Skip to content

Commit 7d69696

Browse files
committed
fix: Update joy.id patch to fix additional issues
1 parent 6916da7 commit 7d69696

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed
Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,42 @@
11
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
33
--- a/node_modules/@joyid/ethereum-provider/dist/index.js
44
+++ 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");
67
}
78
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));
1012
this.emit("chainChanged", chainId);
1113
return void 0;
1214
}
1315
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
1517
--- a/node_modules/@joyid/ethereum-provider/dist/index.mjs
1618
+++ 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");
1821
}
1922
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));
2226
this.emit("chainChanged", chainId);
2327
return void 0;
2428
}
2529
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
2731
--- a/node_modules/@joyid/ethereum-provider/src/index.ts
2832
+++ 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')
3035
}
3136
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))
3440
this.emit('chainChanged', chainId)
3541
return undefined
3642
}

0 commit comments

Comments
 (0)