@0xsequence/provider 0.0.0-20230801185244 → 0.0.0-20230801194854
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.
|
@@ -3275,10 +3275,18 @@ class SequenceProvider extends ethers.ethers.providers.BaseProvider {
|
|
|
3275
3275
|
var _provider$prepareRequ;
|
|
3276
3276
|
// First we check if the method should be handled by the client
|
|
3277
3277
|
if (method === 'eth_chainId') {
|
|
3278
|
-
return
|
|
3278
|
+
return {
|
|
3279
|
+
jsonrpc: '2.0',
|
|
3280
|
+
id: params.id,
|
|
3281
|
+
result: `0x${(await this.useChainId()).toString(16)}`
|
|
3282
|
+
};
|
|
3279
3283
|
}
|
|
3280
3284
|
if (method === 'eth_accounts') {
|
|
3281
|
-
return
|
|
3285
|
+
return {
|
|
3286
|
+
jsonrpc: '2.0',
|
|
3287
|
+
id: params.id,
|
|
3288
|
+
result: [this.client.getAddress()]
|
|
3289
|
+
};
|
|
3282
3290
|
}
|
|
3283
3291
|
if (method === 'wallet_switchEthereumChain') {
|
|
3284
3292
|
const args = params[0];
|
|
@@ -3275,10 +3275,18 @@ class SequenceProvider extends ethers.ethers.providers.BaseProvider {
|
|
|
3275
3275
|
var _provider$prepareRequ;
|
|
3276
3276
|
// First we check if the method should be handled by the client
|
|
3277
3277
|
if (method === 'eth_chainId') {
|
|
3278
|
-
return
|
|
3278
|
+
return {
|
|
3279
|
+
jsonrpc: '2.0',
|
|
3280
|
+
id: params.id,
|
|
3281
|
+
result: `0x${(await this.useChainId()).toString(16)}`
|
|
3282
|
+
};
|
|
3279
3283
|
}
|
|
3280
3284
|
if (method === 'eth_accounts') {
|
|
3281
|
-
return
|
|
3285
|
+
return {
|
|
3286
|
+
jsonrpc: '2.0',
|
|
3287
|
+
id: params.id,
|
|
3288
|
+
result: [this.client.getAddress()]
|
|
3289
|
+
};
|
|
3282
3290
|
}
|
|
3283
3291
|
if (method === 'wallet_switchEthereumChain') {
|
|
3284
3292
|
const args = params[0];
|
|
@@ -3271,10 +3271,18 @@ class SequenceProvider extends ethers.providers.BaseProvider {
|
|
|
3271
3271
|
var _provider$prepareRequ;
|
|
3272
3272
|
// First we check if the method should be handled by the client
|
|
3273
3273
|
if (method === 'eth_chainId') {
|
|
3274
|
-
return
|
|
3274
|
+
return {
|
|
3275
|
+
jsonrpc: '2.0',
|
|
3276
|
+
id: params.id,
|
|
3277
|
+
result: `0x${(await this.useChainId()).toString(16)}`
|
|
3278
|
+
};
|
|
3275
3279
|
}
|
|
3276
3280
|
if (method === 'eth_accounts') {
|
|
3277
|
-
return
|
|
3281
|
+
return {
|
|
3282
|
+
jsonrpc: '2.0',
|
|
3283
|
+
id: params.id,
|
|
3284
|
+
result: [this.client.getAddress()]
|
|
3285
|
+
};
|
|
3278
3286
|
}
|
|
3279
3287
|
if (method === 'wallet_switchEthereumChain') {
|
|
3280
3288
|
const args = params[0];
|
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-20230801194854",
|
|
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",
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"eventemitter2": "^6.4.5",
|
|
13
13
|
"webextension-polyfill": "^0.10.0",
|
|
14
|
-
"@0xsequence/
|
|
15
|
-
"@0xsequence/
|
|
16
|
-
"@0xsequence/
|
|
17
|
-
"@0xsequence/
|
|
18
|
-
"@0xsequence/
|
|
19
|
-
"@0xsequence/network": "0.0.0-
|
|
20
|
-
"@0xsequence/relayer": "0.0.0-
|
|
21
|
-
"@0xsequence/utils": "0.0.0-
|
|
22
|
-
"@0xsequence/wallet": "0.0.0-
|
|
14
|
+
"@0xsequence/abi": "0.0.0-20230801194854",
|
|
15
|
+
"@0xsequence/auth": "0.0.0-20230801194854",
|
|
16
|
+
"@0xsequence/account": "0.0.0-20230801194854",
|
|
17
|
+
"@0xsequence/migration": "0.0.0-20230801194854",
|
|
18
|
+
"@0xsequence/core": "0.0.0-20230801194854",
|
|
19
|
+
"@0xsequence/network": "0.0.0-20230801194854",
|
|
20
|
+
"@0xsequence/relayer": "0.0.0-20230801194854",
|
|
21
|
+
"@0xsequence/utils": "0.0.0-20230801194854",
|
|
22
|
+
"@0xsequence/wallet": "0.0.0-20230801194854"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"ethers": ">=5.5 < 6"
|
package/src/provider.ts
CHANGED
|
@@ -247,11 +247,19 @@ export class SequenceProvider extends ethers.providers.BaseProvider implements I
|
|
|
247
247
|
async perform(method: string, params: any): Promise<any> {
|
|
248
248
|
// First we check if the method should be handled by the client
|
|
249
249
|
if (method === 'eth_chainId') {
|
|
250
|
-
return
|
|
250
|
+
return {
|
|
251
|
+
jsonrpc: '2.0',
|
|
252
|
+
id: params.id,
|
|
253
|
+
result: `0x${(await this.useChainId()).toString(16)}`
|
|
254
|
+
}
|
|
251
255
|
}
|
|
252
256
|
|
|
253
257
|
if (method === 'eth_accounts') {
|
|
254
|
-
return
|
|
258
|
+
return {
|
|
259
|
+
jsonrpc: '2.0',
|
|
260
|
+
id: params.id,
|
|
261
|
+
result: [this.client.getAddress()]
|
|
262
|
+
}
|
|
255
263
|
}
|
|
256
264
|
|
|
257
265
|
if (method === 'wallet_switchEthereumChain') {
|