@aztec/aztec.js 0.1.0-alpha62 → 0.6.2

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 (69) hide show
  1. package/.tsbuildinfo +1 -1
  2. package/dest/abis/ecdsa_account_contract.json +3 -3
  3. package/dest/abis/schnorr_account_contract.json +3 -3
  4. package/dest/abis/schnorr_auth_witness_account_contract.json +3 -3
  5. package/dest/abis/schnorr_single_key_account_contract.json +2 -2
  6. package/dest/account/account.d.ts +2 -2
  7. package/dest/account/account.d.ts.map +1 -1
  8. package/dest/account/account.js +1 -1
  9. package/dest/account/contract/auth_witness_account_contract.d.ts +2 -2
  10. package/dest/account/contract/auth_witness_account_contract.d.ts.map +1 -1
  11. package/dest/account/contract/auth_witness_account_contract.js +1 -1
  12. package/dest/account/contract/ecdsa_account_contract.d.ts +2 -2
  13. package/dest/account/contract/ecdsa_account_contract.d.ts.map +1 -1
  14. package/dest/account/contract/ecdsa_account_contract.js +4 -2
  15. package/dest/account/contract/schnorr_account_contract.d.ts +2 -2
  16. package/dest/account/contract/schnorr_account_contract.d.ts.map +1 -1
  17. package/dest/account/contract/schnorr_account_contract.js +4 -2
  18. package/dest/account/contract/single_key_account_contract.d.ts +2 -2
  19. package/dest/account/contract/single_key_account_contract.d.ts.map +1 -1
  20. package/dest/account/contract/single_key_account_contract.js +3 -4
  21. package/dest/account/entrypoint/auth_witness_account_entrypoint.d.ts +3 -3
  22. package/dest/account/entrypoint/auth_witness_account_entrypoint.d.ts.map +1 -1
  23. package/dest/account/entrypoint/auth_witness_account_entrypoint.js +1 -1
  24. package/dest/account/entrypoint/single_key_account_entrypoint.d.ts +2 -4
  25. package/dest/account/entrypoint/single_key_account_entrypoint.d.ts.map +1 -1
  26. package/dest/account/entrypoint/single_key_account_entrypoint.js +5 -4
  27. package/dest/account/entrypoint/stored_key_account_entrypoint.d.ts +5 -5
  28. package/dest/account/entrypoint/stored_key_account_entrypoint.d.ts.map +1 -1
  29. package/dest/account/entrypoint/stored_key_account_entrypoint.js +4 -5
  30. package/dest/account/index.d.ts +6 -5
  31. package/dest/account/index.d.ts.map +1 -1
  32. package/dest/account/index.js +1 -1
  33. package/dest/aztec_rpc_client/aztec_rpc_client.js +3 -3
  34. package/dest/aztec_rpc_client/wallet.d.ts +2 -2
  35. package/dest/aztec_rpc_client/wallet.d.ts.map +1 -1
  36. package/dest/aztec_rpc_client/wallet.js +1 -1
  37. package/dest/index.d.ts +4 -3
  38. package/dest/index.d.ts.map +1 -1
  39. package/dest/index.js +4 -3
  40. package/dest/main.js +1 -1
  41. package/dest/sandbox/index.d.ts +4 -4
  42. package/dest/sandbox/index.d.ts.map +1 -1
  43. package/dest/sandbox/index.js +5 -5
  44. package/dest/utils/account.d.ts +3 -3
  45. package/dest/utils/account.d.ts.map +1 -1
  46. package/dest/utils/account.js +7 -5
  47. package/dest/utils/pub_key.d.ts +2 -2
  48. package/dest/utils/pub_key.d.ts.map +1 -1
  49. package/dest/utils/pub_key.js +1 -1
  50. package/package.json +4 -4
  51. package/src/abis/ecdsa_account_contract.json +3 -3
  52. package/src/abis/schnorr_account_contract.json +3 -3
  53. package/src/abis/schnorr_auth_witness_account_contract.json +3 -3
  54. package/src/abis/schnorr_single_key_account_contract.json +2 -2
  55. package/src/account/account.ts +2 -2
  56. package/src/account/contract/auth_witness_account_contract.ts +2 -2
  57. package/src/account/contract/ecdsa_account_contract.ts +5 -3
  58. package/src/account/contract/schnorr_account_contract.ts +5 -3
  59. package/src/account/contract/single_key_account_contract.ts +5 -11
  60. package/src/account/entrypoint/auth_witness_account_entrypoint.ts +4 -4
  61. package/src/account/entrypoint/single_key_account_entrypoint.ts +5 -5
  62. package/src/account/entrypoint/stored_key_account_entrypoint.ts +4 -5
  63. package/src/account/index.ts +7 -7
  64. package/src/aztec_rpc_client/aztec_rpc_client.ts +2 -2
  65. package/src/aztec_rpc_client/wallet.ts +2 -2
  66. package/src/index.ts +4 -3
  67. package/src/sandbox/index.ts +4 -4
  68. package/src/utils/account.ts +11 -15
  69. package/src/utils/pub_key.ts +2 -2
@@ -1,6 +1,6 @@
1
1
  import { Schnorr } from '@aztec/circuits.js/barretenberg';
2
2
  import { ContractAbi } from '@aztec/foundation/abi';
3
- import { CompleteAddress, NodeInfo, PrivateKey } from '@aztec/types';
3
+ import { CompleteAddress, GrumpkinPrivateKey, NodeInfo } from '@aztec/types';
4
4
 
5
5
  import SchnorrAccountContractAbi from '../../abis/schnorr_account_contract.json' assert { type: 'json' };
6
6
  import { StoredKeyAccountEntrypoint } from '../entrypoint/stored_key_account_entrypoint.js';
@@ -11,7 +11,7 @@ import { AccountContract } from './index.js';
11
11
  * verified against a Grumpkin public key stored in an immutable encrypted note.
12
12
  */
13
13
  export class SchnorrAccountContract implements AccountContract {
14
- constructor(private signingPrivateKey: PrivateKey) {}
14
+ constructor(private signingPrivateKey: GrumpkinPrivateKey) {}
15
15
 
16
16
  public async getDeploymentArgs() {
17
17
  const signingPublicKey = await Schnorr.new().then(e => e.computePublicKey(this.signingPrivateKey));
@@ -19,7 +19,9 @@ export class SchnorrAccountContract implements AccountContract {
19
19
  }
20
20
 
21
21
  public async getEntrypoint({ address }: CompleteAddress, { chainId, version }: NodeInfo) {
22
- return new StoredKeyAccountEntrypoint(address, this.signingPrivateKey, await Schnorr.new(), chainId, version);
22
+ const schnorr = await Schnorr.new();
23
+ const signClosure = (msg: Buffer) => schnorr.constructSignature(msg, this.signingPrivateKey);
24
+ return new StoredKeyAccountEntrypoint(address, signClosure, chainId, version);
23
25
  }
24
26
 
25
27
  public getContractAbi(): ContractAbi {
@@ -1,6 +1,5 @@
1
- import { Schnorr } from '@aztec/circuits.js/barretenberg';
2
1
  import { ContractAbi } from '@aztec/foundation/abi';
3
- import { CompleteAddress, NodeInfo, PrivateKey } from '@aztec/types';
2
+ import { CompleteAddress, GrumpkinPrivateKey, NodeInfo } from '@aztec/types';
4
3
 
5
4
  import SchnorrSingleKeyAccountContractAbi from '../../abis/schnorr_single_key_account_contract.json' assert { type: 'json' };
6
5
  import { SingleKeyAccountEntrypoint } from '../entrypoint/single_key_account_entrypoint.js';
@@ -11,20 +10,15 @@ import { AccountContract } from './index.js';
11
10
  * the note encryption key, relying on a single private key for both encryption and authentication.
12
11
  */
13
12
  export class SingleKeyAccountContract implements AccountContract {
14
- constructor(private encryptionPrivateKey: PrivateKey) {}
13
+ constructor(private encryptionPrivateKey: GrumpkinPrivateKey) {}
15
14
 
16
15
  public getDeploymentArgs() {
17
16
  return Promise.resolve([]);
18
17
  }
19
18
 
20
- public async getEntrypoint({ address, partialAddress }: CompleteAddress, { chainId, version }: NodeInfo) {
21
- return new SingleKeyAccountEntrypoint(
22
- address,
23
- partialAddress,
24
- this.encryptionPrivateKey,
25
- await Schnorr.new(),
26
- chainId,
27
- version,
19
+ public getEntrypoint({ address, partialAddress }: CompleteAddress, { chainId, version }: NodeInfo) {
20
+ return Promise.resolve(
21
+ new SingleKeyAccountEntrypoint(address, partialAddress, this.encryptionPrivateKey, chainId, version),
28
22
  );
29
23
  }
30
24
 
@@ -1,5 +1,5 @@
1
- import { AztecAddress, Fr, FunctionData, PartialAddress, PrivateKey, TxContext } from '@aztec/circuits.js';
2
- import { Signer } from '@aztec/circuits.js/barretenberg';
1
+ import { AztecAddress, Fr, FunctionData, GrumpkinPrivateKey, PartialAddress, TxContext } from '@aztec/circuits.js';
2
+ import { Schnorr } from '@aztec/circuits.js/barretenberg';
3
3
  import { ContractAbi, FunctionAbi, encodeArguments } from '@aztec/foundation/abi';
4
4
  import { FunctionCall, PackedArguments, TxExecutionRequest } from '@aztec/types';
5
5
 
@@ -19,8 +19,8 @@ export class AuthWitnessAccountEntrypoint implements Entrypoint {
19
19
  constructor(
20
20
  private address: AztecAddress,
21
21
  private partialAddress: PartialAddress,
22
- private privateKey: PrivateKey,
23
- private signer: Signer,
22
+ private privateKey: GrumpkinPrivateKey,
23
+ private signer: Schnorr,
24
24
  private chainId: number = DEFAULT_CHAIN_ID,
25
25
  private version: number = DEFAULT_VERSION,
26
26
  ) {}
@@ -1,5 +1,5 @@
1
- import { AztecAddress, FunctionData, PartialAddress, PrivateKey, TxContext } from '@aztec/circuits.js';
2
- import { Signer } from '@aztec/circuits.js/barretenberg';
1
+ import { AztecAddress, FunctionData, GrumpkinPrivateKey, PartialAddress, TxContext } from '@aztec/circuits.js';
2
+ import { Schnorr } from '@aztec/circuits.js/barretenberg';
3
3
  import { ContractAbi, encodeArguments } from '@aztec/foundation/abi';
4
4
  import { FunctionCall, PackedArguments, TxExecutionRequest } from '@aztec/types';
5
5
 
@@ -18,8 +18,7 @@ export class SingleKeyAccountEntrypoint implements Entrypoint {
18
18
  constructor(
19
19
  private address: AztecAddress,
20
20
  private partialAddress: PartialAddress,
21
- private privateKey: PrivateKey,
22
- private signer: Signer,
21
+ private privateKey: GrumpkinPrivateKey,
23
22
  private chainId: number = DEFAULT_CHAIN_ID,
24
23
  private version: number = DEFAULT_VERSION,
25
24
  ) {}
@@ -35,7 +34,8 @@ export class SingleKeyAccountEntrypoint implements Entrypoint {
35
34
  const { payload, packedArguments: callsPackedArguments } = await buildPayload(executions);
36
35
  const message = await hashPayload(payload);
37
36
 
38
- const signature = this.signer.constructSignature(message, this.privateKey).toBuffer();
37
+ const signer = await Schnorr.new();
38
+ const signature = signer.constructSignature(message, this.privateKey).toBuffer();
39
39
  const publicKey = await generatePublicKey(this.privateKey);
40
40
  const args = [payload, publicKey.toBuffer(), signature, this.partialAddress];
41
41
  const abi = this.getEntrypointAbi();
@@ -1,5 +1,5 @@
1
- import { AztecAddress, FunctionData, PrivateKey, TxContext } from '@aztec/circuits.js';
2
- import { Signer } from '@aztec/circuits.js/barretenberg';
1
+ import { AztecAddress, FunctionData, TxContext } from '@aztec/circuits.js';
2
+ import { Signature } from '@aztec/circuits.js/barretenberg';
3
3
  import { ContractAbi, encodeArguments } from '@aztec/foundation/abi';
4
4
  import { DebugLogger, createDebugLogger } from '@aztec/foundation/log';
5
5
  import { FunctionCall, PackedArguments, TxExecutionRequest } from '@aztec/types';
@@ -18,8 +18,7 @@ export class StoredKeyAccountEntrypoint implements Entrypoint {
18
18
 
19
19
  constructor(
20
20
  private address: AztecAddress,
21
- private privateKey: PrivateKey,
22
- private signer: Signer,
21
+ private sign: (msg: Buffer) => Signature,
23
22
  private chainId: number = DEFAULT_CHAIN_ID,
24
23
  private version: number = DEFAULT_VERSION,
25
24
  ) {
@@ -36,7 +35,7 @@ export class StoredKeyAccountEntrypoint implements Entrypoint {
36
35
 
37
36
  const { payload, packedArguments: callsPackedArguments } = await buildPayload(executions);
38
37
  const message = await hashPayload(payload);
39
- const signature = this.signer.constructSignature(message, this.privateKey).toBuffer();
38
+ const signature = this.sign(message).toBuffer();
40
39
  this.log(`Signed challenge ${message.toString('hex')} as ${signature.toString('hex')}`);
41
40
 
42
41
  const args = [payload, signature];
@@ -1,4 +1,4 @@
1
- import { AztecRPC, CompleteAddress, PrivateKey } from '@aztec/types';
1
+ import { AztecRPC, CompleteAddress, GrumpkinPrivateKey } from '@aztec/types';
2
2
 
3
3
  import { AccountContract, AccountWallet, AztecAddress, Fr } from '../index.js';
4
4
  import { Account } from './account.js';
@@ -23,8 +23,8 @@ export type Salt = Fr | number | bigint;
23
23
  */
24
24
  export function getEcdsaAccount(
25
25
  rpc: AztecRPC,
26
- encryptionPrivateKey: PrivateKey,
27
- signingPrivateKey: PrivateKey,
26
+ encryptionPrivateKey: GrumpkinPrivateKey,
27
+ signingPrivateKey: Buffer,
28
28
  saltOrAddress?: Salt | CompleteAddress,
29
29
  ): Account {
30
30
  return new Account(rpc, encryptionPrivateKey, new EcdsaAccountContract(signingPrivateKey), saltOrAddress);
@@ -39,8 +39,8 @@ export function getEcdsaAccount(
39
39
  */
40
40
  export function getSchnorrAccount(
41
41
  rpc: AztecRPC,
42
- encryptionPrivateKey: PrivateKey,
43
- signingPrivateKey: PrivateKey,
42
+ encryptionPrivateKey: GrumpkinPrivateKey,
43
+ signingPrivateKey: GrumpkinPrivateKey,
44
44
  saltOrAddress?: Salt | CompleteAddress,
45
45
  ): Account {
46
46
  return new Account(rpc, encryptionPrivateKey, new SchnorrAccountContract(signingPrivateKey), saltOrAddress);
@@ -54,7 +54,7 @@ export function getSchnorrAccount(
54
54
  */
55
55
  export function getUnsafeSchnorrAccount(
56
56
  rpc: AztecRPC,
57
- encryptionAndSigningPrivateKey: PrivateKey,
57
+ encryptionAndSigningPrivateKey: GrumpkinPrivateKey,
58
58
  saltOrAddress?: Salt | CompleteAddress,
59
59
  ): Account {
60
60
  return new Account(
@@ -75,7 +75,7 @@ export function getUnsafeSchnorrAccount(
75
75
  export function getUnsafeSchnorrWallet(
76
76
  rpc: AztecRPC,
77
77
  address: AztecAddress,
78
- signingKey: PrivateKey,
78
+ signingKey: GrumpkinPrivateKey,
79
79
  ): Promise<AccountWallet> {
80
80
  return getWallet(rpc, address, new SingleKeyAccountContract(signingKey));
81
81
  }
@@ -1,4 +1,4 @@
1
- import { AztecAddress, CompleteAddress, EthAddress, Fr, Point, PrivateKey } from '@aztec/circuits.js';
1
+ import { AztecAddress, CompleteAddress, EthAddress, Fr, GrumpkinScalar, Point } from '@aztec/circuits.js';
2
2
  import { createJsonRpcClient, defaultFetch } from '@aztec/foundation/json-rpc/client';
3
3
  import {
4
4
  AztecRPC,
@@ -26,8 +26,8 @@ export const createAztecRpcClient = (url: string, fetch = defaultFetch): AztecRP
26
26
  TxHash,
27
27
  EthAddress,
28
28
  Point,
29
- PrivateKey,
30
29
  Fr,
30
+ GrumpkinScalar,
31
31
  NotePreimage,
32
32
  },
33
33
  { Tx, TxReceipt, L2BlockL2Logs },
@@ -1,4 +1,4 @@
1
- import { AztecAddress, CircuitsWasm, Fr, PartialAddress, PrivateKey, TxContext } from '@aztec/circuits.js';
1
+ import { AztecAddress, CircuitsWasm, Fr, GrumpkinPrivateKey, PartialAddress, TxContext } from '@aztec/circuits.js';
2
2
  import {
3
3
  AztecRPC,
4
4
  ContractData,
@@ -32,7 +32,7 @@ export abstract class BaseWallet implements Wallet {
32
32
 
33
33
  abstract createTxExecutionRequest(execs: FunctionCall[], opts?: CreateTxRequestOpts): Promise<TxExecutionRequest>;
34
34
 
35
- registerAccount(privKey: PrivateKey, partialAddress: PartialAddress): Promise<void> {
35
+ registerAccount(privKey: GrumpkinPrivateKey, partialAddress: PartialAddress): Promise<void> {
36
36
  return this.rpc.registerAccount(privKey, partialAddress);
37
37
  }
38
38
  registerRecipient(account: CompleteAddress): Promise<void> {
package/src/index.ts CHANGED
@@ -6,7 +6,7 @@ export * from './account/index.js';
6
6
  export * from './contract_deployer/deploy_method.js';
7
7
  export * from './sandbox/index.js';
8
8
 
9
- export { AztecAddress, EthAddress, Point, Fr } from '@aztec/circuits.js';
9
+ export { AztecAddress, EthAddress, Point, Fr, GrumpkinScalar } from '@aztec/circuits.js';
10
10
  export {
11
11
  AztecRPC,
12
12
  ContractData,
@@ -17,7 +17,7 @@ export {
17
17
  NodeInfo,
18
18
  PackedArguments,
19
19
  PublicKey,
20
- PrivateKey,
20
+ GrumpkinPrivateKey,
21
21
  SyncStatus,
22
22
  Tx,
23
23
  TxExecutionRequest,
@@ -27,5 +27,6 @@ export {
27
27
  emptyFunctionCall,
28
28
  } from '@aztec/types';
29
29
 
30
- export { createDebugLogger } from '@aztec/foundation/log';
30
+ export { createDebugLogger, DebugLogger } from '@aztec/foundation/log';
31
+ export { fileURLToPath } from '@aztec/foundation/url';
31
32
  export { sleep } from '@aztec/foundation/sleep';
@@ -1,4 +1,4 @@
1
- import { Fr, PrivateKey } from '@aztec/circuits.js';
1
+ import { Fr, GrumpkinScalar } from '@aztec/circuits.js';
2
2
  import { ContractAbi } from '@aztec/foundation/abi';
3
3
  import { sleep } from '@aztec/foundation/sleep';
4
4
 
@@ -8,9 +8,9 @@ import SchnorrAccountContractAbi from '../abis/schnorr_account_contract.json' as
8
8
  import { AccountWallet, AztecRPC, EntrypointWallet, getAccountWallets, getSchnorrAccount } from '../index.js';
9
9
 
10
10
  export const INITIAL_SANDBOX_ENCRYPTION_KEYS = [
11
- new PrivateKey(Buffer.from('b2803ec899f76f6b2ac011480d24028f1a29587f8a3a92f7ee9d48d8c085c284', 'hex')),
12
- new PrivateKey(Buffer.from('6bb46e9a80da2ff7bfff71c2c50eaaa4b15f7ed5ad1ade4261b574ef80b0cdb0', 'hex')),
13
- new PrivateKey(Buffer.from('0f6addf0da06c33293df974a565b03d1ab096090d907d98055a8b7f4954e120c', 'hex')),
11
+ GrumpkinScalar.fromString('2153536ff6628eee01cf4024889ff977a18d9fa61d0e414422f7681cf085c281'),
12
+ GrumpkinScalar.fromString('aebd1b4be76efa44f5ee655c20bf9ea60f7ae44b9a7fd1fd9f189c7a0b0cdae'),
13
+ GrumpkinScalar.fromString('0f6addf0da06c33293df974a565b03d1ab096090d907d98055a8b7f4954e120c'),
14
14
  ];
15
15
 
16
16
  export const INITIAL_SANDBOX_SIGNING_KEYS = INITIAL_SANDBOX_ENCRYPTION_KEYS;
@@ -1,4 +1,4 @@
1
- import { Fr, PrivateKey, getContractDeploymentInfo } from '@aztec/circuits.js';
1
+ import { Fr, GrumpkinPrivateKey, GrumpkinScalar, getContractDeploymentInfo } from '@aztec/circuits.js';
2
2
  import { Schnorr } from '@aztec/circuits.js/barretenberg';
3
3
  import { ContractAbi } from '@aztec/foundation/abi';
4
4
  import { createDebugLogger } from '@aztec/foundation/log';
@@ -15,7 +15,7 @@ import { ContractDeployer, EntrypointCollection, StoredKeyAccountEntrypoint, gen
15
15
  export async function createAccounts(
16
16
  aztecRpcClient: AztecRPC,
17
17
  accountContractAbi: ContractAbi,
18
- privateKey?: PrivateKey,
18
+ privateKey?: GrumpkinPrivateKey,
19
19
  salt = Fr.random(),
20
20
  numberOfAccounts = 1,
21
21
  logger = createDebugLogger('aztec:aztec.js:accounts'),
@@ -24,7 +24,7 @@ export async function createAccounts(
24
24
 
25
25
  for (let i = 0; i < numberOfAccounts; ++i) {
26
26
  // TODO(#662): Let the aztec rpc server generate the keypair rather than hardcoding the private key
27
- const privKey = i == 0 && privateKey ? privateKey : PrivateKey.random();
27
+ const privKey = i == 0 && privateKey ? privateKey : GrumpkinScalar.random();
28
28
  const publicKey = await generatePublicKey(privKey);
29
29
  const deploymentInfo = await getContractDeploymentInfo(accountContractAbi, [], salt, publicKey);
30
30
  await aztecRpcClient.registerAccount(privKey, deploymentInfo.completeAddress.partialAddress);
@@ -44,12 +44,7 @@ export async function createAccounts(
44
44
  logger(`Created account ${address.toString()} with public key ${publicKey.toString()}`);
45
45
  accountImpls.registerAccount(
46
46
  address,
47
- new SingleKeyAccountEntrypoint(
48
- address,
49
- deploymentInfo.completeAddress.partialAddress,
50
- privKey,
51
- await Schnorr.new(),
52
- ),
47
+ new SingleKeyAccountEntrypoint(address, deploymentInfo.completeAddress.partialAddress, privKey),
53
48
  );
54
49
  }
55
50
  return new EntrypointWallet(aztecRpcClient, accountImpls);
@@ -67,14 +62,16 @@ export async function createAccounts(
67
62
  export async function getAccountWallets(
68
63
  aztecRpcClient: AztecRPC,
69
64
  accountContractAbi: ContractAbi,
70
- privateKeys: PrivateKey[],
71
- signingKeys: PrivateKey[],
65
+ privateKeys: GrumpkinPrivateKey[],
66
+ signingKeys: GrumpkinPrivateKey[],
72
67
  salts: Fr[],
73
68
  ) {
74
69
  if (privateKeys.length != salts.length || signingKeys.length != privateKeys.length) {
75
70
  throw new Error('Keys and salts must be the same length');
76
71
  }
77
72
  const accountCollection = new EntrypointCollection();
73
+ const schnorr = await Schnorr.new();
74
+
78
75
  for (let i = 0; i < privateKeys.length; i++) {
79
76
  const publicKey = await generatePublicKey(privateKeys[i]);
80
77
  const signingPublicKey = await generatePublicKey(signingKeys[i]);
@@ -86,10 +83,9 @@ export async function getAccountWallets(
86
83
  );
87
84
  const address = deploymentInfo.completeAddress.address;
88
85
 
89
- accountCollection.registerAccount(
90
- address,
91
- new StoredKeyAccountEntrypoint(address, signingKeys[i], await Schnorr.new()),
92
- );
86
+ const signClosure = (msg: Buffer) => schnorr.constructSignature(msg, signingKeys[i]);
87
+
88
+ accountCollection.registerAccount(address, new StoredKeyAccountEntrypoint(address, signClosure));
93
89
  }
94
90
  return new EntrypointWallet(aztecRpcClient, accountCollection);
95
91
  }
@@ -1,4 +1,4 @@
1
- import { PrivateKey, PublicKey } from '@aztec/circuits.js';
1
+ import { GrumpkinPrivateKey, PublicKey } from '@aztec/circuits.js';
2
2
  import { Grumpkin } from '@aztec/circuits.js/barretenberg';
3
3
 
4
4
  /**
@@ -6,7 +6,7 @@ import { Grumpkin } from '@aztec/circuits.js/barretenberg';
6
6
  * @param privateKey - The private key.
7
7
  * @returns The generated public key.
8
8
  */
9
- export async function generatePublicKey(privateKey: PrivateKey): Promise<PublicKey> {
9
+ export async function generatePublicKey(privateKey: GrumpkinPrivateKey): Promise<PublicKey> {
10
10
  const grumpkin = await Grumpkin.new();
11
11
  return grumpkin.mul(grumpkin.generator(), privateKey);
12
12
  }