diff --git a/package-lock.json b/package-lock.json index 35ec659e..47575a8e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@cityofzion/bs-neo3": "1.2.0", "@cityofzion/neon-core": "5.5.1", "@cityofzion/neon-js": "5.5.1", - "@cityofzion/wallet-connect-sdk-wallet-core": "4.3.1", + "@cityofzion/wallet-connect-sdk-wallet-core": "4.3.2", "@cityofzion/wallet-connect-sdk-wallet-react": "4.0.16", "@electron-toolkit/preload": "^2.0.0", "@electron-toolkit/utils": "^2.0.0", @@ -977,9 +977,9 @@ "integrity": "sha512-UjveRGBuj/OlwlX39IutXFPBalosc+dZClC32+wm5JLOsAy12vFeI+dNFe6nnV8HIrFRZSLcHyfq08ILA68LVQ==" }, "node_modules/@cityofzion/wallet-connect-sdk-wallet-core": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@cityofzion/wallet-connect-sdk-wallet-core/-/wallet-connect-sdk-wallet-core-4.3.1.tgz", - "integrity": "sha512-dxWETB4WxXcMMMbuspGRzr2viwcZMV/DB+Uxw1KXB4gWWdvrCvyw9S07lUlPiEwdGFomh00fc6tKOG7U92ki4Q==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/@cityofzion/wallet-connect-sdk-wallet-core/-/wallet-connect-sdk-wallet-core-4.3.2.tgz", + "integrity": "sha512-cF/JmXJyqFvK/2GNOxNoFML3ZNeunSn26bd5X/OgDX64qzWXrE9mtJ48FSzYcNkIg0nz373YxKjpteCZEq7UHw==", "dependencies": { "@cityofzion/neon-core": "5.5.1", "@cityofzion/neon-dappkit": "0.5.1", @@ -1133,6 +1133,149 @@ "react": "*" } }, + "node_modules/@cityofzion/wallet-connect-sdk-wallet-react/node_modules/@cityofzion/neon-dappkit": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@cityofzion/neon-dappkit/-/neon-dappkit-0.5.1.tgz", + "integrity": "sha512-EIO+UvrufXKBwXSuJ5HJJnpM5qq8rDmbxg7c+esS531UNXLL8PRxR9Lb9LxeYsgELI48ZF0oUhn/SX4VlnM/uA==", + "dependencies": { + "@cityofzion/neon-dappkit-types": "0.4.0", + "@cityofzion/neon-js": "5.5.1", + "crypto-browserify": "^3.12.0", + "crypto-js": "^4.1.1", + "elliptic": "^6.5.4", + "randombytes": "^2.1.0", + "readable-stream": "^4.4.2", + "stream": "^0.0.2", + "stream-browserify": "^3.0.0" + } + }, + "node_modules/@cityofzion/wallet-connect-sdk-wallet-react/node_modules/@cityofzion/neon-dappkit-types": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@cityofzion/neon-dappkit-types/-/neon-dappkit-types-0.4.0.tgz", + "integrity": "sha512-UjveRGBuj/OlwlX39IutXFPBalosc+dZClC32+wm5JLOsAy12vFeI+dNFe6nnV8HIrFRZSLcHyfq08ILA68LVQ==" + }, + "node_modules/@cityofzion/wallet-connect-sdk-wallet-react/node_modules/@cityofzion/wallet-connect-sdk-wallet-core": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@cityofzion/wallet-connect-sdk-wallet-core/-/wallet-connect-sdk-wallet-core-4.3.1.tgz", + "integrity": "sha512-dxWETB4WxXcMMMbuspGRzr2viwcZMV/DB+Uxw1KXB4gWWdvrCvyw9S07lUlPiEwdGFomh00fc6tKOG7U92ki4Q==", + "dependencies": { + "@cityofzion/neon-core": "5.5.1", + "@cityofzion/neon-dappkit": "0.5.1", + "@cityofzion/neon-js": "5.5.1", + "@cityofzion/wallet-connect-sdk-core": "3.3.4", + "@ethersproject/abstract-signer": "^5.7.0", + "@walletconnect/core": "^2.13.3", + "@walletconnect/jsonrpc-utils": "^1.0.8", + "@walletconnect/types": "2.13.0", + "@walletconnect/web3wallet": "^1.12.3", + "ethers": "5.7.2", + "moment": "^2.29.4" + } + }, + "node_modules/@cityofzion/wallet-connect-sdk-wallet-react/node_modules/@ethersproject/providers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz", + "integrity": "sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0", + "bech32": "1.1.4", + "ws": "7.4.6" + } + }, + "node_modules/@cityofzion/wallet-connect-sdk-wallet-react/node_modules/ethers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", + "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abi": "5.7.0", + "@ethersproject/abstract-provider": "5.7.0", + "@ethersproject/abstract-signer": "5.7.0", + "@ethersproject/address": "5.7.0", + "@ethersproject/base64": "5.7.0", + "@ethersproject/basex": "5.7.0", + "@ethersproject/bignumber": "5.7.0", + "@ethersproject/bytes": "5.7.0", + "@ethersproject/constants": "5.7.0", + "@ethersproject/contracts": "5.7.0", + "@ethersproject/hash": "5.7.0", + "@ethersproject/hdnode": "5.7.0", + "@ethersproject/json-wallets": "5.7.0", + "@ethersproject/keccak256": "5.7.0", + "@ethersproject/logger": "5.7.0", + "@ethersproject/networks": "5.7.1", + "@ethersproject/pbkdf2": "5.7.0", + "@ethersproject/properties": "5.7.0", + "@ethersproject/providers": "5.7.2", + "@ethersproject/random": "5.7.0", + "@ethersproject/rlp": "5.7.0", + "@ethersproject/sha2": "5.7.0", + "@ethersproject/signing-key": "5.7.0", + "@ethersproject/solidity": "5.7.0", + "@ethersproject/strings": "5.7.0", + "@ethersproject/transactions": "5.7.0", + "@ethersproject/units": "5.7.0", + "@ethersproject/wallet": "5.7.0", + "@ethersproject/web": "5.7.1", + "@ethersproject/wordlists": "5.7.0" + } + }, + "node_modules/@cityofzion/wallet-connect-sdk-wallet-react/node_modules/ws": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/@develar/schema-utils": { "version": "2.6.5", "resolved": "https://registry.npmjs.org/@develar/schema-utils/-/schema-utils-2.6.5.tgz", diff --git a/package.json b/package.json index 7f2d7100..207a4f6f 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "@cityofzion/bs-neo3": "1.2.0", "@cityofzion/neon-core": "5.5.1", "@cityofzion/neon-js": "5.5.1", - "@cityofzion/wallet-connect-sdk-wallet-core": "4.3.1", + "@cityofzion/wallet-connect-sdk-wallet-core": "4.3.2", "@cityofzion/wallet-connect-sdk-wallet-react": "4.0.16", "@electron-toolkit/preload": "^2.0.0", "@electron-toolkit/utils": "^2.0.0", @@ -112,4 +112,4 @@ "vite-plugin-node-polyfills": "^0.17.0", "vite-plugin-svgr": "^3.2.0" } -} \ No newline at end of file +} diff --git a/src/main/walletConnect.ts b/src/main/walletConnect.ts index efb40682..843d486d 100644 --- a/src/main/walletConnect.ts +++ b/src/main/walletConnect.ts @@ -82,8 +82,10 @@ export class WalletConnectEIP155Adapter extends AbstractWalletConnectEIP155Adapt } async getRPCUrl(params: TAdapterMethodParam): Promise { - const { networkByBlockchain } = await getStoreAccountFromWCSession(params) - return networkByBlockchain.ethereum.url + const { networkByBlockchain, account } = await getStoreAccountFromWCSession(params) + if (!account) throw new Error('Account not found') + + return networkByBlockchain[account.blockchain].url } async getCustomSigner(params: TAdapterMethodParam): Promise { diff --git a/src/renderer/src/routes/modals/DappPermission/index.tsx b/src/renderer/src/routes/modals/DappPermission/index.tsx index 94700f87..89a2b3d5 100644 --- a/src/renderer/src/routes/modals/DappPermission/index.tsx +++ b/src/renderer/src/routes/modals/DappPermission/index.tsx @@ -63,6 +63,17 @@ const componentsByBlockchain: Partial< eth_call: EthereumSendTransactionDappPermission, eth_sendRawTransaction: EthereumSendTransactionDappPermission, }, + neox: { + personal_sign: EthereumSignMessageDappPermission, + eth_sign: EthereumSignMessageDappPermission, + eth_signTransaction: EthereumSignTransactionDappPermission, + eth_signTypedData: EthereumSignTypedDataDappPermission, + eth_signTypedData_v3: EthereumSignTypedDataDappPermission, + eth_signTypedData_v4: EthereumSignTypedDataDappPermission, + eth_sendTransaction: EthereumSendTransactionDappPermission, + eth_call: EthereumSendTransactionDappPermission, + eth_sendRawTransaction: EthereumSendTransactionDappPermission, + }, } export const DappPermissionModal = () => {