@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":"authwit.d.ts","sourceRoot":"","sources":["../../src/utils/authwit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"authwit.d.ts","sourceRoot":"","sources":["../../src/utils/authwit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAE3F,8BAA8B;AAC9B,MAAM,MAAM,cAAc,GAAG;IAC3B,8BAA8B;IAC9B,OAAO,EAAE,EAAE,CAAC;IACZ,8BAA8B;IAC9B,OAAO,EAAE,EAAE,CAAC;CACb,CAAC;AAEF,gCAAgC;AAChC,MAAM,MAAM,eAAe,GAAG;IAC5B,qBAAqB;IACrB,QAAQ,EAAE,YAAY,CAAC;IACvB,4BAA4B;IAC5B,SAAS,EAAE,MAAM,GAAG,EAAE,CAAC;CACxB,CAAC;AAEF,4BAA4B;AAC5B,MAAM,MAAM,YAAY,GAAG;IACzB,6BAA6B;IAC7B,MAAM,EAAE,YAAY,CAAC;IACrB,4BAA4B;IAC5B,MAAM,EAAE,2BAA2B,GAAG,YAAY,CAAC;CACpD,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,yBAAyB,GAAU,QAAQ,eAAe,GAAG,YAAY,EAAE,UAAU,cAAc,gBAiB/G,CAAC;AAGF;;;;;;IAMI;AACJ,eAAO,MAAM,uCAAuC,GAAU,QAAQ,YAAY,EAAE,QAAQ,YAAY,gBAEvG,CAAC;AAEF;;;;;;;IAOI;AACJ,eAAO,MAAM,iCAAiC,GAC5C,QAAQ,YAAY,EACpB,QAAQ,YAAY,GAAG,2BAA2B,gBAInD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field_compressed_string.d.ts","sourceRoot":"","sources":["../../src/utils/field_compressed_string.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,UAAU,yBAAyB;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AACD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,
|
|
1
|
+
{"version":3,"file":"field_compressed_string.d.ts","sourceRoot":"","sources":["../../src/utils/field_compressed_string.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,UAAU,yBAAyB;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AACD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAAI,OAAO,yBAAyB,KAAG,MAU5E,CAAC"}
|
package/dest/utils/node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/utils/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/utils/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,eAAO,MAAM,WAAW,GAAU,MAAM,SAAS,EAAE,SAAS,MAAM,kBAYjE,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,KAAK,SAAS,EAAE,MAAM,iCAAiC,CAAC"}
|
package/dest/utils/node.js
CHANGED
package/dest/utils/pxe.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pxe.d.ts","sourceRoot":"","sources":["../../src/utils/pxe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAE3D,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"pxe.d.ts","sourceRoot":"","sources":["../../src/utils/pxe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAE3D,eAAO,MAAM,UAAU,GAAU,KAAK,GAAG,EAAE,SAAS,MAAM,kBAYzD,CAAC"}
|
package/dest/utils/pxe.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { FeeOptions, TxExecutionOptions } from '@aztec/entrypoints/interfaces';
|
|
4
2
|
import type { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
5
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account_wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/account_wallet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"account_wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/account_wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,eAAe,EAGrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;GAEG;AACH,qBAAa,aAAc,SAAQ,UAAU;IAGzC,SAAS,CAAC,OAAO,EAAE,gBAAgB;gBADnC,GAAG,EAAE,GAAG,EACE,OAAO,EAAE,gBAAgB;IAKrC,wBAAwB,CACtB,IAAI,EAAE,gBAAgB,EACtB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,kBAAkB,CAAC;IAI9B,UAAU,IAAI,EAAE;IAIhB,UAAU,IAAI,EAAE;IAIhB;;;;;;;;;OASG;IACG,aAAa,CAAC,mBAAmB,EAAE,EAAE,GAAG,MAAM,GAAG,YAAY,GAAG,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IAa5G;;;;;;;;OAQG;IACU,gBAAgB,CAC3B,mBAAmB,EAAE,EAAE,GAAG,MAAM,GAAG,eAAe,GAAG,YAAY,EACjE,UAAU,EAAE,OAAO,GAClB,OAAO,CAAC,2BAA2B,CAAC;YAgBzB,uBAAuB;IAmBrC;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAMtB;;;;;;;;;OASG;IACG,cAAc,CAClB,UAAU,EAAE,YAAY,EACxB,MAAM,EAAE,eAAe,GAAG,YAAY,EACtC,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC;QACT,yEAAyE;QACzE,gBAAgB,EAAE,OAAO,CAAC;QAC1B,wEAAwE;QACxE,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IA2BF,+EAA+E;IACxE,kBAAkB;IAIzB,sEAAsE;IACtD,UAAU;IAI1B,OAAO,CAAC,mBAAmB;IAwB3B,OAAO,CAAC,oBAAoB;IAa5B,OAAO,CAAC,kBAAkB;CAuB3B"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { FeeOptions, TxExecutionOptions } from '@aztec/entrypoints/interfaces';
|
|
4
2
|
import type { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
5
3
|
import type { Fr } from '@aztec/foundation/fields';
|
|
6
|
-
import type {
|
|
4
|
+
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
7
5
|
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
8
6
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
9
7
|
import type { CompleteAddress, ContractInstanceWithAddress, NodeInfo } from '@aztec/stdlib/contract';
|
|
10
8
|
import type { GasFees } from '@aztec/stdlib/gas';
|
|
11
9
|
import type { ContractClassMetadata, ContractMetadata, EventMetadataDefinition, PXE, PXEInfo } from '@aztec/stdlib/interfaces/client';
|
|
12
|
-
import type { PrivateExecutionResult, Tx, TxExecutionRequest, TxHash, TxProfileResult, TxProvingResult, TxReceipt, TxSimulationResult } from '@aztec/stdlib/tx';
|
|
10
|
+
import type { PrivateExecutionResult, Tx, TxExecutionRequest, TxHash, TxProfileResult, TxProvingResult, TxReceipt, TxSimulationResult, UtilitySimulationResult } from '@aztec/stdlib/tx';
|
|
13
11
|
import type { IntentAction, IntentInnerHash } from '../utils/authwit.js';
|
|
14
12
|
import type { Wallet } from './wallet.js';
|
|
15
13
|
/**
|
|
@@ -34,11 +32,11 @@ export declare abstract class BaseWallet implements Wallet {
|
|
|
34
32
|
registerContractClass(artifact: ContractArtifact): Promise<void>;
|
|
35
33
|
updateContract(contractAddress: AztecAddress, artifact: ContractArtifact): Promise<void>;
|
|
36
34
|
proveTx(txRequest: TxExecutionRequest, privateExecutionResult: PrivateExecutionResult): Promise<TxProvingResult>;
|
|
37
|
-
profileTx(txRequest: TxExecutionRequest, profileMode: 'gates' | 'execution-steps' | 'full', msgSender?: AztecAddress): Promise<TxProfileResult>;
|
|
35
|
+
profileTx(txRequest: TxExecutionRequest, profileMode: 'gates' | 'execution-steps' | 'full', skipProofGeneration?: boolean, msgSender?: AztecAddress): Promise<TxProfileResult>;
|
|
38
36
|
simulateTx(txRequest: TxExecutionRequest, simulatePublic: boolean, msgSender?: AztecAddress, skipTxValidation?: boolean, skipFeeEnforcement?: boolean): Promise<TxSimulationResult>;
|
|
39
37
|
sendTx(tx: Tx): Promise<TxHash>;
|
|
40
38
|
getCurrentBaseFees(): Promise<GasFees>;
|
|
41
|
-
simulateUtility(functionName: string, args: any[], to: AztecAddress, authwits?: AuthWitness[], from?: AztecAddress
|
|
39
|
+
simulateUtility(functionName: string, args: any[], to: AztecAddress, authwits?: AuthWitness[], from?: AztecAddress): Promise<UtilitySimulationResult>;
|
|
42
40
|
getNodeInfo(): Promise<NodeInfo>;
|
|
43
41
|
getPXEInfo(): Promise<PXEInfo>;
|
|
44
42
|
getContractClassMetadata(id: Fr, includeArtifact?: boolean): Promise<ContractClassMetadata>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base_wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/base_wallet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base_wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/base_wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,2BAA2B,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACrG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,GAAG,EACH,OAAO,EACR,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,sBAAsB,EACtB,EAAE,EACF,kBAAkB,EAClB,MAAM,EACN,eAAe,EACf,eAAe,EACf,SAAS,EACT,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;GAEG;AACH,8BAAsB,UAAW,YAAW,MAAM;IACpC,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG;gBAAR,GAAG,EAAE,GAAG;IAEvC,QAAQ,CAAC,kBAAkB,IAAI,eAAe;IAE9C,QAAQ,CAAC,UAAU,IAAI,EAAE;IAEzB,QAAQ,CAAC,UAAU,IAAI,EAAE;IAEzB,QAAQ,CAAC,wBAAwB,CAC/B,IAAI,EAAE,gBAAgB,EACtB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,kBAAkB,CAAC;IAE9B,QAAQ,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,GAAG,MAAM,GAAG,eAAe,GAAG,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IAElG,UAAU;IAIV,cAAc,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IAG5D,UAAU,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAG/B,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAGxD,gBAAgB,CAAC,QAAQ,EAAE;QACzB,eAAe,CAAC,QAAQ,EAAE,2BAA2B,CAAC;QACtD,0BAA0B,CAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;KACxD,GAAG,OAAO,CAAC,IAAI,CAAC;IAGjB,qBAAqB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAGhE,cAAc,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAGxF,OAAO,CAAC,SAAS,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,sBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC;IAGhH,SAAS,CACP,SAAS,EAAE,kBAAkB,EAC7B,WAAW,EAAE,OAAO,GAAG,iBAAiB,GAAG,MAAM,EACjD,mBAAmB,CAAC,EAAE,OAAO,EAC7B,SAAS,CAAC,EAAE,YAAY,GACvB,OAAO,CAAC,eAAe,CAAC;IAG3B,UAAU,CACR,SAAS,EAAE,kBAAkB,EAC7B,cAAc,EAAE,OAAO,EACvB,SAAS,CAAC,EAAE,YAAY,EACxB,gBAAgB,CAAC,EAAE,OAAO,EAC1B,kBAAkB,CAAC,EAAE,OAAO,GAC3B,OAAO,CAAC,kBAAkB,CAAC;IAG9B,MAAM,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAG/B,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;IAGtC,eAAe,CACb,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,GAAG,EAAE,EACX,EAAE,EAAE,YAAY,EAChB,QAAQ,CAAC,EAAE,WAAW,EAAE,EACxB,IAAI,CAAC,EAAE,YAAY,GAClB,OAAO,CAAC,uBAAuB,CAAC;IAGnC,WAAW,IAAI,OAAO,CAAC,QAAQ,CAAC;IAGhC,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAG9B,wBAAwB,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,GAAE,OAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAGlG,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIrE,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAIhD,gBAAgB,CAAC,CAAC,EAChB,eAAe,EAAE,YAAY,EAC7B,KAAK,EAAE,uBAAuB,EAC9B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,YAAY,EAAwC,GAC/D,OAAO,CAAC,CAAC,EAAE,CAAC;IAGf,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,uBAAuB,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;CAG9F"}
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
proveTx(txRequest, privateExecutionResult) {
|
|
30
30
|
return this.pxe.proveTx(txRequest, privateExecutionResult);
|
|
31
31
|
}
|
|
32
|
-
profileTx(txRequest, profileMode, msgSender) {
|
|
33
|
-
return this.pxe.profileTx(txRequest, profileMode, msgSender);
|
|
32
|
+
profileTx(txRequest, profileMode, skipProofGeneration, msgSender) {
|
|
33
|
+
return this.pxe.profileTx(txRequest, profileMode, skipProofGeneration, msgSender);
|
|
34
34
|
}
|
|
35
35
|
simulateTx(txRequest, simulatePublic, msgSender, skipTxValidation, skipFeeEnforcement) {
|
|
36
36
|
return this.pxe.simulateTx(txRequest, simulatePublic, msgSender, skipTxValidation, skipFeeEnforcement);
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { EntrypointInterface, FeeOptions, TxExecutionOptions } from '@aztec/entrypoints/interfaces';
|
|
4
2
|
import type { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
5
3
|
import type { Fr } from '@aztec/foundation/fields';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signerless_wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/signerless_wallet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"signerless_wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/signerless_wallet.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACzG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;IAG5C,OAAO,CAAC,UAAU,CAAC;gBADnB,GAAG,EAAE,GAAG,EACA,UAAU,CAAC,EAAE,mBAAmB,YAAA;IAIpC,wBAAwB,CAC5B,SAAS,EAAE,gBAAgB,EAC3B,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,kBAAkB,CAAC;IAU9B,UAAU,IAAI,EAAE;IAIhB,UAAU,IAAI,EAAE;IAIhB,iBAAiB,IAAI,EAAE;IAIvB,kBAAkB,IAAI,eAAe;IAIrC,aAAa,CAAC,OAAO,EAAE,EAAE,GAAG,MAAM,GAAG,eAAe,GAAG,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;CAG3F"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec.js",
|
|
3
3
|
"homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec.js",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.87.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./dest/index.js",
|
|
@@ -78,13 +78,13 @@
|
|
|
78
78
|
]
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@aztec/constants": "0.
|
|
82
|
-
"@aztec/entrypoints": "0.
|
|
83
|
-
"@aztec/ethereum": "0.
|
|
84
|
-
"@aztec/foundation": "0.
|
|
85
|
-
"@aztec/l1-artifacts": "0.
|
|
86
|
-
"@aztec/protocol-contracts": "0.
|
|
87
|
-
"@aztec/stdlib": "0.
|
|
81
|
+
"@aztec/constants": "0.87.0",
|
|
82
|
+
"@aztec/entrypoints": "0.87.0",
|
|
83
|
+
"@aztec/ethereum": "0.87.0",
|
|
84
|
+
"@aztec/foundation": "0.87.0",
|
|
85
|
+
"@aztec/l1-artifacts": "0.87.0",
|
|
86
|
+
"@aztec/protocol-contracts": "0.87.0",
|
|
87
|
+
"@aztec/stdlib": "0.87.0",
|
|
88
88
|
"axios": "^1.8.2",
|
|
89
89
|
"tslib": "^2.4.0",
|
|
90
90
|
"viem": "2.23.7"
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@jest/globals": "^29.5.0",
|
|
94
94
|
"@types/jest": "^29.5.0",
|
|
95
|
-
"@types/node": "^
|
|
95
|
+
"@types/node": "^22.15.17",
|
|
96
96
|
"buffer": "^6.0.3",
|
|
97
97
|
"crypto-browserify": "^3.12.1",
|
|
98
98
|
"jest": "^29.5.0",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"stream-browserify": "^3.0.0",
|
|
103
103
|
"ts-loader": "^9.4.4",
|
|
104
104
|
"ts-node": "^10.9.1",
|
|
105
|
-
"typescript": "^5.
|
|
105
|
+
"typescript": "^5.3.3",
|
|
106
106
|
"util": "^0.12.5"
|
|
107
107
|
},
|
|
108
108
|
"files": [
|
|
@@ -112,6 +112,6 @@
|
|
|
112
112
|
],
|
|
113
113
|
"types": "./dest/index.d.ts",
|
|
114
114
|
"engines": {
|
|
115
|
-
"node": ">=
|
|
115
|
+
"node": ">=20.10"
|
|
116
116
|
}
|
|
117
117
|
}
|
|
@@ -15,7 +15,11 @@ export type DeployAccountTxReceipt = FieldsOf<TxReceipt> & {
|
|
|
15
15
|
* A deployment transaction for an account contract sent to the network, extending SentTx with methods to get the resulting wallet.
|
|
16
16
|
*/
|
|
17
17
|
export class DeployAccountSentTx extends SentTx {
|
|
18
|
-
constructor(
|
|
18
|
+
constructor(
|
|
19
|
+
pxeOrNode: AztecNode | PXE,
|
|
20
|
+
txHashPromise: Promise<TxHash>,
|
|
21
|
+
private getWalletPromise: Promise<Wallet>,
|
|
22
|
+
) {
|
|
19
23
|
super(pxeOrNode, txHashPromise);
|
|
20
24
|
}
|
|
21
25
|
|
|
@@ -49,8 +49,7 @@ export abstract class BaseContractInteraction {
|
|
|
49
49
|
*/
|
|
50
50
|
protected async proveInternal(options: SendMethodOptions = {}): Promise<TxProvingResult> {
|
|
51
51
|
const txRequest = await this.create(options);
|
|
52
|
-
|
|
53
|
-
return await this.wallet.proveTx(txRequest, txSimulationResult.privateExecutionResult);
|
|
52
|
+
return await this.wallet.proveTx(txRequest);
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
// docs:start:prove
|
|
@@ -62,7 +61,7 @@ export abstract class BaseContractInteraction {
|
|
|
62
61
|
public async prove(options: SendMethodOptions = {}): Promise<ProvenTx> {
|
|
63
62
|
// docs:end:prove
|
|
64
63
|
const txProvingResult = await this.proveInternal(options);
|
|
65
|
-
return new ProvenTx(this.wallet, txProvingResult.toTx());
|
|
64
|
+
return new ProvenTx(this.wallet, txProvingResult.toTx(), txProvingResult.timings);
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
// docs:start:send
|
|
@@ -92,7 +91,7 @@ export abstract class BaseContractInteraction {
|
|
|
92
91
|
* @returns Gas limits.
|
|
93
92
|
*/
|
|
94
93
|
public async estimateGas(
|
|
95
|
-
opts?: Omit<SendMethodOptions, 'estimateGas'
|
|
94
|
+
opts?: Omit<SendMethodOptions, 'estimateGas'>,
|
|
96
95
|
): Promise<Pick<GasSettings, 'gasLimits' | 'teardownGasLimits'>> {
|
|
97
96
|
// docs:end:estimateGas
|
|
98
97
|
const txRequest = await this.create({ ...opts, fee: { ...opts?.fee, estimateGas: false } });
|
|
@@ -8,7 +8,10 @@ import type { RequestMethodOptions, SendMethodOptions, SimulateMethodOptions } f
|
|
|
8
8
|
|
|
9
9
|
/** A batch of function calls to be sent as a single transaction through a wallet. */
|
|
10
10
|
export class BatchCall extends BaseContractInteraction {
|
|
11
|
-
constructor(
|
|
11
|
+
constructor(
|
|
12
|
+
wallet: Wallet,
|
|
13
|
+
protected calls: BaseContractInteraction[],
|
|
14
|
+
) {
|
|
12
15
|
super(wallet);
|
|
13
16
|
}
|
|
14
17
|
|
|
@@ -106,7 +109,7 @@ export class BatchCall extends BaseContractInteraction {
|
|
|
106
109
|
|
|
107
110
|
const results: any[] = [];
|
|
108
111
|
|
|
109
|
-
utilityResults.forEach(([result, index]) => {
|
|
112
|
+
utilityResults.forEach(([{ result }, index]) => {
|
|
110
113
|
results[index] = result;
|
|
111
114
|
});
|
|
112
115
|
indexedExecutionPayloads.forEach(([request, callIndex, resultIndex]) => {
|
|
@@ -2,7 +2,7 @@ import { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
|
2
2
|
import { type FunctionAbi, FunctionSelector, FunctionType, decodeFromAbi, encodeArguments } 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
|
|
|
7
7
|
import type { Wallet } from '../wallet/wallet.js';
|
|
8
8
|
import { BaseContractInteraction } from './base_contract_interaction.js';
|
|
@@ -13,6 +13,30 @@ import type {
|
|
|
13
13
|
SimulateMethodOptions,
|
|
14
14
|
} from './interaction_options.js';
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Represents the result type of a simulation.
|
|
18
|
+
* By default, it will just be the return value of the simulated function
|
|
19
|
+
* so contract interfaces behave as plain functions. If `includeMetadata` is set to true,
|
|
20
|
+
* it will provide extra information.
|
|
21
|
+
*/
|
|
22
|
+
type SimulationReturn<T extends boolean | undefined> = T extends true
|
|
23
|
+
? {
|
|
24
|
+
/**
|
|
25
|
+
* Additional metadata about the simulation
|
|
26
|
+
*/
|
|
27
|
+
meta: {
|
|
28
|
+
/**
|
|
29
|
+
* Timings of the different operations performed, including per function breakdown
|
|
30
|
+
*/
|
|
31
|
+
timings?: SimulationTimings;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Return value of the function
|
|
35
|
+
*/
|
|
36
|
+
result: any;
|
|
37
|
+
}
|
|
38
|
+
: any;
|
|
39
|
+
|
|
16
40
|
/**
|
|
17
41
|
* This is the class that is returned when calling e.g. `contract.methods.myMethod(arg0, arg1)`.
|
|
18
42
|
* It contains available interactions one can call on a method, including view.
|
|
@@ -29,7 +53,7 @@ export class ContractFunctionInteraction extends BaseContractInteraction {
|
|
|
29
53
|
) {
|
|
30
54
|
super(wallet, authWitnesses, capsules);
|
|
31
55
|
if (args.some(arg => arg === undefined || arg === null)) {
|
|
32
|
-
throw new Error(
|
|
56
|
+
throw new Error(`All function interaction arguments must be defined and not null. Received: ${args}`);
|
|
33
57
|
}
|
|
34
58
|
}
|
|
35
59
|
|
|
@@ -93,16 +117,29 @@ export class ContractFunctionInteraction extends BaseContractInteraction {
|
|
|
93
117
|
* @param options - An optional object containing additional configuration for the transaction.
|
|
94
118
|
* @returns The result of the transaction as returned by the contract function.
|
|
95
119
|
*/
|
|
96
|
-
public async simulate(options
|
|
120
|
+
public async simulate<T extends SimulateMethodOptions>(options?: T): Promise<SimulationReturn<T['includeMetadata']>>;
|
|
121
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
122
|
+
public async simulate(
|
|
123
|
+
options: SimulateMethodOptions = {},
|
|
124
|
+
): Promise<SimulationReturn<typeof options.includeMetadata>> {
|
|
97
125
|
// docs:end:simulate
|
|
98
126
|
if (this.functionDao.functionType == FunctionType.UTILITY) {
|
|
99
|
-
|
|
127
|
+
const utilityResult = await this.wallet.simulateUtility(
|
|
100
128
|
this.functionDao.name,
|
|
101
129
|
this.args,
|
|
102
130
|
this.contractAddress,
|
|
103
131
|
options.authWitnesses ?? [],
|
|
104
132
|
options?.from,
|
|
105
133
|
);
|
|
134
|
+
|
|
135
|
+
if (options.includeMetadata) {
|
|
136
|
+
return {
|
|
137
|
+
meta: { timings: utilityResult.timings },
|
|
138
|
+
result: utilityResult.result,
|
|
139
|
+
};
|
|
140
|
+
} else {
|
|
141
|
+
return utilityResult.result;
|
|
142
|
+
}
|
|
106
143
|
}
|
|
107
144
|
|
|
108
145
|
const txRequest = await this.create(options);
|
|
@@ -129,7 +166,13 @@ export class ContractFunctionInteraction extends BaseContractInteraction {
|
|
|
129
166
|
rawReturnValues = simulatedTx.getPublicReturnValues()?.[0].values;
|
|
130
167
|
}
|
|
131
168
|
|
|
132
|
-
|
|
169
|
+
const returnValue = rawReturnValues ? decodeFromAbi(this.functionDao.returnTypes, rawReturnValues) : [];
|
|
170
|
+
|
|
171
|
+
if (options.includeMetadata) {
|
|
172
|
+
return { meta: { timings: simulatedTx.timings }, result: returnValue };
|
|
173
|
+
} else {
|
|
174
|
+
return returnValue;
|
|
175
|
+
}
|
|
133
176
|
}
|
|
134
177
|
|
|
135
178
|
/**
|
|
@@ -138,14 +181,16 @@ export class ContractFunctionInteraction extends BaseContractInteraction {
|
|
|
138
181
|
*
|
|
139
182
|
* @returns An object containing the function return value and profile result.
|
|
140
183
|
*/
|
|
141
|
-
public async profile(
|
|
184
|
+
public async profile(
|
|
185
|
+
options: ProfileMethodOptions = { profileMode: 'gates', skipProofGeneration: true },
|
|
186
|
+
): Promise<TxProfileResult> {
|
|
142
187
|
if (this.functionDao.functionType == FunctionType.UTILITY) {
|
|
143
188
|
throw new Error("Can't profile a utility function.");
|
|
144
189
|
}
|
|
145
190
|
const { authWitnesses, capsules, fee } = options;
|
|
146
191
|
|
|
147
192
|
const txRequest = await this.create({ fee, authWitnesses, capsules });
|
|
148
|
-
return await this.wallet.profileTx(txRequest, options.profileMode, options?.from);
|
|
193
|
+
return await this.wallet.profileTx(txRequest, options.profileMode, options.skipProofGeneration, options?.from);
|
|
149
194
|
}
|
|
150
195
|
|
|
151
196
|
/**
|
|
@@ -2,6 +2,7 @@ import type { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
|
2
2
|
import { mergeExecutionPayloads } from '@aztec/entrypoints/payload';
|
|
3
3
|
import type { Fr } from '@aztec/foundation/fields';
|
|
4
4
|
import { type ContractArtifact, type FunctionAbi, type FunctionArtifact, getInitializer } from '@aztec/stdlib/abi';
|
|
5
|
+
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
5
6
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
7
|
import {
|
|
7
8
|
type ContractInstanceWithAddress,
|
|
@@ -11,7 +12,7 @@ import {
|
|
|
11
12
|
} from '@aztec/stdlib/contract';
|
|
12
13
|
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
13
14
|
import type { PublicKeys } from '@aztec/stdlib/keys';
|
|
14
|
-
import type { TxExecutionRequest, TxProfileResult } from '@aztec/stdlib/tx';
|
|
15
|
+
import type { Capsule, TxExecutionRequest, TxProfileResult } from '@aztec/stdlib/tx';
|
|
15
16
|
|
|
16
17
|
import { deployInstance } from '../deployment/deploy_instance.js';
|
|
17
18
|
import { registerContractClass } from '../deployment/register_class.js';
|
|
@@ -62,8 +63,10 @@ export class DeployMethod<TContract extends ContractBase = Contract> extends Bas
|
|
|
62
63
|
private postDeployCtor: (address: AztecAddress, wallet: Wallet) => Promise<TContract>,
|
|
63
64
|
private args: any[] = [],
|
|
64
65
|
constructorNameOrArtifact?: string | FunctionArtifact,
|
|
66
|
+
authWitnesses: AuthWitness[] = [],
|
|
67
|
+
capsules: Capsule[] = [],
|
|
65
68
|
) {
|
|
66
|
-
super(wallet);
|
|
69
|
+
super(wallet, authWitnesses, capsules);
|
|
67
70
|
this.constructorArtifact = getInitializer(artifact, constructorNameOrArtifact);
|
|
68
71
|
}
|
|
69
72
|
|
|
@@ -122,10 +125,10 @@ export class DeployMethod<TContract extends ContractBase = Contract> extends Bas
|
|
|
122
125
|
* @returns An object containing the function return value and profile result.
|
|
123
126
|
*/
|
|
124
127
|
public async profile(
|
|
125
|
-
options: DeployOptions & ProfileMethodOptions = { profileMode: 'gates' },
|
|
128
|
+
options: DeployOptions & ProfileMethodOptions = { profileMode: 'gates', skipProofGeneration: true },
|
|
126
129
|
): Promise<TxProfileResult> {
|
|
127
130
|
const txRequest = await this.create(options);
|
|
128
|
-
return await this.wallet.profileTx(txRequest, options.profileMode, options?.from);
|
|
131
|
+
return await this.wallet.profileTx(txRequest, options.profileMode, options.skipProofGeneration, options?.from);
|
|
129
132
|
}
|
|
130
133
|
|
|
131
134
|
/**
|
|
@@ -242,8 +245,12 @@ export class DeployMethod<TContract extends ContractBase = Contract> extends Bas
|
|
|
242
245
|
*/
|
|
243
246
|
public override async prove(options: DeployOptions): Promise<DeployProvenTx<TContract>> {
|
|
244
247
|
const txProvingResult = await this.proveInternal(options);
|
|
245
|
-
return new DeployProvenTx(
|
|
246
|
-
this.
|
|
248
|
+
return new DeployProvenTx(
|
|
249
|
+
this.wallet,
|
|
250
|
+
txProvingResult.toTx(),
|
|
251
|
+
this.postDeployCtor,
|
|
252
|
+
() => this.getInstance(options),
|
|
253
|
+
txProvingResult.timings,
|
|
247
254
|
);
|
|
248
255
|
}
|
|
249
256
|
|
|
@@ -252,7 +259,7 @@ export class DeployMethod<TContract extends ContractBase = Contract> extends Bas
|
|
|
252
259
|
* @param options - Options.
|
|
253
260
|
*/
|
|
254
261
|
public override estimateGas(
|
|
255
|
-
options?: Omit<DeployOptions, 'estimateGas'
|
|
262
|
+
options?: Omit<DeployOptions, 'estimateGas'>,
|
|
256
263
|
): Promise<Pick<GasSettings, 'gasLimits' | 'teardownGasLimits'>> {
|
|
257
264
|
return super.estimateGas(options);
|
|
258
265
|
}
|
|
@@ -266,4 +273,30 @@ export class DeployMethod<TContract extends ContractBase = Contract> extends Bas
|
|
|
266
273
|
public get partialAddress() {
|
|
267
274
|
return this.instance && computePartialAddress(this.instance);
|
|
268
275
|
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Augments this DeployMethod with additional metadata, such as authWitnesses and capsules.
|
|
279
|
+
* @param options - An object containing the metadata to add to the interaction
|
|
280
|
+
* @returns A new DeployMethod with the added metadata, but calling the same original function in the same manner
|
|
281
|
+
*/
|
|
282
|
+
public with({
|
|
283
|
+
authWitnesses = [],
|
|
284
|
+
capsules = [],
|
|
285
|
+
}: {
|
|
286
|
+
/** The authWitnesses to add to the deployment */
|
|
287
|
+
authWitnesses?: AuthWitness[];
|
|
288
|
+
/** The capsules to add to the deployment */
|
|
289
|
+
capsules?: Capsule[];
|
|
290
|
+
}): DeployMethod {
|
|
291
|
+
return new DeployMethod(
|
|
292
|
+
this.publicKeys,
|
|
293
|
+
this.wallet,
|
|
294
|
+
this.artifact,
|
|
295
|
+
this.postDeployCtor,
|
|
296
|
+
this.args,
|
|
297
|
+
this.constructorArtifact?.name,
|
|
298
|
+
this.authWitnesses.concat(authWitnesses),
|
|
299
|
+
this.capsules.concat(capsules),
|
|
300
|
+
);
|
|
301
|
+
}
|
|
269
302
|
}
|
|
@@ -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
|
|
|
5
5
|
import type { Wallet } from '../wallet/wallet.js';
|
|
6
6
|
import type { Contract } from './contract.js';
|
|
@@ -16,8 +16,9 @@ export class DeployProvenTx<TContract extends Contract = Contract> extends Prove
|
|
|
16
16
|
tx: Tx,
|
|
17
17
|
private postDeployCtor: (address: AztecAddress, wallet: Wallet) => Promise<TContract>,
|
|
18
18
|
private instanceGetter: () => Promise<ContractInstanceWithAddress>,
|
|
19
|
+
timings?: ProvingTimings,
|
|
19
20
|
) {
|
|
20
|
-
super(wallet, tx);
|
|
21
|
+
super(wallet, tx, timings);
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
/**
|
|
@@ -19,8 +19,6 @@ export type RequestMethodOptions = {
|
|
|
19
19
|
* Represents options for calling a (constrained) function in a contract.
|
|
20
20
|
*/
|
|
21
21
|
export type SendMethodOptions = RequestMethodOptions & {
|
|
22
|
-
/** Wether to skip the simulation of the public part of the transaction. */
|
|
23
|
-
skipPublicSimulation?: boolean;
|
|
24
22
|
/** The fee options for the transaction. */
|
|
25
23
|
fee?: UserFeeOptions;
|
|
26
24
|
/** 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 */
|
|
@@ -44,6 +42,8 @@ export type SimulateMethodOptions = Pick<
|
|
|
44
42
|
skipTxValidation?: boolean;
|
|
45
43
|
/** Whether to ensure the fee payer is not empty and has enough balance to pay for the fee. */
|
|
46
44
|
skipFeeEnforcement?: boolean;
|
|
45
|
+
/** Whether to include the metadata in the simulation result, instead of just the return of the function */
|
|
46
|
+
includeMetadata?: boolean;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
/**
|
|
@@ -52,4 +52,6 @@ export type SimulateMethodOptions = Pick<
|
|
|
52
52
|
export type ProfileMethodOptions = SimulateMethodOptions & {
|
|
53
53
|
/** Whether to return gates information or the bytecode/witnesses. */
|
|
54
54
|
profileMode: 'gates' | 'execution-steps' | 'full';
|
|
55
|
+
/** Whether to generate a ClientIVC proof or not */
|
|
56
|
+
skipProofGeneration?: boolean;
|
|
55
57
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Tx } from '@aztec/stdlib/tx';
|
|
1
|
+
import { type ProvingTimings, Tx } from '@aztec/stdlib/tx';
|
|
2
2
|
|
|
3
3
|
import type { Wallet } from '../wallet/wallet.js';
|
|
4
4
|
import { SentTx } from './sent_tx.js';
|
|
@@ -7,7 +7,12 @@ import { SentTx } from './sent_tx.js';
|
|
|
7
7
|
* A proven transaction that can be sent to the network. Returned by the `prove` method of a contract interaction.
|
|
8
8
|
*/
|
|
9
9
|
export class ProvenTx extends Tx {
|
|
10
|
-
constructor(
|
|
10
|
+
constructor(
|
|
11
|
+
protected wallet: Wallet,
|
|
12
|
+
tx: Tx,
|
|
13
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
14
|
+
public timings?: ProvingTimings,
|
|
15
|
+
) {
|
|
11
16
|
super(tx.data, tx.clientIvcProof, tx.contractClassLogs, tx.publicFunctionCalldata);
|
|
12
17
|
}
|
|
13
18
|
|
package/src/contract/sent_tx.ts
CHANGED
|
@@ -28,7 +28,10 @@ export const DefaultWaitOpts: WaitOpts = {
|
|
|
28
28
|
* its hash, receipt, and mining status.
|
|
29
29
|
*/
|
|
30
30
|
export class SentTx {
|
|
31
|
-
constructor(
|
|
31
|
+
constructor(
|
|
32
|
+
protected pxeWalletOrNode: Wallet | AztecNode | PXE,
|
|
33
|
+
protected txHashPromise: Promise<TxHash>,
|
|
34
|
+
) {}
|
|
32
35
|
|
|
33
36
|
/**
|
|
34
37
|
* Retrieves the transaction hash of the SentTx instance.
|
|
@@ -46,9 +46,8 @@ export class AccountEntrypointMetaPaymentMethod implements FeePaymentMethod {
|
|
|
46
46
|
async getExecutionPayload(gasSettings: GasSettings): Promise<ExecutionPayload> {
|
|
47
47
|
const emptyAppCalls = await EncodedAppEntrypointCalls.fromAppExecution([]);
|
|
48
48
|
// Get the execution payload for the fee, it includes the calls and potentially authWitnesses
|
|
49
|
-
const { calls: feeCalls, authWitnesses: feeAuthwitnesses } =
|
|
50
|
-
gasSettings
|
|
51
|
-
);
|
|
49
|
+
const { calls: feeCalls, authWitnesses: feeAuthwitnesses } =
|
|
50
|
+
await this.paymentMethod.getExecutionPayload(gasSettings);
|
|
52
51
|
// Encode the calls for the fee
|
|
53
52
|
const feePayer = await this.paymentMethod.getFeePayer(gasSettings);
|
|
54
53
|
const isFeePayer = feePayer.equals(this.accountAddress);
|
|
@@ -14,21 +14,20 @@ import { createPXEClient } from '../pxe_client.js';
|
|
|
14
14
|
* @param host - The URL of the host.
|
|
15
15
|
* @param rpcMethod - The RPC method to call.
|
|
16
16
|
* @param body - The body of the request.
|
|
17
|
-
* @param useApiEndpoints - Whether to use the API endpoints or inject the method in the body.
|
|
18
17
|
* @returns The response data.
|
|
19
18
|
*/
|
|
20
|
-
async function axiosFetch(host: string,
|
|
19
|
+
async function axiosFetch(host: string, body: unknown) {
|
|
21
20
|
const request = new Axios({
|
|
22
21
|
headers: { 'content-type': 'application/json' },
|
|
23
22
|
transformRequest: [(data: any) => jsonStringify(data)],
|
|
24
23
|
transformResponse: [(data: any) => JSON.parse(data)],
|
|
25
24
|
});
|
|
26
|
-
const [url, content] =
|
|
25
|
+
const [url, content] = [host, body];
|
|
27
26
|
const resp = await request.post(url, content).catch((error: AxiosError) => {
|
|
28
27
|
if (error.response) {
|
|
29
28
|
return error.response;
|
|
30
29
|
}
|
|
31
|
-
const errorMessage = `Error fetching from host ${host}
|
|
30
|
+
const errorMessage = `Error fetching from host ${host}: ${inspect(error)}`;
|
|
32
31
|
throw new Error(errorMessage);
|
|
33
32
|
});
|
|
34
33
|
|
|
@@ -36,11 +35,12 @@ async function axiosFetch(host: string, rpcMethod: string, body: any, useApiEndp
|
|
|
36
35
|
if (isOK) {
|
|
37
36
|
const headers = {
|
|
38
37
|
get: (header: string) =>
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
39
39
|
typeof resp.headers.get === 'function' ? resp.headers.get(header)?.toString() : undefined,
|
|
40
40
|
};
|
|
41
41
|
return { response: resp.data, headers };
|
|
42
42
|
} else {
|
|
43
|
-
const errorMessage = `Error ${resp.status} from json-rpc server ${host}
|
|
43
|
+
const errorMessage = `Error ${resp.status} from json-rpc server ${host}: ${resp.data}`;
|
|
44
44
|
if (resp.status >= 400 && resp.status < 500) {
|
|
45
45
|
throw new NoRetryError(errorMessage);
|
|
46
46
|
} else {
|
|
@@ -62,10 +62,10 @@ export function createCompatibleClient(
|
|
|
62
62
|
versions: Partial<ComponentsVersions> = {},
|
|
63
63
|
): Promise<PXE> {
|
|
64
64
|
// Use axios due to timeout issues with fetch when proving TXs.
|
|
65
|
-
const fetch = async (host: string,
|
|
65
|
+
const fetch = async (host: string, body: unknown) => {
|
|
66
66
|
return await retry(
|
|
67
|
-
() => axiosFetch(host,
|
|
68
|
-
`JsonRpcClient request
|
|
67
|
+
() => axiosFetch(host, body),
|
|
68
|
+
`JsonRpcClient request to ${host}`,
|
|
69
69
|
makeBackoff([1, 2, 3]),
|
|
70
70
|
logger,
|
|
71
71
|
false,
|