|
1 | 1 | diff --git a/node_modules/@joyid/ethereum-provider/dist/index.js b/node_modules/@joyid/ethereum-provider/dist/index.js
|
2 |
| -index 994b6cc..922a08d 100644 |
| 2 | +index 994b6cc..e352351 100644 |
3 | 3 | --- a/node_modules/@joyid/ethereum-provider/dist/index.js
|
4 | 4 | +++ b/node_modules/@joyid/ethereum-provider/dist/index.js
|
5 |
| -@@ -52,6 +52,7 @@ var EthereumProvider = class extends _eventemitter32.default { |
| 5 | +@@ -51,7 +51,8 @@ var EthereumProvider = class extends _eventemitter32.default { |
| 6 | + throw new Error("eth_sign is not supported, use personal_sign instead"); |
6 | 7 | }
|
7 | 8 | case "wallet_switchEthereumChain": {
|
8 |
| - const [chainId] = args.params; |
9 |
| -+ this.switchChain(chainId); |
| 9 | +- const [chainId] = args.params; |
| 10 | ++ const chainId = args.params?.[0]?.chainId; |
| 11 | ++ this.switchChain(parseInt(chainId)); |
10 | 12 | this.emit("chainChanged", chainId);
|
11 | 13 | return void 0;
|
12 | 14 | }
|
13 | 15 | diff --git a/node_modules/@joyid/ethereum-provider/dist/index.mjs b/node_modules/@joyid/ethereum-provider/dist/index.mjs
|
14 |
| -index e182344..3746b80 100644 |
| 16 | +index e182344..7f5bb7a 100644 |
15 | 17 | --- a/node_modules/@joyid/ethereum-provider/dist/index.mjs
|
16 | 18 | +++ b/node_modules/@joyid/ethereum-provider/dist/index.mjs
|
17 |
| -@@ -52,6 +52,7 @@ var EthereumProvider = class extends EventEmitter { |
| 19 | +@@ -51,7 +51,8 @@ var EthereumProvider = class extends EventEmitter { |
| 20 | + throw new Error("eth_sign is not supported, use personal_sign instead"); |
18 | 21 | }
|
19 | 22 | case "wallet_switchEthereumChain": {
|
20 |
| - const [chainId] = args.params; |
21 |
| -+ this.switchChain(chainId); |
| 23 | +- const [chainId] = args.params; |
| 24 | ++ const chainId = args.params?.[0]?.chainId |
| 25 | ++ this.switchChain(parseInt(chainId)); |
22 | 26 | this.emit("chainChanged", chainId);
|
23 | 27 | return void 0;
|
24 | 28 | }
|
25 | 29 | diff --git a/node_modules/@joyid/ethereum-provider/src/index.ts b/node_modules/@joyid/ethereum-provider/src/index.ts
|
26 |
| -index 2bb2aa8..0c55f0c 100644 |
| 30 | +index 2bb2aa8..3e09bf2 100644 |
27 | 31 | --- a/node_modules/@joyid/ethereum-provider/src/index.ts
|
28 | 32 | +++ b/node_modules/@joyid/ethereum-provider/src/index.ts
|
29 |
| -@@ -150,6 +150,7 @@ export class EthereumProvider extends EventEmitter { |
| 33 | +@@ -149,7 +149,8 @@ export class EthereumProvider extends EventEmitter { |
| 34 | + throw new Error('eth_sign is not supported, use personal_sign instead') |
30 | 35 | }
|
31 | 36 | case 'wallet_switchEthereumChain': {
|
32 |
| - const [chainId] = args.params as [chainId: string] |
33 |
| -+ this.switchChain(chainId) |
| 37 | +- const [chainId] = args.params as [chainId: string] |
| 38 | ++ const chainId = args.params?.[0]?.chainId as string |
| 39 | ++ this.switchChain(parseInt(chainId)) |
34 | 40 | this.emit('chainChanged', chainId)
|
35 | 41 | return undefined
|
36 | 42 | }
|
0 commit comments