@aztec/aztec.js 0.0.1-commit.b655e406 → 0.0.1-commit.c31f2472
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 +26 -42
- package/dest/account/account.d.ts.map +1 -1
- package/dest/account/account.js +19 -47
- package/dest/account/account_contract.d.ts +9 -10
- package/dest/account/account_contract.d.ts.map +1 -1
- package/dest/account/account_with_secret_key.d.ts +20 -9
- 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 +4 -3
- package/dest/account/index.d.ts.map +1 -1
- package/dest/account/index.js +2 -0
- package/dest/account/signerless_account.d.ts +7 -9
- package/dest/account/signerless_account.d.ts.map +1 -1
- package/dest/account/signerless_account.js +8 -11
- package/dest/api/abi.d.ts +1 -1
- package/dest/api/account.d.ts +3 -4
- package/dest/api/account.d.ts.map +1 -1
- package/dest/api/account.js +2 -3
- package/dest/api/addresses.d.ts +1 -1
- 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/block.d.ts +1 -1
- package/dest/api/contract.d.ts +17 -11
- package/dest/api/contract.d.ts.map +1 -1
- package/dest/api/contract.js +15 -9
- package/dest/api/crypto.d.ts +1 -1
- package/dest/api/deployment.d.ts +1 -1
- package/dest/api/eth_address.d.ts +1 -1
- package/dest/api/ethereum.d.ts +1 -1
- package/dest/api/events.d.ts +1 -1
- package/dest/api/fee.d.ts +1 -1
- package/dest/api/fee_testing.d.ts +1 -1
- package/dest/api/fields.d.ts +3 -2
- package/dest/api/fields.d.ts.map +1 -1
- package/dest/api/fields.js +2 -1
- package/dest/api/keys.d.ts +1 -1
- package/dest/api/log.d.ts +1 -1
- package/dest/api/messaging.d.ts +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/note.d.ts +2 -2
- package/dest/api/note.d.ts.map +1 -1
- package/dest/api/note.js +1 -1
- 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/trees.d.ts +1 -1
- 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/utils.d.ts +1 -1
- package/dest/api/wallet.d.ts +2 -3
- package/dest/api/wallet.d.ts.map +1 -1
- package/dest/api/wallet.js +1 -2
- package/dest/authorization/call_authorization_request.d.ts +2 -2
- package/dest/authorization/call_authorization_request.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.d.ts +8 -11
- 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 +8 -9
- package/dest/contract/batch_call.d.ts.map +1 -1
- package/dest/contract/batch_call.js +54 -34
- package/dest/contract/checker.d.ts +1 -1
- package/dest/contract/contract.d.ts +2 -2
- package/dest/contract/contract.d.ts.map +1 -1
- package/dest/contract/contract.js +4 -5
- package/dest/contract/contract_base.d.ts +6 -10
- package/dest/contract/contract_base.d.ts.map +1 -1
- package/dest/contract/contract_base.js +5 -12
- package/dest/contract/contract_function_interaction.d.ts +3 -3
- package/dest/contract/contract_function_interaction.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.js +9 -6
- package/dest/contract/deploy_method.d.ts +71 -23
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +49 -29
- package/dest/contract/get_gas_limits.d.ts +1 -1
- package/dest/contract/interaction_options.d.ts +44 -7
- package/dest/contract/interaction_options.d.ts.map +1 -1
- package/dest/contract/interaction_options.js +12 -11
- package/dest/contract/protocol_contracts/auth-registry.d.ts +36 -0
- package/dest/contract/protocol_contracts/auth-registry.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/auth-registry.js +963 -0
- package/dest/contract/protocol_contracts/contract-class-registry.d.ts +35 -0
- package/dest/contract/protocol_contracts/contract-class-registry.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/contract-class-registry.js +784 -0
- package/dest/contract/protocol_contracts/contract-instance-registry.d.ts +31 -0
- package/dest/contract/protocol_contracts/contract-instance-registry.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/contract-instance-registry.js +866 -0
- package/dest/contract/protocol_contracts/fee-juice.d.ts +30 -0
- package/dest/contract/protocol_contracts/fee-juice.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/fee-juice.js +827 -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 +563 -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 +579 -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/broadcast_function.d.ts +1 -1
- package/dest/deployment/broadcast_function.js +4 -4
- package/dest/deployment/contract_deployer.d.ts +1 -1
- package/dest/deployment/contract_deployer.d.ts.map +1 -1
- package/dest/deployment/contract_deployer.js +1 -1
- package/dest/deployment/publish_class.d.ts +1 -1
- package/dest/deployment/publish_class.js +3 -3
- 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 -6
- package/dest/ethereum/portal_manager.d.ts.map +1 -1
- package/dest/ethereum/portal_manager.js +48 -22
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts +2 -2
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
- package/dest/fee/fee_juice_payment_method_with_claim.js +3 -3
- package/dest/fee/fee_payment_method.d.ts +2 -2
- package/dest/fee/fee_payment_method.d.ts.map +1 -1
- package/dest/fee/private_fee_payment_method.d.ts +2 -2
- package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/private_fee_payment_method.js +4 -4
- package/dest/fee/public_fee_payment_method.d.ts +2 -2
- package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/public_fee_payment_method.js +4 -4
- package/dest/fee/sponsored_fee_payment.d.ts +2 -2
- package/dest/fee/sponsored_fee_payment.d.ts.map +1 -1
- package/dest/fee/sponsored_fee_payment.js +2 -2
- 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/abi_types.d.ts +2 -2
- package/dest/utils/abi_types.d.ts.map +1 -1
- package/dest/utils/authwit.d.ts +14 -12
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/authwit.js +27 -20
- package/dest/utils/cross_chain.d.ts +2 -2
- package/dest/utils/cross_chain.d.ts.map +1 -1
- package/dest/utils/fee_juice.d.ts +2 -2
- package/dest/utils/fee_juice.js +2 -2
- package/dest/utils/field_compressed_string.d.ts +1 -1
- package/dest/utils/field_compressed_string.d.ts.map +1 -1
- package/dest/utils/field_compressed_string.js +1 -1
- package/dest/utils/node.d.ts +13 -2
- package/dest/utils/node.d.ts.map +1 -1
- package/dest/utils/node.js +46 -0
- package/dest/utils/pub_key.d.ts +2 -2
- package/dest/utils/pub_key.d.ts.map +1 -1
- package/dest/utils/pub_key.js +1 -1
- package/dest/wallet/account_entrypoint_meta_payment_method.d.ts +6 -9
- package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -1
- package/dest/wallet/account_entrypoint_meta_payment_method.js +29 -44
- package/dest/wallet/account_manager.d.ts +3 -9
- package/dest/wallet/account_manager.d.ts.map +1 -1
- package/dest/wallet/account_manager.js +6 -12
- package/dest/wallet/deploy_account_method.d.ts +37 -9
- package/dest/wallet/deploy_account_method.d.ts.map +1 -1
- package/dest/wallet/deploy_account_method.js +9 -7
- package/dest/wallet/index.d.ts +1 -2
- package/dest/wallet/index.d.ts.map +1 -1
- package/dest/wallet/index.js +0 -1
- package/dest/wallet/wallet.d.ts +323 -1504
- package/dest/wallet/wallet.d.ts.map +1 -1
- package/dest/wallet/wallet.js +85 -115
- package/package.json +16 -13
- package/src/account/account.ts +35 -60
- package/src/account/account_contract.ts +7 -8
- package/src/account/account_with_secret_key.ts +34 -9
- package/src/account/index.ts +3 -2
- package/src/account/signerless_account.ts +15 -15
- package/src/api/account.ts +10 -3
- package/src/api/authorization.ts +1 -0
- package/src/api/contract.ts +24 -8
- package/src/api/fields.ts +2 -1
- package/src/api/node.ts +7 -3
- package/src/api/note.ts +1 -1
- package/src/api/protocol.ts +7 -0
- package/src/api/tx.ts +4 -0
- package/src/api/wallet.ts +10 -9
- package/src/authorization/call_authorization_request.ts +1 -1
- package/src/contract/base_contract_interaction.ts +27 -16
- package/src/contract/batch_call.ts +67 -48
- package/src/contract/contract.ts +7 -5
- package/src/contract/contract_base.ts +5 -15
- package/src/contract/contract_function_interaction.ts +10 -11
- package/src/contract/deploy_method.ts +134 -40
- package/src/contract/interaction_options.ts +52 -13
- package/src/contract/protocol_contracts/auth-registry.ts +545 -0
- package/src/contract/protocol_contracts/contract-class-registry.ts +433 -0
- package/src/contract/protocol_contracts/contract-instance-registry.ts +495 -0
- package/src/contract/protocol_contracts/fee-juice.ts +457 -0
- package/src/contract/protocol_contracts/multi-call-entrypoint.ts +329 -0
- package/src/contract/protocol_contracts/public-checks.ts +315 -0
- package/src/contract/wait_for_proven.ts +1 -1
- package/src/contract/wait_opts.ts +21 -0
- package/src/deployment/broadcast_function.ts +4 -4
- package/src/deployment/contract_deployer.ts +3 -2
- package/src/deployment/publish_class.ts +3 -3
- package/src/deployment/publish_instance.ts +3 -6
- package/src/ethereum/portal_manager.ts +65 -34
- package/src/fee/fee_juice_payment_method_with_claim.ts +4 -2
- package/src/fee/fee_payment_method.ts +1 -1
- package/src/fee/private_fee_payment_method.ts +5 -3
- package/src/fee/public_fee_payment_method.ts +5 -3
- package/src/fee/sponsored_fee_payment.ts +3 -1
- package/src/scripts/generate_protocol_contract_types.ts +150 -0
- package/src/utils/abi_types.ts +1 -1
- package/src/utils/authwit.ts +40 -22
- package/src/utils/cross_chain.ts +1 -1
- package/src/utils/fee_juice.ts +2 -2
- package/src/utils/field_compressed_string.ts +1 -1
- package/src/utils/node.ts +62 -0
- package/src/utils/pub_key.ts +2 -2
- package/src/wallet/account_entrypoint_meta_payment_method.ts +29 -60
- package/src/wallet/account_manager.ts +7 -15
- package/src/wallet/deploy_account_method.ts +41 -16
- package/src/wallet/index.ts +0 -1
- package/src/wallet/wallet.ts +207 -152
- 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 -43
- package/dest/contract/deploy_sent_tx.d.ts.map +0 -1
- package/dest/contract/deploy_sent_tx.js +0 -40
- 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 -51
- 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/wallet/base_wallet.d.ts +0 -91
- package/dest/wallet/base_wallet.d.ts.map +0 -1
- package/dest/wallet/base_wallet.js +0 -238
- package/src/account/interface.ts +0 -25
- package/src/contract/deploy_sent_tx.ts +0 -68
- package/src/contract/protocol_contracts.ts +0 -35
- package/src/contract/sent_tx.ts +0 -130
- package/src/contract/unsafe_contract.ts +0 -19
- package/src/wallet/base_wallet.ts +0 -350
package/src/utils/authwit.ts
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import type { ChainInfo } from '@aztec/entrypoints/interfaces';
|
|
2
|
-
import { Fr } from '@aztec/foundation/
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
4
4
|
import { type ABIParameterVisibility, type FunctionAbi, type FunctionCall, FunctionType } from '@aztec/stdlib/abi';
|
|
5
5
|
import { AuthWitness, computeInnerAuthWitHash, computeOuterAuthWitHash } from '@aztec/stdlib/auth-witness';
|
|
6
6
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
7
|
import { computeVarArgsHash } from '@aztec/stdlib/hash';
|
|
8
|
-
import type { TxProfileResult } from '@aztec/stdlib/tx';
|
|
8
|
+
import type { TxHash, TxProfileResult, TxReceipt } from '@aztec/stdlib/tx';
|
|
9
9
|
|
|
10
10
|
import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
|
|
11
11
|
import type {
|
|
12
|
+
InteractionWaitOptions,
|
|
12
13
|
ProfileInteractionOptions,
|
|
13
14
|
SendInteractionOptions,
|
|
15
|
+
SendInteractionOptionsWithoutWait,
|
|
16
|
+
SendReturn,
|
|
14
17
|
SimulateInteractionOptions,
|
|
15
18
|
SimulationReturn,
|
|
16
19
|
} from '../contract/interaction_options.js';
|
|
17
|
-
import type { SentTx } from '../contract/sent_tx.js';
|
|
18
20
|
import type { Wallet } from '../wallet/index.js';
|
|
19
21
|
|
|
20
22
|
/** Intent with an inner hash */
|
|
@@ -22,7 +24,7 @@ export type IntentInnerHash = {
|
|
|
22
24
|
/** The consumer */
|
|
23
25
|
consumer: AztecAddress;
|
|
24
26
|
/** The action to approve */
|
|
25
|
-
innerHash:
|
|
27
|
+
innerHash: Fr;
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
/** Intent with a call */
|
|
@@ -42,8 +44,8 @@ export type ContractFunctionInteractionCallIntent = {
|
|
|
42
44
|
};
|
|
43
45
|
|
|
44
46
|
/** Identifies ContractFunctionInteractionCallIntents */
|
|
45
|
-
function
|
|
46
|
-
messageHashOrIntent: Fr |
|
|
47
|
+
export function isContractFunctionInteractionCallIntent(
|
|
48
|
+
messageHashOrIntent: Fr | IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent,
|
|
47
49
|
): messageHashOrIntent is ContractFunctionInteractionCallIntent {
|
|
48
50
|
return (
|
|
49
51
|
'caller' in messageHashOrIntent &&
|
|
@@ -81,7 +83,7 @@ export const computeAuthWitMessageHash = async (
|
|
|
81
83
|
const version = metadata.version;
|
|
82
84
|
|
|
83
85
|
if ('caller' in intent) {
|
|
84
|
-
const call =
|
|
86
|
+
const call = isContractFunctionInteractionCallIntent(intent) ? await intent.action.getFunctionCall() : intent.call;
|
|
85
87
|
return computeOuterAuthWitHash(
|
|
86
88
|
call.to,
|
|
87
89
|
chainId,
|
|
@@ -102,14 +104,12 @@ export const computeAuthWitMessageHash = async (
|
|
|
102
104
|
* @returns The message hash for the intent
|
|
103
105
|
*/
|
|
104
106
|
export async function getMessageHashFromIntent(
|
|
105
|
-
messageHashOrIntent: Fr |
|
|
107
|
+
messageHashOrIntent: Fr | IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent,
|
|
106
108
|
chainInfo: ChainInfo,
|
|
107
109
|
) {
|
|
108
110
|
let messageHash: Fr;
|
|
109
111
|
const { chainId, version } = chainInfo;
|
|
110
|
-
if (
|
|
111
|
-
messageHash = Fr.fromBuffer(messageHashOrIntent);
|
|
112
|
-
} else if (messageHashOrIntent instanceof Fr) {
|
|
112
|
+
if (messageHashOrIntent instanceof Fr) {
|
|
113
113
|
messageHash = messageHashOrIntent;
|
|
114
114
|
} else {
|
|
115
115
|
messageHash = await computeAuthWitMessageHash(messageHashOrIntent, { chainId, version });
|
|
@@ -156,12 +156,9 @@ export async function lookupValidity(
|
|
|
156
156
|
}> {
|
|
157
157
|
let innerHash, consumer;
|
|
158
158
|
if ('caller' in intent) {
|
|
159
|
-
const call =
|
|
159
|
+
const call = isContractFunctionInteractionCallIntent(intent) ? await intent.action.getFunctionCall() : intent.call;
|
|
160
160
|
innerHash = await computeInnerAuthWitHashFromAction(intent.caller, call);
|
|
161
161
|
consumer = call.to;
|
|
162
|
-
} else if (Buffer.isBuffer(intent.innerHash)) {
|
|
163
|
-
innerHash = Fr.fromBuffer(intent.innerHash);
|
|
164
|
-
consumer = intent.consumer;
|
|
165
162
|
} else {
|
|
166
163
|
({ innerHash, consumer } = intent);
|
|
167
164
|
}
|
|
@@ -174,9 +171,20 @@ export async function lookupValidity(
|
|
|
174
171
|
name: 'lookup_validity',
|
|
175
172
|
isInitializer: false,
|
|
176
173
|
functionType: FunctionType.UTILITY,
|
|
177
|
-
|
|
174
|
+
isOnlySelf: false,
|
|
178
175
|
isStatic: false,
|
|
179
|
-
parameters: [
|
|
176
|
+
parameters: [
|
|
177
|
+
{
|
|
178
|
+
name: 'consumer',
|
|
179
|
+
type: {
|
|
180
|
+
fields: [{ name: 'inner', type: { kind: 'field' } }],
|
|
181
|
+
kind: 'struct',
|
|
182
|
+
path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
|
|
183
|
+
},
|
|
184
|
+
visibility: 'private' as ABIParameterVisibility,
|
|
185
|
+
},
|
|
186
|
+
{ name: 'inner_hash', type: { kind: 'field' }, visibility: 'private' as ABIParameterVisibility },
|
|
187
|
+
],
|
|
180
188
|
returnTypes: [{ kind: 'boolean' }],
|
|
181
189
|
errorTypes: {},
|
|
182
190
|
} as FunctionAbi;
|
|
@@ -194,7 +202,7 @@ export async function lookupValidity(
|
|
|
194
202
|
name: 'utility_is_consumable',
|
|
195
203
|
isInitializer: false,
|
|
196
204
|
functionType: FunctionType.UTILITY,
|
|
197
|
-
|
|
205
|
+
isOnlySelf: false,
|
|
198
206
|
isStatic: false,
|
|
199
207
|
parameters: [
|
|
200
208
|
{
|
|
@@ -240,7 +248,7 @@ export class SetPublicAuthwitContractInteraction extends ContractFunctionInterac
|
|
|
240
248
|
static async create(
|
|
241
249
|
wallet: Wallet,
|
|
242
250
|
from: AztecAddress,
|
|
243
|
-
messageHashOrIntent: Fr |
|
|
251
|
+
messageHashOrIntent: Fr | IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent,
|
|
244
252
|
authorized: boolean,
|
|
245
253
|
) {
|
|
246
254
|
const chainInfo = await wallet.getChainInfo();
|
|
@@ -280,9 +288,19 @@ export class SetPublicAuthwitContractInteraction extends ContractFunctionInterac
|
|
|
280
288
|
* Overrides the send method, adding the sender of the authwit (authorizer) as from
|
|
281
289
|
* and preventing misuse
|
|
282
290
|
* @param options - An optional object containing 'fee' options information
|
|
283
|
-
* @returns A
|
|
291
|
+
* @returns A TxReceipt (if wait is true/undefined) or TxHash (if wait is false)
|
|
284
292
|
*/
|
|
285
|
-
|
|
293
|
+
// Overload for when wait is not specified at all - returns TxReceipt
|
|
294
|
+
public override send(options?: Omit<SendInteractionOptionsWithoutWait, 'from'>): Promise<TxReceipt>;
|
|
295
|
+
// Generic overload for explicit wait values
|
|
296
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
297
|
+
public override send<W extends InteractionWaitOptions>(
|
|
298
|
+
options?: Omit<SendInteractionOptions<W>, 'from'>,
|
|
299
|
+
): Promise<SendReturn<W>>;
|
|
300
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
301
|
+
public override send(
|
|
302
|
+
options?: Omit<SendInteractionOptions<InteractionWaitOptions>, 'from'>,
|
|
303
|
+
): Promise<TxReceipt | TxHash> {
|
|
286
304
|
return super.send({ ...options, from: this.from });
|
|
287
305
|
}
|
|
288
306
|
|
|
@@ -291,7 +309,7 @@ export class SetPublicAuthwitContractInteraction extends ContractFunctionInterac
|
|
|
291
309
|
name: 'set_authorized',
|
|
292
310
|
isInitializer: false,
|
|
293
311
|
functionType: FunctionType.PUBLIC,
|
|
294
|
-
|
|
312
|
+
isOnlySelf: true,
|
|
295
313
|
isStatic: false,
|
|
296
314
|
parameters: [
|
|
297
315
|
{
|
package/src/utils/cross_chain.ts
CHANGED
package/src/utils/fee_juice.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
3
3
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
import { deriveStorageSlotInMap } from '@aztec/stdlib/hash';
|
|
@@ -6,7 +6,7 @@ import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Returns the owner's fee juice balance.
|
|
9
|
-
* Note: This is used only
|
|
9
|
+
* Note: This is used only e2e_local_network_example test. TODO: Consider nuking.
|
|
10
10
|
*/
|
|
11
11
|
export async function getFeeJuiceBalance(owner: AztecAddress, node: AztecNode): Promise<bigint> {
|
|
12
12
|
const slot = await deriveStorageSlotInMap(new Fr(1), owner);
|
package/src/utils/node.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { Logger } from '@aztec/foundation/log';
|
|
2
2
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
3
3
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
4
|
+
import type { TxHash, TxReceipt } from '@aztec/stdlib/tx';
|
|
5
|
+
import { SortedTxStatuses, TxStatus } from '@aztec/stdlib/tx';
|
|
6
|
+
|
|
7
|
+
import { DefaultWaitOpts, type WaitOpts } from '../contract/wait_opts.js';
|
|
4
8
|
|
|
5
9
|
export const waitForNode = async (node: AztecNode, logger?: Logger) => {
|
|
6
10
|
await retryUntil(async () => {
|
|
@@ -16,4 +20,62 @@ export const waitForNode = async (node: AztecNode, logger?: Logger) => {
|
|
|
16
20
|
}, 'RPC Get Node Info');
|
|
17
21
|
};
|
|
18
22
|
|
|
23
|
+
/** Returns true if the receipt status is at least the desired status level. */
|
|
24
|
+
function hasReachedStatus(receipt: TxReceipt, desiredStatus: TxStatus): boolean {
|
|
25
|
+
return SortedTxStatuses.indexOf(receipt.status) >= SortedTxStatuses.indexOf(desiredStatus);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Waits for a transaction to be mined and returns its receipt.
|
|
30
|
+
* @param node - The Aztec node to query for transaction status
|
|
31
|
+
* @param txHash - The hash of the transaction to wait for
|
|
32
|
+
* @param opts - Optional configuration for waiting behavior
|
|
33
|
+
* @returns The transaction receipt
|
|
34
|
+
* @throws If the transaction fails and dontThrowOnRevert is not set
|
|
35
|
+
*/
|
|
36
|
+
export async function waitForTx(node: AztecNode, txHash: TxHash, opts?: WaitOpts): Promise<TxReceipt> {
|
|
37
|
+
const startTime = Date.now();
|
|
38
|
+
const ignoreDroppedReceiptsFor = opts?.ignoreDroppedReceiptsFor ?? DefaultWaitOpts.ignoreDroppedReceiptsFor;
|
|
39
|
+
const waitForStatus = opts?.waitForStatus ?? TxStatus.CHECKPOINTED;
|
|
40
|
+
|
|
41
|
+
const receipt = await retryUntil(
|
|
42
|
+
async () => {
|
|
43
|
+
const txReceipt = await node.getTxReceipt(txHash);
|
|
44
|
+
// If receipt is not yet available, try again
|
|
45
|
+
if (txReceipt.isPending()) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
// If the tx was "dropped", either return it or ignore based on timing.
|
|
49
|
+
// We can ignore it at first because the transaction may have been sent to node 1, and now we're asking node 2 for the receipt.
|
|
50
|
+
// If we don't allow a short grace period, we could incorrectly return a TxReceipt with status DROPPED.
|
|
51
|
+
if (txReceipt.isDropped()) {
|
|
52
|
+
const elapsedSeconds = (Date.now() - startTime) / 1000;
|
|
53
|
+
if (!ignoreDroppedReceiptsFor || elapsedSeconds > ignoreDroppedReceiptsFor) {
|
|
54
|
+
return txReceipt;
|
|
55
|
+
}
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
// Check if the receipt has reached the desired status level
|
|
59
|
+
if (!hasReachedStatus(txReceipt, waitForStatus)) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
return txReceipt;
|
|
63
|
+
},
|
|
64
|
+
'isMined',
|
|
65
|
+
opts?.timeout ?? DefaultWaitOpts.timeout,
|
|
66
|
+
opts?.interval ?? DefaultWaitOpts.interval,
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
if (!receipt.isMined()) {
|
|
70
|
+
throw new Error(`Transaction ${txHash.toString()} was ${receipt.status}. Reason: ${receipt.error ?? 'unknown'}`);
|
|
71
|
+
}
|
|
72
|
+
if (!receipt.hasExecutionSucceeded() && !opts?.dontThrowOnRevert) {
|
|
73
|
+
throw new Error(
|
|
74
|
+
`Transaction ${txHash.toString()} reverted: ${receipt.executionResult}. Reason: ${receipt.error ?? 'unknown'}`,
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return receipt;
|
|
79
|
+
}
|
|
80
|
+
|
|
19
81
|
export { createAztecNodeClient, type AztecNode } from '@aztec/stdlib/interfaces/client';
|
package/src/utils/pub_key.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Grumpkin } from '@aztec/foundation/crypto';
|
|
2
|
-
import type { GrumpkinScalar } from '@aztec/foundation/
|
|
1
|
+
import { Grumpkin } from '@aztec/foundation/crypto/grumpkin';
|
|
2
|
+
import type { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
|
|
3
3
|
import type { PublicKey } from '@aztec/stdlib/keys';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import { AccountFeePaymentMethodOptions } from '@aztec/entrypoints/account';
|
|
2
|
-
import { EncodedAppEntrypointCalls } from '@aztec/entrypoints/encoding';
|
|
3
|
-
import { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
4
2
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
5
|
-
import {
|
|
6
|
-
type ContractArtifact,
|
|
7
|
-
type FunctionArtifact,
|
|
8
|
-
FunctionCall,
|
|
9
|
-
FunctionSelector,
|
|
10
|
-
encodeArguments,
|
|
11
|
-
getFunctionArtifactByName,
|
|
12
|
-
} from '@aztec/stdlib/abi';
|
|
13
3
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
14
4
|
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
5
|
+
import { ExecutionPayload } from '@aztec/stdlib/tx';
|
|
15
6
|
|
|
7
|
+
import type { Account } from '../account/account.js';
|
|
16
8
|
import type { FeePaymentMethod } from '../fee/fee_payment_method.js';
|
|
17
|
-
import type { Wallet } from './index.js';
|
|
18
9
|
|
|
19
10
|
/**
|
|
20
11
|
* Fee payment method that allows an account contract to pay for its own deployment
|
|
@@ -33,11 +24,9 @@ import type { Wallet } from './index.js';
|
|
|
33
24
|
*/
|
|
34
25
|
export class AccountEntrypointMetaPaymentMethod implements FeePaymentMethod {
|
|
35
26
|
constructor(
|
|
36
|
-
private
|
|
37
|
-
private artifact: ContractArtifact,
|
|
38
|
-
private feePaymentNameOrArtifact: string | FunctionArtifact,
|
|
39
|
-
private accountAddress: AztecAddress,
|
|
27
|
+
private account: Account,
|
|
40
28
|
private paymentMethod?: FeePaymentMethod,
|
|
29
|
+
private feeEntrypointOptions?: any,
|
|
41
30
|
) {}
|
|
42
31
|
|
|
43
32
|
getAsset(): Promise<AztecAddress> {
|
|
@@ -45,58 +34,38 @@ export class AccountEntrypointMetaPaymentMethod implements FeePaymentMethod {
|
|
|
45
34
|
}
|
|
46
35
|
|
|
47
36
|
async getExecutionPayload(): Promise<ExecutionPayload> {
|
|
48
|
-
// Get the execution payload for the fee
|
|
49
|
-
|
|
50
|
-
// FeeJuice balance
|
|
51
|
-
const { calls: feeCalls, authWitnesses: feeAuthwitnesses } =
|
|
52
|
-
(await this.paymentMethod?.getExecutionPayload()) ?? ExecutionPayload.empty();
|
|
53
|
-
// Encode the calls for the fee
|
|
54
|
-
const feePayer = (await this.paymentMethod?.getFeePayer()) ?? this.accountAddress;
|
|
55
|
-
const isFeePayer = feePayer.equals(this.accountAddress);
|
|
56
|
-
let accountFeePaymentMethodOptions = AccountFeePaymentMethodOptions.EXTERNAL;
|
|
57
|
-
if (isFeePayer) {
|
|
58
|
-
// If the account is the fee payer, and the incoming fee payload has calls
|
|
59
|
-
// it can only be FeeJuicePaymentMethodWithClaim
|
|
60
|
-
// If the payload has no calls, it's paying using
|
|
61
|
-
// its own fee juice balance
|
|
62
|
-
accountFeePaymentMethodOptions =
|
|
63
|
-
feeCalls.length === 0
|
|
64
|
-
? AccountFeePaymentMethodOptions.PREEXISTING_FEE_JUICE
|
|
65
|
-
: AccountFeePaymentMethodOptions.FEE_JUICE_WITH_CLAIM;
|
|
66
|
-
}
|
|
67
|
-
const feeEncodedCalls = await EncodedAppEntrypointCalls.create(feeCalls);
|
|
37
|
+
// Get the execution payload for the fee
|
|
38
|
+
const innerPayload = (await this.paymentMethod?.getExecutionPayload()) ?? ExecutionPayload.empty();
|
|
68
39
|
|
|
69
|
-
//
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
40
|
+
// If no fee entrypoint options were provided, compute them based on the wrapped payment method
|
|
41
|
+
// This mimics how the actual account contract works when invoked directly:
|
|
42
|
+
// - If we are the fee payer, are there calls in the inner payload? In that case, those calls can
|
|
43
|
+
// only be claiming fee juice, so we use FEE_JUICE_WITH_CLAIM
|
|
44
|
+
// - If we are the fee payer, but there are no calls, then we assume the account already has
|
|
45
|
+
// fee juice and can pay directly with PREEXISTING_FEE_JUICE
|
|
46
|
+
// - If we are not the fee payer, then EXTERNAL is used
|
|
47
|
+
let options = this.feeEntrypointOptions;
|
|
48
|
+
if (!options) {
|
|
49
|
+
const feePayer = (await this.paymentMethod?.getFeePayer()) ?? this.account.getAddress();
|
|
50
|
+
const isFeePayer = feePayer.equals(this.account.getAddress());
|
|
75
51
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
encodeArguments(feePaymentArtifact, args),
|
|
84
|
-
feePaymentArtifact.returnTypes,
|
|
85
|
-
);
|
|
52
|
+
let accountFeePaymentMethodOptions = AccountFeePaymentMethodOptions.EXTERNAL;
|
|
53
|
+
if (isFeePayer) {
|
|
54
|
+
accountFeePaymentMethodOptions =
|
|
55
|
+
innerPayload.calls.length === 0
|
|
56
|
+
? AccountFeePaymentMethodOptions.PREEXISTING_FEE_JUICE
|
|
57
|
+
: AccountFeePaymentMethodOptions.FEE_JUICE_WITH_CLAIM;
|
|
58
|
+
}
|
|
86
59
|
|
|
87
|
-
|
|
88
|
-
|
|
60
|
+
options = { feePaymentMethodOptions: accountFeePaymentMethodOptions };
|
|
61
|
+
}
|
|
89
62
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
[payloadAuthWitness, ...feeAuthwitnesses],
|
|
93
|
-
[],
|
|
94
|
-
feeEncodedCalls.hashedArguments,
|
|
95
|
-
);
|
|
63
|
+
// Use the generic wrapping mechanism from the account interface
|
|
64
|
+
return this.account.wrapExecutionPayload(innerPayload, options);
|
|
96
65
|
}
|
|
97
66
|
|
|
98
67
|
getFeePayer(): Promise<AztecAddress> {
|
|
99
|
-
return this.paymentMethod?.getFeePayer() ?? Promise.resolve(this.
|
|
68
|
+
return this.paymentMethod?.getFeePayer() ?? Promise.resolve(this.account.getAddress());
|
|
100
69
|
}
|
|
101
70
|
|
|
102
71
|
getGasSettings(): GasSettings | undefined {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import {
|
|
3
3
|
CompleteAddress,
|
|
4
4
|
type ContractInstanceWithAddress,
|
|
@@ -9,7 +9,6 @@ import { deriveKeys } from '@aztec/stdlib/keys';
|
|
|
9
9
|
import type { AccountContract } from '../account/account_contract.js';
|
|
10
10
|
import { AccountWithSecretKey } from '../account/account_with_secret_key.js';
|
|
11
11
|
import type { Salt } from '../account/index.js';
|
|
12
|
-
import type { AccountInterface } from '../account/interface.js';
|
|
13
12
|
import { Contract } from '../contract/contract.js';
|
|
14
13
|
import { DeployAccountMethod } from './deploy_account_method.js';
|
|
15
14
|
import type { Wallet } from './wallet.js';
|
|
@@ -58,16 +57,6 @@ export class AccountManager {
|
|
|
58
57
|
return this.getPublicKeys().hash();
|
|
59
58
|
}
|
|
60
59
|
|
|
61
|
-
/**
|
|
62
|
-
* Returns the entrypoint for this account as defined by its account contract.
|
|
63
|
-
* @returns An entrypoint.
|
|
64
|
-
*/
|
|
65
|
-
public async getAccountInterface(): Promise<AccountInterface> {
|
|
66
|
-
const chainInfo = await this.wallet.getChainInfo();
|
|
67
|
-
const completeAddress = await this.getCompleteAddress();
|
|
68
|
-
return this.accountContract.getInterface(completeAddress, chainInfo);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
60
|
/**
|
|
72
61
|
* Gets the calculated complete address associated with this account.
|
|
73
62
|
* Does not require the account to have been published for public execution.
|
|
@@ -103,8 +92,9 @@ export class AccountManager {
|
|
|
103
92
|
* @returns A Wallet instance.
|
|
104
93
|
*/
|
|
105
94
|
public async getAccount(): Promise<AccountWithSecretKey> {
|
|
106
|
-
const
|
|
107
|
-
|
|
95
|
+
const completeAddress = await this.getCompleteAddress();
|
|
96
|
+
const account = this.accountContract.getAccount(completeAddress);
|
|
97
|
+
return new AccountWithSecretKey(account, this.secretKey, this.salt);
|
|
108
98
|
}
|
|
109
99
|
|
|
110
100
|
/**
|
|
@@ -134,12 +124,14 @@ export class AccountManager {
|
|
|
134
124
|
constructorArgs: undefined,
|
|
135
125
|
};
|
|
136
126
|
|
|
127
|
+
const account = await this.getAccount();
|
|
137
128
|
return new DeployAccountMethod(
|
|
138
129
|
this.getPublicKeys(),
|
|
139
130
|
this.wallet,
|
|
140
131
|
artifact,
|
|
141
|
-
|
|
132
|
+
instance => Contract.at(instance.address, artifact, this.wallet),
|
|
142
133
|
new Fr(this.salt),
|
|
134
|
+
account,
|
|
143
135
|
constructorArgs,
|
|
144
136
|
constructorName,
|
|
145
137
|
);
|
|
@@ -1,33 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
2
|
import type { ContractArtifact, FunctionArtifact } from '@aztec/stdlib/abi';
|
|
4
3
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
+
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
5
5
|
import type { PublicKeys } from '@aztec/stdlib/keys';
|
|
6
|
+
import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/stdlib/tx';
|
|
6
7
|
|
|
8
|
+
import type { Account } from '../account/account.js';
|
|
7
9
|
import type { Contract } from '../contract/contract.js';
|
|
8
10
|
import type { ContractBase } from '../contract/contract_base.js';
|
|
9
11
|
import {
|
|
10
12
|
DeployMethod,
|
|
11
|
-
type
|
|
13
|
+
type DeployOptionsWithoutWait,
|
|
12
14
|
type RequestDeployOptions,
|
|
13
15
|
type SimulateDeployOptions,
|
|
14
16
|
} from '../contract/deploy_method.js';
|
|
17
|
+
import type { FeePaymentMethodOption, InteractionWaitOptions } from '../contract/interaction_options.js';
|
|
15
18
|
import type { FeePaymentMethod } from '../fee/fee_payment_method.js';
|
|
16
19
|
import { AccountEntrypointMetaPaymentMethod } from './account_entrypoint_meta_payment_method.js';
|
|
17
20
|
import type { Wallet } from './index.js';
|
|
18
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
|
+
|
|
19
30
|
/**
|
|
20
31
|
* The configuration options for the request method. Omits the contractAddressSalt, since
|
|
21
32
|
* for account contracts that is fixed in the constructor
|
|
22
33
|
*/
|
|
23
|
-
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'>;
|
|
24
45
|
|
|
25
46
|
/**
|
|
26
47
|
* The configuration options for the send/prove methods. Omits:
|
|
27
48
|
* - The contractAddressSalt, since for account contracts that is fixed in the constructor.
|
|
28
49
|
* - UniversalDeployment flag, since account contracts are always deployed with it set to true
|
|
29
50
|
*/
|
|
30
|
-
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
|
+
};
|
|
31
60
|
|
|
32
61
|
/**
|
|
33
62
|
* The configuration options for the simulate method. Omits the contractAddressSalt, since
|
|
@@ -44,8 +73,9 @@ export class DeployAccountMethod<TContract extends ContractBase = Contract> exte
|
|
|
44
73
|
publicKeys: PublicKeys,
|
|
45
74
|
wallet: Wallet,
|
|
46
75
|
artifact: ContractArtifact,
|
|
47
|
-
postDeployCtor: (
|
|
76
|
+
postDeployCtor: (instance: ContractInstanceWithAddress, wallet: Wallet) => TContract,
|
|
48
77
|
private salt: Fr,
|
|
78
|
+
private account: Account,
|
|
49
79
|
args: any[] = [],
|
|
50
80
|
constructorNameOrArtifact?: string | FunctionArtifact,
|
|
51
81
|
) {
|
|
@@ -60,19 +90,14 @@ export class DeployAccountMethod<TContract extends ContractBase = Contract> exte
|
|
|
60
90
|
* For more details on how the fee payment routing works see documentation of AccountEntrypointMetaPaymentMethod class.
|
|
61
91
|
*
|
|
62
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.
|
|
63
94
|
* @returns A FeePaymentMethod that routes the original one through the account's entrypoint (AccountEntrypointMetaPaymentMethod)
|
|
64
95
|
*/
|
|
65
|
-
private getSelfFeePaymentMethod(originalPaymentMethod?: FeePaymentMethod) {
|
|
96
|
+
private getSelfFeePaymentMethod(originalPaymentMethod?: FeePaymentMethod, feeEntrypointOptions?: any) {
|
|
66
97
|
if (!this.address) {
|
|
67
98
|
throw new Error('Instance is not yet constructed. This is a bug!');
|
|
68
99
|
}
|
|
69
|
-
return new AccountEntrypointMetaPaymentMethod(
|
|
70
|
-
this.wallet,
|
|
71
|
-
this.artifact,
|
|
72
|
-
'entrypoint',
|
|
73
|
-
this.address,
|
|
74
|
-
originalPaymentMethod,
|
|
75
|
-
);
|
|
100
|
+
return new AccountEntrypointMetaPaymentMethod(this.account, originalPaymentMethod, feeEntrypointOptions);
|
|
76
101
|
}
|
|
77
102
|
|
|
78
103
|
/**
|
|
@@ -96,7 +121,7 @@ export class DeployAccountMethod<TContract extends ContractBase = Contract> exte
|
|
|
96
121
|
const executionPayloads = [deploymentExecutionPayload];
|
|
97
122
|
// If this is a self-deployment, manage the fee accordingly
|
|
98
123
|
if (opts?.deployer?.equals(AztecAddress.ZERO)) {
|
|
99
|
-
const feePaymentMethod = this.getSelfFeePaymentMethod(opts?.fee?.paymentMethod);
|
|
124
|
+
const feePaymentMethod = this.getSelfFeePaymentMethod(opts?.fee?.paymentMethod, opts?.fee?.feeEntrypointOptions);
|
|
100
125
|
const feeExecutionPayload = await feePaymentMethod.getExecutionPayload();
|
|
101
126
|
// Notice they are reversed (fee payment usually goes first):
|
|
102
127
|
// this is because we need to construct the contract BEFORE it can pay for its own fee
|
|
@@ -112,7 +137,7 @@ export class DeployAccountMethod<TContract extends ContractBase = Contract> exte
|
|
|
112
137
|
return mergeExecutionPayloads(executionPayloads);
|
|
113
138
|
}
|
|
114
139
|
|
|
115
|
-
override convertDeployOptionsToRequestOptions(options:
|
|
140
|
+
override convertDeployOptionsToRequestOptions(options: DeployAccountOptionsWithoutWait): RequestDeployOptions {
|
|
116
141
|
return {
|
|
117
142
|
...options,
|
|
118
143
|
// Deployer is handled in the request method and forcibly set to undefined,
|
package/src/wallet/index.ts
CHANGED