@0xsequence/account 2.3.25 → 2.3.27
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.
- package/dist/0xsequence-account.cjs.dev.js +8 -6
- package/dist/0xsequence-account.cjs.prod.js +8 -6
- package/dist/0xsequence-account.esm.js +8 -6
- package/dist/declarations/src/account.d.ts +3 -2
- package/dist/declarations/src/signer.d.ts +3 -1
- package/package.json +11 -11
- package/src/account.ts +9 -7
- package/src/signer.ts +9 -7
|
@@ -145,9 +145,11 @@ class AccountSigner {
|
|
|
145
145
|
const selectMethod = (_this$options$selectF = (_this$options4 = this.options) == null ? void 0 : _this$options4.selectFee) != null ? _this$options$selectF : this.defaultSelectFee.bind(this);
|
|
146
146
|
const feeOption = await selectMethod(txs, prepare.feeOptions);
|
|
147
147
|
const finalTransactions = [...prepare.transactions, ...encodeGasRefundTransaction(feeOption)];
|
|
148
|
-
return this.account.sendTransaction(finalTransactions, this.chainId, prepare.feeQuote, undefined, undefined,
|
|
149
|
-
nonceSpace: this.options.nonceSpace
|
|
150
|
-
|
|
148
|
+
return this.account.sendTransaction(finalTransactions, this.chainId, prepare.feeQuote, undefined, undefined, {
|
|
149
|
+
nonceSpace: (_this$options5 = this.options) == null ? void 0 : _this$options5.nonceSpace,
|
|
150
|
+
projectAccessKey: options == null ? void 0 : options.projectAccessKey,
|
|
151
|
+
waitForReceipt: options == null ? void 0 : options.waitForReceipt
|
|
152
|
+
}); // Will always have a transaction response
|
|
151
153
|
}
|
|
152
154
|
getBalance(blockTag) {
|
|
153
155
|
return this.provider.getBalance(this.account.address, blockTag);
|
|
@@ -931,7 +933,7 @@ class Account {
|
|
|
931
933
|
failedChains
|
|
932
934
|
};
|
|
933
935
|
}
|
|
934
|
-
async sendSignedTransactions(signedBundle, chainId, quote, pstatus, callback, projectAccessKey) {
|
|
936
|
+
async sendSignedTransactions(signedBundle, chainId, quote, pstatus, callback, projectAccessKey, waitForReceipt) {
|
|
935
937
|
if (!Array.isArray(signedBundle)) {
|
|
936
938
|
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback, projectAccessKey);
|
|
937
939
|
}
|
|
@@ -939,7 +941,7 @@ class Account {
|
|
|
939
941
|
this.mustBeFullyMigrated(status);
|
|
940
942
|
const decoratedBundle = await this.decorateTransactions(signedBundle, status, chainId);
|
|
941
943
|
callback == null || callback(decoratedBundle);
|
|
942
|
-
return this.relayer(chainId).relay(decoratedBundle, quote,
|
|
944
|
+
return this.relayer(chainId).relay(decoratedBundle, quote, waitForReceipt, projectAccessKey);
|
|
943
945
|
}
|
|
944
946
|
async fillGasLimits(txs, chainId, status) {
|
|
945
947
|
const wallet = this.walletForStatus(chainId, status || (await this.status(chainId)));
|
|
@@ -1004,7 +1006,7 @@ class Account {
|
|
|
1004
1006
|
bundles.push(signed);
|
|
1005
1007
|
}
|
|
1006
1008
|
bundles.push(...childBundles.filter(b => b.transactions.length > 0));
|
|
1007
|
-
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback, options == null ? void 0 : options.projectAccessKey);
|
|
1009
|
+
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback, options == null ? void 0 : options.projectAccessKey, options == null ? void 0 : options.waitForReceipt);
|
|
1008
1010
|
}
|
|
1009
1011
|
async signTypedData(domain, types, message, chainId, cantValidateBehavior = 'ignore') {
|
|
1010
1012
|
const digest = utils.encodeTypedDataDigest({
|
|
@@ -145,9 +145,11 @@ class AccountSigner {
|
|
|
145
145
|
const selectMethod = (_this$options$selectF = (_this$options4 = this.options) == null ? void 0 : _this$options4.selectFee) != null ? _this$options$selectF : this.defaultSelectFee.bind(this);
|
|
146
146
|
const feeOption = await selectMethod(txs, prepare.feeOptions);
|
|
147
147
|
const finalTransactions = [...prepare.transactions, ...encodeGasRefundTransaction(feeOption)];
|
|
148
|
-
return this.account.sendTransaction(finalTransactions, this.chainId, prepare.feeQuote, undefined, undefined,
|
|
149
|
-
nonceSpace: this.options.nonceSpace
|
|
150
|
-
|
|
148
|
+
return this.account.sendTransaction(finalTransactions, this.chainId, prepare.feeQuote, undefined, undefined, {
|
|
149
|
+
nonceSpace: (_this$options5 = this.options) == null ? void 0 : _this$options5.nonceSpace,
|
|
150
|
+
projectAccessKey: options == null ? void 0 : options.projectAccessKey,
|
|
151
|
+
waitForReceipt: options == null ? void 0 : options.waitForReceipt
|
|
152
|
+
}); // Will always have a transaction response
|
|
151
153
|
}
|
|
152
154
|
getBalance(blockTag) {
|
|
153
155
|
return this.provider.getBalance(this.account.address, blockTag);
|
|
@@ -931,7 +933,7 @@ class Account {
|
|
|
931
933
|
failedChains
|
|
932
934
|
};
|
|
933
935
|
}
|
|
934
|
-
async sendSignedTransactions(signedBundle, chainId, quote, pstatus, callback, projectAccessKey) {
|
|
936
|
+
async sendSignedTransactions(signedBundle, chainId, quote, pstatus, callback, projectAccessKey, waitForReceipt) {
|
|
935
937
|
if (!Array.isArray(signedBundle)) {
|
|
936
938
|
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback, projectAccessKey);
|
|
937
939
|
}
|
|
@@ -939,7 +941,7 @@ class Account {
|
|
|
939
941
|
this.mustBeFullyMigrated(status);
|
|
940
942
|
const decoratedBundle = await this.decorateTransactions(signedBundle, status, chainId);
|
|
941
943
|
callback == null || callback(decoratedBundle);
|
|
942
|
-
return this.relayer(chainId).relay(decoratedBundle, quote,
|
|
944
|
+
return this.relayer(chainId).relay(decoratedBundle, quote, waitForReceipt, projectAccessKey);
|
|
943
945
|
}
|
|
944
946
|
async fillGasLimits(txs, chainId, status) {
|
|
945
947
|
const wallet = this.walletForStatus(chainId, status || (await this.status(chainId)));
|
|
@@ -1004,7 +1006,7 @@ class Account {
|
|
|
1004
1006
|
bundles.push(signed);
|
|
1005
1007
|
}
|
|
1006
1008
|
bundles.push(...childBundles.filter(b => b.transactions.length > 0));
|
|
1007
|
-
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback, options == null ? void 0 : options.projectAccessKey);
|
|
1009
|
+
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback, options == null ? void 0 : options.projectAccessKey, options == null ? void 0 : options.waitForReceipt);
|
|
1008
1010
|
}
|
|
1009
1011
|
async signTypedData(domain, types, message, chainId, cantValidateBehavior = 'ignore') {
|
|
1010
1012
|
const digest = utils.encodeTypedDataDigest({
|
|
@@ -141,9 +141,11 @@ class AccountSigner {
|
|
|
141
141
|
const selectMethod = (_this$options$selectF = (_this$options4 = this.options) == null ? void 0 : _this$options4.selectFee) != null ? _this$options$selectF : this.defaultSelectFee.bind(this);
|
|
142
142
|
const feeOption = await selectMethod(txs, prepare.feeOptions);
|
|
143
143
|
const finalTransactions = [...prepare.transactions, ...encodeGasRefundTransaction(feeOption)];
|
|
144
|
-
return this.account.sendTransaction(finalTransactions, this.chainId, prepare.feeQuote, undefined, undefined,
|
|
145
|
-
nonceSpace: this.options.nonceSpace
|
|
146
|
-
|
|
144
|
+
return this.account.sendTransaction(finalTransactions, this.chainId, prepare.feeQuote, undefined, undefined, {
|
|
145
|
+
nonceSpace: (_this$options5 = this.options) == null ? void 0 : _this$options5.nonceSpace,
|
|
146
|
+
projectAccessKey: options == null ? void 0 : options.projectAccessKey,
|
|
147
|
+
waitForReceipt: options == null ? void 0 : options.waitForReceipt
|
|
148
|
+
}); // Will always have a transaction response
|
|
147
149
|
}
|
|
148
150
|
getBalance(blockTag) {
|
|
149
151
|
return this.provider.getBalance(this.account.address, blockTag);
|
|
@@ -927,7 +929,7 @@ class Account {
|
|
|
927
929
|
failedChains
|
|
928
930
|
};
|
|
929
931
|
}
|
|
930
|
-
async sendSignedTransactions(signedBundle, chainId, quote, pstatus, callback, projectAccessKey) {
|
|
932
|
+
async sendSignedTransactions(signedBundle, chainId, quote, pstatus, callback, projectAccessKey, waitForReceipt) {
|
|
931
933
|
if (!Array.isArray(signedBundle)) {
|
|
932
934
|
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback, projectAccessKey);
|
|
933
935
|
}
|
|
@@ -935,7 +937,7 @@ class Account {
|
|
|
935
937
|
this.mustBeFullyMigrated(status);
|
|
936
938
|
const decoratedBundle = await this.decorateTransactions(signedBundle, status, chainId);
|
|
937
939
|
callback == null || callback(decoratedBundle);
|
|
938
|
-
return this.relayer(chainId).relay(decoratedBundle, quote,
|
|
940
|
+
return this.relayer(chainId).relay(decoratedBundle, quote, waitForReceipt, projectAccessKey);
|
|
939
941
|
}
|
|
940
942
|
async fillGasLimits(txs, chainId, status) {
|
|
941
943
|
const wallet = this.walletForStatus(chainId, status || (await this.status(chainId)));
|
|
@@ -1000,7 +1002,7 @@ class Account {
|
|
|
1000
1002
|
bundles.push(signed);
|
|
1001
1003
|
}
|
|
1002
1004
|
bundles.push(...childBundles.filter(b => b.transactions.length > 0));
|
|
1003
|
-
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback, options == null ? void 0 : options.projectAccessKey);
|
|
1005
|
+
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback, options == null ? void 0 : options.projectAccessKey, options == null ? void 0 : options.waitForReceipt);
|
|
1004
1006
|
}
|
|
1005
1007
|
async signTypedData(domain, types, message, chainId, cantValidateBehavior = 'ignore') {
|
|
1006
1008
|
const digest = encodeTypedDataDigest({
|
|
@@ -140,7 +140,7 @@ export declare class Account {
|
|
|
140
140
|
migratedAllChains: boolean;
|
|
141
141
|
failedChains: number[];
|
|
142
142
|
}>;
|
|
143
|
-
sendSignedTransactions(signedBundle: commons.transaction.IntendedTransactionBundle | commons.transaction.IntendedTransactionBundle[], chainId: ethers.BigNumberish, quote?: FeeQuote, pstatus?: AccountStatus, callback?: (bundle: commons.transaction.IntendedTransactionBundle) => void, projectAccessKey?: string): Promise<
|
|
143
|
+
sendSignedTransactions(signedBundle: commons.transaction.IntendedTransactionBundle | commons.transaction.IntendedTransactionBundle[], chainId: ethers.BigNumberish, quote?: FeeQuote, pstatus?: AccountStatus, callback?: (bundle: commons.transaction.IntendedTransactionBundle) => void, projectAccessKey?: string, waitForReceipt?: boolean): Promise<commons.transaction.TransactionResponse>;
|
|
144
144
|
fillGasLimits(txs: commons.transaction.Transactionish, chainId: ethers.BigNumberish, status?: AccountStatus): Promise<commons.transaction.SimulatedTransaction[]>;
|
|
145
145
|
gasRefundQuotes(txs: commons.transaction.Transactionish, chainId: ethers.BigNumberish, stubSignatureOverrides: Map<string, string>, status?: AccountStatus, options?: {
|
|
146
146
|
simulate?: boolean;
|
|
@@ -161,7 +161,8 @@ export declare class Account {
|
|
|
161
161
|
nonceSpace?: ethers.BigNumberish;
|
|
162
162
|
serial?: boolean;
|
|
163
163
|
projectAccessKey?: string;
|
|
164
|
-
|
|
164
|
+
waitForReceipt?: boolean;
|
|
165
|
+
}): Promise<commons.transaction.TransactionResponse | undefined>;
|
|
165
166
|
signTypedData(domain: ethers.TypedDataDomain, types: Record<string, Array<ethers.TypedDataField>>, message: Record<string, any>, chainId: ethers.BigNumberish, cantValidateBehavior?: 'ignore' | 'eip6492' | 'throw'): Promise<string>;
|
|
166
167
|
getSigners(): Promise<Array<{
|
|
167
168
|
address: string;
|
|
@@ -39,7 +39,9 @@ export declare class AccountSigner implements ethers.AbstractSigner<ethers.Provi
|
|
|
39
39
|
private defaultSelectFee;
|
|
40
40
|
sendTransaction(txs: commons.transaction.Transactionish, options?: {
|
|
41
41
|
simulateForFeeOptions?: boolean;
|
|
42
|
-
|
|
42
|
+
projectAccessKey?: string;
|
|
43
|
+
waitForReceipt?: boolean;
|
|
44
|
+
}): Promise<commons.transaction.TransactionResponse>;
|
|
43
45
|
getBalance(blockTag?: ethers.BlockTag | undefined): Promise<bigint>;
|
|
44
46
|
call(transaction: ethers.TransactionRequest, blockTag?: ethers.BlockTag): Promise<string>;
|
|
45
47
|
resolveName(name: string): Promise<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/account",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.27",
|
|
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",
|
|
@@ -12,21 +12,21 @@
|
|
|
12
12
|
"ethers": ">=6"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@0xsequence/abi": "2.3.
|
|
16
|
-
"@0xsequence/core": "2.3.
|
|
17
|
-
"@0xsequence/
|
|
18
|
-
"@0xsequence/
|
|
19
|
-
"@0xsequence/relayer": "2.3.
|
|
20
|
-
"@0xsequence/utils": "2.3.
|
|
21
|
-
"@0xsequence/sessions": "2.3.
|
|
22
|
-
"@0xsequence/wallet": "2.3.
|
|
15
|
+
"@0xsequence/abi": "2.3.27",
|
|
16
|
+
"@0xsequence/core": "2.3.27",
|
|
17
|
+
"@0xsequence/network": "2.3.27",
|
|
18
|
+
"@0xsequence/migration": "2.3.27",
|
|
19
|
+
"@0xsequence/relayer": "2.3.27",
|
|
20
|
+
"@0xsequence/utils": "2.3.27",
|
|
21
|
+
"@0xsequence/sessions": "2.3.27",
|
|
22
|
+
"@0xsequence/wallet": "2.3.27"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
26
26
|
"ethers": "6.13.4",
|
|
27
27
|
"nyc": "^15.1.0",
|
|
28
|
-
"@0xsequence/signhub": "2.3.
|
|
29
|
-
"@0xsequence/tests": "2.3.
|
|
28
|
+
"@0xsequence/signhub": "2.3.27",
|
|
29
|
+
"@0xsequence/tests": "2.3.27"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"src",
|
package/src/account.ts
CHANGED
|
@@ -946,8 +946,9 @@ export class Account {
|
|
|
946
946
|
quote?: FeeQuote,
|
|
947
947
|
pstatus?: AccountStatus,
|
|
948
948
|
callback?: (bundle: commons.transaction.IntendedTransactionBundle) => void,
|
|
949
|
-
projectAccessKey?: string
|
|
950
|
-
|
|
949
|
+
projectAccessKey?: string,
|
|
950
|
+
waitForReceipt?: boolean
|
|
951
|
+
): Promise<commons.transaction.TransactionResponse> {
|
|
951
952
|
if (!Array.isArray(signedBundle)) {
|
|
952
953
|
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback, projectAccessKey)
|
|
953
954
|
}
|
|
@@ -957,7 +958,7 @@ export class Account {
|
|
|
957
958
|
const decoratedBundle = await this.decorateTransactions(signedBundle, status, chainId)
|
|
958
959
|
callback?.(decoratedBundle)
|
|
959
960
|
|
|
960
|
-
return this.relayer(chainId).relay(decoratedBundle, quote,
|
|
961
|
+
return this.relayer(chainId).relay(decoratedBundle, quote, waitForReceipt, projectAccessKey)
|
|
961
962
|
}
|
|
962
963
|
|
|
963
964
|
async fillGasLimits(
|
|
@@ -1047,9 +1048,10 @@ export class Account {
|
|
|
1047
1048
|
options?: {
|
|
1048
1049
|
nonceSpace?: ethers.BigNumberish
|
|
1049
1050
|
serial?: boolean
|
|
1050
|
-
projectAccessKey?: string
|
|
1051
|
-
|
|
1052
|
-
|
|
1051
|
+
projectAccessKey?: string,
|
|
1052
|
+
waitForReceipt?: boolean
|
|
1053
|
+
}
|
|
1054
|
+
): Promise<commons.transaction.TransactionResponse | undefined> {
|
|
1053
1055
|
const status = await this.status(chainId)
|
|
1054
1056
|
|
|
1055
1057
|
const predecorated = skipPreDecorate ? txs : await this.predecorateTransactions(txs, status, chainId)
|
|
@@ -1064,7 +1066,7 @@ export class Account {
|
|
|
1064
1066
|
}
|
|
1065
1067
|
bundles.push(...childBundles.filter(b => b.transactions.length > 0))
|
|
1066
1068
|
|
|
1067
|
-
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback, options?.projectAccessKey)
|
|
1069
|
+
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback, options?.projectAccessKey, options?.waitForReceipt)
|
|
1068
1070
|
}
|
|
1069
1071
|
|
|
1070
1072
|
async signTypedData(
|
package/src/signer.ts
CHANGED
|
@@ -149,8 +149,10 @@ export class AccountSigner implements ethers.AbstractSigner<ethers.Provider> {
|
|
|
149
149
|
txs: commons.transaction.Transactionish,
|
|
150
150
|
options?: {
|
|
151
151
|
simulateForFeeOptions?: boolean
|
|
152
|
+
projectAccessKey?: string
|
|
153
|
+
waitForReceipt?: boolean
|
|
152
154
|
}
|
|
153
|
-
): Promise<
|
|
155
|
+
): Promise<commons.transaction.TransactionResponse> {
|
|
154
156
|
const prepare = await this.account.prepareTransactions({
|
|
155
157
|
txs,
|
|
156
158
|
chainId: this.chainId,
|
|
@@ -169,12 +171,12 @@ export class AccountSigner implements ethers.AbstractSigner<ethers.Provider> {
|
|
|
169
171
|
prepare.feeQuote,
|
|
170
172
|
undefined,
|
|
171
173
|
undefined,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
) as Promise<
|
|
174
|
+
{
|
|
175
|
+
nonceSpace: this.options?.nonceSpace,
|
|
176
|
+
projectAccessKey: options?.projectAccessKey,
|
|
177
|
+
waitForReceipt: options?.waitForReceipt
|
|
178
|
+
}
|
|
179
|
+
) as Promise<commons.transaction.TransactionResponse> // Will always have a transaction response
|
|
178
180
|
}
|
|
179
181
|
|
|
180
182
|
getBalance(blockTag?: ethers.BlockTag | undefined): Promise<bigint> {
|