@aztec/accounts 0.0.1-commit.fce3e4f → 0.0.1-commit.fffb133c

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 (54) hide show
  1. package/README.md +1 -1
  2. package/artifacts/EcdsaKAccount.json +2896 -3235
  3. package/artifacts/EcdsaRAccount.json +2896 -3235
  4. package/artifacts/SchnorrAccount.json +2946 -3450
  5. package/artifacts/SchnorrSingleKeyAccount.json +2041 -2030
  6. package/artifacts/SimulatedAccount.json +1962 -2110
  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.js +1 -1
  14. package/dest/ecdsa/ecdsa_r/account_contract.js +1 -1
  15. package/dest/ecdsa/ssh_ecdsa_r/account_contract.js +1 -1
  16. package/dest/schnorr/account_contract.d.ts +3 -2
  17. package/dest/schnorr/account_contract.d.ts.map +1 -1
  18. package/dest/schnorr/account_contract.js +1 -1
  19. package/dest/schnorr/index.d.ts +3 -2
  20. package/dest/schnorr/index.d.ts.map +1 -1
  21. package/dest/schnorr/lazy.d.ts +3 -2
  22. package/dest/schnorr/lazy.d.ts.map +1 -1
  23. package/dest/single_key/account_contract.d.ts +2 -2
  24. package/dest/single_key/account_contract.d.ts.map +1 -1
  25. package/dest/single_key/account_contract.js +1 -1
  26. package/dest/stub/account_contract.d.ts +2 -2
  27. package/dest/stub/account_contract.d.ts.map +1 -1
  28. package/dest/stub/index.d.ts +3 -4
  29. package/dest/stub/index.d.ts.map +1 -1
  30. package/dest/stub/index.js +4 -5
  31. package/dest/stub/lazy.d.ts +6 -4
  32. package/dest/stub/lazy.d.ts.map +1 -1
  33. package/dest/stub/lazy.js +7 -5
  34. package/dest/testing/configuration.d.ts +5 -4
  35. package/dest/testing/configuration.d.ts.map +1 -1
  36. package/dest/testing/configuration.js +1 -1
  37. package/package.json +10 -10
  38. package/src/defaults/account_contract.ts +9 -5
  39. package/src/defaults/index.ts +0 -1
  40. package/src/ecdsa/ecdsa_k/account_contract.ts +2 -2
  41. package/src/ecdsa/ecdsa_r/account_contract.ts +2 -2
  42. package/src/ecdsa/ssh_ecdsa_r/account_contract.ts +2 -2
  43. package/src/schnorr/account_contract.ts +3 -2
  44. package/src/schnorr/index.ts +2 -1
  45. package/src/schnorr/lazy.ts +2 -1
  46. package/src/single_key/account_contract.ts +3 -2
  47. package/src/stub/account_contract.ts +1 -1
  48. package/src/stub/index.ts +7 -8
  49. package/src/stub/lazy.ts +10 -8
  50. package/src/testing/configuration.ts +2 -1
  51. package/dest/defaults/account_interface.d.ts +0 -28
  52. package/dest/defaults/account_interface.d.ts.map +0 -1
  53. package/dest/defaults/account_interface.js +0 -36
  54. package/src/defaults/account_interface.ts +0 -63
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,28 +0,0 @@
1
- import type { AccountInterface, AuthWitnessProvider } from '@aztec/aztec.js/account';
2
- import { type DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
3
- import type { ChainInfo, EntrypointInterface } from '@aztec/entrypoints/interfaces';
4
- import { Fr } from '@aztec/foundation/fields';
5
- import type { AuthWitness } from '@aztec/stdlib/auth-witness';
6
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
7
- import { CompleteAddress } from '@aztec/stdlib/contract';
8
- import type { GasSettings } from '@aztec/stdlib/gas';
9
- import type { ExecutionPayload, TxExecutionRequest } from '@aztec/stdlib/tx';
10
- /**
11
- * Default implementation for an account interface. Requires that the account uses the default
12
- * entrypoint signature, which accept an AppPayload and a FeePayload as defined in noir-libs/aztec-noir/src/entrypoint module
13
- */
14
- export declare class DefaultAccountInterface implements AccountInterface {
15
- private authWitnessProvider;
16
- private address;
17
- protected entrypoint: EntrypointInterface;
18
- private chainId;
19
- private version;
20
- constructor(authWitnessProvider: AuthWitnessProvider, address: CompleteAddress, chainInfo: ChainInfo);
21
- createTxExecutionRequest(exec: ExecutionPayload, gasSettings: GasSettings, options: DefaultAccountEntrypointOptions): Promise<TxExecutionRequest>;
22
- createAuthWit(messageHash: Fr): Promise<AuthWitness>;
23
- getCompleteAddress(): CompleteAddress;
24
- getAddress(): AztecAddress;
25
- getChainId(): Fr;
26
- getVersion(): Fr;
27
- }
28
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNjb3VudF9pbnRlcmZhY2UuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kZWZhdWx0cy9hY2NvdW50X2ludGVyZmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxtQkFBbUIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQ3JGLE9BQU8sRUFBNEIsS0FBSywrQkFBK0IsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBQzVHLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxtQkFBbUIsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBQ3BGLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUM5QyxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQUM5RCxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDekQsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDckQsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUU3RTs7O0dBR0c7QUFDSCxxQkFBYSx1QkFBd0IsWUFBVyxnQkFBZ0I7SUFPNUQsT0F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AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE7E;;;GAGG;AACH,qBAAa,uBAAwB,YAAW,gBAAgB;IAO5D,OAAO,CAAC,mBAAmB;IAC3B,OAAO,CAAC,OAAO;IAPjB,SAAS,CAAC,UAAU,EAAE,mBAAmB,CAAC;IAE1C,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,OAAO,CAAK;IAEpB,YACU,mBAAmB,EAAE,mBAAmB,EACxC,OAAO,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EAUrB;IAED,wBAAwB,CACtB,IAAI,EAAE,gBAAgB,EACtB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,kBAAkB,CAAC,CAE7B;IAED,aAAa,CAAC,WAAW,EAAE,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAEnD;IAED,kBAAkB,IAAI,eAAe,CAEpC;IAED,UAAU,IAAI,YAAY,CAEzB;IAED,UAAU,IAAI,EAAE,CAEf;IAED,UAAU,IAAI,EAAE,CAEf;CACF"}
@@ -1,36 +0,0 @@
1
- import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
2
- /**
3
- * Default implementation for an account interface. Requires that the account uses the default
4
- * entrypoint signature, which accept an AppPayload and a FeePayload as defined in noir-libs/aztec-noir/src/entrypoint module
5
- */ export class DefaultAccountInterface {
6
- authWitnessProvider;
7
- address;
8
- entrypoint;
9
- chainId;
10
- version;
11
- constructor(authWitnessProvider, address, chainInfo){
12
- this.authWitnessProvider = authWitnessProvider;
13
- this.address = address;
14
- this.entrypoint = new DefaultAccountEntrypoint(address.address, authWitnessProvider, chainInfo.chainId.toNumber(), chainInfo.version.toNumber());
15
- this.chainId = chainInfo.chainId;
16
- this.version = chainInfo.version;
17
- }
18
- createTxExecutionRequest(exec, gasSettings, options) {
19
- return this.entrypoint.createTxExecutionRequest(exec, gasSettings, options);
20
- }
21
- createAuthWit(messageHash) {
22
- return this.authWitnessProvider.createAuthWit(messageHash);
23
- }
24
- getCompleteAddress() {
25
- return this.address;
26
- }
27
- getAddress() {
28
- return this.address.address;
29
- }
30
- getChainId() {
31
- return this.chainId;
32
- }
33
- getVersion() {
34
- return this.version;
35
- }
36
- }
@@ -1,63 +0,0 @@
1
- import type { AccountInterface, AuthWitnessProvider } from '@aztec/aztec.js/account';
2
- import { DefaultAccountEntrypoint, type DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
3
- import type { ChainInfo, EntrypointInterface } from '@aztec/entrypoints/interfaces';
4
- import { Fr } from '@aztec/foundation/fields';
5
- import type { AuthWitness } from '@aztec/stdlib/auth-witness';
6
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
7
- import { CompleteAddress } from '@aztec/stdlib/contract';
8
- import type { GasSettings } from '@aztec/stdlib/gas';
9
- import type { ExecutionPayload, TxExecutionRequest } from '@aztec/stdlib/tx';
10
-
11
- /**
12
- * Default implementation for an account interface. Requires that the account uses the default
13
- * entrypoint signature, which accept an AppPayload and a FeePayload as defined in noir-libs/aztec-noir/src/entrypoint module
14
- */
15
- export class DefaultAccountInterface implements AccountInterface {
16
- protected entrypoint: EntrypointInterface;
17
-
18
- private chainId: Fr;
19
- private version: Fr;
20
-
21
- constructor(
22
- private authWitnessProvider: AuthWitnessProvider,
23
- private address: CompleteAddress,
24
- chainInfo: ChainInfo,
25
- ) {
26
- this.entrypoint = new DefaultAccountEntrypoint(
27
- address.address,
28
- authWitnessProvider,
29
- chainInfo.chainId.toNumber(),
30
- chainInfo.version.toNumber(),
31
- );
32
- this.chainId = chainInfo.chainId;
33
- this.version = chainInfo.version;
34
- }
35
-
36
- createTxExecutionRequest(
37
- exec: ExecutionPayload,
38
- gasSettings: GasSettings,
39
- options: DefaultAccountEntrypointOptions,
40
- ): Promise<TxExecutionRequest> {
41
- return this.entrypoint.createTxExecutionRequest(exec, gasSettings, options);
42
- }
43
-
44
- createAuthWit(messageHash: Fr): Promise<AuthWitness> {
45
- return this.authWitnessProvider.createAuthWit(messageHash);
46
- }
47
-
48
- getCompleteAddress(): CompleteAddress {
49
- return this.address;
50
- }
51
-
52
- getAddress(): AztecAddress {
53
- return this.address.address;
54
- }
55
-
56
- getChainId(): Fr {
57
- return this.chainId;
58
- }
59
-
60
- getVersion(): Fr {
61
- return this.version;
62
- }
63
- }