@aztec/aztec.js 0.86.0 → 0.87.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.
- package/dest/account_manager/deploy_account_sent_tx.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.d.ts +1 -1
- package/dest/contract/base_contract_interaction.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.js +2 -3
- package/dest/contract/batch_call.d.ts.map +1 -1
- package/dest/contract/batch_call.js +1 -1
- package/dest/contract/contract_function_interaction.d.ts +24 -2
- package/dest/contract/contract_function_interaction.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.js +28 -15
- package/dest/contract/deploy_method.d.ts +15 -3
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +13 -5
- package/dest/contract/deploy_proven_tx.d.ts +2 -2
- package/dest/contract/deploy_proven_tx.d.ts.map +1 -1
- package/dest/contract/deploy_proven_tx.js +2 -2
- package/dest/contract/interaction_options.d.ts +4 -2
- package/dest/contract/interaction_options.d.ts.map +1 -1
- package/dest/contract/proven_tx.d.ts +3 -2
- package/dest/contract/proven_tx.d.ts.map +1 -1
- package/dest/contract/proven_tx.js +4 -2
- package/dest/contract/sent_tx.d.ts.map +1 -1
- package/dest/deployment/contract_deployer.d.ts.map +1 -1
- package/dest/ethereum/l1_contracts.d.ts.map +1 -1
- package/dest/ethereum/l1_contracts.js +1 -1
- package/dest/fee/account_entrypoint_meta_payment_method.d.ts.map +1 -1
- package/dest/rpc_clients/node/index.js +9 -15
- package/dest/test/anvil_test_watcher.d.ts.map +1 -1
- package/dest/test/anvil_test_watcher.js +1 -1
- package/dest/test/rollup_cheat_codes.d.ts +5 -0
- package/dest/test/rollup_cheat_codes.d.ts.map +1 -1
- package/dest/test/rollup_cheat_codes.js +16 -0
- package/dest/utils/abi_types.d.ts +0 -2
- package/dest/utils/abi_types.d.ts.map +1 -1
- package/dest/utils/authwit.d.ts +0 -2
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/field_compressed_string.d.ts.map +1 -1
- package/dest/utils/node.d.ts.map +1 -1
- package/dest/utils/node.js +1 -1
- package/dest/utils/pxe.d.ts.map +1 -1
- package/dest/utils/pxe.js +1 -1
- package/dest/wallet/account_wallet.d.ts +0 -2
- package/dest/wallet/account_wallet.d.ts.map +1 -1
- package/dest/wallet/base_wallet.d.ts +4 -6
- package/dest/wallet/base_wallet.d.ts.map +1 -1
- package/dest/wallet/base_wallet.js +2 -2
- package/dest/wallet/signerless_wallet.d.ts +0 -2
- package/dest/wallet/signerless_wallet.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/account_manager/deploy_account_sent_tx.ts +5 -1
- package/src/contract/base_contract_interaction.ts +3 -4
- package/src/contract/batch_call.ts +5 -2
- package/src/contract/contract_function_interaction.ts +52 -7
- package/src/contract/deploy_method.ts +40 -7
- package/src/contract/deploy_proven_tx.ts +3 -2
- package/src/contract/interaction_options.ts +4 -2
- package/src/contract/proven_tx.ts +7 -2
- package/src/contract/sent_tx.ts +4 -1
- package/src/ethereum/l1_contracts.ts +1 -1
- package/src/fee/account_entrypoint_meta_payment_method.ts +2 -3
- package/src/rpc_clients/node/index.ts +8 -8
- package/src/test/anvil_test_watcher.ts +1 -1
- package/src/test/rollup_cheat_codes.ts +20 -1
- package/src/utils/node.ts +1 -1
- package/src/utils/pxe.ts +1 -1
- package/src/wallet/account_wallet.ts +4 -1
- package/src/wallet/base_wallet.ts +6 -4
- package/src/wallet/signerless_wallet.ts +4 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_account_sent_tx.d.ts","sourceRoot":"","sources":["../../src/account_manager/deploy_account_sent_tx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,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,IAAI,GAAE,QAA0B,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAK9F"}
|
|
@@ -60,7 +60,7 @@ export declare abstract class BaseContractInteraction {
|
|
|
60
60
|
* @param pad - Percentage to pad the suggested gas limits by, if empty, defaults to 10%.
|
|
61
61
|
* @returns Gas limits.
|
|
62
62
|
*/
|
|
63
|
-
estimateGas(opts?: Omit<SendMethodOptions, 'estimateGas'
|
|
63
|
+
estimateGas(opts?: Omit<SendMethodOptions, 'estimateGas'>): Promise<Pick<GasSettings, 'gasLimits' | 'teardownGasLimits'>>;
|
|
64
64
|
/**
|
|
65
65
|
* Returns default fee options based on the user opts without running a simulation for gas estimation.
|
|
66
66
|
* @param fee - User-provided fee options.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base_contract_interaction.d.ts","sourceRoot":"","sources":["../../src/contract/base_contract_interaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGrF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;;;GAGG;AACH,8BAAsB,uBAAuB;IAIzC,SAAS,CAAC,MAAM,EAAE,MAAM;IACxB,SAAS,CAAC,aAAa,EAAE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,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE;IAL/B,SAAS,CAAC,GAAG,yCAAgD;gBAGjD,MAAM,EAAE,MAAM,EACd,aAAa,GAAE,WAAW,EAAO,EACjC,QAAQ,GAAE,OAAO,EAAO;IAGpC;;;;OAIG;aACa,MAAM,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAEhF;;;;;OAKG;aACa,OAAO,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAElF;;;;;;OAMG;cACa,aAAa,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC;IAMxF;;;;OAIG;IACU,KAAK,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAOtE;;;;;;;;OAQG;IACI,IAAI,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM;IAUpD;;;;;OAKG;IACU,WAAW,CACtB,IAAI,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,GAC5C,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,mBAAmB,CAAC,CAAC;IAiBhE;;;OAGG;cACa,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC;IAU1F;;;;;;OAMG;cACa,aAAa,CAC3B,gBAAgB,EAAE,gBAAgB,EAClC,GAAG,EAAE,cAAc,YAAK,EACxB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,UAAU,CAAC;CA8BvB"}
|
|
@@ -26,8 +26,7 @@ import { SentTx } from './sent_tx.js';
|
|
|
26
26
|
* @returns The proving result.
|
|
27
27
|
*/ async proveInternal(options = {}) {
|
|
28
28
|
const txRequest = await this.create(options);
|
|
29
|
-
|
|
30
|
-
return await this.wallet.proveTx(txRequest, txSimulationResult.privateExecutionResult);
|
|
29
|
+
return await this.wallet.proveTx(txRequest);
|
|
31
30
|
}
|
|
32
31
|
// docs:start:prove
|
|
33
32
|
/**
|
|
@@ -37,7 +36,7 @@ import { SentTx } from './sent_tx.js';
|
|
|
37
36
|
*/ async prove(options = {}) {
|
|
38
37
|
// docs:end:prove
|
|
39
38
|
const txProvingResult = await this.proveInternal(options);
|
|
40
|
-
return new ProvenTx(this.wallet, txProvingResult.toTx());
|
|
39
|
+
return new ProvenTx(this.wallet, txProvingResult.toTx(), txProvingResult.timings);
|
|
41
40
|
}
|
|
42
41
|
// docs:start:send
|
|
43
42
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch_call.d.ts","sourceRoot":"","sources":["../../src/contract/batch_call.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAA0B,MAAM,4BAA4B,CAAC;AAEtF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAE/G,qFAAqF;AACrF,qBAAa,SAAU,SAAQ,uBAAuB;
|
|
1
|
+
{"version":3,"file":"batch_call.d.ts","sourceRoot":"","sources":["../../src/contract/batch_call.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAA0B,MAAM,4BAA4B,CAAC;AAEtF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAE/G,qFAAqF;AACrF,qBAAa,SAAU,SAAQ,uBAAuB;IAGlD,SAAS,CAAC,KAAK,EAAE,uBAAuB,EAAE;gBAD1C,MAAM,EAAE,MAAM,EACJ,KAAK,EAAE,uBAAuB,EAAE;IAK5C;;;;;OAKG;IACU,MAAM,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IASjF;;;;OAIG;IACU,OAAO,CAAC,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAWnF;;;;;;;;OAQG;IACU,QAAQ,CAAC,OAAO,GAAE,qBAA0B,GAAG,OAAO,CAAC,GAAG,CAAC;YAwE1D,WAAW;CAG1B"}
|
|
@@ -80,7 +80,7 @@ import { BaseContractInteraction } from './base_contract_interaction.js';
|
|
|
80
80
|
this.wallet.simulateTx(txRequest, true, options?.from, options?.skipTxValidation)
|
|
81
81
|
]);
|
|
82
82
|
const results = [];
|
|
83
|
-
utilityResults.forEach(([result, index])=>{
|
|
83
|
+
utilityResults.forEach(([{ result }, index])=>{
|
|
84
84
|
results[index] = result;
|
|
85
85
|
});
|
|
86
86
|
indexedExecutionPayloads.forEach(([request, callIndex, resultIndex])=>{
|
|
@@ -2,10 +2,31 @@ import { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
|
2
2
|
import { type FunctionAbi } from '@aztec/stdlib/abi';
|
|
3
3
|
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
4
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
-
import type { Capsule, HashedValues, TxExecutionRequest, TxProfileResult } from '@aztec/stdlib/tx';
|
|
5
|
+
import type { Capsule, HashedValues, SimulationTimings, TxExecutionRequest, TxProfileResult } from '@aztec/stdlib/tx';
|
|
6
6
|
import type { Wallet } from '../wallet/wallet.js';
|
|
7
7
|
import { BaseContractInteraction } from './base_contract_interaction.js';
|
|
8
8
|
import type { ProfileMethodOptions, RequestMethodOptions, SendMethodOptions, SimulateMethodOptions } from './interaction_options.js';
|
|
9
|
+
/**
|
|
10
|
+
* Represents the result type of a simulation.
|
|
11
|
+
* By default, it will just be the return value of the simulated function
|
|
12
|
+
* so contract interfaces behave as plain functions. If `includeMetadata` is set to true,
|
|
13
|
+
* it will provide extra information.
|
|
14
|
+
*/
|
|
15
|
+
type SimulationReturn<T extends boolean | undefined> = T extends true ? {
|
|
16
|
+
/**
|
|
17
|
+
* Additional metadata about the simulation
|
|
18
|
+
*/
|
|
19
|
+
meta: {
|
|
20
|
+
/**
|
|
21
|
+
* Timings of the different operations performed, including per function breakdown
|
|
22
|
+
*/
|
|
23
|
+
timings?: SimulationTimings;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Return value of the function
|
|
27
|
+
*/
|
|
28
|
+
result: any;
|
|
29
|
+
} : any;
|
|
9
30
|
/**
|
|
10
31
|
* This is the class that is returned when calling e.g. `contract.methods.myMethod(arg0, arg1)`.
|
|
11
32
|
* It contains available interactions one can call on a method, including view.
|
|
@@ -39,7 +60,7 @@ export declare class ContractFunctionInteraction extends BaseContractInteraction
|
|
|
39
60
|
* @param options - An optional object containing additional configuration for the transaction.
|
|
40
61
|
* @returns The result of the transaction as returned by the contract function.
|
|
41
62
|
*/
|
|
42
|
-
simulate(options?:
|
|
63
|
+
simulate<T extends SimulateMethodOptions>(options?: T): Promise<SimulationReturn<T['includeMetadata']>>;
|
|
43
64
|
/**
|
|
44
65
|
* Simulate a transaction and profile the gate count for each function in the transaction.
|
|
45
66
|
* @param options - Same options as `simulate`, plus profiling method
|
|
@@ -63,4 +84,5 @@ export declare class ContractFunctionInteraction extends BaseContractInteraction
|
|
|
63
84
|
extraHashedArgs?: HashedValues[];
|
|
64
85
|
}): ContractFunctionInteraction;
|
|
65
86
|
}
|
|
87
|
+
export {};
|
|
66
88
|
//# sourceMappingURL=contract_function_interaction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract_function_interaction.d.ts","sourceRoot":"","sources":["../../src/contract/contract_function_interaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,KAAK,WAAW,EAAkE,MAAM,mBAAmB,CAAC;AACrH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"contract_function_interaction.d.ts","sourceRoot":"","sources":["../../src/contract/contract_function_interaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,KAAK,WAAW,EAAkE,MAAM,mBAAmB,CAAC;AACrH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEtH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAElC;;;;;GAKG;AACH,KAAK,gBAAgB,CAAC,CAAC,SAAS,OAAO,GAAG,SAAS,IAAI,CAAC,SAAS,IAAI,GACjE;IACE;;OAEG;IACH,IAAI,EAAE;QACJ;;WAEG;QACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;KAC7B,CAAC;IACF;;OAEG;IACH,MAAM,EAAE,GAAG,CAAC;CACb,GACD,GAAG,CAAC;AAER;;;GAGG;AACH,qBAAa,2BAA4B,SAAQ,uBAAuB;IAGpE,SAAS,CAAC,eAAe,EAAE,YAAY;IACvC,SAAS,CAAC,WAAW,EAAE,WAAW;IAClC,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE;IAGrB,OAAO,CAAC,eAAe;gBANvB,MAAM,EAAE,MAAM,EACJ,eAAe,EAAE,YAAY,EAC7B,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,GAAG,EAAE,EACrB,aAAa,GAAE,WAAW,EAAO,EACjC,QAAQ,GAAE,OAAO,EAAO,EAChB,eAAe,GAAE,YAAY,EAAO;IAS9C;;;;;OAKG;IACmB,MAAM,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAc1F;;;;;OAKG;IACmB,OAAO,CAAC,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAwB5F;;;;;;;;OAQG;IACU,QAAQ,CAAC,CAAC,SAAS,qBAAqB,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC;IA0DpH;;;;;OAKG;IACU,OAAO,CAClB,OAAO,GAAE,oBAA0E,GAClF,OAAO,CAAC,eAAe,CAAC;IAU3B;;;;;;OAMG;IACI,IAAI,CAAC,EACV,aAAkB,EAClB,QAAa,EACb,eAAoB,GACrB,EAAE;QACD,kDAAkD;QAClD,aAAa,CAAC,EAAE,WAAW,EAAE,CAAC;QAC9B,6CAA6C;QAC7C,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;QACrB,sDAAsD;QACtD,eAAe,CAAC,EAAE,YAAY,EAAE,CAAC;KAClC,GAAG,2BAA2B;CAWhC"}
|
|
@@ -12,7 +12,7 @@ import { BaseContractInteraction } from './base_contract_interaction.js';
|
|
|
12
12
|
constructor(wallet, contractAddress, functionDao, args, authWitnesses = [], capsules = [], extraHashedArgs = []){
|
|
13
13
|
super(wallet, authWitnesses, capsules), this.contractAddress = contractAddress, this.functionDao = functionDao, this.args = args, this.extraHashedArgs = extraHashedArgs;
|
|
14
14
|
if (args.some((arg)=>arg === undefined || arg === null)) {
|
|
15
|
-
throw new Error(
|
|
15
|
+
throw new Error(`All function interaction arguments must be defined and not null. Received: ${args}`);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
// docs:start:create
|
|
@@ -60,19 +60,21 @@ import { BaseContractInteraction } from './base_contract_interaction.js';
|
|
|
60
60
|
const { authWitnesses, capsules } = options;
|
|
61
61
|
return new ExecutionPayload(calls, this.authWitnesses.concat(authWitnesses ?? []), this.capsules.concat(capsules ?? []), this.extraHashedArgs);
|
|
62
62
|
}
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
-
* Simulate a transaction and get its return values
|
|
66
|
-
* Differs from prove in a few important ways:
|
|
67
|
-
* 1. It returns the values of the function execution
|
|
68
|
-
* 2. It supports `utility`, `private` and `public` functions
|
|
69
|
-
*
|
|
70
|
-
* @param options - An optional object containing additional configuration for the transaction.
|
|
71
|
-
* @returns The result of the transaction as returned by the contract function.
|
|
72
|
-
*/ async simulate(options = {}) {
|
|
63
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
64
|
+
async simulate(options = {}) {
|
|
73
65
|
// docs:end:simulate
|
|
74
66
|
if (this.functionDao.functionType == FunctionType.UTILITY) {
|
|
75
|
-
|
|
67
|
+
const utilityResult = await this.wallet.simulateUtility(this.functionDao.name, this.args, this.contractAddress, options.authWitnesses ?? [], options?.from);
|
|
68
|
+
if (options.includeMetadata) {
|
|
69
|
+
return {
|
|
70
|
+
meta: {
|
|
71
|
+
timings: utilityResult.timings
|
|
72
|
+
},
|
|
73
|
+
result: utilityResult.result
|
|
74
|
+
};
|
|
75
|
+
} else {
|
|
76
|
+
return utilityResult.result;
|
|
77
|
+
}
|
|
76
78
|
}
|
|
77
79
|
const txRequest = await this.create(options);
|
|
78
80
|
const simulatedTx = await this.wallet.simulateTx(txRequest, true, options.from, options.skipTxValidation, options.skipFeeEnforcement ?? true);
|
|
@@ -90,7 +92,17 @@ import { BaseContractInteraction } from './base_contract_interaction.js';
|
|
|
90
92
|
// For public functions we retrieve the first values directly from the public output.
|
|
91
93
|
rawReturnValues = simulatedTx.getPublicReturnValues()?.[0].values;
|
|
92
94
|
}
|
|
93
|
-
|
|
95
|
+
const returnValue = rawReturnValues ? decodeFromAbi(this.functionDao.returnTypes, rawReturnValues) : [];
|
|
96
|
+
if (options.includeMetadata) {
|
|
97
|
+
return {
|
|
98
|
+
meta: {
|
|
99
|
+
timings: simulatedTx.timings
|
|
100
|
+
},
|
|
101
|
+
result: returnValue
|
|
102
|
+
};
|
|
103
|
+
} else {
|
|
104
|
+
return returnValue;
|
|
105
|
+
}
|
|
94
106
|
}
|
|
95
107
|
/**
|
|
96
108
|
* Simulate a transaction and profile the gate count for each function in the transaction.
|
|
@@ -98,7 +110,8 @@ import { BaseContractInteraction } from './base_contract_interaction.js';
|
|
|
98
110
|
*
|
|
99
111
|
* @returns An object containing the function return value and profile result.
|
|
100
112
|
*/ async profile(options = {
|
|
101
|
-
profileMode: 'gates'
|
|
113
|
+
profileMode: 'gates',
|
|
114
|
+
skipProofGeneration: true
|
|
102
115
|
}) {
|
|
103
116
|
if (this.functionDao.functionType == FunctionType.UTILITY) {
|
|
104
117
|
throw new Error("Can't profile a utility function.");
|
|
@@ -109,7 +122,7 @@ import { BaseContractInteraction } from './base_contract_interaction.js';
|
|
|
109
122
|
authWitnesses,
|
|
110
123
|
capsules
|
|
111
124
|
});
|
|
112
|
-
return await this.wallet.profileTx(txRequest, options.profileMode, options?.from);
|
|
125
|
+
return await this.wallet.profileTx(txRequest, options.profileMode, options.skipProofGeneration, options?.from);
|
|
113
126
|
}
|
|
114
127
|
/**
|
|
115
128
|
* Augments this ContractFunctionInteraction with additional metadata, such as authWitnesses, capsules, and extraHashedArgs.
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
2
2
|
import type { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import { type ContractArtifact, type FunctionArtifact } from '@aztec/stdlib/abi';
|
|
4
|
+
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
4
5
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
6
|
import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
6
7
|
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
7
8
|
import type { PublicKeys } from '@aztec/stdlib/keys';
|
|
8
|
-
import type { TxExecutionRequest, TxProfileResult } from '@aztec/stdlib/tx';
|
|
9
|
+
import type { Capsule, TxExecutionRequest, TxProfileResult } from '@aztec/stdlib/tx';
|
|
9
10
|
import type { Wallet } from '../wallet/wallet.js';
|
|
10
11
|
import { BaseContractInteraction } from './base_contract_interaction.js';
|
|
11
12
|
import type { Contract } from './contract.js';
|
|
@@ -42,7 +43,7 @@ export declare class DeployMethod<TContract extends ContractBase = Contract> ext
|
|
|
42
43
|
private instance?;
|
|
43
44
|
/** Constructor function to call. */
|
|
44
45
|
private constructorArtifact;
|
|
45
|
-
constructor(publicKeys: PublicKeys, wallet: Wallet, artifact: ContractArtifact, postDeployCtor: (address: AztecAddress, wallet: Wallet) => Promise<TContract>, args?: any[], constructorNameOrArtifact?: string | FunctionArtifact);
|
|
46
|
+
constructor(publicKeys: PublicKeys, wallet: Wallet, artifact: ContractArtifact, postDeployCtor: (address: AztecAddress, wallet: Wallet) => Promise<TContract>, args?: any[], constructorNameOrArtifact?: string | FunctionArtifact, authWitnesses?: AuthWitness[], capsules?: Capsule[]);
|
|
46
47
|
/**
|
|
47
48
|
* Create a contract deployment transaction, given the deployment options.
|
|
48
49
|
* This function internally calls `request()` and `sign()` methods to prepare
|
|
@@ -112,10 +113,21 @@ export declare class DeployMethod<TContract extends ContractBase = Contract> ext
|
|
|
112
113
|
* Estimates gas cost for this deployment operation.
|
|
113
114
|
* @param options - Options.
|
|
114
115
|
*/
|
|
115
|
-
estimateGas(options?: Omit<DeployOptions, 'estimateGas'
|
|
116
|
+
estimateGas(options?: Omit<DeployOptions, 'estimateGas'>): Promise<Pick<GasSettings, 'gasLimits' | 'teardownGasLimits'>>;
|
|
116
117
|
/** Return this deployment address. */
|
|
117
118
|
get address(): AztecAddress | undefined;
|
|
118
119
|
/** Returns the partial address for this deployment. */
|
|
119
120
|
get partialAddress(): Promise<Fr> | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* Augments this DeployMethod with additional metadata, such as authWitnesses and capsules.
|
|
123
|
+
* @param options - An object containing the metadata to add to the interaction
|
|
124
|
+
* @returns A new DeployMethod with the added metadata, but calling the same original function in the same manner
|
|
125
|
+
*/
|
|
126
|
+
with({ authWitnesses, capsules, }: {
|
|
127
|
+
/** The authWitnesses to add to the deployment */
|
|
128
|
+
authWitnesses?: AuthWitness[];
|
|
129
|
+
/** The capsules to add to the deployment */
|
|
130
|
+
capsules?: Capsule[];
|
|
131
|
+
}): DeployMethod;
|
|
120
132
|
}
|
|
121
133
|
//# sourceMappingURL=deploy_method.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_method.d.ts","sourceRoot":"","sources":["../../src/contract/deploy_method.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,KAAK,gBAAgB,EAAoB,KAAK,gBAAgB,EAAkB,MAAM,mBAAmB,CAAC;AACnH,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EACL,KAAK,2BAA2B,EAIjC,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MA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G;cACa,6BAA6B,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAuCrG;;;;OAIG;cACa,6BAA6B,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAehG;;;;;;;OAOG;IACa,IAAI,CAAC,OAAO,GAAE,aAAkB,GAAG,YAAY,CAAC,SAAS,CAAC;IAM1E;;;;;OAKG;IACU,WAAW,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAa3F;;;;OAIG;IACmB,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IAWvF;;;OAGG;IACa,WAAW,CACzB,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,aAAa,CAAC,GAC3C,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,mBAAmB,CAAC,CAAC;IAIhE,sCAAsC;IACtC,IAAW,OAAO,6BAEjB;IAED,uDAAuD;IACvD,IAAW,cAAc,4BAExB;IAED;;;;OAIG;IACI,IAAI,CAAC,EACV,aAAkB,EAClB,QAAa,GACd,EAAE;QACD,iDAAiD;QACjD,aAAa,CAAC,EAAE,WAAW,EAAE,CAAC;QAC9B,4CAA4C;QAC5C,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;KACtB,GAAG,YAAY;CAYjB"}
|
|
@@ -20,8 +20,8 @@ import { DeploySentTx } from './deploy_sent_tx.js';
|
|
|
20
20
|
args;
|
|
21
21
|
/** The contract instance to be deployed. */ instance;
|
|
22
22
|
/** Constructor function to call. */ constructorArtifact;
|
|
23
|
-
constructor(publicKeys, wallet, artifact, postDeployCtor, args = [], constructorNameOrArtifact){
|
|
24
|
-
super(wallet), this.publicKeys = publicKeys, this.artifact = artifact, this.postDeployCtor = postDeployCtor, this.args = args, this.instance = undefined;
|
|
23
|
+
constructor(publicKeys, wallet, artifact, postDeployCtor, args = [], constructorNameOrArtifact, authWitnesses = [], capsules = []){
|
|
24
|
+
super(wallet, authWitnesses, capsules), this.publicKeys = publicKeys, this.artifact = artifact, this.postDeployCtor = postDeployCtor, this.args = args, this.instance = undefined;
|
|
25
25
|
this.constructorArtifact = getInitializer(artifact, constructorNameOrArtifact);
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
@@ -82,10 +82,11 @@ import { DeploySentTx } from './deploy_sent_tx.js';
|
|
|
82
82
|
*
|
|
83
83
|
* @returns An object containing the function return value and profile result.
|
|
84
84
|
*/ async profile(options = {
|
|
85
|
-
profileMode: 'gates'
|
|
85
|
+
profileMode: 'gates',
|
|
86
|
+
skipProofGeneration: true
|
|
86
87
|
}) {
|
|
87
88
|
const txRequest = await this.create(options);
|
|
88
|
-
return await this.wallet.profileTx(txRequest, options.profileMode, options?.from);
|
|
89
|
+
return await this.wallet.profileTx(txRequest, options.profileMode, options.skipProofGeneration, options?.from);
|
|
89
90
|
}
|
|
90
91
|
/**
|
|
91
92
|
* Register this contract in the PXE and returns the Contract object.
|
|
@@ -177,7 +178,7 @@ import { DeploySentTx } from './deploy_sent_tx.js';
|
|
|
177
178
|
* @returns The proven tx.
|
|
178
179
|
*/ async prove(options) {
|
|
179
180
|
const txProvingResult = await this.proveInternal(options);
|
|
180
|
-
return new DeployProvenTx(this.wallet, txProvingResult.toTx(), this.postDeployCtor, ()=>this.getInstance(options));
|
|
181
|
+
return new DeployProvenTx(this.wallet, txProvingResult.toTx(), this.postDeployCtor, ()=>this.getInstance(options), txProvingResult.timings);
|
|
181
182
|
}
|
|
182
183
|
/**
|
|
183
184
|
* Estimates gas cost for this deployment operation.
|
|
@@ -191,4 +192,11 @@ import { DeploySentTx } from './deploy_sent_tx.js';
|
|
|
191
192
|
/** Returns the partial address for this deployment. */ get partialAddress() {
|
|
192
193
|
return this.instance && computePartialAddress(this.instance);
|
|
193
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Augments this DeployMethod with additional metadata, such as authWitnesses and capsules.
|
|
197
|
+
* @param options - An object containing the metadata to add to the interaction
|
|
198
|
+
* @returns A new DeployMethod with the added metadata, but calling the same original function in the same manner
|
|
199
|
+
*/ with({ authWitnesses = [], capsules = [] }) {
|
|
200
|
+
return new DeployMethod(this.publicKeys, this.wallet, this.artifact, this.postDeployCtor, this.args, this.constructorArtifact?.name, this.authWitnesses.concat(authWitnesses), this.capsules.concat(capsules));
|
|
201
|
+
}
|
|
194
202
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
2
2
|
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
3
|
-
import type { Tx } from '@aztec/stdlib/tx';
|
|
3
|
+
import type { ProvingTimings, Tx } from '@aztec/stdlib/tx';
|
|
4
4
|
import type { Wallet } from '../wallet/wallet.js';
|
|
5
5
|
import type { Contract } from './contract.js';
|
|
6
6
|
import { DeploySentTx } from './deploy_sent_tx.js';
|
|
@@ -11,7 +11,7 @@ import { ProvenTx } from './proven_tx.js';
|
|
|
11
11
|
export declare class DeployProvenTx<TContract extends Contract = Contract> extends ProvenTx {
|
|
12
12
|
private postDeployCtor;
|
|
13
13
|
private instanceGetter;
|
|
14
|
-
constructor(wallet: Wallet, tx: Tx, postDeployCtor: (address: AztecAddress, wallet: Wallet) => Promise<TContract>, instanceGetter: () => Promise<ContractInstanceWithAddress
|
|
14
|
+
constructor(wallet: Wallet, tx: Tx, postDeployCtor: (address: AztecAddress, wallet: Wallet) => Promise<TContract>, instanceGetter: () => Promise<ContractInstanceWithAddress>, timings?: ProvingTimings);
|
|
15
15
|
/**
|
|
16
16
|
* Sends the transaction to the network via the provided wallet.
|
|
17
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_proven_tx.d.ts","sourceRoot":"","sources":["../../src/contract/deploy_proven_tx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy_proven_tx.d.ts","sourceRoot":"","sources":["../../src/contract/deploy_proven_tx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;GAEG;AACH,qBAAa,cAAc,CAAC,SAAS,SAAS,QAAQ,GAAG,QAAQ,CAAE,SAAQ,QAAQ;IAI/E,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,cAAc;gBAHtB,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,EAAE,EACE,cAAc,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,CAAC,EAC7E,cAAc,EAAE,MAAM,OAAO,CAAC,2BAA2B,CAAC,EAClE,OAAO,CAAC,EAAE,cAAc;IAK1B;;OAEG;IACa,IAAI,IAAI,YAAY,CAAC,SAAS,CAAC;CAOhD"}
|
|
@@ -5,8 +5,8 @@ import { ProvenTx } from './proven_tx.js';
|
|
|
5
5
|
*/ export class DeployProvenTx extends ProvenTx {
|
|
6
6
|
postDeployCtor;
|
|
7
7
|
instanceGetter;
|
|
8
|
-
constructor(wallet, tx, postDeployCtor, instanceGetter){
|
|
9
|
-
super(wallet, tx), this.postDeployCtor = postDeployCtor, this.instanceGetter = instanceGetter;
|
|
8
|
+
constructor(wallet, tx, postDeployCtor, instanceGetter, timings){
|
|
9
|
+
super(wallet, tx, timings), this.postDeployCtor = postDeployCtor, this.instanceGetter = instanceGetter;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Sends the transaction to the network via the provided wallet.
|
|
@@ -17,8 +17,6 @@ export type RequestMethodOptions = {
|
|
|
17
17
|
* Represents options for calling a (constrained) function in a contract.
|
|
18
18
|
*/
|
|
19
19
|
export type SendMethodOptions = RequestMethodOptions & {
|
|
20
|
-
/** Wether to skip the simulation of the public part of the transaction. */
|
|
21
|
-
skipPublicSimulation?: boolean;
|
|
22
20
|
/** The fee options for the transaction. */
|
|
23
21
|
fee?: UserFeeOptions;
|
|
24
22
|
/** Custom nonce to inject into the app payload of the transaction. Useful when trying to cancel an ongoing transaction by creating a new one with a higher fee */
|
|
@@ -38,6 +36,8 @@ export type SimulateMethodOptions = Pick<SendMethodOptions, 'authWitnesses' | 'c
|
|
|
38
36
|
skipTxValidation?: boolean;
|
|
39
37
|
/** Whether to ensure the fee payer is not empty and has enough balance to pay for the fee. */
|
|
40
38
|
skipFeeEnforcement?: boolean;
|
|
39
|
+
/** Whether to include the metadata in the simulation result, instead of just the return of the function */
|
|
40
|
+
includeMetadata?: boolean;
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
43
43
|
* Represents the options for profiling an interaction.
|
|
@@ -45,5 +45,7 @@ export type SimulateMethodOptions = Pick<SendMethodOptions, 'authWitnesses' | 'c
|
|
|
45
45
|
export type ProfileMethodOptions = SimulateMethodOptions & {
|
|
46
46
|
/** Whether to return gates information or the bytecode/witnesses. */
|
|
47
47
|
profileMode: 'gates' | 'execution-steps' | 'full';
|
|
48
|
+
/** Whether to generate a ClientIVC proof or not */
|
|
49
|
+
skipProofGeneration?: boolean;
|
|
48
50
|
};
|
|
49
51
|
//# sourceMappingURL=interaction_options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction_options.d.ts","sourceRoot":"","sources":["../../src/contract/interaction_options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,6CAA6C;IAC7C,aAAa,CAAC,EAAE,WAAW,EAAE,CAAC;IAC9B,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,GAAG;IACrD,
|
|
1
|
+
{"version":3,"file":"interaction_options.d.ts","sourceRoot":"","sources":["../../src/contract/interaction_options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,6CAA6C;IAC7C,aAAa,CAAC,EAAE,WAAW,EAAE,CAAC;IAC9B,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,GAAG;IACrD,2CAA2C;IAC3C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,kKAAkK;IAClK,KAAK,CAAC,EAAE,EAAE,CAAC;IACX,qIAAqI;IACrI,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,iBAAiB,EACjB,eAAe,GAAG,UAAU,GAAG,KAAK,GAAG,OAAO,GAAG,aAAa,CAC/D,GAAG;IACF,kCAAkC;IAClC,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,8HAA8H;IAC9H,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,8FAA8F;IAC9F,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,2GAA2G;IAC3G,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,GAAG;IACzD,qEAAqE;IACrE,WAAW,EAAE,OAAO,GAAG,iBAAiB,GAAG,MAAM,CAAC;IAClD,mDAAmD;IACnD,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Tx } from '@aztec/stdlib/tx';
|
|
1
|
+
import { type ProvingTimings, Tx } from '@aztec/stdlib/tx';
|
|
2
2
|
import type { Wallet } from '../wallet/wallet.js';
|
|
3
3
|
import { SentTx } from './sent_tx.js';
|
|
4
4
|
/**
|
|
@@ -6,7 +6,8 @@ import { SentTx } from './sent_tx.js';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class ProvenTx extends Tx {
|
|
8
8
|
protected wallet: Wallet;
|
|
9
|
-
|
|
9
|
+
timings?: ProvingTimings | undefined;
|
|
10
|
+
constructor(wallet: Wallet, tx: Tx, timings?: ProvingTimings | undefined);
|
|
10
11
|
protected getPlainDataTx(): Tx;
|
|
11
12
|
/**
|
|
12
13
|
* Sends the transaction to the network via the provided wallet.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proven_tx.d.ts","sourceRoot":"","sources":["../../src/contract/proven_tx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"proven_tx.d.ts","sourceRoot":"","sources":["../../src/contract/proven_tx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;;GAEG;AACH,qBAAa,QAAS,SAAQ,EAAE;IAE5B,SAAS,CAAC,MAAM,EAAE,MAAM;IAGjB,OAAO,CAAC,EAAE,cAAc;gBAHrB,MAAM,EAAE,MAAM,EACxB,EAAE,EAAE,EAAE,EAEC,OAAO,CAAC,EAAE,cAAc,YAAA;IAMjC,SAAS,CAAC,cAAc,IAAI,EAAE;IAI9B;;OAEG;IACI,IAAI,IAAI,MAAM;CAOtB"}
|
|
@@ -4,8 +4,10 @@ import { SentTx } from './sent_tx.js';
|
|
|
4
4
|
* A proven transaction that can be sent to the network. Returned by the `prove` method of a contract interaction.
|
|
5
5
|
*/ export class ProvenTx extends Tx {
|
|
6
6
|
wallet;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
timings;
|
|
8
|
+
constructor(wallet, tx, // eslint-disable-next-line jsdoc/require-jsdoc
|
|
9
|
+
timings){
|
|
10
|
+
super(tx.data, tx.clientIvcProof, tx.contractClassLogs, tx.publicFunctionCalldata), this.wallet = wallet, this.timings = timings;
|
|
9
11
|
}
|
|
10
12
|
// Clone the TX data to get a serializable object.
|
|
11
13
|
getPlainDataTx() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sent_tx.d.ts","sourceRoot":"","sources":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{"version":3,"file":"contract_deployer.d.ts","sourceRoot":"","sources":["../../src/deployment/contract_deployer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD;;;GAGG;AACH,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,UAAU,CAAC;IACnB,OAAO,CAAC,eAAe,CAAC;gBAHhB,QAAQ,EAAE,gBAAgB,EAC1B,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,UAAU,YAAA,EACvB,eAAe,CAAC,EAAE,MAAM,YAAA;IAGlC;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE;CAW7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"l1_contracts.d.ts","sourceRoot":"","sources":["../../src/ethereum/l1_contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAKjF,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"l1_contracts.d.ts","sourceRoot":"","sources":["../../src/ethereum/l1_contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAKjF,eAAO,MAAM,sBAAsB,GAAU,KAAK,MAAM,KAAG,OAAO,CAAC,mBAAmB,CAerF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account_entrypoint_meta_payment_method.d.ts","sourceRoot":"","sources":["../../src/fee/account_entrypoint_meta_payment_method.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAKtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,qBAAa,kCAAmC,YAAW,gBAAgB;IAEvE,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,mBAAmB;IAC3B,OAAO,CAAC,wBAAwB;IAChC,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,aAAa;gBAJb,QAAQ,EAAE,gBAAgB,EAC1B,mBAAmB,EAAE,mBAAmB,EACxC,wBAAwB,EAAE,MAAM,GAAG,gBAAgB,EACnD,cAAc,EAAE,YAAY,EAC5B,aAAa,EAAE,gBAAgB;IAGzC,QAAQ,IAAI,OAAO,CAAC,YAAY,CAAC;IAI3B,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"account_entrypoint_meta_payment_method.d.ts","sourceRoot":"","sources":["../../src/fee/account_entrypoint_meta_payment_method.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAKtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,qBAAa,kCAAmC,YAAW,gBAAgB;IAEvE,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,mBAAmB;IAC3B,OAAO,CAAC,wBAAwB;IAChC,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,aAAa;gBAJb,QAAQ,EAAE,gBAAgB,EAC1B,mBAAmB,EAAE,mBAAmB,EACxC,wBAAwB,EAAE,MAAM,GAAG,gBAAgB,EACnD,cAAc,EAAE,YAAY,EAC5B,aAAa,EAAE,gBAAgB;IAGzC,QAAQ,IAAI,OAAO,CAAC,YAAY,CAAC;IAI3B,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAwC9E,WAAW,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;CAG7D"}
|
|
@@ -9,9 +9,8 @@ import { createPXEClient } from '../pxe_client.js';
|
|
|
9
9
|
* @param host - The URL of the host.
|
|
10
10
|
* @param rpcMethod - The RPC method to call.
|
|
11
11
|
* @param body - The body of the request.
|
|
12
|
-
* @param useApiEndpoints - Whether to use the API endpoints or inject the method in the body.
|
|
13
12
|
* @returns The response data.
|
|
14
|
-
*/ async function axiosFetch(host,
|
|
13
|
+
*/ async function axiosFetch(host, body) {
|
|
15
14
|
const request = new Axios({
|
|
16
15
|
headers: {
|
|
17
16
|
'content-type': 'application/json'
|
|
@@ -23,34 +22,29 @@ import { createPXEClient } from '../pxe_client.js';
|
|
|
23
22
|
(data)=>JSON.parse(data)
|
|
24
23
|
]
|
|
25
24
|
});
|
|
26
|
-
const [url, content] =
|
|
27
|
-
`${host}/${rpcMethod}`,
|
|
28
|
-
body
|
|
29
|
-
] : [
|
|
25
|
+
const [url, content] = [
|
|
30
26
|
host,
|
|
31
|
-
|
|
32
|
-
...body,
|
|
33
|
-
method: rpcMethod
|
|
34
|
-
}
|
|
27
|
+
body
|
|
35
28
|
];
|
|
36
29
|
const resp = await request.post(url, content).catch((error)=>{
|
|
37
30
|
if (error.response) {
|
|
38
31
|
return error.response;
|
|
39
32
|
}
|
|
40
|
-
const errorMessage = `Error fetching from host ${host}
|
|
33
|
+
const errorMessage = `Error fetching from host ${host}: ${inspect(error)}`;
|
|
41
34
|
throw new Error(errorMessage);
|
|
42
35
|
});
|
|
43
36
|
const isOK = resp.status >= 200 && resp.status < 300;
|
|
44
37
|
if (isOK) {
|
|
45
38
|
const headers = {
|
|
46
|
-
get: (header)
|
|
39
|
+
get: (header)=>// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
40
|
+
typeof resp.headers.get === 'function' ? resp.headers.get(header)?.toString() : undefined
|
|
47
41
|
};
|
|
48
42
|
return {
|
|
49
43
|
response: resp.data,
|
|
50
44
|
headers
|
|
51
45
|
};
|
|
52
46
|
} else {
|
|
53
|
-
const errorMessage = `Error ${resp.status} from json-rpc server ${host}
|
|
47
|
+
const errorMessage = `Error ${resp.status} from json-rpc server ${host}: ${resp.data}`;
|
|
54
48
|
if (resp.status >= 400 && resp.status < 500) {
|
|
55
49
|
throw new NoRetryError(errorMessage);
|
|
56
50
|
} else {
|
|
@@ -66,8 +60,8 @@ import { createPXEClient } from '../pxe_client.js';
|
|
|
66
60
|
* @returns A PXE client.
|
|
67
61
|
*/ export function createCompatibleClient(rpcUrl, logger = createLogger('aztecjs:pxe_client'), versions = {}) {
|
|
68
62
|
// Use axios due to timeout issues with fetch when proving TXs.
|
|
69
|
-
const fetch = async (host,
|
|
70
|
-
return await retry(()=>axiosFetch(host,
|
|
63
|
+
const fetch = async (host, body)=>{
|
|
64
|
+
return await retry(()=>axiosFetch(host, body), `JsonRpcClient request to ${host}`, makeBackoff([
|
|
71
65
|
1,
|
|
72
66
|
2,
|
|
73
67
|
3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anvil_test_watcher.d.ts","sourceRoot":"","sources":["../../src/test/anvil_test_watcher.ts"],"names":[],"mappings":"AAAA,OAA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,CAAC,oBAAoB,CAAC,CAAiB;IAC9C,OAAO,CAAC,qBAAqB,CAAC,CAAiB;IAC/C,OAAO,CAAC,6BAA6B,CAAC,CAAiB;IAEvD,OAAO,CAAC,MAAM,CAAiD;IAE/D,OAAO,CAAC,iBAAiB,CAAQ;gBAGvB,UAAU,EAAE,aAAa,EACjC,aAAa,EAAE,UAAU,EACzB,QAAQ,EAAE,UAAU,EACZ,YAAY,CAAC,EAAE,gBAAgB,YAAA;IAezC,oBAAoB,CAAC,iBAAiB,EAAE,OAAO;IAI/C,YAAY,CAAC,SAAS,EAAE,OAAO;IAIzB,KAAK;IAwBL,IAAI;IAMJ,OAAO;IAMP,YAAY;IAOZ,cAAc;IAoBd,gBAAgB;CAwCvB"}
|
|
@@ -31,6 +31,11 @@ export declare class RollupCheatCodes {
|
|
|
31
31
|
/** Epoch duration */ epochDuration: bigint;
|
|
32
32
|
/** Slot duration */ slotDuration: bigint;
|
|
33
33
|
}>;
|
|
34
|
+
/**
|
|
35
|
+
* Advances time to the beginning of the given epoch
|
|
36
|
+
* @param epoch - The epoch to advance to
|
|
37
|
+
*/
|
|
38
|
+
advanceToEpoch(epoch: bigint): Promise<bigint>;
|
|
34
39
|
/** Warps time in L1 until the next epoch */
|
|
35
40
|
advanceToNextEpoch(): Promise<void>;
|
|
36
41
|
/** Warps time in L1 until the beginning of the next slot. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollup_cheat_codes.d.ts","sourceRoot":"","sources":["../../src/test/rollup_cheat_codes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAGjF,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE1D,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK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AC,OAAO,EAAE,MAAM;IASzC;;;OAGG;IACU,YAAY,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM;IAiC5D;;;OAGG;IACU,OAAO,CAClB,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,qBAAqB,CAAC,OAAO,SAAS,EAAE,gBAAgB,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC;IAQ1G,4CAA4C;IAC/B,oBAAoB;IAQjC;;;OAGG;IACU,sBAAsB,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM;IAMtE;;;OAGG;IACU,qBAAqB,CAAC,QAAQ,EAAE,MAAM;CAOpD"}
|
|
@@ -73,6 +73,22 @@ import { foundry } from 'viem/chains';
|
|
|
73
73
|
slotDuration
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Advances time to the beginning of the given epoch
|
|
78
|
+
* @param epoch - The epoch to advance to
|
|
79
|
+
*/ async advanceToEpoch(epoch) {
|
|
80
|
+
const { epochDuration: slotsInEpoch } = await this.getConfig();
|
|
81
|
+
const timestamp = await this.rollup.read.getTimestampForSlot([
|
|
82
|
+
epoch * slotsInEpoch
|
|
83
|
+
]);
|
|
84
|
+
try {
|
|
85
|
+
await this.ethCheatCodes.warp(Number(timestamp));
|
|
86
|
+
this.logger.warn(`Warped to epoch ${epoch}`);
|
|
87
|
+
} catch {
|
|
88
|
+
this.logger.debug('Warp failed, time already satisfied');
|
|
89
|
+
}
|
|
90
|
+
return timestamp;
|
|
91
|
+
}
|
|
76
92
|
/** Warps time in L1 until the next epoch */ async advanceToNextEpoch() {
|
|
77
93
|
const slot = await this.getSlot();
|
|
78
94
|
const { epochDuration, slotDuration } = await this.getConfig();
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
2
|
import type { Fr } from '@aztec/foundation/fields';
|
|
5
3
|
import type { EventSelector, FunctionSelector } from '@aztec/stdlib/abi';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abi_types.d.ts","sourceRoot":"","sources":["../../src/utils/abi_types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"abi_types.d.ts","sourceRoot":"","sources":["../../src/utils/abi_types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,uEAAuE;AACvE,MAAM,MAAM,SAAS,GAAG,EAAE,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG;IAA2B,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEvG,yEAAyE;AACzE,MAAM,MAAM,cAAc,GAAG;IAAyB,OAAO,EAAE,SAAS,CAAA;CAAE,GAAG,UAAU,CAAC;AAExF,2EAA2E;AAC3E,MAAM,MAAM,gBAAgB,GAAG;IAAyB,OAAO,EAAE,SAAS,CAAA;CAAE,GAAG,YAAY,CAAC;AAE5F,8EAA8E;AAC9E,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,gBAAgB,CAAC;AAEhE,4EAA4E;AAC5E,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,aAAa,CAAC;AAE1D,kDAAkD;AAClD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvC,gFAAgF;AAChF,MAAM,MAAM,gBAAgB,GAAG;IAAuB,KAAK,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAAC"}
|
package/dest/utils/authwit.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
2
|
import type { FunctionCall } from '@aztec/stdlib/abi';
|
|
5
3
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|