@aztec/wallet-sdk 0.0.1-commit.21ecf947b → 0.0.1-commit.2448fdb

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.
Files changed (57) hide show
  1. package/dest/base-wallet/base_wallet.d.ts +48 -41
  2. package/dest/base-wallet/base_wallet.d.ts.map +1 -1
  3. package/dest/base-wallet/base_wallet.js +159 -82
  4. package/dest/base-wallet/index.d.ts +2 -2
  5. package/dest/base-wallet/index.d.ts.map +1 -1
  6. package/dest/base-wallet/utils.d.ts +5 -3
  7. package/dest/base-wallet/utils.d.ts.map +1 -1
  8. package/dest/base-wallet/utils.js +9 -4
  9. package/dest/crypto.d.ts +39 -1
  10. package/dest/crypto.d.ts.map +1 -1
  11. package/dest/crypto.js +88 -0
  12. package/dest/extension/provider/extension_wallet.d.ts +2 -5
  13. package/dest/extension/provider/extension_wallet.d.ts.map +1 -1
  14. package/dest/extension/provider/index.d.ts +2 -2
  15. package/dest/extension/provider/index.d.ts.map +1 -1
  16. package/dest/iframe/handlers/iframe_connection_handler.d.ts +118 -0
  17. package/dest/iframe/handlers/iframe_connection_handler.d.ts.map +1 -0
  18. package/dest/iframe/handlers/iframe_connection_handler.js +228 -0
  19. package/dest/iframe/handlers/index.d.ts +2 -0
  20. package/dest/iframe/handlers/index.d.ts.map +1 -0
  21. package/dest/iframe/handlers/index.js +1 -0
  22. package/dest/iframe/provider/iframe_discovery.d.ts +25 -0
  23. package/dest/iframe/provider/iframe_discovery.d.ts.map +1 -0
  24. package/dest/iframe/provider/iframe_discovery.js +167 -0
  25. package/dest/iframe/provider/iframe_provider.d.ts +65 -0
  26. package/dest/iframe/provider/iframe_provider.d.ts.map +1 -0
  27. package/dest/iframe/provider/iframe_provider.js +257 -0
  28. package/dest/iframe/provider/iframe_wallet.d.ts +68 -0
  29. package/dest/iframe/provider/iframe_wallet.d.ts.map +1 -0
  30. package/dest/iframe/provider/iframe_wallet.js +200 -0
  31. package/dest/iframe/provider/index.d.ts +4 -0
  32. package/dest/iframe/provider/index.d.ts.map +1 -0
  33. package/dest/iframe/provider/index.js +3 -0
  34. package/dest/manager/types.d.ts +3 -2
  35. package/dest/manager/types.d.ts.map +1 -1
  36. package/dest/manager/wallet_manager.d.ts +1 -1
  37. package/dest/manager/wallet_manager.d.ts.map +1 -1
  38. package/dest/manager/wallet_manager.js +46 -16
  39. package/dest/types.d.ts +14 -2
  40. package/dest/types.d.ts.map +1 -1
  41. package/dest/types.js +4 -0
  42. package/package.json +12 -8
  43. package/src/base-wallet/base_wallet.ts +228 -136
  44. package/src/base-wallet/index.ts +6 -1
  45. package/src/base-wallet/utils.ts +14 -4
  46. package/src/crypto.ts +104 -0
  47. package/src/extension/provider/extension_wallet.ts +1 -6
  48. package/src/extension/provider/index.ts +1 -1
  49. package/src/iframe/handlers/iframe_connection_handler.ts +328 -0
  50. package/src/iframe/handlers/index.ts +7 -0
  51. package/src/iframe/provider/iframe_discovery.ts +185 -0
  52. package/src/iframe/provider/iframe_provider.ts +331 -0
  53. package/src/iframe/provider/iframe_wallet.ts +229 -0
  54. package/src/iframe/provider/index.ts +3 -0
  55. package/src/manager/types.ts +2 -1
  56. package/src/manager/wallet_manager.ts +48 -14
  57. package/src/types.ts +13 -0
@@ -1,21 +1,20 @@
1
- import type { Account } from '@aztec/aztec.js/account';
1
+ import type { Account, NoFrom } from '@aztec/aztec.js/account';
2
2
  import type { CallIntent, IntentInnerHash } from '@aztec/aztec.js/authorization';
3
3
  import { type InteractionWaitOptions, type SendReturn } from '@aztec/aztec.js/contracts';
4
4
  import type { FeePaymentMethod } from '@aztec/aztec.js/fee';
5
- import type { Aliased, AppCapabilities, BatchResults, BatchedMethod, PrivateEvent, PrivateEventFilter, ProfileOptions, SendOptions, SimulateOptions, SimulateUtilityOptions, Wallet, WalletCapabilities } from '@aztec/aztec.js/wallet';
5
+ import { type Aliased, type AppCapabilities, type BatchResults, type BatchedMethod, ContractInitializationStatus, type ExecuteUtilityOptions, type PrivateEvent, type PrivateEventFilter, type ProfileOptions, type SendOptions, type SimulateOptions, TxSimulationResultWithAppOffset, type Wallet, type WalletCapabilities } from '@aztec/aztec.js/wallet';
6
6
  import { AccountFeePaymentMethodOptions } from '@aztec/entrypoints/account';
7
7
  import type { ChainInfo } from '@aztec/entrypoints/interfaces';
8
8
  import { Fr } from '@aztec/foundation/curves/bn254';
9
9
  import type { FieldsOf } from '@aztec/foundation/types';
10
- import type { AccessScopes } from '@aztec/pxe/client/lazy';
11
10
  import type { PXE } from '@aztec/pxe/server';
12
11
  import { type ContractArtifact, type EventMetadataDefinition, type FunctionCall } from '@aztec/stdlib/abi';
13
12
  import type { AuthWitness } from '@aztec/stdlib/auth-witness';
14
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
13
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
15
14
  import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
16
15
  import { GasSettings } from '@aztec/stdlib/gas';
17
16
  import type { AztecNode } from '@aztec/stdlib/interfaces/client';
18
- import { type TxExecutionRequest, type TxProfileResult, TxSimulationResult, type UtilitySimulationResult } from '@aztec/stdlib/tx';
17
+ import { type TxExecutionRequest, type TxProfileResult, type UtilityExecutionResult } from '@aztec/stdlib/tx';
19
18
  import { ExecutionPayload } from '@aztec/stdlib/tx';
20
19
  /**
21
20
  * Options to configure fee payment for a transaction
@@ -27,10 +26,26 @@ export type FeeOptions = {
27
26
  */
28
27
  walletFeePaymentMethod?: FeePaymentMethod;
29
28
  /** Configuration options for the account to properly handle the selected fee payment method */
30
- accountFeePaymentMethodOptions: AccountFeePaymentMethodOptions;
29
+ accountFeePaymentMethodOptions?: AccountFeePaymentMethodOptions;
31
30
  /** The gas settings to use for the transaction */
32
31
  gasSettings: GasSettings;
33
32
  };
33
+ /** Options for `simulateViaEntrypoint`. */
34
+ export type SimulateViaEntrypointOptions = Pick<SimulateOptions, 'from' | 'additionalScopes' | 'skipTxValidation' | 'skipFeeEnforcement'> & {
35
+ /** Fee options for the entrypoint */
36
+ feeOptions: FeeOptions;
37
+ };
38
+ /** Options for `completeFeeOptions`. */
39
+ export type CompleteFeeOptionsConfig = {
40
+ /** The address where the transaction is being sent from. */
41
+ from: AztecAddress | NoFrom;
42
+ /** The address paying for fees (if any fee payment method is embedded in the execution payload). */
43
+ feePayer?: AztecAddress;
44
+ /** User-provided partial gas settings. */
45
+ gasSettings?: Partial<FieldsOf<GasSettings>>;
46
+ /** If true, returns gas settings with high gas limits for estimation. If false, uses fallback limits. */
47
+ forEstimation?: boolean;
48
+ };
34
49
  /**
35
50
  * A base class for Wallet implementations
36
51
  */
@@ -40,8 +55,9 @@ export declare abstract class BaseWallet implements Wallet {
40
55
  protected log: import("@aztec/foundation/log").Logger;
41
56
  protected minFeePadding: number;
42
57
  protected cancellableTransactions: boolean;
58
+ private nodeInfoPromise;
43
59
  protected constructor(pxe: PXE, aztecNode: AztecNode, log?: import("@aztec/foundation/log").Logger);
44
- protected scopesFor(from: AztecAddress): AztecAddress[];
60
+ protected scopesFrom(from: AztecAddress | NoFrom, additionalScopes?: AztecAddress[]): AztecAddress[];
45
61
  protected abstract getAccountFromAddress(address: AztecAddress): Promise<Account>;
46
62
  abstract getAccounts(): Promise<Aliased<AztecAddress>[]>;
47
63
  /**
@@ -53,7 +69,7 @@ export declare abstract class BaseWallet implements Wallet {
53
69
  */
54
70
  getAddressBook(): Promise<Aliased<AztecAddress>[]>;
55
71
  getChainInfo(): Promise<ChainInfo>;
56
- protected createTxExecutionRequestFromPayloadAndFee(executionPayload: ExecutionPayload, from: AztecAddress, feeOptions: FeeOptions): Promise<TxExecutionRequest>;
72
+ protected createTxExecutionRequestFromPayloadAndFee(executionPayload: ExecutionPayload, from: AztecAddress | NoFrom, feeOptions: FeeOptions): Promise<TxExecutionRequest>;
57
73
  createAuthWit(from: AztecAddress, messageHashOrIntent: IntentInnerHash | CallIntent): Promise<AuthWitness>;
58
74
  /**
59
75
  * Request capabilities from the wallet.
@@ -72,42 +88,24 @@ export declare abstract class BaseWallet implements Wallet {
72
88
  batch<const T extends readonly BatchedMethod[]>(methods: T): Promise<BatchResults<T>>;
73
89
  /**
74
90
  * Completes partial user-provided fee options with wallet defaults.
75
- * @param from - The address where the transaction is being sent from
76
- * @param feePayer - The address paying for fees (if any fee payment method is embedded in the execution payload)
77
- * @param gasSettings - User-provided partial gas settings
78
- * @returns - Complete fee options that can be used to create a transaction execution request
79
- */
80
- protected completeFeeOptions(from: AztecAddress, feePayer?: AztecAddress, gasSettings?: Partial<FieldsOf<GasSettings>>): Promise<FeeOptions>;
81
- /**
82
- * Completes partial user-provided fee options with unreasonably high gas limits
83
- * for gas estimation. Uses the same logic as completeFeeOptions but sets high limits
84
- * to avoid running out of gas during estimation.
85
- * @param from - The address where the transaction is being sent from
86
- * @param feePayer - The address paying for fees (if any fee payment method is embedded in the execution payload)
87
- * @param gasSettings - User-provided partial gas settings
91
+ * @param config - Fee completion config.
88
92
  */
89
- protected completeFeeOptionsForEstimation(from: AztecAddress, feePayer?: AztecAddress, gasSettings?: Partial<FieldsOf<GasSettings>>): Promise<{
90
- /**
91
- * A wallet-provided fallback fee payment method that is used only if the transaction that is being constructed
92
- * doesn't already include one
93
- */
94
- walletFeePaymentMethod?: FeePaymentMethod | undefined;
95
- /** Configuration options for the account to properly handle the selected fee payment method */
96
- accountFeePaymentMethodOptions: AccountFeePaymentMethodOptions;
97
- gasSettings: GasSettings;
98
- }>;
93
+ protected completeFeeOptions(config: CompleteFeeOptionsConfig): Promise<FeeOptions>;
99
94
  registerSender(address: AztecAddress, _alias?: string): Promise<AztecAddress>;
100
95
  registerContract(instance: ContractInstanceWithAddress, artifact?: ContractArtifact, secretKey?: Fr): Promise<ContractInstanceWithAddress>;
101
96
  /**
102
97
  * Simulates calls through the standard PXE path (account entrypoint).
103
98
  * @param executionPayload - The execution payload to simulate.
104
- * @param from - The sender address.
105
- * @param feeOptions - Fee options for the transaction.
106
- * @param skipTxValidation - Whether to skip tx validation.
107
- * @param skipFeeEnforcement - Whether to skip fee enforcement.
108
- * @param scopes - The scopes to use for the simulation.
99
+ * @param opts - Simulation options.
109
100
  */
110
- protected simulateViaEntrypoint(executionPayload: ExecutionPayload, from: AztecAddress, feeOptions: FeeOptions, scopes: AccessScopes, skipTxValidation?: boolean, skipFeeEnforcement?: boolean): Promise<TxSimulationResult>;
101
+ protected simulateViaEntrypoint(executionPayload: ExecutionPayload, opts: SimulateViaEntrypointOptions): Promise<TxSimulationResultWithAppOffset>;
102
+ /**
103
+ * Computes the index where the app's calls begin in the flattened array of calls (0 = entrypoint/root, 1..N = fee
104
+ * calls, N+1 = app).
105
+ * @param from - The sender address, or NO_FROM for the default entrypoint.
106
+ * @param feeOptions - Fee options containing the wallet fee payment method.
107
+ */
108
+ protected computeAppCallOffset(from: AztecAddress | NoFrom, feeOptions: FeeOptions): Promise<number>;
111
109
  /**
112
110
  * Simulates a transaction, optimizing leading public static calls by running them directly
113
111
  * on the node while sending the remaining calls through the standard PXE path.
@@ -116,15 +114,24 @@ export declare abstract class BaseWallet implements Wallet {
116
114
  * @param opts - Simulation options (from address, fee settings, etc.).
117
115
  * @returns The merged simulation result.
118
116
  */
119
- simulateTx(executionPayload: ExecutionPayload, opts: SimulateOptions): Promise<TxSimulationResult>;
117
+ simulateTx(executionPayload: ExecutionPayload, opts: SimulateOptions): Promise<TxSimulationResultWithAppOffset>;
120
118
  profileTx(executionPayload: ExecutionPayload, opts: ProfileOptions): Promise<TxProfileResult>;
121
119
  sendTx<W extends InteractionWaitOptions = undefined>(executionPayload: ExecutionPayload, opts: SendOptions<W>): Promise<SendReturn<W>>;
120
+ /**
121
+ * Resolves a contract address to a human-readable name via PXE, if available.
122
+ * @param address - The contract address to resolve.
123
+ */
124
+ protected getContractName(address: AztecAddress): Promise<string | undefined>;
122
125
  protected contextualizeError(err: Error, ...context: string[]): Error;
123
- simulateUtility(call: FunctionCall, opts: SimulateUtilityOptions): Promise<UtilitySimulationResult>;
126
+ executeUtility(call: FunctionCall, opts: ExecuteUtilityOptions): Promise<UtilityExecutionResult>;
124
127
  getPrivateEvents<T>(eventDef: EventMetadataDefinition, eventFilter: PrivateEventFilter): Promise<PrivateEvent<T>[]>;
128
+ /**
129
+ * Returns metadata about a contract, including whether it has been initialized, published, and updated.
130
+ * @param address - The contract address to query.
131
+ */
125
132
  getContractMetadata(address: AztecAddress): Promise<{
126
133
  instance: ContractInstanceWithAddress | undefined;
127
- isContractInitialized: boolean;
134
+ initializationStatus: ContractInitializationStatus;
128
135
  isContractPublished: boolean;
129
136
  isContractUpdated: boolean;
130
137
  updatedContractClassId: Fr | undefined;
@@ -134,4 +141,4 @@ export declare abstract class BaseWallet implements Wallet {
134
141
  isContractClassPubliclyRegistered: boolean;
135
142
  }>;
136
143
  }
137
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZV93YWxsZXQuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9iYXNlLXdhbGxldC9iYXNlX3dhbGxldC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxPQUFPLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUN2RCxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsZUFBZSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFDakYsT0FBTyxFQUFFLEtBQUssc0JBQXNCLEVBQVcsS0FBSyxVQUFVLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUNsRyxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBRTVELE9BQU8sS0FBSyxFQUNWLE9BQU8sRUFDUCxlQUFlLEVBQ2YsWUFBWSxFQUNaLGFBQWEsRUFDYixZQUFZLEVBQ1osa0JBQWtCLEVBQ2xCLGNBQWMsRUFDZCxXQUFXLEVBQ1gsZUFBZSxFQUNmLHNCQUF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;;;;;OAOG;IACG,UAAU,CACd,gBAAgB,EAAE,gBAAgB,EAClC,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,+BAA+B,CAAC,CA8C1C;IAEK,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAYlG;IAEY,MAAM,CAAC,CAAC,SAAS,sBAAsB,GAAG,SAAS,EAC9D,gBAAgB,EAAE,gBAAgB,EAClC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAsCxB;IAED;;;OAGG;IACH,UAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAOlF;IAED,SAAS,CAAC,kBAAkB,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAYpE;IAED,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAE/F;IAEK,gBAAgB,CAAC,CAAC,EACtB,QAAQ,EAAE,uBAAuB,EACjC,WAAW,EAAE,kBAAkB,GAC9B,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAe5B;IAED;;;OAGG;IACG,mBAAmB,CAAC,OAAO,EAAE,YAAY;;;;;;OAiC9C;IAEK,wBAAwB,CAAC,EAAE,EAAE,EAAE;;;OAMpC;CACF"}
@@ -1,14 +1,18 @@
1
- import { NO_WAIT } from '@aztec/aztec.js/contracts';
1
+ import { NO_FROM } from '@aztec/aztec.js/account';
2
+ import { NO_WAIT, extractOffchainOutput } from '@aztec/aztec.js/contracts';
2
3
  import { waitForTx } from '@aztec/aztec.js/node';
3
- import { GAS_ESTIMATION_DA_GAS_LIMIT, GAS_ESTIMATION_L2_GAS_LIMIT, GAS_ESTIMATION_TEARDOWN_DA_GAS_LIMIT, GAS_ESTIMATION_TEARDOWN_L2_GAS_LIMIT } from '@aztec/constants';
4
+ import { ContractInitializationStatus, TxSimulationResultWithAppOffset } from '@aztec/aztec.js/wallet';
4
5
  import { AccountFeePaymentMethodOptions } from '@aztec/entrypoints/account';
6
+ import { DefaultEntrypoint } from '@aztec/entrypoints/default';
5
7
  import { Fr } from '@aztec/foundation/curves/bn254';
6
8
  import { createLogger } from '@aztec/foundation/log';
9
+ import { displayDebugLogs } from '@aztec/pxe/client/lazy';
7
10
  import { decodeFromAbi } from '@aztec/stdlib/abi';
11
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
8
12
  import { computePartialAddress, getContractClassFromArtifact } from '@aztec/stdlib/contract';
9
13
  import { SimulationError } from '@aztec/stdlib/errors';
10
- import { Gas, GasSettings } from '@aztec/stdlib/gas';
11
- import { siloNullifier } from '@aztec/stdlib/hash';
14
+ import { Gas, GasFees, GasSettings } from '@aztec/stdlib/gas';
15
+ import { computeSiloedPrivateInitializationNullifier, computeSiloedPublicInitializationNullifier } from '@aztec/stdlib/hash';
12
16
  import { mergeExecutionPayloads } from '@aztec/stdlib/tx';
13
17
  import { inspect } from 'util';
14
18
  import { buildMergedSimulationResult, extractOptimizablePublicStaticCalls, simulateViaNode } from './utils.js';
@@ -20,6 +24,9 @@ import { buildMergedSimulationResult, extractOptimizablePublicStaticCalls, simul
20
24
  log;
21
25
  minFeePadding;
22
26
  cancellableTransactions;
27
+ // A wallet is instantiated for a particular chain, so chain info never changes during its lifetime.
28
+ // We cache it here because getChainInfo is called frequently (every tx simulation, send, auth wit, etc.).
29
+ nodeInfoPromise;
23
30
  // Protected because we want to force wallets to instantiate their own PXE.
24
31
  constructor(pxe, aztecNode, log = createLogger('wallet-sdk:base_wallet')){
25
32
  this.pxe = pxe;
@@ -28,12 +35,15 @@ import { buildMergedSimulationResult, extractOptimizablePublicStaticCalls, simul
28
35
  this.minFeePadding = 0.5;
29
36
  this.cancellableTransactions = false;
30
37
  }
31
- // When `from` is the zero address (e.g. when deploying a new account contract), we return an
32
- // empty scope list which acts as deny-all: no notes are visible and no keys are accessible.
33
- scopesFor(from) {
34
- return from.isZero() ? [] : [
35
- from
38
+ scopesFrom(from, additionalScopes = []) {
39
+ const allScopes = from === NO_FROM ? additionalScopes : [
40
+ from,
41
+ ...additionalScopes
36
42
  ];
43
+ const scopeSet = new Set(allScopes.map((address)=>address.toString()));
44
+ return [
45
+ ...scopeSet
46
+ ].map(AztecAddress.fromString);
37
47
  }
38
48
  /**
39
49
  * Returns the list of aliased contacts associated with the wallet.
@@ -49,7 +59,10 @@ import { buildMergedSimulationResult, extractOptimizablePublicStaticCalls, simul
49
59
  }));
50
60
  }
51
61
  async getChainInfo() {
52
- const { l1ChainId, rollupVersion } = await this.aztecNode.getNodeInfo();
62
+ if (!this.nodeInfoPromise) {
63
+ this.nodeInfoPromise = this.aztecNode.getNodeInfo();
64
+ }
65
+ const { l1ChainId, rollupVersion } = await this.nodeInfoPromise;
53
66
  return {
54
67
  chainId: new Fr(l1ChainId),
55
68
  version: new Fr(rollupVersion)
@@ -57,18 +70,24 @@ import { buildMergedSimulationResult, extractOptimizablePublicStaticCalls, simul
57
70
  }
58
71
  async createTxExecutionRequestFromPayloadAndFee(executionPayload, from, feeOptions) {
59
72
  const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
60
- const executionOptions = {
61
- txNonce: Fr.random(),
62
- cancellable: this.cancellableTransactions,
63
- feePaymentMethodOptions: feeOptions.accountFeePaymentMethodOptions
64
- };
65
73
  const finalExecutionPayload = feeExecutionPayload ? mergeExecutionPayloads([
66
74
  feeExecutionPayload,
67
75
  executionPayload
68
76
  ]) : executionPayload;
69
- const fromAccount = await this.getAccountFromAddress(from);
70
77
  const chainInfo = await this.getChainInfo();
71
- return fromAccount.createTxExecutionRequest(finalExecutionPayload, feeOptions.gasSettings, chainInfo, executionOptions);
78
+ if (from === NO_FROM) {
79
+ const entrypoint = new DefaultEntrypoint();
80
+ return entrypoint.createTxExecutionRequest(finalExecutionPayload, feeOptions.gasSettings, chainInfo);
81
+ } else {
82
+ const fromAccount = await this.getAccountFromAddress(from);
83
+ const executionOptions = {
84
+ txNonce: Fr.random(),
85
+ cancellable: this.cancellableTransactions,
86
+ // If from is an address, feeOptions include the way the account contract should handle the fee payment
87
+ feePaymentMethodOptions: feeOptions.accountFeePaymentMethodOptions
88
+ };
89
+ return fromAccount.createTxExecutionRequest(finalExecutionPayload, feeOptions.gasSettings, chainInfo, executionOptions);
90
+ }
72
91
  }
73
92
  async createAuthWit(from, messageHashOrIntent) {
74
93
  const account = await this.getAccountFromAddress(from);
@@ -111,26 +130,33 @@ import { buildMergedSimulationResult, extractOptimizablePublicStaticCalls, simul
111
130
  }
112
131
  /**
113
132
  * Completes partial user-provided fee options with wallet defaults.
114
- * @param from - The address where the transaction is being sent from
115
- * @param feePayer - The address paying for fees (if any fee payment method is embedded in the execution payload)
116
- * @param gasSettings - User-provided partial gas settings
117
- * @returns - Complete fee options that can be used to create a transaction execution request
118
- */ async completeFeeOptions(from, feePayer, gasSettings) {
133
+ * @param config - Fee completion config.
134
+ */ async completeFeeOptions(config) {
135
+ const { from, feePayer, gasSettings, forEstimation } = config;
119
136
  const maxFeesPerGas = gasSettings?.maxFeesPerGas ?? (await this.aztecNode.getCurrentMinFees()).mul(1 + this.minFeePadding);
120
137
  let accountFeePaymentMethodOptions;
121
- // The transaction does not include a fee payment method, so we set the flag
122
- // for the account to use its fee juice balance
123
- if (!feePayer) {
124
- accountFeePaymentMethodOptions = AccountFeePaymentMethodOptions.PREEXISTING_FEE_JUICE;
125
- } else {
126
- // The transaction includes fee payment method, so we check if we are the fee payer for it
127
- // (this can only happen if the embedded payment method is FeeJuiceWithClaim)
128
- accountFeePaymentMethodOptions = from.equals(feePayer) ? AccountFeePaymentMethodOptions.FEE_JUICE_WITH_CLAIM : AccountFeePaymentMethodOptions.EXTERNAL;
138
+ // If from is an address, we need to determine the appropriate fee payment method options for the
139
+ // account contract entrypoint to use
140
+ if (from !== NO_FROM) {
141
+ if (!feePayer) {
142
+ // The transaction does not include a fee payment method, so we set the flag
143
+ // for the account to use its fee juice balance
144
+ accountFeePaymentMethodOptions = AccountFeePaymentMethodOptions.PREEXISTING_FEE_JUICE;
145
+ } else {
146
+ // The transaction includes fee payment method, so we check if we are the fee payer for it
147
+ // (this can only happen if the embedded payment method is FeeJuiceWithClaim)
148
+ accountFeePaymentMethodOptions = from.equals(feePayer) ? AccountFeePaymentMethodOptions.FEE_JUICE_WITH_CLAIM : AccountFeePaymentMethodOptions.EXTERNAL;
149
+ }
129
150
  }
130
- const fullGasSettings = GasSettings.default({
131
- ...gasSettings,
132
- maxFeesPerGas
133
- });
151
+ const gasSettingsOverrides = {
152
+ gasLimits: gasSettings?.gasLimits ? Gas.from(gasSettings.gasLimits) : undefined,
153
+ teardownGasLimits: gasSettings?.teardownGasLimits ? Gas.from(gasSettings.teardownGasLimits) : undefined,
154
+ maxFeesPerGas,
155
+ maxPriorityFeesPerGas: gasSettings?.maxPriorityFeesPerGas ?? GasFees.empty()
156
+ };
157
+ // When estimating gas (simulation), use high limits so the simulation doesn't run out of gas.
158
+ // When sending for real, use protocol max limits that the network will actually accept.
159
+ const fullGasSettings = forEstimation ? GasSettings.forEstimation(gasSettingsOverrides) : GasSettings.fallback(gasSettingsOverrides);
134
160
  this.log.debug(`Using L2 gas settings`, fullGasSettings);
135
161
  return {
136
162
  gasSettings: fullGasSettings,
@@ -138,24 +164,6 @@ import { buildMergedSimulationResult, extractOptimizablePublicStaticCalls, simul
138
164
  accountFeePaymentMethodOptions
139
165
  };
140
166
  }
141
- /**
142
- * Completes partial user-provided fee options with unreasonably high gas limits
143
- * for gas estimation. Uses the same logic as completeFeeOptions but sets high limits
144
- * to avoid running out of gas during estimation.
145
- * @param from - The address where the transaction is being sent from
146
- * @param feePayer - The address paying for fees (if any fee payment method is embedded in the execution payload)
147
- * @param gasSettings - User-provided partial gas settings
148
- */ async completeFeeOptionsForEstimation(from, feePayer, gasSettings) {
149
- const defaultFeeOptions = await this.completeFeeOptions(from, feePayer, gasSettings);
150
- const { gasSettings: { maxFeesPerGas, maxPriorityFeesPerGas } } = defaultFeeOptions;
151
- // Use unrealistically high gas limits for estimation to avoid running out of gas.
152
- // They will be tuned down after the simulation.
153
- const gasSettingsForEstimation = new GasSettings(new Gas(GAS_ESTIMATION_DA_GAS_LIMIT, GAS_ESTIMATION_L2_GAS_LIMIT), new Gas(GAS_ESTIMATION_TEARDOWN_DA_GAS_LIMIT, GAS_ESTIMATION_TEARDOWN_L2_GAS_LIMIT), maxFeesPerGas, maxPriorityFeesPerGas);
154
- return {
155
- ...defaultFeeOptions,
156
- gasSettings: gasSettingsForEstimation
157
- };
158
- }
159
167
  registerSender(address, _alias = '') {
160
168
  return this.pxe.registerSender(address);
161
169
  }
@@ -194,19 +202,29 @@ import { buildMergedSimulationResult, extractOptimizablePublicStaticCalls, simul
194
202
  /**
195
203
  * Simulates calls through the standard PXE path (account entrypoint).
196
204
  * @param executionPayload - The execution payload to simulate.
197
- * @param from - The sender address.
198
- * @param feeOptions - Fee options for the transaction.
199
- * @param skipTxValidation - Whether to skip tx validation.
200
- * @param skipFeeEnforcement - Whether to skip fee enforcement.
201
- * @param scopes - The scopes to use for the simulation.
202
- */ async simulateViaEntrypoint(executionPayload, from, feeOptions, scopes, skipTxValidation, skipFeeEnforcement) {
203
- const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(executionPayload, from, feeOptions);
204
- return this.pxe.simulateTx(txRequest, {
205
+ * @param opts - Simulation options.
206
+ */ async simulateViaEntrypoint(executionPayload, opts) {
207
+ const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(executionPayload, opts.from, opts.feeOptions);
208
+ const result = await this.pxe.simulateTx(txRequest, {
205
209
  simulatePublic: true,
206
- skipTxValidation,
207
- skipFeeEnforcement,
208
- scopes
210
+ skipTxValidation: opts.skipTxValidation,
211
+ skipFeeEnforcement: opts.skipFeeEnforcement,
212
+ scopes: this.scopesFrom(opts.from, opts.additionalScopes)
209
213
  });
214
+ const appCallOffset = await this.computeAppCallOffset(opts.from, opts.feeOptions);
215
+ return TxSimulationResultWithAppOffset.fromResultAndOffset(result, appCallOffset);
216
+ }
217
+ /**
218
+ * Computes the index where the app's calls begin in the flattened array of calls (0 = entrypoint/root, 1..N = fee
219
+ * calls, N+1 = app).
220
+ * @param from - The sender address, or NO_FROM for the default entrypoint.
221
+ * @param feeOptions - Fee options containing the wallet fee payment method.
222
+ */ async computeAppCallOffset(from, feeOptions) {
223
+ if (from === NO_FROM) {
224
+ return 0;
225
+ }
226
+ const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
227
+ return (feeExecutionPayload?.calls.length ?? 0) + 1; // +1 for entrypoint
210
228
  }
211
229
  /**
212
230
  * Simulates a transaction, optimizing leading public static calls by running them directly
@@ -216,7 +234,12 @@ import { buildMergedSimulationResult, extractOptimizablePublicStaticCalls, simul
216
234
  * @param opts - Simulation options (from address, fee settings, etc.).
217
235
  * @returns The merged simulation result.
218
236
  */ async simulateTx(executionPayload, opts) {
219
- const feeOptions = opts.fee?.estimateGas ? await this.completeFeeOptionsForEstimation(opts.from, executionPayload.feePayer, opts.fee?.gasSettings) : await this.completeFeeOptions(opts.from, executionPayload.feePayer, opts.fee?.gasSettings);
237
+ const feeOptions = await this.completeFeeOptions({
238
+ from: opts.from,
239
+ feePayer: executionPayload.feePayer,
240
+ gasSettings: opts.fee?.gasSettings,
241
+ forEstimation: true
242
+ });
220
243
  const { optimizableCalls, remainingCalls } = extractOptimizablePublicStaticCalls(executionPayload);
221
244
  const remainingPayload = {
222
245
  ...executionPayload,
@@ -231,25 +254,41 @@ import { buildMergedSimulationResult, extractOptimizablePublicStaticCalls, simul
231
254
  } catch {
232
255
  blockHeader = await this.aztecNode.getBlockHeader();
233
256
  }
257
+ const simulationOrigin = opts.from === NO_FROM ? AztecAddress.ZERO : opts.from;
234
258
  const [optimizedResults, normalResult] = await Promise.all([
235
- optimizableCalls.length > 0 ? simulateViaNode(this.aztecNode, optimizableCalls, opts.from, chainInfo, feeOptions.gasSettings, blockHeader, opts.skipFeeEnforcement ?? true) : Promise.resolve([]),
236
- remainingCalls.length > 0 ? this.simulateViaEntrypoint(remainingPayload, opts.from, feeOptions, this.scopesFor(opts.from), opts.skipTxValidation, opts.skipFeeEnforcement ?? true) : Promise.resolve(null)
259
+ optimizableCalls.length > 0 ? simulateViaNode(this.aztecNode, optimizableCalls, simulationOrigin, chainInfo, feeOptions.gasSettings, blockHeader, opts.skipFeeEnforcement ?? true, this.getContractName.bind(this)) : Promise.resolve([]),
260
+ remainingCalls.length > 0 ? this.simulateViaEntrypoint(remainingPayload, {
261
+ from: opts.from,
262
+ feeOptions,
263
+ additionalScopes: opts.additionalScopes,
264
+ skipTxValidation: opts.skipTxValidation,
265
+ skipFeeEnforcement: opts.skipFeeEnforcement ?? true
266
+ }) : Promise.resolve(null)
237
267
  ]);
238
268
  return buildMergedSimulationResult(optimizedResults, normalResult);
239
269
  }
240
270
  async profileTx(executionPayload, opts) {
241
- const feeOptions = await this.completeFeeOptions(opts.from, executionPayload.feePayer, opts.fee?.gasSettings);
271
+ const feeOptions = await this.completeFeeOptions({
272
+ from: opts.from,
273
+ feePayer: executionPayload.feePayer,
274
+ gasSettings: opts.fee?.gasSettings
275
+ });
242
276
  const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(executionPayload, opts.from, feeOptions);
243
277
  return this.pxe.profileTx(txRequest, {
244
278
  profileMode: opts.profileMode,
245
279
  skipProofGeneration: opts.skipProofGeneration ?? true,
246
- scopes: this.scopesFor(opts.from)
280
+ scopes: this.scopesFrom(opts.from, opts.additionalScopes)
247
281
  });
248
282
  }
249
283
  async sendTx(executionPayload, opts) {
250
- const feeOptions = await this.completeFeeOptions(opts.from, executionPayload.feePayer, opts.fee?.gasSettings);
284
+ const feeOptions = await this.completeFeeOptions({
285
+ from: opts.from,
286
+ feePayer: executionPayload.feePayer,
287
+ gasSettings: opts.fee?.gasSettings
288
+ });
251
289
  const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(executionPayload, opts.from, feeOptions);
252
- const provenTx = await this.pxe.proveTx(txRequest, this.scopesFor(opts.from));
290
+ const provenTx = await this.pxe.proveTx(txRequest, this.scopesFrom(opts.from, opts.additionalScopes));
291
+ const offchainOutput = extractOffchainOutput(provenTx.getOffchainEffects(), provenTx.publicInputs.constants.anchorBlockHeader.globalVariables.timestamp);
253
292
  const tx = await provenTx.toTx();
254
293
  const txHash = tx.getTxHash();
255
294
  if (await this.aztecNode.getTxEffect(txHash)) {
@@ -262,11 +301,33 @@ import { buildMergedSimulationResult, extractOptimizablePublicStaticCalls, simul
262
301
  this.log.info(`Sent transaction ${txHash}`);
263
302
  // If wait is NO_WAIT, return txHash immediately
264
303
  if (opts.wait === NO_WAIT) {
265
- return txHash;
304
+ return {
305
+ txHash,
306
+ ...offchainOutput
307
+ };
266
308
  }
267
309
  // Otherwise, wait for the full receipt (default behavior on wait: undefined)
268
310
  const waitOpts = typeof opts.wait === 'object' ? opts.wait : undefined;
269
- return await waitForTx(this.aztecNode, txHash, waitOpts);
311
+ const receipt = await waitForTx(this.aztecNode, txHash, waitOpts);
312
+ // Display debug logs from public execution if present (served in test mode only)
313
+ if (receipt.debugLogs?.length) {
314
+ await displayDebugLogs(receipt.debugLogs, this.getContractName.bind(this));
315
+ }
316
+ return {
317
+ receipt,
318
+ ...offchainOutput
319
+ };
320
+ }
321
+ /**
322
+ * Resolves a contract address to a human-readable name via PXE, if available.
323
+ * @param address - The contract address to resolve.
324
+ */ async getContractName(address) {
325
+ const instance = await this.pxe.getContractInstance(address);
326
+ if (!instance) {
327
+ return undefined;
328
+ }
329
+ const artifact = await this.pxe.getContractArtifact(instance.currentContractClassId);
330
+ return artifact?.name;
270
331
  }
271
332
  contextualizeError(err, ...context) {
272
333
  let contextStr = '';
@@ -281,12 +342,10 @@ import { buildMergedSimulationResult, extractOptimizablePublicStaticCalls, simul
281
342
  }
282
343
  return err;
283
344
  }
284
- simulateUtility(call, opts) {
285
- return this.pxe.simulateUtility(call, {
345
+ executeUtility(call, opts) {
346
+ return this.pxe.executeUtility(call, {
286
347
  authwits: opts.authWitnesses,
287
- scopes: [
288
- opts.scope
289
- ]
348
+ scopes: opts.scopes
290
349
  });
291
350
  }
292
351
  async getPrivateEvents(eventDef, eventFilter) {
@@ -305,15 +364,33 @@ import { buildMergedSimulationResult, extractOptimizablePublicStaticCalls, simul
305
364
  });
306
365
  return decodedEvents;
307
366
  }
308
- async getContractMetadata(address) {
367
+ /**
368
+ * Returns metadata about a contract, including whether it has been initialized, published, and updated.
369
+ * @param address - The contract address to query.
370
+ */ async getContractMetadata(address) {
309
371
  const instance = await this.pxe.getContractInstance(address);
310
- const initNullifier = await siloNullifier(address, address.toField());
311
- const publiclyRegisteredContract = await this.aztecNode.getContract(address);
312
- const initNullifierMembershipWitness = await this.aztecNode.getNullifierMembershipWitness('latest', initNullifier);
372
+ const publiclyRegisteredContractPromise = this.aztecNode.getContract(address);
373
+ let initializationStatus;
374
+ if (instance) {
375
+ // We have the instance, so we can compute the private initialization nullifier (which includes init_hash and is
376
+ // emitted by both private and public initializers) and get a definitive INITIALIZED/UNINITIALIZED answer.
377
+ const initNullifier = await computeSiloedPrivateInitializationNullifier(address, instance.initializationHash);
378
+ const witness = await this.aztecNode.getNullifierMembershipWitness('latest', initNullifier);
379
+ initializationStatus = witness ? ContractInitializationStatus.INITIALIZED : ContractInitializationStatus.UNINITIALIZED;
380
+ } else {
381
+ // Without the instance we lack the init_hash needed for the private nullifier. We fall back to checking the
382
+ // public initialization nullifier (computed from address alone). Not all contracts emit it (only those with
383
+ // public functions that require initialization checks), so its absence doesn't mean the contract is
384
+ // uninitialized.
385
+ const publicNullifier = await computeSiloedPublicInitializationNullifier(address);
386
+ const witness = await this.aztecNode.getNullifierMembershipWitness('latest', publicNullifier);
387
+ initializationStatus = witness ? ContractInitializationStatus.INITIALIZED : ContractInitializationStatus.UNKNOWN;
388
+ }
389
+ const publiclyRegisteredContract = await publiclyRegisteredContractPromise;
313
390
  const isContractUpdated = publiclyRegisteredContract && !publiclyRegisteredContract.currentContractClassId.equals(publiclyRegisteredContract.originalContractClassId);
314
391
  return {
315
392
  instance: instance ?? undefined,
316
- isContractInitialized: !!initNullifierMembershipWitness,
393
+ initializationStatus,
317
394
  isContractPublished: !!publiclyRegisteredContract,
318
395
  isContractUpdated: !!isContractUpdated,
319
396
  updatedContractClassId: isContractUpdated ? publiclyRegisteredContract.currentContractClassId : undefined
@@ -1,3 +1,3 @@
1
- export { BaseWallet, type FeeOptions } from './base_wallet.js';
1
+ export { BaseWallet, type CompleteFeeOptionsConfig, type FeeOptions, type SimulateViaEntrypointOptions, } from './base_wallet.js';
2
2
  export { simulateViaNode, buildMergedSimulationResult, extractOptimizablePublicStaticCalls } from './utils.js';
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9iYXNlLXdhbGxldC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLEtBQUssVUFBVSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDL0QsT0FBTyxFQUFFLGVBQWUsRUFBRSwyQkFBMkIsRUFBRSxtQ0FBbUMsRUFBRSxNQUFNLFlBQVksQ0FBQyJ9
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9iYXNlLXdhbGxldC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsVUFBVSxFQUNWLEtBQUssd0JBQXdCLEVBQzdCLEtBQUssVUFBVSxFQUNmLEtBQUssNEJBQTRCLEdBQ2xDLE1BQU0sa0JBQWtCLENBQUM7QUFDMUIsT0FBTyxFQUFFLGVBQWUsRUFBRSwyQkFBMkIsRUFBRSxtQ0FBbUMsRUFBRSxNQUFNLFlBQVksQ0FBQyJ9
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/base-wallet/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,2BAA2B,EAAE,mCAAmC,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/base-wallet/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,wBAAwB,EAC7B,KAAK,UAAU,EACf,KAAK,4BAA4B,GAClC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,2BAA2B,EAAE,mCAAmC,EAAE,MAAM,YAAY,CAAC"}
@@ -1,5 +1,7 @@
1
1
  import type { AztecNode } from '@aztec/aztec.js/node';
2
+ import { TxSimulationResultWithAppOffset } from '@aztec/aztec.js/wallet';
2
3
  import type { ChainInfo } from '@aztec/entrypoints/interfaces';
4
+ import type { ContractNameResolver } from '@aztec/pxe/client/lazy';
3
5
  import { type FunctionCall } from '@aztec/stdlib/abi';
4
6
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
7
  import type { GasSettings } from '@aztec/stdlib/gas';
@@ -33,7 +35,7 @@ export declare function extractOptimizablePublicStaticCalls(payload: ExecutionPa
33
35
  * @param skipFeeEnforcement - Whether to skip fee enforcement during simulation.
34
36
  * @returns Array of TxSimulationResult, one per batch.
35
37
  */
36
- export declare function simulateViaNode(node: AztecNode, publicStaticCalls: FunctionCall[], from: AztecAddress, chainInfo: ChainInfo, gasSettings: GasSettings, blockHeader: BlockHeader, skipFeeEnforcement?: boolean): Promise<TxSimulationResult[]>;
38
+ export declare function simulateViaNode(node: AztecNode, publicStaticCalls: FunctionCall[], from: AztecAddress, chainInfo: ChainInfo, gasSettings: GasSettings, blockHeader: BlockHeader, skipFeeEnforcement: boolean | undefined, getContractName: ContractNameResolver): Promise<TxSimulationResult[]>;
37
39
  /**
38
40
  * Merges simulation results from the optimized (public static) and normal paths.
39
41
  * Since optimized calls are always a leading prefix, return values are simply
@@ -44,5 +46,5 @@ export declare function simulateViaNode(node: AztecNode, publicStaticCalls: Func
44
46
  * @param normalResult - Result from normal simulation (null if all calls were optimized).
45
47
  * @returns A single TxSimulationResult with return values in original call order.
46
48
  */
47
- export declare function buildMergedSimulationResult(optimizedResults: TxSimulationResult[], normalResult: TxSimulationResult | null): TxSimulationResult;
48
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9iYXNlLXdhbGxldC91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUV0RCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUsvRCxPQUFPLEVBQUUsS0FBSyxZQUFZLEVBQW9CLE1BQU0sbUJBQW1CLENBQUM7QUFDeEUsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDaEUsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFRckQsT0FBTyxFQUNMLEtBQUssV0FBVyxFQUNoQixLQUFLLGdCQUFnQixFQU9yQixrQkFBa0IsRUFDbkIsTUFBTSxrQkFBa0IsQ0FBQztBQUUxQjs7Ozs7Ozs7O0dBU0c7QUFDSCx3QkFBZ0IsbUNBQW1DLENBQUMsT0FBTyxFQUFFLGdCQUFnQixHQUFHO0lBQzlFLHVFQUF1RTtJQUN2RSxnQkFBZ0IsRUFBRSxZQUFZLEVBQUUsQ0FBQztJQUNqQywyQkFBMkI7SUFDM0IsY0FBYyxFQUFFLFlBQVksRUFBRSxDQUFDO0NBQ2hDLENBT0E7QUFtR0Q7Ozs7Ozs7Ozs7OztHQVlHO0FBQ0gsd0JBQXNCLGVBQWUsQ0FDbkMsSUFBSSxFQUFFLFNBQVMsRUFDZixpQkFBaUIsRUFBRSxZQUFZLEVBQUUsRUFDakMsSUFBSSxFQUFFLFlBQVksRUFDbEIsU0FBUyxFQUFFLFNBQVMsRUFDcEIsV0FBVyxFQUFFLFdBQVcsRUFDeEIsV0FBVyxFQUFFLFdBQVcsRUFDeEIsa0JBQWtCLEdBQUUsT0FBYyxHQUNqQyxPQUFPLENBQUMsa0JBQWtCLEVBQUUsQ0FBQyxDQXVCL0I7QUFFRDs7Ozs7Ozs7O0dBU0c7QUFDSCx3QkFBZ0IsMkJBQTJCLENBQ3pDLGdCQUFnQixFQUFFLGtCQUFrQixFQUFFLEVBQ3RDLFlBQVksRUFBRSxrQkFBa0IsR0FBRyxJQUFJLEdBQ3RDLGtCQUFrQixDQW9CcEIifQ==
49
+ export declare function buildMergedSimulationResult(optimizedResults: TxSimulationResult[], normalResult: TxSimulationResultWithAppOffset | null): TxSimulationResultWithAppOffset;
50
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9iYXNlLXdhbGxldC91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUN0RCxPQUFPLEVBQUUsK0JBQStCLEVBQUUsT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