From 62a811645b4bc3959cf1c4558cb466cc0a6a84b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Freitas?= Date: Tue, 25 Jul 2023 19:08:06 +0100 Subject: [PATCH] support custom wallets on react --- package-lock.json | 416 +-------------------------- packages/react/package.json | 2 +- packages/react/src/WalletContext.tsx | 11 +- 3 files changed, 12 insertions(+), 417 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0e58a9ba5..cb58d747e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27117,7 +27117,7 @@ "version": "0.4.0-beta.0", "license": "MIT", "dependencies": { - "@mintbase-js/auth": "0.3.2-upgrade-packages-3378beb.0", + "@mintbase-js/auth": "0.4.0-beta.0", "@mintbase-js/data": "0.4.0-beta.0", "@mintbase-js/sdk": "0.4.0-beta.0", "@near-wallet-selector/core": "^8.0.3", @@ -27131,100 +27131,6 @@ "@testing-library/user-event": "^14.4.3" } }, - "packages/react/node_modules/@here-wallet/core": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/@here-wallet/core/-/core-1.4.3.tgz", - "integrity": "sha512-HtiAd1gMKxFzbnSualrzAw9CuoGWdY9z8aCY5fkpst+z7Fa5yVvBIg+f/6BWn2PFdxIWEnKk8V051FHEX/iYxA==", - "dependencies": { - "sha1": "^1.1.1", - "uuid4": "2.0.3" - }, - "peerDependencies": { - "bn.js": "5.2.1", - "borsh": "0.7.0", - "near-api-js": "^2.1.1" - } - }, - "packages/react/node_modules/@mintbase-js/auth": { - "version": "0.3.2-upgrade-packages-3378beb.0", - "resolved": "https://registry.npmjs.org/@mintbase-js/auth/-/auth-0.3.2-upgrade-packages-3378beb.0.tgz", - "integrity": "sha512-tpx1VpEPMvuhG9MYD9A6RuS0SBFFIt91L5qSj8jfswLrd9e7ZLUu9RwSlptpWf6d/Qr5xXlqfE8yMF4o79r+SQ==", - "dependencies": { - "@mintbase-js/sdk": "^0.3.2-upgrade-packages-8d232aa.0", - "@near-wallet-selector/core": "^8.0.3", - "@near-wallet-selector/default-wallets": "^8.0.3", - "@near-wallet-selector/here-wallet": "^8.0.3", - "@near-wallet-selector/ledger": "^8.0.3", - "@near-wallet-selector/meteor-wallet": "^8.0.3", - "@near-wallet-selector/modal-ui": "^8.0.3", - "@near-wallet-selector/my-near-wallet": "*", - "@near-wallet-selector/near-wallet": "^8.0.3", - "@near-wallet-selector/sender": "^8.0.3", - "@near-wallet-selector/wallet-connect": "^8.0.3", - "bs58": "^5.0.0", - "isomorphic-textencoder": "^1.0.1", - "js-sha256": "^0.9.0", - "rxjs": "^7.5.7" - } - }, - "packages/react/node_modules/@mintbase-js/auth/node_modules/@mintbase-js/sdk": { - "version": "0.3.2-zero-balance-test-poc-cd787c2.0", - "resolved": "https://registry.npmjs.org/@mintbase-js/sdk/-/sdk-0.3.2-zero-balance-test-poc-cd787c2.0.tgz", - "integrity": "sha512-8FIaDy030+Mr5eiKiCZJQ45jRvF0Ur4y4h6V1YSixsPDwwFZtlSP0fTqROLZyPeKcVh4s7WUj/4HlToucwuIbw==", - "dependencies": { - "bn.js": "5.2.1", - "near-api-js": "^0.44.2" - } - }, - "packages/react/node_modules/@mintbase-js/auth/node_modules/borsh": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.6.0.tgz", - "integrity": "sha512-sl5k89ViqsThXQpYa9XDtz1sBl3l1lI313cFUY1HKr+wvMILnb+58xpkqTNrYbelh99dY7K8usxoCusQmqix9Q==", - "dependencies": { - "bn.js": "^5.2.0", - "bs58": "^4.0.0", - "text-encoding-utf-8": "^1.0.2" - } - }, - "packages/react/node_modules/@mintbase-js/auth/node_modules/borsh/node_modules/bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "dependencies": { - "base-x": "^3.0.2" - } - }, - "packages/react/node_modules/@mintbase-js/auth/node_modules/near-api-js": { - "version": "0.44.2", - "resolved": "https://registry.npmjs.org/near-api-js/-/near-api-js-0.44.2.tgz", - "integrity": "sha512-eMnc4V+geggapEUa3nU2p8HSHn/njtloI4P2mceHQWO8vDE1NGpnAw8FuTBrLmXSgIv9m6oocgFc9t3VNf5zwg==", - "dependencies": { - "bn.js": "5.2.0", - "borsh": "^0.6.0", - "bs58": "^4.0.0", - "depd": "^2.0.0", - "error-polyfill": "^0.1.3", - "http-errors": "^1.7.2", - "js-sha256": "^0.9.0", - "mustache": "^4.0.0", - "node-fetch": "^2.6.1", - "text-encoding-utf-8": "^1.0.2", - "tweetnacl": "^1.0.1" - } - }, - "packages/react/node_modules/@mintbase-js/auth/node_modules/near-api-js/node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" - }, - "packages/react/node_modules/@mintbase-js/auth/node_modules/near-api-js/node_modules/bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "dependencies": { - "base-x": "^3.0.2" - } - }, "packages/react/node_modules/@near-wallet-selector/core": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/@near-wallet-selector/core/-/core-8.0.3.tgz", @@ -27236,60 +27142,6 @@ "near-api-js": "^1.0.0 || ^2.0.0" } }, - "packages/react/node_modules/@near-wallet-selector/here-wallet": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@near-wallet-selector/here-wallet/-/here-wallet-8.0.3.tgz", - "integrity": "sha512-UuilyD7CFyXciUXWFEU36GrdV9AyIvgsUj4MVWx79sCaJe++Q3staI2Bhqg05zW2CjSCujywP4RiZ8OJ9CW+ew==", - "dependencies": { - "@here-wallet/core": "^1.4.3", - "@near-wallet-selector/core": "8.0.3", - "bn.js": "^5.2.0" - }, - "peerDependencies": { - "near-api-js": "^1.0.0 || ^2.0.0" - } - }, - "packages/react/node_modules/@near-wallet-selector/ledger": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@near-wallet-selector/ledger/-/ledger-8.0.3.tgz", - "integrity": "sha512-q+rpF7fEQ1n5TnStpWjGHa8CFkhwwcnUOGwVLYZYGnnSHqwARnae0jfNi+W7c56oJPlz9A8K3Dblpjwa8T5tkg==", - "dependencies": { - "@ledgerhq/hw-transport": "6.27.1", - "@ledgerhq/hw-transport-webhid": "6.27.1", - "@near-wallet-selector/core": "8.0.3", - "@near-wallet-selector/wallet-utils": "8.0.3", - "bn.js": "^5.2.0", - "is-mobile": "^3.1.1" - }, - "peerDependencies": { - "near-api-js": "^1.0.0 || ^2.0.0" - } - }, - "packages/react/node_modules/@near-wallet-selector/meteor-wallet": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@near-wallet-selector/meteor-wallet/-/meteor-wallet-8.0.3.tgz", - "integrity": "sha512-7GKRBNibm9zkcoDhoELPivELFLgE2Jy8r7bjPfza3ApsClQn2mp0Iy3u68Y/Ke3Bcbr6I7S30oaKUMjNRo7hGw==", - "dependencies": { - "@meteorwallet/sdk": "^0.6.0", - "@near-wallet-selector/core": "8.0.3", - "@near-wallet-selector/wallet-utils": "8.0.3" - }, - "peerDependencies": { - "near-api-js": "^1.0.0 || ^2.0.0" - } - }, - "packages/react/node_modules/@near-wallet-selector/meteor-wallet/node_modules/@meteorwallet/sdk": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@meteorwallet/sdk/-/sdk-0.6.0.tgz", - "integrity": "sha512-oriaQ1gk1hpQx6V6BxsvUthDd0Bpmv3ho5Ap5pm9P0euEosWtFUVF1dTYndJE10qBG8yLW+EOOX1LZ8taXCiRA==", - "dependencies": { - "nanoid": "3.3.4", - "query-string": "^7.1.1" - }, - "peerDependencies": { - "near-api-js": "^0.44.2 || ^1.0.0" - } - }, "packages/react/node_modules/@near-wallet-selector/modal-ui": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/@near-wallet-selector/modal-ui/-/modal-ui-8.0.3.tgz", @@ -27302,68 +27154,6 @@ "react-dom": "18.2.0" } }, - "packages/react/node_modules/@near-wallet-selector/my-near-wallet": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@near-wallet-selector/my-near-wallet/-/my-near-wallet-8.0.3.tgz", - "integrity": "sha512-elYQZBQ/tGM4NHQ/ufuRmajDzHFFFciE7IPo1UTIZWw2lTCOADnRnBEb1aqqY+ThUrmtc0IuBC2SOtdLkjOMyQ==", - "dependencies": { - "@near-wallet-selector/core": "8.0.3", - "@near-wallet-selector/wallet-utils": "8.0.3" - }, - "peerDependencies": { - "near-api-js": "^1.0.0 || ^2.0.0" - } - }, - "packages/react/node_modules/@near-wallet-selector/near-wallet": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@near-wallet-selector/near-wallet/-/near-wallet-8.0.3.tgz", - "integrity": "sha512-t2q3XPjS4CA9W8oYuL4JrlURakZ+rZkJZjJcP03afNMr13PFIXMq41olSLfNu+jPyoOD8g4a2yZBph80CjMcjQ==", - "dependencies": { - "@near-wallet-selector/core": "8.0.3", - "@near-wallet-selector/my-near-wallet": "8.0.3" - }, - "peerDependencies": { - "near-api-js": "^1.0.0 || ^2.0.0" - } - }, - "packages/react/node_modules/@near-wallet-selector/sender": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@near-wallet-selector/sender/-/sender-8.0.3.tgz", - "integrity": "sha512-C9B+AVcxKQ5LC5FOtEJCZYcH8HRUgDcbD+keBzVdFhi2SbG2WS5V4+cKMrf/CXCTESqnZ+spZKdDt4Dypi4bwA==", - "dependencies": { - "@near-wallet-selector/core": "8.0.3", - "is-mobile": "^3.1.1" - }, - "peerDependencies": { - "near-api-js": "^1.0.0 || ^2.0.0" - } - }, - "packages/react/node_modules/@near-wallet-selector/wallet-connect": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@near-wallet-selector/wallet-connect/-/wallet-connect-8.0.3.tgz", - "integrity": "sha512-HE6ijbhjq3BuLU+7yKVkCN679PRsltZxOamimSYtTgS/gDrl2XUJn10UKAiIeIKPyYknI/946q+kq+WkUuQ6Ng==", - "dependencies": { - "@near-wallet-selector/core": "8.0.3", - "@near-wallet-selector/wallet-utils": "8.0.3", - "@walletconnect/sign-client": "2.5.2", - "@web3modal/standalone": "^2.2.2" - }, - "peerDependencies": { - "near-api-js": "^1.0.0 || ^2.0.0" - } - }, - "packages/react/node_modules/@near-wallet-selector/wallet-utils": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@near-wallet-selector/wallet-utils/-/wallet-utils-8.0.3.tgz", - "integrity": "sha512-KciRo2TERtqEQL1tnNmBZi6srMeDJkOPnGOkdPeQjg8fT0xSH7+hGZjOz6nSOLEP0/059so8aWo30uHN7wBVmA==", - "dependencies": { - "@near-wallet-selector/core": "8.0.3", - "bn.js": "^5.2.0" - }, - "peerDependencies": { - "near-api-js": "^1.0.0 || ^2.0.0" - } - }, "packages/react/node_modules/ajv": { "version": "8.12.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", @@ -27410,17 +27200,6 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, - "packages/react/node_modules/nanoid": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", - "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, "packages/react/node_modules/near-api-js": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/near-api-js/-/near-api-js-2.1.3.tgz", @@ -31499,7 +31278,7 @@ "@mintbase-js/react": { "version": "file:packages/react", "requires": { - "@mintbase-js/auth": "0.3.2-upgrade-packages-3378beb.0", + "@mintbase-js/auth": "0.4.0-beta.0", "@mintbase-js/data": "0.4.0-beta.0", "@mintbase-js/sdk": "0.4.0-beta.0", "@near-wallet-selector/core": "^8.0.3", @@ -31511,101 +31290,6 @@ "react-dom": "^18.2.0" }, "dependencies": { - "@here-wallet/core": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/@here-wallet/core/-/core-1.4.3.tgz", - "integrity": "sha512-HtiAd1gMKxFzbnSualrzAw9CuoGWdY9z8aCY5fkpst+z7Fa5yVvBIg+f/6BWn2PFdxIWEnKk8V051FHEX/iYxA==", - "requires": { - "sha1": "^1.1.1", - "uuid4": "2.0.3" - } - }, - "@mintbase-js/auth": { - "version": "0.3.2-upgrade-packages-3378beb.0", - "resolved": "https://registry.npmjs.org/@mintbase-js/auth/-/auth-0.3.2-upgrade-packages-3378beb.0.tgz", - "integrity": "sha512-tpx1VpEPMvuhG9MYD9A6RuS0SBFFIt91L5qSj8jfswLrd9e7ZLUu9RwSlptpWf6d/Qr5xXlqfE8yMF4o79r+SQ==", - "requires": { - "@mintbase-js/sdk": "^0.3.2-upgrade-packages-8d232aa.0", - "@near-wallet-selector/core": "^8.0.3", - "@near-wallet-selector/default-wallets": "^8.0.3", - "@near-wallet-selector/here-wallet": "^8.0.3", - "@near-wallet-selector/ledger": "^8.0.3", - "@near-wallet-selector/meteor-wallet": "^8.0.3", - "@near-wallet-selector/modal-ui": "^8.0.3", - "@near-wallet-selector/my-near-wallet": "*", - "@near-wallet-selector/near-wallet": "^8.0.3", - "@near-wallet-selector/sender": "^8.0.3", - "@near-wallet-selector/wallet-connect": "^8.0.3", - "bs58": "^5.0.0", - "isomorphic-textencoder": "^1.0.1", - "js-sha256": "^0.9.0", - "rxjs": "^7.5.7" - }, - "dependencies": { - "@mintbase-js/sdk": { - "version": "0.3.2-zero-balance-test-poc-cd787c2.0", - "resolved": "https://registry.npmjs.org/@mintbase-js/sdk/-/sdk-0.3.2-zero-balance-test-poc-cd787c2.0.tgz", - "integrity": "sha512-8FIaDy030+Mr5eiKiCZJQ45jRvF0Ur4y4h6V1YSixsPDwwFZtlSP0fTqROLZyPeKcVh4s7WUj/4HlToucwuIbw==", - "requires": { - "bn.js": "5.2.1", - "near-api-js": "^0.44.2" - } - }, - "borsh": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.6.0.tgz", - "integrity": "sha512-sl5k89ViqsThXQpYa9XDtz1sBl3l1lI313cFUY1HKr+wvMILnb+58xpkqTNrYbelh99dY7K8usxoCusQmqix9Q==", - "requires": { - "bn.js": "^5.2.0", - "bs58": "^4.0.0", - "text-encoding-utf-8": "^1.0.2" - }, - "dependencies": { - "bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "requires": { - "base-x": "^3.0.2" - } - } - } - }, - "near-api-js": { - "version": "0.44.2", - "resolved": "https://registry.npmjs.org/near-api-js/-/near-api-js-0.44.2.tgz", - "integrity": "sha512-eMnc4V+geggapEUa3nU2p8HSHn/njtloI4P2mceHQWO8vDE1NGpnAw8FuTBrLmXSgIv9m6oocgFc9t3VNf5zwg==", - "requires": { - "bn.js": "5.2.0", - "borsh": "^0.6.0", - "bs58": "^4.0.0", - "depd": "^2.0.0", - "error-polyfill": "^0.1.3", - "http-errors": "^1.7.2", - "js-sha256": "^0.9.0", - "mustache": "^4.0.0", - "node-fetch": "^2.6.1", - "text-encoding-utf-8": "^1.0.2", - "tweetnacl": "^1.0.1" - }, - "dependencies": { - "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" - }, - "bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "requires": { - "base-x": "^3.0.2" - } - } - } - } - } - }, "@near-wallet-selector/core": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/@near-wallet-selector/core/-/core-8.0.3.tgz", @@ -31614,50 +31298,6 @@ "rxjs": "^7.8.0" } }, - "@near-wallet-selector/here-wallet": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@near-wallet-selector/here-wallet/-/here-wallet-8.0.3.tgz", - "integrity": "sha512-UuilyD7CFyXciUXWFEU36GrdV9AyIvgsUj4MVWx79sCaJe++Q3staI2Bhqg05zW2CjSCujywP4RiZ8OJ9CW+ew==", - "requires": { - "@here-wallet/core": "^1.4.3", - "@near-wallet-selector/core": "8.0.3", - "bn.js": "^5.2.0" - } - }, - "@near-wallet-selector/ledger": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@near-wallet-selector/ledger/-/ledger-8.0.3.tgz", - "integrity": "sha512-q+rpF7fEQ1n5TnStpWjGHa8CFkhwwcnUOGwVLYZYGnnSHqwARnae0jfNi+W7c56oJPlz9A8K3Dblpjwa8T5tkg==", - "requires": { - "@ledgerhq/hw-transport": "6.27.1", - "@ledgerhq/hw-transport-webhid": "6.27.1", - "@near-wallet-selector/core": "8.0.3", - "@near-wallet-selector/wallet-utils": "8.0.3", - "bn.js": "^5.2.0", - "is-mobile": "^3.1.1" - } - }, - "@near-wallet-selector/meteor-wallet": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@near-wallet-selector/meteor-wallet/-/meteor-wallet-8.0.3.tgz", - "integrity": "sha512-7GKRBNibm9zkcoDhoELPivELFLgE2Jy8r7bjPfza3ApsClQn2mp0Iy3u68Y/Ke3Bcbr6I7S30oaKUMjNRo7hGw==", - "requires": { - "@meteorwallet/sdk": "^0.6.0", - "@near-wallet-selector/core": "8.0.3", - "@near-wallet-selector/wallet-utils": "8.0.3" - }, - "dependencies": { - "@meteorwallet/sdk": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@meteorwallet/sdk/-/sdk-0.6.0.tgz", - "integrity": "sha512-oriaQ1gk1hpQx6V6BxsvUthDd0Bpmv3ho5Ap5pm9P0euEosWtFUVF1dTYndJE10qBG8yLW+EOOX1LZ8taXCiRA==", - "requires": { - "nanoid": "3.3.4", - "query-string": "^7.1.1" - } - } - } - }, "@near-wallet-selector/modal-ui": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/@near-wallet-selector/modal-ui/-/modal-ui-8.0.3.tgz", @@ -31670,53 +31310,6 @@ "react-dom": "18.2.0" } }, - "@near-wallet-selector/my-near-wallet": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@near-wallet-selector/my-near-wallet/-/my-near-wallet-8.0.3.tgz", - "integrity": "sha512-elYQZBQ/tGM4NHQ/ufuRmajDzHFFFciE7IPo1UTIZWw2lTCOADnRnBEb1aqqY+ThUrmtc0IuBC2SOtdLkjOMyQ==", - "requires": { - "@near-wallet-selector/core": "8.0.3", - "@near-wallet-selector/wallet-utils": "8.0.3" - } - }, - "@near-wallet-selector/near-wallet": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@near-wallet-selector/near-wallet/-/near-wallet-8.0.3.tgz", - "integrity": "sha512-t2q3XPjS4CA9W8oYuL4JrlURakZ+rZkJZjJcP03afNMr13PFIXMq41olSLfNu+jPyoOD8g4a2yZBph80CjMcjQ==", - "requires": { - "@near-wallet-selector/core": "8.0.3", - "@near-wallet-selector/my-near-wallet": "8.0.3" - } - }, - "@near-wallet-selector/sender": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@near-wallet-selector/sender/-/sender-8.0.3.tgz", - "integrity": "sha512-C9B+AVcxKQ5LC5FOtEJCZYcH8HRUgDcbD+keBzVdFhi2SbG2WS5V4+cKMrf/CXCTESqnZ+spZKdDt4Dypi4bwA==", - "requires": { - "@near-wallet-selector/core": "8.0.3", - "is-mobile": "^3.1.1" - } - }, - "@near-wallet-selector/wallet-connect": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@near-wallet-selector/wallet-connect/-/wallet-connect-8.0.3.tgz", - "integrity": "sha512-HE6ijbhjq3BuLU+7yKVkCN679PRsltZxOamimSYtTgS/gDrl2XUJn10UKAiIeIKPyYknI/946q+kq+WkUuQ6Ng==", - "requires": { - "@near-wallet-selector/core": "8.0.3", - "@near-wallet-selector/wallet-utils": "8.0.3", - "@walletconnect/sign-client": "2.5.2", - "@web3modal/standalone": "^2.2.2" - } - }, - "@near-wallet-selector/wallet-utils": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@near-wallet-selector/wallet-utils/-/wallet-utils-8.0.3.tgz", - "integrity": "sha512-KciRo2TERtqEQL1tnNmBZi6srMeDJkOPnGOkdPeQjg8fT0xSH7+hGZjOz6nSOLEP0/059so8aWo30uHN7wBVmA==", - "requires": { - "@near-wallet-selector/core": "8.0.3", - "bn.js": "^5.2.0" - } - }, "ajv": { "version": "8.12.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", @@ -31761,11 +31354,6 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, - "nanoid": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", - "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==" - }, "near-api-js": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/near-api-js/-/near-api-js-2.1.3.tgz", diff --git a/packages/react/package.json b/packages/react/package.json index b7c78134b..ffed6f506 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -23,7 +23,7 @@ "@testing-library/user-event": "^14.4.3" }, "dependencies": { - "@mintbase-js/auth": "0.3.2-upgrade-packages-3378beb.0", + "@mintbase-js/auth": "0.4.0-beta.0", "@mintbase-js/data": "0.4.0-beta.0", "@mintbase-js/sdk": "0.4.0-beta.0", "@near-wallet-selector/core": "^8.0.3", diff --git a/packages/react/src/WalletContext.tsx b/packages/react/src/WalletContext.tsx index 6fcd63bf7..d14a4e3dd 100644 --- a/packages/react/src/WalletContext.tsx +++ b/packages/react/src/WalletContext.tsx @@ -21,6 +21,7 @@ import type { AccountState, VerifiedOwner, VerifyOwnerParams, + WalletModuleFactory, } from '@near-wallet-selector/core'; import type { WalletSelectorModal } from '@near-wallet-selector/modal-ui'; import type { Network } from '@mintbase-js/sdk'; @@ -50,8 +51,8 @@ export type WalletSetupComponents = { export const WalletContext = createContext(null); -export const WalletContextProvider: React.FC<{ children: React.ReactNode; network?: Network; contractAddress?: string }> = ({ - children, network, contractAddress, +export const WalletContextProvider: React.FC<{ children: React.ReactNode; network?: Network; contractAddress?: string; additionalWallets?: Array }> = ({ + children, network, contractAddress, additionalWallets, }): JSX.Element => { const [errorMessage, setErrorMessage] = useState(''); const [components, setComponents] = useState( @@ -70,6 +71,9 @@ export const WalletContextProvider: React.FC<{ children: React.ReactNode; networ const components = await setupWalletSelectorComponents( selectedNetwork, selectedContract, + { + additionalWallets, + }, ); setIsWalletSelectorSetup(true); @@ -84,6 +88,9 @@ export const WalletContextProvider: React.FC<{ children: React.ReactNode; networ const components = await setupWalletSelectorComponents( selectedNetwork, selectedContract, + { + additionalWallets, + }, ); return components; };