@aztec/aztec.js 3.0.3 → 4.0.0-devnet.1-patch.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/account.d.ts +25 -40
- package/dest/account/account.d.ts.map +1 -1
- package/dest/account/account.js +19 -47
- package/dest/account/account_contract.d.ts +8 -9
- package/dest/account/account_contract.d.ts.map +1 -1
- package/dest/account/account_with_secret_key.d.ts +19 -7
- package/dest/account/account_with_secret_key.d.ts.map +1 -1
- package/dest/account/account_with_secret_key.js +21 -4
- package/dest/account/index.d.ts +3 -2
- package/dest/account/index.d.ts.map +1 -1
- package/dest/account/index.js +2 -0
- package/dest/account/signerless_account.d.ts +5 -6
- package/dest/account/signerless_account.d.ts.map +1 -1
- package/dest/account/signerless_account.js +8 -11
- package/dest/api/account.d.ts +2 -4
- package/dest/api/account.d.ts.map +1 -1
- package/dest/api/account.js +1 -3
- package/dest/api/authorization.d.ts +2 -2
- package/dest/api/authorization.d.ts.map +1 -1
- package/dest/api/authorization.js +1 -1
- package/dest/api/contract.d.ts +18 -12
- package/dest/api/contract.d.ts.map +1 -1
- package/dest/api/contract.js +16 -10
- package/dest/api/deployment.d.ts +1 -2
- package/dest/api/deployment.d.ts.map +1 -1
- package/dest/api/deployment.js +0 -1
- package/dest/api/events.d.ts +10 -6
- package/dest/api/events.d.ts.map +1 -1
- package/dest/api/events.js +30 -20
- package/dest/api/fields.d.ts +2 -1
- package/dest/api/fields.d.ts.map +1 -1
- package/dest/api/fields.js +1 -0
- package/dest/api/keys.d.ts +1 -1
- package/dest/api/keys.js +1 -1
- package/dest/api/node.d.ts +8 -4
- package/dest/api/node.d.ts.map +1 -1
- package/dest/api/node.js +7 -3
- package/dest/api/protocol.d.ts +7 -1
- package/dest/api/protocol.d.ts.map +1 -1
- package/dest/api/protocol.js +6 -0
- package/dest/api/tx.d.ts +2 -2
- package/dest/api/tx.d.ts.map +1 -1
- package/dest/api/tx.js +1 -1
- package/dest/api/wallet.d.ts +3 -2
- package/dest/api/wallet.d.ts.map +1 -1
- package/dest/api/wallet.js +2 -1
- package/dest/authorization/call_authorization_request.d.ts +22 -1
- package/dest/authorization/call_authorization_request.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.d.ts +8 -10
- package/dest/contract/base_contract_interaction.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.js +5 -17
- package/dest/contract/batch_call.d.ts +1 -1
- package/dest/contract/batch_call.d.ts.map +1 -1
- package/dest/contract/batch_call.js +3 -1
- package/dest/contract/contract_base.d.ts +4 -1
- package/dest/contract/contract_base.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.d.ts +3 -12
- package/dest/contract/contract_function_interaction.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.js +6 -6
- package/dest/contract/deploy_method.d.ts +63 -16
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +41 -23
- package/dest/contract/interaction_options.d.ts +42 -5
- package/dest/contract/interaction_options.d.ts.map +1 -1
- package/dest/contract/interaction_options.js +8 -1
- package/dest/contract/protocol_contracts/auth-registry.d.ts +27 -0
- package/dest/contract/protocol_contracts/auth-registry.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/auth-registry.js +558 -0
- package/dest/contract/protocol_contracts/contract-class-registry.d.ts +15 -0
- package/dest/contract/protocol_contracts/contract-class-registry.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/contract-class-registry.js +127 -0
- package/dest/contract/protocol_contracts/contract-instance-registry.d.ts +22 -0
- package/dest/contract/protocol_contracts/contract-instance-registry.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/contract-instance-registry.js +465 -0
- package/dest/contract/protocol_contracts/fee-juice.d.ts +21 -0
- package/dest/contract/protocol_contracts/fee-juice.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/fee-juice.js +426 -0
- package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts +34 -0
- package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/multi-call-entrypoint.js +585 -0
- package/dest/contract/protocol_contracts/public-checks.d.ts +26 -0
- package/dest/contract/protocol_contracts/public-checks.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/public-checks.js +593 -0
- package/dest/contract/wait_for_proven.d.ts +2 -2
- package/dest/contract/wait_for_proven.d.ts.map +1 -1
- package/dest/contract/wait_for_proven.js +1 -1
- package/dest/contract/wait_opts.d.ts +16 -0
- package/dest/contract/wait_opts.d.ts.map +1 -0
- package/dest/contract/wait_opts.js +5 -0
- package/dest/deployment/publish_class.js +2 -2
- package/dest/deployment/publish_instance.d.ts +2 -2
- package/dest/deployment/publish_instance.d.ts.map +1 -1
- package/dest/deployment/publish_instance.js +3 -3
- package/dest/ethereum/portal_manager.d.ts +7 -4
- package/dest/ethereum/portal_manager.d.ts.map +1 -1
- package/dest/ethereum/portal_manager.js +15 -16
- package/dest/fee/fee_juice_payment_method_with_claim.js +6 -6
- package/dest/fee/private_fee_payment_method.js +10 -10
- package/dest/fee/public_fee_payment_method.js +10 -10
- package/dest/fee/sponsored_fee_payment.js +3 -3
- package/dest/scripts/generate_protocol_contract_types.d.ts +2 -0
- package/dest/scripts/generate_protocol_contract_types.d.ts.map +1 -0
- package/dest/scripts/generate_protocol_contract_types.js +120 -0
- package/dest/utils/authwit.d.ts +8 -6
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/authwit.js +5 -9
- package/dest/utils/node.d.ts +12 -1
- package/dest/utils/node.d.ts.map +1 -1
- package/dest/utils/node.js +46 -0
- package/dest/wallet/account_entrypoint_meta_payment_method.d.ts +5 -8
- package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -1
- package/dest/wallet/account_entrypoint_meta_payment_method.js +28 -43
- package/dest/wallet/account_manager.d.ts +5 -8
- package/dest/wallet/account_manager.d.ts.map +1 -1
- package/dest/wallet/account_manager.js +5 -11
- package/dest/wallet/capabilities.d.ts +444 -0
- package/dest/wallet/capabilities.d.ts.map +1 -0
- package/dest/wallet/capabilities.js +3 -0
- package/dest/wallet/deploy_account_method.d.ts +34 -6
- package/dest/wallet/deploy_account_method.d.ts.map +1 -1
- package/dest/wallet/deploy_account_method.js +7 -5
- package/dest/wallet/index.d.ts +2 -1
- package/dest/wallet/index.d.ts.map +1 -1
- package/dest/wallet/index.js +1 -0
- package/dest/wallet/wallet.d.ts +1642 -1007
- package/dest/wallet/wallet.d.ts.map +1 -1
- package/dest/wallet/wallet.js +201 -107
- package/package.json +24 -13
- package/src/account/account.ts +34 -58
- package/src/account/account_contract.ts +6 -7
- package/src/account/account_with_secret_key.ts +33 -8
- package/src/account/index.ts +2 -1
- package/src/account/signerless_account.ts +13 -12
- package/src/api/account.ts +9 -3
- package/src/api/authorization.ts +1 -0
- package/src/api/contract.ts +24 -9
- package/src/api/deployment.ts +0 -1
- package/src/api/events.ts +35 -27
- package/src/api/fields.ts +1 -0
- package/src/api/keys.ts +2 -2
- package/src/api/node.ts +7 -3
- package/src/api/protocol.ts +7 -0
- package/src/api/tx.ts +2 -0
- package/src/api/wallet.ts +47 -3
- package/src/contract/base_contract_interaction.ts +27 -15
- package/src/contract/batch_call.ts +4 -2
- package/src/contract/contract_function_interaction.ts +13 -6
- package/src/contract/deploy_method.ts +122 -29
- package/src/contract/interaction_options.ts +49 -4
- package/src/contract/protocol_contracts/auth-registry.ts +351 -0
- package/src/contract/protocol_contracts/contract-class-registry.ts +96 -0
- package/src/contract/protocol_contracts/contract-instance-registry.ts +302 -0
- package/src/contract/protocol_contracts/fee-juice.ts +264 -0
- package/src/contract/protocol_contracts/multi-call-entrypoint.ts +332 -0
- package/src/contract/protocol_contracts/public-checks.ts +316 -0
- package/src/contract/wait_for_proven.ts +1 -1
- package/src/contract/wait_opts.ts +21 -0
- package/src/deployment/publish_class.ts +2 -2
- package/src/deployment/publish_instance.ts +3 -6
- package/src/ethereum/portal_manager.ts +17 -21
- package/src/fee/fee_juice_payment_method_with_claim.ts +5 -5
- package/src/fee/private_fee_payment_method.ts +7 -7
- package/src/fee/public_fee_payment_method.ts +8 -8
- package/src/fee/sponsored_fee_payment.ts +3 -3
- package/src/scripts/generate_protocol_contract_types.ts +150 -0
- package/src/utils/authwit.ts +19 -7
- package/src/utils/node.ts +62 -0
- package/src/wallet/account_entrypoint_meta_payment_method.ts +28 -60
- package/src/wallet/account_manager.ts +5 -13
- package/src/wallet/capabilities.ts +491 -0
- package/src/wallet/deploy_account_method.ts +37 -13
- package/src/wallet/index.ts +1 -0
- package/src/wallet/wallet.ts +319 -118
- package/dest/account/interface.d.ts +0 -19
- package/dest/account/interface.d.ts.map +0 -1
- package/dest/account/interface.js +0 -5
- package/dest/contract/deploy_sent_tx.d.ts +0 -48
- package/dest/contract/deploy_sent_tx.d.ts.map +0 -1
- package/dest/contract/deploy_sent_tx.js +0 -46
- package/dest/contract/protocol_contracts.d.ts +0 -9
- package/dest/contract/protocol_contracts.d.ts.map +0 -1
- package/dest/contract/protocol_contracts.js +0 -26
- package/dest/contract/sent_tx.d.ts +0 -50
- package/dest/contract/sent_tx.d.ts.map +0 -1
- package/dest/contract/sent_tx.js +0 -90
- package/dest/contract/unsafe_contract.d.ts +0 -15
- package/dest/contract/unsafe_contract.d.ts.map +0 -1
- package/dest/contract/unsafe_contract.js +0 -6
- package/dest/deployment/broadcast_function.d.ts +0 -24
- package/dest/deployment/broadcast_function.d.ts.map +0 -1
- package/dest/deployment/broadcast_function.js +0 -74
- package/src/account/interface.ts +0 -25
- package/src/contract/deploy_sent_tx.ts +0 -75
- package/src/contract/protocol_contracts.ts +0 -35
- package/src/contract/sent_tx.ts +0 -129
- package/src/contract/unsafe_contract.ts +0 -19
- package/src/deployment/broadcast_function.ts +0 -148
|
@@ -5,30 +5,58 @@ import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
|
5
5
|
import type { PublicKeys } from '@aztec/stdlib/keys';
|
|
6
6
|
import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/stdlib/tx';
|
|
7
7
|
|
|
8
|
+
import type { Account } from '../account/account.js';
|
|
8
9
|
import type { Contract } from '../contract/contract.js';
|
|
9
10
|
import type { ContractBase } from '../contract/contract_base.js';
|
|
10
11
|
import {
|
|
11
12
|
DeployMethod,
|
|
12
|
-
type
|
|
13
|
+
type DeployOptionsWithoutWait,
|
|
13
14
|
type RequestDeployOptions,
|
|
14
15
|
type SimulateDeployOptions,
|
|
15
16
|
} from '../contract/deploy_method.js';
|
|
17
|
+
import type { FeePaymentMethodOption, InteractionWaitOptions } from '../contract/interaction_options.js';
|
|
16
18
|
import type { FeePaymentMethod } from '../fee/fee_payment_method.js';
|
|
17
19
|
import { AccountEntrypointMetaPaymentMethod } from './account_entrypoint_meta_payment_method.js';
|
|
18
20
|
import type { Wallet } from './index.js';
|
|
19
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Extended fee payment method option for account deployments that includes entrypoint wrapping options
|
|
24
|
+
*/
|
|
25
|
+
export type DeployAccountFeePaymentMethodOption = FeePaymentMethodOption & {
|
|
26
|
+
/** Optional entrypoint-specific options for wrapping execution payloads */
|
|
27
|
+
feeEntrypointOptions?: unknown;
|
|
28
|
+
};
|
|
29
|
+
|
|
20
30
|
/**
|
|
21
31
|
* The configuration options for the request method. Omits the contractAddressSalt, since
|
|
22
32
|
* for account contracts that is fixed in the constructor
|
|
23
33
|
*/
|
|
24
|
-
export type RequestDeployAccountOptions = Omit<RequestDeployOptions, 'contractAddressSalt'
|
|
34
|
+
export type RequestDeployAccountOptions = Omit<RequestDeployOptions, 'contractAddressSalt' | 'fee'> & {
|
|
35
|
+
/** Fee options specific to account deployment */
|
|
36
|
+
fee?: DeployAccountFeePaymentMethodOption;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Base configuration options for the send/prove methods without wait parameter. Omits:
|
|
41
|
+
* - The contractAddressSalt, since for account contracts that is fixed in the constructor.
|
|
42
|
+
* - UniversalDeployment flag, since account contracts are always deployed with it set to true
|
|
43
|
+
*/
|
|
44
|
+
export type DeployAccountOptionsWithoutWait = Omit<DeployOptionsWithoutWait, 'contractAddressSalt' | 'universalDeploy'>;
|
|
25
45
|
|
|
26
46
|
/**
|
|
27
47
|
* The configuration options for the send/prove methods. Omits:
|
|
28
48
|
* - The contractAddressSalt, since for account contracts that is fixed in the constructor.
|
|
29
49
|
* - UniversalDeployment flag, since account contracts are always deployed with it set to true
|
|
30
50
|
*/
|
|
31
|
-
export type DeployAccountOptions =
|
|
51
|
+
export type DeployAccountOptions<W extends InteractionWaitOptions = undefined> = DeployAccountOptionsWithoutWait & {
|
|
52
|
+
/**
|
|
53
|
+
* Whether to wait for the transaction to be mined.
|
|
54
|
+
* - undefined (default): wait with default options and return TxReceipt
|
|
55
|
+
* - WaitOpts object: wait with custom options and return TxReceipt
|
|
56
|
+
* - false: return txHash immediately without waiting
|
|
57
|
+
*/
|
|
58
|
+
wait?: W;
|
|
59
|
+
};
|
|
32
60
|
|
|
33
61
|
/**
|
|
34
62
|
* The configuration options for the simulate method. Omits the contractAddressSalt, since
|
|
@@ -47,6 +75,7 @@ export class DeployAccountMethod<TContract extends ContractBase = Contract> exte
|
|
|
47
75
|
artifact: ContractArtifact,
|
|
48
76
|
postDeployCtor: (instance: ContractInstanceWithAddress, wallet: Wallet) => TContract,
|
|
49
77
|
private salt: Fr,
|
|
78
|
+
private account: Account,
|
|
50
79
|
args: any[] = [],
|
|
51
80
|
constructorNameOrArtifact?: string | FunctionArtifact,
|
|
52
81
|
) {
|
|
@@ -61,19 +90,14 @@ export class DeployAccountMethod<TContract extends ContractBase = Contract> exte
|
|
|
61
90
|
* For more details on how the fee payment routing works see documentation of AccountEntrypointMetaPaymentMethod class.
|
|
62
91
|
*
|
|
63
92
|
* @param originalPaymentMethod - originalPaymentMethod The original payment method to be wrapped.
|
|
93
|
+
* @param feeEntrypointOptions - Optional entrypoint-specific options for wrapping. If not provided, will be auto-computed based on the payment method.
|
|
64
94
|
* @returns A FeePaymentMethod that routes the original one through the account's entrypoint (AccountEntrypointMetaPaymentMethod)
|
|
65
95
|
*/
|
|
66
|
-
private getSelfFeePaymentMethod(originalPaymentMethod?: FeePaymentMethod) {
|
|
96
|
+
private getSelfFeePaymentMethod(originalPaymentMethod?: FeePaymentMethod, feeEntrypointOptions?: any) {
|
|
67
97
|
if (!this.address) {
|
|
68
98
|
throw new Error('Instance is not yet constructed. This is a bug!');
|
|
69
99
|
}
|
|
70
|
-
return new AccountEntrypointMetaPaymentMethod(
|
|
71
|
-
this.wallet,
|
|
72
|
-
this.artifact,
|
|
73
|
-
'entrypoint',
|
|
74
|
-
this.address,
|
|
75
|
-
originalPaymentMethod,
|
|
76
|
-
);
|
|
100
|
+
return new AccountEntrypointMetaPaymentMethod(this.account, originalPaymentMethod, feeEntrypointOptions);
|
|
77
101
|
}
|
|
78
102
|
|
|
79
103
|
/**
|
|
@@ -97,7 +121,7 @@ export class DeployAccountMethod<TContract extends ContractBase = Contract> exte
|
|
|
97
121
|
const executionPayloads = [deploymentExecutionPayload];
|
|
98
122
|
// If this is a self-deployment, manage the fee accordingly
|
|
99
123
|
if (opts?.deployer?.equals(AztecAddress.ZERO)) {
|
|
100
|
-
const feePaymentMethod = this.getSelfFeePaymentMethod(opts?.fee?.paymentMethod);
|
|
124
|
+
const feePaymentMethod = this.getSelfFeePaymentMethod(opts?.fee?.paymentMethod, opts?.fee?.feeEntrypointOptions);
|
|
101
125
|
const feeExecutionPayload = await feePaymentMethod.getExecutionPayload();
|
|
102
126
|
// Notice they are reversed (fee payment usually goes first):
|
|
103
127
|
// this is because we need to construct the contract BEFORE it can pay for its own fee
|
|
@@ -113,7 +137,7 @@ export class DeployAccountMethod<TContract extends ContractBase = Contract> exte
|
|
|
113
137
|
return mergeExecutionPayloads(executionPayloads);
|
|
114
138
|
}
|
|
115
139
|
|
|
116
|
-
override convertDeployOptionsToRequestOptions(options:
|
|
140
|
+
override convertDeployOptionsToRequestOptions(options: DeployAccountOptionsWithoutWait): RequestDeployOptions {
|
|
117
141
|
return {
|
|
118
142
|
...options,
|
|
119
143
|
// Deployer is handled in the request method and forcibly set to undefined,
|
package/src/wallet/index.ts
CHANGED