Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/blocto #117

Open
wants to merge 6 commits into
base: main-v-2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ape.swap/uikit",
"version": "1.3.35",
"version": "1.3.37-alpha.0",
"description": "Set of UI components for apeswap projects",
"main": "dist/index.cjs.js",
"resolutions": {
Expand Down Expand Up @@ -87,6 +87,7 @@
"styled-components": "^5.2.0"
},
"dependencies": {
"@blocto/blocto-connector": "^0.2.3",
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.8.1",
"@mdx-js/react": "1.6.22",
Expand Down
35 changes: 35 additions & 0 deletions src/__tests__/widgets/walletmodal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,41 @@ it("renders ConnectModal correctly", () => {
</defs>
</svg>

</button>
<button
class="css-1l1jss8-WalletCard"
id="wallet-connect-"
>
<span
class="css-oe19h8-WalletCard"
/>
<svg
class="sc-bdfBQB kA-DbXw"
color="text"
viewBox="0 0 128 128"
width="32px"
xmlns="http://www.w3.org/2000/svg"
>
<rect
fill="white"
height="128"
rx="64"
width="128"
/>
<path
d="M24.3498 61.285C24.1107 61.2847 23.8742 61.3343 23.6554 61.4306C23.4366 61.527 23.2403 61.6679 23.0791 61.8445C22.918 62.0211 22.7954 62.2293 22.7193 62.456C22.6433 62.6827 22.6154 62.9227 22.6374 63.1608C23.2966 69.9607 26.464 76.2716 31.5225 80.8634C36.581 85.4553 43.168 87.9991 49.9998 87.9991C56.8316 87.9991 63.4186 85.4553 68.4771 80.8634C73.5355 76.2716 76.703 69.9607 77.3621 63.1608C77.3842 62.9227 77.3563 62.6827 77.2802 62.456C77.2042 62.2293 77.0816 62.0211 76.9204 61.8445C76.7592 61.6679 76.563 61.527 76.3442 61.4306C76.1254 61.3343 75.8888 61.2847 75.6498 61.285H24.3498Z"
fill="#ADD3F0"
/>
<path
d="M24.3497 12.5724C30.6851 12.5724 36.7609 15.0891 41.2407 19.5688C45.7204 24.0486 48.2371 30.1244 48.2371 36.4597V55.8211C48.2371 56.2759 48.0564 56.7121 47.7348 57.0337C47.4132 57.3553 46.977 57.5359 46.5222 57.5359H24.3497C23.8949 57.5359 23.4588 57.3553 23.1372 57.0337C22.8156 56.7121 22.6349 56.2759 22.6349 55.8211V14.2872C22.6349 13.8324 22.8156 13.3963 23.1372 13.0747C23.4588 12.7531 23.8949 12.5724 24.3497 12.5724Z"
fill="#1C2D66"
/>
<path
d="M53.6936 33.1909H54.8226C57.7835 33.1909 60.7154 33.7741 63.451 34.9072C66.1865 36.0403 68.6721 37.7011 70.7658 39.7948C72.8595 41.8885 74.5203 44.3741 75.6534 47.1096C76.7865 49.8452 77.3697 52.7771 77.3697 55.7381V55.821C77.3697 56.2759 77.189 56.712 76.8674 57.0336C76.5458 57.3552 76.1097 57.5359 75.6549 57.5359H62.9845C60.0649 57.5359 57.2649 56.3761 55.2005 54.3116C53.136 52.2472 51.9762 49.4472 51.9762 46.5276V34.8957C51.9789 34.4422 52.161 34.0082 52.4829 33.6887C52.8048 33.3692 53.2401 33.1902 53.6936 33.1909Z"
fill="#347EB8"
/>
</svg>

</button>
<button
class="css-1l1jss8-WalletCard"
Expand Down
6 changes: 6 additions & 0 deletions src/widgets/WalletModal/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import TorusWallet from "./icons/SocialLogin";
import Coinbase from "./icons/Coinbase";
import Unstoppable from "./icons/Unstoppable";
import Bitkeep from "./icons/Bitkeep";
import Blocto from "./icons/Blocto";
import { Config, ConnectorNames } from "./types";

const connectors: Config[] = [
Expand Down Expand Up @@ -55,6 +56,11 @@ const connectors: Config[] = [
icon: Coinbase,
connectorId: ConnectorNames.Walletlink,
},
{
title: "Blocto",
icon: Blocto,
connectorId: ConnectorNames.Blocto,
},
{
title: "Binance Chain Wallet",
icon: BinanceChain,
Expand Down
25 changes: 25 additions & 0 deletions src/widgets/WalletModal/icons/Blocto.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from "react";
import LegacySvg from "../../../components/Svg/LegacySvg";
import { LegacySvgProps } from "../../../components/Svg/types";

const Icon: React.FC<LegacySvgProps> = (props) => {
return (
<LegacySvg viewBox="0 0 128 128" {...props}>
<rect width="128" height="128" rx="64" fill="white" />
<path
d="M24.3498 61.285C24.1107 61.2847 23.8742 61.3343 23.6554 61.4306C23.4366 61.527 23.2403 61.6679 23.0791 61.8445C22.918 62.0211 22.7954 62.2293 22.7193 62.456C22.6433 62.6827 22.6154 62.9227 22.6374 63.1608C23.2966 69.9607 26.464 76.2716 31.5225 80.8634C36.581 85.4553 43.168 87.9991 49.9998 87.9991C56.8316 87.9991 63.4186 85.4553 68.4771 80.8634C73.5355 76.2716 76.703 69.9607 77.3621 63.1608C77.3842 62.9227 77.3563 62.6827 77.2802 62.456C77.2042 62.2293 77.0816 62.0211 76.9204 61.8445C76.7592 61.6679 76.563 61.527 76.3442 61.4306C76.1254 61.3343 75.8888 61.2847 75.6498 61.285H24.3498Z"
fill="#ADD3F0"
/>
<path
d="M24.3497 12.5724C30.6851 12.5724 36.7609 15.0891 41.2407 19.5688C45.7204 24.0486 48.2371 30.1244 48.2371 36.4597V55.8211C48.2371 56.2759 48.0564 56.7121 47.7348 57.0337C47.4132 57.3553 46.977 57.5359 46.5222 57.5359H24.3497C23.8949 57.5359 23.4588 57.3553 23.1372 57.0337C22.8156 56.7121 22.6349 56.2759 22.6349 55.8211V14.2872C22.6349 13.8324 22.8156 13.3963 23.1372 13.0747C23.4588 12.7531 23.8949 12.5724 24.3497 12.5724Z"
fill="#1C2D66"
/>
<path
d="M53.6936 33.1909H54.8226C57.7835 33.1909 60.7154 33.7741 63.451 34.9072C66.1865 36.0403 68.6721 37.7011 70.7658 39.7948C72.8595 41.8885 74.5203 44.3741 75.6534 47.1096C76.7865 49.8452 77.3697 52.7771 77.3697 55.7381V55.821C77.3697 56.2759 77.189 56.712 76.8674 57.0336C76.5458 57.3552 76.1097 57.5359 75.6549 57.5359H62.9845C60.0649 57.5359 57.2649 56.3761 55.2005 54.3116C53.136 52.2472 51.9762 49.4472 51.9762 46.5276V34.8957C51.9789 34.4422 52.161 34.0082 52.4829 33.6887C52.8048 33.3692 53.2401 33.1902 53.6936 33.1909Z"
fill="#347EB8"
/>
</LegacySvg>
);
};

export default Icon;
1 change: 1 addition & 0 deletions src/widgets/WalletModal/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export enum ConnectorNames {
Walletlink = "Walletlink",
Unstoppable = "Unstoppable",
Torus = "Torus",
Blocto = "Blocto",
}

export type Login = (connectorId: ConnectorNames) => void;
Expand Down
86 changes: 85 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,26 @@
"@web3-react/walletlink-connector" "^6.1.1"
jsbi "^3.1.1"

"@blocto/blocto-connector@^0.2.3":
version "0.2.3"
resolved "https://registry.yarnpkg.com/@blocto/blocto-connector/-/blocto-connector-0.2.3.tgz#24831336006c25826f63c65307fa4347728896c9"
integrity sha512-TMvkp0+MjQWPOzVT3d1+FP2dNiDUWKrDUBVHPOqcwxlqWCT6Xb7HBfCZFc4T+rNpV+HOc4nSuGcZ4AEaAYSbvg==
dependencies:
"@blocto/sdk" "^0.2.13"
"@web3-react/abstract-connector" "^6.0.7"
"@web3-react/types" "^6.0.7"
tiny-invariant "^1.1.0"

"@blocto/sdk@^0.2.13":
version "0.2.22"
resolved "https://registry.yarnpkg.com/@blocto/sdk/-/sdk-0.2.22.tgz#c7fe62809de0640a0a3f7a043c5bbceb8be17e38"
integrity sha512-Ro1AiISSlOiri/It932NEFxnDuF83Ide+z0p3KHs5+CdYYLYgCMmyroQnfRtoh3mbXdrTvI+EAuSkr+meWNqrg==
dependencies:
bs58 "^4.0.1"
buffer "^6.0.3"
eip1193-provider "^1.0.1"
js-sha3 "^0.8.0"

"@chaitanyapotti/random-id@^1.0.3":
version "1.0.3"
resolved "https://registry.yarnpkg.com/@chaitanyapotti/random-id/-/random-id-1.0.3.tgz#f52f647cfe9f79fc7723ea2b01b0ad3889204002"
Expand Down Expand Up @@ -2001,6 +2021,31 @@
"@types/yargs" "^16.0.0"
chalk "^4.0.0"

"@json-rpc-tools/provider@^1.5.5":
version "1.7.6"
resolved "https://registry.yarnpkg.com/@json-rpc-tools/provider/-/provider-1.7.6.tgz#8a17c34c493fa892632e278fd9331104e8491ec6"
integrity sha512-z7D3xvJ33UfCGv77n40lbzOYjZKVM3k2+5cV7xS8G6SCvKTzMkhkUYuD/qzQUNT4cG/lv0e9mRToweEEVLVVmA==
dependencies:
"@json-rpc-tools/utils" "^1.7.6"
axios "^0.21.0"
safe-json-utils "^1.1.1"
ws "^7.4.0"

"@json-rpc-tools/types@^1.7.6":
version "1.7.6"
resolved "https://registry.yarnpkg.com/@json-rpc-tools/types/-/types-1.7.6.tgz#5abd5fde01364a130c46093b501715bcce5bdc0e"
integrity sha512-nDSqmyRNEqEK9TZHtM15uNnDljczhCUdBmRhpNZ95bIPKEDQ+nTDmGMFd2lLin3upc5h2VVVd9tkTDdbXUhDIQ==
dependencies:
keyvaluestorage-interface "^1.0.0"

"@json-rpc-tools/utils@^1.7.6":
version "1.7.6"
resolved "https://registry.yarnpkg.com/@json-rpc-tools/utils/-/utils-1.7.6.tgz#67f04987dbaa2e7adb6adff1575367b75a9a9ba1"
integrity sha512-HjA8x/U/Q78HRRe19yh8HVKoZ+Iaoo3YZjakJYxR+rw52NHo6jM+VE9b8+7ygkCFXl/EHID5wh/MkXaE/jGyYw==
dependencies:
"@json-rpc-tools/types" "^1.7.6"
"@pedrouid/environment" "^1.0.1"

"@mdx-js/loader@^1.6.22":
version "1.6.22"
resolved "https://registry.yarnpkg.com/@mdx-js/loader/-/loader-1.6.22.tgz#d9e8fe7f8185ff13c9c8639c048b123e30d322c4"
Expand Down Expand Up @@ -2115,6 +2160,11 @@
mkdirp "^1.0.4"
rimraf "^3.0.2"

"@pedrouid/environment@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@pedrouid/environment/-/environment-1.0.1.tgz#858f0f8a057340e0b250398b75ead77d6f4342ec"
integrity sha512-HaW78NszGzRZd9SeoI3JD11JqY+lubnaOx7Pewj5pfjqWXOEATpeKIFb9Z4t2WBUK2iryiXX3lzWwmYWgUL0Ug==

"@pmmmwh/react-refresh-webpack-plugin@^0.4.3":
version "0.4.3"
resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.4.3.tgz#1eec460596d200c0236bf195b078a5d1df89b766"
Expand Down Expand Up @@ -4960,6 +5010,13 @@ axios@^0.18.0:
follow-redirects "1.5.10"
is-buffer "^2.0.2"

axios@^0.21.0:
version "0.21.4"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575"
integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==
dependencies:
follow-redirects "^1.14.0"

axobject-query@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be"
Expand Down Expand Up @@ -6004,7 +6061,7 @@ [email protected]:
dependencies:
fast-json-stable-stringify "2.x"

bs58@^4.0.0:
bs58@^4.0.0, bs58@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a"
integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo=
Expand Down Expand Up @@ -7690,6 +7747,13 @@ [email protected]:
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=

eip1193-provider@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/eip1193-provider/-/eip1193-provider-1.0.1.tgz#420d29cf4f6c443e3f32e718fb16fafb250637c3"
integrity sha512-kSuqwQ26d7CzuS/t3yRXo2Su2cVH0QfvyKbr2H7Be7O5YDyIq4hQGCNTo5wRdP07bt+E2R/8nPCzey4ojBHf7g==
dependencies:
"@json-rpc-tools/provider" "^1.5.5"

electron-to-chromium@^1.3.47, electron-to-chromium@^1.3.564, electron-to-chromium@^1.3.854:
version "1.3.855"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.855.tgz#bfc75867d6aaf19f0d40ab02f0b1f60ad6866b02"
Expand Down Expand Up @@ -9227,6 +9291,11 @@ [email protected]:
dependencies:
debug "=3.1.0"

follow-redirects@^1.14.0:
version "1.15.2"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13"
integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==

for-each@~0.3.3:
version "0.3.3"
resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e"
Expand Down Expand Up @@ -15294,6 +15363,11 @@ safe-event-emitter@^1.0.1:
dependencies:
events "^3.0.0"

safe-json-utils@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/safe-json-utils/-/safe-json-utils-1.1.1.tgz#0e883874467d95ab914c3f511096b89bfb3e63b1"
integrity sha512-SAJWGKDs50tAbiDXLf89PDwt9XYkWyANFWVzn4dTXl5QyI8t2o/bW5/OJl3lvc2WVU4MEpTo9Yz5NVFNsp+OJQ==

safe-regex@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e"
Expand Down Expand Up @@ -16607,6 +16681,11 @@ tiny-invariant@^1.0.2, tiny-invariant@^1.0.6:
resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.1.0.tgz#634c5f8efdc27714b7f386c35e6760991d230875"
integrity sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw==

tiny-invariant@^1.1.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.2.0.tgz#a1141f86b672a9148c72e978a19a73b9b94a15a9"
integrity sha512-1Uhn/aqw5C6RI4KejVeTg6mIS7IqxnLJ8Mv2tV5rTc0qWobay7pDUz6Wi392Cnc8ak1H0F2cjoRzb2/AW4+Fvg==

tiny-warning@^1.0.0, tiny-warning@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754"
Expand Down Expand Up @@ -17960,6 +18039,11 @@ ws@^5.1.1:
dependencies:
async-limiter "~1.0.0"

ws@^7.4.0:
version "7.5.9"
resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591"
integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==

ws@^7.4.6:
version "7.5.5"
resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.5.tgz#8b4bc4af518cfabd0473ae4f99144287b33eb881"
Expand Down