@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/testing/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The `@aztec/accounts/testing` export provides utility methods for testing, in particular in a Sandbox environment.
|
|
3
3
|
*
|
|
4
|
-
* Use {@link getInitialTestAccountsWallets} to obtain a list of wallets for the Sandbox pre-seeded accounts.
|
|
5
|
-
*
|
|
6
4
|
* @packageDocumentation
|
|
7
|
-
*/ import {
|
|
5
|
+
*/ import { Fr } from '@aztec/aztec.js/fields';
|
|
6
|
+
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
7
|
+
import { getSchnorrAccountContractAddress } from '../schnorr/index.js';
|
|
8
8
|
import { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_SECRET_KEYS, INITIAL_TEST_SIGNING_KEYS } from './configuration.js';
|
|
9
9
|
export { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_SECRET_KEYS, INITIAL_TEST_SIGNING_KEYS } from './configuration.js';
|
|
10
10
|
/**
|
|
11
11
|
* Gets the basic information for initial test accounts.
|
|
12
|
-
*/ export function
|
|
12
|
+
*/ export function getInitialTestAccountsData() {
|
|
13
13
|
return Promise.all(INITIAL_TEST_SECRET_KEYS.map(async (secret, i)=>({
|
|
14
14
|
secret,
|
|
15
15
|
signingKey: INITIAL_TEST_ENCRYPTION_KEYS[i],
|
|
@@ -18,34 +18,18 @@ export { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_
|
|
|
18
18
|
})));
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
* Queries a PXE for it's registered accounts.
|
|
36
|
-
* @param pxe - PXE instance.
|
|
37
|
-
* @returns A set of key data for each of the initial accounts.
|
|
38
|
-
*/ export async function getDeployedTestAccounts(pxe) {
|
|
39
|
-
const registeredAccounts = await pxe.getRegisteredAccounts();
|
|
40
|
-
const testAccounts = await getInitialTestAccounts();
|
|
41
|
-
return testAccounts.filter((t)=>registeredAccounts.some((r)=>r.address.equals(t.address)));
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Queries a PXE for it's registered accounts and returns wallets for those accounts using keys in the initial test accounts.
|
|
45
|
-
* @param pxe - PXE instance.
|
|
46
|
-
* @returns A set of AccountWallet implementations for each of the initial accounts.
|
|
47
|
-
*/ export async function getDeployedTestAccountsWallets(pxe) {
|
|
48
|
-
const testAccounts = await getDeployedTestAccounts(pxe);
|
|
49
|
-
return Promise.all(testAccounts.map(({ secret, signingKey, salt })=>getSchnorrWalletWithSecretKey(pxe, secret, signingKey, salt)));
|
|
21
|
+
* Generate a fixed amount of random schnorr account contract instance.
|
|
22
|
+
*/ export async function generateSchnorrAccounts(numberOfAccounts) {
|
|
23
|
+
const secrets = Array.from({
|
|
24
|
+
length: numberOfAccounts
|
|
25
|
+
}, ()=>Fr.random());
|
|
26
|
+
return await Promise.all(secrets.map(async (secret)=>{
|
|
27
|
+
const salt = Fr.random();
|
|
28
|
+
return {
|
|
29
|
+
secret,
|
|
30
|
+
signingKey: deriveSigningKey(secret),
|
|
31
|
+
salt,
|
|
32
|
+
address: await getSchnorrAccountContractAddress(secret, salt)
|
|
33
|
+
};
|
|
34
|
+
}));
|
|
50
35
|
}
|
|
51
|
-
export { deployFundedSchnorrAccount, deployFundedSchnorrAccounts, generateSchnorrAccounts } from './create_account.js';
|
package/dest/testing/lazy.d.ts
CHANGED
|
@@ -1,34 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `@aztec/accounts/testing/lazy` export provides utility methods for testing, in particular in a Sandbox environment.
|
|
3
|
-
*
|
|
4
|
-
* Use {@link getInitialTestAccountsWallets} to obtain a list of wallets for the Sandbox pre-seeded accounts.
|
|
5
|
-
*
|
|
6
|
-
* @packageDocumentation
|
|
7
|
-
*/
|
|
8
|
-
import type { PXE } from '@aztec/aztec.js';
|
|
9
|
-
import type { AccountWalletWithSecretKey } from '@aztec/aztec.js/wallet';
|
|
10
1
|
import { type InitialAccountData } from './configuration.js';
|
|
11
|
-
export {
|
|
2
|
+
export { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_SECRET_KEYS } 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 wallets for the Aztec accounts that are initially stored in the test environment.
|
|
18
|
-
* @param pxe - PXE instance.
|
|
19
|
-
* @returns A set of AccountWallet implementations for each of the initial accounts.
|
|
20
|
-
*/
|
|
21
|
-
export declare function getInitialTestAccountsWallets(pxe: PXE): Promise<AccountWalletWithSecretKey[]>;
|
|
22
|
-
/**
|
|
23
|
-
* Queries a PXE for it's registered accounts.
|
|
24
|
-
* @param pxe - PXE instance.
|
|
25
|
-
* @returns A set of key data for each of the initial accounts.
|
|
26
|
-
*/
|
|
27
|
-
export declare function getDeployedTestAccounts(pxe: PXE): Promise<InitialAccountData[]>;
|
|
6
|
+
export declare function getInitialTestAccountsData(): Promise<InitialAccountData[]>;
|
|
28
7
|
/**
|
|
29
|
-
*
|
|
30
|
-
* @param pxe - PXE instance.
|
|
31
|
-
* @returns A set of AccountWallet implementations for each of the initial accounts.
|
|
8
|
+
* Generate a fixed amount of random schnorr account contract instance.
|
|
32
9
|
*/
|
|
33
|
-
export declare function
|
|
10
|
+
export declare function generateSchnorrAccounts(numberOfAccounts: number): Promise<InitialAccountData[]>;
|
|
34
11
|
//# sourceMappingURL=lazy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/testing/lazy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/testing/lazy.ts"],"names":[],"mappings":"AASA,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE1F;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAa1E;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAarG"}
|
package/dest/testing/lazy.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The `@aztec/accounts/testing/lazy` export provides utility methods for testing, in particular in a Sandbox environment.
|
|
3
3
|
*
|
|
4
|
-
* Use {@link getInitialTestAccountsWallets} to obtain a list of wallets for the Sandbox pre-seeded accounts.
|
|
5
|
-
*
|
|
6
4
|
* @packageDocumentation
|
|
7
|
-
*/ import {
|
|
5
|
+
*/ import { Fr } from '@aztec/aztec.js/fields';
|
|
6
|
+
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
7
|
+
import { getSchnorrAccountContractAddress } from '../schnorr/lazy.js';
|
|
8
8
|
import { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_SECRET_KEYS, INITIAL_TEST_SIGNING_KEYS } from './configuration.js';
|
|
9
|
-
export { INITIAL_TEST_ACCOUNT_SALTS,
|
|
9
|
+
export { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_SECRET_KEYS } from './configuration.js';
|
|
10
10
|
/**
|
|
11
11
|
* Gets the basic information for initial test accounts.
|
|
12
|
-
*/ export function
|
|
12
|
+
*/ export function getInitialTestAccountsData() {
|
|
13
13
|
return Promise.all(INITIAL_TEST_SECRET_KEYS.map(async (secret, i)=>({
|
|
14
14
|
secret,
|
|
15
15
|
signingKey: INITIAL_TEST_ENCRYPTION_KEYS[i],
|
|
@@ -18,29 +18,18 @@ export { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_
|
|
|
18
18
|
})));
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
* Generate a fixed amount of random schnorr account contract instance.
|
|
22
|
+
*/ export async function generateSchnorrAccounts(numberOfAccounts) {
|
|
23
|
+
const secrets = Array.from({
|
|
24
|
+
length: numberOfAccounts
|
|
25
|
+
}, ()=>Fr.random());
|
|
26
|
+
return await Promise.all(secrets.map(async (secret)=>{
|
|
27
|
+
const salt = Fr.random();
|
|
28
|
+
return {
|
|
29
|
+
secret,
|
|
30
|
+
signingKey: deriveSigningKey(secret),
|
|
31
|
+
salt,
|
|
32
|
+
address: await getSchnorrAccountContractAddress(secret, salt)
|
|
33
|
+
};
|
|
28
34
|
}));
|
|
29
35
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Queries a PXE for it's registered accounts.
|
|
32
|
-
* @param pxe - PXE instance.
|
|
33
|
-
* @returns A set of key data for each of the initial accounts.
|
|
34
|
-
*/ export async function getDeployedTestAccounts(pxe) {
|
|
35
|
-
const registeredAccounts = await pxe.getRegisteredAccounts();
|
|
36
|
-
const testAccounts = await getInitialTestAccounts();
|
|
37
|
-
return testAccounts.filter((t)=>registeredAccounts.some((r)=>r.address.equals(t.address)));
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Queries a PXE for it's registered accounts and returns wallets for those accounts using keys in the initial test accounts.
|
|
41
|
-
* @param pxe - PXE instance.
|
|
42
|
-
* @returns A set of AccountWallet implementations for each of the initial accounts.
|
|
43
|
-
*/ export async function getDeployedTestAccountsWallets(pxe) {
|
|
44
|
-
const testAccounts = await getDeployedTestAccounts(pxe);
|
|
45
|
-
return Promise.all(testAccounts.map(({ secret, signingKey, salt })=>getSchnorrWalletWithSecretKey(pxe, secret, signingKey, salt)));
|
|
46
|
-
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@aztec/accounts",
|
|
3
3
|
"homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/accounts",
|
|
4
4
|
"description": "Implementation of sample account contracts for Aztec Network",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "3.0.0-devnet.2",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
"./defaults": "./dest/defaults/index.js",
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
"./schnorr/lazy": "./dest/schnorr/lazy.js",
|
|
13
13
|
"./single_key": "./dest/single_key/index.js",
|
|
14
14
|
"./single_key/lazy": "./dest/single_key/lazy.js",
|
|
15
|
+
"./stub": "./dest/stub/index.js",
|
|
16
|
+
"./stub/lazy": "./dest/stub/lazy.js",
|
|
15
17
|
"./testing": "./dest/testing/index.js",
|
|
16
18
|
"./testing/lazy": "./dest/testing/lazy.js",
|
|
17
19
|
"./copy-cat": "./dest/copy_cat/index.js",
|
|
@@ -80,11 +82,11 @@
|
|
|
80
82
|
]
|
|
81
83
|
},
|
|
82
84
|
"dependencies": {
|
|
83
|
-
"@aztec/aztec.js": "
|
|
84
|
-
"@aztec/entrypoints": "
|
|
85
|
-
"@aztec/ethereum": "
|
|
86
|
-
"@aztec/foundation": "
|
|
87
|
-
"@aztec/stdlib": "
|
|
85
|
+
"@aztec/aztec.js": "3.0.0-devnet.2",
|
|
86
|
+
"@aztec/entrypoints": "3.0.0-devnet.2",
|
|
87
|
+
"@aztec/ethereum": "3.0.0-devnet.2",
|
|
88
|
+
"@aztec/foundation": "3.0.0-devnet.2",
|
|
89
|
+
"@aztec/stdlib": "3.0.0-devnet.2",
|
|
88
90
|
"tslib": "^2.4.0"
|
|
89
91
|
},
|
|
90
92
|
"devDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { AccountContract, AccountInterface, AuthWitnessProvider } from '@aztec/aztec.js/account';
|
|
1
|
+
import type { AccountContract, AccountInterface, AuthWitnessProvider, ChainInfo } from '@aztec/aztec.js/account';
|
|
2
2
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
3
|
-
import type { CompleteAddress
|
|
3
|
+
import type { CompleteAddress } from '@aztec/stdlib/contract';
|
|
4
4
|
|
|
5
5
|
import { DefaultAccountInterface } from '../defaults/account_interface.js';
|
|
6
6
|
|
|
@@ -23,7 +23,7 @@ export abstract class DefaultAccountContract implements AccountContract {
|
|
|
23
23
|
|
|
24
24
|
constructor() {}
|
|
25
25
|
|
|
26
|
-
getInterface(address: CompleteAddress,
|
|
27
|
-
return new DefaultAccountInterface(this.getAuthWitnessProvider(address), address,
|
|
26
|
+
getInterface(address: CompleteAddress, chainInfo: ChainInfo): AccountInterface {
|
|
27
|
+
return new DefaultAccountInterface(this.getAuthWitnessProvider(address), address, chainInfo);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { AccountInterface, AuthWitnessProvider } from '@aztec/aztec.js/account';
|
|
2
|
-
import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
|
|
3
|
-
import type {
|
|
2
|
+
import { DefaultAccountEntrypoint, type DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
|
|
3
|
+
import type { ChainInfo, EntrypointInterface } from '@aztec/entrypoints/interfaces';
|
|
4
4
|
import type { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
5
5
|
import { Fr } from '@aztec/foundation/fields';
|
|
6
6
|
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
7
7
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
8
8
|
import { CompleteAddress } from '@aztec/stdlib/contract';
|
|
9
|
-
import type {
|
|
9
|
+
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
10
10
|
import type { TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -22,24 +22,24 @@ export class DefaultAccountInterface implements AccountInterface {
|
|
|
22
22
|
constructor(
|
|
23
23
|
private authWitnessProvider: AuthWitnessProvider,
|
|
24
24
|
private address: CompleteAddress,
|
|
25
|
-
|
|
25
|
+
chainInfo: ChainInfo,
|
|
26
26
|
) {
|
|
27
27
|
this.entrypoint = new DefaultAccountEntrypoint(
|
|
28
28
|
address.address,
|
|
29
29
|
authWitnessProvider,
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
chainInfo.chainId.toNumber(),
|
|
31
|
+
chainInfo.version.toNumber(),
|
|
32
32
|
);
|
|
33
|
-
this.chainId =
|
|
34
|
-
this.version =
|
|
33
|
+
this.chainId = chainInfo.chainId;
|
|
34
|
+
this.version = chainInfo.version;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
createTxExecutionRequest(
|
|
38
38
|
exec: ExecutionPayload,
|
|
39
|
-
|
|
40
|
-
options:
|
|
39
|
+
gasSettings: GasSettings,
|
|
40
|
+
options: DefaultAccountEntrypointOptions,
|
|
41
41
|
): Promise<TxExecutionRequest> {
|
|
42
|
-
return this.entrypoint.createTxExecutionRequest(exec,
|
|
42
|
+
return this.entrypoint.createTxExecutionRequest(exec, gasSettings, options);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
createAuthWit(messageHash: Fr): Promise<AuthWitness> {
|
|
@@ -4,13 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
|
-
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
|
|
8
|
-
import { type AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
|
|
9
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
10
7
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
11
8
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
12
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
13
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
14
9
|
import type { NoirCompiledContract } from '@aztec/stdlib/noir';
|
|
15
10
|
|
|
16
11
|
import EcdsaKAccountContractJson from '../../../artifacts/EcdsaKAccount.json' with { type: 'json' };
|
|
@@ -34,30 +29,3 @@ export class EcdsaKAccountContract extends EcdsaKBaseAccountContract {
|
|
|
34
29
|
return Promise.resolve(EcdsaKAccountContractArtifact);
|
|
35
30
|
}
|
|
36
31
|
}
|
|
37
|
-
/**
|
|
38
|
-
* Creates an Account that relies on an ECDSA signing key for authentication.
|
|
39
|
-
* @param pxe - An PXE server instance.
|
|
40
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
41
|
-
* @param signingPrivateKey - Secp256k1 key used for signing transactions.
|
|
42
|
-
* @param salt - Deployment salt.
|
|
43
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
44
|
-
*/
|
|
45
|
-
export function getEcdsaKAccount(
|
|
46
|
-
pxe: PXE,
|
|
47
|
-
secretKey: Fr,
|
|
48
|
-
signingPrivateKey: Buffer,
|
|
49
|
-
salt?: Salt,
|
|
50
|
-
): Promise<AccountManager> {
|
|
51
|
-
return AccountManager.create(pxe, secretKey, new EcdsaKAccountContract(signingPrivateKey), salt);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Gets a wallet for an already registered account using ECDSA signatures.
|
|
56
|
-
* @param pxe - An PXE server instance.
|
|
57
|
-
* @param address - Address for the account.
|
|
58
|
-
* @param signingPrivateKey - ECDSA key used for signing transactions.
|
|
59
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
60
|
-
*/
|
|
61
|
-
export function getEcdsaKWallet(pxe: PXE, address: AztecAddress, signingPrivateKey: Buffer): Promise<AccountWallet> {
|
|
62
|
-
return getWallet(pxe, address, new EcdsaKAccountContract(signingPrivateKey));
|
|
63
|
-
}
|
|
@@ -4,13 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
|
-
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
|
|
8
|
-
import { type AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
|
|
9
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
10
7
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
11
8
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
12
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
13
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
14
9
|
|
|
15
10
|
import { EcdsaKBaseAccountContract } from './account_contract.js';
|
|
16
11
|
|
|
@@ -19,10 +14,10 @@ import { EcdsaKBaseAccountContract } from './account_contract.js';
|
|
|
19
14
|
* @returns The contract artifact for the ecdsa K account contract
|
|
20
15
|
*/
|
|
21
16
|
export async function getEcdsaKAccountContractArtifact() {
|
|
22
|
-
// Cannot assert this import as it's incompatible with
|
|
23
|
-
// https://
|
|
24
|
-
//
|
|
25
|
-
//
|
|
17
|
+
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
18
|
+
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
19
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
20
|
+
// "text/javascript"
|
|
26
21
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
27
22
|
const { default: ecdsaKAccountContractJson } = await import('../../../artifacts/EcdsaKAccount.json');
|
|
28
23
|
return loadContractArtifact(ecdsaKAccountContractJson);
|
|
@@ -42,30 +37,3 @@ export class EcdsaKAccountContract extends EcdsaKBaseAccountContract {
|
|
|
42
37
|
return getEcdsaKAccountContractArtifact();
|
|
43
38
|
}
|
|
44
39
|
}
|
|
45
|
-
/**
|
|
46
|
-
* Creates an Account that relies on an ECDSA signing key for authentication.
|
|
47
|
-
* @param pxe - An PXE server instance.
|
|
48
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
49
|
-
* @param signingPrivateKey - Secp256k1 key used for signing transactions.
|
|
50
|
-
* @param salt - Deployment salt.
|
|
51
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
52
|
-
*/
|
|
53
|
-
export function getEcdsaKAccount(
|
|
54
|
-
pxe: PXE,
|
|
55
|
-
secretKey: Fr,
|
|
56
|
-
signingPrivateKey: Buffer,
|
|
57
|
-
salt?: Salt,
|
|
58
|
-
): Promise<AccountManager> {
|
|
59
|
-
return AccountManager.create(pxe, secretKey, new EcdsaKAccountContract(signingPrivateKey), salt);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Gets a wallet for an already registered account using ECDSA signatures.
|
|
64
|
-
* @param pxe - An PXE server instance.
|
|
65
|
-
* @param address - Address for the account.
|
|
66
|
-
* @param signingPrivateKey - ECDSA key used for signing transactions.
|
|
67
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
68
|
-
*/
|
|
69
|
-
export function getEcdsaKWallet(pxe: PXE, address: AztecAddress, signingPrivateKey: Buffer): Promise<AccountWallet> {
|
|
70
|
-
return getWallet(pxe, address, new EcdsaKAccountContract(signingPrivateKey));
|
|
71
|
-
}
|
|
@@ -4,13 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
|
-
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
|
|
8
|
-
import { type AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
|
|
9
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
10
7
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
11
8
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
12
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
13
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
14
9
|
import type { NoirCompiledContract } from '@aztec/stdlib/noir';
|
|
15
10
|
|
|
16
11
|
import EcdsaRAccountContractJson from '../../../artifacts/EcdsaRAccount.json' with { type: 'json' };
|
|
@@ -34,30 +29,3 @@ export class EcdsaRAccountContract extends EcdsaRBaseAccountContract {
|
|
|
34
29
|
return Promise.resolve(EcdsaRAccountContractArtifact);
|
|
35
30
|
}
|
|
36
31
|
}
|
|
37
|
-
/**
|
|
38
|
-
* Creates an Account that relies on an ECDSA signing key for authentication.
|
|
39
|
-
* @param pxe - An PXE server instance.
|
|
40
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
41
|
-
* @param signingPrivateKey - Secp256k1 key used for signing transactions.
|
|
42
|
-
* @param salt - Deployment salt.
|
|
43
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
44
|
-
*/
|
|
45
|
-
export function getEcdsaRAccount(
|
|
46
|
-
pxe: PXE,
|
|
47
|
-
secretKey: Fr,
|
|
48
|
-
signingPrivateKey: Buffer,
|
|
49
|
-
salt?: Salt,
|
|
50
|
-
): Promise<AccountManager> {
|
|
51
|
-
return AccountManager.create(pxe, secretKey, new EcdsaRAccountContract(signingPrivateKey), salt);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Gets a wallet for an already registered account using ECDSA signatures.
|
|
56
|
-
* @param pxe - An PXE server instance.
|
|
57
|
-
* @param address - Address for the account.
|
|
58
|
-
* @param signingPrivateKey - ECDSA key used for signing transactions.
|
|
59
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
60
|
-
*/
|
|
61
|
-
export function getEcdsaRWallet(pxe: PXE, address: AztecAddress, signingPrivateKey: Buffer): Promise<AccountWallet> {
|
|
62
|
-
return getWallet(pxe, address, new EcdsaRAccountContract(signingPrivateKey));
|
|
63
|
-
}
|
|
@@ -4,13 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
|
-
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
|
|
8
|
-
import { type AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
|
|
9
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
10
7
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
11
8
|
import { loadContractArtifact } from '@aztec/stdlib/abi';
|
|
12
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
13
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
14
9
|
|
|
15
10
|
import { EcdsaRBaseAccountContract } from './account_contract.js';
|
|
16
11
|
|
|
@@ -19,10 +14,10 @@ import { EcdsaRBaseAccountContract } from './account_contract.js';
|
|
|
19
14
|
* @returns The contract artifact for the ecdsa K account contract
|
|
20
15
|
*/
|
|
21
16
|
export async function getEcdsaRAccountContractArtifact() {
|
|
22
|
-
// Cannot assert this import as it's incompatible with
|
|
23
|
-
// https://
|
|
24
|
-
//
|
|
25
|
-
//
|
|
17
|
+
// Cannot assert this import as it's incompatible with bundlers like vite
|
|
18
|
+
// https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
|
|
19
|
+
// Even if now supported by al major browsers, the MIME type is replaced with
|
|
20
|
+
// "text/javascript"
|
|
26
21
|
// In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
|
|
27
22
|
const { default: ecdsaKAccountContractJson } = await import('../../../artifacts/EcdsaRAccount.json');
|
|
28
23
|
return loadContractArtifact(ecdsaKAccountContractJson);
|
|
@@ -42,30 +37,3 @@ export class EcdsaRAccountContract extends EcdsaRBaseAccountContract {
|
|
|
42
37
|
return getEcdsaRAccountContractArtifact();
|
|
43
38
|
}
|
|
44
39
|
}
|
|
45
|
-
/**
|
|
46
|
-
* Creates an Account that relies on an ECDSA signing key for authentication.
|
|
47
|
-
* @param pxe - An PXE server instance.
|
|
48
|
-
* @param secretKey - Secret key used to derive all the keystore keys.
|
|
49
|
-
* @param signingPrivateKey - Secp256k1 key used for signing transactions.
|
|
50
|
-
* @param salt - Deployment salt.
|
|
51
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
52
|
-
*/
|
|
53
|
-
export function getEcdsaRAccount(
|
|
54
|
-
pxe: PXE,
|
|
55
|
-
secretKey: Fr,
|
|
56
|
-
signingPrivateKey: Buffer,
|
|
57
|
-
salt?: Salt,
|
|
58
|
-
): Promise<AccountManager> {
|
|
59
|
-
return AccountManager.create(pxe, secretKey, new EcdsaRAccountContract(signingPrivateKey), salt);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Gets a wallet for an already registered account using ECDSA signatures.
|
|
64
|
-
* @param pxe - An PXE server instance.
|
|
65
|
-
* @param address - Address for the account.
|
|
66
|
-
* @param signingPrivateKey - ECDSA key used for signing transactions.
|
|
67
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
68
|
-
*/
|
|
69
|
-
export function getEcdsaRWallet(pxe: PXE, address: AztecAddress, signingPrivateKey: Buffer): Promise<AccountWallet> {
|
|
70
|
-
return getWallet(pxe, address, new EcdsaRAccountContract(signingPrivateKey));
|
|
71
|
-
}
|
|
@@ -4,12 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
|
-
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
|
|
8
|
-
import { type AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
|
|
9
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
10
7
|
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
8
|
|
|
14
9
|
import { EcdsaRAccountContractArtifact } from '../ecdsa_r/index.js';
|
|
15
10
|
import { EcdsaRSSHBaseAccountContract } from './account_contract.js';
|
|
@@ -23,39 +18,11 @@ import { EcdsaRSSHBaseAccountContract } from './account_contract.js';
|
|
|
23
18
|
* Eagerly loads the contract artifact
|
|
24
19
|
*/
|
|
25
20
|
export class EcdsaRSSHAccountContract extends EcdsaRSSHBaseAccountContract {
|
|
26
|
-
constructor(
|
|
27
|
-
super(
|
|
21
|
+
constructor(signingPublicKey: Buffer) {
|
|
22
|
+
super(signingPublicKey);
|
|
28
23
|
}
|
|
29
24
|
|
|
30
25
|
override getContractArtifact(): Promise<ContractArtifact> {
|
|
31
26
|
return Promise.resolve(EcdsaRAccountContractArtifact);
|
|
32
27
|
}
|
|
33
28
|
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Creates an Account that relies on an ECDSA 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 signingPublicKey - Secp2561 key used to identify its corresponding private key in the SSH Agent.
|
|
40
|
-
* @param salt - Deployment salt.
|
|
41
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
42
|
-
*/
|
|
43
|
-
export function getEcdsaRSSHAccount(
|
|
44
|
-
pxe: PXE,
|
|
45
|
-
secretKey: Fr,
|
|
46
|
-
signingPublicKey: Buffer,
|
|
47
|
-
salt?: Salt,
|
|
48
|
-
): Promise<AccountManager> {
|
|
49
|
-
return AccountManager.create(pxe, secretKey, new EcdsaRSSHAccountContract(signingPublicKey), salt);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Gets a wallet for an already registered account using ECDSA signatures.
|
|
54
|
-
* @param pxe - An PXE server instance.
|
|
55
|
-
* @param address - Address for the account.
|
|
56
|
-
* @param signingPrivateKey - ECDSA key used for signing transactions.
|
|
57
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
58
|
-
*/
|
|
59
|
-
export function getEcdsaRSSHWallet(pxe: PXE, address: AztecAddress, signingPublicKey: Buffer): Promise<AccountWallet> {
|
|
60
|
-
return getWallet(pxe, address, new EcdsaRSSHAccountContract(signingPublicKey));
|
|
61
|
-
}
|
|
@@ -4,12 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
|
-
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
|
|
8
|
-
import { type AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
|
|
9
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
10
7
|
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
8
|
|
|
14
9
|
import { getEcdsaRAccountContractArtifact } from '../ecdsa_r/lazy.js';
|
|
15
10
|
import { EcdsaRSSHBaseAccountContract } from './account_contract.js';
|
|
@@ -23,39 +18,11 @@ import { EcdsaRSSHBaseAccountContract } from './account_contract.js';
|
|
|
23
18
|
* Lazily loads the contract artifact
|
|
24
19
|
*/
|
|
25
20
|
export class EcdsaRSSHAccountContract extends EcdsaRSSHBaseAccountContract {
|
|
26
|
-
constructor(
|
|
27
|
-
super(
|
|
21
|
+
constructor(signingPublicKey: Buffer) {
|
|
22
|
+
super(signingPublicKey);
|
|
28
23
|
}
|
|
29
24
|
|
|
30
25
|
override getContractArtifact(): Promise<ContractArtifact> {
|
|
31
26
|
return getEcdsaRAccountContractArtifact();
|
|
32
27
|
}
|
|
33
28
|
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Creates an Account that relies on an ECDSA 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 signingPublicKey - Secp2561 key used to identify its corresponding private key in the SSH Agent.
|
|
40
|
-
* @param salt - Deployment salt.
|
|
41
|
-
* @returns An account manager initialized with the account contract and its deployment params
|
|
42
|
-
*/
|
|
43
|
-
export function getEcdsaRSSHAccount(
|
|
44
|
-
pxe: PXE,
|
|
45
|
-
secretKey: Fr,
|
|
46
|
-
signingPublicKey: Buffer,
|
|
47
|
-
salt?: Salt,
|
|
48
|
-
): Promise<AccountManager> {
|
|
49
|
-
return AccountManager.create(pxe, secretKey, new EcdsaRSSHAccountContract(signingPublicKey), salt);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Gets a wallet for an already registered account using ECDSA signatures.
|
|
54
|
-
* @param pxe - An PXE server instance.
|
|
55
|
-
* @param address - Address for the account.
|
|
56
|
-
* @param signingPrivateKey - ECDSA key used for signing transactions.
|
|
57
|
-
* @returns A wallet for this account that can be used to interact with a contract instance.
|
|
58
|
-
*/
|
|
59
|
-
export function getEcdsaRSSHWallet(pxe: PXE, address: AztecAddress, signingPublicKey: Buffer): Promise<AccountWallet> {
|
|
60
|
-
return getWallet(pxe, address, new EcdsaRSSHAccountContract(signingPublicKey));
|
|
61
|
-
}
|