@aztec/test-wallet 0.0.1-commit.24de95ac → 0.0.1-commit.3469e52

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/bundle.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { TestWallet } from './wallet/bundle.js';
2
2
  export { type AccountData } from './wallet/test_wallet.js';
3
- export { deployFundedSchnorrAccounts, registerInitialSandboxAccountsInWallet, ProvenTx, proveInteraction, } from './utils.js';
4
- //# sourceMappingURL=bundle.d.ts.map
3
+ export { deployFundedSchnorrAccounts, registerInitialLocalNetworkAccountsInWallet, ProvenTx, proveInteraction, } from './utils.js';
4
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVuZGxlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvYnVuZGxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUNoRCxPQUFPLEVBQUUsS0FBSyxXQUFXLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUMzRCxPQUFPLEVBQ0wsMkJBQTJCLEVBQzNCLDJDQUEyQyxFQUMzQyxRQUFRLEVBQ1IsZ0JBQWdCLEdBQ2pCLE1BQU0sWUFBWSxDQUFDIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,2BAA2B,EAC3B,sCAAsC,EACtC,QAAQ,EACR,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,2BAA2B,EAC3B,2CAA2C,EAC3C,QAAQ,EACR,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
package/dest/bundle.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export { TestWallet } from './wallet/bundle.js';
2
- export { deployFundedSchnorrAccounts, registerInitialSandboxAccountsInWallet, ProvenTx, proveInteraction } from './utils.js';
2
+ export { deployFundedSchnorrAccounts, registerInitialLocalNetworkAccountsInWallet, ProvenTx, proveInteraction } from './utils.js';
package/dest/lazy.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { TestWallet } from './wallet/lazy.js';
2
2
  export { type AccountData } from './wallet/test_wallet.js';
3
- export { deployFundedSchnorrAccounts, registerInitialSandboxAccountsInWallet, ProvenTx, proveInteraction, } from './utils.js';
4
- //# sourceMappingURL=lazy.d.ts.map
3
+ export { deployFundedSchnorrAccounts, registerInitialLocalNetworkAccountsInWallet, ProvenTx, proveInteraction, } from './utils.js';
4
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2xhenkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQzlDLE9BQU8sRUFBRSxLQUFLLFdBQVcsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQzNELE9BQU8sRUFDTCwyQkFBMkIsRUFDM0IsMkNBQTJDLEVBQzNDLFFBQVEsRUFDUixnQkFBZ0IsR0FDakIsTUFBTSxZQUFZLENBQUMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../src/lazy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,2BAA2B,EAC3B,sCAAsC,EACtC,QAAQ,EACR,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../src/lazy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,2BAA2B,EAC3B,2CAA2C,EAC3C,QAAQ,EACR,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
package/dest/lazy.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export { TestWallet } from './wallet/lazy.js';
2
- export { deployFundedSchnorrAccounts, registerInitialSandboxAccountsInWallet, ProvenTx, proveInteraction } from './utils.js';
2
+ export { deployFundedSchnorrAccounts, registerInitialLocalNetworkAccountsInWallet, ProvenTx, proveInteraction } from './utils.js';
package/dest/server.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { TestWallet } from './wallet/server.js';
2
2
  export { type AccountData } from './wallet/test_wallet.js';
3
- export { deployFundedSchnorrAccounts, registerInitialSandboxAccountsInWallet, ProvenTx, proveInteraction, } from './utils.js';
4
- //# sourceMappingURL=server.d.ts.map
3
+ export { deployFundedSchnorrAccounts, registerInitialLocalNetworkAccountsInWallet, ProvenTx, proveInteraction, } from './utils.js';
4
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvc2VydmVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUNoRCxPQUFPLEVBQUUsS0FBSyxXQUFXLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUMzRCxPQUFPLEVBQ0wsMkJBQTJCLEVBQzNCLDJDQUEyQyxFQUMzQyxRQUFRLEVBQ1IsZ0JBQWdCLEdBQ2pCLE1BQU0sWUFBWSxDQUFDIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,2BAA2B,EAC3B,sCAAsC,EACtC,QAAQ,EACR,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,2BAA2B,EAC3B,2CAA2C,EAC3C,QAAQ,EACR,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
package/dest/server.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export { TestWallet } from './wallet/server.js';
2
- export { deployFundedSchnorrAccounts, registerInitialSandboxAccountsInWallet, ProvenTx, proveInteraction } from './utils.js';
2
+ export { deployFundedSchnorrAccounts, registerInitialLocalNetworkAccountsInWallet, ProvenTx, proveInteraction } from './utils.js';
package/dest/utils.d.ts CHANGED
@@ -10,11 +10,11 @@ import type { BaseTestWallet } from './wallet/test_wallet.js';
10
10
  */
11
11
  export declare function deployFundedSchnorrAccounts(wallet: BaseTestWallet, aztecNode: AztecNode, accountsData: InitialAccountData[], waitOptions?: WaitOpts): Promise<import("@aztec/aztec.js/wallet").AccountManager[]>;
12
12
  /**
13
- * Registers the initial sandbox accounts in the wallet.
13
+ * Registers the initial local network accounts in the wallet.
14
14
  * @param wallet - Test wallet to use to register the accounts.
15
15
  * @returns Addresses of the registered accounts.
16
16
  */
17
- export declare function registerInitialSandboxAccountsInWallet(wallet: BaseTestWallet): Promise<AztecAddress[]>;
17
+ export declare function registerInitialLocalNetworkAccountsInWallet(wallet: BaseTestWallet): Promise<AztecAddress[]>;
18
18
  /**
19
19
  * A proven transaction that can be sent to the network. Returned by the `prove` method of the test wallet
20
20
  */
@@ -36,4 +36,4 @@ export declare class ProvenTx extends Tx {
36
36
  * @returns - A proven transaction ready do be sent to the network
37
37
  */
38
38
  export declare function proveInteraction(wallet: BaseTestWallet, interaction: ContractFunctionInteraction | DeployMethod, options: SendInteractionOptions | DeployOptions): Promise<ProvenTx>;
39
- //# sourceMappingURL=utils.d.ts.map
39
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxrQkFBa0IsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBRWxFLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUN6RCxPQUFPLEVBQ0wsMkJBQTJCLEVBQzNCLFlBQVksRUFDWixLQUFLLGFBQWEsRUFDbEIsS0FBSyxzQkFBc0IsRUFDM0IsTUFBTSxFQUNOLEtBQUssUUFBUSxFQUVkLE1BQU0sMkJBQTJCLENBQUM7QUFDbkMsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDdEQsT0FBTyxFQUFFLEtBQUssY0FBYyxFQUFFLEtBQUssWUFBWSxFQUFFLEVBQUUsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBRTlFL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EACZ,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,MAAM,EACN,KAAK,QAAQ,EAEd,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAE9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,kBAAkB,EAAE,EAClC,WAAW,CAAC,EAAE,QAAQ,8DAiBvB;AAED;;;;GAIG;AACH,wBAAsB,2CAA2C,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAOjH;AACD;;GAEG;AACH,qBAAa,QAAS,SAAQ,EAAE;IAE5B,OAAO,CAAC,IAAI;IAEZ,4EAA4E;IACrE,eAAe,EAAE,cAAc,EAAE;IAEjC,KAAK,CAAC;IANf,YACU,IAAI,EAAE,SAAS,EACvB,EAAE,EAAE,EAAE;IACN,4EAA4E;IACrE,eAAe,EAAE,cAAc,EAAE,EAEjC,KAAK,CAAC,0BAAc,EAG5B;IAED,IAAI,WAMH;CACF;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,cAAc,EACtB,WAAW,EAAE,2BAA2B,GAAG,YAAY,EACvD,OAAO,EAAE,sBAAsB,GAAG,aAAa,qBAShD"}
package/dest/utils.js CHANGED
@@ -21,10 +21,10 @@ import { Tx } from '@aztec/stdlib/tx';
21
21
  return accountManagers;
22
22
  }
23
23
  /**
24
- * Registers the initial sandbox accounts in the wallet.
24
+ * Registers the initial local network accounts in the wallet.
25
25
  * @param wallet - Test wallet to use to register the accounts.
26
26
  * @returns Addresses of the registered accounts.
27
- */ export async function registerInitialSandboxAccountsInWallet(wallet) {
27
+ */ export async function registerInitialLocalNetworkAccountsInWallet(wallet) {
28
28
  const testAccounts = await getInitialTestAccountsData();
29
29
  return Promise.all(testAccounts.map(async (account)=>{
30
30
  return (await wallet.createSchnorrAccount(account.secret, account.salt, account.signingKey)).address;
@@ -61,5 +61,5 @@ import { Tx } from '@aztec/stdlib/tx';
61
61
  } else {
62
62
  execPayload = await interaction.request(options);
63
63
  }
64
- return wallet.proveTx(execPayload, await toSendOptions(options));
64
+ return wallet.proveTx(execPayload, toSendOptions(options));
65
65
  }
@@ -14,10 +14,16 @@ export declare class TestWallet extends BaseTestWallet {
14
14
  createSchnorrAccount(secret: Fr, salt: Fr, signingKey?: Fq): Promise<AccountManager>;
15
15
  createECDSARAccount(secret: Fr, salt: Fr, signingKey: Buffer): Promise<AccountManager>;
16
16
  createECDSAKAccount(secret: Fr, salt: Fr, signingKey: Buffer): Promise<AccountManager>;
17
+ /**
18
+ * Creates a stub account that impersonates the given address, allowing kernelless simulations
19
+ * to bypass the account's authorization mechanisms via contract overrides.
20
+ * @param address - The address of the account to impersonate
21
+ * @returns The stub account, contract instance, and artifact for simulation
22
+ */
17
23
  getFakeAccountDataFor(address: AztecAddress): Promise<{
18
24
  account: import("@aztec/aztec.js/account").BaseAccount;
19
25
  instance: import("@aztec/aztec.js/contracts").ContractInstanceWithAddress;
20
- artifact: import("@aztec/aztec.js/abi").ContractArtifact;
26
+ artifact: import("@aztec/stdlib/abi").ContractArtifact;
21
27
  }>;
22
28
  }
23
- //# sourceMappingURL=bundle.d.ts.map
29
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVuZGxlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvd2FsbGV0L2J1bmRsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFJQSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSwyQkFBMkIsQ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sT0FBTyxFQUFFLFlBQVk7Ozs7T0FzQmhEO0NBQ0YifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/wallet/bundle.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,kBAAkB,EAA2B,MAAM,0BAA0B,CAAC;AAG5G,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,cAAc;WAC/B,MAAM,CACjB,IAAI,EAAE,SAAS,EACf,iBAAiB,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,EACtC,OAAO,GAAE,kBAAoC,GAC5C,OAAO,CAAC,UAAU,CAAC;IAStB,oBAAoB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC;IAUpF,mBAAmB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAStF,mBAAmB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAShF,qBAAqB,CAAC,OAAO,EAAE,YAAY;;;;;CAkBlD"}
1
+ {"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/wallet/bundle.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,kBAAkB,EAA2B,MAAM,0BAA0B,CAAC;AAG5G,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,cAAc;IAC5C,OAAa,MAAM,CACjB,IAAI,EAAE,SAAS,EACf,iBAAiB,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,EACtC,OAAO,GAAE,kBAAoC,GAC5C,OAAO,CAAC,UAAU,CAAC,CAOrB;IAED,oBAAoB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAQnF;IAED,mBAAmB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAOrF;IAED,mBAAmB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAOrF;IAED;;;;;OAKG;IACG,qBAAqB,CAAC,OAAO,EAAE,YAAY;;;;OAsBhD;CACF"}
@@ -1,6 +1,7 @@
1
1
  import { EcdsaKAccountContract, EcdsaRAccountContract } from '@aztec/accounts/ecdsa';
2
2
  import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
3
3
  import { StubAccountContractArtifact, createStubAccount } from '@aztec/accounts/stub';
4
+ import { SignerlessAccount } from '@aztec/aztec.js/account';
4
5
  import { getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
5
6
  import { Fr } from '@aztec/aztec.js/fields';
6
7
  import { createPXE, getPXEConfig } from '@aztec/pxe/client/bundle';
@@ -46,15 +47,25 @@ import { BaseTestWallet } from './test_wallet.js';
46
47
  };
47
48
  return this.createAccount(accountData);
48
49
  }
49
- async getFakeAccountDataFor(address) {
50
- const chainInfo = await this.getChainInfo();
50
+ /**
51
+ * Creates a stub account that impersonates the given address, allowing kernelless simulations
52
+ * to bypass the account's authorization mechanisms via contract overrides.
53
+ * @param address - The address of the account to impersonate
54
+ * @returns The stub account, contract instance, and artifact for simulation
55
+ */ async getFakeAccountDataFor(address) {
51
56
  const originalAccount = await this.getAccountFromAddress(address);
57
+ // Account contracts can only be overridden if they have an associated address
58
+ // Overwriting SignerlessAccount is not supported, and does not really make sense
59
+ // since it has no authorization mechanism.
60
+ if (originalAccount instanceof SignerlessAccount) {
61
+ throw new Error(`Cannot create fake account data for SignerlessAccount at address: ${address}`);
62
+ }
52
63
  const originalAddress = originalAccount.getCompleteAddress();
53
- const { contractInstance } = await this.pxe.getContractMetadata(originalAddress.address);
64
+ const contractInstance = await this.pxe.getContractInstance(originalAddress.address);
54
65
  if (!contractInstance) {
55
66
  throw new Error(`No contract instance found for address: ${originalAddress.address}`);
56
67
  }
57
- const stubAccount = createStubAccount(originalAddress, chainInfo);
68
+ const stubAccount = createStubAccount(originalAddress);
58
69
  const instance = await getContractInstanceFromInstantiationParams(StubAccountContractArtifact, {
59
70
  salt: Fr.random()
60
71
  });
@@ -14,10 +14,16 @@ export declare class TestWallet extends BaseTestWallet {
14
14
  createSchnorrAccount(secret: Fr, salt: Fr, signingKey?: Fq): Promise<AccountManager>;
15
15
  createECDSARAccount(secret: Fr, salt: Fr, signingKey: Buffer): Promise<AccountManager>;
16
16
  createECDSAKAccount(secret: Fr, salt: Fr, signingKey: Buffer): Promise<AccountManager>;
17
+ /**
18
+ * Creates a stub account that impersonates the given address, allowing kernelless simulations
19
+ * to bypass the account's authorization mechanisms via contract overrides.
20
+ * @param address - The address of the account to impersonate
21
+ * @returns The stub account, contract instance, and artifact for simulation
22
+ */
17
23
  getFakeAccountDataFor(address: AztecAddress): Promise<{
18
24
  account: import("@aztec/aztec.js/account").BaseAccount;
19
25
  instance: import("@aztec/aztec.js/contracts").ContractInstanceWithAddress;
20
- artifact: import("@aztec/aztec.js/abi").ContractArtifact;
26
+ artifact: import("@aztec/stdlib/abi").ContractArtifact;
21
27
  }>;
22
28
  }
23
- //# sourceMappingURL=lazy.d.ts.map
29
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3dhbGxldC9sYXp5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUlBLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBRTlELE9BQU8sRUFBRSxFQUFFLEVBQUUsRUFBRSxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDaEQsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDdEQsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBQ3hELE9BQU8sRUFBRSxLQUFLLFNBQVMsRUFBRSxLQUFLLGtCQUFrQixFQUEyQixNQUFNLHdCQUF3QixDQUFDO0FBRzFHLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUVsRDs7OztHQUlHO0FBQ0gscUJBQWEsVUFBVyxTQUFRLGNBQWM7SUFDNUMsT0FBYSxNQUFNLENBQ2pCLElBQUksRUFBRSxTQUFTLEVBQ2YsaUJBQWlCLENBQUMsRUFBRSxPQUFPLENBQUMsU0FBUyxDQUFDLEVBQ3RDLE9BQU8sR0FBRSxrQkFBb0MsR0FDNUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQU9yQjtJQ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AAE,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAOrF;IAED,mBAAmB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAOrF;IAED;;;;;OAKG;IACG,qBAAqB,CAAC,OAAO,EAAE,YAAY;;;;OAuBhD;CACF"}
@@ -1,6 +1,7 @@
1
1
  import { EcdsaKAccountContract, EcdsaRAccountContract } from '@aztec/accounts/ecdsa/lazy';
2
2
  import { SchnorrAccountContract } from '@aztec/accounts/schnorr/lazy';
3
3
  import { createStubAccount, getStubAccountContractArtifact } from '@aztec/accounts/stub/lazy';
4
+ import { SignerlessAccount } from '@aztec/aztec.js/account';
4
5
  import { getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
5
6
  import { Fr } from '@aztec/aztec.js/fields';
6
7
  import { createPXE, getPXEConfig } from '@aztec/pxe/client/lazy';
@@ -46,15 +47,25 @@ import { BaseTestWallet } from './test_wallet.js';
46
47
  };
47
48
  return this.createAccount(accountData);
48
49
  }
49
- async getFakeAccountDataFor(address) {
50
- const chainInfo = await this.getChainInfo();
50
+ /**
51
+ * Creates a stub account that impersonates the given address, allowing kernelless simulations
52
+ * to bypass the account's authorization mechanisms via contract overrides.
53
+ * @param address - The address of the account to impersonate
54
+ * @returns The stub account, contract instance, and artifact for simulation
55
+ */ async getFakeAccountDataFor(address) {
51
56
  const originalAccount = await this.getAccountFromAddress(address);
57
+ // Account contracts can only be overridden if they have an associated address
58
+ // Overwriting SignerlessAccount is not supported, and does not really make sense
59
+ // since it has no authorization mechanism.
60
+ if (originalAccount instanceof SignerlessAccount) {
61
+ throw new Error(`Cannot create fake account data for SignerlessAccount at address: ${address}`);
62
+ }
52
63
  const originalAddress = originalAccount.getCompleteAddress();
53
- const { contractInstance } = await this.pxe.getContractMetadata(originalAddress.address);
64
+ const contractInstance = await this.pxe.getContractInstance(originalAddress.address);
54
65
  if (!contractInstance) {
55
66
  throw new Error(`No contract instance found for address: ${originalAddress.address}`);
56
67
  }
57
- const stubAccount = createStubAccount(originalAddress, chainInfo);
68
+ const stubAccount = createStubAccount(originalAddress);
58
69
  const StubAccountContractArtifact = await getStubAccountContractArtifact();
59
70
  const instance = await getContractInstanceFromInstantiationParams(StubAccountContractArtifact, {
60
71
  salt: Fr.random()
@@ -14,10 +14,16 @@ export declare class TestWallet extends BaseTestWallet {
14
14
  createSchnorrAccount(secret: Fr, salt: Fr, signingKey?: Fq): Promise<AccountManager>;
15
15
  createECDSARAccount(secret: Fr, salt: Fr, signingKey: Buffer): Promise<AccountManager>;
16
16
  createECDSAKAccount(secret: Fr, salt: Fr, signingKey: Buffer): Promise<AccountManager>;
17
+ /**
18
+ * Creates a stub account that impersonates the given address, allowing kernelless simulations
19
+ * to bypass the account's authorization mechanisms via contract overrides.
20
+ * @param address - The address of the account to impersonate
21
+ * @returns The stub account, contract instance, and artifact for simulation
22
+ */
17
23
  getFakeAccountDataFor(address: AztecAddress): Promise<{
18
24
  account: import("@aztec/aztec.js/account").BaseAccount;
19
25
  instance: import("@aztec/aztec.js/contracts").ContractInstanceWithAddress;
20
- artifact: import("@aztec/aztec.js/abi").ContractArtifact;
26
+ artifact: import("@aztec/stdlib/abi").ContractArtifact;
21
27
  }>;
22
28
  }
23
- //# sourceMappingURL=server.d.ts.map
29
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvd2FsbGV0L3NlcnZlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFJQSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUU5RCxPQUFPLEVBQUUsRUFBRSxFQUFFLEVBQUUsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBQ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","sourceRoot":"","sources":["../../src/wallet/server.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,kBAAkB,EAA2B,MAAM,mBAAmB,CAAC;AAGrG,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,cAAc;WAC/B,MAAM,CACjB,IAAI,EAAE,SAAS,EACf,iBAAiB,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,EACtC,OAAO,GAAE,kBAAoC,GAC5C,OAAO,CAAC,UAAU,CAAC;IAStB,oBAAoB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC;IAUpF,mBAAmB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAStF,mBAAmB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAShF,qBAAqB,CAAC,OAAO,EAAE,YAAY;;;;;CAkBlD"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/wallet/server.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,kBAAkB,EAA2B,MAAM,mBAAmB,CAAC;AAGrG,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,cAAc;IAC5C,OAAa,MAAM,CACjB,IAAI,EAAE,SAAS,EACf,iBAAiB,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,EACtC,OAAO,GAAE,kBAAoC,GAC5C,OAAO,CAAC,UAAU,CAAC,CAOrB;IAED,oBAAoB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAQnF;IAED,mBAAmB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAOrF;IAED,mBAAmB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAOrF;IAED;;;;;OAKG;IACG,qBAAqB,CAAC,OAAO,EAAE,YAAY;;;;OAsBhD;CACF"}
@@ -1,6 +1,7 @@
1
1
  import { EcdsaKAccountContract, EcdsaRAccountContract } from '@aztec/accounts/ecdsa';
2
2
  import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
3
3
  import { StubAccountContractArtifact, createStubAccount } from '@aztec/accounts/stub';
4
+ import { SignerlessAccount } from '@aztec/aztec.js/account';
4
5
  import { getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
5
6
  import { Fr } from '@aztec/aztec.js/fields';
6
7
  import { createPXE, getPXEConfig } from '@aztec/pxe/server';
@@ -46,15 +47,25 @@ import { BaseTestWallet } from './test_wallet.js';
46
47
  };
47
48
  return this.createAccount(accountData);
48
49
  }
49
- async getFakeAccountDataFor(address) {
50
- const chainInfo = await this.getChainInfo();
50
+ /**
51
+ * Creates a stub account that impersonates the given address, allowing kernelless simulations
52
+ * to bypass the account's authorization mechanisms via contract overrides.
53
+ * @param address - The address of the account to impersonate
54
+ * @returns The stub account, contract instance, and artifact for simulation
55
+ */ async getFakeAccountDataFor(address) {
51
56
  const originalAccount = await this.getAccountFromAddress(address);
57
+ // Account contracts can only be overridden if they have an associated address
58
+ // Overwriting SignerlessAccount is not supported, and does not really make sense
59
+ // since it has no authorization mechanism.
60
+ if (originalAccount instanceof SignerlessAccount) {
61
+ throw new Error(`Cannot create fake account data for SignerlessAccount at address: ${address}`);
62
+ }
52
63
  const originalAddress = originalAccount.getCompleteAddress();
53
- const { contractInstance } = await this.pxe.getContractMetadata(originalAddress.address);
64
+ const contractInstance = await this.pxe.getContractInstance(originalAddress.address);
54
65
  if (!contractInstance) {
55
66
  throw new Error(`No contract instance found for address: ${originalAddress.address}`);
56
67
  }
57
- const stubAccount = createStubAccount(originalAddress, chainInfo);
68
+ const stubAccount = createStubAccount(originalAddress);
58
69
  const instance = await getContractInstanceFromInstantiationParams(StubAccountContractArtifact, {
59
70
  salt: Fr.random()
60
71
  });
@@ -1,15 +1,15 @@
1
1
  import type { ContractArtifact } from '@aztec/aztec.js/abi';
2
2
  import { type Account, type AccountContract } from '@aztec/aztec.js/account';
3
3
  import { type CallIntent, type ContractFunctionInteractionCallIntent, type IntentInnerHash, SetPublicAuthwitContractInteraction } from '@aztec/aztec.js/authorization';
4
- import { BaseWallet, type SendOptions, type SimulateOptions } from '@aztec/aztec.js/wallet';
5
- import { AccountManager } from '@aztec/aztec.js/wallet';
6
- import { ExecutionPayload } from '@aztec/entrypoints/payload';
7
- import { Fq, Fr } from '@aztec/foundation/fields';
4
+ import { AccountManager, type SendOptions, type SimulateOptions } from '@aztec/aztec.js/wallet';
5
+ import { Fq, Fr } from '@aztec/foundation/curves/bn254';
8
6
  import { AuthWitness } from '@aztec/stdlib/auth-witness';
9
7
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
10
8
  import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
11
- import type { NotesFilter, UniqueNote } from '@aztec/stdlib/note';
9
+ import type { NoteDao, NotesFilter } from '@aztec/stdlib/note';
12
10
  import type { TxSimulationResult } from '@aztec/stdlib/tx';
11
+ import { ExecutionPayload } from '@aztec/stdlib/tx';
12
+ import { BaseWallet } from '@aztec/wallet-sdk/base-wallet';
13
13
  import { ProvenTx } from '../utils.js';
14
14
  /**
15
15
  * Data for generating an account.
@@ -55,7 +55,7 @@ export declare abstract class BaseTestWallet extends BaseWallet {
55
55
  enableSimulatedSimulations(): void;
56
56
  /** Disable the "simulated simulation" path for simulateTx. */
57
57
  disableSimulatedSimulations(): void;
58
- setBaseFeePadding(value?: number): void;
58
+ setMinFeePadding(value?: number): void;
59
59
  protected getAccountFromAddress(address: AztecAddress): Promise<Account>;
60
60
  getAccounts(): Promise<{
61
61
  alias: string;
@@ -96,15 +96,21 @@ export declare abstract class BaseTestWallet extends BaseWallet {
96
96
  * @param messageHashOrIntent - The action to authorize/revoke
97
97
  * @param authorized - Whether the action can be performed or not
98
98
  */
99
- setPublicAuthWit(from: AztecAddress, messageHashOrIntent: Fr | Buffer | IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent, authorized: boolean): Promise<SetPublicAuthwitContractInteraction>;
99
+ setPublicAuthWit(from: AztecAddress, messageHashOrIntent: Fr | IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent, authorized: boolean): Promise<SetPublicAuthwitContractInteraction>;
100
100
  /**
101
101
  * Creates and returns an authwit according the the rules
102
102
  * of the provided account. This authwit can be verified
103
103
  * by the account contract
104
104
  * @param from - The address authorizing the action
105
- * @param messageHashOrIntent - The action to authorize
105
+ * @param intent - The action to authorize
106
+ */
107
+ createAuthWit(from: AztecAddress, intent: IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent): Promise<AuthWitness>;
108
+ /**
109
+ * Creates a stub account that impersonates the given address, allowing kernelless simulations
110
+ * to bypass the account's authorization mechanisms via contract overrides.
111
+ * @param address - The address of the account to impersonate
112
+ * @returns The stub account, contract instance, and artifact for simulation
106
113
  */
107
- createAuthWit(from: AztecAddress, messageHashOrIntent: Fr | Buffer | IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent): Promise<AuthWitness>;
108
114
  abstract getFakeAccountDataFor(address: AztecAddress): Promise<{
109
115
  account: Account;
110
116
  instance: ContractInstanceWithAddress;
@@ -132,7 +138,7 @@ export declare abstract class BaseTestWallet extends BaseWallet {
132
138
  * @param filter - The filter to apply to the notes.
133
139
  * @returns The requested notes.
134
140
  */
135
- getNotes(filter: NotesFilter): Promise<UniqueNote[]>;
141
+ getNotes(filter: NotesFilter): Promise<NoteDao[]>;
136
142
  /**
137
143
  * Stops the internal job queue.
138
144
  *
@@ -140,4 +146,4 @@ export declare abstract class BaseTestWallet extends BaseWallet {
140
146
  */
141
147
  stop(): Promise<void>;
142
148
  }
143
- //# sourceMappingURL=test_wallet.d.ts.map
149
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdF93YWxsZXQuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy93YWxsZXQvdGVzdF93YWxsZXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUM1RCxPQUFPLEVBQUUsS0FBSyxPQUFPLEVBQUUsS0FBSyxlQUFlLEVBQXFCLE1BQU0seUJBQXlCLENBQUM7QUFDaEcsT0FBTyxFQUNMLEtBQUssVUFBVSxFQUNmLEtBQUsscUNBQXFDLEVBQzFDLEtBQUssZUFBZSxFQUNwQixtQ0FBbUMsRUFJcEMsTUFBTSwrQkFBK0IsQ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GAAG,OAAO,CAAC,kBAAkB,CAAC,CA6BhH;IAED;;;;;;;;OAQG;IACG,OAAO,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAU1E;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAEhD;IAED;;;;OAIG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAEpB;CACF"}
@@ -1,11 +1,12 @@
1
1
  import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
2
2
  import { SignerlessAccount } from '@aztec/aztec.js/account';
3
- import { SetPublicAuthwitContractInteraction, getMessageHashFromIntent, lookupValidity } from '@aztec/aztec.js/authorization';
4
- import { BaseWallet } from '@aztec/aztec.js/wallet';
3
+ import { SetPublicAuthwitContractInteraction, computeInnerAuthWitHashFromAction, isContractFunctionInteractionCallIntent, lookupValidity } from '@aztec/aztec.js/authorization';
5
4
  import { AccountManager } from '@aztec/aztec.js/wallet';
6
- import { mergeExecutionPayloads } from '@aztec/entrypoints/payload';
7
- import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';
5
+ import { Fr } from '@aztec/foundation/curves/bn254';
6
+ import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
8
7
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
8
+ import { mergeExecutionPayloads } from '@aztec/stdlib/tx';
9
+ import { BaseWallet } from '@aztec/wallet-sdk/base-wallet';
9
10
  import { ProvenTx } from '../utils.js';
10
11
  /**
11
12
  * Wallet implementation that stores accounts in memory and allows allows their creation
@@ -34,21 +35,20 @@ import { ProvenTx } from '../utils.js';
34
35
  /** Disable the "simulated simulation" path for simulateTx. */ disableSimulatedSimulations() {
35
36
  this.simulatedSimulations = false;
36
37
  }
37
- setBaseFeePadding(value) {
38
- this.baseFeePadding = value ?? 0.5;
38
+ setMinFeePadding(value) {
39
+ this.minFeePadding = value ?? 0.5;
39
40
  }
40
- async getAccountFromAddress(address) {
41
+ getAccountFromAddress(address) {
41
42
  let account;
42
43
  if (address.equals(AztecAddress.ZERO)) {
43
- const chainInfo = await this.getChainInfo();
44
- account = new SignerlessAccount(chainInfo);
44
+ account = new SignerlessAccount();
45
45
  } else {
46
46
  account = this.accounts.get(address?.toString() ?? '');
47
47
  }
48
48
  if (!account) {
49
49
  throw new Error(`Account not found in wallet for address: ${address}`);
50
50
  }
51
- return account;
51
+ return Promise.resolve(account);
52
52
  }
53
53
  getAccounts() {
54
54
  return Promise.resolve(Array.from(this.accounts.values()).map((acc)=>({
@@ -102,18 +102,28 @@ import { ProvenTx } from '../utils.js';
102
102
  * of the provided account. This authwit can be verified
103
103
  * by the account contract
104
104
  * @param from - The address authorizing the action
105
- * @param messageHashOrIntent - The action to authorize
106
- */ async createAuthWit(from, messageHashOrIntent) {
105
+ * @param intent - The action to authorize
106
+ */ async createAuthWit(from, intent) {
107
107
  const account = await this.getAccountFromAddress(from);
108
108
  const chainInfo = await this.getChainInfo();
109
- const messageHash = await getMessageHashFromIntent(messageHashOrIntent, chainInfo);
110
- return account.createAuthWit(messageHash);
109
+ let intentInnerHash;
110
+ if ('caller' in intent) {
111
+ const call = isContractFunctionInteractionCallIntent(intent) ? await intent.action.getFunctionCall() : intent.call;
112
+ const innerHash = await computeInnerAuthWitHashFromAction(intent.caller, call);
113
+ intentInnerHash = {
114
+ innerHash,
115
+ consumer: call.to
116
+ };
117
+ } else {
118
+ intentInnerHash = intent;
119
+ }
120
+ return account.createAuthWit(intentInnerHash, chainInfo);
111
121
  }
112
122
  async simulateTx(executionPayload, opts) {
113
123
  if (!this.simulatedSimulations) {
114
124
  return super.simulateTx(executionPayload, opts);
115
125
  } else {
116
- const feeOptions = opts.fee?.estimateGas ? await this.getFeeOptionsForGasEstimation(opts.from, opts.fee) : await this.getDefaultFeeOptions(opts.from, opts.fee);
126
+ 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);
117
127
  const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
118
128
  const executionOptions = {
119
129
  txNonce: Fr.random(),
@@ -125,7 +135,8 @@ import { ProvenTx } from '../utils.js';
125
135
  executionPayload
126
136
  ]) : executionPayload;
127
137
  const { account: fromAccount, instance, artifact } = await this.getFakeAccountDataFor(opts.from);
128
- const txRequest = await fromAccount.createTxExecutionRequest(finalExecutionPayload, feeOptions.gasSettings, executionOptions);
138
+ const chainInfo = await this.getChainInfo();
139
+ const txRequest = await fromAccount.createTxExecutionRequest(finalExecutionPayload, feeOptions.gasSettings, chainInfo, executionOptions);
129
140
  const contractOverrides = {
130
141
  [opts.from.toString()]: {
131
142
  instance,
@@ -146,7 +157,7 @@ import { ProvenTx } from '../utils.js';
146
157
  * @param opts - The options to configure the interaction
147
158
  * @returns - A proven tx ready to be sent to the network
148
159
  */ async proveTx(exec, opts) {
149
- const fee = await this.getDefaultFeeOptions(opts.from, opts.fee);
160
+ const fee = await this.completeFeeOptions(opts.from, exec.feePayer, opts.fee?.gasSettings);
150
161
  const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(exec, opts.from, fee);
151
162
  const txProvingResult = await this.pxe.proveTx(txRequest);
152
163
  return new ProvenTx(this.aztecNode, await txProvingResult.toTx(), txProvingResult.getOffchainEffects(), txProvingResult.stats);
@@ -162,7 +173,7 @@ import { ProvenTx } from '../utils.js';
162
173
  * @param filter - The filter to apply to the notes.
163
174
  * @returns The requested notes.
164
175
  */ getNotes(filter) {
165
- return this.pxe.getNotes(filter);
176
+ return this.pxe.debug.getNotes(filter);
166
177
  }
167
178
  /**
168
179
  * Stops the internal job queue.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aztec/test-wallet",
3
3
  "homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/test-wallet",
4
- "version": "0.0.1-commit.24de95ac",
4
+ "version": "0.0.1-commit.3469e52",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  "./client/bundle": "./dest/bundle.js",
@@ -15,9 +15,9 @@
15
15
  "tsconfig": "./tsconfig.json"
16
16
  },
17
17
  "scripts": {
18
- "build": "yarn clean && tsc -b",
19
- "build:dev": "tsc -b --watch",
20
- "build:ts": "tsc -b",
18
+ "build": "yarn clean && ../scripts/tsc.sh",
19
+ "build:dev": "../scripts/tsc.sh --watch",
20
+ "build:ts": "../scripts/tsc.sh",
21
21
  "clean": "rm -rf ./dest .tsbuildinfo",
22
22
  "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
23
23
  },
@@ -62,19 +62,22 @@
62
62
  ]
63
63
  },
64
64
  "dependencies": {
65
- "@aztec/accounts": "0.0.1-commit.24de95ac",
66
- "@aztec/aztec.js": "0.0.1-commit.24de95ac",
67
- "@aztec/entrypoints": "0.0.1-commit.24de95ac",
68
- "@aztec/foundation": "0.0.1-commit.24de95ac",
69
- "@aztec/noir-contracts.js": "0.0.1-commit.24de95ac",
70
- "@aztec/pxe": "0.0.1-commit.24de95ac",
71
- "@aztec/stdlib": "0.0.1-commit.24de95ac"
65
+ "@aztec/accounts": "0.0.1-commit.3469e52",
66
+ "@aztec/aztec.js": "0.0.1-commit.3469e52",
67
+ "@aztec/entrypoints": "0.0.1-commit.3469e52",
68
+ "@aztec/foundation": "0.0.1-commit.3469e52",
69
+ "@aztec/noir-contracts.js": "0.0.1-commit.3469e52",
70
+ "@aztec/pxe": "0.0.1-commit.3469e52",
71
+ "@aztec/stdlib": "0.0.1-commit.3469e52",
72
+ "@aztec/wallet-sdk": "0.0.1-commit.3469e52"
72
73
  },
73
74
  "devDependencies": {
74
75
  "@jest/globals": "^30.0.0",
75
76
  "@types/jest": "^30.0.0",
76
77
  "@types/node": "^22.15.17",
78
+ "@typescript/native-preview": "7.0.0-dev.20260113.1",
77
79
  "jest": "^30.0.0",
80
+ "jest-mock-extended": "^4.0.0",
78
81
  "resolve-typescript-plugin": "^2.0.1",
79
82
  "ts-loader": "^9.5.4",
80
83
  "ts-node": "^10.9.1",
package/src/bundle.ts CHANGED
@@ -2,7 +2,7 @@ export { TestWallet } from './wallet/bundle.js';
2
2
  export { type AccountData } from './wallet/test_wallet.js';
3
3
  export {
4
4
  deployFundedSchnorrAccounts,
5
- registerInitialSandboxAccountsInWallet,
5
+ registerInitialLocalNetworkAccountsInWallet,
6
6
  ProvenTx,
7
7
  proveInteraction,
8
8
  } from './utils.js';
package/src/lazy.ts CHANGED
@@ -2,7 +2,7 @@ export { TestWallet } from './wallet/lazy.js';
2
2
  export { type AccountData } from './wallet/test_wallet.js';
3
3
  export {
4
4
  deployFundedSchnorrAccounts,
5
- registerInitialSandboxAccountsInWallet,
5
+ registerInitialLocalNetworkAccountsInWallet,
6
6
  ProvenTx,
7
7
  proveInteraction,
8
8
  } from './utils.js';
package/src/server.ts CHANGED
@@ -2,7 +2,7 @@ export { TestWallet } from './wallet/server.js';
2
2
  export { type AccountData } from './wallet/test_wallet.js';
3
3
  export {
4
4
  deployFundedSchnorrAccounts,
5
- registerInitialSandboxAccountsInWallet,
5
+ registerInitialLocalNetworkAccountsInWallet,
6
6
  ProvenTx,
7
7
  proveInteraction,
8
8
  } from './utils.js';
package/src/utils.ts CHANGED
@@ -43,11 +43,11 @@ export async function deployFundedSchnorrAccounts(
43
43
  }
44
44
 
45
45
  /**
46
- * Registers the initial sandbox accounts in the wallet.
46
+ * Registers the initial local network accounts in the wallet.
47
47
  * @param wallet - Test wallet to use to register the accounts.
48
48
  * @returns Addresses of the registered accounts.
49
49
  */
50
- export async function registerInitialSandboxAccountsInWallet(wallet: BaseTestWallet): Promise<AztecAddress[]> {
50
+ export async function registerInitialLocalNetworkAccountsInWallet(wallet: BaseTestWallet): Promise<AztecAddress[]> {
51
51
  const testAccounts = await getInitialTestAccountsData();
52
52
  return Promise.all(
53
53
  testAccounts.map(async account => {
@@ -97,5 +97,5 @@ export async function proveInteraction(
97
97
  } else {
98
98
  execPayload = await interaction.request(options);
99
99
  }
100
- return wallet.proveTx(execPayload, await toSendOptions(options));
100
+ return wallet.proveTx(execPayload, toSendOptions(options));
101
101
  }
@@ -1,6 +1,7 @@
1
1
  import { EcdsaKAccountContract, EcdsaRAccountContract } from '@aztec/accounts/ecdsa';
2
2
  import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
3
3
  import { StubAccountContractArtifact, createStubAccount } from '@aztec/accounts/stub';
4
+ import { type Account, SignerlessAccount } from '@aztec/aztec.js/account';
4
5
  import type { AztecAddress } from '@aztec/aztec.js/addresses';
5
6
  import { getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
6
7
  import { Fq, Fr } from '@aztec/aztec.js/fields';
@@ -58,15 +59,26 @@ export class TestWallet extends BaseTestWallet {
58
59
  return this.createAccount(accountData);
59
60
  }
60
61
 
62
+ /**
63
+ * Creates a stub account that impersonates the given address, allowing kernelless simulations
64
+ * to bypass the account's authorization mechanisms via contract overrides.
65
+ * @param address - The address of the account to impersonate
66
+ * @returns The stub account, contract instance, and artifact for simulation
67
+ */
61
68
  async getFakeAccountDataFor(address: AztecAddress) {
62
- const chainInfo = await this.getChainInfo();
63
69
  const originalAccount = await this.getAccountFromAddress(address);
64
- const originalAddress = originalAccount.getCompleteAddress();
65
- const { contractInstance } = await this.pxe.getContractMetadata(originalAddress.address);
70
+ // Account contracts can only be overridden if they have an associated address
71
+ // Overwriting SignerlessAccount is not supported, and does not really make sense
72
+ // since it has no authorization mechanism.
73
+ if (originalAccount instanceof SignerlessAccount) {
74
+ throw new Error(`Cannot create fake account data for SignerlessAccount at address: ${address}`);
75
+ }
76
+ const originalAddress = (originalAccount as Account).getCompleteAddress();
77
+ const contractInstance = await this.pxe.getContractInstance(originalAddress.address);
66
78
  if (!contractInstance) {
67
79
  throw new Error(`No contract instance found for address: ${originalAddress.address}`);
68
80
  }
69
- const stubAccount = createStubAccount(originalAddress, chainInfo);
81
+ const stubAccount = createStubAccount(originalAddress);
70
82
  const instance = await getContractInstanceFromInstantiationParams(StubAccountContractArtifact, {
71
83
  salt: Fr.random(),
72
84
  });
@@ -1,6 +1,7 @@
1
1
  import { EcdsaKAccountContract, EcdsaRAccountContract } from '@aztec/accounts/ecdsa/lazy';
2
2
  import { SchnorrAccountContract } from '@aztec/accounts/schnorr/lazy';
3
3
  import { createStubAccount, getStubAccountContractArtifact } from '@aztec/accounts/stub/lazy';
4
+ import { type Account, SignerlessAccount } from '@aztec/aztec.js/account';
4
5
  import type { AztecAddress } from '@aztec/aztec.js/addresses';
5
6
  import { getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
6
7
  import { Fq, Fr } from '@aztec/aztec.js/fields';
@@ -58,15 +59,26 @@ export class TestWallet extends BaseTestWallet {
58
59
  return this.createAccount(accountData);
59
60
  }
60
61
 
62
+ /**
63
+ * Creates a stub account that impersonates the given address, allowing kernelless simulations
64
+ * to bypass the account's authorization mechanisms via contract overrides.
65
+ * @param address - The address of the account to impersonate
66
+ * @returns The stub account, contract instance, and artifact for simulation
67
+ */
61
68
  async getFakeAccountDataFor(address: AztecAddress) {
62
- const chainInfo = await this.getChainInfo();
63
69
  const originalAccount = await this.getAccountFromAddress(address);
64
- const originalAddress = originalAccount.getCompleteAddress();
65
- const { contractInstance } = await this.pxe.getContractMetadata(originalAddress.address);
70
+ // Account contracts can only be overridden if they have an associated address
71
+ // Overwriting SignerlessAccount is not supported, and does not really make sense
72
+ // since it has no authorization mechanism.
73
+ if (originalAccount instanceof SignerlessAccount) {
74
+ throw new Error(`Cannot create fake account data for SignerlessAccount at address: ${address}`);
75
+ }
76
+ const originalAddress = (originalAccount as Account).getCompleteAddress();
77
+ const contractInstance = await this.pxe.getContractInstance(originalAddress.address);
66
78
  if (!contractInstance) {
67
79
  throw new Error(`No contract instance found for address: ${originalAddress.address}`);
68
80
  }
69
- const stubAccount = createStubAccount(originalAddress, chainInfo);
81
+ const stubAccount = createStubAccount(originalAddress);
70
82
  const StubAccountContractArtifact = await getStubAccountContractArtifact();
71
83
  const instance = await getContractInstanceFromInstantiationParams(StubAccountContractArtifact, {
72
84
  salt: Fr.random(),
@@ -1,6 +1,7 @@
1
1
  import { EcdsaKAccountContract, EcdsaRAccountContract } from '@aztec/accounts/ecdsa';
2
2
  import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
3
3
  import { StubAccountContractArtifact, createStubAccount } from '@aztec/accounts/stub';
4
+ import { type Account, SignerlessAccount } from '@aztec/aztec.js/account';
4
5
  import type { AztecAddress } from '@aztec/aztec.js/addresses';
5
6
  import { getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
6
7
  import { Fq, Fr } from '@aztec/aztec.js/fields';
@@ -58,15 +59,26 @@ export class TestWallet extends BaseTestWallet {
58
59
  return this.createAccount(accountData);
59
60
  }
60
61
 
62
+ /**
63
+ * Creates a stub account that impersonates the given address, allowing kernelless simulations
64
+ * to bypass the account's authorization mechanisms via contract overrides.
65
+ * @param address - The address of the account to impersonate
66
+ * @returns The stub account, contract instance, and artifact for simulation
67
+ */
61
68
  async getFakeAccountDataFor(address: AztecAddress) {
62
- const chainInfo = await this.getChainInfo();
63
69
  const originalAccount = await this.getAccountFromAddress(address);
64
- const originalAddress = originalAccount.getCompleteAddress();
65
- const { contractInstance } = await this.pxe.getContractMetadata(originalAddress.address);
70
+ // Account contracts can only be overridden if they have an associated address
71
+ // Overwriting SignerlessAccount is not supported, and does not really make sense
72
+ // since it has no authorization mechanism.
73
+ if (originalAccount instanceof SignerlessAccount) {
74
+ throw new Error(`Cannot create fake account data for SignerlessAccount at address: ${address}`);
75
+ }
76
+ const originalAddress = (originalAccount as Account).getCompleteAddress();
77
+ const contractInstance = await this.pxe.getContractInstance(originalAddress.address);
66
78
  if (!contractInstance) {
67
79
  throw new Error(`No contract instance found for address: ${originalAddress.address}`);
68
80
  }
69
- const stubAccount = createStubAccount(originalAddress, chainInfo);
81
+ const stubAccount = createStubAccount(originalAddress);
70
82
  const instance = await getContractInstanceFromInstantiationParams(StubAccountContractArtifact, {
71
83
  salt: Fr.random(),
72
84
  });
@@ -6,19 +6,21 @@ import {
6
6
  type ContractFunctionInteractionCallIntent,
7
7
  type IntentInnerHash,
8
8
  SetPublicAuthwitContractInteraction,
9
- getMessageHashFromIntent,
9
+ computeInnerAuthWitHashFromAction,
10
+ isContractFunctionInteractionCallIntent,
10
11
  lookupValidity,
11
12
  } from '@aztec/aztec.js/authorization';
12
- import { BaseWallet, type SendOptions, type SimulateOptions } from '@aztec/aztec.js/wallet';
13
- import { AccountManager } from '@aztec/aztec.js/wallet';
13
+ import { AccountManager, type SendOptions, type SimulateOptions } from '@aztec/aztec.js/wallet';
14
14
  import type { DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
15
- import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/entrypoints/payload';
16
- import { Fq, Fr, GrumpkinScalar } from '@aztec/foundation/fields';
15
+ import { Fq, Fr } from '@aztec/foundation/curves/bn254';
16
+ import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
17
17
  import { AuthWitness } from '@aztec/stdlib/auth-witness';
18
18
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
19
19
  import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
20
- import type { NotesFilter, UniqueNote } from '@aztec/stdlib/note';
20
+ import type { NoteDao, NotesFilter } from '@aztec/stdlib/note';
21
21
  import type { TxSimulationResult } from '@aztec/stdlib/tx';
22
+ import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/stdlib/tx';
23
+ import { BaseWallet } from '@aztec/wallet-sdk/base-wallet';
22
24
 
23
25
  import { ProvenTx } from '../utils.js';
24
26
 
@@ -75,15 +77,14 @@ export abstract class BaseTestWallet extends BaseWallet {
75
77
  this.simulatedSimulations = false;
76
78
  }
77
79
 
78
- setBaseFeePadding(value?: number) {
79
- this.baseFeePadding = value ?? 0.5;
80
+ setMinFeePadding(value?: number) {
81
+ this.minFeePadding = value ?? 0.5;
80
82
  }
81
83
 
82
- protected async getAccountFromAddress(address: AztecAddress): Promise<Account> {
84
+ protected getAccountFromAddress(address: AztecAddress): Promise<Account> {
83
85
  let account: Account | undefined;
84
86
  if (address.equals(AztecAddress.ZERO)) {
85
- const chainInfo = await this.getChainInfo();
86
- account = new SignerlessAccount(chainInfo);
87
+ account = new SignerlessAccount();
87
88
  } else {
88
89
  account = this.accounts.get(address?.toString() ?? '');
89
90
  }
@@ -92,7 +93,7 @@ export abstract class BaseTestWallet extends BaseWallet {
92
93
  throw new Error(`Account not found in wallet for address: ${address}`);
93
94
  }
94
95
 
95
- return account;
96
+ return Promise.resolve(account);
96
97
  }
97
98
 
98
99
  getAccounts() {
@@ -162,7 +163,7 @@ export abstract class BaseTestWallet extends BaseWallet {
162
163
  */
163
164
  public setPublicAuthWit(
164
165
  from: AztecAddress,
165
- messageHashOrIntent: Fr | Buffer | IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent,
166
+ messageHashOrIntent: Fr | IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent,
166
167
  authorized: boolean,
167
168
  ): Promise<SetPublicAuthwitContractInteraction> {
168
169
  return SetPublicAuthwitContractInteraction.create(this, from, messageHashOrIntent, authorized);
@@ -173,18 +174,33 @@ export abstract class BaseTestWallet extends BaseWallet {
173
174
  * of the provided account. This authwit can be verified
174
175
  * by the account contract
175
176
  * @param from - The address authorizing the action
176
- * @param messageHashOrIntent - The action to authorize
177
+ * @param intent - The action to authorize
177
178
  */
178
179
  public override async createAuthWit(
179
180
  from: AztecAddress,
180
- messageHashOrIntent: Fr | Buffer | IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent,
181
+ intent: IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent,
181
182
  ): Promise<AuthWitness> {
182
183
  const account = await this.getAccountFromAddress(from);
183
184
  const chainInfo = await this.getChainInfo();
184
- const messageHash = await getMessageHashFromIntent(messageHashOrIntent, chainInfo);
185
- return account.createAuthWit(messageHash);
185
+ let intentInnerHash: IntentInnerHash;
186
+ if ('caller' in intent) {
187
+ const call = isContractFunctionInteractionCallIntent(intent)
188
+ ? await intent.action.getFunctionCall()
189
+ : intent.call;
190
+ const innerHash = await computeInnerAuthWitHashFromAction(intent.caller, call);
191
+ intentInnerHash = { innerHash, consumer: call.to };
192
+ } else {
193
+ intentInnerHash = intent;
194
+ }
195
+ return account.createAuthWit(intentInnerHash, chainInfo);
186
196
  }
187
197
 
198
+ /**
199
+ * Creates a stub account that impersonates the given address, allowing kernelless simulations
200
+ * to bypass the account's authorization mechanisms via contract overrides.
201
+ * @param address - The address of the account to impersonate
202
+ * @returns The stub account, contract instance, and artifact for simulation
203
+ */
188
204
  abstract getFakeAccountDataFor(
189
205
  address: AztecAddress, // eslint-disable-next-line jsdoc/require-jsdoc
190
206
  ): Promise<{ account: Account; instance: ContractInstanceWithAddress; artifact: ContractArtifact }>;
@@ -194,8 +210,8 @@ export abstract class BaseTestWallet extends BaseWallet {
194
210
  return super.simulateTx(executionPayload, opts);
195
211
  } else {
196
212
  const feeOptions = opts.fee?.estimateGas
197
- ? await this.getFeeOptionsForGasEstimation(opts.from, opts.fee)
198
- : await this.getDefaultFeeOptions(opts.from, opts.fee);
213
+ ? await this.completeFeeOptionsForEstimation(opts.from, executionPayload.feePayer, opts.fee?.gasSettings)
214
+ : await this.completeFeeOptions(opts.from, executionPayload.feePayer, opts.fee?.gasSettings);
199
215
  const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
200
216
  const executionOptions: DefaultAccountEntrypointOptions = {
201
217
  txNonce: Fr.random(),
@@ -206,9 +222,11 @@ export abstract class BaseTestWallet extends BaseWallet {
206
222
  ? mergeExecutionPayloads([feeExecutionPayload, executionPayload])
207
223
  : executionPayload;
208
224
  const { account: fromAccount, instance, artifact } = await this.getFakeAccountDataFor(opts.from);
225
+ const chainInfo = await this.getChainInfo();
209
226
  const txRequest = await fromAccount.createTxExecutionRequest(
210
227
  finalExecutionPayload,
211
228
  feeOptions.gasSettings,
229
+ chainInfo,
212
230
  executionOptions,
213
231
  );
214
232
  const contractOverrides = {
@@ -228,7 +246,7 @@ export abstract class BaseTestWallet extends BaseWallet {
228
246
  * @returns - A proven tx ready to be sent to the network
229
247
  */
230
248
  async proveTx(exec: ExecutionPayload, opts: SendOptions): Promise<ProvenTx> {
231
- const fee = await this.getDefaultFeeOptions(opts.from, opts.fee);
249
+ const fee = await this.completeFeeOptions(opts.from, exec.feePayer, opts.fee?.gasSettings);
232
250
  const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(exec, opts.from, fee);
233
251
  const txProvingResult = await this.pxe.proveTx(txRequest);
234
252
  return new ProvenTx(
@@ -250,8 +268,8 @@ export abstract class BaseTestWallet extends BaseWallet {
250
268
  * @param filter - The filter to apply to the notes.
251
269
  * @returns The requested notes.
252
270
  */
253
- getNotes(filter: NotesFilter): Promise<UniqueNote[]> {
254
- return this.pxe.getNotes(filter);
271
+ getNotes(filter: NotesFilter): Promise<NoteDao[]> {
272
+ return this.pxe.debug.getNotes(filter);
255
273
  }
256
274
 
257
275
  /**