@0xsequence/account 2.0.26 → 2.1.0
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.
|
@@ -849,15 +849,15 @@ class Account {
|
|
|
849
849
|
failedChains
|
|
850
850
|
};
|
|
851
851
|
}
|
|
852
|
-
async sendSignedTransactions(signedBundle, chainId, quote, pstatus, callback) {
|
|
852
|
+
async sendSignedTransactions(signedBundle, chainId, quote, pstatus, callback, projectAccessKey) {
|
|
853
853
|
if (!Array.isArray(signedBundle)) {
|
|
854
|
-
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback);
|
|
854
|
+
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback, projectAccessKey);
|
|
855
855
|
}
|
|
856
856
|
const status = pstatus || (await this.status(chainId));
|
|
857
857
|
this.mustBeFullyMigrated(status);
|
|
858
858
|
const decoratedBundle = await this.decorateTransactions(signedBundle, status, chainId);
|
|
859
859
|
callback == null || callback(decoratedBundle);
|
|
860
|
-
return this.relayer(chainId).relay(decoratedBundle, quote);
|
|
860
|
+
return this.relayer(chainId).relay(decoratedBundle, quote, undefined, projectAccessKey);
|
|
861
861
|
}
|
|
862
862
|
async fillGasLimits(txs, chainId, status) {
|
|
863
863
|
const wallet = this.walletForStatus(chainId, status || (await this.status(chainId)));
|
|
@@ -898,7 +898,8 @@ class Account {
|
|
|
898
898
|
const status = await this.status(args.chainId);
|
|
899
899
|
const transactions = await this.fillGasLimits(args.txs, args.chainId, status);
|
|
900
900
|
const gasRefundQuote = await this.gasRefundQuotes(transactions, args.chainId, args.stubSignatureOverrides, status, {
|
|
901
|
-
simulate: args.simulateForFeeOptions
|
|
901
|
+
simulate: args.simulateForFeeOptions,
|
|
902
|
+
projectAccessKey: args.projectAccessKey
|
|
902
903
|
});
|
|
903
904
|
const flatDecorated = core.commons.transaction.unwind(this.address, gasRefundQuote.decorated.transactions);
|
|
904
905
|
return {
|
|
@@ -921,7 +922,7 @@ class Account {
|
|
|
921
922
|
bundles.push(signed);
|
|
922
923
|
}
|
|
923
924
|
bundles.push(...childBundles.filter(b => b.transactions.length > 0));
|
|
924
|
-
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback);
|
|
925
|
+
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback, options == null ? void 0 : options.projectAccessKey);
|
|
925
926
|
}
|
|
926
927
|
async signTypedData(domain, types, message, chainId, cantValidateBehavior = 'ignore') {
|
|
927
928
|
const digest = utils.encodeTypedDataDigest({
|
|
@@ -849,15 +849,15 @@ class Account {
|
|
|
849
849
|
failedChains
|
|
850
850
|
};
|
|
851
851
|
}
|
|
852
|
-
async sendSignedTransactions(signedBundle, chainId, quote, pstatus, callback) {
|
|
852
|
+
async sendSignedTransactions(signedBundle, chainId, quote, pstatus, callback, projectAccessKey) {
|
|
853
853
|
if (!Array.isArray(signedBundle)) {
|
|
854
|
-
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback);
|
|
854
|
+
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback, projectAccessKey);
|
|
855
855
|
}
|
|
856
856
|
const status = pstatus || (await this.status(chainId));
|
|
857
857
|
this.mustBeFullyMigrated(status);
|
|
858
858
|
const decoratedBundle = await this.decorateTransactions(signedBundle, status, chainId);
|
|
859
859
|
callback == null || callback(decoratedBundle);
|
|
860
|
-
return this.relayer(chainId).relay(decoratedBundle, quote);
|
|
860
|
+
return this.relayer(chainId).relay(decoratedBundle, quote, undefined, projectAccessKey);
|
|
861
861
|
}
|
|
862
862
|
async fillGasLimits(txs, chainId, status) {
|
|
863
863
|
const wallet = this.walletForStatus(chainId, status || (await this.status(chainId)));
|
|
@@ -898,7 +898,8 @@ class Account {
|
|
|
898
898
|
const status = await this.status(args.chainId);
|
|
899
899
|
const transactions = await this.fillGasLimits(args.txs, args.chainId, status);
|
|
900
900
|
const gasRefundQuote = await this.gasRefundQuotes(transactions, args.chainId, args.stubSignatureOverrides, status, {
|
|
901
|
-
simulate: args.simulateForFeeOptions
|
|
901
|
+
simulate: args.simulateForFeeOptions,
|
|
902
|
+
projectAccessKey: args.projectAccessKey
|
|
902
903
|
});
|
|
903
904
|
const flatDecorated = core.commons.transaction.unwind(this.address, gasRefundQuote.decorated.transactions);
|
|
904
905
|
return {
|
|
@@ -921,7 +922,7 @@ class Account {
|
|
|
921
922
|
bundles.push(signed);
|
|
922
923
|
}
|
|
923
924
|
bundles.push(...childBundles.filter(b => b.transactions.length > 0));
|
|
924
|
-
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback);
|
|
925
|
+
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback, options == null ? void 0 : options.projectAccessKey);
|
|
925
926
|
}
|
|
926
927
|
async signTypedData(domain, types, message, chainId, cantValidateBehavior = 'ignore') {
|
|
927
928
|
const digest = utils.encodeTypedDataDigest({
|
|
@@ -845,15 +845,15 @@ class Account {
|
|
|
845
845
|
failedChains
|
|
846
846
|
};
|
|
847
847
|
}
|
|
848
|
-
async sendSignedTransactions(signedBundle, chainId, quote, pstatus, callback) {
|
|
848
|
+
async sendSignedTransactions(signedBundle, chainId, quote, pstatus, callback, projectAccessKey) {
|
|
849
849
|
if (!Array.isArray(signedBundle)) {
|
|
850
|
-
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback);
|
|
850
|
+
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback, projectAccessKey);
|
|
851
851
|
}
|
|
852
852
|
const status = pstatus || (await this.status(chainId));
|
|
853
853
|
this.mustBeFullyMigrated(status);
|
|
854
854
|
const decoratedBundle = await this.decorateTransactions(signedBundle, status, chainId);
|
|
855
855
|
callback == null || callback(decoratedBundle);
|
|
856
|
-
return this.relayer(chainId).relay(decoratedBundle, quote);
|
|
856
|
+
return this.relayer(chainId).relay(decoratedBundle, quote, undefined, projectAccessKey);
|
|
857
857
|
}
|
|
858
858
|
async fillGasLimits(txs, chainId, status) {
|
|
859
859
|
const wallet = this.walletForStatus(chainId, status || (await this.status(chainId)));
|
|
@@ -894,7 +894,8 @@ class Account {
|
|
|
894
894
|
const status = await this.status(args.chainId);
|
|
895
895
|
const transactions = await this.fillGasLimits(args.txs, args.chainId, status);
|
|
896
896
|
const gasRefundQuote = await this.gasRefundQuotes(transactions, args.chainId, args.stubSignatureOverrides, status, {
|
|
897
|
-
simulate: args.simulateForFeeOptions
|
|
897
|
+
simulate: args.simulateForFeeOptions,
|
|
898
|
+
projectAccessKey: args.projectAccessKey
|
|
898
899
|
});
|
|
899
900
|
const flatDecorated = commons.transaction.unwind(this.address, gasRefundQuote.decorated.transactions);
|
|
900
901
|
return {
|
|
@@ -917,7 +918,7 @@ class Account {
|
|
|
917
918
|
bundles.push(signed);
|
|
918
919
|
}
|
|
919
920
|
bundles.push(...childBundles.filter(b => b.transactions.length > 0));
|
|
920
|
-
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback);
|
|
921
|
+
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback, options == null ? void 0 : options.projectAccessKey);
|
|
921
922
|
}
|
|
922
923
|
async signTypedData(domain, types, message, chainId, cantValidateBehavior = 'ignore') {
|
|
923
924
|
const digest = encodeTypedDataDigest({
|
|
@@ -128,10 +128,11 @@ export declare class Account {
|
|
|
128
128
|
migratedAllChains: boolean;
|
|
129
129
|
failedChains: number[];
|
|
130
130
|
}>;
|
|
131
|
-
sendSignedTransactions(signedBundle: commons.transaction.IntendedTransactionBundle | commons.transaction.IntendedTransactionBundle[], chainId: ethers.BigNumberish, quote?: FeeQuote, pstatus?: AccountStatus, callback?: (bundle: commons.transaction.IntendedTransactionBundle) => void): Promise<ethers.TransactionResponse>;
|
|
131
|
+
sendSignedTransactions(signedBundle: commons.transaction.IntendedTransactionBundle | commons.transaction.IntendedTransactionBundle[], chainId: ethers.BigNumberish, quote?: FeeQuote, pstatus?: AccountStatus, callback?: (bundle: commons.transaction.IntendedTransactionBundle) => void, projectAccessKey?: string): Promise<ethers.TransactionResponse>;
|
|
132
132
|
fillGasLimits(txs: commons.transaction.Transactionish, chainId: ethers.BigNumberish, status?: AccountStatus): Promise<commons.transaction.SimulatedTransaction[]>;
|
|
133
133
|
gasRefundQuotes(txs: commons.transaction.Transactionish, chainId: ethers.BigNumberish, stubSignatureOverrides: Map<string, string>, status?: AccountStatus, options?: {
|
|
134
134
|
simulate?: boolean;
|
|
135
|
+
projectAccessKey?: string;
|
|
135
136
|
}): Promise<{
|
|
136
137
|
options: FeeOption[];
|
|
137
138
|
quote?: FeeQuote;
|
|
@@ -142,10 +143,12 @@ export declare class Account {
|
|
|
142
143
|
chainId: ethers.BigNumberish;
|
|
143
144
|
stubSignatureOverrides: Map<string, string>;
|
|
144
145
|
simulateForFeeOptions?: boolean;
|
|
146
|
+
projectAccessKey?: string;
|
|
145
147
|
}): Promise<PreparedTransactions>;
|
|
146
148
|
sendTransaction(txs: commons.transaction.Transactionish, chainId: ethers.BigNumberish, quote?: FeeQuote, skipPreDecorate?: boolean, callback?: (bundle: commons.transaction.IntendedTransactionBundle) => void, options?: {
|
|
147
149
|
nonceSpace?: ethers.BigNumberish;
|
|
148
150
|
serial?: boolean;
|
|
151
|
+
projectAccessKey?: string;
|
|
149
152
|
}): Promise<ethers.TransactionResponse | undefined>;
|
|
150
153
|
signTypedData(domain: ethers.TypedDataDomain, types: Record<string, Array<ethers.TypedDataField>>, message: Record<string, any>, chainId: ethers.BigNumberish, cantValidateBehavior?: 'ignore' | 'eip6492' | 'throw'): Promise<string>;
|
|
151
154
|
getSigners(): Promise<Array<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/account",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
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.0
|
|
16
|
-
"@0xsequence/core": "2.0
|
|
17
|
-
"@0xsequence/migration": "2.0
|
|
18
|
-
"@0xsequence/network": "2.0
|
|
19
|
-
"@0xsequence/relayer": "2.0
|
|
20
|
-
"@0xsequence/sessions": "2.0
|
|
21
|
-
"@0xsequence/utils": "2.0
|
|
22
|
-
"@0xsequence/wallet": "2.0
|
|
15
|
+
"@0xsequence/abi": "2.1.0",
|
|
16
|
+
"@0xsequence/core": "2.1.0",
|
|
17
|
+
"@0xsequence/migration": "2.1.0",
|
|
18
|
+
"@0xsequence/network": "2.1.0",
|
|
19
|
+
"@0xsequence/relayer": "2.1.0",
|
|
20
|
+
"@0xsequence/sessions": "2.1.0",
|
|
21
|
+
"@0xsequence/utils": "2.1.0",
|
|
22
|
+
"@0xsequence/wallet": "2.1.0"
|
|
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.0
|
|
29
|
-
"@0xsequence/tests": "2.0
|
|
28
|
+
"@0xsequence/signhub": "2.1.0",
|
|
29
|
+
"@0xsequence/tests": "2.1.0"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"src",
|
package/src/account.ts
CHANGED
|
@@ -880,10 +880,11 @@ export class Account {
|
|
|
880
880
|
chainId: ethers.BigNumberish,
|
|
881
881
|
quote?: FeeQuote,
|
|
882
882
|
pstatus?: AccountStatus,
|
|
883
|
-
callback?: (bundle: commons.transaction.IntendedTransactionBundle) => void
|
|
883
|
+
callback?: (bundle: commons.transaction.IntendedTransactionBundle) => void,
|
|
884
|
+
projectAccessKey?: string
|
|
884
885
|
): Promise<ethers.TransactionResponse> {
|
|
885
886
|
if (!Array.isArray(signedBundle)) {
|
|
886
|
-
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback)
|
|
887
|
+
return this.sendSignedTransactions([signedBundle], chainId, quote, pstatus, callback, projectAccessKey)
|
|
887
888
|
}
|
|
888
889
|
const status = pstatus || (await this.status(chainId))
|
|
889
890
|
this.mustBeFullyMigrated(status)
|
|
@@ -891,7 +892,7 @@ export class Account {
|
|
|
891
892
|
const decoratedBundle = await this.decorateTransactions(signedBundle, status, chainId)
|
|
892
893
|
callback?.(decoratedBundle)
|
|
893
894
|
|
|
894
|
-
return this.relayer(chainId).relay(decoratedBundle, quote)
|
|
895
|
+
return this.relayer(chainId).relay(decoratedBundle, quote, undefined, projectAccessKey)
|
|
895
896
|
}
|
|
896
897
|
|
|
897
898
|
async fillGasLimits(
|
|
@@ -910,6 +911,7 @@ export class Account {
|
|
|
910
911
|
status?: AccountStatus,
|
|
911
912
|
options?: {
|
|
912
913
|
simulate?: boolean
|
|
914
|
+
projectAccessKey?: string
|
|
913
915
|
}
|
|
914
916
|
): Promise<{
|
|
915
917
|
options: FeeOption[]
|
|
@@ -952,12 +954,14 @@ export class Account {
|
|
|
952
954
|
chainId: ethers.BigNumberish
|
|
953
955
|
stubSignatureOverrides: Map<string, string>
|
|
954
956
|
simulateForFeeOptions?: boolean
|
|
957
|
+
projectAccessKey?: string
|
|
955
958
|
}): Promise<PreparedTransactions> {
|
|
956
959
|
const status = await this.status(args.chainId)
|
|
957
960
|
|
|
958
961
|
const transactions = await this.fillGasLimits(args.txs, args.chainId, status)
|
|
959
962
|
const gasRefundQuote = await this.gasRefundQuotes(transactions, args.chainId, args.stubSignatureOverrides, status, {
|
|
960
|
-
simulate: args.simulateForFeeOptions
|
|
963
|
+
simulate: args.simulateForFeeOptions,
|
|
964
|
+
projectAccessKey: args.projectAccessKey
|
|
961
965
|
})
|
|
962
966
|
const flatDecorated = commons.transaction.unwind(this.address, gasRefundQuote.decorated.transactions)
|
|
963
967
|
|
|
@@ -978,6 +982,7 @@ export class Account {
|
|
|
978
982
|
options?: {
|
|
979
983
|
nonceSpace?: ethers.BigNumberish
|
|
980
984
|
serial?: boolean
|
|
985
|
+
projectAccessKey?: string
|
|
981
986
|
}
|
|
982
987
|
): Promise<ethers.TransactionResponse | undefined> {
|
|
983
988
|
const status = await this.status(chainId)
|
|
@@ -994,7 +999,7 @@ export class Account {
|
|
|
994
999
|
}
|
|
995
1000
|
bundles.push(...childBundles.filter(b => b.transactions.length > 0))
|
|
996
1001
|
|
|
997
|
-
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback)
|
|
1002
|
+
return this.sendSignedTransactions(bundles, chainId, quote, undefined, callback, options?.projectAccessKey)
|
|
998
1003
|
}
|
|
999
1004
|
|
|
1000
1005
|
async signTypedData(
|