@aztec/cli-wallet 3.0.0-nightly.20251003 → 3.0.0-nightly.20251004
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/dest/cmds/cancel_tx.d.ts +2 -2
- package/dest/cmds/cancel_tx.d.ts.map +1 -1
- package/dest/cmds/cancel_tx.js +1 -3
- package/dest/cmds/send.d.ts.map +1 -1
- package/dest/utils/options/fees.d.ts +4 -4
- package/dest/utils/options/fees.d.ts.map +1 -1
- package/dest/utils/wallet.d.ts +2 -2
- package/dest/utils/wallet.d.ts.map +1 -1
- package/dest/utils/wallet.js +7 -9
- package/package.json +12 -12
- package/src/cmds/cancel_tx.ts +10 -7
- package/src/cmds/send.ts +9 -2
- package/src/utils/options/fees.ts +4 -8
- package/src/utils/wallet.ts +21 -16
package/dest/cmds/cancel_tx.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { AztecAddress, type FeePaymentMethod, type TxHash } from '@aztec/aztec.js';
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import type { LogFn } from '@aztec/foundation/log';
|
|
4
4
|
import { GasFees, GasSettings } from '@aztec/stdlib/gas';
|
|
@@ -8,5 +8,5 @@ export declare function cancelTx(wallet: CLIWallet, from: AztecAddress, { txHash
|
|
|
8
8
|
gasSettings: GasSettings;
|
|
9
9
|
txNonce: Fr;
|
|
10
10
|
cancellable: boolean;
|
|
11
|
-
}, paymentMethod:
|
|
11
|
+
}, paymentMethod: FeePaymentMethod | undefined, increasedFees: GasFees, maxFeesPerGas: GasFees | undefined, log: LogFn): Promise<void>;
|
|
12
12
|
//# sourceMappingURL=cancel_tx.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancel_tx.d.ts","sourceRoot":"","sources":["../../src/cmds/cancel_tx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK
|
|
1
|
+
{"version":3,"file":"cancel_tx.d.ts","sourceRoot":"","sources":["../../src/cmds/cancel_tx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,gBAAgB,EAGrB,KAAK,MAAM,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,YAAY,EAClB,EACE,MAAM,EACN,WAAW,EAAE,iBAAiB,EAC9B,OAAO,EACP,WAAW,GACZ,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,EAAE,CAAC;IACZ,WAAW,EAAE,OAAO,CAAC;CACtB,EACD,aAAa,EAAE,gBAAgB,GAAG,SAAS,EAC3C,aAAa,EAAE,OAAO,EACtB,aAAa,EAAE,OAAO,GAAG,SAAS,EAClC,GAAG,EAAE,KAAK,iBAwCX"}
|
package/dest/cmds/cancel_tx.js
CHANGED
|
@@ -14,9 +14,7 @@ export async function cancelTx(wallet, from, { txHash, gasSettings: prevTxGasSet
|
|
|
14
14
|
...prevTxGasSettings,
|
|
15
15
|
maxPriorityFeesPerGas,
|
|
16
16
|
maxFeesPerGas: maxFeesPerGas ?? prevTxGasSettings.maxFeesPerGas
|
|
17
|
-
})
|
|
18
|
-
endSetup: false,
|
|
19
|
-
isFeePayer: false
|
|
17
|
+
})
|
|
20
18
|
};
|
|
21
19
|
const txProvingResult = await wallet.proveCancellationTx(from, txNonce, feeOptions);
|
|
22
20
|
const sentTx = new SentTx(wallet, async ()=>{
|
package/dest/cmds/send.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/cmds/send.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/cmds/send.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,EAAE,EAEH,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,wBAAsB,IAAI,CACxB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,YAAY,EAClB,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,GAAG,EAAE,EACrB,oBAAoB,EAAE,MAAM,EAC5B,eAAe,EAAE,YAAY,EAC7B,IAAI,EAAE,OAAO,EACb,WAAW,EAAE,OAAO,EACpB,OAAO,EAAE,UAAU,EACnB,aAAa,EAAE,WAAW,EAAE,EAC5B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,KAAK;;;;;eA4DX"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AztecNode, FeeOptions, FeePaymentMethod, FieldsOf, Wallet } from '@aztec/aztec.js';
|
|
2
2
|
import type { LogFn } from '@aztec/foundation/log';
|
|
3
3
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
import { GasFees, GasSettings } from '@aztec/stdlib/gas';
|
|
@@ -12,17 +12,17 @@ export type RawCliFeeArgs = {
|
|
|
12
12
|
maxPriorityFeesPerGas?: string;
|
|
13
13
|
};
|
|
14
14
|
export type ParsedFeeOptions = {
|
|
15
|
-
paymentMethod?:
|
|
15
|
+
paymentMethod?: FeePaymentMethod;
|
|
16
16
|
gasSettings?: Partial<FieldsOf<GasSettings>>;
|
|
17
17
|
};
|
|
18
18
|
export declare function getPaymentMethodOption(): Option;
|
|
19
|
-
export declare function parsePaymentMethod(payment: string, log: LogFn, db?: WalletDB): (wallet: Wallet, from: AztecAddress, gasSettings: GasSettings) => Promise<
|
|
19
|
+
export declare function parsePaymentMethod(payment: string, log: LogFn, db?: WalletDB): (wallet: Wallet, from: AztecAddress, gasSettings: GasSettings) => Promise<FeePaymentMethod | undefined>;
|
|
20
20
|
export declare function parseGasFees(gasFees: string): GasFees;
|
|
21
21
|
export declare class CLIFeeArgs {
|
|
22
22
|
estimateOnly: boolean;
|
|
23
23
|
private paymentMethod;
|
|
24
24
|
private gasSettings;
|
|
25
|
-
constructor(estimateOnly: boolean, paymentMethod: (wallet: Wallet, feePayer: AztecAddress, gasSettings: GasSettings) => Promise<
|
|
25
|
+
constructor(estimateOnly: boolean, paymentMethod: (wallet: Wallet, feePayer: AztecAddress, gasSettings: GasSettings) => Promise<FeePaymentMethod | undefined>, gasSettings: Partial<FieldsOf<GasSettings>>);
|
|
26
26
|
toUserFeeOptions(node: AztecNode, wallet: Wallet, from: AztecAddress): Promise<ParsedFeeOptions>;
|
|
27
27
|
static parse(args: RawCliFeeArgs, log: LogFn, db?: WalletDB): CLIFeeArgs;
|
|
28
28
|
static getOptions(): Option[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fees.d.ts","sourceRoot":"","sources":["../../../src/utils/options/fees.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE
|
|
1
|
+
{"version":3,"file":"fees.d.ts","sourceRoot":"","sources":["../../../src/utils/options/fees.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEjG,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAO,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAI3D,MAAM,MAAM,aAAa,GAAG;IAC1B,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;CAC9C,CAAC;AAyDF,wBAAgB,sBAAsB,WAGrC;AA0BD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,KAAK,EACV,EAAE,CAAC,EAAE,QAAQ,GACZ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,KAAK,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CA+EzG;AAyBD,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAkBrD;AACD,qBAAa,UAAU;IAEZ,YAAY,EAAE,OAAO;IAC5B,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,WAAW;gBANZ,YAAY,EAAE,OAAO,EACpB,aAAa,EAAE,CACrB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,WAAW,KACrB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,EAClC,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAG/C,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAUtG,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,UAAU;IAQxE,MAAM,CAAC,UAAU;CAGlB;AAID,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,UAAU,EACnB,YAAY,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,mBAAmB,CAAC,EAClE,GAAG,EAAE,KAAK,QAIX"}
|
package/dest/utils/wallet.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Account, AccountManager, type Aliased, type AztecNode, BaseWallet, type
|
|
1
|
+
import { type Account, AccountManager, type Aliased, type AztecNode, BaseWallet, type InteractionFeeOptions, type SimulateOptions, UniqueNote } from '@aztec/aztec.js';
|
|
2
2
|
import { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
3
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
4
|
import type { LogFn } from '@aztec/foundation/log';
|
|
@@ -19,7 +19,7 @@ export declare class CLIWallet extends BaseWallet {
|
|
|
19
19
|
static create(node: AztecNode, log: LogFn, db?: WalletDB, overridePXEConfig?: Partial<PXEConfig>): Promise<CLIWallet>;
|
|
20
20
|
getAccounts(): Promise<Aliased<AztecAddress>[]>;
|
|
21
21
|
private createCancellationTxExecutionRequest;
|
|
22
|
-
proveCancellationTx(from: AztecAddress, txNonce: Fr, increasedFee:
|
|
22
|
+
proveCancellationTx(from: AztecAddress, txNonce: Fr, increasedFee: InteractionFeeOptions): Promise<TxProvingResult>;
|
|
23
23
|
getAccountFromAddress(address: AztecAddress): Promise<Account>;
|
|
24
24
|
private createAccount;
|
|
25
25
|
createOrRetrieveAccount(address?: AztecAddress, secretKey?: Fr, type?: AccountType, salt?: Fr, publicKey?: string): Promise<AccountManager>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/utils/wallet.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,OAAO,EAEZ,cAAc,EACd,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,UAAU,EACV,KAAK,
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/utils/wallet.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,OAAO,EAEZ,cAAc,EACd,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,UAAU,EACV,KAAK,qBAAqB,EAE1B,KAAK,eAAe,EACpB,UAAU,EAGX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAA0B,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAIxD,eAAO,MAAM,YAAY,+EAAgF,CAAC;AAC1G,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAExD,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC,qBAAa,SAAU,SAAQ,UAAU;IAMrC,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,EAAE,CAAC;IANb,OAAO,CAAC,YAAY,CAA8B;gBAGhD,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,SAAS,EACP,OAAO,EAAE,KAAK,EACd,EAAE,CAAC,EAAE,QAAQ,YAAA;WAMV,MAAM,CACjB,IAAI,EAAE,SAAS,EACf,GAAG,EAAE,KAAK,EACV,EAAE,CAAC,EAAE,QAAQ,EACb,iBAAiB,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GACrC,OAAO,CAAC,SAAS,CAAC;IAMN,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;YAKhD,oCAAoC;IAoB5C,mBAAmB,CACvB,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,EAAE,EACX,YAAY,EAAE,qBAAqB,GAClC,OAAO,CAAC,eAAe,CAAC;IAKZ,qBAAqB,CAAC,OAAO,EAAE,YAAY;YAkB5C,aAAa;IAWrB,uBAAuB,CAC3B,OAAO,CAAC,EAAE,YAAY,EACtB,SAAS,CAAC,EAAE,EAAE,EACd,IAAI,GAAE,WAAuB,EAC7B,IAAI,CAAC,EAAE,EAAE,EACT,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,cAAc,CAAC;YAqDZ,qBAAqB;IAmBpB,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAqDjH,YAAY,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAMvC,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;CAGrD"}
|
package/dest/utils/wallet.js
CHANGED
|
@@ -3,7 +3,6 @@ import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
|
|
|
3
3
|
import { StubAccountContractArtifact, createStubAccount } from '@aztec/accounts/stub';
|
|
4
4
|
import { getIdentities } from '@aztec/accounts/utils';
|
|
5
5
|
import { AccountManager, BaseWallet, SignerlessAccount, getContractInstanceFromInstantiationParams, getGasLimits } from '@aztec/aztec.js';
|
|
6
|
-
import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
|
|
7
6
|
import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/entrypoints/payload';
|
|
8
7
|
import { Fr } from '@aztec/foundation/fields';
|
|
9
8
|
import { createPXE, getPXEConfig } from '@aztec/pxe/server';
|
|
@@ -39,15 +38,15 @@ export class CLIWallet extends BaseWallet {
|
|
|
39
38
|
})));
|
|
40
39
|
}
|
|
41
40
|
async createCancellationTxExecutionRequest(from, txNonce, increasedFee) {
|
|
42
|
-
const
|
|
41
|
+
const feeOptions = await this.getDefaultFeeOptions(from, increasedFee);
|
|
42
|
+
const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
|
|
43
43
|
const fromAccount = await this.getAccountFromAddress(from);
|
|
44
44
|
const executionOptions = {
|
|
45
45
|
txNonce,
|
|
46
46
|
cancellable: this.cancellableTransactions,
|
|
47
|
-
|
|
48
|
-
endSetup: increasedFee.endSetup
|
|
47
|
+
feePaymentMethodOptions: feeOptions.accountFeePaymentMethodOptions
|
|
49
48
|
};
|
|
50
|
-
return await fromAccount.createTxExecutionRequest(feeExecutionPayload ?? ExecutionPayload.empty(),
|
|
49
|
+
return await fromAccount.createTxExecutionRequest(feeExecutionPayload ?? ExecutionPayload.empty(), feeOptions.gasSettings, executionOptions);
|
|
51
50
|
}
|
|
52
51
|
async proveCancellationTx(from, txNonce, increasedFee) {
|
|
53
52
|
const cancellationTxRequest = await this.createCancellationTxExecutionRequest(from, txNonce, increasedFee);
|
|
@@ -57,7 +56,7 @@ export class CLIWallet extends BaseWallet {
|
|
|
57
56
|
let account;
|
|
58
57
|
if (address.equals(AztecAddress.ZERO)) {
|
|
59
58
|
const chainInfo = await this.getChainInfo();
|
|
60
|
-
account = new SignerlessAccount(
|
|
59
|
+
account = new SignerlessAccount(chainInfo);
|
|
61
60
|
} else if (this.accountCache.has(address.toString())) {
|
|
62
61
|
return this.accountCache.get(address.toString());
|
|
63
62
|
} else {
|
|
@@ -143,12 +142,11 @@ export class CLIWallet extends BaseWallet {
|
|
|
143
142
|
async simulateTx(executionPayload, opts) {
|
|
144
143
|
let simulationResults;
|
|
145
144
|
const feeOptions = opts.fee?.estimateGas ? await this.getFeeOptionsForGasEstimation(opts.from, opts.fee) : await this.getDefaultFeeOptions(opts.from, opts.fee);
|
|
146
|
-
const feeExecutionPayload = await feeOptions.
|
|
145
|
+
const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
|
|
147
146
|
const executionOptions = {
|
|
148
147
|
txNonce: Fr.random(),
|
|
149
148
|
cancellable: this.cancellableTransactions,
|
|
150
|
-
|
|
151
|
-
endSetup: feeOptions.endSetup
|
|
149
|
+
feePaymentMethodOptions: feeOptions.accountFeePaymentMethodOptions
|
|
152
150
|
};
|
|
153
151
|
const finalExecutionPayload = feeExecutionPayload ? mergeExecutionPayloads([
|
|
154
152
|
feeExecutionPayload,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/cli-wallet",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20251004",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/cmds/index.js",
|
|
@@ -67,17 +67,17 @@
|
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@aztec/accounts": "3.0.0-nightly.
|
|
71
|
-
"@aztec/aztec.js": "3.0.0-nightly.
|
|
72
|
-
"@aztec/cli": "3.0.0-nightly.
|
|
73
|
-
"@aztec/entrypoints": "3.0.0-nightly.
|
|
74
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
75
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
76
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
77
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
78
|
-
"@aztec/noir-noirc_abi": "3.0.0-nightly.
|
|
79
|
-
"@aztec/pxe": "3.0.0-nightly.
|
|
80
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
70
|
+
"@aztec/accounts": "3.0.0-nightly.20251004",
|
|
71
|
+
"@aztec/aztec.js": "3.0.0-nightly.20251004",
|
|
72
|
+
"@aztec/cli": "3.0.0-nightly.20251004",
|
|
73
|
+
"@aztec/entrypoints": "3.0.0-nightly.20251004",
|
|
74
|
+
"@aztec/ethereum": "3.0.0-nightly.20251004",
|
|
75
|
+
"@aztec/foundation": "3.0.0-nightly.20251004",
|
|
76
|
+
"@aztec/kv-store": "3.0.0-nightly.20251004",
|
|
77
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20251004",
|
|
78
|
+
"@aztec/noir-noirc_abi": "3.0.0-nightly.20251004",
|
|
79
|
+
"@aztec/pxe": "3.0.0-nightly.20251004",
|
|
80
|
+
"@aztec/stdlib": "3.0.0-nightly.20251004",
|
|
81
81
|
"commander": "^12.1.0",
|
|
82
82
|
"inquirer": "^10.1.8",
|
|
83
83
|
"source-map-support": "^0.5.21",
|
package/src/cmds/cancel_tx.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
type AppConfigurableFeePaymentMethod,
|
|
3
2
|
AztecAddress,
|
|
4
|
-
type
|
|
3
|
+
type FeePaymentMethod,
|
|
4
|
+
type InteractionFeeOptions,
|
|
5
5
|
SentTx,
|
|
6
6
|
type TxHash,
|
|
7
7
|
TxStatus,
|
|
@@ -21,8 +21,13 @@ export async function cancelTx(
|
|
|
21
21
|
gasSettings: prevTxGasSettings,
|
|
22
22
|
txNonce,
|
|
23
23
|
cancellable,
|
|
24
|
-
}: {
|
|
25
|
-
|
|
24
|
+
}: {
|
|
25
|
+
txHash: TxHash;
|
|
26
|
+
gasSettings: GasSettings;
|
|
27
|
+
txNonce: Fr;
|
|
28
|
+
cancellable: boolean;
|
|
29
|
+
},
|
|
30
|
+
paymentMethod: FeePaymentMethod | undefined,
|
|
26
31
|
increasedFees: GasFees,
|
|
27
32
|
maxFeesPerGas: GasFees | undefined,
|
|
28
33
|
log: LogFn,
|
|
@@ -38,15 +43,13 @@ export async function cancelTx(
|
|
|
38
43
|
prevTxGasSettings.maxPriorityFeesPerGas.feePerL2Gas + increasedFees.feePerL2Gas,
|
|
39
44
|
);
|
|
40
45
|
|
|
41
|
-
const feeOptions:
|
|
46
|
+
const feeOptions: InteractionFeeOptions = {
|
|
42
47
|
paymentMethod,
|
|
43
48
|
gasSettings: GasSettings.from({
|
|
44
49
|
...prevTxGasSettings,
|
|
45
50
|
maxPriorityFeesPerGas,
|
|
46
51
|
maxFeesPerGas: maxFeesPerGas ?? prevTxGasSettings.maxFeesPerGas,
|
|
47
52
|
}),
|
|
48
|
-
endSetup: false,
|
|
49
|
-
isFeePayer: false,
|
|
50
53
|
};
|
|
51
54
|
|
|
52
55
|
const txProvingResult = await wallet.proveCancellationTx(from, txNonce, feeOptions);
|
package/src/cmds/send.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AuthWitness,
|
|
3
|
+
type AztecAddress,
|
|
4
|
+
type AztecNode,
|
|
5
|
+
Contract,
|
|
6
|
+
Fr,
|
|
7
|
+
type SendInteractionOptions,
|
|
8
|
+
} from '@aztec/aztec.js';
|
|
2
9
|
import { prepTx } from '@aztec/cli/utils';
|
|
3
10
|
import type { LogFn } from '@aztec/foundation/log';
|
|
4
11
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
@@ -31,7 +38,7 @@ export async function send(
|
|
|
31
38
|
const txNonce = Fr.random();
|
|
32
39
|
|
|
33
40
|
const { paymentMethod, gasSettings } = await feeOpts.toUserFeeOptions(node, wallet, from);
|
|
34
|
-
const sendOptions:
|
|
41
|
+
const sendOptions: SendInteractionOptions = {
|
|
35
42
|
fee: { paymentMethod, gasSettings },
|
|
36
43
|
from,
|
|
37
44
|
authWitnesses,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AztecNode, FeeOptions, FeePaymentMethod, FieldsOf, Wallet } from '@aztec/aztec.js';
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import type { LogFn } from '@aztec/foundation/log';
|
|
4
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
@@ -19,7 +19,7 @@ export type RawCliFeeArgs = {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export type ParsedFeeOptions = {
|
|
22
|
-
paymentMethod?:
|
|
22
|
+
paymentMethod?: FeePaymentMethod;
|
|
23
23
|
gasSettings?: Partial<FieldsOf<GasSettings>>;
|
|
24
24
|
};
|
|
25
25
|
|
|
@@ -111,11 +111,7 @@ export function parsePaymentMethod(
|
|
|
111
111
|
payment: string,
|
|
112
112
|
log: LogFn,
|
|
113
113
|
db?: WalletDB,
|
|
114
|
-
): (
|
|
115
|
-
wallet: Wallet,
|
|
116
|
-
from: AztecAddress,
|
|
117
|
-
gasSettings: GasSettings,
|
|
118
|
-
) => Promise<AppConfigurableFeePaymentMethod | undefined> {
|
|
114
|
+
): (wallet: Wallet, from: AztecAddress, gasSettings: GasSettings) => Promise<FeePaymentMethod | undefined> {
|
|
119
115
|
const parsed = payment.split(',').reduce(
|
|
120
116
|
(acc, item) => {
|
|
121
117
|
const [dimension, value] = item.split('=');
|
|
@@ -245,7 +241,7 @@ export class CLIFeeArgs {
|
|
|
245
241
|
wallet: Wallet,
|
|
246
242
|
feePayer: AztecAddress,
|
|
247
243
|
gasSettings: GasSettings,
|
|
248
|
-
) => Promise<
|
|
244
|
+
) => Promise<FeePaymentMethod | undefined>,
|
|
249
245
|
private gasSettings: Partial<FieldsOf<GasSettings>>,
|
|
250
246
|
) {}
|
|
251
247
|
|
package/src/utils/wallet.ts
CHANGED
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
type Aliased,
|
|
10
10
|
type AztecNode,
|
|
11
11
|
BaseWallet,
|
|
12
|
-
type
|
|
12
|
+
type InteractionFeeOptions,
|
|
13
13
|
SignerlessAccount,
|
|
14
14
|
type SimulateOptions,
|
|
15
15
|
UniqueNote,
|
|
16
16
|
getContractInstanceFromInstantiationParams,
|
|
17
17
|
getGasLimits,
|
|
18
18
|
} from '@aztec/aztec.js';
|
|
19
|
-
import {
|
|
19
|
+
import type { DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
|
|
20
20
|
import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/entrypoints/payload';
|
|
21
21
|
import { Fr } from '@aztec/foundation/fields';
|
|
22
22
|
import type { LogFn } from '@aztec/foundation/log';
|
|
@@ -66,23 +66,31 @@ export class CLIWallet extends BaseWallet {
|
|
|
66
66
|
return Promise.resolve(accounts.map(({ key, value }) => ({ alias: value, item: AztecAddress.fromString(key) })));
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
private async createCancellationTxExecutionRequest(
|
|
70
|
-
|
|
69
|
+
private async createCancellationTxExecutionRequest(
|
|
70
|
+
from: AztecAddress,
|
|
71
|
+
txNonce: Fr,
|
|
72
|
+
increasedFee: InteractionFeeOptions,
|
|
73
|
+
) {
|
|
74
|
+
const feeOptions = await this.getDefaultFeeOptions(from, increasedFee);
|
|
75
|
+
const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
|
|
71
76
|
const fromAccount = await this.getAccountFromAddress(from);
|
|
72
|
-
const executionOptions = {
|
|
77
|
+
const executionOptions: DefaultAccountEntrypointOptions = {
|
|
73
78
|
txNonce,
|
|
74
79
|
cancellable: this.cancellableTransactions,
|
|
75
|
-
|
|
76
|
-
endSetup: increasedFee.endSetup,
|
|
80
|
+
feePaymentMethodOptions: feeOptions.accountFeePaymentMethodOptions,
|
|
77
81
|
};
|
|
78
82
|
return await fromAccount.createTxExecutionRequest(
|
|
79
83
|
feeExecutionPayload ?? ExecutionPayload.empty(),
|
|
80
|
-
|
|
84
|
+
feeOptions.gasSettings,
|
|
81
85
|
executionOptions,
|
|
82
86
|
);
|
|
83
87
|
}
|
|
84
88
|
|
|
85
|
-
async proveCancellationTx(
|
|
89
|
+
async proveCancellationTx(
|
|
90
|
+
from: AztecAddress,
|
|
91
|
+
txNonce: Fr,
|
|
92
|
+
increasedFee: InteractionFeeOptions,
|
|
93
|
+
): Promise<TxProvingResult> {
|
|
86
94
|
const cancellationTxRequest = await this.createCancellationTxExecutionRequest(from, txNonce, increasedFee);
|
|
87
95
|
return await this.pxe.proveTx(cancellationTxRequest);
|
|
88
96
|
}
|
|
@@ -91,9 +99,7 @@ export class CLIWallet extends BaseWallet {
|
|
|
91
99
|
let account: Account | undefined;
|
|
92
100
|
if (address.equals(AztecAddress.ZERO)) {
|
|
93
101
|
const chainInfo = await this.getChainInfo();
|
|
94
|
-
account = new SignerlessAccount(
|
|
95
|
-
new DefaultMultiCallEntrypoint(chainInfo.chainId.toNumber(), chainInfo.version.toNumber()),
|
|
96
|
-
);
|
|
102
|
+
account = new SignerlessAccount(chainInfo);
|
|
97
103
|
} else if (this.accountCache.has(address.toString())) {
|
|
98
104
|
return this.accountCache.get(address.toString())!;
|
|
99
105
|
} else {
|
|
@@ -201,12 +207,11 @@ export class CLIWallet extends BaseWallet {
|
|
|
201
207
|
const feeOptions = opts.fee?.estimateGas
|
|
202
208
|
? await this.getFeeOptionsForGasEstimation(opts.from, opts.fee)
|
|
203
209
|
: await this.getDefaultFeeOptions(opts.from, opts.fee);
|
|
204
|
-
const feeExecutionPayload = await feeOptions.
|
|
205
|
-
const executionOptions = {
|
|
210
|
+
const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
|
|
211
|
+
const executionOptions: DefaultAccountEntrypointOptions = {
|
|
206
212
|
txNonce: Fr.random(),
|
|
207
213
|
cancellable: this.cancellableTransactions,
|
|
208
|
-
|
|
209
|
-
endSetup: feeOptions.endSetup,
|
|
214
|
+
feePaymentMethodOptions: feeOptions.accountFeePaymentMethodOptions,
|
|
210
215
|
};
|
|
211
216
|
const finalExecutionPayload = feeExecutionPayload
|
|
212
217
|
? mergeExecutionPayloads([feeExecutionPayload, executionPayload])
|