@aztec-labs/wallets 6.0.0-nightly.20260829

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 (41) hide show
  1. package/dest/embedded/account-contract-providers/bundle.d.ts +19 -0
  2. package/dest/embedded/account-contract-providers/bundle.d.ts.map +1 -0
  3. package/dest/embedded/account-contract-providers/bundle.js +29 -0
  4. package/dest/embedded/account-contract-providers/lazy.d.ts +19 -0
  5. package/dest/embedded/account-contract-providers/lazy.d.ts.map +1 -0
  6. package/dest/embedded/account-contract-providers/lazy.js +39 -0
  7. package/dest/embedded/account-contract-providers/types.d.ts +20 -0
  8. package/dest/embedded/account-contract-providers/types.d.ts.map +1 -0
  9. package/dest/embedded/account-contract-providers/types.js +6 -0
  10. package/dest/embedded/embedded_wallet.d.ts +103 -0
  11. package/dest/embedded/embedded_wallet.d.ts.map +1 -0
  12. package/dest/embedded/embedded_wallet.js +359 -0
  13. package/dest/embedded/entrypoints/browser.d.ts +14 -0
  14. package/dest/embedded/entrypoints/browser.d.ts.map +1 -0
  15. package/dest/embedded/entrypoints/browser.js +72 -0
  16. package/dest/embedded/entrypoints/node.d.ts +14 -0
  17. package/dest/embedded/entrypoints/node.d.ts.map +1 -0
  18. package/dest/embedded/entrypoints/node.js +75 -0
  19. package/dest/embedded/entrypoints/resolve_aztec_node.d.ts +4 -0
  20. package/dest/embedded/entrypoints/resolve_aztec_node.d.ts.map +1 -0
  21. package/dest/embedded/entrypoints/resolve_aztec_node.js +4 -0
  22. package/dest/embedded/store_encryption.d.ts +74 -0
  23. package/dest/embedded/store_encryption.d.ts.map +1 -0
  24. package/dest/embedded/store_encryption.js +93 -0
  25. package/dest/embedded/wallet_db.d.ts +41 -0
  26. package/dest/embedded/wallet_db.d.ts.map +1 -0
  27. package/dest/embedded/wallet_db.js +133 -0
  28. package/dest/testing.d.ts +16 -0
  29. package/dest/testing.d.ts.map +1 -0
  30. package/dest/testing.js +18 -0
  31. package/package.json +102 -0
  32. package/src/embedded/account-contract-providers/bundle.ts +43 -0
  33. package/src/embedded/account-contract-providers/lazy.ts +53 -0
  34. package/src/embedded/account-contract-providers/types.ts +21 -0
  35. package/src/embedded/embedded_wallet.ts +481 -0
  36. package/src/embedded/entrypoints/browser.ts +93 -0
  37. package/src/embedded/entrypoints/node.ts +100 -0
  38. package/src/embedded/entrypoints/resolve_aztec_node.ts +10 -0
  39. package/src/embedded/store_encryption.ts +146 -0
  40. package/src/embedded/wallet_db.ts +150 -0
  41. package/src/testing.ts +37 -0
@@ -0,0 +1,19 @@
1
+ import type { Account, AccountContract } from '@aztec-labs/aztec.js/account';
2
+ import type { Fq } from '@aztec-labs/foundation/curves/bn254';
3
+ import type { ContractArtifact } from '@aztec-labs/stdlib/abi';
4
+ import type { CompleteAddress } from '@aztec-labs/stdlib/contract';
5
+ import type { AccountType } from '../wallet_db.js';
6
+ import type { AccountContractsProvider } from './types.js';
7
+ /**
8
+ * Loads account contract artifacts eagerly via static imports.
9
+ * Designed for Node.js environments where all artifacts are available at startup.
10
+ */
11
+ export declare class BundleAccountContractsProvider implements AccountContractsProvider {
12
+ getSchnorrAccountContract(signingKey: Fq): Promise<AccountContract>;
13
+ getSchnorrInitializerlessAccountContract(signingKey: Fq): Promise<AccountContract>;
14
+ getEcdsaRAccountContract(signingKey: Buffer): Promise<AccountContract>;
15
+ getEcdsaKAccountContract(signingKey: Buffer): Promise<AccountContract>;
16
+ getStubAccountContractArtifact(type: AccountType): Promise<ContractArtifact>;
17
+ createStubAccount(address: CompleteAddress, type: AccountType): Promise<Account>;
18
+ }
19
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVuZGxlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvZW1iZWRkZWQvYWNjb3VudC1jb250cmFjdC1wcm92aWRlcnMvYnVuZGxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3Mi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3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../../src/embedded/account-contract-providers/bundle.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE3D;;;GAGG;AACH,qBAAa,8BAA+B,YAAW,wBAAwB;IAC7E,yBAAyB,CAAC,UAAU,EAAE,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CAElE;IAED,wCAAwC,CAAC,UAAU,EAAE,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CAEjF;IAED,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAErE;IAED,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAErE;IAED,8BAA8B,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAG3E;IAED,iBAAiB,CAAC,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAG/E;CACF"}
@@ -0,0 +1,29 @@
1
+ import { EcdsaKAccountContract, EcdsaRAccountContract } from '@aztec-labs/accounts/ecdsa';
2
+ import { StubEcdsaAccountContractArtifact, createStubEcdsaAccount } from '@aztec-labs/accounts/ecdsa/stub';
3
+ import { SchnorrAccountContract, SchnorrInitializerlessAccountContract } from '@aztec-labs/accounts/schnorr';
4
+ import { StubSchnorrAccountContractArtifact, createStubSchnorrAccount } from '@aztec-labs/accounts/schnorr/stub';
5
+ /**
6
+ * Loads account contract artifacts eagerly via static imports.
7
+ * Designed for Node.js environments where all artifacts are available at startup.
8
+ */ export class BundleAccountContractsProvider {
9
+ getSchnorrAccountContract(signingKey) {
10
+ return Promise.resolve(new SchnorrAccountContract(signingKey));
11
+ }
12
+ getSchnorrInitializerlessAccountContract(signingKey) {
13
+ return Promise.resolve(new SchnorrInitializerlessAccountContract(signingKey));
14
+ }
15
+ getEcdsaRAccountContract(signingKey) {
16
+ return Promise.resolve(new EcdsaRAccountContract(signingKey));
17
+ }
18
+ getEcdsaKAccountContract(signingKey) {
19
+ return Promise.resolve(new EcdsaKAccountContract(signingKey));
20
+ }
21
+ getStubAccountContractArtifact(type) {
22
+ const isSchnorr = type === 'schnorr' || type === 'schnorr_initializerless';
23
+ return Promise.resolve(isSchnorr ? StubSchnorrAccountContractArtifact : StubEcdsaAccountContractArtifact);
24
+ }
25
+ createStubAccount(address, type) {
26
+ const isSchnorr = type === 'schnorr' || type === 'schnorr_initializerless';
27
+ return Promise.resolve(isSchnorr ? createStubSchnorrAccount(address) : createStubEcdsaAccount(address));
28
+ }
29
+ }
@@ -0,0 +1,19 @@
1
+ import type { Account, AccountContract } from '@aztec-labs/aztec.js/account';
2
+ import type { Fq } from '@aztec-labs/foundation/curves/bn254';
3
+ import type { ContractArtifact } from '@aztec-labs/stdlib/abi';
4
+ import type { CompleteAddress } from '@aztec-labs/stdlib/contract';
5
+ import type { AccountType } from '../wallet_db.js';
6
+ import type { AccountContractsProvider } from './types.js';
7
+ /**
8
+ * Loads account contract artifacts lazily via dynamic imports.
9
+ * Designed for browser environments where code splitting reduces initial bundle size.
10
+ */
11
+ export declare class LazyAccountContractsProvider implements AccountContractsProvider {
12
+ getSchnorrAccountContract(signingKey: Fq): Promise<AccountContract>;
13
+ getSchnorrInitializerlessAccountContract(signingKey: Fq): Promise<AccountContract>;
14
+ getEcdsaRAccountContract(signingKey: Buffer): Promise<AccountContract>;
15
+ getEcdsaKAccountContract(signingKey: Buffer): Promise<AccountContract>;
16
+ getStubAccountContractArtifact(type: AccountType): Promise<ContractArtifact>;
17
+ createStubAccount(address: CompleteAddress, type: AccountType): Promise<Account>;
18
+ }
19
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2VtYmVkZGVkL2FjY291bnQtY29udHJhY3QtcHJvdmlkZXJzL2xhenkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLDhCQUE4QixDQUFDO0FBQzdFLE9BQU8sS0FBSyxFQUFFLEVBQUUsRUFBRSxNQUFNLHFDQUFxQyxDQUFDO0FBQzlELE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDL0QsT0FBTyxLQUFLLEVBQUUsZUFBZSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFFbkUsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDbkQsT0FBTyxLQUFLLEVBQUUsd0JBQXdCLEVBQUUsTUFBTSxZQUFZLENBQUM7QUFFM0Q7OztHQUdHO0FBQ0gscUJBQWEsNEJBQTZCLFlBQVcsd0JBQXdCO0lBQ3JFLHlCQUF5QixDQUFDLFVBQVUsRUFBRSxFQUFFLEdBQUcsT0FBTyxDQUFDLGVBQWUsQ0FBQyxDQUd4RTtJQUVLLHdDQUF3QyxDQUFDLFVBQVUsRUFBRSxFQUFFLEdBQUcsT0FBTyxDQUFDLGVBQWUsQ0FBQyxDQUd2RjtJQUVLLHdCQUF3QixDQUFDLFVBQVUsRUFBRSxNQUFNLEdBQUcsT0FBTyxDQUFDLGVBQWUsQ0FBQyxDQUczRTtJQUVLLHdCQU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AiB,CAAC,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAQrF;CACF"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Loads account contract artifacts lazily via dynamic imports.
3
+ * Designed for browser environments where code splitting reduces initial bundle size.
4
+ */ export class LazyAccountContractsProvider {
5
+ async getSchnorrAccountContract(signingKey) {
6
+ const { SchnorrAccountContract } = await import('@aztec-labs/accounts/schnorr/lazy');
7
+ return new SchnorrAccountContract(signingKey);
8
+ }
9
+ async getSchnorrInitializerlessAccountContract(signingKey) {
10
+ const { SchnorrInitializerlessAccountContract } = await import('@aztec-labs/accounts/schnorr/lazy');
11
+ return new SchnorrInitializerlessAccountContract(signingKey);
12
+ }
13
+ async getEcdsaRAccountContract(signingKey) {
14
+ const { EcdsaRAccountContract } = await import('@aztec-labs/accounts/ecdsa/lazy');
15
+ return new EcdsaRAccountContract(signingKey);
16
+ }
17
+ async getEcdsaKAccountContract(signingKey) {
18
+ const { EcdsaKAccountContract } = await import('@aztec-labs/accounts/ecdsa/lazy');
19
+ return new EcdsaKAccountContract(signingKey);
20
+ }
21
+ async getStubAccountContractArtifact(type) {
22
+ if (type === 'schnorr' || type === 'schnorr_initializerless') {
23
+ const { getStubSchnorrAccountContractArtifact } = await import('@aztec-labs/accounts/schnorr/stub/lazy');
24
+ return getStubSchnorrAccountContractArtifact();
25
+ } else {
26
+ const { getStubEcdsaAccountContractArtifact } = await import('@aztec-labs/accounts/ecdsa/stub/lazy');
27
+ return getStubEcdsaAccountContractArtifact();
28
+ }
29
+ }
30
+ async createStubAccount(address, type) {
31
+ if (type === 'schnorr' || type === 'schnorr_initializerless') {
32
+ const { createStubSchnorrAccount } = await import('@aztec-labs/accounts/schnorr/stub/lazy');
33
+ return createStubSchnorrAccount(address);
34
+ } else {
35
+ const { createStubEcdsaAccount } = await import('@aztec-labs/accounts/ecdsa/stub/lazy');
36
+ return createStubEcdsaAccount(address);
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,20 @@
1
+ import type { Account, AccountContract } from '@aztec-labs/aztec.js/account';
2
+ import type { Fq } from '@aztec-labs/foundation/curves/bn254';
3
+ import type { ContractArtifact } from '@aztec-labs/stdlib/abi';
4
+ import type { CompleteAddress } from '@aztec-labs/stdlib/contract';
5
+ import type { AccountType } from '../wallet_db.js';
6
+ /**
7
+ * Provides account contract implementations and stub accounts for the EmbeddedWallet.
8
+ * Two implementations exist:
9
+ * - LazyAccountContractsProvider: uses dynamic imports for browser environments
10
+ * - EagerAccountContractsProvider: uses static imports for Node.js environments
11
+ */
12
+ export interface AccountContractsProvider {
13
+ getSchnorrAccountContract(signingKey: Fq): Promise<AccountContract>;
14
+ getSchnorrInitializerlessAccountContract(signingKey: Fq): Promise<AccountContract>;
15
+ getEcdsaRAccountContract(signingKey: Buffer): Promise<AccountContract>;
16
+ getEcdsaKAccountContract(signingKey: Buffer): Promise<AccountContract>;
17
+ getStubAccountContractArtifact(type: AccountType): Promise<ContractArtifact>;
18
+ createStubAccount(address: CompleteAddress, type: AccountType): Promise<Account>;
19
+ }
20
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9lbWJlZGRlZC9hY2NvdW50LWNvbnRyYWN0LXByb3ZpZGVycy90eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sOEJBQThCLENBQUM7QUFDN0UsT0FBTyxLQUFLLEVBQUUsRUFBRSxFQUFFLE1BQU0scUNBQXFDLENBQUM7QUFDOUQsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUMvRCxPQUFPLEtBQUssRUFBRSxlQUFlLEVBQUUsTUFBTS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wB;IACvC,yBAAyB,CAAC,UAAU,EAAE,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACpE,wCAAwC,CAAC,UAAU,EAAE,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACnF,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACvE,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACvE,8BAA8B,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC7E,iBAAiB,CAAC,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAClF"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Provides account contract implementations and stub accounts for the EmbeddedWallet.
3
+ * Two implementations exist:
4
+ * - LazyAccountContractsProvider: uses dynamic imports for browser environments
5
+ * - EagerAccountContractsProvider: uses static imports for Node.js environments
6
+ */ export { };
@@ -0,0 +1,103 @@
1
+ import { type Account } from '@aztec-labs/aztec.js/account';
2
+ import { type InteractionWaitOptions, type SendReturn } from '@aztec-labs/aztec.js/contracts';
3
+ import type { AztecNodeClientOptions } from '@aztec-labs/aztec.js/node';
4
+ import type { Aliased, ExecuteUtilityOptions, PrivateEvent, PrivateEventFilter, ProfileOptions, SendOptions, SimulateOptions } from '@aztec-labs/aztec.js/wallet';
5
+ import { AccountManager, TxSimulationResultWithAppOffset } from '@aztec-labs/aztec.js/wallet';
6
+ import { Fq, Fr } from '@aztec-labs/foundation/curves/bn254';
7
+ import type { Logger } from '@aztec-labs/foundation/log';
8
+ import type { AztecAsyncKVStore } from '@aztec-labs/kv-store';
9
+ import type { PXEConfig, PXECreationOptions } from '@aztec-labs/pxe/client/lazy';
10
+ import type { PXE } from '@aztec-labs/pxe/server';
11
+ import type { EventMetadataDefinition, FunctionCall } from '@aztec-labs/stdlib/abi';
12
+ import { AztecAddress } from '@aztec-labs/stdlib/aztec-address';
13
+ import type { AztecNode } from '@aztec-labs/stdlib/interfaces/client';
14
+ import { type ContractOverrides, ExecutionPayload, type TxProfileResult, type UtilityExecutionResult } from '@aztec-labs/stdlib/tx';
15
+ import { BaseWallet, type SimulateViaEntrypointOptions } from '@aztec-labs/wallet-sdk/base-wallet';
16
+ import type { AccountContractsProvider } from './account-contract-providers/types.js';
17
+ import { type AccountType, WalletDB } from './wallet_db.js';
18
+ /** Options for the PXE instance created by the EmbeddedWallet. */
19
+ export type EmbeddedWalletPXEOptions = Partial<PXEConfig> & PXECreationOptions;
20
+ /** Splits a unified EmbeddedWalletPXEOptions into PXEConfig overrides and PXECreationOptions. */
21
+ export declare function splitPxeOptions(pxe?: EmbeddedWalletPXEOptions): {
22
+ config: Partial<PXEConfig>;
23
+ creation: PXECreationOptions;
24
+ };
25
+ /** Options for the EmbeddedWallet's own DB (accounts, senders — distinct from PXE state). */
26
+ export type EmbeddedWalletDBOptions = {
27
+ /** Override the wallet DB backend. If omitted, an IndexedDB (browser) / LMDB (node) store is created. */
28
+ store?: AztecAsyncKVStore;
29
+ };
30
+ export type EmbeddedWalletOptions = {
31
+ /** Parent logger. Child loggers are derived via createChild() for each subsystem. */
32
+ logger?: Logger;
33
+ /** Use ephemeral (in-memory) stores. Data will not persist across sessions. */
34
+ ephemeral?: boolean;
35
+ /** PXE configuration and dependency overrides (custom store, prover, simulator). */
36
+ pxe?: EmbeddedWalletPXEOptions;
37
+ /** Wallet DB dependency overrides (custom store). */
38
+ walletDb?: EmbeddedWalletDBOptions;
39
+ /** JSON-RPC client options used when the wallet is created from a node URL. */
40
+ nodeClientOptions?: AztecNodeClientOptions;
41
+ /**
42
+ * Override PXE configuration.
43
+ * @deprecated Use `pxe` instead.
44
+ */
45
+ pxeConfig?: Partial<PXEConfig>;
46
+ /**
47
+ * Advanced PXE creation options (custom store, prover, simulator).
48
+ * @deprecated Use `pxe` instead.
49
+ */
50
+ pxeOptions?: PXECreationOptions;
51
+ };
52
+ export declare class EmbeddedWallet extends BaseWallet {
53
+ protected walletDB: WalletDB;
54
+ protected accountContracts: AccountContractsProvider;
55
+ protected estimatedGasPadding: number;
56
+ protected stubClassIds: Map<"ecdsasecp256k1" | "ecdsasecp256r1" | "schnorr" | "schnorr_initializerless", Fr>;
57
+ constructor(pxe: PXE, aztecNode: AztecNode, walletDB: WalletDB, accountContracts: AccountContractsProvider, log?: Logger);
58
+ protected getAccountFromAddress(address: AztecAddress): Promise<Account>;
59
+ getAccounts(): Promise<Aliased<AztecAddress>[]>;
60
+ registerSender(address: AztecAddress, alias: string): Promise<AztecAddress>;
61
+ getAddressBook(): Promise<Aliased<AztecAddress>[]>;
62
+ /**
63
+ * Overrides the base sendTx to add a pre-simulation step before the actual send. The simulation
64
+ * estimates actual gas usage and captures call authorization requests to generate
65
+ * the necessary authwitnesses.
66
+ */
67
+ sendTx<W extends InteractionWaitOptions = undefined>(executionPayload: ExecutionPayload, opts: SendOptions<W>): Promise<SendReturn<W>>;
68
+ /**
69
+ * Overrides the base simulateTx to drive PXE syncing explicitly. The PXE created by the embedded
70
+ * wallet has autoSync disabled (so we can share one sync across simulate+send in sendTx); for
71
+ * standalone simulations we still need a fresh anchor block, which we provide here.
72
+ */
73
+ simulateTx(executionPayload: ExecutionPayload, opts: SimulateOptions): Promise<TxSimulationResultWithAppOffset>;
74
+ profileTx(executionPayload: ExecutionPayload, opts: ProfileOptions): Promise<TxProfileResult>;
75
+ executeUtility(call: FunctionCall, opts: ExecuteUtilityOptions): Promise<UtilityExecutionResult>;
76
+ getPrivateEvents<T>(eventDef: EventMetadataDefinition, eventFilter: PrivateEventFilter): Promise<PrivateEvent<T>[]>;
77
+ /**
78
+ * Hashes and registers the stub class for every supported account type with PXE, populating
79
+ * stubClassIds. Called on wallet initialization.
80
+ */
81
+ initStubClasses(): Promise<void>;
82
+ /**
83
+ * Builds contract overrides for all provided addresses by replacing their account contracts with stub implementations.
84
+ * Uses a type-specific stub artifact so that the stub's constructor selector matches the real account's constructor.
85
+ */
86
+ protected buildAccountOverrides(addresses: AztecAddress[]): Promise<ContractOverrides>;
87
+ /**
88
+ * Simulates calls via a stub account entrypoint, bypassing real account authorization.
89
+ * This allows kernelless simulation with contract overrides, skipping expensive
90
+ * private kernel circuit execution.
91
+ */
92
+ protected simulateViaEntrypoint(executionPayload: ExecutionPayload, opts: SimulateViaEntrypointOptions): Promise<TxSimulationResultWithAppOffset>;
93
+ protected createAccountInternal(type: AccountType, secret: Fr, salt: Fr, signingKey: Buffer): Promise<AccountManager>;
94
+ createAndStoreAccount(alias: string, type: AccountType, secret: Fr, salt: Fr, signingKey: Buffer): Promise<AccountManager>;
95
+ createSchnorrAccount(secret: Fr, salt: Fr, signingKey: Fq, alias?: string): Promise<AccountManager>;
96
+ createSchnorrInitializerlessAccount(secret: Fr, salt: Fr, signingKey: Fq, alias?: string): Promise<AccountManager>;
97
+ createECDSARAccount(secret: Fr, salt: Fr, signingKey: Buffer, alias?: string): Promise<AccountManager>;
98
+ createECDSAKAccount(secret: Fr, salt: Fr, signingKey: Buffer, alias?: string): Promise<AccountManager>;
99
+ setMinFeePadding(value?: number): void;
100
+ setEstimatedGasPadding(value?: number): void;
101
+ stop(): Promise<void>;
102
+ }
103
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1iZWRkZWRfd2FsbGV0LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZW1iZWRkZWQvZW1iZWRkZWRfd2FsbGV0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLE9BQU8sRUFBVyxNQUFNLDhCQUE4QixDQUFDO0FBRXJFLE9BQU8sRUFFTCxLQUFLLHNCQUFzQixFQUUzQixLQUFLLFVBQVUsRUFFaEIsTUFBTSxnQ0FBZ0MsQ0FBQztBQUN4QyxPQUFPLEtB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ACR,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,cAAc,CAAC,CAqDzB;IAEK,qBAAqB,CACzB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,EAAE,EACV,IAAI,EAAE,EAAE,EACR,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,cAAc,CAAC,CAIzB;IAED,oBAAoB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAElG;IAED,mCAAmC,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAEjH;IAED,mBAAmB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAErG;IAED,mBAAmB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAErG;IAED,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,QAE9B;IAED,sBAAsB,CAAC,KAAK,CAAC,EAAE,MAAM,QAEpC;IAEK,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAG1B;CACF"}
@@ -0,0 +1,359 @@
1
+ import { NO_FROM } from '@aztec-labs/aztec.js/account';
2
+ import { CallAuthorizationRequest } from '@aztec-labs/aztec.js/authorization';
3
+ import { ContractFunctionInteraction, NO_WAIT } from '@aztec-labs/aztec.js/contracts';
4
+ import { AccountManager, TxSimulationResultWithAppOffset } from '@aztec-labs/aztec.js/wallet';
5
+ import { DefaultEntrypoint } from '@aztec-labs/entrypoints/default';
6
+ import { poseidon2Hash } from '@aztec-labs/foundation/crypto/poseidon';
7
+ import { Schnorr } from '@aztec-labs/foundation/crypto/schnorr';
8
+ import { Fq, Fr } from '@aztec-labs/foundation/curves/bn254';
9
+ import { getContractClassFromArtifact } from '@aztec-labs/stdlib/contract';
10
+ import { GasSettings } from '@aztec-labs/stdlib/gas';
11
+ import { SimulationOverrides, TxStatus, collectOffchainEffects, mergeExecutionPayloads } from '@aztec-labs/stdlib/tx';
12
+ import { BaseWallet, getGasLimits } from '@aztec-labs/wallet-sdk/base-wallet';
13
+ /** Splits a unified EmbeddedWalletPXEOptions into PXEConfig overrides and PXECreationOptions. */ export function splitPxeOptions(pxe) {
14
+ if (!pxe) {
15
+ return {
16
+ config: {},
17
+ creation: {}
18
+ };
19
+ }
20
+ const { loggers, loggerActorLabel, proverOrOptions, store, simulator, hooks, preloadedContractsProvider, ...config } = pxe;
21
+ return {
22
+ config,
23
+ creation: {
24
+ loggers,
25
+ loggerActorLabel,
26
+ proverOrOptions,
27
+ store,
28
+ simulator,
29
+ hooks,
30
+ preloadedContractsProvider
31
+ }
32
+ };
33
+ }
34
+ const DEFAULT_ESTIMATED_GAS_PADDING = 0.1;
35
+ export class EmbeddedWallet extends BaseWallet {
36
+ walletDB;
37
+ accountContracts;
38
+ estimatedGasPadding;
39
+ // Stub class ids, populated on wallet startup
40
+ // to avoid redundant work per simulation
41
+ stubClassIds;
42
+ constructor(pxe, aztecNode, walletDB, accountContracts, log){
43
+ super(pxe, aztecNode, log), this.walletDB = walletDB, this.accountContracts = accountContracts, this.estimatedGasPadding = DEFAULT_ESTIMATED_GAS_PADDING, this.stubClassIds = new Map();
44
+ }
45
+ async getAccountFromAddress(address) {
46
+ const { secretKey, salt, signingKey, type } = await this.walletDB.retrieveAccount(address);
47
+ const accountManager = await this.createAccountInternal(type, secretKey, salt, signingKey);
48
+ const account = await accountManager.getAccount();
49
+ if (!account) {
50
+ throw new Error(`Account not found in wallet for address: ${address}`);
51
+ }
52
+ return account;
53
+ }
54
+ getAccounts() {
55
+ return this.walletDB.listAccounts();
56
+ }
57
+ async registerSender(address, alias) {
58
+ await this.walletDB.storeSender(address, alias);
59
+ await this.pxe.registerTaggingSecretSource({
60
+ kind: 'address-derived',
61
+ sender: address
62
+ });
63
+ return address;
64
+ }
65
+ async getAddressBook() {
66
+ const sources = await this.pxe.getTaggingSecretSources({
67
+ kind: 'address-derived'
68
+ });
69
+ const senders = sources.map((source)=>source.sender);
70
+ const storedSenders = await this.walletDB.listSenders();
71
+ for (const storedSender of storedSenders){
72
+ if (senders.findIndex((sender)=>sender.equals(storedSender.item)) === -1) {
73
+ await this.pxe.registerTaggingSecretSource({
74
+ kind: 'address-derived',
75
+ sender: storedSender.item
76
+ });
77
+ }
78
+ }
79
+ return storedSenders;
80
+ }
81
+ /**
82
+ * Overrides the base sendTx to add a pre-simulation step before the actual send. The simulation
83
+ * estimates actual gas usage and captures call authorization requests to generate
84
+ * the necessary authwitnesses.
85
+ */ async sendTx(executionPayload, opts) {
86
+ // PXE has autoSync disabled by the embedded wallet entrypoints, so we sync once here to cover
87
+ // both the inner simulateTx (via simulateViaEntrypoint) and the proveTx that super.sendTx
88
+ await this.pxe.sync();
89
+ const feeOptions = await this.completeFeeOptions({
90
+ from: opts.from,
91
+ feePayer: executionPayload.feePayer,
92
+ gasSettings: opts.fee?.gasSettings,
93
+ forEstimation: true
94
+ });
95
+ // Simulate the transaction first to estimate gas and capture required
96
+ // private authwitnesses based on offchain effects.
97
+ const simulationResult = await this.simulateViaEntrypoint(executionPayload, {
98
+ from: opts.from,
99
+ feeOptions,
100
+ additionalScopes: opts.additionalScopes,
101
+ skipTxValidation: true,
102
+ sendMessagesAs: opts.sendMessagesAs
103
+ });
104
+ const offchainEffects = collectOffchainEffects(simulationResult.privateExecutionResult);
105
+ const authWitnesses = await Promise.all(offchainEffects.map(async (effect)=>{
106
+ try {
107
+ const authRequest = await CallAuthorizationRequest.fromFields(effect.data);
108
+ return this.createAuthWit(authRequest.onBehalfOf, {
109
+ consumer: effect.contractAddress,
110
+ innerHash: authRequest.innerHash
111
+ });
112
+ } catch {
113
+ return undefined;
114
+ }
115
+ }));
116
+ for (const authwit of authWitnesses){
117
+ if (authwit) {
118
+ executionPayload.authWitnesses.push(authwit);
119
+ }
120
+ }
121
+ const maxTxGasLimits = await this.getMaxTxGasLimits();
122
+ const estimated = getGasLimits(simulationResult.gasUsed, maxTxGasLimits, this.estimatedGasPadding);
123
+ this.log.verbose(`Estimated gas limits for tx: DA=${estimated.gasLimits.daGas} L2=${estimated.gasLimits.l2Gas} teardownDA=${estimated.teardownGasLimits.daGas} teardownL2=${estimated.teardownGasLimits.l2Gas}`);
124
+ const gasSettings = GasSettings.from({
125
+ ...opts.fee?.gasSettings,
126
+ maxFeesPerGas: feeOptions.gasSettings.maxFeesPerGas,
127
+ maxPriorityFeesPerGas: feeOptions.gasSettings.maxPriorityFeesPerGas,
128
+ gasLimits: opts.fee?.gasSettings?.gasLimits ?? estimated.gasLimits,
129
+ teardownGasLimits: opts.fee?.gasSettings?.teardownGasLimits ?? estimated.teardownGasLimits
130
+ });
131
+ let wait = opts.wait;
132
+ if (wait !== NO_WAIT) {
133
+ const callerWaitOpts = typeof wait === 'object' ? wait : {};
134
+ wait = {
135
+ ...callerWaitOpts,
136
+ // Default to PROPOSED so the wait returns as soon as the tx lands in a proposed L2 block,
137
+ // rather than waiting until the end of the slot for the checkpoint to be published to L1.
138
+ // This is what makes MBPS (Multiple Blocks Per Slot) actually improve UX: with CHECKPOINTED
139
+ // we'd block until L1 inclusion regardless of how early in the slot the tx was sequenced.
140
+ // The tradeoff is a weaker guarantee — a proposed block only becomes canonical once it (or
141
+ // a later block in the same slot) is checkpointed, so a tx could be re-orged out if the
142
+ // proposer fails to publish to L1 (which should be rare, since they'd get slashed for it).
143
+ waitForStatus: callerWaitOpts.waitForStatus ?? TxStatus.PROPOSED
144
+ };
145
+ }
146
+ return super.sendTx(executionPayload, {
147
+ ...opts,
148
+ wait: wait,
149
+ fee: {
150
+ ...opts.fee,
151
+ gasSettings
152
+ }
153
+ });
154
+ }
155
+ /**
156
+ * Overrides the base simulateTx to drive PXE syncing explicitly. The PXE created by the embedded
157
+ * wallet has autoSync disabled (so we can share one sync across simulate+send in sendTx); for
158
+ * standalone simulations we still need a fresh anchor block, which we provide here.
159
+ */ async simulateTx(executionPayload, opts) {
160
+ await this.pxe.sync();
161
+ return super.simulateTx(executionPayload, opts);
162
+ }
163
+ async profileTx(executionPayload, opts) {
164
+ await this.pxe.sync();
165
+ return super.profileTx(executionPayload, opts);
166
+ }
167
+ async executeUtility(call, opts) {
168
+ await this.pxe.sync();
169
+ return super.executeUtility(call, opts);
170
+ }
171
+ async getPrivateEvents(eventDef, eventFilter) {
172
+ await this.pxe.sync();
173
+ return super.getPrivateEvents(eventDef, eventFilter);
174
+ }
175
+ /**
176
+ * Hashes and registers the stub class for every supported account type with PXE, populating
177
+ * stubClassIds. Called on wallet initialization.
178
+ */ async initStubClasses() {
179
+ const schnorrArtifact = await this.accountContracts.getStubAccountContractArtifact('schnorr');
180
+ const { id: schnorrClassId } = await getContractClassFromArtifact(schnorrArtifact);
181
+ await this.pxe.registerContractClass(schnorrArtifact);
182
+ // ecdsa stubs share the same class id
183
+ const ecdsaArtifact = await this.accountContracts.getStubAccountContractArtifact('ecdsasecp256r1');
184
+ const { id: ecdsaClassId } = await getContractClassFromArtifact(ecdsaArtifact);
185
+ await this.pxe.registerContractClass(ecdsaArtifact);
186
+ this.stubClassIds.set('schnorr', schnorrClassId);
187
+ this.stubClassIds.set('schnorr_initializerless', schnorrClassId);
188
+ this.stubClassIds.set('ecdsasecp256k1', ecdsaClassId);
189
+ this.stubClassIds.set('ecdsasecp256r1', ecdsaClassId);
190
+ }
191
+ /**
192
+ * Builds contract overrides for all provided addresses by replacing their account contracts with stub implementations.
193
+ * Uses a type-specific stub artifact so that the stub's constructor selector matches the real account's constructor.
194
+ */ async buildAccountOverrides(addresses) {
195
+ const accounts = await this.getAccounts();
196
+ const contracts = {};
197
+ const filtered = accounts.filter((acc)=>addresses.some((addr)=>addr.equals(acc.item)));
198
+ for (const account of filtered){
199
+ const address = account.item;
200
+ const { type } = await this.walletDB.retrieveAccount(address);
201
+ const stubClassId = this.stubClassIds.get(type);
202
+ if (!stubClassId) {
203
+ throw new Error(`Stub class for account type '${type}' was not registered at wallet init. This is a bug — initStubClasses should cover every supported AccountType.`);
204
+ }
205
+ const originalAccount = await this.getAccountFromAddress(address);
206
+ const completeAddress = originalAccount.getCompleteAddress();
207
+ const contractInstance = await this.pxe.getContractInstance(completeAddress.address);
208
+ if (!contractInstance) {
209
+ throw new Error(`No contract instance found for address: ${completeAddress.address} during account override building. This is a bug!`);
210
+ }
211
+ contracts[address.toString()] = {
212
+ instance: {
213
+ ...contractInstance,
214
+ currentContractClassId: stubClassId
215
+ }
216
+ };
217
+ }
218
+ return contracts;
219
+ }
220
+ /**
221
+ * Simulates calls via a stub account entrypoint, bypassing real account authorization.
222
+ * This allows kernelless simulation with contract overrides, skipping expensive
223
+ * private kernel circuit execution.
224
+ */ async simulateViaEntrypoint(executionPayload, opts) {
225
+ const { from, feeOptions, additionalScopes, skipTxValidation, skipFeeEnforcement, sendMessagesAs } = opts;
226
+ const scopes = this.scopesFrom(from, additionalScopes ?? [], sendMessagesAs);
227
+ const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
228
+ const finalExecutionPayload = feeExecutionPayload ? mergeExecutionPayloads([
229
+ feeExecutionPayload,
230
+ executionPayload
231
+ ]) : executionPayload;
232
+ const chainInfo = await this.getChainInfo();
233
+ const accountOverrides = await this.buildAccountOverrides(scopes);
234
+ const overrides = new SimulationOverrides({
235
+ contracts: accountOverrides
236
+ });
237
+ let txRequest;
238
+ if (from === NO_FROM) {
239
+ const entrypoint = new DefaultEntrypoint();
240
+ txRequest = await entrypoint.createTxExecutionRequest(finalExecutionPayload, feeOptions.gasSettings, chainInfo);
241
+ } else {
242
+ const { type } = await this.walletDB.retrieveAccount(from);
243
+ const originalAccount = await this.getAccountFromAddress(from);
244
+ const completeAddress = originalAccount.getCompleteAddress();
245
+ const account = await this.accountContracts.createStubAccount(completeAddress, type);
246
+ const executionOptions = {
247
+ txNonce: Fr.random(),
248
+ cancellable: this.cancellableTransactions,
249
+ // If from is an address, feeOptions include the way the account contract should handle the fee payment
250
+ feePaymentMethodOptions: feeOptions.accountFeePaymentMethodOptions
251
+ };
252
+ txRequest = await account.createTxExecutionRequest(finalExecutionPayload, feeOptions.gasSettings, chainInfo, executionOptions);
253
+ }
254
+ const result = await this.pxe.simulateTx(txRequest, {
255
+ simulatePublic: true,
256
+ skipFeeEnforcement,
257
+ skipTxValidation,
258
+ overrides,
259
+ scopes,
260
+ senderForTags: this.senderForTagsFrom(from, sendMessagesAs)
261
+ });
262
+ const appCallOffset = await this.computeAppCallOffset(from, feeOptions);
263
+ return TxSimulationResultWithAppOffset.fromResultAndOffset(result, appCallOffset);
264
+ }
265
+ async createAccountInternal(type, secret, salt, signingKey) {
266
+ let contract;
267
+ let immutablesHash;
268
+ let publicKey;
269
+ switch(type){
270
+ case 'schnorr':
271
+ {
272
+ contract = await this.accountContracts.getSchnorrAccountContract(Fq.fromBuffer(signingKey));
273
+ break;
274
+ }
275
+ case 'schnorr_initializerless':
276
+ {
277
+ contract = await this.accountContracts.getSchnorrInitializerlessAccountContract(Fq.fromBuffer(signingKey));
278
+ publicKey = await new Schnorr().computePublicKey(Fq.fromBuffer(signingKey));
279
+ immutablesHash = await poseidon2Hash([
280
+ publicKey.x,
281
+ publicKey.y
282
+ ]);
283
+ break;
284
+ }
285
+ case 'ecdsasecp256k1':
286
+ {
287
+ contract = await this.accountContracts.getEcdsaKAccountContract(signingKey);
288
+ break;
289
+ }
290
+ case 'ecdsasecp256r1':
291
+ {
292
+ contract = await this.accountContracts.getEcdsaRAccountContract(signingKey);
293
+ break;
294
+ }
295
+ default:
296
+ {
297
+ throw new Error(`Unknown account type ${type}`);
298
+ }
299
+ }
300
+ const accountManager = await AccountManager.create(this, secret, contract, {
301
+ salt,
302
+ immutablesHash
303
+ });
304
+ const instance = accountManager.getInstance();
305
+ const existingInstance = await this.pxe.getContractInstance(instance.address);
306
+ if (!existingInstance) {
307
+ const existingArtifact = await this.pxe.getContractArtifact(instance.currentContractClassId);
308
+ const artifact = existingArtifact ?? await accountManager.getAccountContract().getContractArtifact();
309
+ await this.registerContract(instance, !existingArtifact ? await accountManager.getAccountContract().getContractArtifact() : undefined, accountManager.getSecretKey());
310
+ if (type === 'schnorr_initializerless') {
311
+ const constructor = artifact.functions.find((f)=>f.name === 'constructor');
312
+ if (!constructor) {
313
+ throw new Error('Could not create SchnorrInitializerlessAccountContract: constructor ABI not found');
314
+ }
315
+ const storeCall = new ContractFunctionInteraction(this, instance.address, constructor, [
316
+ publicKey.x,
317
+ publicKey.y
318
+ ]);
319
+ await storeCall.simulate({
320
+ from: instance.address
321
+ });
322
+ }
323
+ }
324
+ return accountManager;
325
+ }
326
+ async createAndStoreAccount(alias, type, secret, salt, signingKey) {
327
+ const accountManager = await this.createAccountInternal(type, secret, salt, signingKey);
328
+ await this.walletDB.storeAccount(accountManager.address, {
329
+ type,
330
+ secretKey: secret,
331
+ salt,
332
+ alias,
333
+ signingKey
334
+ });
335
+ return accountManager;
336
+ }
337
+ createSchnorrAccount(secret, salt, signingKey, alias) {
338
+ return this.createAndStoreAccount(alias ?? '', 'schnorr', secret, salt, signingKey.toBuffer());
339
+ }
340
+ createSchnorrInitializerlessAccount(secret, salt, signingKey, alias) {
341
+ return this.createAndStoreAccount(alias ?? '', 'schnorr_initializerless', secret, salt, signingKey.toBuffer());
342
+ }
343
+ createECDSARAccount(secret, salt, signingKey, alias) {
344
+ return this.createAndStoreAccount(alias ?? '', 'ecdsasecp256r1', secret, salt, signingKey);
345
+ }
346
+ createECDSAKAccount(secret, salt, signingKey, alias) {
347
+ return this.createAndStoreAccount(alias ?? '', 'ecdsasecp256k1', secret, salt, signingKey);
348
+ }
349
+ setMinFeePadding(value) {
350
+ this.minFeePadding = value ?? 0.5;
351
+ }
352
+ setEstimatedGasPadding(value) {
353
+ this.estimatedGasPadding = value ?? DEFAULT_ESTIMATED_GAS_PADDING;
354
+ }
355
+ async stop() {
356
+ await this.pxe.stop();
357
+ await this.walletDB.close();
358
+ }
359
+ }