@aztec/accounts 4.0.0-nightly.20250907 → 4.0.0-nightly.20260108

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 (122) hide show
  1. package/README.md +1 -1
  2. package/artifacts/EcdsaKAccount.json +3200 -3634
  3. package/artifacts/EcdsaRAccount.json +3200 -3634
  4. package/artifacts/SchnorrAccount.json +3215 -3822
  5. package/artifacts/SchnorrSingleKeyAccount.json +2555 -2634
  6. package/artifacts/SimulatedAccount.json +2108 -2330
  7. package/dest/defaults/account_contract.d.ts +4 -4
  8. package/dest/defaults/account_contract.d.ts.map +1 -1
  9. package/dest/defaults/account_contract.js +2 -2
  10. package/dest/defaults/account_interface.d.ts +8 -8
  11. package/dest/defaults/account_interface.d.ts.map +1 -1
  12. package/dest/defaults/account_interface.js +6 -7
  13. package/dest/defaults/index.d.ts +2 -2
  14. package/dest/defaults/index.js +1 -1
  15. package/dest/ecdsa/ecdsa_k/account_contract.d.ts +1 -1
  16. package/dest/ecdsa/ecdsa_k/account_contract.d.ts.map +1 -1
  17. package/dest/ecdsa/ecdsa_k/account_contract.js +1 -1
  18. package/dest/ecdsa/ecdsa_k/index.d.ts +1 -23
  19. package/dest/ecdsa/ecdsa_k/index.d.ts.map +1 -1
  20. package/dest/ecdsa/ecdsa_k/index.js +1 -22
  21. package/dest/ecdsa/ecdsa_k/lazy.d.ts +1 -23
  22. package/dest/ecdsa/ecdsa_k/lazy.d.ts.map +1 -1
  23. package/dest/ecdsa/ecdsa_k/lazy.js +5 -26
  24. package/dest/ecdsa/ecdsa_r/account_contract.d.ts +1 -1
  25. package/dest/ecdsa/ecdsa_r/account_contract.d.ts.map +1 -1
  26. package/dest/ecdsa/ecdsa_r/account_contract.js +1 -1
  27. package/dest/ecdsa/ecdsa_r/index.d.ts +1 -23
  28. package/dest/ecdsa/ecdsa_r/index.d.ts.map +1 -1
  29. package/dest/ecdsa/ecdsa_r/index.js +1 -22
  30. package/dest/ecdsa/ecdsa_r/lazy.d.ts +1 -23
  31. package/dest/ecdsa/ecdsa_r/lazy.d.ts.map +1 -1
  32. package/dest/ecdsa/ecdsa_r/lazy.js +5 -26
  33. package/dest/ecdsa/index.d.ts +1 -1
  34. package/dest/ecdsa/lazy.d.ts +1 -1
  35. package/dest/ecdsa/ssh_ecdsa_r/account_contract.d.ts +1 -1
  36. package/dest/ecdsa/ssh_ecdsa_r/account_contract.d.ts.map +1 -1
  37. package/dest/ecdsa/ssh_ecdsa_r/account_contract.js +1 -1
  38. package/dest/ecdsa/ssh_ecdsa_r/index.d.ts +2 -24
  39. package/dest/ecdsa/ssh_ecdsa_r/index.d.ts.map +1 -1
  40. package/dest/ecdsa/ssh_ecdsa_r/index.js +3 -24
  41. package/dest/ecdsa/ssh_ecdsa_r/lazy.d.ts +2 -24
  42. package/dest/ecdsa/ssh_ecdsa_r/lazy.d.ts.map +1 -1
  43. package/dest/ecdsa/ssh_ecdsa_r/lazy.js +3 -24
  44. package/dest/schnorr/account_contract.d.ts +3 -2
  45. package/dest/schnorr/account_contract.d.ts.map +1 -1
  46. package/dest/schnorr/account_contract.js +1 -1
  47. package/dest/schnorr/index.d.ts +4 -38
  48. package/dest/schnorr/index.d.ts.map +1 -1
  49. package/dest/schnorr/index.js +1 -32
  50. package/dest/schnorr/lazy.d.ts +4 -38
  51. package/dest/schnorr/lazy.d.ts.map +1 -1
  52. package/dest/schnorr/lazy.js +5 -36
  53. package/dest/single_key/account_contract.d.ts +2 -2
  54. package/dest/single_key/account_contract.d.ts.map +1 -1
  55. package/dest/single_key/account_contract.js +1 -1
  56. package/dest/single_key/index.d.ts +2 -21
  57. package/dest/single_key/index.d.ts.map +1 -1
  58. package/dest/single_key/index.js +1 -23
  59. package/dest/single_key/lazy.d.ts +2 -21
  60. package/dest/single_key/lazy.d.ts.map +1 -1
  61. package/dest/single_key/lazy.js +5 -27
  62. package/dest/stub/account_contract.d.ts +29 -0
  63. package/dest/stub/account_contract.d.ts.map +1 -0
  64. package/dest/stub/account_contract.js +30 -0
  65. package/dest/stub/index.d.ts +21 -0
  66. package/dest/stub/index.d.ts.map +1 -0
  67. package/dest/stub/index.js +29 -0
  68. package/dest/stub/lazy.d.ts +23 -0
  69. package/dest/stub/lazy.d.ts.map +1 -0
  70. package/dest/stub/lazy.js +35 -0
  71. package/dest/testing/configuration.d.ts +5 -4
  72. package/dest/testing/configuration.d.ts.map +1 -1
  73. package/dest/testing/configuration.js +1 -1
  74. package/dest/testing/index.d.ts +6 -36
  75. package/dest/testing/index.d.ts.map +1 -1
  76. package/dest/testing/index.js +19 -35
  77. package/dest/testing/lazy.d.ts +5 -28
  78. package/dest/testing/lazy.d.ts.map +1 -1
  79. package/dest/testing/lazy.js +19 -30
  80. package/dest/utils/index.d.ts +1 -1
  81. package/dest/utils/ssh_agent.d.ts +1 -1
  82. package/package.json +13 -10
  83. package/src/defaults/account_contract.ts +4 -4
  84. package/src/defaults/account_interface.ts +13 -14
  85. package/src/defaults/index.ts +1 -1
  86. package/src/ecdsa/ecdsa_k/account_contract.ts +2 -2
  87. package/src/ecdsa/ecdsa_k/index.ts +0 -32
  88. package/src/ecdsa/ecdsa_k/lazy.ts +4 -36
  89. package/src/ecdsa/ecdsa_r/account_contract.ts +2 -2
  90. package/src/ecdsa/ecdsa_r/index.ts +0 -32
  91. package/src/ecdsa/ecdsa_r/lazy.ts +4 -36
  92. package/src/ecdsa/ssh_ecdsa_r/account_contract.ts +2 -2
  93. package/src/ecdsa/ssh_ecdsa_r/index.ts +2 -35
  94. package/src/ecdsa/ssh_ecdsa_r/lazy.ts +2 -35
  95. package/src/schnorr/account_contract.ts +3 -2
  96. package/src/schnorr/index.ts +9 -56
  97. package/src/schnorr/lazy.ts +13 -60
  98. package/src/single_key/account_contract.ts +3 -2
  99. package/src/single_key/index.ts +1 -32
  100. package/src/single_key/lazy.ts +5 -36
  101. package/src/stub/account_contract.ts +39 -0
  102. package/src/stub/index.ts +41 -0
  103. package/src/stub/lazy.ts +49 -0
  104. package/src/testing/configuration.ts +2 -1
  105. package/src/testing/index.ts +20 -57
  106. package/src/testing/lazy.ts +18 -50
  107. package/dest/copy_cat/base.d.ts +0 -18
  108. package/dest/copy_cat/base.d.ts.map +0 -1
  109. package/dest/copy_cat/base.js +0 -28
  110. package/dest/copy_cat/index.d.ts +0 -10
  111. package/dest/copy_cat/index.d.ts.map +0 -1
  112. package/dest/copy_cat/index.js +0 -31
  113. package/dest/copy_cat/lazy.d.ts +0 -9
  114. package/dest/copy_cat/lazy.d.ts.map +0 -1
  115. package/dest/copy_cat/lazy.js +0 -29
  116. package/dest/testing/create_account.d.ts +0 -43
  117. package/dest/testing/create_account.d.ts.map +0 -1
  118. package/dest/testing/create_account.js +0 -61
  119. package/src/copy_cat/base.ts +0 -47
  120. package/src/copy_cat/index.ts +0 -44
  121. package/src/copy_cat/lazy.ts +0 -40
  122. package/src/testing/create_account.ts +0 -111
@@ -0,0 +1,29 @@
1
+ import type { AuthWitnessProvider } from '@aztec/aztec.js/account';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
+ import { AuthWitness } from '@aztec/stdlib/auth-witness';
4
+ import { CompleteAddress } from '@aztec/stdlib/contract';
5
+ import { DefaultAccountContract } from '../defaults/account_contract.js';
6
+ /**
7
+ * An Account contract that does not perform any authentication of authwits
8
+ * (`is_valid` always returns `true`)
9
+ * It is used to capture authorization data during simulations
10
+ */
11
+ export declare abstract class StubBaseAccountContract extends DefaultAccountContract {
12
+ constructor();
13
+ getInitializationFunctionAndArgs(): Promise<{
14
+ constructorName: string;
15
+ constructorArgs: never[];
16
+ }>;
17
+ getAuthWitnessProvider(_address: CompleteAddress): AuthWitnessProvider;
18
+ }
19
+ /** Creates auth witnesses using Stub signatures. */
20
+ export declare class StubAuthWitnessProvider implements AuthWitnessProvider {
21
+ constructor();
22
+ /**
23
+ * A fake account always returns an empty authwitness, since it doesn't
24
+ * perform any verification whatsoever
25
+ * @param messageHash - The outer hash of the message for which the auth witness is created
26
+ */
27
+ createAuthWit(messageHash: Fr): Promise<AuthWitness>;
28
+ }
29
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNjb3VudF9jb250cmFjdC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3N0dWIvYWNjb3VudF9jb250cmFjdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxtQkFBbUIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQ25FLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sNEJBQTRCLENBQUM7QUFDekQsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBRXpELE9BQU8sRUFBRSxzQkFBc0IsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBRXpFOzs7O0dBSUc7QUFDSCw4QkFBc0IsdUJBQXdCLFNBQVEsc0JBQXNCO0lBQzFFLGNBRUM7SUFFRCxnQ0FBZ0M7OztPQUUvQjtJQUVELHNCQUFzQixDQUFDLFFBQVEsRUFBRSxlQUFlLEdBQUcsbUJBQW1CLENBRXJFO0NBQ0Y7QUFFRCxvREFBb0Q7QUFDcEQscUJBQWEsdUJBQXdCLFlBQVcsbUJBQW1CO0lBQ2pFLGNBQWdCO0lBRWhCOzs7O09BSUc7SUFDSCxhQUFhLENBQUMsV0FBVyxFQUFFLEVBQUUsR0FBRyxPQUFPLENBQUMsV0FBVyxDQUFDLENBRW5EO0NBQ0YifQ==
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account_contract.d.ts","sourceRoot":"","sources":["../../src/stub/account_contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE;;;;GAIG;AACH,8BAAsB,uBAAwB,SAAQ,sBAAsB;IAC1E,cAEC;IAED,gCAAgC;;;OAE/B;IAED,sBAAsB,CAAC,QAAQ,EAAE,eAAe,GAAG,mBAAmB,CAErE;CACF;AAED,oDAAoD;AACpD,qBAAa,uBAAwB,YAAW,mBAAmB;IACjE,cAAgB;IAEhB;;;;OAIG;IACH,aAAa,CAAC,WAAW,EAAE,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAEnD;CACF"}
@@ -0,0 +1,30 @@
1
+ import { AuthWitness } from '@aztec/stdlib/auth-witness';
2
+ import { DefaultAccountContract } from '../defaults/account_contract.js';
3
+ /**
4
+ * An Account contract that does not perform any authentication of authwits
5
+ * (`is_valid` always returns `true`)
6
+ * It is used to capture authorization data during simulations
7
+ */ export class StubBaseAccountContract extends DefaultAccountContract {
8
+ constructor(){
9
+ super();
10
+ }
11
+ getInitializationFunctionAndArgs() {
12
+ return Promise.resolve({
13
+ constructorName: 'constructor',
14
+ constructorArgs: []
15
+ });
16
+ }
17
+ getAuthWitnessProvider(_address) {
18
+ return new StubAuthWitnessProvider();
19
+ }
20
+ }
21
+ /** Creates auth witnesses using Stub signatures. */ export class StubAuthWitnessProvider {
22
+ constructor(){}
23
+ /**
24
+ * A fake account always returns an empty authwitness, since it doesn't
25
+ * perform any verification whatsoever
26
+ * @param messageHash - The outer hash of the message for which the auth witness is created
27
+ */ createAuthWit(messageHash) {
28
+ return Promise.resolve(new AuthWitness(messageHash, []));
29
+ }
30
+ }
@@ -0,0 +1,21 @@
1
+ import { BaseAccount, type ChainInfo } from '@aztec/aztec.js/account';
2
+ import type { CompleteAddress } from '@aztec/aztec.js/addresses';
3
+ import type { ContractArtifact } from '@aztec/stdlib/abi';
4
+ import { StubBaseAccountContract } from './account_contract.js';
5
+ export declare const StubAccountContractArtifact: ContractArtifact;
6
+ /**
7
+ * Stub account contract
8
+ * Eagerly loads the contract artifact
9
+ */
10
+ export declare class StubAccountContract extends StubBaseAccountContract {
11
+ constructor();
12
+ getContractArtifact(): Promise<ContractArtifact>;
13
+ }
14
+ /**
15
+ * Creates a stub account that impersonates the one with the provided originalAddress.
16
+ * @param originalAddress - The address of the account to stub
17
+ * @param chainInfo - The chain info that the account is connected to
18
+ * @returns A stub account that can be used for kernelless simulations
19
+ */
20
+ export declare function createStubAccount(originalAddress: CompleteAddress, chainInfo: ChainInfo): BaseAccount;
21
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdHViL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsS0FBSyxTQUFTLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUN0RSxPQUFPLEtBQUssRUFBRSxlQUFlLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUNqRSxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBTTFELE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBRWhFLGVBQU8sTUFBTSwyQkFBMkIsa0JBQXlFLENBQUM7QUFFbEg7OztHQUdHO0FBQ0gscUJBQWEsbUJBQW9CLFNBQVEsdUJBQXVCO0lBQzlELGNBRUM7SUFFUSxtQkFBbUIsSUFBSSxPQUFPLENBQUMsZ0JBQWdCLENBQUMsQ0FFeEQ7Q0FDRjtBQUVEOzs7OztHQUtHO0FBQ0gsd0JBQWdCLGlCQUFpQixDQUFDLGVBQWUsRUFBRSxlQUFlLEVBQUUsU0FBUyxFQUFFLFNBQVMsZUFRdkYifQ==
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stub/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAM1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,eAAO,MAAM,2BAA2B,kBAAyE,CAAC;AAElH;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,uBAAuB;IAC9D,cAEC;IAEQ,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAExD;CACF;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,eAAe,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,eAQvF"}
@@ -0,0 +1,29 @@
1
+ import { BaseAccount } from '@aztec/aztec.js/account';
2
+ import { loadContractArtifact } from '@aztec/stdlib/abi';
3
+ import SimulatedAccountContract from '../../artifacts/SimulatedAccount.json' with {
4
+ type: 'json'
5
+ };
6
+ import { DefaultAccountInterface } from '../defaults/account_interface.js';
7
+ import { StubBaseAccountContract } from './account_contract.js';
8
+ export const StubAccountContractArtifact = loadContractArtifact(SimulatedAccountContract);
9
+ /**
10
+ * Stub account contract
11
+ * Eagerly loads the contract artifact
12
+ */ export class StubAccountContract extends StubBaseAccountContract {
13
+ constructor(){
14
+ super();
15
+ }
16
+ getContractArtifact() {
17
+ return Promise.resolve(StubAccountContractArtifact);
18
+ }
19
+ }
20
+ /**
21
+ * Creates a stub account that impersonates the one with the provided originalAddress.
22
+ * @param originalAddress - The address of the account to stub
23
+ * @param chainInfo - The chain info that the account is connected to
24
+ * @returns A stub account that can be used for kernelless simulations
25
+ */ export function createStubAccount(originalAddress, chainInfo) {
26
+ const accountContract = new StubAccountContract();
27
+ const accountInterface = new DefaultAccountInterface(accountContract.getAuthWitnessProvider(originalAddress), originalAddress, chainInfo);
28
+ return new BaseAccount(accountInterface);
29
+ }
@@ -0,0 +1,23 @@
1
+ import { BaseAccount, type ChainInfo } from '@aztec/aztec.js/account';
2
+ import type { CompleteAddress } from '@aztec/aztec.js/addresses';
3
+ import type { ContractArtifact } from '@aztec/stdlib/abi';
4
+ import { StubBaseAccountContract } from './account_contract.js';
5
+ /**
6
+ * Lazily loads the contract artifact
7
+ * @returns The contract artifact for the Stub account contract
8
+ */
9
+ export declare function getStubAccountContractArtifact(): Promise<ContractArtifact>;
10
+ /**
11
+ * Account contract that authenticates transactions using Stub signatures
12
+ * verified against a Grumpkin public key stored in an immutable encrypted note.
13
+ * Lazily loads the contract artifact
14
+ */
15
+ export declare class StubAccountContract extends StubBaseAccountContract {
16
+ constructor();
17
+ getContractArtifact(): Promise<ContractArtifact>;
18
+ }
19
+ /**
20
+ *
21
+ */
22
+ export declare function createStubAccount(originalAddress: CompleteAddress, chainInfo: ChainInfo): BaseAccount;
23
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3N0dWIvbGF6eS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsV0FBVyxFQUFFLEtBQUssU0FBUyxFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDdEUsT0FBTyxLQUFLLEVBQUUsZUFBZSxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFDakUsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUkxRCxPQUFPLEVBQUUsdUJBQXVCLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUVoRTs7O0dBR0c7QUFDSCx3QkFBc0IsOEJBQThCLDhCQVFuRDtBQUVEOzs7O0dBSUc7QUFDSCxxQkFBYSxtQkFBb0IsU0FBUSx1QkFBdUI7SUFDOUQsY0FFQztJQUVRLG1CQUFtQixJQUFJLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxDQUV4RDtDQUNGO0FBRUQ7O0dBRUc7QUFDSCx3QkFBZ0IsaUJBQWlCLENBQUMsZUFBZSxFQUFFLGVBQWUsRUFBRSxTQUFTLEVBQUUsU0FBUyxlQVF2RiJ9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/stub/lazy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAI1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;;GAGG;AACH,wBAAsB,8BAA8B,8BAQnD;AAED;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,uBAAuB;IAC9D,cAEC;IAEQ,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAExD;CACF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,eAAe,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,eAQvF"}
@@ -0,0 +1,35 @@
1
+ import { BaseAccount } from '@aztec/aztec.js/account';
2
+ import { loadContractArtifact } from '@aztec/stdlib/abi';
3
+ import { DefaultAccountInterface } from '../defaults/account_interface.js';
4
+ import { StubBaseAccountContract } from './account_contract.js';
5
+ /**
6
+ * Lazily loads the contract artifact
7
+ * @returns The contract artifact for the Stub account contract
8
+ */ export async function getStubAccountContractArtifact() {
9
+ // Cannot assert this import as it's incompatible with bundlers like vite
10
+ // https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
11
+ // Even if now supported by al major browsers, the MIME type is replaced with
12
+ // "text/javascript"
13
+ // In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
14
+ const { default: StubAccountContractJson } = await import('../../artifacts/SimulatedAccount.json');
15
+ return loadContractArtifact(StubAccountContractJson);
16
+ }
17
+ /**
18
+ * Account contract that authenticates transactions using Stub signatures
19
+ * verified against a Grumpkin public key stored in an immutable encrypted note.
20
+ * Lazily loads the contract artifact
21
+ */ export class StubAccountContract extends StubBaseAccountContract {
22
+ constructor(){
23
+ super();
24
+ }
25
+ getContractArtifact() {
26
+ return getStubAccountContractArtifact();
27
+ }
28
+ }
29
+ /**
30
+ *
31
+ */ export function createStubAccount(originalAddress, chainInfo) {
32
+ const accountContract = new StubAccountContract();
33
+ const accountInterface = new DefaultAccountInterface(accountContract.getAuthWitnessProvider(originalAddress), originalAddress, chainInfo);
34
+ return new BaseAccount(accountInterface);
35
+ }
@@ -1,8 +1,9 @@
1
- import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
+ import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
2
3
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
3
4
  export declare const INITIAL_TEST_SECRET_KEYS: Fr[];
4
- export declare const INITIAL_TEST_ENCRYPTION_KEYS: import("@aztec/foundation/fields").Fq[];
5
- export declare const INITIAL_TEST_SIGNING_KEYS: import("@aztec/foundation/fields").Fq[];
5
+ export declare const INITIAL_TEST_ENCRYPTION_KEYS: import("@aztec/foundation/curves/bn254").Fq[];
6
+ export declare const INITIAL_TEST_SIGNING_KEYS: import("@aztec/foundation/curves/bn254").Fq[];
6
7
  export declare const INITIAL_TEST_ACCOUNT_SALTS: Fr[];
7
8
  /**
8
9
  * Data for generating an initial account.
@@ -25,4 +26,4 @@ export interface InitialAccountData {
25
26
  */
26
27
  address: AztecAddress;
27
28
  }
28
- //# sourceMappingURL=configuration.d.ts.map
29
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJhdGlvbi5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Rlc3RpbmcvY29uZmlndXJhdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDcEQsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLG1DQUFtQyxDQUFDO0FBQ25FLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBR2hFLGVBQU8sTUFBTSx3QkFBd0IsTUFJcEMsQ0FBQztBQUVGLGVBQU8sTUFBTSw0QkFBNEIsK0NBRXhDLENBQUM7QUFFRixlQUFPLE1BQU0seUJBQXlCLCtDQUErQixDQUFDO0FBRXRFLGVBQU8sTUFBTSwwQkFBMEIsTUFBOEIsQ0FBQztBQUV0RTs7R0FFRztBQUNILE1BQU0sV0FBVyxrQkFBa0I7SUFDakM7O09BRUc7SUFDSCxNQUFNLEVBQUUsRUFBRSxDQUFDO0lBQ1g7O09BRUc7SUFDSCxVQUFVLEVBQUUsY0FBYyxDQUFDO0lBQzNCOztPQUVHO0lBQ0gsSUFBSSxFQUFFLEVBQUUsQ0FBQztJQUNUOztPQUVHO0lBQ0gsT0FBTyxFQUFFLFlBQVksQ0FBQztDQUN2QiJ9
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../src/testing/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,eAAO,MAAM,wBAAwB,MAIpC,CAAC;AAEF,eAAO,MAAM,4BAA4B,yCAExC,CAAC;AAEF,eAAO,MAAM,yBAAyB,yCAA+B,CAAC;AAEtE,eAAO,MAAM,0BAA0B,MAA8B,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,MAAM,EAAE,EAAE,CAAC;IACX;;OAEG;IACH,UAAU,EAAE,cAAc,CAAC;IAC3B;;OAEG;IACH,IAAI,EAAE,EAAE,CAAC;IACT;;OAEG;IACH,OAAO,EAAE,YAAY,CAAC;CACvB"}
1
+ {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../src/testing/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,eAAO,MAAM,wBAAwB,MAIpC,CAAC;AAEF,eAAO,MAAM,4BAA4B,+CAExC,CAAC;AAEF,eAAO,MAAM,yBAAyB,+CAA+B,CAAC;AAEtE,eAAO,MAAM,0BAA0B,MAA8B,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,MAAM,EAAE,EAAE,CAAC;IACX;;OAEG;IACH,UAAU,EAAE,cAAc,CAAC;IAC3B;;OAEG;IACH,IAAI,EAAE,EAAE,CAAC;IACT;;OAEG;IACH,OAAO,EAAE,YAAY,CAAC;CACvB"}
@@ -1,4 +1,4 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import { deriveMasterIncomingViewingSecretKey } from '@aztec/stdlib/keys';
3
3
  export const INITIAL_TEST_SECRET_KEYS = [
4
4
  Fr.fromHexString('2153536ff6628eee01cf4024889ff977a18d9fa61d0e414422f7681cf085c281'),
@@ -1,41 +1,11 @@
1
- /**
2
- * The `@aztec/accounts/testing` export provides utility methods for testing, in particular in a Sandbox environment.
3
- *
4
- * Use {@link getInitialTestAccountsWallets} to obtain a list of wallets for the Sandbox pre-seeded accounts.
5
- *
6
- * @packageDocumentation
7
- */
8
- import { AccountManager, type PXE } from '@aztec/aztec.js';
9
- import type { AccountWalletWithSecretKey } from '@aztec/aztec.js/wallet';
10
- import type { InitialAccountData } from './configuration.js';
11
- export { type InitialAccountData, INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_SECRET_KEYS, INITIAL_TEST_SIGNING_KEYS, } from './configuration.js';
1
+ import { type InitialAccountData } from './configuration.js';
2
+ export { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_SECRET_KEYS, INITIAL_TEST_SIGNING_KEYS, type InitialAccountData, } from './configuration.js';
12
3
  /**
13
4
  * Gets the basic information for initial test accounts.
14
5
  */
15
- export declare function getInitialTestAccounts(): Promise<InitialAccountData[]>;
16
- /**
17
- * Gets a collection of account managers for the Aztec accounts that are initially stored in the test environment.
18
- * @param pxe - PXE instance.
19
- * @returns A set of AccountManager implementations for each of the initial accounts.
20
- */
21
- export declare function getInitialTestAccountsManagers(pxe: PXE): Promise<AccountManager[]>;
22
- /**
23
- * Gets a collection of wallets for the Aztec accounts that are initially stored in the test environment.
24
- * @param pxe - PXE instance.
25
- * @returns A set of AccountWallet implementations for each of the initial accounts.
26
- */
27
- export declare function getInitialTestAccountsWallets(pxe: PXE): Promise<AccountWalletWithSecretKey[]>;
28
- /**
29
- * Queries a PXE for it's registered accounts.
30
- * @param pxe - PXE instance.
31
- * @returns A set of key data for each of the initial accounts.
32
- */
33
- export declare function getDeployedTestAccounts(pxe: PXE): Promise<InitialAccountData[]>;
6
+ export declare function getInitialTestAccountsData(): Promise<InitialAccountData[]>;
34
7
  /**
35
- * Queries a PXE for it's registered accounts and returns wallets for those accounts using keys in the initial test accounts.
36
- * @param pxe - PXE instance.
37
- * @returns A set of AccountWallet implementations for each of the initial accounts.
8
+ * Generate a fixed amount of random schnorr account contract instance.
38
9
  */
39
- export declare function getDeployedTestAccountsWallets(pxe: PXE): Promise<AccountWalletWithSecretKey[]>;
40
- export { deployFundedSchnorrAccount, deployFundedSchnorrAccounts, generateSchnorrAccounts } from './create_account.js';
41
- //# sourceMappingURL=index.d.ts.map
10
+ export declare function generateSchnorrAccounts(numberOfAccounts: number): Promise<Promise<InitialAccountData[]>>;
11
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0aW5nL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVNBLE9BQU8sRUFLTCxLQUFLLGtCQUFrQixFQUN4QixNQUFNLG9CQUFvQixDQUFDO0FBRTVCLE9BQU8sRUFDTCwwQkFBMEIsRUFDMUIsNEJBQTRCLEVBQzVCLHdCQUF3QixFQUN4Qix5QkFBeUIsRUFDekIsS0FBSyxrQkFBa0IsR0FDeEIsTUFBTSxvQkFBb0IsQ0FBQztBQUU1Qjs7R0FFRztBQUNILHdCQUFnQiwwQkFBMEIsSUFBSSxPQUFPLENBQUMsa0JBQWtCLEVBQUUsQ0FBQyxDQWExRTtBQUVEOztHQUVHO0FBQ0gsd0JBQXNCLHVCQUF1QixDQUFDLGdCQUFnQixFQUFFLE1BQU0sR0FBRyxPQUFPLENBQUMsT0FBTyxDQUFDLGtCQUFrQixFQUFFLENBQUMsQ0FBQyxDQWE5RyJ9
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,cAAc,EAAE,KAAK,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAOzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAQ7D,OAAO,EACL,KAAK,kBAAkB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAatE;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAMlF;AAED;;;;GAIG;AACH,wBAAsB,6BAA6B,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAInG;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAIrF;AAED;;;;GAIG;AACH,wBAAsB,8BAA8B,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAKpG;AAED,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AASA,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,EAC5B,wBAAwB,EACxB,yBAAyB,EACzB,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAa1E;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAa9G"}
@@ -1,15 +1,15 @@
1
1
  /**
2
- * The `@aztec/accounts/testing` export provides utility methods for testing, in particular in a Sandbox environment.
3
- *
4
- * Use {@link getInitialTestAccountsWallets} to obtain a list of wallets for the Sandbox pre-seeded accounts.
2
+ * The `@aztec/accounts/testing` export provides utility methods for testing, in particular in a local network environment.
5
3
  *
6
4
  * @packageDocumentation
7
- */ import { getSchnorrAccount, getSchnorrAccountContractAddress, getSchnorrWalletWithSecretKey } from '../schnorr/index.js';
5
+ */ import { Fr } from '@aztec/aztec.js/fields';
6
+ import { deriveSigningKey } from '@aztec/stdlib/keys';
7
+ import { getSchnorrAccountContractAddress } from '../schnorr/index.js';
8
8
  import { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_SECRET_KEYS, INITIAL_TEST_SIGNING_KEYS } from './configuration.js';
9
9
  export { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_SECRET_KEYS, INITIAL_TEST_SIGNING_KEYS } from './configuration.js';
10
10
  /**
11
11
  * Gets the basic information for initial test accounts.
12
- */ export function getInitialTestAccounts() {
12
+ */ export function getInitialTestAccountsData() {
13
13
  return Promise.all(INITIAL_TEST_SECRET_KEYS.map(async (secret, i)=>({
14
14
  secret,
15
15
  signingKey: INITIAL_TEST_ENCRYPTION_KEYS[i],
@@ -18,34 +18,18 @@ export { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_
18
18
  })));
19
19
  }
20
20
  /**
21
- * Gets a collection of account managers for the Aztec accounts that are initially stored in the test environment.
22
- * @param pxe - PXE instance.
23
- * @returns A set of AccountManager implementations for each of the initial accounts.
24
- */ export function getInitialTestAccountsManagers(pxe) {
25
- return Promise.all(INITIAL_TEST_SECRET_KEYS.map((encryptionKey, i)=>getSchnorrAccount(pxe, encryptionKey, INITIAL_TEST_SIGNING_KEYS[i], INITIAL_TEST_ACCOUNT_SALTS[i])));
26
- }
27
- /**
28
- * Gets a collection of wallets for the Aztec accounts that are initially stored in the test environment.
29
- * @param pxe - PXE instance.
30
- * @returns A set of AccountWallet implementations for each of the initial accounts.
31
- */ export async function getInitialTestAccountsWallets(pxe) {
32
- return Promise.all((await Promise.all(await getInitialTestAccountsManagers(pxe))).map((accountManager)=>accountManager.getWallet()));
33
- }
34
- /**
35
- * Queries a PXE for it's registered accounts.
36
- * @param pxe - PXE instance.
37
- * @returns A set of key data for each of the initial accounts.
38
- */ export async function getDeployedTestAccounts(pxe) {
39
- const registeredAccounts = await pxe.getRegisteredAccounts();
40
- const testAccounts = await getInitialTestAccounts();
41
- return testAccounts.filter((t)=>registeredAccounts.some((r)=>r.address.equals(t.address)));
42
- }
43
- /**
44
- * Queries a PXE for it's registered accounts and returns wallets for those accounts using keys in the initial test accounts.
45
- * @param pxe - PXE instance.
46
- * @returns A set of AccountWallet implementations for each of the initial accounts.
47
- */ export async function getDeployedTestAccountsWallets(pxe) {
48
- const testAccounts = await getDeployedTestAccounts(pxe);
49
- return Promise.all(testAccounts.map(({ secret, signingKey, salt })=>getSchnorrWalletWithSecretKey(pxe, secret, signingKey, salt)));
21
+ * Generate a fixed amount of random schnorr account contract instance.
22
+ */ export async function generateSchnorrAccounts(numberOfAccounts) {
23
+ const secrets = Array.from({
24
+ length: numberOfAccounts
25
+ }, ()=>Fr.random());
26
+ return await Promise.all(secrets.map(async (secret)=>{
27
+ const salt = Fr.random();
28
+ return {
29
+ secret,
30
+ signingKey: deriveSigningKey(secret),
31
+ salt,
32
+ address: await getSchnorrAccountContractAddress(secret, salt)
33
+ };
34
+ }));
50
35
  }
51
- export { deployFundedSchnorrAccount, deployFundedSchnorrAccounts, generateSchnorrAccounts } from './create_account.js';
@@ -1,34 +1,11 @@
1
- /**
2
- * The `@aztec/accounts/testing/lazy` export provides utility methods for testing, in particular in a Sandbox environment.
3
- *
4
- * Use {@link getInitialTestAccountsWallets} to obtain a list of wallets for the Sandbox pre-seeded accounts.
5
- *
6
- * @packageDocumentation
7
- */
8
- import type { PXE } from '@aztec/aztec.js';
9
- import type { AccountWalletWithSecretKey } from '@aztec/aztec.js/wallet';
10
1
  import { type InitialAccountData } from './configuration.js';
11
- export { type InitialAccountData, INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_SECRET_KEYS, INITIAL_TEST_SIGNING_KEYS, } from './configuration.js';
2
+ export { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_SECRET_KEYS } from './configuration.js';
12
3
  /**
13
4
  * Gets the basic information for initial test accounts.
14
5
  */
15
- export declare function getInitialTestAccounts(): Promise<InitialAccountData[]>;
16
- /**
17
- * Gets a collection of wallets for the Aztec accounts that are initially stored in the test environment.
18
- * @param pxe - PXE instance.
19
- * @returns A set of AccountWallet implementations for each of the initial accounts.
20
- */
21
- export declare function getInitialTestAccountsWallets(pxe: PXE): Promise<AccountWalletWithSecretKey[]>;
22
- /**
23
- * Queries a PXE for it's registered accounts.
24
- * @param pxe - PXE instance.
25
- * @returns A set of key data for each of the initial accounts.
26
- */
27
- export declare function getDeployedTestAccounts(pxe: PXE): Promise<InitialAccountData[]>;
6
+ export declare function getInitialTestAccountsData(): Promise<InitialAccountData[]>;
28
7
  /**
29
- * Queries a PXE for it's registered accounts and returns wallets for those accounts using keys in the initial test accounts.
30
- * @param pxe - PXE instance.
31
- * @returns A set of AccountWallet implementations for each of the initial accounts.
8
+ * Generate a fixed amount of random schnorr account contract instance.
32
9
  */
33
- export declare function getDeployedTestAccountsWallets(pxe: PXE): Promise<AccountWalletWithSecretKey[]>;
34
- //# sourceMappingURL=lazy.d.ts.map
10
+ export declare function generateSchnorrAccounts(numberOfAccounts: number): Promise<InitialAccountData[]>;
11
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Rlc3RpbmcvbGF6eS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFTQSxPQUFPLEVBS0wsS0FBSyxrQkFBa0IsRUFDeEIsTUFBTSxvQkFBb0IsQ0FBQztBQUU1QixPQUFPLEVBQUUsMEJBQTBCLEVBQUUsd0JBQXdCLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUUxRjs7R0FFRztBQUNILHdCQUFnQiwwQkFBMEIsSUFBSSxPQUFPLENBQUMsa0JBQWtCLEVBQUUsQ0FBQyxDQWExRTtBQUVEOztHQUVHO0FBQ0gsd0JBQXNCLHVCQUF1QixDQUFDLGdCQUFnQixFQUFFLE1BQU0sR0FBRyxPQUFPLENBQUMsa0JBQWtCLEVBQUUsQ0FBQyxDQWFyRyJ9
@@ -1 +1 @@
1
- {"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/testing/lazy.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAGzE,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,KAAK,kBAAkB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAatE;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAY7F;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAIrF;AAED;;;;GAIG;AACH,wBAAsB,8BAA8B,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAKpG"}
1
+ {"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/testing/lazy.ts"],"names":[],"mappings":"AASA,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE1F;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAa1E;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAarG"}
@@ -1,15 +1,15 @@
1
1
  /**
2
- * The `@aztec/accounts/testing/lazy` export provides utility methods for testing, in particular in a Sandbox environment.
3
- *
4
- * Use {@link getInitialTestAccountsWallets} to obtain a list of wallets for the Sandbox pre-seeded accounts.
2
+ * The `@aztec/accounts/testing/lazy` export provides utility methods for testing, in particular in a local network environment.
5
3
  *
6
4
  * @packageDocumentation
7
- */ import { getSchnorrAccount, getSchnorrAccountContractAddress, getSchnorrWalletWithSecretKey } from '../schnorr/lazy.js';
5
+ */ import { Fr } from '@aztec/aztec.js/fields';
6
+ import { deriveSigningKey } from '@aztec/stdlib/keys';
7
+ import { getSchnorrAccountContractAddress } from '../schnorr/lazy.js';
8
8
  import { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_SECRET_KEYS, INITIAL_TEST_SIGNING_KEYS } from './configuration.js';
9
- export { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_SECRET_KEYS, INITIAL_TEST_SIGNING_KEYS } from './configuration.js';
9
+ export { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_SECRET_KEYS } from './configuration.js';
10
10
  /**
11
11
  * Gets the basic information for initial test accounts.
12
- */ export function getInitialTestAccounts() {
12
+ */ export function getInitialTestAccountsData() {
13
13
  return Promise.all(INITIAL_TEST_SECRET_KEYS.map(async (secret, i)=>({
14
14
  secret,
15
15
  signingKey: INITIAL_TEST_ENCRYPTION_KEYS[i],
@@ -18,29 +18,18 @@ export { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_
18
18
  })));
19
19
  }
20
20
  /**
21
- * Gets a collection of wallets for the Aztec accounts that are initially stored in the test environment.
22
- * @param pxe - PXE instance.
23
- * @returns A set of AccountWallet implementations for each of the initial accounts.
24
- */ export function getInitialTestAccountsWallets(pxe) {
25
- return Promise.all(INITIAL_TEST_SECRET_KEYS.map(async (encryptionKey, i)=>{
26
- const account = await getSchnorrAccount(pxe, encryptionKey, INITIAL_TEST_SIGNING_KEYS[i], INITIAL_TEST_ACCOUNT_SALTS[i]);
27
- return account.getWallet();
21
+ * Generate a fixed amount of random schnorr account contract instance.
22
+ */ export async function generateSchnorrAccounts(numberOfAccounts) {
23
+ const secrets = Array.from({
24
+ length: numberOfAccounts
25
+ }, ()=>Fr.random());
26
+ return await Promise.all(secrets.map(async (secret)=>{
27
+ const salt = Fr.random();
28
+ return {
29
+ secret,
30
+ signingKey: deriveSigningKey(secret),
31
+ salt,
32
+ address: await getSchnorrAccountContractAddress(secret, salt)
33
+ };
28
34
  }));
29
35
  }
30
- /**
31
- * Queries a PXE for it's registered accounts.
32
- * @param pxe - PXE instance.
33
- * @returns A set of key data for each of the initial accounts.
34
- */ export async function getDeployedTestAccounts(pxe) {
35
- const registeredAccounts = await pxe.getRegisteredAccounts();
36
- const testAccounts = await getInitialTestAccounts();
37
- return testAccounts.filter((t)=>registeredAccounts.some((r)=>r.address.equals(t.address)));
38
- }
39
- /**
40
- * Queries a PXE for it's registered accounts and returns wallets for those accounts using keys in the initial test accounts.
41
- * @param pxe - PXE instance.
42
- * @returns A set of AccountWallet implementations for each of the initial accounts.
43
- */ export async function getDeployedTestAccountsWallets(pxe) {
44
- const testAccounts = await getDeployedTestAccounts(pxe);
45
- return Promise.all(testAccounts.map(({ secret, signingKey, salt })=>getSchnorrWalletWithSecretKey(pxe, secret, signingKey, salt)));
46
- }
@@ -1,2 +1,2 @@
1
1
  export * from './ssh_agent.js';
2
- //# sourceMappingURL=index.d.ts.map
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGdCQUFnQixDQUFDIn0=
@@ -30,4 +30,4 @@ export declare function getIdentities(): Promise<StoredKey[]>;
30
30
  */
31
31
  export declare function signWithAgent(keyType: Buffer, curveName: Buffer, publicKey: Buffer, data: Buffer): Promise<Buffer<ArrayBufferLike>>;
32
32
  export {};
33
- //# sourceMappingURL=ssh_agent.d.ts.map
33
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3NoX2FnZW50LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvc3NoX2FnZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxRQUFRLENBQUM7QUFDaEMsT0FBTyxHQUFHLE1BQU0sS0FBSyxDQUFDO0FBT3RCOztHQUVHO0FBQ0gsd0JBQWdCLGNBQWMsZUFNN0I7QUFFRDs7R0FFRztBQUNILEtBQUssU0FBUyxHQUFHO0lBQ2Y7O09BRUc7SUFDSCxJQUFJLEVBQUUsTUFBTSxDQUFDO0lBQ2I7O09BRUc7SUFDSCxTQUFTLEVBQUUsTUFBTSxDQUFDO0lBQ2xCOztPQUVHO0lBQ0gsT0FBTyxFQUFFLE1BQU0sQ0FBQztDQUNqQixDQUFDO0FBRUY7O0dBRUc7QUFDSCx3QkFBZ0IsYUFBYSxJQUFJLE9BQU8sQ0FBQyxTQUFTLEVBQUUsQ0FBQyxDQWtEcEQ7QUFFRDs7R0FFRztBQUNILHdCQUFnQixhQUFhLENBQUMsT0FBTyxFQUFFLE1BQU0sRUFBRSxTQUFTLEVBQUUsTUFBTSxFQUFFLFNBQVMsRUFBRSxNQUFNLEVBQUUsSUFBSSxFQUFFLE1BQU0sb0NBd0NoRyJ9
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@aztec/accounts",
3
3
  "homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/accounts",
4
4
  "description": "Implementation of sample account contracts for Aztec Network",
5
- "version": "4.0.0-nightly.20250907",
5
+ "version": "4.0.0-nightly.20260108",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  "./defaults": "./dest/defaults/index.js",
@@ -12,6 +12,8 @@
12
12
  "./schnorr/lazy": "./dest/schnorr/lazy.js",
13
13
  "./single_key": "./dest/single_key/index.js",
14
14
  "./single_key/lazy": "./dest/single_key/lazy.js",
15
+ "./stub": "./dest/stub/index.js",
16
+ "./stub/lazy": "./dest/stub/lazy.js",
15
17
  "./testing": "./dest/testing/index.js",
16
18
  "./testing/lazy": "./dest/testing/lazy.js",
17
19
  "./copy-cat": "./dest/copy_cat/index.js",
@@ -30,11 +32,11 @@
30
32
  "tsconfig": "./tsconfig.json"
31
33
  },
32
34
  "scripts": {
33
- "build": "yarn clean && yarn generate && tsc -b",
35
+ "build": "yarn clean && yarn generate && ../scripts/tsc.sh",
34
36
  "generate": "yarn generate:noir-contracts",
35
37
  "generate:noir-contracts": "./scripts/copy-contracts.sh",
36
- "build:dev": "tsc -b --watch",
37
- "build:ts": "tsc -b",
38
+ "build:dev": "../scripts/tsc.sh --watch",
39
+ "build:ts": "tsgo -b",
38
40
  "clean": "rm -rf ./dest .tsbuildinfo ./artifacts",
39
41
  "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
40
42
  },
@@ -80,20 +82,21 @@
80
82
  ]
81
83
  },
82
84
  "dependencies": {
83
- "@aztec/aztec.js": "4.0.0-nightly.20250907",
84
- "@aztec/entrypoints": "4.0.0-nightly.20250907",
85
- "@aztec/ethereum": "4.0.0-nightly.20250907",
86
- "@aztec/foundation": "4.0.0-nightly.20250907",
87
- "@aztec/stdlib": "4.0.0-nightly.20250907",
85
+ "@aztec/aztec.js": "4.0.0-nightly.20260108",
86
+ "@aztec/entrypoints": "4.0.0-nightly.20260108",
87
+ "@aztec/ethereum": "4.0.0-nightly.20260108",
88
+ "@aztec/foundation": "4.0.0-nightly.20260108",
89
+ "@aztec/stdlib": "4.0.0-nightly.20260108",
88
90
  "tslib": "^2.4.0"
89
91
  },
90
92
  "devDependencies": {
91
93
  "@jest/globals": "^30.0.0",
92
94
  "@types/jest": "^30.0.0",
93
95
  "@types/node": "^22.15.17",
96
+ "@typescript/native-preview": "7.0.0-dev.20251126.1",
94
97
  "jest": "^30.0.0",
95
98
  "jest-mock-extended": "^4.0.0",
96
- "ts-loader": "^9.4.4",
99
+ "ts-loader": "^9.5.4",
97
100
  "ts-node": "^10.9.1",
98
101
  "typescript": "^5.3.3"
99
102
  },
@@ -1,6 +1,6 @@
1
- import type { AccountContract, AccountInterface, AuthWitnessProvider } from '@aztec/aztec.js/account';
1
+ import type { AccountContract, AccountInterface, AuthWitnessProvider, ChainInfo } from '@aztec/aztec.js/account';
2
2
  import type { ContractArtifact } from '@aztec/stdlib/abi';
3
- import type { CompleteAddress, NodeInfo } from '@aztec/stdlib/contract';
3
+ import type { CompleteAddress } from '@aztec/stdlib/contract';
4
4
 
5
5
  import { DefaultAccountInterface } from '../defaults/account_interface.js';
6
6
 
@@ -23,7 +23,7 @@ export abstract class DefaultAccountContract implements AccountContract {
23
23
 
24
24
  constructor() {}
25
25
 
26
- getInterface(address: CompleteAddress, nodeInfo: NodeInfo): AccountInterface {
27
- return new DefaultAccountInterface(this.getAuthWitnessProvider(address), address, nodeInfo);
26
+ getInterface(address: CompleteAddress, chainInfo: ChainInfo): AccountInterface {
27
+ return new DefaultAccountInterface(this.getAuthWitnessProvider(address), address, chainInfo);
28
28
  }
29
29
  }
@@ -1,13 +1,12 @@
1
1
  import type { AccountInterface, AuthWitnessProvider } from '@aztec/aztec.js/account';
2
- import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
3
- import type { EntrypointInterface, FeeOptions, TxExecutionOptions } from '@aztec/entrypoints/interfaces';
4
- import type { ExecutionPayload } from '@aztec/entrypoints/payload';
5
- import { Fr } from '@aztec/foundation/fields';
2
+ import { DefaultAccountEntrypoint, type DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
3
+ import type { ChainInfo, EntrypointInterface } from '@aztec/entrypoints/interfaces';
4
+ import { Fr } from '@aztec/foundation/curves/bn254';
6
5
  import type { AuthWitness } from '@aztec/stdlib/auth-witness';
7
6
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
8
7
  import { CompleteAddress } from '@aztec/stdlib/contract';
9
- import type { NodeInfo } from '@aztec/stdlib/contract';
10
- import type { TxExecutionRequest } from '@aztec/stdlib/tx';
8
+ import type { GasSettings } from '@aztec/stdlib/gas';
9
+ import type { ExecutionPayload, TxExecutionRequest } from '@aztec/stdlib/tx';
11
10
 
12
11
  /**
13
12
  * Default implementation for an account interface. Requires that the account uses the default
@@ -22,24 +21,24 @@ export class DefaultAccountInterface implements AccountInterface {
22
21
  constructor(
23
22
  private authWitnessProvider: AuthWitnessProvider,
24
23
  private address: CompleteAddress,
25
- nodeInfo: Pick<NodeInfo, 'l1ChainId' | 'rollupVersion'>,
24
+ chainInfo: ChainInfo,
26
25
  ) {
27
26
  this.entrypoint = new DefaultAccountEntrypoint(
28
27
  address.address,
29
28
  authWitnessProvider,
30
- nodeInfo.l1ChainId,
31
- nodeInfo.rollupVersion,
29
+ chainInfo.chainId.toNumber(),
30
+ chainInfo.version.toNumber(),
32
31
  );
33
- this.chainId = new Fr(nodeInfo.l1ChainId);
34
- this.version = new Fr(nodeInfo.rollupVersion);
32
+ this.chainId = chainInfo.chainId;
33
+ this.version = chainInfo.version;
35
34
  }
36
35
 
37
36
  createTxExecutionRequest(
38
37
  exec: ExecutionPayload,
39
- fee: FeeOptions,
40
- options: TxExecutionOptions,
38
+ gasSettings: GasSettings,
39
+ options: DefaultAccountEntrypointOptions,
41
40
  ): Promise<TxExecutionRequest> {
42
- return this.entrypoint.createTxExecutionRequest(exec, fee, options);
41
+ return this.entrypoint.createTxExecutionRequest(exec, gasSettings, options);
43
42
  }
44
43
 
45
44
  createAuthWit(messageHash: Fr): Promise<AuthWitness> {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The `@aztec/accounts/defaults` export provides the base class {@link DefaultAccountContract} for implementing account contracts that use the default entrypoint payload module.
3
3
  *
4
- * Read more in {@link https://docs.aztec.network/developers/tutorials/codealong/contract_tutorials/write_accounts_contract | Writing an account contract}.
4
+ * Read more in {@link https://docs.aztec.network/developers/tutorials/contract_tutorials/counter_contract | Writing an account contract}.
5
5
  *
6
6
  * @packageDocumentation
7
7
  */