@0xsequence/provider 0.0.0-20230309215219 → 0.0.0-20230320165616
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2141,9 +2141,12 @@ class WalletRequestHandler {
|
|
|
2141
2141
|
}
|
|
2142
2142
|
findNetworkID(network) {
|
|
2143
2143
|
const networkId = this.networks.find(n => {
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2144
|
+
switch (`${network}`) {
|
|
2145
|
+
case (n.name, `${n.chainId}`):
|
|
2146
|
+
return true;
|
|
2147
|
+
default:
|
|
2148
|
+
return false;
|
|
2149
|
+
}
|
|
2147
2150
|
});
|
|
2148
2151
|
if (!networkId) {
|
|
2149
2152
|
throw new Error(`Network ${network} not found`);
|
|
@@ -2238,7 +2241,7 @@ class WalletRequestHandler {
|
|
|
2238
2241
|
|
|
2239
2242
|
try {
|
|
2240
2243
|
// TODO: Either implement account as a signer, or change signAuthorization to accept an account
|
|
2241
|
-
connectDetails.proof = await auth.signAuthorization(this.account, authOptions);
|
|
2244
|
+
connectDetails.proof = await auth.signAuthorization(this.account, this.defaultNetworkId, authOptions);
|
|
2242
2245
|
} catch (err) {
|
|
2243
2246
|
utils.logger.warn(`connect, signAuthorization failed for options: ${JSON.stringify(options)}, due to: ${err.message}`);
|
|
2244
2247
|
return {
|
|
@@ -2141,9 +2141,12 @@ class WalletRequestHandler {
|
|
|
2141
2141
|
}
|
|
2142
2142
|
findNetworkID(network) {
|
|
2143
2143
|
const networkId = this.networks.find(n => {
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2144
|
+
switch (`${network}`) {
|
|
2145
|
+
case (n.name, `${n.chainId}`):
|
|
2146
|
+
return true;
|
|
2147
|
+
default:
|
|
2148
|
+
return false;
|
|
2149
|
+
}
|
|
2147
2150
|
});
|
|
2148
2151
|
if (!networkId) {
|
|
2149
2152
|
throw new Error(`Network ${network} not found`);
|
|
@@ -2238,7 +2241,7 @@ class WalletRequestHandler {
|
|
|
2238
2241
|
|
|
2239
2242
|
try {
|
|
2240
2243
|
// TODO: Either implement account as a signer, or change signAuthorization to accept an account
|
|
2241
|
-
connectDetails.proof = await auth.signAuthorization(this.account, authOptions);
|
|
2244
|
+
connectDetails.proof = await auth.signAuthorization(this.account, this.defaultNetworkId, authOptions);
|
|
2242
2245
|
} catch (err) {
|
|
2243
2246
|
utils.logger.warn(`connect, signAuthorization failed for options: ${JSON.stringify(options)}, due to: ${err.message}`);
|
|
2244
2247
|
return {
|
|
@@ -2137,9 +2137,12 @@ class WalletRequestHandler {
|
|
|
2137
2137
|
}
|
|
2138
2138
|
findNetworkID(network) {
|
|
2139
2139
|
const networkId = this.networks.find(n => {
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2140
|
+
switch (`${network}`) {
|
|
2141
|
+
case (n.name, `${n.chainId}`):
|
|
2142
|
+
return true;
|
|
2143
|
+
default:
|
|
2144
|
+
return false;
|
|
2145
|
+
}
|
|
2143
2146
|
});
|
|
2144
2147
|
if (!networkId) {
|
|
2145
2148
|
throw new Error(`Network ${network} not found`);
|
|
@@ -2234,7 +2237,7 @@ class WalletRequestHandler {
|
|
|
2234
2237
|
|
|
2235
2238
|
try {
|
|
2236
2239
|
// TODO: Either implement account as a signer, or change signAuthorization to accept an account
|
|
2237
|
-
connectDetails.proof = await signAuthorization(this.account, authOptions);
|
|
2240
|
+
connectDetails.proof = await signAuthorization(this.account, this.defaultNetworkId, authOptions);
|
|
2238
2241
|
} catch (err) {
|
|
2239
2242
|
logger.warn(`connect, signAuthorization failed for options: ${JSON.stringify(options)}, due to: ${err.message}`);
|
|
2240
2243
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/provider",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-20230320165616",
|
|
4
4
|
"description": "provider sub-package for Sequence",
|
|
5
5
|
"repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/provider",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
"author": "Horizon Blockchain Games",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@0xsequence/abi": "0.0.0-
|
|
13
|
-
"@0xsequence/account": "0.0.0-
|
|
14
|
-
"@0xsequence/auth": "0.0.0-
|
|
15
|
-
"@0xsequence/core": "0.0.0-
|
|
16
|
-
"@0xsequence/migration": "0.0.0-
|
|
17
|
-
"@0xsequence/network": "0.0.0-
|
|
18
|
-
"@0xsequence/relayer": "0.0.0-
|
|
19
|
-
"@0xsequence/utils": "0.0.0-
|
|
20
|
-
"@0xsequence/wallet": "0.0.0-
|
|
12
|
+
"@0xsequence/abi": "0.0.0-20230320165616",
|
|
13
|
+
"@0xsequence/account": "0.0.0-20230320165616",
|
|
14
|
+
"@0xsequence/auth": "0.0.0-20230320165616",
|
|
15
|
+
"@0xsequence/core": "0.0.0-20230320165616",
|
|
16
|
+
"@0xsequence/migration": "0.0.0-20230320165616",
|
|
17
|
+
"@0xsequence/network": "0.0.0-20230320165616",
|
|
18
|
+
"@0xsequence/relayer": "0.0.0-20230320165616",
|
|
19
|
+
"@0xsequence/utils": "0.0.0-20230320165616",
|
|
20
|
+
"@0xsequence/wallet": "0.0.0-20230320165616",
|
|
21
21
|
"eventemitter2": "^6.4.5",
|
|
22
22
|
"webextension-polyfill": "^0.10.0"
|
|
23
23
|
},
|
|
@@ -71,10 +71,13 @@ export class WalletRequestHandler implements ExternalProvider, JsonRpcHandler, P
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
private findNetworkID(network: string | number) {
|
|
74
|
-
const networkId = this.networks.find(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
const networkId = this.networks.find(n => {
|
|
75
|
+
switch (`${network}`) {
|
|
76
|
+
case n.name, `${n.chainId}`:
|
|
77
|
+
return true
|
|
78
|
+
default:
|
|
79
|
+
return false
|
|
80
|
+
}
|
|
78
81
|
})
|
|
79
82
|
|
|
80
83
|
if (!networkId) {
|
|
@@ -178,7 +181,7 @@ export class WalletRequestHandler implements ExternalProvider, JsonRpcHandler, P
|
|
|
178
181
|
|
|
179
182
|
try {
|
|
180
183
|
// TODO: Either implement account as a signer, or change signAuthorization to accept an account
|
|
181
|
-
connectDetails.proof = await signAuthorization(this.account
|
|
184
|
+
connectDetails.proof = await signAuthorization(this.account, this.defaultNetworkId, authOptions)
|
|
182
185
|
} catch (err) {
|
|
183
186
|
logger.warn(`connect, signAuthorization failed for options: ${JSON.stringify(options)}, due to: ${err.message}`)
|
|
184
187
|
return {
|