@aztec/accounts 2.1.0-rc.9 → 3.0.0-devnet.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.
- package/artifacts/EcdsaKAccount.json +888 -1159
- package/artifacts/EcdsaRAccount.json +888 -1159
- package/artifacts/SchnorrAccount.json +992 -1262
- package/artifacts/SchnorrSingleKeyAccount.json +456 -672
- package/artifacts/SimulatedAccount.json +420 -644
- package/dest/defaults/account_contract.d.ts +3 -3
- package/dest/defaults/account_contract.d.ts.map +1 -1
- package/dest/defaults/account_contract.js +2 -2
- package/dest/defaults/account_interface.d.ts +5 -4
- package/dest/defaults/account_interface.d.ts.map +1 -1
- package/dest/defaults/account_interface.js +6 -7
- package/dest/ecdsa/ecdsa_k/index.d.ts +0 -22
- package/dest/ecdsa/ecdsa_k/index.d.ts.map +1 -1
- package/dest/ecdsa/ecdsa_k/index.js +1 -22
- package/dest/ecdsa/ecdsa_k/lazy.d.ts +0 -22
- package/dest/ecdsa/ecdsa_k/lazy.d.ts.map +1 -1
- package/dest/ecdsa/ecdsa_k/lazy.js +5 -26
- package/dest/ecdsa/ecdsa_r/index.d.ts +0 -22
- package/dest/ecdsa/ecdsa_r/index.d.ts.map +1 -1
- package/dest/ecdsa/ecdsa_r/index.js +1 -22
- package/dest/ecdsa/ecdsa_r/lazy.d.ts +0 -22
- package/dest/ecdsa/ecdsa_r/lazy.d.ts.map +1 -1
- package/dest/ecdsa/ecdsa_r/lazy.js +5 -26
- package/dest/ecdsa/ssh_ecdsa_r/index.d.ts +1 -23
- package/dest/ecdsa/ssh_ecdsa_r/index.d.ts.map +1 -1
- package/dest/ecdsa/ssh_ecdsa_r/index.js +3 -24
- package/dest/ecdsa/ssh_ecdsa_r/lazy.d.ts +1 -23
- package/dest/ecdsa/ssh_ecdsa_r/lazy.d.ts.map +1 -1
- package/dest/ecdsa/ssh_ecdsa_r/lazy.js +3 -24
- package/dest/schnorr/index.d.ts +1 -36
- package/dest/schnorr/index.d.ts.map +1 -1
- package/dest/schnorr/index.js +1 -32
- package/dest/schnorr/lazy.d.ts +1 -36
- package/dest/schnorr/lazy.d.ts.map +1 -1
- package/dest/schnorr/lazy.js +5 -36
- package/dest/single_key/index.d.ts +1 -20
- package/dest/single_key/index.d.ts.map +1 -1
- package/dest/single_key/index.js +1 -23
- package/dest/single_key/lazy.d.ts +1 -20
- package/dest/single_key/lazy.d.ts.map +1 -1
- package/dest/single_key/lazy.js +5 -27
- package/dest/stub/account_contract.d.ts +29 -0
- package/dest/stub/account_contract.d.ts.map +1 -0
- package/dest/stub/account_contract.js +30 -0
- package/dest/stub/index.d.ts +21 -0
- package/dest/stub/index.d.ts.map +1 -0
- package/dest/stub/index.js +29 -0
- package/dest/stub/lazy.d.ts +23 -0
- package/dest/stub/lazy.d.ts.map +1 -0
- package/dest/stub/lazy.js +35 -0
- package/dest/testing/index.d.ts +5 -35
- package/dest/testing/index.d.ts.map +1 -1
- package/dest/testing/index.js +18 -34
- package/dest/testing/lazy.d.ts +4 -27
- package/dest/testing/lazy.d.ts.map +1 -1
- package/dest/testing/lazy.js +18 -29
- package/package.json +8 -6
- package/src/defaults/account_contract.ts +4 -4
- package/src/defaults/account_interface.ts +11 -11
- package/src/ecdsa/ecdsa_k/index.ts +0 -32
- package/src/ecdsa/ecdsa_k/lazy.ts +4 -36
- package/src/ecdsa/ecdsa_r/index.ts +0 -32
- package/src/ecdsa/ecdsa_r/lazy.ts +4 -36
- package/src/ecdsa/ssh_ecdsa_r/index.ts +2 -35
- package/src/ecdsa/ssh_ecdsa_r/lazy.ts +2 -35
- package/src/schnorr/index.ts +7 -55
- package/src/schnorr/lazy.ts +11 -59
- package/src/single_key/index.ts +1 -32
- package/src/single_key/lazy.ts +5 -36
- package/src/stub/account_contract.ts +39 -0
- package/src/stub/index.ts +41 -0
- package/src/stub/lazy.ts +49 -0
- package/src/testing/index.ts +19 -56
- package/src/testing/lazy.ts +17 -49
- package/dest/copy_cat/base.d.ts +0 -18
- package/dest/copy_cat/base.d.ts.map +0 -1
- package/dest/copy_cat/base.js +0 -28
- package/dest/copy_cat/index.d.ts +0 -10
- package/dest/copy_cat/index.d.ts.map +0 -1
- package/dest/copy_cat/index.js +0 -31
- package/dest/copy_cat/lazy.d.ts +0 -9
- package/dest/copy_cat/lazy.d.ts.map +0 -1
- package/dest/copy_cat/lazy.js +0 -29
- package/dest/testing/create_account.d.ts +0 -43
- package/dest/testing/create_account.d.ts.map +0 -1
- package/dest/testing/create_account.js +0 -61
- package/src/copy_cat/base.ts +0 -47
- package/src/copy_cat/index.ts +0 -44
- package/src/copy_cat/lazy.ts +0 -40
- package/src/testing/create_account.ts +0 -111
package/dest/schnorr/index.d.ts
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
* The `@aztec/accounts/schnorr` export provides an account contract implementation that uses Schnorr signatures with a Grumpkin key for authentication, and a separate Grumpkin key for encryption.
|
|
3
|
-
* This is the suggested account contract type for most use cases within Aztec.
|
|
4
|
-
*
|
|
5
|
-
* @packageDocumentation
|
|
6
|
-
*/
|
|
7
|
-
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
|
|
8
|
-
import { type AccountWallet, type AccountWalletWithSecretKey } from '@aztec/aztec.js/wallet';
|
|
1
|
+
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
9
2
|
import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';
|
|
10
3
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
11
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
12
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
13
4
|
import { SchnorrBaseAccountContract } from './account_contract.js';
|
|
14
5
|
export declare const SchnorrAccountContractArtifact: ContractArtifact;
|
|
15
6
|
/**
|
|
@@ -21,32 +12,6 @@ export declare class SchnorrAccountContract extends SchnorrBaseAccountContract {
|
|
|
21
12
|
constructor(signingPrivateKey: GrumpkinScalar);
|
|
22
13
|
getContractArtifact(): Promise<ContractArtifact>;
|
|
23
14
|
}
|
|
24
|
-
/**
|
|
25
|
-
* Creates an Account Manager that relies on a Grumpkin signing key for authentication.
|
|
26
|
-
* @param pxe - An PXE server instance.
|
|
27
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
28
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
29
|
-
* @param salt - Deployment salt.
|
|
30
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
31
|
-
*/
|
|
32
|
-
export declare function getSchnorrAccount(pxe: PXE, secretKey: Fr, signingPrivateKey: GrumpkinScalar, salt?: Salt): Promise<AccountManager>;
|
|
33
|
-
/**
|
|
34
|
-
* Gets a wallet for an already registered account using Schnorr signatures.
|
|
35
|
-
* @param pxe - An PXE server instance.
|
|
36
|
-
* @param address - Address for the account.
|
|
37
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
38
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
39
|
-
*/
|
|
40
|
-
export declare function getSchnorrWallet(pxe: PXE, address: AztecAddress, signingPrivateKey: GrumpkinScalar): Promise<AccountWallet>;
|
|
41
|
-
/**
|
|
42
|
-
* Gets a wallet for an already registered account using Schnorr signatures.
|
|
43
|
-
* @param pxe - An PXE server instance.
|
|
44
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
45
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
46
|
-
* @param salt - Deployment salt.
|
|
47
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
48
|
-
*/
|
|
49
|
-
export declare function getSchnorrWalletWithSecretKey(pxe: PXE, secretKey: Fr, signingPrivateKey: GrumpkinScalar, salt: Salt): Promise<AccountWalletWithSecretKey>;
|
|
50
15
|
/**
|
|
51
16
|
* Compute the address of a schnorr account contract.
|
|
52
17
|
* @param secret - A seed for deriving the signing key and public keys.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schnorr/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schnorr/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAM1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,eAAO,MAAM,8BAA8B,kBAA2E,CAAC;AAEvH;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,0BAA0B;gBACxD,iBAAiB,EAAE,cAAc;IAIpC,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAG1D;AAED;;;;;GAKG;AACH,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,EAAE,EACV,IAAI,EAAE,EAAE,EACR,iBAAiB,CAAC,EAAE,cAAc,GACjC,OAAO,CAAC,YAAY,CAAC,CAIvB"}
|
package/dest/schnorr/index.js
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
* This is the suggested account contract type for most use cases within Aztec.
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
|
-
*/ import {
|
|
7
|
-
import { getWallet } from '@aztec/aztec.js/wallet';
|
|
6
|
+
*/ import { getAccountContractAddress } from '@aztec/aztec.js/account';
|
|
8
7
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
9
8
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
10
9
|
import SchnorrAccountContractJson from '../../artifacts/SchnorrAccount.json' with {
|
|
@@ -24,36 +23,6 @@ export const SchnorrAccountContractArtifact = loadContractArtifact(SchnorrAccoun
|
|
|
24
23
|
return Promise.resolve(SchnorrAccountContractArtifact);
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
|
-
/**
|
|
28
|
-
* Creates an Account Manager that relies on a Grumpkin signing key for authentication.
|
|
29
|
-
* @param pxe - An PXE server instance.
|
|
30
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
31
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
32
|
-
* @param salt - Deployment salt.
|
|
33
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
34
|
-
*/ export function getSchnorrAccount(pxe, secretKey, signingPrivateKey, salt) {
|
|
35
|
-
return AccountManager.create(pxe, secretKey, new SchnorrAccountContract(signingPrivateKey), salt);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Gets a wallet for an already registered account using Schnorr signatures.
|
|
39
|
-
* @param pxe - An PXE server instance.
|
|
40
|
-
* @param address - Address for the account.
|
|
41
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
42
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
43
|
-
*/ export function getSchnorrWallet(pxe, address, signingPrivateKey) {
|
|
44
|
-
return getWallet(pxe, address, new SchnorrAccountContract(signingPrivateKey));
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Gets a wallet for an already registered account using Schnorr signatures.
|
|
48
|
-
* @param pxe - An PXE server instance.
|
|
49
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
50
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
51
|
-
* @param salt - Deployment salt.
|
|
52
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
53
|
-
*/ export async function getSchnorrWalletWithSecretKey(pxe, secretKey, signingPrivateKey, salt) {
|
|
54
|
-
const account = await getSchnorrAccount(pxe, secretKey, signingPrivateKey, salt);
|
|
55
|
-
return account.getWallet();
|
|
56
|
-
}
|
|
57
26
|
/**
|
|
58
27
|
* Compute the address of a schnorr account contract.
|
|
59
28
|
* @param secret - A seed for deriving the signing key and public keys.
|
package/dest/schnorr/lazy.d.ts
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `@aztec/accounts/schnorr` export provides an account contract implementation that uses Schnorr signatures with a Grumpkin key for authentication, and a separate Grumpkin key for encryption.
|
|
3
|
-
* This is the suggested account contract type for most use cases within Aztec.
|
|
4
|
-
*
|
|
5
|
-
* @packageDocumentation
|
|
6
|
-
*/
|
|
7
|
-
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
|
|
8
|
-
import { type AccountWallet, type AccountWalletWithSecretKey } from '@aztec/aztec.js/wallet';
|
|
9
1
|
import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';
|
|
10
2
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
11
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
12
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
3
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
13
4
|
import { SchnorrBaseAccountContract } from './account_contract.js';
|
|
14
5
|
/**
|
|
15
6
|
* Lazily loads the contract artifact
|
|
@@ -25,32 +16,6 @@ export declare class SchnorrAccountContract extends SchnorrBaseAccountContract {
|
|
|
25
16
|
constructor(signingPrivateKey: GrumpkinScalar);
|
|
26
17
|
getContractArtifact(): Promise<ContractArtifact>;
|
|
27
18
|
}
|
|
28
|
-
/**
|
|
29
|
-
* Creates an Account Manager that relies on a Grumpkin signing key for authentication.
|
|
30
|
-
* @param pxe - An PXE server instance.
|
|
31
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
32
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
33
|
-
* @param salt - Deployment salt.
|
|
34
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
35
|
-
*/
|
|
36
|
-
export declare function getSchnorrAccount(pxe: PXE, secretKey: Fr, signingPrivateKey: GrumpkinScalar, salt?: Salt): Promise<AccountManager>;
|
|
37
|
-
/**
|
|
38
|
-
* Gets a wallet for an already registered account using Schnorr signatures.
|
|
39
|
-
* @param pxe - An PXE server instance.
|
|
40
|
-
* @param address - Address for the account.
|
|
41
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
42
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
43
|
-
*/
|
|
44
|
-
export declare function getSchnorrWallet(pxe: PXE, address: AztecAddress, signingPrivateKey: GrumpkinScalar): Promise<AccountWallet>;
|
|
45
|
-
/**
|
|
46
|
-
* Gets a wallet for an already registered account using Schnorr signatures.
|
|
47
|
-
* @param pxe - An PXE server instance.
|
|
48
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
49
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
50
|
-
* @param salt - Deployment salt.
|
|
51
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
52
|
-
*/
|
|
53
|
-
export declare function getSchnorrWalletWithSecretKey(pxe: PXE, secretKey: Fr, signingPrivateKey: GrumpkinScalar, salt: Salt): Promise<AccountWalletWithSecretKey>;
|
|
54
19
|
/**
|
|
55
20
|
* Compute the address of a schnorr account contract.
|
|
56
21
|
* @param secret - A seed for deriving the signing key and public keys.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/schnorr/lazy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/schnorr/lazy.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;GAGG;AACH,wBAAsB,iCAAiC,8BAQtD;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,0BAA0B;gBACxD,iBAAiB,EAAE,cAAc;IAIpC,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAG1D;AAED;;;;;GAKG;AACH,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,EAAE,EACV,IAAI,EAAE,EAAE,EACR,iBAAiB,CAAC,EAAE,cAAc,GACjC,OAAO,CAAC,YAAY,CAAC,CAIvB"}
|
package/dest/schnorr/lazy.js
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
* This is the suggested account contract type for most use cases within Aztec.
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
|
-
*/ import {
|
|
7
|
-
import { getWallet } from '@aztec/aztec.js/wallet';
|
|
6
|
+
*/ import { getAccountContractAddress } from '@aztec/aztec.js/account';
|
|
8
7
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
9
8
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
10
9
|
import { SchnorrBaseAccountContract } from './account_contract.js';
|
|
@@ -12,10 +11,10 @@ import { SchnorrBaseAccountContract } from './account_contract.js';
|
|
|
12
11
|
* Lazily loads the contract artifact
|
|
13
12
|
* @returns The contract artifact for the schnorr account contract
|
|
14
13
|
*/ export async function getSchnorrAccountContractArtifact() {
|
|
15
|
-
// Cannot assert this import as it's incompatible with
|
|
16
|
-
// https://
|
|
17
|
-
//
|
|
18
|
-
//
|
|
14
|
+
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
15
|
+
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
16
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
17
|
+
// "text/javascript"
|
|
19
18
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
20
19
|
const { default: schnorrAccountContractJson } = await import('../../artifacts/SchnorrAccount.json');
|
|
21
20
|
return loadContractArtifact(schnorrAccountContractJson);
|
|
@@ -32,36 +31,6 @@ import { SchnorrBaseAccountContract } from './account_contract.js';
|
|
|
32
31
|
return getSchnorrAccountContractArtifact();
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
|
-
/**
|
|
36
|
-
* Creates an Account Manager that relies on a Grumpkin signing key for authentication.
|
|
37
|
-
* @param pxe - An PXE server instance.
|
|
38
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
39
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
40
|
-
* @param salt - Deployment salt.
|
|
41
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
42
|
-
*/ export function getSchnorrAccount(pxe, secretKey, signingPrivateKey, salt) {
|
|
43
|
-
return AccountManager.create(pxe, secretKey, new SchnorrAccountContract(signingPrivateKey), salt);
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Gets a wallet for an already registered account using Schnorr signatures.
|
|
47
|
-
* @param pxe - An PXE server instance.
|
|
48
|
-
* @param address - Address for the account.
|
|
49
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
50
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
51
|
-
*/ export function getSchnorrWallet(pxe, address, signingPrivateKey) {
|
|
52
|
-
return getWallet(pxe, address, new SchnorrAccountContract(signingPrivateKey));
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Gets a wallet for an already registered account using Schnorr signatures.
|
|
56
|
-
* @param pxe - An PXE server instance.
|
|
57
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
58
|
-
* @param signingPrivateKey - Grumpkin key used for signing transactions.
|
|
59
|
-
* @param salt - Deployment salt.
|
|
60
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
61
|
-
*/ export async function getSchnorrWalletWithSecretKey(pxe, secretKey, signingPrivateKey, salt) {
|
|
62
|
-
const account = await getSchnorrAccount(pxe, secretKey, signingPrivateKey, salt);
|
|
63
|
-
return account.getWallet();
|
|
64
|
-
}
|
|
65
34
|
/**
|
|
66
35
|
* Compute the address of a schnorr account contract.
|
|
67
36
|
* @param secret - A seed for deriving the signing key and public keys.
|
|
@@ -4,11 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
8
|
-
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
|
|
9
|
-
import { type AccountWallet } from '@aztec/aztec.js/wallet';
|
|
7
|
+
import type { GrumpkinScalar } from '@aztec/aztec.js/fields';
|
|
10
8
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
11
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
12
9
|
import { SingleKeyBaseAccountContract } from './account_contract.js';
|
|
13
10
|
export declare const SchnorrSingleKeyAccountContractArtifact: ContractArtifact;
|
|
14
11
|
/**
|
|
@@ -20,20 +17,4 @@ export declare class SingleKeyAccountContract extends SingleKeyBaseAccountContra
|
|
|
20
17
|
constructor(signingPrivateKey: GrumpkinScalar);
|
|
21
18
|
getContractArtifact(): Promise<ContractArtifact>;
|
|
22
19
|
}
|
|
23
|
-
/**
|
|
24
|
-
* Creates an Account that uses the same Grumpkin key for encryption and authentication.
|
|
25
|
-
* @param pxe - An PXE server instance.
|
|
26
|
-
* @param secretKey - Secret key used to derive all the keystore keys (in this case also used to get signing key).
|
|
27
|
-
* @param salt - Deployment salt.
|
|
28
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
29
|
-
*/
|
|
30
|
-
export declare function getUnsafeSchnorrAccount(pxe: PXE, secretKey: Fr, salt?: Salt): Promise<AccountManager>;
|
|
31
|
-
/**
|
|
32
|
-
* Gets a wallet for an already registered account using Schnorr signatures with a single key for encryption and authentication.
|
|
33
|
-
* @param pxe - An PXE server instance.
|
|
34
|
-
* @param address - Address for the account.
|
|
35
|
-
* @param signingPrivateKey - Grumpkin key used for note encryption and signing transactions.
|
|
36
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
37
|
-
*/
|
|
38
|
-
export declare function getUnsafeSchnorrWallet(pxe: PXE, address: AztecAddress, signingPrivateKey: GrumpkinScalar): Promise<AccountWallet>;
|
|
39
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/single_key/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/single_key/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAK1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,eAAO,MAAM,uCAAuC,kBAEnD,CAAC;AAEF;;;;GAIG;AACH,qBAAa,wBAAyB,SAAQ,4BAA4B;gBAC5D,iBAAiB,EAAE,cAAc;IAIpC,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAG1D"}
|
package/dest/single_key/index.js
CHANGED
|
@@ -3,10 +3,7 @@
|
|
|
3
3
|
* It is not recommended to use this account type in production.
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
|
-
*/ import {
|
|
7
|
-
import { getWallet } from '@aztec/aztec.js/wallet';
|
|
8
|
-
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
9
|
-
import { deriveMasterIncomingViewingSecretKey } from '@aztec/stdlib/keys';
|
|
6
|
+
*/ import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
10
7
|
import SchnorrSingleKeyAccountContractJson from '../../artifacts/SchnorrSingleKeyAccount.json' with {
|
|
11
8
|
type: 'json'
|
|
12
9
|
};
|
|
@@ -24,22 +21,3 @@ export const SchnorrSingleKeyAccountContractArtifact = loadContractArtifact(Schn
|
|
|
24
21
|
return Promise.resolve(SchnorrSingleKeyAccountContractArtifact);
|
|
25
22
|
}
|
|
26
23
|
}
|
|
27
|
-
/**
|
|
28
|
-
* Creates an Account that uses the same Grumpkin key for encryption and authentication.
|
|
29
|
-
* @param pxe - An PXE server instance.
|
|
30
|
-
* @param secretKey - Secret key used to derive all the keystore keys (in this case also used to get signing key).
|
|
31
|
-
* @param salt - Deployment salt.
|
|
32
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
33
|
-
*/ export function getUnsafeSchnorrAccount(pxe, secretKey, salt) {
|
|
34
|
-
const encryptionPrivateKey = deriveMasterIncomingViewingSecretKey(secretKey);
|
|
35
|
-
return AccountManager.create(pxe, secretKey, new SingleKeyAccountContract(encryptionPrivateKey), salt);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Gets a wallet for an already registered account using Schnorr signatures with a single key for encryption and authentication.
|
|
39
|
-
* @param pxe - An PXE server instance.
|
|
40
|
-
* @param address - Address for the account.
|
|
41
|
-
* @param signingPrivateKey - Grumpkin key used for note encryption and signing transactions.
|
|
42
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
43
|
-
*/ export function getUnsafeSchnorrWallet(pxe, address, signingPrivateKey) {
|
|
44
|
-
return getWallet(pxe, address, new SingleKeyAccountContract(signingPrivateKey));
|
|
45
|
-
}
|
|
@@ -4,11 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
8
|
-
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
|
|
9
|
-
import { type AccountWallet } from '@aztec/aztec.js/wallet';
|
|
7
|
+
import type { GrumpkinScalar } from '@aztec/aztec.js/fields';
|
|
10
8
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
11
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
12
9
|
import { SingleKeyBaseAccountContract } from './account_contract.js';
|
|
13
10
|
/**
|
|
14
11
|
* Lazily loads the contract artifact
|
|
@@ -24,20 +21,4 @@ export declare class SingleKeyAccountContract extends SingleKeyBaseAccountContra
|
|
|
24
21
|
constructor(signingPrivateKey: GrumpkinScalar);
|
|
25
22
|
getContractArtifact(): Promise<ContractArtifact>;
|
|
26
23
|
}
|
|
27
|
-
/**
|
|
28
|
-
* Creates an Account that uses the same Grumpkin key for encryption and authentication.
|
|
29
|
-
* @param pxe - An PXE server instance.
|
|
30
|
-
* @param secretKey - Secret key used to derive all the keystore keys (in this case also used to get signing key).
|
|
31
|
-
* @param salt - Deployment salt.
|
|
32
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
33
|
-
*/
|
|
34
|
-
export declare function getUnsafeSchnorrAccount(pxe: PXE, secretKey: Fr, salt?: Salt): Promise<AccountManager>;
|
|
35
|
-
/**
|
|
36
|
-
* Gets a wallet for an already registered account using Schnorr signatures with a single key for encryption and authentication.
|
|
37
|
-
* @param pxe - An PXE server instance.
|
|
38
|
-
* @param address - Address for the account.
|
|
39
|
-
* @param signingPrivateKey - Grumpkin key used for note encryption and signing transactions.
|
|
40
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
41
|
-
*/
|
|
42
|
-
export declare function getUnsafeSchnorrWallet(pxe: PXE, address: AztecAddress, signingPrivateKey: GrumpkinScalar): Promise<AccountWallet>;
|
|
43
24
|
//# sourceMappingURL=lazy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/single_key/lazy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/single_key/lazy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE;;;GAGG;AACH,wBAAsB,mCAAmC,8BAQxD;AAED;;;;GAIG;AACH,qBAAa,wBAAyB,SAAQ,4BAA4B;gBAC5D,iBAAiB,EAAE,cAAc;IAIpC,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAG1D"}
|
package/dest/single_key/lazy.js
CHANGED
|
@@ -3,19 +3,16 @@
|
|
|
3
3
|
* It is not recommended to use this account type in production.
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
|
-
*/ import {
|
|
7
|
-
import { getWallet } from '@aztec/aztec.js/wallet';
|
|
8
|
-
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
9
|
-
import { deriveMasterIncomingViewingSecretKey } from '@aztec/stdlib/keys';
|
|
6
|
+
*/ import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
10
7
|
import { SingleKeyBaseAccountContract } from './account_contract.js';
|
|
11
8
|
/**
|
|
12
9
|
* Lazily loads the contract artifact
|
|
13
10
|
* @returns The contract artifact for the single key account contract
|
|
14
11
|
*/ export async function getSingleKeyAccountContractArtifact() {
|
|
15
|
-
// Cannot assert this import as it's incompatible with
|
|
16
|
-
// https://
|
|
17
|
-
//
|
|
18
|
-
//
|
|
12
|
+
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
13
|
+
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
14
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
15
|
+
// "text/javascript"
|
|
19
16
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
20
17
|
const { default: schnorrAccountContractJson } = await import('../../artifacts/SchnorrAccount.json');
|
|
21
18
|
return loadContractArtifact(schnorrAccountContractJson);
|
|
@@ -32,22 +29,3 @@ import { SingleKeyBaseAccountContract } from './account_contract.js';
|
|
|
32
29
|
return getSingleKeyAccountContractArtifact();
|
|
33
30
|
}
|
|
34
31
|
}
|
|
35
|
-
/**
|
|
36
|
-
* Creates an Account that uses the same Grumpkin key for encryption and authentication.
|
|
37
|
-
* @param pxe - An PXE server instance.
|
|
38
|
-
* @param secretKey - Secret key used to derive all the keystore keys (in this case also used to get signing key).
|
|
39
|
-
* @param salt - Deployment salt.
|
|
40
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
41
|
-
*/ export function getUnsafeSchnorrAccount(pxe, secretKey, salt) {
|
|
42
|
-
const encryptionPrivateKey = deriveMasterIncomingViewingSecretKey(secretKey);
|
|
43
|
-
return AccountManager.create(pxe, secretKey, new SingleKeyAccountContract(encryptionPrivateKey), salt);
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Gets a wallet for an already registered account using Schnorr signatures with a single key for encryption and authentication.
|
|
47
|
-
* @param pxe - An PXE server instance.
|
|
48
|
-
* @param address - Address for the account.
|
|
49
|
-
* @param signingPrivateKey - Grumpkin key used for note encryption and signing transactions.
|
|
50
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
51
|
-
*/ export function getUnsafeSchnorrWallet(pxe, address, signingPrivateKey) {
|
|
52
|
-
return getWallet(pxe, address, new SingleKeyAccountContract(signingPrivateKey));
|
|
53
|
-
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AuthWitnessProvider } from '@aztec/aztec.js/account';
|
|
2
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
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=account_contract.d.ts.map
|
|
@@ -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,0BAA0B,CAAC;AAC9C,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;;IAK1E,gCAAgC;;;;IAIhC,sBAAsB,CAAC,QAAQ,EAAE,eAAe,GAAG,mBAAmB;CAGvE;AAED,oDAAoD;AACpD,qBAAa,uBAAwB,YAAW,mBAAmB;;IAGjE;;;;OAIG;IACH,aAAa,CAAC,WAAW,EAAE,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC;CAGrD"}
|
|
@@ -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=index.d.ts.map
|
|
@@ -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;;IAKrD,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAG1D;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=lazy.d.ts.map
|
|
@@ -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;;IAKrD,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAG1D;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
|
+
}
|
package/dest/testing/index.d.ts
CHANGED
|
@@ -1,41 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
|
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
|
-
*
|
|
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
|
|
40
|
-
export { deployFundedSchnorrAccount, deployFundedSchnorrAccounts, generateSchnorrAccounts } from './create_account.js';
|
|
10
|
+
export declare function generateSchnorrAccounts(numberOfAccounts: number): Promise<Promise<InitialAccountData[]>>;
|
|
41
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"
|
|
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"}
|