@aztec/aztec.js 0.0.1-commit.03f7ef2 → 0.0.1-commit.04852196a
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/abi.d.ts +2 -2
- package/dest/api/abi.d.ts.map +1 -1
- 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 +18 -6
- package/dest/api/events.d.ts.map +1 -1
- package/dest/api/events.js +37 -22
- 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 +3 -3
- package/dest/contract/batch_call.d.ts.map +1 -1
- package/dest/contract/batch_call.js +20 -9
- 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 +7 -16
- package/dest/contract/contract_function_interaction.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.js +107 -18
- package/dest/contract/deploy_method.d.ts +91 -19
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +73 -34
- package/dest/contract/get_gas_limits.js +3 -3
- package/dest/contract/interaction_options.d.ts +99 -21
- package/dest/contract/interaction_options.d.ts.map +1 -1
- package/dest/contract/interaction_options.js +41 -1
- 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 +1005 -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 +139 -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 +434 -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 +601 -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 +609 -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.d.ts +2 -1
- package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/private_fee_payment_method.js +11 -10
- package/dest/fee/public_fee_payment_method.d.ts +2 -1
- package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/public_fee_payment_method.js +11 -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/abi_types.d.ts +6 -1
- package/dest/utils/abi_types.d.ts.map +1 -1
- package/dest/utils/abi_types.js +1 -1
- package/dest/utils/authwit.d.ts +8 -6
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/authwit.js +15 -15
- package/dest/utils/cross_chain.d.ts +3 -8
- package/dest/utils/cross_chain.d.ts.map +1 -1
- package/dest/utils/cross_chain.js +8 -15
- 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 +452 -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 +46 -7
- package/dest/wallet/deploy_account_method.d.ts.map +1 -1
- package/dest/wallet/deploy_account_method.js +33 -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 +1810 -2493
- package/dest/wallet/wallet.d.ts.map +1 -1
- package/dest/wallet/wallet.js +230 -108
- package/package.json +25 -14
- 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/abi.ts +1 -0
- package/src/api/account.ts +9 -3
- package/src/api/authorization.ts +1 -0
- package/src/api/contract.ts +31 -9
- package/src/api/deployment.ts +0 -1
- package/src/api/events.ts +50 -32
- 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 +48 -3
- package/src/contract/base_contract_interaction.ts +28 -15
- package/src/contract/batch_call.ts +20 -15
- package/src/contract/contract_function_interaction.ts +114 -26
- package/src/contract/deploy_method.ts +179 -41
- package/src/contract/get_gas_limits.ts +3 -3
- package/src/contract/interaction_options.ts +141 -23
- package/src/contract/protocol_contracts/auth-registry.ts +553 -0
- package/src/contract/protocol_contracts/contract-class-registry.ts +99 -0
- package/src/contract/protocol_contracts/contract-instance-registry.ts +302 -0
- package/src/contract/protocol_contracts/fee-juice.ts +266 -0
- package/src/contract/protocol_contracts/multi-call-entrypoint.ts +336 -0
- package/src/contract/protocol_contracts/public-checks.ts +320 -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 +8 -7
- package/src/fee/public_fee_payment_method.ts +9 -8
- package/src/fee/sponsored_fee_payment.ts +3 -3
- package/src/scripts/generate_protocol_contract_types.ts +150 -0
- package/src/utils/abi_types.ts +7 -0
- package/src/utils/authwit.ts +34 -24
- package/src/utils/cross_chain.ts +9 -18
- 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 +500 -0
- package/src/wallet/deploy_account_method.ts +74 -13
- package/src/wallet/index.ts +1 -0
- package/src/wallet/wallet.ts +367 -128
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MAX_PROCESSABLE_L2_GAS } from '@aztec/constants';
|
|
2
2
|
import { Gas } from '@aztec/stdlib/gas';
|
|
3
3
|
import type { TxSimulationResult } from '@aztec/stdlib/tx';
|
|
4
4
|
|
|
@@ -23,8 +23,8 @@ export function getGasLimits(
|
|
|
23
23
|
const gasLimits = simulationResult.gasUsed.totalGas.mul(1 + pad);
|
|
24
24
|
const teardownGasLimits = simulationResult.gasUsed.teardownGas.mul(1 + pad);
|
|
25
25
|
|
|
26
|
-
if (gasLimits.l2Gas >
|
|
27
|
-
throw new Error('Transaction consumes more gas than the
|
|
26
|
+
if (gasLimits.l2Gas > MAX_PROCESSABLE_L2_GAS) {
|
|
27
|
+
throw new Error('Transaction consumes more l2 gas than the maximum processable gas');
|
|
28
28
|
}
|
|
29
29
|
return {
|
|
30
30
|
gasLimits,
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
1
2
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
2
3
|
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
3
|
-
import
|
|
4
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
5
|
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
5
|
-
import
|
|
6
|
+
import {
|
|
7
|
+
type Capsule,
|
|
8
|
+
OFFCHAIN_MESSAGE_IDENTIFIER,
|
|
9
|
+
type OffchainEffect,
|
|
10
|
+
type SimulationStats,
|
|
11
|
+
type TxHash,
|
|
12
|
+
type TxReceipt,
|
|
13
|
+
} from '@aztec/stdlib/tx';
|
|
6
14
|
|
|
7
15
|
import type { FeePaymentMethod } from '../fee/fee_payment_method.js';
|
|
8
16
|
import type { ProfileOptions, SendOptions, SimulateOptions } from '../wallet/index.js';
|
|
17
|
+
import type { WaitOpts } from './wait_opts.js';
|
|
9
18
|
|
|
10
19
|
/**
|
|
11
20
|
* Options used to tweak the simulation and add gas estimation capabilities
|
|
@@ -55,13 +64,52 @@ export type RequestInteractionOptions = {
|
|
|
55
64
|
};
|
|
56
65
|
|
|
57
66
|
/**
|
|
58
|
-
*
|
|
67
|
+
* Constant for explicitly not waiting for transaction confirmation.
|
|
68
|
+
* We use this instead of false to avoid confusion with falsy checks.
|
|
69
|
+
*/
|
|
70
|
+
export const NO_WAIT = 'NO_WAIT' as const;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Type for the NO_WAIT constant.
|
|
74
|
+
*/
|
|
75
|
+
export type NoWait = typeof NO_WAIT;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Type for wait options in interactions.
|
|
79
|
+
* - NO_WAIT symbol: Don't wait for confirmation, return TxHash immediately
|
|
80
|
+
* - WaitOpts object: Wait with custom options and return receipt/result
|
|
81
|
+
* - undefined: Wait with default options and return receipt/result
|
|
82
|
+
*/
|
|
83
|
+
export type InteractionWaitOptions = NoWait | WaitOpts | undefined;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Base options for calling a (constrained) function in a contract, without wait parameter.
|
|
59
87
|
*/
|
|
60
|
-
export type
|
|
88
|
+
export type SendInteractionOptionsWithoutWait = RequestInteractionOptions & {
|
|
61
89
|
/** The sender's Aztec address. */
|
|
62
90
|
from: AztecAddress;
|
|
63
91
|
/** The fee options for the transaction. */
|
|
64
92
|
fee?: InteractionFeeOptions;
|
|
93
|
+
/**
|
|
94
|
+
* Additional addresses whose private state and keys should be accessible during execution,
|
|
95
|
+
* beyond the sender's. Required when the transaction needs to access private state or keys
|
|
96
|
+
* belonging to an address other than `from`, e.g. withdrawing from an escrow that holds
|
|
97
|
+
* its own private notes.
|
|
98
|
+
*/
|
|
99
|
+
additionalScopes?: AztecAddress[];
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Represents options for calling a (constrained) function in a contract.
|
|
104
|
+
*/
|
|
105
|
+
export type SendInteractionOptions<W extends InteractionWaitOptions = undefined> = SendInteractionOptionsWithoutWait & {
|
|
106
|
+
/**
|
|
107
|
+
* Whether to wait for the transaction to be mined.
|
|
108
|
+
* - undefined (default): wait with default options and return TxReceipt
|
|
109
|
+
* - WaitOpts object: wait with custom options and return TxReceipt
|
|
110
|
+
* - NO_WAIT: return txHash immediately without waiting
|
|
111
|
+
*/
|
|
112
|
+
wait?: W;
|
|
65
113
|
};
|
|
66
114
|
|
|
67
115
|
/**
|
|
@@ -76,8 +124,8 @@ export type SimulateInteractionOptions = Omit<SendInteractionOptions, 'fee'> & {
|
|
|
76
124
|
skipTxValidation?: boolean;
|
|
77
125
|
/** Whether to ensure the fee payer is not empty and has enough balance to pay for the fee. */
|
|
78
126
|
skipFeeEnforcement?: boolean;
|
|
79
|
-
/** Whether to include metadata such as
|
|
80
|
-
* the simulation result,
|
|
127
|
+
/** Whether to include metadata such as performance statistics (e.g. timing information of the different circuits and oracles) and gas estimation
|
|
128
|
+
* in the simulation result, in addition to the return value and offchain effects */
|
|
81
129
|
includeMetadata?: boolean;
|
|
82
130
|
};
|
|
83
131
|
|
|
@@ -91,30 +139,99 @@ export type ProfileInteractionOptions = SimulateInteractionOptions & {
|
|
|
91
139
|
skipProofGeneration?: boolean;
|
|
92
140
|
};
|
|
93
141
|
|
|
142
|
+
/** A message emitted during execution or proving, to be delivered offchain. */
|
|
143
|
+
export type OffchainMessage = {
|
|
144
|
+
/** The intended recipient of the message. */
|
|
145
|
+
recipient: AztecAddress;
|
|
146
|
+
/** The message payload (typically encrypted). */
|
|
147
|
+
payload: Fr[];
|
|
148
|
+
/** The contract that emitted the message. */
|
|
149
|
+
contractAddress: AztecAddress;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
/** Groups all unproven outputs from private execution that are returned to the client. */
|
|
153
|
+
export type OffchainOutput = {
|
|
154
|
+
/** Raw offchain effects emitted during execution. */
|
|
155
|
+
offchainEffects: OffchainEffect[];
|
|
156
|
+
/** Messages emitted during execution, to be delivered offchain. */
|
|
157
|
+
offchainMessages: OffchainMessage[];
|
|
158
|
+
};
|
|
159
|
+
|
|
94
160
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
161
|
+
* Splits an array of offchain effects into decoded offchain messages and remaining effects.
|
|
162
|
+
* Effects whose data starts with `OFFCHAIN_MESSAGE_IDENTIFIER` are parsed as messages and removed
|
|
163
|
+
* from the effects array.
|
|
164
|
+
*/
|
|
165
|
+
export function extractOffchainOutput(effects: OffchainEffect[]): OffchainOutput {
|
|
166
|
+
const offchainEffects: OffchainEffect[] = [];
|
|
167
|
+
const offchainMessages: OffchainMessage[] = [];
|
|
168
|
+
|
|
169
|
+
for (const effect of effects) {
|
|
170
|
+
if (effect.data.length >= 2 && effect.data[0].equals(OFFCHAIN_MESSAGE_IDENTIFIER)) {
|
|
171
|
+
offchainMessages.push({
|
|
172
|
+
recipient: AztecAddress.fromField(effect.data[1]),
|
|
173
|
+
payload: effect.data.slice(2),
|
|
174
|
+
contractAddress: effect.contractAddress,
|
|
175
|
+
});
|
|
176
|
+
} else {
|
|
177
|
+
offchainEffects.push(effect);
|
|
110
178
|
}
|
|
111
|
-
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return { offchainEffects, offchainMessages };
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Returns an empty `OffchainOutput` (no effects, no messages).
|
|
186
|
+
*/
|
|
187
|
+
export function emptyOffchainOutput(): OffchainOutput {
|
|
188
|
+
return { offchainEffects: [], offchainMessages: [] };
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Represents the result of a simulation.
|
|
193
|
+
* Always includes the return value and offchain output.
|
|
194
|
+
* When `includeMetadata` or `fee.estimateGas` is set, also includes stats and gas estimation.
|
|
195
|
+
*/
|
|
196
|
+
export type SimulationResult = {
|
|
197
|
+
/** Return value of the function */
|
|
198
|
+
result: any;
|
|
199
|
+
/** Additional stats about the simulation. Present when `includeMetadata` is set. */
|
|
200
|
+
stats?: SimulationStats;
|
|
201
|
+
/** Gas estimation results. Present when `includeMetadata` or `fee.estimateGas` is set. */
|
|
202
|
+
estimatedGas?: Pick<GasSettings, 'gasLimits' | 'teardownGasLimits'>;
|
|
203
|
+
} & OffchainOutput;
|
|
204
|
+
|
|
205
|
+
/** Result of sendTx when not waiting for mining. */
|
|
206
|
+
export type TxSendResultImmediate = {
|
|
207
|
+
/** The hash of the sent transaction. */
|
|
208
|
+
txHash: TxHash;
|
|
209
|
+
} & OffchainOutput;
|
|
210
|
+
|
|
211
|
+
/** Result of sendTx when waiting for mining. */
|
|
212
|
+
export type TxSendResultMined<TReturn = TxReceipt> = {
|
|
213
|
+
/** The transaction receipt. */
|
|
214
|
+
receipt: TReturn;
|
|
215
|
+
} & OffchainOutput;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Represents the result type of sending a transaction.
|
|
219
|
+
* If `wait` is NO_WAIT, returns TxSendResultImmediate.
|
|
220
|
+
* Otherwise returns TxSendResultMined.
|
|
221
|
+
*/
|
|
222
|
+
export type SendReturn<T extends InteractionWaitOptions, TReturn = TxReceipt> = T extends NoWait
|
|
223
|
+
? TxSendResultImmediate
|
|
224
|
+
: TxSendResultMined<TReturn>;
|
|
112
225
|
|
|
113
226
|
/**
|
|
114
227
|
* Transforms and cleans up the higher level SendInteractionOptions defined by the interaction into
|
|
115
228
|
* SendOptions, which are the ones that can be serialized and forwarded to the wallet
|
|
229
|
+
* @param options - The send interaction options with optional wait parameter
|
|
230
|
+
* @returns The send options to forward to the wallet
|
|
116
231
|
*/
|
|
117
|
-
export function toSendOptions
|
|
232
|
+
export function toSendOptions<W extends InteractionWaitOptions = undefined>(
|
|
233
|
+
options: SendInteractionOptions<W>,
|
|
234
|
+
): SendOptions<W> {
|
|
118
235
|
return {
|
|
119
236
|
...options,
|
|
120
237
|
fee: {
|
|
@@ -126,6 +243,7 @@ export function toSendOptions(options: SendInteractionOptions): SendOptions {
|
|
|
126
243
|
...options.fee?.gasSettings,
|
|
127
244
|
},
|
|
128
245
|
},
|
|
246
|
+
wait: options.wait, // Pass through wait option
|
|
129
247
|
};
|
|
130
248
|
}
|
|
131
249
|
|