@0xsequence/account 1.6.1 → 1.6.3
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.
|
@@ -213,12 +213,14 @@ class Account {
|
|
|
213
213
|
this.migrations = void 0;
|
|
214
214
|
this.orchestrator = void 0;
|
|
215
215
|
this.jwt = void 0;
|
|
216
|
+
this.projectAccessKey = void 0;
|
|
216
217
|
this.address = ethers.ethers.utils.getAddress(options.address);
|
|
217
218
|
this.contexts = options.contexts;
|
|
218
219
|
this.tracker = options.tracker;
|
|
219
220
|
this.networks = options.networks;
|
|
220
221
|
this.orchestrator = options.orchestrator;
|
|
221
222
|
this.jwt = options.jwt;
|
|
223
|
+
this.projectAccessKey = options.projectAccessKey;
|
|
222
224
|
this.migrations = options.migrations || migration.defaults.DefaultMigrations;
|
|
223
225
|
this.migrator = new migration.migrator.Migrator(options.tracker, this.migrations, this.contexts);
|
|
224
226
|
}
|
|
@@ -244,7 +246,8 @@ class Account {
|
|
|
244
246
|
contexts: options.contexts,
|
|
245
247
|
networks: options.networks,
|
|
246
248
|
orchestrator: options.orchestrator,
|
|
247
|
-
migrations: options.migrations
|
|
249
|
+
migrations: options.migrations,
|
|
250
|
+
projectAccessKey: options.projectAccessKey
|
|
248
251
|
});
|
|
249
252
|
}
|
|
250
253
|
getAddress() {
|
|
@@ -269,7 +272,7 @@ class Account {
|
|
|
269
272
|
providerFor(chainId) {
|
|
270
273
|
const found = this.network(chainId);
|
|
271
274
|
if (!found.provider && !found.rpcUrl) throw new Error(`Provider not found for chainId ${chainId}`);
|
|
272
|
-
return found.provider || new ethers.ethers.providers.StaticJsonRpcProvider(utils.getEthersConnectionInfo(found.rpcUrl,
|
|
275
|
+
return found.provider || new ethers.ethers.providers.StaticJsonRpcProvider(utils.getEthersConnectionInfo(found.rpcUrl, this.projectAccessKey, this.jwt), {
|
|
273
276
|
name: '',
|
|
274
277
|
chainId: ethers.ethers.BigNumber.from(chainId).toNumber()
|
|
275
278
|
});
|
|
@@ -286,6 +289,7 @@ class Account {
|
|
|
286
289
|
if (!found.relayer) throw new Error(`Relayer not found for chainId ${chainId}`);
|
|
287
290
|
if (relayer.isRelayer(found.relayer)) return found.relayer;
|
|
288
291
|
return new relayer.RpcRelayer(_extends({}, found.relayer, {
|
|
292
|
+
projectAccessKey: this.projectAccessKey,
|
|
289
293
|
jwtAuth: this.jwt
|
|
290
294
|
}));
|
|
291
295
|
}
|
|
@@ -213,12 +213,14 @@ class Account {
|
|
|
213
213
|
this.migrations = void 0;
|
|
214
214
|
this.orchestrator = void 0;
|
|
215
215
|
this.jwt = void 0;
|
|
216
|
+
this.projectAccessKey = void 0;
|
|
216
217
|
this.address = ethers.ethers.utils.getAddress(options.address);
|
|
217
218
|
this.contexts = options.contexts;
|
|
218
219
|
this.tracker = options.tracker;
|
|
219
220
|
this.networks = options.networks;
|
|
220
221
|
this.orchestrator = options.orchestrator;
|
|
221
222
|
this.jwt = options.jwt;
|
|
223
|
+
this.projectAccessKey = options.projectAccessKey;
|
|
222
224
|
this.migrations = options.migrations || migration.defaults.DefaultMigrations;
|
|
223
225
|
this.migrator = new migration.migrator.Migrator(options.tracker, this.migrations, this.contexts);
|
|
224
226
|
}
|
|
@@ -244,7 +246,8 @@ class Account {
|
|
|
244
246
|
contexts: options.contexts,
|
|
245
247
|
networks: options.networks,
|
|
246
248
|
orchestrator: options.orchestrator,
|
|
247
|
-
migrations: options.migrations
|
|
249
|
+
migrations: options.migrations,
|
|
250
|
+
projectAccessKey: options.projectAccessKey
|
|
248
251
|
});
|
|
249
252
|
}
|
|
250
253
|
getAddress() {
|
|
@@ -269,7 +272,7 @@ class Account {
|
|
|
269
272
|
providerFor(chainId) {
|
|
270
273
|
const found = this.network(chainId);
|
|
271
274
|
if (!found.provider && !found.rpcUrl) throw new Error(`Provider not found for chainId ${chainId}`);
|
|
272
|
-
return found.provider || new ethers.ethers.providers.StaticJsonRpcProvider(utils.getEthersConnectionInfo(found.rpcUrl,
|
|
275
|
+
return found.provider || new ethers.ethers.providers.StaticJsonRpcProvider(utils.getEthersConnectionInfo(found.rpcUrl, this.projectAccessKey, this.jwt), {
|
|
273
276
|
name: '',
|
|
274
277
|
chainId: ethers.ethers.BigNumber.from(chainId).toNumber()
|
|
275
278
|
});
|
|
@@ -286,6 +289,7 @@ class Account {
|
|
|
286
289
|
if (!found.relayer) throw new Error(`Relayer not found for chainId ${chainId}`);
|
|
287
290
|
if (relayer.isRelayer(found.relayer)) return found.relayer;
|
|
288
291
|
return new relayer.RpcRelayer(_extends({}, found.relayer, {
|
|
292
|
+
projectAccessKey: this.projectAccessKey,
|
|
289
293
|
jwtAuth: this.jwt
|
|
290
294
|
}));
|
|
291
295
|
}
|
|
@@ -209,12 +209,14 @@ class Account {
|
|
|
209
209
|
this.migrations = void 0;
|
|
210
210
|
this.orchestrator = void 0;
|
|
211
211
|
this.jwt = void 0;
|
|
212
|
+
this.projectAccessKey = void 0;
|
|
212
213
|
this.address = ethers.utils.getAddress(options.address);
|
|
213
214
|
this.contexts = options.contexts;
|
|
214
215
|
this.tracker = options.tracker;
|
|
215
216
|
this.networks = options.networks;
|
|
216
217
|
this.orchestrator = options.orchestrator;
|
|
217
218
|
this.jwt = options.jwt;
|
|
219
|
+
this.projectAccessKey = options.projectAccessKey;
|
|
218
220
|
this.migrations = options.migrations || defaults.DefaultMigrations;
|
|
219
221
|
this.migrator = new migrator.Migrator(options.tracker, this.migrations, this.contexts);
|
|
220
222
|
}
|
|
@@ -240,7 +242,8 @@ class Account {
|
|
|
240
242
|
contexts: options.contexts,
|
|
241
243
|
networks: options.networks,
|
|
242
244
|
orchestrator: options.orchestrator,
|
|
243
|
-
migrations: options.migrations
|
|
245
|
+
migrations: options.migrations,
|
|
246
|
+
projectAccessKey: options.projectAccessKey
|
|
244
247
|
});
|
|
245
248
|
}
|
|
246
249
|
getAddress() {
|
|
@@ -265,7 +268,7 @@ class Account {
|
|
|
265
268
|
providerFor(chainId) {
|
|
266
269
|
const found = this.network(chainId);
|
|
267
270
|
if (!found.provider && !found.rpcUrl) throw new Error(`Provider not found for chainId ${chainId}`);
|
|
268
|
-
return found.provider || new ethers.providers.StaticJsonRpcProvider(getEthersConnectionInfo(found.rpcUrl,
|
|
271
|
+
return found.provider || new ethers.providers.StaticJsonRpcProvider(getEthersConnectionInfo(found.rpcUrl, this.projectAccessKey, this.jwt), {
|
|
269
272
|
name: '',
|
|
270
273
|
chainId: ethers.BigNumber.from(chainId).toNumber()
|
|
271
274
|
});
|
|
@@ -282,6 +285,7 @@ class Account {
|
|
|
282
285
|
if (!found.relayer) throw new Error(`Relayer not found for chainId ${chainId}`);
|
|
283
286
|
if (isRelayer(found.relayer)) return found.relayer;
|
|
284
287
|
return new RpcRelayer(_extends({}, found.relayer, {
|
|
288
|
+
projectAccessKey: this.projectAccessKey,
|
|
285
289
|
jwtAuth: this.jwt
|
|
286
290
|
}));
|
|
287
291
|
}
|
|
@@ -36,6 +36,7 @@ export type AccountOptions = {
|
|
|
36
36
|
orchestrator: SignatureOrchestrator;
|
|
37
37
|
networks: NetworkConfig[];
|
|
38
38
|
jwt?: string;
|
|
39
|
+
projectAccessKey?: string;
|
|
39
40
|
};
|
|
40
41
|
export interface PreparedTransactions {
|
|
41
42
|
transactions: commons.transaction.SimulatedTransaction[];
|
|
@@ -52,6 +53,7 @@ export declare class Account {
|
|
|
52
53
|
readonly migrations: migrator.Migrations;
|
|
53
54
|
private orchestrator;
|
|
54
55
|
private jwt?;
|
|
56
|
+
private projectAccessKey?;
|
|
55
57
|
constructor(options: AccountOptions);
|
|
56
58
|
getSigner(chainId: ChainId, options?: AccountSignerOptions): AccountSigner;
|
|
57
59
|
static new(options: {
|
|
@@ -61,6 +63,7 @@ export declare class Account {
|
|
|
61
63
|
orchestrator: SignatureOrchestrator;
|
|
62
64
|
networks: NetworkConfig[];
|
|
63
65
|
migrations?: migrator.Migrations;
|
|
66
|
+
projectAccessKey?: string;
|
|
64
67
|
}): Promise<Account>;
|
|
65
68
|
getAddress(): Promise<string>;
|
|
66
69
|
get version(): number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/account",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
4
4
|
"description": "tools for migrating sequence wallets to new versions",
|
|
5
5
|
"repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/account",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -10,20 +10,20 @@
|
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"ethers": "^5.5.2",
|
|
13
|
-
"@0xsequence/abi": "1.6.
|
|
14
|
-
"@0xsequence/core": "1.6.
|
|
15
|
-
"@0xsequence/migration": "1.6.
|
|
16
|
-
"@0xsequence/network": "1.6.
|
|
17
|
-
"@0xsequence/relayer": "1.6.
|
|
18
|
-
"@0xsequence/sessions": "1.6.
|
|
19
|
-
"@0xsequence/
|
|
20
|
-
"@0xsequence/
|
|
13
|
+
"@0xsequence/abi": "1.6.3",
|
|
14
|
+
"@0xsequence/core": "1.6.3",
|
|
15
|
+
"@0xsequence/migration": "1.6.3",
|
|
16
|
+
"@0xsequence/network": "1.6.3",
|
|
17
|
+
"@0xsequence/relayer": "1.6.3",
|
|
18
|
+
"@0xsequence/sessions": "1.6.3",
|
|
19
|
+
"@0xsequence/wallet": "1.6.3",
|
|
20
|
+
"@0xsequence/utils": "1.6.3"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
24
24
|
"nyc": "^15.1.0",
|
|
25
|
-
"@0xsequence/signhub": "1.6.
|
|
26
|
-
"@0xsequence/tests": "1.6.
|
|
25
|
+
"@0xsequence/signhub": "1.6.3",
|
|
26
|
+
"@0xsequence/tests": "1.6.3"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"src",
|
package/src/account.ts
CHANGED
|
@@ -57,6 +57,9 @@ export type AccountOptions = {
|
|
|
57
57
|
|
|
58
58
|
// Jwt
|
|
59
59
|
jwt?: string
|
|
60
|
+
|
|
61
|
+
// Project access key
|
|
62
|
+
projectAccessKey?: string
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
export interface PreparedTransactions {
|
|
@@ -102,6 +105,8 @@ export class Account {
|
|
|
102
105
|
|
|
103
106
|
private jwt?: string
|
|
104
107
|
|
|
108
|
+
private projectAccessKey?: string
|
|
109
|
+
|
|
105
110
|
constructor(options: AccountOptions) {
|
|
106
111
|
this.address = ethers.utils.getAddress(options.address)
|
|
107
112
|
|
|
@@ -110,6 +115,7 @@ export class Account {
|
|
|
110
115
|
this.networks = options.networks
|
|
111
116
|
this.orchestrator = options.orchestrator
|
|
112
117
|
this.jwt = options.jwt
|
|
118
|
+
this.projectAccessKey = options.projectAccessKey
|
|
113
119
|
|
|
114
120
|
this.migrations = options.migrations || defaults.DefaultMigrations
|
|
115
121
|
this.migrator = new migrator.Migrator(options.tracker, this.migrations, this.contexts)
|
|
@@ -126,6 +132,7 @@ export class Account {
|
|
|
126
132
|
orchestrator: SignatureOrchestrator
|
|
127
133
|
networks: NetworkConfig[]
|
|
128
134
|
migrations?: migrator.Migrations
|
|
135
|
+
projectAccessKey?: string
|
|
129
136
|
}): Promise<Account> {
|
|
130
137
|
const mig = new migrator.Migrator(options.tracker, options.migrations ?? defaults.DefaultMigrations, options.contexts)
|
|
131
138
|
|
|
@@ -145,7 +152,8 @@ export class Account {
|
|
|
145
152
|
contexts: options.contexts,
|
|
146
153
|
networks: options.networks,
|
|
147
154
|
orchestrator: options.orchestrator,
|
|
148
|
-
migrations: options.migrations
|
|
155
|
+
migrations: options.migrations,
|
|
156
|
+
projectAccessKey: options.projectAccessKey
|
|
149
157
|
})
|
|
150
158
|
}
|
|
151
159
|
|
|
@@ -181,7 +189,7 @@ export class Account {
|
|
|
181
189
|
if (!found.provider && !found.rpcUrl) throw new Error(`Provider not found for chainId ${chainId}`)
|
|
182
190
|
return (
|
|
183
191
|
found.provider ||
|
|
184
|
-
new ethers.providers.StaticJsonRpcProvider(getEthersConnectionInfo(found.rpcUrl,
|
|
192
|
+
new ethers.providers.StaticJsonRpcProvider(getEthersConnectionInfo(found.rpcUrl, this.projectAccessKey, this.jwt), {
|
|
185
193
|
name: '',
|
|
186
194
|
chainId: ethers.BigNumber.from(chainId).toNumber()
|
|
187
195
|
})
|
|
@@ -200,7 +208,7 @@ export class Account {
|
|
|
200
208
|
const found = this.network(chainId)
|
|
201
209
|
if (!found.relayer) throw new Error(`Relayer not found for chainId ${chainId}`)
|
|
202
210
|
if (isRelayer(found.relayer)) return found.relayer
|
|
203
|
-
return new RpcRelayer({ ...found.relayer, jwtAuth: this.jwt })
|
|
211
|
+
return new RpcRelayer({ ...found.relayer, projectAccessKey: this.projectAccessKey, jwtAuth: this.jwt })
|
|
204
212
|
}
|
|
205
213
|
|
|
206
214
|
setOrchestrator(orchestrator: SignatureOrchestrator) {
|