@aztec/accounts 0.0.1-commit.24de95ac → 0.0.1-commit.2606882

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 (113) hide show
  1. package/README.md +1 -2
  2. package/artifacts/EcdsaKAccount.json +9226 -4542
  3. package/artifacts/EcdsaRAccount.json +9221 -4537
  4. package/artifacts/SchnorrAccount.json +9412 -4924
  5. package/artifacts/SimulatedEcdsaAccount.json +10122 -0
  6. package/artifacts/SimulatedSchnorrAccount.json +10214 -0
  7. package/dest/defaults/account_contract.d.ts +3 -3
  8. package/dest/defaults/account_contract.d.ts.map +1 -1
  9. package/dest/defaults/account_contract.js +5 -3
  10. package/dest/defaults/index.d.ts +1 -2
  11. package/dest/defaults/index.d.ts.map +1 -1
  12. package/dest/defaults/index.js +1 -2
  13. package/dest/ecdsa/ecdsa_k/account_contract.d.ts +2 -2
  14. package/dest/ecdsa/ecdsa_k/account_contract.d.ts.map +1 -1
  15. package/dest/ecdsa/ecdsa_k/account_contract.js +7 -3
  16. package/dest/ecdsa/ecdsa_k/index.d.ts +1 -1
  17. package/dest/ecdsa/ecdsa_k/index.d.ts.map +1 -1
  18. package/dest/ecdsa/ecdsa_k/lazy.d.ts +1 -1
  19. package/dest/ecdsa/ecdsa_k/lazy.d.ts.map +1 -1
  20. package/dest/ecdsa/ecdsa_r/account_contract.d.ts +2 -2
  21. package/dest/ecdsa/ecdsa_r/account_contract.d.ts.map +1 -1
  22. package/dest/ecdsa/ecdsa_r/account_contract.js +7 -3
  23. package/dest/ecdsa/ecdsa_r/index.d.ts +1 -1
  24. package/dest/ecdsa/ecdsa_r/index.d.ts.map +1 -1
  25. package/dest/ecdsa/ecdsa_r/lazy.d.ts +1 -1
  26. package/dest/ecdsa/ecdsa_r/lazy.d.ts.map +1 -1
  27. package/dest/ecdsa/index.d.ts +1 -1
  28. package/dest/ecdsa/lazy.d.ts +1 -1
  29. package/dest/ecdsa/ssh_ecdsa_r/account_contract.d.ts +2 -2
  30. package/dest/ecdsa/ssh_ecdsa_r/account_contract.d.ts.map +1 -1
  31. package/dest/ecdsa/ssh_ecdsa_r/account_contract.js +7 -3
  32. package/dest/ecdsa/ssh_ecdsa_r/index.d.ts +1 -1
  33. package/dest/ecdsa/ssh_ecdsa_r/index.d.ts.map +1 -1
  34. package/dest/ecdsa/ssh_ecdsa_r/lazy.d.ts +1 -1
  35. package/dest/ecdsa/ssh_ecdsa_r/lazy.d.ts.map +1 -1
  36. package/dest/schnorr/account_contract.d.ts +3 -2
  37. package/dest/schnorr/account_contract.d.ts.map +1 -1
  38. package/dest/schnorr/account_contract.js +3 -5
  39. package/dest/schnorr/index.d.ts +3 -2
  40. package/dest/schnorr/index.d.ts.map +1 -1
  41. package/dest/schnorr/lazy.d.ts +3 -2
  42. package/dest/schnorr/lazy.d.ts.map +1 -1
  43. package/dest/stub/account_contract.d.ts +2 -2
  44. package/dest/stub/account_contract.d.ts.map +1 -1
  45. package/dest/stub/ecdsa/index.d.ts +11 -0
  46. package/dest/stub/ecdsa/index.d.ts.map +1 -0
  47. package/dest/stub/ecdsa/index.js +18 -0
  48. package/dest/stub/ecdsa/lazy.d.ts +14 -0
  49. package/dest/stub/ecdsa/lazy.d.ts.map +1 -0
  50. package/dest/stub/ecdsa/lazy.js +22 -0
  51. package/dest/stub/schnorr/index.d.ts +11 -0
  52. package/dest/stub/schnorr/index.d.ts.map +1 -0
  53. package/dest/stub/schnorr/index.js +18 -0
  54. package/dest/stub/schnorr/lazy.d.ts +14 -0
  55. package/dest/stub/schnorr/lazy.d.ts.map +1 -0
  56. package/dest/stub/schnorr/lazy.js +22 -0
  57. package/dest/testing/configuration.d.ts +5 -4
  58. package/dest/testing/configuration.d.ts.map +1 -1
  59. package/dest/testing/configuration.js +1 -1
  60. package/dest/testing/index.d.ts +1 -1
  61. package/dest/testing/index.js +1 -1
  62. package/dest/testing/lazy.d.ts +1 -1
  63. package/dest/testing/lazy.js +1 -1
  64. package/dest/utils/index.d.ts +1 -1
  65. package/dest/utils/ssh_agent.d.ts +1 -1
  66. package/dest/utils/ssh_agent.d.ts.map +1 -1
  67. package/dest/utils/ssh_agent.js +2 -0
  68. package/package.json +14 -14
  69. package/src/defaults/account_contract.ts +9 -5
  70. package/src/defaults/index.ts +0 -1
  71. package/src/ecdsa/ecdsa_k/account_contract.ts +3 -3
  72. package/src/ecdsa/ecdsa_r/account_contract.ts +3 -3
  73. package/src/ecdsa/ssh_ecdsa_r/account_contract.ts +3 -3
  74. package/src/schnorr/account_contract.ts +5 -4
  75. package/src/schnorr/index.ts +2 -1
  76. package/src/schnorr/lazy.ts +2 -1
  77. package/src/stub/account_contract.ts +1 -1
  78. package/src/stub/ecdsa/index.ts +28 -0
  79. package/src/stub/ecdsa/lazy.ts +34 -0
  80. package/src/stub/schnorr/index.ts +30 -0
  81. package/src/stub/schnorr/lazy.ts +34 -0
  82. package/src/testing/configuration.ts +2 -1
  83. package/src/testing/index.ts +1 -1
  84. package/src/testing/lazy.ts +1 -1
  85. package/src/utils/ssh_agent.ts +2 -0
  86. package/artifacts/SchnorrSingleKeyAccount.json +0 -4558
  87. package/artifacts/SimulatedAccount.json +0 -4494
  88. package/dest/defaults/account_interface.d.ts +0 -29
  89. package/dest/defaults/account_interface.d.ts.map +0 -1
  90. package/dest/defaults/account_interface.js +0 -36
  91. package/dest/single_key/account_contract.d.ts +0 -17
  92. package/dest/single_key/account_contract.d.ts.map +0 -1
  93. package/dest/single_key/account_contract.js +0 -42
  94. package/dest/single_key/index.d.ts +0 -20
  95. package/dest/single_key/index.d.ts.map +0 -1
  96. package/dest/single_key/index.js +0 -23
  97. package/dest/single_key/lazy.d.ts +0 -24
  98. package/dest/single_key/lazy.d.ts.map +0 -1
  99. package/dest/single_key/lazy.js +0 -31
  100. package/dest/stub/index.d.ts +0 -21
  101. package/dest/stub/index.d.ts.map +0 -1
  102. package/dest/stub/index.js +0 -29
  103. package/dest/stub/lazy.d.ts +0 -23
  104. package/dest/stub/lazy.d.ts.map +0 -1
  105. package/dest/stub/lazy.js +0 -35
  106. package/src/defaults/account_interface.ts +0 -64
  107. package/src/single_key/account_contract.ts +0 -46
  108. package/src/single_key/index.ts +0 -32
  109. package/src/single_key/lazy.ts +0 -40
  110. package/src/stub/index.ts +0 -41
  111. package/src/stub/lazy.ts +0 -49
  112. /package/artifacts/{SchnorrSingleKeyAccount.d.json.ts → SimulatedEcdsaAccount.d.json.ts} +0 -0
  113. /package/artifacts/{SimulatedAccount.d.json.ts → SimulatedSchnorrAccount.d.json.ts} +0 -0
@@ -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'),
@@ -8,4 +8,4 @@ export declare function getInitialTestAccountsData(): Promise<InitialAccountData
8
8
  * Generate a fixed amount of random schnorr account contract instance.
9
9
  */
10
10
  export declare function generateSchnorrAccounts(numberOfAccounts: number): Promise<Promise<InitialAccountData[]>>;
11
- //# sourceMappingURL=index.d.ts.map
11
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0aW5nL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVNBLE9BQU8sRUFLTCxLQUFLLGtCQUFrQixFQUN4QixNQUFNLG9CQUFvQixDQUFDO0FBRTVCLE9BQU8sRUFDTCwwQkFBMEIsRUFDMUIsNEJBQTRCLEVBQzVCLHdCQUF3QixFQUN4Qix5QkFBeUIsRUFDekIsS0FBSyxrQkFBa0IsR0FDeEIsTUFBTSxvQkFBb0IsQ0FBQztBQUU1Qjs7R0FFRztBQUNILHdCQUFnQiwwQkFBMEIsSUFBSSxPQUFPLENBQUMsa0JBQWtCLEVBQUUsQ0FBQyxDQWExRTtBQUVEOztHQUVHO0FBQ0gsd0JBQXNCLHVCQUF1QixDQUFDLGdCQUFnQixFQUFFLE1BQU0sR0FBRyxPQUFPLENBQUMsT0FBTyxDQUFDLGtCQUFrQixFQUFFLENBQUMsQ0FBQyxDQWE5RyJ9
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The `@aztec/accounts/testing` export provides utility methods for testing, in particular in a Sandbox environment.
2
+ * The `@aztec/accounts/testing` export provides utility methods for testing, in particular in a local network environment.
3
3
  *
4
4
  * @packageDocumentation
5
5
  */ import { Fr } from '@aztec/aztec.js/fields';
@@ -8,4 +8,4 @@ export declare function getInitialTestAccountsData(): Promise<InitialAccountData
8
8
  * Generate a fixed amount of random schnorr account contract instance.
9
9
  */
10
10
  export declare function generateSchnorrAccounts(numberOfAccounts: number): Promise<InitialAccountData[]>;
11
- //# sourceMappingURL=lazy.d.ts.map
11
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Rlc3RpbmcvbGF6eS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFTQSxPQUFPLEVBS0wsS0FBSyxrQkFBa0IsRUFDeEIsTUFBTSxvQkFBb0IsQ0FBQztBQUU1QixPQUFPLEVBQUUsMEJBQTBCLEVBQUUsd0JBQXdCLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUUxRjs7R0FFRztBQUNILHdCQUFnQiwwQkFBMEIsSUFBSSxPQUFPLENBQUMsa0JBQWtCLEVBQUUsQ0FBQyxDQWExRTtBQUVEOztHQUVHO0FBQ0gsd0JBQXNCLHVCQUF1QixDQUFDLGdCQUFnQixFQUFFLE1BQU0sR0FBRyxPQUFPLENBQUMsa0JBQWtCLEVBQUUsQ0FBQyxDQWFyRyJ9
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The `@aztec/accounts/testing/lazy` export provides utility methods for testing, in particular in a Sandbox environment.
2
+ * The `@aztec/accounts/testing/lazy` export provides utility methods for testing, in particular in a local network environment.
3
3
  *
4
4
  * @packageDocumentation
5
5
  */ import { Fr } from '@aztec/aztec.js/fields';
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3NoX2FnZW50LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvc3NoX2FnZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxRQUFRLENBQUM7QUFDaEMsT0FBTyxHQUFHLE1BQU0sS0FBSyxDQUFDO0FBT3RCOztHQUVHO0FBQ0gsd0JBQWdCLGNBQWMsZUFNN0I7QUFFRDs7R0FFRztBQUNILEtBQUssU0FBUyxHQUFHO0lBQ2Y7O09BRUc7SUFDSCxJQUFJLEVBQUUsTUFBTSxDQUFDO0lBQ2I7O09BRUc7SUFDSCxTQUFTLEVBQUUsTUFBTSxDQUFDO0lBQ2xCOztPQUVHO0lBQ0gsT0FBTyxFQUFFLE1BQU0sQ0FBQztDQUNqQixDQUFDO0FBRUY7O0dBRUc7QUFDSCx3QkFBZ0IsYUFBYSxJQUFJLE9BQU8sQ0FBQyxTQUFTLEVBQUUsQ0FBQyxDQW1EcEQ7QUFFRDs7R0FFRztBQUNILHdCQUFnQixhQUFhLENBQUMsT0FBTyxFQUFFLE1BQU0sRUFBRSxTQUFTLEVBQUUsTUFBTSxFQUFFLFNBQVMsRUFBRSxNQUFNLEVBQUUsSUFBSSxFQUFFLE1BQU0sb0NBeUNoRyJ9
@@ -1 +1 @@
1
- {"version":3,"file":"ssh_agent.d.ts","sourceRoot":"","sources":["../../src/utils/ssh_agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,GAAG,MAAM,KAAK,CAAC;AAOtB;;GAEG;AACH,wBAAgB,cAAc,eAM7B;AAED;;GAEG;AACH,KAAK,SAAS,GAAG;IACf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,CAkDpD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,oCAwChG"}
1
+ {"version":3,"file":"ssh_agent.d.ts","sourceRoot":"","sources":["../../src/utils/ssh_agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,GAAG,MAAM,KAAK,CAAC;AAOtB;;GAEG;AACH,wBAAgB,cAAc,eAM7B;AAED;;GAEG;AACH,KAAK,SAAS,GAAG;IACf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,CAmDpD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,oCAyChG"}
@@ -18,6 +18,7 @@ const SSH_AGENT_SIGN_RESPONSE = 14;
18
18
  */ export function getIdentities() {
19
19
  return new Promise((resolve, reject)=>{
20
20
  const stream = connectToAgent();
21
+ stream.on('error', reject);
21
22
  stream.on('connect', ()=>{
22
23
  const request = Buffer.concat([
23
24
  Buffer.from([
@@ -78,6 +79,7 @@ const SSH_AGENT_SIGN_RESPONSE = 14;
78
79
  */ export function signWithAgent(keyType, curveName, publicKey, data) {
79
80
  return new Promise((resolve, reject)=>{
80
81
  const stream = connectToAgent();
82
+ stream.on('error', reject);
81
83
  stream.on('connect', ()=>{
82
84
  // Construct the key blob
83
85
  const keyBlob = Buffer.concat([
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": "0.0.1-commit.24de95ac",
5
+ "version": "0.0.1-commit.2606882",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  "./defaults": "./dest/defaults/index.js",
@@ -10,10 +10,10 @@
10
10
  "./ecdsa/lazy": "./dest/ecdsa/lazy.js",
11
11
  "./schnorr": "./dest/schnorr/index.js",
12
12
  "./schnorr/lazy": "./dest/schnorr/lazy.js",
13
- "./single_key": "./dest/single_key/index.js",
14
- "./single_key/lazy": "./dest/single_key/lazy.js",
15
- "./stub": "./dest/stub/index.js",
16
- "./stub/lazy": "./dest/stub/lazy.js",
13
+ "./stub/schnorr": "./dest/stub/schnorr/index.js",
14
+ "./stub/schnorr/lazy": "./dest/stub/schnorr/lazy.js",
15
+ "./stub/ecdsa": "./dest/stub/ecdsa/index.js",
16
+ "./stub/ecdsa/lazy": "./dest/stub/ecdsa/lazy.js",
17
17
  "./testing": "./dest/testing/index.js",
18
18
  "./testing/lazy": "./dest/testing/lazy.js",
19
19
  "./copy-cat": "./dest/copy_cat/index.js",
@@ -25,18 +25,17 @@
25
25
  "./src/defaults/index.ts",
26
26
  "./src/ecdsa/index.ts",
27
27
  "./src/schnorr/index.ts",
28
- "./src/single_key/index.ts",
29
28
  "./src/testing/index.ts"
30
29
  ],
31
30
  "name": "Accounts",
32
31
  "tsconfig": "./tsconfig.json"
33
32
  },
34
33
  "scripts": {
35
- "build": "yarn clean && yarn generate && tsc -b",
34
+ "build": "yarn clean && yarn generate && ../scripts/tsc.sh",
36
35
  "generate": "yarn generate:noir-contracts",
37
36
  "generate:noir-contracts": "./scripts/copy-contracts.sh",
38
- "build:dev": "tsc -b --watch",
39
- "build:ts": "tsc -b",
37
+ "build:dev": "../scripts/tsc.sh --watch",
38
+ "build:ts": "../scripts/tsc.sh",
40
39
  "clean": "rm -rf ./dest .tsbuildinfo ./artifacts",
41
40
  "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
42
41
  },
@@ -82,17 +81,18 @@
82
81
  ]
83
82
  },
84
83
  "dependencies": {
85
- "@aztec/aztec.js": "0.0.1-commit.24de95ac",
86
- "@aztec/entrypoints": "0.0.1-commit.24de95ac",
87
- "@aztec/ethereum": "0.0.1-commit.24de95ac",
88
- "@aztec/foundation": "0.0.1-commit.24de95ac",
89
- "@aztec/stdlib": "0.0.1-commit.24de95ac",
84
+ "@aztec/aztec.js": "0.0.1-commit.2606882",
85
+ "@aztec/entrypoints": "0.0.1-commit.2606882",
86
+ "@aztec/ethereum": "0.0.1-commit.2606882",
87
+ "@aztec/foundation": "0.0.1-commit.2606882",
88
+ "@aztec/stdlib": "0.0.1-commit.2606882",
90
89
  "tslib": "^2.4.0"
91
90
  },
92
91
  "devDependencies": {
93
92
  "@jest/globals": "^30.0.0",
94
93
  "@types/jest": "^30.0.0",
95
94
  "@types/node": "^22.15.17",
95
+ "@typescript/native-preview": "7.0.0-dev.20260113.1",
96
96
  "jest": "^30.0.0",
97
97
  "jest-mock-extended": "^4.0.0",
98
98
  "ts-loader": "^9.5.4",
@@ -1,9 +1,8 @@
1
- import type { AccountContract, AccountInterface, AuthWitnessProvider, ChainInfo } from '@aztec/aztec.js/account';
1
+ import { type Account, type AccountContract, type AuthWitnessProvider, BaseAccount } from '@aztec/aztec.js/account';
2
+ import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
2
3
  import type { ContractArtifact } from '@aztec/stdlib/abi';
3
4
  import type { CompleteAddress } from '@aztec/stdlib/contract';
4
5
 
5
- import { DefaultAccountInterface } from '../defaults/account_interface.js';
6
-
7
6
  /**
8
7
  * Base class for implementing an account contract. Requires that the account uses the
9
8
  * default entrypoint method signature.
@@ -23,7 +22,12 @@ export abstract class DefaultAccountContract implements AccountContract {
23
22
 
24
23
  constructor() {}
25
24
 
26
- getInterface(address: CompleteAddress, chainInfo: ChainInfo): AccountInterface {
27
- return new DefaultAccountInterface(this.getAuthWitnessProvider(address), address, chainInfo);
25
+ getAccount(completeAddress: CompleteAddress): Account {
26
+ const authWitnessProvider = this.getAuthWitnessProvider(completeAddress);
27
+ return new BaseAccount(
28
+ new DefaultAccountEntrypoint(completeAddress.address, authWitnessProvider),
29
+ authWitnessProvider,
30
+ completeAddress,
31
+ );
28
32
  }
29
33
  }
@@ -6,5 +6,4 @@
6
6
  * @packageDocumentation
7
7
  */
8
8
 
9
- export * from './account_interface.js';
10
9
  export * from './account_contract.js';
@@ -1,6 +1,6 @@
1
1
  import type { AuthWitnessProvider } from '@aztec/aztec.js/account';
2
- import { Ecdsa } from '@aztec/foundation/crypto';
3
- import type { Fr } from '@aztec/foundation/fields';
2
+ import { Ecdsa } from '@aztec/foundation/crypto/ecdsa';
3
+ import type { Fr } from '@aztec/foundation/curves/bn254';
4
4
  import { AuthWitness } from '@aztec/stdlib/auth-witness';
5
5
  import { CompleteAddress } from '@aztec/stdlib/contract';
6
6
 
@@ -21,7 +21,7 @@ export abstract class EcdsaKBaseAccountContract extends DefaultAccountContract {
21
21
  const signingPublicKey = await new Ecdsa().computePublicKey(this.signingPrivateKey);
22
22
  return {
23
23
  constructorName: 'constructor',
24
- constructorArgs: [signingPublicKey.subarray(0, 32), signingPublicKey.subarray(32, 64)],
24
+ constructorArgs: [[...signingPublicKey.subarray(0, 32)], [...signingPublicKey.subarray(32, 64)]],
25
25
  };
26
26
  }
27
27
 
@@ -1,6 +1,6 @@
1
1
  import type { AuthWitnessProvider } from '@aztec/aztec.js/account';
2
- import { Ecdsa } from '@aztec/foundation/crypto';
3
- import type { Fr } from '@aztec/foundation/fields';
2
+ import { Ecdsa } from '@aztec/foundation/crypto/ecdsa';
3
+ import type { Fr } from '@aztec/foundation/curves/bn254';
4
4
  import { AuthWitness } from '@aztec/stdlib/auth-witness';
5
5
  import { CompleteAddress } from '@aztec/stdlib/contract';
6
6
 
@@ -21,7 +21,7 @@ export abstract class EcdsaRBaseAccountContract extends DefaultAccountContract {
21
21
  const signingPublicKey = await new Ecdsa('secp256r1').computePublicKey(this.signingPrivateKey);
22
22
  return {
23
23
  constructorName: 'constructor',
24
- constructorArgs: [signingPublicKey.subarray(0, 32), signingPublicKey.subarray(32, 64)],
24
+ constructorArgs: [[...signingPublicKey.subarray(0, 32)], [...signingPublicKey.subarray(32, 64)]],
25
25
  };
26
26
  }
27
27
 
@@ -1,6 +1,6 @@
1
1
  import type { AuthWitnessProvider } from '@aztec/aztec.js/account';
2
- import { EcdsaSignature } from '@aztec/foundation/crypto';
3
- import type { Fr } from '@aztec/foundation/fields';
2
+ import { EcdsaSignature } from '@aztec/foundation/crypto/ecdsa';
3
+ import type { Fr } from '@aztec/foundation/curves/bn254';
4
4
  import { AuthWitness } from '@aztec/stdlib/auth-witness';
5
5
  import { CompleteAddress } from '@aztec/stdlib/contract';
6
6
 
@@ -25,7 +25,7 @@ export abstract class EcdsaRSSHBaseAccountContract extends DefaultAccountContrac
25
25
  getInitializationFunctionAndArgs() {
26
26
  return Promise.resolve({
27
27
  constructorName: 'constructor',
28
- constructorArgs: [this.signingPublicKey.subarray(0, 32), this.signingPublicKey.subarray(32, 64)],
28
+ constructorArgs: [[...this.signingPublicKey.subarray(0, 32)], [...this.signingPublicKey.subarray(32, 64)]],
29
29
  });
30
30
  }
31
31
 
@@ -1,6 +1,7 @@
1
1
  import type { AuthWitnessProvider } from '@aztec/aztec.js/account';
2
- import { Schnorr } from '@aztec/foundation/crypto';
3
- import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';
2
+ import { Schnorr } from '@aztec/foundation/crypto/schnorr';
3
+ import { Fr } from '@aztec/foundation/curves/bn254';
4
+ import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
4
5
  import { AuthWitness } from '@aztec/stdlib/auth-witness';
5
6
  import { CompleteAddress } from '@aztec/stdlib/contract';
6
7
 
@@ -33,7 +34,7 @@ export class SchnorrAuthWitnessProvider implements AuthWitnessProvider {
33
34
 
34
35
  async createAuthWit(messageHash: Fr): Promise<AuthWitness> {
35
36
  const schnorr = new Schnorr();
36
- const signature = await schnorr.constructSignature(messageHash.toBuffer(), this.signingPrivateKey);
37
- return new AuthWitness(messageHash, [...signature.toBuffer()]);
37
+ const signature = await schnorr.constructSignature(messageHash, this.signingPrivateKey);
38
+ return new AuthWitness(messageHash, signature.toLimbFields());
38
39
  }
39
40
  }
@@ -6,7 +6,8 @@
6
6
  */
7
7
  import { getAccountContractAddress } from '@aztec/aztec.js/account';
8
8
  import type { AztecAddress } from '@aztec/aztec.js/addresses';
9
- import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';
9
+ import { Fr } from '@aztec/foundation/curves/bn254';
10
+ import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
10
11
  import type { ContractArtifact } from '@aztec/stdlib/abi';
11
12
  import { loadContractArtifact } from '@aztec/stdlib/abi';
12
13
  import { deriveSigningKey } from '@aztec/stdlib/keys';
@@ -5,7 +5,8 @@
5
5
  * @packageDocumentation
6
6
  */
7
7
  import { getAccountContractAddress } from '@aztec/aztec.js/account';
8
- import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';
8
+ import { Fr } from '@aztec/foundation/curves/bn254';
9
+ import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
9
10
  import type { ContractArtifact } from '@aztec/stdlib/abi';
10
11
  import { loadContractArtifact } from '@aztec/stdlib/abi';
11
12
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
@@ -1,5 +1,5 @@
1
1
  import type { AuthWitnessProvider } from '@aztec/aztec.js/account';
2
- import { Fr } from '@aztec/foundation/fields';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
3
  import { AuthWitness } from '@aztec/stdlib/auth-witness';
4
4
  import { CompleteAddress } from '@aztec/stdlib/contract';
5
5
 
@@ -0,0 +1,28 @@
1
+ import { BaseAccount } from '@aztec/aztec.js/account';
2
+ import type { CompleteAddress } from '@aztec/aztec.js/addresses';
3
+ import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
4
+ import { loadContractArtifact } from '@aztec/stdlib/abi';
5
+ import type { NoirCompiledContract } from '@aztec/stdlib/noir';
6
+
7
+ import SimulatedEcdsaAccountJson from '../../../artifacts/SimulatedEcdsaAccount.json' with { type: 'json' };
8
+ import { StubBaseAccountContract } from '../account_contract.js';
9
+
10
+ export const StubEcdsaAccountContractArtifact = loadContractArtifact(SimulatedEcdsaAccountJson as NoirCompiledContract);
11
+
12
+ /** Stub account contract for ECDSA accounts (secp256k1 and secp256r1). Eagerly loads the contract artifact. */
13
+ export class StubEcdsaAccountContract extends StubBaseAccountContract {
14
+ override getContractArtifact() {
15
+ return Promise.resolve(StubEcdsaAccountContractArtifact);
16
+ }
17
+ }
18
+
19
+ /** Creates an ECDSA stub account that impersonates the one with the provided address. */
20
+ export function createStubEcdsaAccount(originalAddress: CompleteAddress) {
21
+ const accountContract = new StubEcdsaAccountContract();
22
+ const authWitnessProvider = accountContract.getAuthWitnessProvider(originalAddress);
23
+ return new BaseAccount(
24
+ new DefaultAccountEntrypoint(originalAddress.address, authWitnessProvider),
25
+ authWitnessProvider,
26
+ originalAddress,
27
+ );
28
+ }
@@ -0,0 +1,34 @@
1
+ import { BaseAccount } from '@aztec/aztec.js/account';
2
+ import type { CompleteAddress } from '@aztec/aztec.js/addresses';
3
+ import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
4
+ import { loadContractArtifact } from '@aztec/stdlib/abi';
5
+
6
+ import { StubBaseAccountContract } from '../account_contract.js';
7
+
8
+ /**
9
+ * Lazily loads the ECDSA stub contract artifact (browser-compatible).
10
+ */
11
+ export async function getStubEcdsaAccountContractArtifact() {
12
+ // Cannot assert this import as it's incompatible with bundlers like vite
13
+ // https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
14
+ const { default: json } = await import('../../../artifacts/SimulatedEcdsaAccount.json');
15
+ return loadContractArtifact(json);
16
+ }
17
+
18
+ /** Stub account contract for ECDSA accounts (secp256k1 and secp256r1). Lazily loads the contract artifact. */
19
+ export class StubEcdsaAccountContract extends StubBaseAccountContract {
20
+ override getContractArtifact() {
21
+ return getStubEcdsaAccountContractArtifact();
22
+ }
23
+ }
24
+
25
+ /** Creates an ECDSA stub account that impersonates the one with the provided address. */
26
+ export function createStubEcdsaAccount(originalAddress: CompleteAddress) {
27
+ const accountContract = new StubEcdsaAccountContract();
28
+ const authWitnessProvider = accountContract.getAuthWitnessProvider(originalAddress);
29
+ return new BaseAccount(
30
+ new DefaultAccountEntrypoint(originalAddress.address, authWitnessProvider),
31
+ authWitnessProvider,
32
+ originalAddress,
33
+ );
34
+ }
@@ -0,0 +1,30 @@
1
+ import { BaseAccount } from '@aztec/aztec.js/account';
2
+ import type { CompleteAddress } from '@aztec/aztec.js/addresses';
3
+ import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
4
+ import { loadContractArtifact } from '@aztec/stdlib/abi';
5
+ import type { NoirCompiledContract } from '@aztec/stdlib/noir';
6
+
7
+ import SimulatedSchnorrAccountJson from '../../../artifacts/SimulatedSchnorrAccount.json' with { type: 'json' };
8
+ import { StubBaseAccountContract } from '../account_contract.js';
9
+
10
+ export const StubSchnorrAccountContractArtifact = loadContractArtifact(
11
+ SimulatedSchnorrAccountJson as NoirCompiledContract,
12
+ );
13
+
14
+ /** Stub account contract for Schnorr accounts. Eagerly loads the contract artifact. */
15
+ export class StubSchnorrAccountContract extends StubBaseAccountContract {
16
+ override getContractArtifact() {
17
+ return Promise.resolve(StubSchnorrAccountContractArtifact);
18
+ }
19
+ }
20
+
21
+ /** Creates a Schnorr stub account that impersonates the one with the provided address. */
22
+ export function createStubSchnorrAccount(originalAddress: CompleteAddress) {
23
+ const accountContract = new StubSchnorrAccountContract();
24
+ const authWitnessProvider = accountContract.getAuthWitnessProvider(originalAddress);
25
+ return new BaseAccount(
26
+ new DefaultAccountEntrypoint(originalAddress.address, authWitnessProvider),
27
+ authWitnessProvider,
28
+ originalAddress,
29
+ );
30
+ }
@@ -0,0 +1,34 @@
1
+ import { BaseAccount } from '@aztec/aztec.js/account';
2
+ import type { CompleteAddress } from '@aztec/aztec.js/addresses';
3
+ import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
4
+ import { loadContractArtifact } from '@aztec/stdlib/abi';
5
+
6
+ import { StubBaseAccountContract } from '../account_contract.js';
7
+
8
+ /**
9
+ * Lazily loads the Schnorr stub contract artifact (browser-compatible).
10
+ */
11
+ export async function getStubSchnorrAccountContractArtifact() {
12
+ // Cannot assert this import as it's incompatible with bundlers like vite
13
+ // https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
14
+ const { default: json } = await import('../../../artifacts/SimulatedSchnorrAccount.json');
15
+ return loadContractArtifact(json);
16
+ }
17
+
18
+ /** Stub account contract for Schnorr accounts. Lazily loads the contract artifact. */
19
+ export class StubSchnorrAccountContract extends StubBaseAccountContract {
20
+ override getContractArtifact() {
21
+ return getStubSchnorrAccountContractArtifact();
22
+ }
23
+ }
24
+
25
+ /** Creates a Schnorr stub account that impersonates the one with the provided address. */
26
+ export function createStubSchnorrAccount(originalAddress: CompleteAddress) {
27
+ const accountContract = new StubSchnorrAccountContract();
28
+ const authWitnessProvider = accountContract.getAuthWitnessProvider(originalAddress);
29
+ return new BaseAccount(
30
+ new DefaultAccountEntrypoint(originalAddress.address, authWitnessProvider),
31
+ authWitnessProvider,
32
+ originalAddress,
33
+ );
34
+ }
@@ -1,4 +1,5 @@
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
  import { deriveMasterIncomingViewingSecretKey } from '@aztec/stdlib/keys';
4
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The `@aztec/accounts/testing` export provides utility methods for testing, in particular in a Sandbox environment.
2
+ * The `@aztec/accounts/testing` export provides utility methods for testing, in particular in a local network environment.
3
3
  *
4
4
  * @packageDocumentation
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The `@aztec/accounts/testing/lazy` export provides utility methods for testing, in particular in a Sandbox environment.
2
+ * The `@aztec/accounts/testing/lazy` export provides utility methods for testing, in particular in a local network environment.
3
3
  *
4
4
  * @packageDocumentation
5
5
  */
@@ -41,6 +41,7 @@ type StoredKey = {
41
41
  export function getIdentities(): Promise<StoredKey[]> {
42
42
  return new Promise((resolve, reject) => {
43
43
  const stream = connectToAgent();
44
+ stream.on('error', reject);
44
45
  stream.on('connect', () => {
45
46
  const request = Buffer.concat([
46
47
  Buffer.from([0, 0, 0, 5 + 4]), // length
@@ -96,6 +97,7 @@ export function getIdentities(): Promise<StoredKey[]> {
96
97
  export function signWithAgent(keyType: Buffer, curveName: Buffer, publicKey: Buffer, data: Buffer) {
97
98
  return new Promise<Buffer>((resolve, reject) => {
98
99
  const stream = connectToAgent();
100
+ stream.on('error', reject);
99
101
  stream.on('connect', () => {
100
102
  // Construct the key blob
101
103
  const keyBlob = Buffer.concat([