@aztec/accounts 0.0.0-test.0 → 0.0.1-commit.21caa21
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 +4320 -3340
- package/artifacts/EcdsaRAccount.json +4046 -3066
- package/artifacts/SchnorrAccount.json +4420 -3285
- package/artifacts/SchnorrSingleKeyAccount.json +2566 -1824
- package/artifacts/SimulatedAccount.d.json.ts +3 -0
- package/artifacts/SimulatedAccount.json +4623 -0
- package/dest/defaults/account_contract.d.ts +10 -5
- 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 +7 -6
- package/dest/defaults/account_interface.d.ts.map +1 -1
- package/dest/defaults/account_interface.js +6 -7
- package/dest/defaults/index.d.ts +2 -2
- package/dest/defaults/index.js +1 -1
- package/dest/ecdsa/ecdsa_k/account_contract.d.ts +5 -4
- package/dest/ecdsa/ecdsa_k/account_contract.d.ts.map +1 -1
- package/dest/ecdsa/ecdsa_k/account_contract.js +8 -5
- package/dest/ecdsa/ecdsa_k/index.d.ts +1 -25
- package/dest/ecdsa/ecdsa_k/index.d.ts.map +1 -1
- package/dest/ecdsa/ecdsa_k/index.js +2 -23
- package/dest/ecdsa/ecdsa_k/lazy.d.ts +1 -25
- 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/account_contract.d.ts +19 -0
- package/dest/ecdsa/ecdsa_r/account_contract.d.ts.map +1 -0
- package/dest/ecdsa/ecdsa_r/account_contract.js +41 -0
- package/dest/ecdsa/ecdsa_r/index.d.ts +19 -0
- package/dest/ecdsa/ecdsa_r/index.d.ts.map +1 -0
- package/dest/ecdsa/ecdsa_r/index.js +23 -0
- package/dest/ecdsa/ecdsa_r/lazy.d.ts +23 -0
- package/dest/ecdsa/ecdsa_r/lazy.d.ts.map +1 -0
- package/dest/ecdsa/ecdsa_r/lazy.js +31 -0
- package/dest/ecdsa/index.d.ts +2 -1
- package/dest/ecdsa/index.d.ts.map +1 -1
- package/dest/ecdsa/index.js +1 -0
- package/dest/ecdsa/lazy.d.ts +2 -1
- package/dest/ecdsa/lazy.d.ts.map +1 -1
- package/dest/ecdsa/lazy.js +1 -0
- package/dest/ecdsa/ssh_ecdsa_r/account_contract.d.ts +5 -4
- package/dest/ecdsa/ssh_ecdsa_r/account_contract.d.ts.map +1 -1
- package/dest/ecdsa/ssh_ecdsa_r/account_contract.js +8 -5
- package/dest/ecdsa/ssh_ecdsa_r/index.d.ts +2 -27
- package/dest/ecdsa/ssh_ecdsa_r/index.d.ts.map +1 -1
- package/dest/ecdsa/ssh_ecdsa_r/index.js +3 -28
- package/dest/ecdsa/ssh_ecdsa_r/lazy.d.ts +2 -30
- package/dest/ecdsa/ssh_ecdsa_r/lazy.d.ts.map +1 -1
- package/dest/ecdsa/ssh_ecdsa_r/lazy.js +3 -38
- package/dest/schnorr/account_contract.d.ts +5 -2
- package/dest/schnorr/account_contract.d.ts.map +1 -1
- package/dest/schnorr/account_contract.js +8 -5
- package/dest/schnorr/index.d.ts +2 -37
- package/dest/schnorr/index.d.ts.map +1 -1
- package/dest/schnorr/index.js +2 -33
- package/dest/schnorr/lazy.d.ts +2 -37
- package/dest/schnorr/lazy.d.ts.map +1 -1
- package/dest/schnorr/lazy.js +5 -36
- package/dest/single_key/account_contract.d.ts +2 -2
- package/dest/single_key/account_contract.d.ts.map +1 -1
- package/dest/single_key/account_contract.js +1 -1
- package/dest/single_key/index.d.ts +2 -21
- package/dest/single_key/index.d.ts.map +1 -1
- package/dest/single_key/index.js +2 -24
- package/dest/single_key/lazy.d.ts +2 -21
- 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/configuration.d.ts +1 -1
- package/dest/testing/index.d.ts +6 -30
- package/dest/testing/index.d.ts.map +1 -1
- package/dest/testing/index.js +18 -30
- package/dest/testing/lazy.d.ts +5 -28
- package/dest/testing/lazy.d.ts.map +1 -1
- package/dest/testing/lazy.js +19 -30
- package/dest/utils/index.d.ts +1 -1
- package/dest/utils/ssh_agent.d.ts +2 -5
- package/dest/utils/ssh_agent.d.ts.map +1 -1
- package/package.json +26 -20
- package/src/defaults/account_contract.ts +13 -5
- package/src/defaults/account_interface.ts +15 -11
- package/src/defaults/index.ts +1 -1
- package/src/ecdsa/ecdsa_k/account_contract.ts +5 -2
- package/src/ecdsa/ecdsa_k/index.ts +1 -33
- package/src/ecdsa/ecdsa_k/lazy.ts +4 -36
- package/src/ecdsa/ecdsa_r/account_contract.ts +42 -0
- package/src/ecdsa/ecdsa_r/index.ts +31 -0
- package/src/ecdsa/ecdsa_r/lazy.ts +39 -0
- package/src/ecdsa/index.ts +1 -0
- package/src/ecdsa/lazy.ts +1 -0
- package/src/ecdsa/ssh_ecdsa_r/account_contract.ts +5 -2
- package/src/ecdsa/ssh_ecdsa_r/index.ts +3 -42
- package/src/ecdsa/ssh_ecdsa_r/lazy.ts +3 -53
- package/src/schnorr/account_contract.ts +2 -2
- package/src/schnorr/index.ts +8 -56
- package/src/schnorr/lazy.ts +11 -59
- package/src/single_key/account_contract.ts +5 -2
- package/src/single_key/index.ts +2 -33
- 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 -51
- package/src/testing/lazy.ts +18 -50
- package/dest/dapp/dapp_interface.d.ts +0 -10
- package/dest/dapp/dapp_interface.d.ts.map +0 -1
- package/dest/dapp/dapp_interface.js +0 -16
- package/dest/dapp/index.d.ts +0 -2
- package/dest/dapp/index.d.ts.map +0 -1
- package/dest/dapp/index.js +0 -1
- 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 -58
- package/src/dapp/dapp_interface.ts +0 -38
- package/src/dapp/index.ts +0 -1
- package/src/testing/create_account.ts +0 -93
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dapp_interface.d.ts","sourceRoot":"","sources":["../../src/dapp/dapp_interface.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,YAAY,EACZ,eAAe,EACf,KAAK,QAAQ,EACd,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,uBAAuB;gBAE7D,mBAAmB,EAAE,mBAAmB,EACxC,WAAW,EAAE,eAAe,EAC5B,WAAW,EAAE,YAAY,EACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,WAAW,GAAG,iBAAiB,CAAC;IAY3D,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,GAAG,oBAAoB;CAMpG"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { DefaultDappEntrypoint } from '@aztec/entrypoints/dapp';
|
|
2
|
-
import { DefaultAccountInterface } from '../defaults/account_interface.js';
|
|
3
|
-
/**
|
|
4
|
-
* Default implementation for an account interface that uses a dapp entrypoint.
|
|
5
|
-
*/ export class DefaultDappInterface extends DefaultAccountInterface {
|
|
6
|
-
constructor(authWitnessProvider, userAddress, dappAddress, nodeInfo){
|
|
7
|
-
super(authWitnessProvider, userAddress, nodeInfo);
|
|
8
|
-
this.entrypoint = new DefaultDappEntrypoint(userAddress.address, authWitnessProvider, dappAddress, nodeInfo.l1ChainId, nodeInfo.protocolVersion);
|
|
9
|
-
}
|
|
10
|
-
static createFromUserWallet(wallet, dappAddress) {
|
|
11
|
-
return new DefaultDappInterface(wallet, wallet.getCompleteAddress(), dappAddress, {
|
|
12
|
-
l1ChainId: wallet.getChainId().toNumber(),
|
|
13
|
-
protocolVersion: wallet.getVersion().toNumber()
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
}
|
package/dest/dapp/index.d.ts
DELETED
package/dest/dapp/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dapp/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
package/dest/dapp/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './dapp_interface.js';
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { type AccountManager, type PXE, type WaitOpts } from '@aztec/aztec.js';
|
|
2
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
import type { InitialAccountData } from './configuration.js';
|
|
4
|
-
/**
|
|
5
|
-
* Generate a fixed amount of random schnorr account contract instance.
|
|
6
|
-
*/
|
|
7
|
-
export declare function generateSchnorrAccounts(numberOfAccounts: number): Promise<{
|
|
8
|
-
secret: Fr;
|
|
9
|
-
signingKey: import("@aztec/aztec.js").Fq;
|
|
10
|
-
salt: Fr;
|
|
11
|
-
address: import("@aztec/aztec.js").AztecAddress;
|
|
12
|
-
}[]>;
|
|
13
|
-
/**
|
|
14
|
-
* Data for deploying funded account.
|
|
15
|
-
*/
|
|
16
|
-
type DeployAccountData = Pick<InitialAccountData, 'secret' | 'salt'> & {
|
|
17
|
-
/**
|
|
18
|
-
* An optional signingKey if it's not derived from the secret.
|
|
19
|
-
*/
|
|
20
|
-
signingKey?: InitialAccountData['signingKey'];
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Deploy schnorr account contract.
|
|
24
|
-
* It will pay for the fee for the deployment itself. So it must be funded with the prefilled public data.
|
|
25
|
-
*/
|
|
26
|
-
export declare function deployFundedSchnorrAccount(pxe: PXE, account: DeployAccountData, opts?: WaitOpts & {
|
|
27
|
-
/**
|
|
28
|
-
* Whether or not to skip registering contract class.
|
|
29
|
-
*/
|
|
30
|
-
skipClassRegistration?: boolean;
|
|
31
|
-
}): Promise<AccountManager>;
|
|
32
|
-
/**
|
|
33
|
-
* Deploy schnorr account contracts.
|
|
34
|
-
* They will pay for the fees for the deployment themselves. So they must be funded with the prefilled public data.
|
|
35
|
-
*/
|
|
36
|
-
export declare function deployFundedSchnorrAccounts(pxe: PXE, accounts: DeployAccountData[], opts?: WaitOpts & {
|
|
37
|
-
/**
|
|
38
|
-
* Whether or not to skip registering contract class.
|
|
39
|
-
*/
|
|
40
|
-
skipClassRegistration?: boolean;
|
|
41
|
-
}): Promise<AccountManager[]>;
|
|
42
|
-
export {};
|
|
43
|
-
//# sourceMappingURL=create_account.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create_account.d.ts","sourceRoot":"","sources":["../../src/testing/create_account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAyB,KAAK,GAAG,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtG,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAI9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D;;GAEG;AACH,wBAAsB,uBAAuB,CAAC,gBAAgB,EAAE,MAAM;;;;;KAarE;AAED;;GAEG;AACH,KAAK,iBAAiB,GAAG,IAAI,CAAC,kBAAkB,EAAE,QAAQ,GAAG,MAAM,CAAC,GAAG;IACrE;;OAEG;IACH,UAAU,CAAC,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;CAC/C,CAAC;AAEF;;;GAGG;AACH,wBAAsB,0BAA0B,CAC9C,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,iBAAiB,EAC1B,IAAI,GAAE,QAAQ,GAAG;IACf;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACiB,GAClD,OAAO,CAAC,cAAc,CAAC,CAiBzB;AAED;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,iBAAiB,EAAE,EAC7B,IAAI,GAAE,QAAQ,GAAG;IACf;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACiB,GAClD,OAAO,CAAC,cAAc,EAAE,CAAC,CAY3B"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { FeeJuicePaymentMethod } from '@aztec/aztec.js';
|
|
2
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
4
|
-
import { getSchnorrAccount, getSchnorrAccountContractAddress } from '../schnorr/index.js';
|
|
5
|
-
/**
|
|
6
|
-
* Generate a fixed amount of random schnorr account contract instance.
|
|
7
|
-
*/ export async function generateSchnorrAccounts(numberOfAccounts) {
|
|
8
|
-
const secrets = Array.from({
|
|
9
|
-
length: numberOfAccounts
|
|
10
|
-
}, ()=>Fr.random());
|
|
11
|
-
return await Promise.all(secrets.map(async (secret)=>{
|
|
12
|
-
const salt = Fr.random();
|
|
13
|
-
return {
|
|
14
|
-
secret,
|
|
15
|
-
signingKey: deriveSigningKey(secret),
|
|
16
|
-
salt,
|
|
17
|
-
address: await getSchnorrAccountContractAddress(secret, salt)
|
|
18
|
-
};
|
|
19
|
-
}));
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Deploy schnorr account contract.
|
|
23
|
-
* It will pay for the fee for the deployment itself. So it must be funded with the prefilled public data.
|
|
24
|
-
*/ export async function deployFundedSchnorrAccount(pxe, account, opts = {
|
|
25
|
-
interval: 0.1,
|
|
26
|
-
skipClassRegistration: false
|
|
27
|
-
}) {
|
|
28
|
-
const signingKey = account.signingKey ?? deriveSigningKey(account.secret);
|
|
29
|
-
const accountManager = await getSchnorrAccount(pxe, account.secret, signingKey, account.salt);
|
|
30
|
-
// Pay the fee by the account itself.
|
|
31
|
-
// This only works when the world state is prefilled with the balance for the account in test environment.
|
|
32
|
-
const paymentMethod = new FeeJuicePaymentMethod(accountManager.getAddress());
|
|
33
|
-
await accountManager.deploy({
|
|
34
|
-
skipClassRegistration: opts.skipClassRegistration,
|
|
35
|
-
skipPublicDeployment: true,
|
|
36
|
-
fee: {
|
|
37
|
-
paymentMethod
|
|
38
|
-
}
|
|
39
|
-
}).wait(opts);
|
|
40
|
-
return accountManager;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Deploy schnorr account contracts.
|
|
44
|
-
* They will pay for the fees for the deployment themselves. So they must be funded with the prefilled public data.
|
|
45
|
-
*/ export async function deployFundedSchnorrAccounts(pxe, accounts, opts = {
|
|
46
|
-
interval: 0.1,
|
|
47
|
-
skipClassRegistration: false
|
|
48
|
-
}) {
|
|
49
|
-
const accountManagers = [];
|
|
50
|
-
// Serial due to https://github.com/AztecProtocol/aztec-packages/issues/12045
|
|
51
|
-
for(let i = 0; i < accounts.length; i++){
|
|
52
|
-
accountManagers.push(await deployFundedSchnorrAccount(pxe, accounts[i], {
|
|
53
|
-
...opts,
|
|
54
|
-
skipClassRegistration: i !== 0 || opts.skipClassRegistration
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
return accountManagers;
|
|
58
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type AccountWallet,
|
|
3
|
-
type AuthWitnessProvider,
|
|
4
|
-
AztecAddress,
|
|
5
|
-
CompleteAddress,
|
|
6
|
-
type NodeInfo,
|
|
7
|
-
} from '@aztec/aztec.js';
|
|
8
|
-
import { DefaultDappEntrypoint } from '@aztec/entrypoints/dapp';
|
|
9
|
-
|
|
10
|
-
import { DefaultAccountInterface } from '../defaults/account_interface.js';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Default implementation for an account interface that uses a dapp entrypoint.
|
|
14
|
-
*/
|
|
15
|
-
export class DefaultDappInterface extends DefaultAccountInterface {
|
|
16
|
-
constructor(
|
|
17
|
-
authWitnessProvider: AuthWitnessProvider,
|
|
18
|
-
userAddress: CompleteAddress,
|
|
19
|
-
dappAddress: AztecAddress,
|
|
20
|
-
nodeInfo: Pick<NodeInfo, 'l1ChainId' | 'protocolVersion'>,
|
|
21
|
-
) {
|
|
22
|
-
super(authWitnessProvider, userAddress, nodeInfo);
|
|
23
|
-
this.entrypoint = new DefaultDappEntrypoint(
|
|
24
|
-
userAddress.address,
|
|
25
|
-
authWitnessProvider,
|
|
26
|
-
dappAddress,
|
|
27
|
-
nodeInfo.l1ChainId,
|
|
28
|
-
nodeInfo.protocolVersion,
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
static createFromUserWallet(wallet: AccountWallet, dappAddress: AztecAddress): DefaultDappInterface {
|
|
33
|
-
return new DefaultDappInterface(wallet, wallet.getCompleteAddress(), dappAddress, {
|
|
34
|
-
l1ChainId: wallet.getChainId().toNumber(),
|
|
35
|
-
protocolVersion: wallet.getVersion().toNumber(),
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
package/src/dapp/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './dapp_interface.js';
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { type AccountManager, FeeJuicePaymentMethod, type PXE, type WaitOpts } from '@aztec/aztec.js';
|
|
2
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
4
|
-
|
|
5
|
-
import { getSchnorrAccount, getSchnorrAccountContractAddress } from '../schnorr/index.js';
|
|
6
|
-
import type { InitialAccountData } from './configuration.js';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Generate a fixed amount of random schnorr account contract instance.
|
|
10
|
-
*/
|
|
11
|
-
export async function generateSchnorrAccounts(numberOfAccounts: number) {
|
|
12
|
-
const secrets = Array.from({ length: numberOfAccounts }, () => Fr.random());
|
|
13
|
-
return await Promise.all(
|
|
14
|
-
secrets.map(async secret => {
|
|
15
|
-
const salt = Fr.random();
|
|
16
|
-
return {
|
|
17
|
-
secret,
|
|
18
|
-
signingKey: deriveSigningKey(secret),
|
|
19
|
-
salt,
|
|
20
|
-
address: await getSchnorrAccountContractAddress(secret, salt),
|
|
21
|
-
};
|
|
22
|
-
}),
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Data for deploying funded account.
|
|
28
|
-
*/
|
|
29
|
-
type DeployAccountData = Pick<InitialAccountData, 'secret' | 'salt'> & {
|
|
30
|
-
/**
|
|
31
|
-
* An optional signingKey if it's not derived from the secret.
|
|
32
|
-
*/
|
|
33
|
-
signingKey?: InitialAccountData['signingKey'];
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Deploy schnorr account contract.
|
|
38
|
-
* It will pay for the fee for the deployment itself. So it must be funded with the prefilled public data.
|
|
39
|
-
*/
|
|
40
|
-
export async function deployFundedSchnorrAccount(
|
|
41
|
-
pxe: PXE,
|
|
42
|
-
account: DeployAccountData,
|
|
43
|
-
opts: WaitOpts & {
|
|
44
|
-
/**
|
|
45
|
-
* Whether or not to skip registering contract class.
|
|
46
|
-
*/
|
|
47
|
-
skipClassRegistration?: boolean;
|
|
48
|
-
} = { interval: 0.1, skipClassRegistration: false },
|
|
49
|
-
): Promise<AccountManager> {
|
|
50
|
-
const signingKey = account.signingKey ?? deriveSigningKey(account.secret);
|
|
51
|
-
const accountManager = await getSchnorrAccount(pxe, account.secret, signingKey, account.salt);
|
|
52
|
-
|
|
53
|
-
// Pay the fee by the account itself.
|
|
54
|
-
// This only works when the world state is prefilled with the balance for the account in test environment.
|
|
55
|
-
const paymentMethod = new FeeJuicePaymentMethod(accountManager.getAddress());
|
|
56
|
-
|
|
57
|
-
await accountManager
|
|
58
|
-
.deploy({
|
|
59
|
-
skipClassRegistration: opts.skipClassRegistration,
|
|
60
|
-
skipPublicDeployment: true,
|
|
61
|
-
fee: { paymentMethod },
|
|
62
|
-
})
|
|
63
|
-
.wait(opts);
|
|
64
|
-
|
|
65
|
-
return accountManager;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Deploy schnorr account contracts.
|
|
70
|
-
* They will pay for the fees for the deployment themselves. So they must be funded with the prefilled public data.
|
|
71
|
-
*/
|
|
72
|
-
export async function deployFundedSchnorrAccounts(
|
|
73
|
-
pxe: PXE,
|
|
74
|
-
accounts: DeployAccountData[],
|
|
75
|
-
opts: WaitOpts & {
|
|
76
|
-
/**
|
|
77
|
-
* Whether or not to skip registering contract class.
|
|
78
|
-
*/
|
|
79
|
-
skipClassRegistration?: boolean;
|
|
80
|
-
} = { interval: 0.1, skipClassRegistration: false },
|
|
81
|
-
): Promise<AccountManager[]> {
|
|
82
|
-
const accountManagers: AccountManager[] = [];
|
|
83
|
-
// Serial due to https://github.com/AztecProtocol/aztec-packages/issues/12045
|
|
84
|
-
for (let i = 0; i < accounts.length; i++) {
|
|
85
|
-
accountManagers.push(
|
|
86
|
-
await deployFundedSchnorrAccount(pxe, accounts[i], {
|
|
87
|
-
...opts,
|
|
88
|
-
skipClassRegistration: i !== 0 || opts.skipClassRegistration, // Register the contract class at most once.
|
|
89
|
-
}),
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
return accountManagers;
|
|
93
|
-
}
|