@aztec/accounts 0.0.1-commit.24de95ac → 0.0.1-commit.27d773e65

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 (91) hide show
  1. package/README.md +1 -2
  2. package/artifacts/EcdsaKAccount.json +3504 -3596
  3. package/artifacts/EcdsaRAccount.json +3505 -3597
  4. package/artifacts/SchnorrAccount.json +3437 -3695
  5. package/artifacts/SimulatedAccount.json +2245 -2239
  6. package/dest/defaults/account_contract.d.ts +3 -3
  7. package/dest/defaults/account_contract.d.ts.map +1 -1
  8. package/dest/defaults/account_contract.js +5 -3
  9. package/dest/defaults/index.d.ts +1 -2
  10. package/dest/defaults/index.d.ts.map +1 -1
  11. package/dest/defaults/index.js +1 -2
  12. package/dest/ecdsa/ecdsa_k/account_contract.d.ts +1 -1
  13. package/dest/ecdsa/ecdsa_k/account_contract.d.ts.map +1 -1
  14. package/dest/ecdsa/ecdsa_k/account_contract.js +1 -1
  15. package/dest/ecdsa/ecdsa_k/index.d.ts +1 -1
  16. package/dest/ecdsa/ecdsa_k/index.d.ts.map +1 -1
  17. package/dest/ecdsa/ecdsa_k/lazy.d.ts +1 -1
  18. package/dest/ecdsa/ecdsa_k/lazy.d.ts.map +1 -1
  19. package/dest/ecdsa/ecdsa_r/account_contract.d.ts +1 -1
  20. package/dest/ecdsa/ecdsa_r/account_contract.d.ts.map +1 -1
  21. package/dest/ecdsa/ecdsa_r/account_contract.js +1 -1
  22. package/dest/ecdsa/ecdsa_r/index.d.ts +1 -1
  23. package/dest/ecdsa/ecdsa_r/index.d.ts.map +1 -1
  24. package/dest/ecdsa/ecdsa_r/lazy.d.ts +1 -1
  25. package/dest/ecdsa/ecdsa_r/lazy.d.ts.map +1 -1
  26. package/dest/ecdsa/index.d.ts +1 -1
  27. package/dest/ecdsa/lazy.d.ts +1 -1
  28. package/dest/ecdsa/ssh_ecdsa_r/account_contract.d.ts +1 -1
  29. package/dest/ecdsa/ssh_ecdsa_r/account_contract.d.ts.map +1 -1
  30. package/dest/ecdsa/ssh_ecdsa_r/account_contract.js +1 -1
  31. package/dest/ecdsa/ssh_ecdsa_r/index.d.ts +1 -1
  32. package/dest/ecdsa/ssh_ecdsa_r/index.d.ts.map +1 -1
  33. package/dest/ecdsa/ssh_ecdsa_r/lazy.d.ts +1 -1
  34. package/dest/ecdsa/ssh_ecdsa_r/lazy.d.ts.map +1 -1
  35. package/dest/schnorr/account_contract.d.ts +3 -2
  36. package/dest/schnorr/account_contract.d.ts.map +1 -1
  37. package/dest/schnorr/account_contract.js +1 -1
  38. package/dest/schnorr/index.d.ts +3 -2
  39. package/dest/schnorr/index.d.ts.map +1 -1
  40. package/dest/schnorr/lazy.d.ts +3 -2
  41. package/dest/schnorr/lazy.d.ts.map +1 -1
  42. package/dest/stub/account_contract.d.ts +2 -2
  43. package/dest/stub/account_contract.d.ts.map +1 -1
  44. package/dest/stub/index.d.ts +3 -4
  45. package/dest/stub/index.d.ts.map +1 -1
  46. package/dest/stub/index.js +4 -5
  47. package/dest/stub/lazy.d.ts +6 -4
  48. package/dest/stub/lazy.d.ts.map +1 -1
  49. package/dest/stub/lazy.js +7 -5
  50. package/dest/testing/configuration.d.ts +5 -4
  51. package/dest/testing/configuration.d.ts.map +1 -1
  52. package/dest/testing/configuration.js +1 -1
  53. package/dest/testing/index.d.ts +1 -1
  54. package/dest/testing/index.js +1 -1
  55. package/dest/testing/lazy.d.ts +1 -1
  56. package/dest/testing/lazy.js +1 -1
  57. package/dest/utils/index.d.ts +1 -1
  58. package/dest/utils/ssh_agent.d.ts +1 -1
  59. package/package.json +10 -12
  60. package/src/defaults/account_contract.ts +9 -5
  61. package/src/defaults/index.ts +0 -1
  62. package/src/ecdsa/ecdsa_k/account_contract.ts +2 -2
  63. package/src/ecdsa/ecdsa_r/account_contract.ts +2 -2
  64. package/src/ecdsa/ssh_ecdsa_r/account_contract.ts +2 -2
  65. package/src/schnorr/account_contract.ts +3 -2
  66. package/src/schnorr/index.ts +2 -1
  67. package/src/schnorr/lazy.ts +2 -1
  68. package/src/stub/account_contract.ts +1 -1
  69. package/src/stub/index.ts +7 -8
  70. package/src/stub/lazy.ts +10 -8
  71. package/src/testing/configuration.ts +2 -1
  72. package/src/testing/index.ts +1 -1
  73. package/src/testing/lazy.ts +1 -1
  74. package/artifacts/SchnorrSingleKeyAccount.d.json.ts +0 -3
  75. package/artifacts/SchnorrSingleKeyAccount.json +0 -4558
  76. package/dest/defaults/account_interface.d.ts +0 -29
  77. package/dest/defaults/account_interface.d.ts.map +0 -1
  78. package/dest/defaults/account_interface.js +0 -36
  79. package/dest/single_key/account_contract.d.ts +0 -17
  80. package/dest/single_key/account_contract.d.ts.map +0 -1
  81. package/dest/single_key/account_contract.js +0 -42
  82. package/dest/single_key/index.d.ts +0 -20
  83. package/dest/single_key/index.d.ts.map +0 -1
  84. package/dest/single_key/index.js +0 -23
  85. package/dest/single_key/lazy.d.ts +0 -24
  86. package/dest/single_key/lazy.d.ts.map +0 -1
  87. package/dest/single_key/lazy.js +0 -31
  88. package/src/defaults/account_interface.ts +0 -64
  89. package/src/single_key/account_contract.ts +0 -46
  90. package/src/single_key/index.ts +0 -32
  91. package/src/single_key/lazy.ts +0 -40
@@ -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
 
@@ -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
 
@@ -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
 
@@ -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
 
@@ -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
 
package/src/stub/index.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { BaseAccount, type ChainInfo } from '@aztec/aztec.js/account';
1
+ import { BaseAccount } from '@aztec/aztec.js/account';
2
2
  import type { CompleteAddress } from '@aztec/aztec.js/addresses';
3
+ import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
3
4
  import type { ContractArtifact } from '@aztec/stdlib/abi';
4
5
  import { loadContractArtifact } from '@aztec/stdlib/abi';
5
6
  import type { NoirCompiledContract } from '@aztec/stdlib/noir';
6
7
 
7
8
  import SimulatedAccountContract from '../../artifacts/SimulatedAccount.json' with { type: 'json' };
8
- import { DefaultAccountInterface } from '../defaults/account_interface.js';
9
9
  import { StubBaseAccountContract } from './account_contract.js';
10
10
 
11
11
  export const StubAccountContractArtifact = loadContractArtifact(SimulatedAccountContract as NoirCompiledContract);
@@ -27,15 +27,14 @@ export class StubAccountContract extends StubBaseAccountContract {
27
27
  /**
28
28
  * Creates a stub account that impersonates the one with the provided originalAddress.
29
29
  * @param originalAddress - The address of the account to stub
30
- * @param chainInfo - The chain info that the account is connected to
31
30
  * @returns A stub account that can be used for kernelless simulations
32
31
  */
33
- export function createStubAccount(originalAddress: CompleteAddress, chainInfo: ChainInfo) {
32
+ export function createStubAccount(originalAddress: CompleteAddress) {
34
33
  const accountContract = new StubAccountContract();
35
- const accountInterface = new DefaultAccountInterface(
36
- accountContract.getAuthWitnessProvider(originalAddress),
34
+ const authWitnessProvider = accountContract.getAuthWitnessProvider(originalAddress);
35
+ return new BaseAccount(
36
+ new DefaultAccountEntrypoint(originalAddress.address, authWitnessProvider),
37
+ authWitnessProvider,
37
38
  originalAddress,
38
- chainInfo,
39
39
  );
40
- return new BaseAccount(accountInterface);
41
40
  }
package/src/stub/lazy.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { BaseAccount, type ChainInfo } from '@aztec/aztec.js/account';
1
+ import { BaseAccount } from '@aztec/aztec.js/account';
2
2
  import type { CompleteAddress } from '@aztec/aztec.js/addresses';
3
+ import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
3
4
  import type { ContractArtifact } from '@aztec/stdlib/abi';
4
5
  import { loadContractArtifact } from '@aztec/stdlib/abi';
5
6
 
6
- import { DefaultAccountInterface } from '../defaults/account_interface.js';
7
7
  import { StubBaseAccountContract } from './account_contract.js';
8
8
 
9
9
  /**
@@ -36,14 +36,16 @@ export class StubAccountContract extends StubBaseAccountContract {
36
36
  }
37
37
 
38
38
  /**
39
- *
39
+ * Creates a stub account that impersonates the one with the provided originalAddress.
40
+ * @param originalAddress - The address of the account to stub
41
+ * @returns A stub account that can be used for kernelless simulations
40
42
  */
41
- export function createStubAccount(originalAddress: CompleteAddress, chainInfo: ChainInfo) {
43
+ export function createStubAccount(originalAddress: CompleteAddress) {
42
44
  const accountContract = new StubAccountContract();
43
- const accountInterface = new DefaultAccountInterface(
44
- accountContract.getAuthWitnessProvider(originalAddress),
45
+ const authWitnessProvider = accountContract.getAuthWitnessProvider(originalAddress);
46
+ return new BaseAccount(
47
+ new DefaultAccountEntrypoint(originalAddress.address, authWitnessProvider),
48
+ authWitnessProvider,
45
49
  originalAddress,
46
- chainInfo,
47
50
  );
48
- return new BaseAccount(accountInterface);
49
51
  }
@@ -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
  */
@@ -1,3 +0,0 @@
1
- import { type NoirCompiledContract } from '@aztec/stdlib/noir';
2
- const circuit: NoirCompiledContract;
3
- export = circuit;