diff --git a/apps/deploy-web/package.json b/apps/deploy-web/package.json index 61542ce80..ba2c1cfa9 100644 --- a/apps/deploy-web/package.json +++ b/apps/deploy-web/package.json @@ -24,6 +24,7 @@ "@cosmjs/encoding": "^0.32.4", "@cosmjs/proto-signing": "^0.32.4", "@cosmjs/stargate": "^0.32.4", + "@cosmos-kit/cosmos-extension-metamask": "^0.10.0", "@cosmos-kit/cosmostation-extension": "^2.12.2", "@cosmos-kit/keplr": "^2.12.2", "@cosmos-kit/leap-extension": "^2.12.2", diff --git a/apps/deploy-web/src/context/CustomChainProvider/CustomChainProvider.tsx b/apps/deploy-web/src/context/CustomChainProvider/CustomChainProvider.tsx index 383afe23b..4870b951a 100644 --- a/apps/deploy-web/src/context/CustomChainProvider/CustomChainProvider.tsx +++ b/apps/deploy-web/src/context/CustomChainProvider/CustomChainProvider.tsx @@ -12,17 +12,31 @@ import { useChain } from "@cosmos-kit/react"; import { akash, akashSandbox, akashTestnet, assetLists } from "@src/chains"; import networkStore from "@src/store/networkStore"; import { customRegistry } from "@src/utils/customRegistry"; +import { useEffect, useState } from "react"; +import { CosmosMetamaskExtensionWallet } from "@cosmos-kit/cosmos-extension-metamask"; type Props = { children: React.ReactNode; }; export function CustomChainProvider({ children }: Props) { + const [metamask, setMetamask] = useState([]); + + useEffect(() => { + import("@cosmos-kit/cosmos-extension-metamask").then(module => { + setMetamask(module.wallets); + }); + }, []); + + if (!metamask.length) { + return null; + } + return ( { diff --git a/package-lock.json b/package-lock.json index fa319cb23..d3b2fb8c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -289,6 +289,7 @@ "@cosmjs/encoding": "^0.32.4", "@cosmjs/proto-signing": "^0.32.4", "@cosmjs/stargate": "^0.32.4", + "@cosmos-kit/cosmos-extension-metamask": "^0.10.0", "@cosmos-kit/cosmostation-extension": "^2.12.2", "@cosmos-kit/keplr": "^2.12.2", "@cosmos-kit/leap-extension": "^2.12.2", @@ -625,22 +626,6 @@ "typescript": "^5" } }, - "apps/provider-console/node_modules/@chain-registry/keplr": { - "version": "1.68.2", - "resolved": "https://registry.npmjs.org/@chain-registry/keplr/-/keplr-1.68.2.tgz", - "integrity": "sha512-H3rdf/cLx7bNyyKo+1nI9HpLTlLzyeqi0Rmt+ggwtFRC63ZmDaMg/3vPY4rHvu38OdcaOid4Nyfc+7h3EEPW8Q==", - "dependencies": { - "@chain-registry/types": "^0.45.1", - "@keplr-wallet/cosmos": "0.12.28", - "@keplr-wallet/crypto": "0.12.28", - "semver": "^7.5.0" - } - }, - "apps/provider-console/node_modules/@chain-registry/types": { - "version": "0.45.22", - "resolved": "https://registry.npmjs.org/@chain-registry/types/-/types-0.45.22.tgz", - "integrity": "sha512-6q8/n39/oqjaF2tviKrOTgaxzDlXekPi4T96iceMOBF4tcN8jhcVHq9J3FczpRNeRPL4jpa7w82jRaYiX/LYVg==" - }, "apps/provider-console/node_modules/@cosmjs/crypto": { "version": "0.32.4", "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.32.4.tgz", @@ -3497,6 +3482,24 @@ "resolved": "https://registry.npmjs.org/@chain-registry/types/-/types-0.45.41.tgz", "integrity": "sha512-OCCuqFE5xmjxwe0ardEe+ozKS0NeDOIgqpfjA7TeTQAWkRexty1j5PXZW/1/73C0wJ1/b/GXILsXwSi44w5MzA==" }, + "node_modules/@chain-registry/keplr": { + "version": "1.68.2", + "resolved": "https://registry.npmjs.org/@chain-registry/keplr/-/keplr-1.68.2.tgz", + "integrity": "sha512-H3rdf/cLx7bNyyKo+1nI9HpLTlLzyeqi0Rmt+ggwtFRC63ZmDaMg/3vPY4rHvu38OdcaOid4Nyfc+7h3EEPW8Q==", + "license": "SEE LICENSE IN LICENSE", + "dependencies": { + "@chain-registry/types": "^0.45.1", + "@keplr-wallet/cosmos": "0.12.28", + "@keplr-wallet/crypto": "0.12.28", + "semver": "^7.5.0" + } + }, + "node_modules/@chain-registry/keplr/node_modules/@chain-registry/types": { + "version": "0.45.55", + "resolved": "https://registry.npmjs.org/@chain-registry/types/-/types-0.45.55.tgz", + "integrity": "sha512-uy7DQzLgxLOoVL5EyNUUUvftcoJznij06sXVUavdO/4w8HPFTpuAibY9aB7u/ILpIvirQsa6czMRIuWkRQdHEw==", + "license": "SEE LICENSE IN LICENSE" + }, "node_modules/@chain-registry/types": { "version": "0.41.4", "resolved": "https://registry.npmjs.org/@chain-registry/types/-/types-0.41.4.tgz", @@ -4479,6 +4482,116 @@ "xstream": "^11.14.0" } }, + "node_modules/@cosmos-kit/cosmos-extension-metamask": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@cosmos-kit/cosmos-extension-metamask/-/cosmos-extension-metamask-0.10.0.tgz", + "integrity": "sha512-Ii+1MnVDXECjlLH3djer0GORa/R23dgv6fyKPiXhoE0tynzLTlWcwC4OGHZUxgQIpRdTATshivuZEGVvdV+ctA==", + "license": "SEE LICENSE IN LICENSE", + "dependencies": { + "@chain-registry/keplr": "1.68.2", + "@cosmos-kit/core": "^2.13.1", + "@cosmsnap/snapper": "^0.2.5", + "cosmjs-types": ">=0.9.0" + }, + "peerDependencies": { + "@cosmjs/amino": ">=0.32.3", + "@cosmjs/proto-signing": ">=0.32.3" + } + }, + "node_modules/@cosmos-kit/cosmos-extension-metamask/node_modules/@cosmjs/crypto": { + "version": "0.31.3", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.31.3.tgz", + "integrity": "sha512-vRbvM9ZKR2017TO73dtJ50KxoGcFzKtKI7C8iO302BQ5p+DuB+AirUg1952UpSoLfv5ki9O416MFANNg8UN/EQ==", + "license": "Apache-2.0", + "dependencies": { + "@cosmjs/encoding": "^0.31.3", + "@cosmjs/math": "^0.31.3", + "@cosmjs/utils": "^0.31.3", + "@noble/hashes": "^1", + "bn.js": "^5.2.0", + "elliptic": "^6.5.4", + "libsodium-wrappers-sumo": "^0.7.11" + } + }, + "node_modules/@cosmos-kit/cosmos-extension-metamask/node_modules/@cosmjs/encoding": { + "version": "0.31.3", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.31.3.tgz", + "integrity": "sha512-6IRtG0fiVYwyP7n+8e54uTx2pLYijO48V3t9TLiROERm5aUAIzIlz6Wp0NYaI5he9nh1lcEGJ1lkquVKFw3sUg==", + "license": "Apache-2.0", + "dependencies": { + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" + } + }, + "node_modules/@cosmos-kit/cosmos-extension-metamask/node_modules/@cosmjs/math": { + "version": "0.31.3", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.31.3.tgz", + "integrity": "sha512-kZ2C6glA5HDb9hLz1WrftAjqdTBb3fWQsRR+Us2HsjAYdeE6M3VdXMsYCP5M3yiihal1WDwAY2U7HmfJw7Uh4A==", + "license": "Apache-2.0", + "dependencies": { + "bn.js": "^5.2.0" + } + }, + "node_modules/@cosmos-kit/cosmos-extension-metamask/node_modules/@cosmjs/utils": { + "version": "0.31.3", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.31.3.tgz", + "integrity": "sha512-VBhAgzrrYdIe0O5IbKRqwszbQa7ZyQLx9nEQuHQ3HUplQW7P44COG/ye2n6AzCudtqxmwdX7nyX8ta1J07GoqA==", + "license": "Apache-2.0" + }, + "node_modules/@cosmos-kit/cosmos-extension-metamask/node_modules/@cosmsnap/snapper": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/@cosmsnap/snapper/-/snapper-0.2.6.tgz", + "integrity": "sha512-6tuFgCOlfT/5kX2rNHeeTE3Ltx7I23q4EegMiLLsrm3FRDzr0xj7Q8w5PVlW9wPicpGz9FmbE8bK6yIAjmIlkg==", + "license": "MIT", + "dependencies": { + "@cosmjs/amino": "^0.31.3", + "@keplr-wallet/proto-types": "0.12.12", + "@keplr-wallet/types": "0.12.12", + "appwrite": "^14.0.0", + "ses": "^0.18.4" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@cosmos-kit/cosmos-extension-metamask/node_modules/@cosmsnap/snapper/node_modules/@cosmjs/amino": { + "version": "0.31.3", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.31.3.tgz", + "integrity": "sha512-36emtUq895sPRX8PTSOnG+lhJDCVyIcE0Tr5ct59sUbgQiI14y43vj/4WAlJ/utSOxy+Zhj9wxcs4AZfu0BHsw==", + "license": "Apache-2.0", + "dependencies": { + "@cosmjs/crypto": "^0.31.3", + "@cosmjs/encoding": "^0.31.3", + "@cosmjs/math": "^0.31.3", + "@cosmjs/utils": "^0.31.3" + } + }, + "node_modules/@cosmos-kit/cosmos-extension-metamask/node_modules/@keplr-wallet/proto-types": { + "version": "0.12.12", + "resolved": "https://registry.npmjs.org/@keplr-wallet/proto-types/-/proto-types-0.12.12.tgz", + "integrity": "sha512-iAqqNlJpxu/8j+SwOXEH2ymM4W0anfxn+eNeWuqz2c/0JxGTWeLURioxQmCtewtllfHdDHHcoQ7/S+NmXiaEgQ==", + "license": "Apache-2.0", + "dependencies": { + "long": "^4.0.0", + "protobufjs": "^6.11.2" + } + }, + "node_modules/@cosmos-kit/cosmos-extension-metamask/node_modules/@keplr-wallet/types": { + "version": "0.12.12", + "resolved": "https://registry.npmjs.org/@keplr-wallet/types/-/types-0.12.12.tgz", + "integrity": "sha512-fo6b8j9EXnJukGvZorifJWEm1BPIrvaTLuu5PqaU5k1ANDasm/FL1NaUuaTBVvhRjINtvVXqYpW/rVUinA9MBA==", + "license": "Apache-2.0", + "dependencies": { + "long": "^4.0.0" + } + }, + "node_modules/@cosmos-kit/cosmos-extension-metamask/node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", + "license": "Apache-2.0" + }, "node_modules/@cosmos-kit/cosmostation-extension": { "version": "2.13.0", "resolved": "https://registry.npmjs.org/@cosmos-kit/cosmostation-extension/-/cosmostation-extension-2.13.0.tgz", @@ -4640,22 +4753,6 @@ "@cosmjs/proto-signing": ">=0.32.3" } }, - "node_modules/@cosmos-kit/leap-extension/node_modules/@chain-registry/keplr": { - "version": "1.68.2", - "resolved": "https://registry.npmjs.org/@chain-registry/keplr/-/keplr-1.68.2.tgz", - "integrity": "sha512-H3rdf/cLx7bNyyKo+1nI9HpLTlLzyeqi0Rmt+ggwtFRC63ZmDaMg/3vPY4rHvu38OdcaOid4Nyfc+7h3EEPW8Q==", - "dependencies": { - "@chain-registry/types": "^0.45.1", - "@keplr-wallet/cosmos": "0.12.28", - "@keplr-wallet/crypto": "0.12.28", - "semver": "^7.5.0" - } - }, - "node_modules/@cosmos-kit/leap-extension/node_modules/@chain-registry/types": { - "version": "0.45.41", - "resolved": "https://registry.npmjs.org/@chain-registry/types/-/types-0.45.41.tgz", - "integrity": "sha512-OCCuqFE5xmjxwe0ardEe+ozKS0NeDOIgqpfjA7TeTQAWkRexty1j5PXZW/1/73C0wJ1/b/GXILsXwSi44w5MzA==" - }, "node_modules/@cosmos-kit/react": { "version": "2.18.0", "resolved": "https://registry.npmjs.org/@cosmos-kit/react/-/react-2.18.0.tgz", @@ -22545,6 +22642,45 @@ "integrity": "sha512-Quji6+8kLBC3NnBeo14nPDq0+2jUs5s3/xEye+udFHumHhRk4M7aAMXp/PBJqkKYGuuyR9M/6Dq7d2AViiGmhw==", "peer": true }, + "node_modules/appwrite": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/appwrite/-/appwrite-14.0.1.tgz", + "integrity": "sha512-ORlvfqVif/2K3qKGgGiGfMP33Zwm+xxB1fIC4Lm3sojOkDd8u8YvgKQO0Meq5UXb8Dc0Rl66Z7qlGBAfRQ04bA==", + "license": "BSD-3-Clause", + "dependencies": { + "cross-fetch": "3.1.5", + "isomorphic-form-data": "2.0.0" + } + }, + "node_modules/appwrite/node_modules/cross-fetch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", + "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "license": "MIT", + "dependencies": { + "node-fetch": "2.6.7" + } + }, + "node_modules/appwrite/node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/arg": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", @@ -31417,6 +31553,29 @@ "node": ">=0.10.0" } }, + "node_modules/isomorphic-form-data": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isomorphic-form-data/-/isomorphic-form-data-2.0.0.tgz", + "integrity": "sha512-TYgVnXWeESVmQSg4GLVbalmQ+B4NPi/H4eWxqALKj63KsUrcu301YDjBqaOw3h+cbak7Na4Xyps3BiptHtxTfg==", + "license": "MIT", + "dependencies": { + "form-data": "^2.3.2" + } + }, + "node_modules/isomorphic-form-data/node_modules/form-data": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, "node_modules/isomorphic-unfetch": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/isomorphic-unfetch/-/isomorphic-unfetch-3.1.0.tgz",