Skip to content

Commit cca2d30

Browse files
committed
refactor: multi chain 1ca
1 parent f064623 commit cca2d30

File tree

6 files changed

+185
-131
lines changed

6 files changed

+185
-131
lines changed

advanced/dapps/react-dapp-v2/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
"@solana/web3.js": "^1.36.0",
2727
"@stacks/network": "^7.0.2",
2828
"@stacks/transactions": "^7.0.6",
29-
"@walletconnect/core": "2.20.3-canary-1ca-3",
29+
"@walletconnect/core": "2.20.3-canary-1ca-4",
3030
"@walletconnect/encoding": "^1.0.1",
3131
"@walletconnect/jsonrpc-utils": "^1.0.8",
32-
"@walletconnect/types": "2.20.3-canary-1ca-3",
33-
"@walletconnect/universal-provider": "2.20.3-canary-1ca-3",
34-
"@walletconnect/sign-client": "2.20.3-canary-1ca-3",
35-
"@walletconnect/utils": "2.20.3-canary-1ca-3",
32+
"@walletconnect/types": "2.20.3-canary-1ca-4",
33+
"@walletconnect/universal-provider": "2.20.3-canary-1ca-4",
34+
"@walletconnect/sign-client": "2.20.3-canary-1ca-4",
35+
"@walletconnect/utils": "2.20.3-canary-1ca-4",
3636
"@reown/appkit": "1.7.5",
3737
"axios": "^1.0.0",
3838
"@mysten/sui": "^1.29.1",
@@ -112,14 +112,14 @@
112112
"next@>=9.5.5 <14.2.15": ">=14.2.15",
113113
"ansi-html@<0.0.8": ">=0.0.8",
114114
"axios@<1.8.2": ">=1.8.2",
115-
"@walletconnect/core@<2.21.3-canary-1ca-0": ">=2.20.3-canary-1ca-3",
115+
"@walletconnect/core@<2.21.3-canary-1ca-0": ">=2.20.3-canary-1ca-4",
116116
"@walletconnect/encoding": ">=1.0.1",
117117
"@walletconnect/jsonrpc-utils": ">=1.0.8",
118-
"@walletconnect/types@<2.21.3-canary-1ca-0": ">=2.20.3-canary-1ca-3",
119-
"@walletconnect/universal-provider@<2.21.3-canary-1ca-0": ">=2.20.3-canary-1ca-3",
120-
"@walletconnect/sign-client@<2.21.3-canary-1ca-0": ">=2.20.3-canary-1ca-3",
121-
"@walletconnect/utils@<2.21.3-canary-1ca-0": ">=2.20.3-canary-1ca-3",
122-
"@walletconnect/ethereum-provider@<2.21.3-canary-1ca-0": ">=2.20.3-canary-1ca-3"
118+
"@walletconnect/types@<2.21.3-canary-1ca-0": ">=2.20.3-canary-1ca-4",
119+
"@walletconnect/universal-provider@<2.21.3-canary-1ca-0": ">=2.20.3-canary-1ca-4",
120+
"@walletconnect/sign-client@<2.21.3-canary-1ca-0": ">=2.20.3-canary-1ca-4",
121+
"@walletconnect/utils@<2.21.3-canary-1ca-0": ">=2.20.3-canary-1ca-4",
122+
"@walletconnect/ethereum-provider@<2.21.3-canary-1ca-0": ">=2.20.3-canary-1ca-4"
123123
}
124124
}
125125
}

advanced/dapps/react-dapp-v2/pnpm-lock.yaml

Lines changed: 47 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

advanced/wallets/react-wallet-v2/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@
8383
"typescript": "5.2.2"
8484
},
8585
"resolutions": {
86-
"@walletconnect/core": "2.20.3-canary-1ca-3",
87-
"@walletconnect/utils": "2.20.3-canary-1ca-3",
88-
"@walletconnect/types": "2.20.3-canary-1ca-3",
89-
"@walletconnect/sign-client": "2.20.3-canary-1ca-3",
90-
"@walletconnect/ethereum-provider": "2.20.3-canary-1ca-3",
91-
"@walletconnect/universal-provider": "2.20.3-canary-1ca-3"
86+
"@walletconnect/core": "2.20.3-canary-1ca-4",
87+
"@walletconnect/utils": "2.20.3-canary-1ca-4",
88+
"@walletconnect/types": "2.20.3-canary-1ca-4",
89+
"@walletconnect/sign-client": "2.20.3-canary-1ca-4",
90+
"@walletconnect/ethereum-provider": "2.20.3-canary-1ca-4",
91+
"@walletconnect/universal-provider": "2.20.3-canary-1ca-4"
9292
}
9393
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { SignClientTypes } from '@walletconnect/types'
2+
import { parseChainId } from '@walletconnect/utils'
3+
import { approveEIP155Request } from './EIP155RequestHandlerUtil'
4+
import { approveSuiRequest } from './SuiRequestHandlerUtil'
5+
import { approveSolanaRequest } from './SolanaRequestHandlerUtil'
6+
import { approveBip122Request } from './Bip122RequestHandlerUtil'
7+
8+
export function approveMultichainRequest(
9+
requestEvent: SignClientTypes.EventArguments['session_request']
10+
) {
11+
const chainId = requestEvent.params.chainId
12+
const { namespace } = parseChainId(chainId)
13+
switch (namespace) {
14+
case 'eip155':
15+
return approveEIP155Request(requestEvent)
16+
case 'sui':
17+
return approveSuiRequest(requestEvent)
18+
case 'solana':
19+
return approveSolanaRequest(requestEvent)
20+
case 'bip122':
21+
return approveBip122Request(requestEvent)
22+
default:
23+
console.log('need to implement multichain request handler for', namespace)
24+
}
25+
}

0 commit comments

Comments
 (0)