@aztec/aztec.js 0.80.0 → 0.82.0
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/dest/account/{contract.d.ts → account_contract.d.ts} +11 -5
- package/dest/account/account_contract.d.ts.map +1 -0
- package/dest/account/{contract.js → account_contract.js} +5 -1
- package/dest/account/index.d.ts +2 -3
- package/dest/account/index.d.ts.map +1 -1
- package/dest/account/index.js +1 -2
- package/dest/account/interface.d.ts +1 -13
- package/dest/account/interface.d.ts.map +1 -1
- package/dest/account/interface.js +1 -0
- package/dest/account_manager/account_manager.d.ts +105 -0
- package/dest/account_manager/account_manager.d.ts.map +1 -0
- package/dest/account_manager/account_manager.js +165 -0
- package/dest/account_manager/deploy_account_method.d.ts +4 -4
- package/dest/account_manager/deploy_account_method.d.ts.map +1 -1
- package/dest/account_manager/deploy_account_method.js +28 -13
- package/dest/account_manager/deploy_account_sent_tx.d.ts +3 -3
- package/dest/account_manager/deploy_account_sent_tx.d.ts.map +1 -1
- package/dest/account_manager/deploy_account_sent_tx.js +2 -2
- package/dest/account_manager/index.d.ts +1 -104
- package/dest/account_manager/index.d.ts.map +1 -1
- package/dest/account_manager/index.js +1 -157
- package/dest/api/account.d.ts +2 -1
- package/dest/api/account.d.ts.map +1 -1
- package/dest/api/contract.d.ts +4 -1
- package/dest/api/contract.d.ts.map +1 -1
- package/dest/api/contract.js +3 -0
- package/dest/api/fee.d.ts +1 -1
- package/dest/api/fee.d.ts.map +1 -1
- package/dest/api/utils.d.ts +2 -1
- package/dest/api/utils.d.ts.map +1 -1
- package/dest/api/utils.js +2 -1
- package/dest/api/wallet.d.ts +1 -1
- package/dest/api/wallet.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.d.ts +22 -57
- package/dest/contract/base_contract_interaction.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.js +12 -67
- package/dest/contract/batch_call.d.ts +6 -18
- package/dest/contract/batch_call.d.ts.map +1 -1
- package/dest/contract/batch_call.js +25 -54
- package/dest/contract/contract.d.ts +1 -1
- package/dest/contract/contract.d.ts.map +1 -1
- package/dest/contract/contract_base.d.ts +2 -2
- package/dest/contract/contract_base.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.d.ts +38 -18
- package/dest/contract/contract_function_interaction.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.js +34 -41
- package/dest/contract/deploy_method.d.ts +7 -8
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +27 -32
- package/dest/contract/deploy_proven_tx.d.ts +2 -3
- package/dest/contract/deploy_proven_tx.d.ts.map +1 -1
- package/dest/contract/deploy_sent_tx.d.ts +2 -3
- package/dest/contract/deploy_sent_tx.d.ts.map +1 -1
- package/dest/contract/deploy_sent_tx.js +4 -4
- package/dest/contract/protocol_contracts.d.ts +1 -1
- package/dest/contract/protocol_contracts.d.ts.map +1 -1
- package/dest/contract/proven_tx.d.ts +3 -4
- package/dest/contract/proven_tx.d.ts.map +1 -1
- package/dest/contract/sent_tx.d.ts +4 -16
- package/dest/contract/sent_tx.d.ts.map +1 -1
- package/dest/contract/sent_tx.js +6 -37
- package/dest/contract/unsafe_contract.d.ts +1 -1
- package/dest/contract/unsafe_contract.d.ts.map +1 -1
- package/dest/contract/wait_for_proven.d.ts +17 -0
- package/dest/contract/wait_for_proven.d.ts.map +1 -0
- package/dest/contract/wait_for_proven.js +17 -0
- package/dest/deployment/broadcast_function.js +12 -8
- package/dest/deployment/contract_deployer.d.ts +1 -1
- package/dest/deployment/contract_deployer.d.ts.map +1 -1
- package/dest/deployment/register_class.d.ts +1 -1
- package/dest/deployment/register_class.d.ts.map +1 -1
- package/dest/deployment/register_class.js +6 -11
- package/dest/entrypoint/default_multi_call_entrypoint.d.ts +3 -2
- package/dest/entrypoint/default_multi_call_entrypoint.d.ts.map +1 -1
- package/dest/entrypoint/default_multi_call_entrypoint.js +12 -8
- package/dest/ethereum/portal_manager.d.ts +20 -11
- package/dest/ethereum/portal_manager.d.ts.map +1 -1
- package/dest/ethereum/portal_manager.js +64 -30
- package/dest/fee/fee_juice_payment_method.d.ts +3 -3
- package/dest/fee/fee_juice_payment_method.d.ts.map +1 -1
- package/dest/fee/fee_juice_payment_method.js +3 -2
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts +4 -4
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
- package/dest/fee/fee_juice_payment_method_with_claim.js +6 -5
- package/dest/fee/private_fee_payment_method.d.ts +6 -6
- package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/private_fee_payment_method.js +13 -12
- package/dest/fee/public_fee_payment_method.d.ts +7 -7
- package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/public_fee_payment_method.js +10 -11
- package/dest/fee/utils.d.ts +13 -0
- package/dest/fee/utils.d.ts.map +1 -0
- package/dest/fee/utils.js +32 -0
- package/dest/index.d.ts +1 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -1
- package/dest/test/aztec_cheat_codes.d.ts +2 -2
- package/dest/test/aztec_cheat_codes.d.ts.map +1 -1
- package/dest/test/aztec_cheat_codes.js +3 -3
- package/dest/utils/authwit.d.ts +16 -9
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/authwit.js +26 -35
- package/dest/wallet/account_wallet.d.ts +6 -6
- package/dest/wallet/account_wallet.d.ts.map +1 -1
- package/dest/wallet/account_wallet.js +15 -17
- package/dest/wallet/base_wallet.d.ts +12 -35
- package/dest/wallet/base_wallet.d.ts.map +1 -1
- package/dest/wallet/base_wallet.js +11 -64
- package/dest/wallet/index.d.ts +2 -2
- package/dest/wallet/index.d.ts.map +1 -1
- package/dest/wallet/index.js +1 -1
- package/dest/wallet/signerless_wallet.d.ts +3 -3
- package/dest/wallet/signerless_wallet.d.ts.map +1 -1
- package/dest/wallet/signerless_wallet.js +3 -6
- package/dest/wallet/wallet.d.ts +11 -0
- package/dest/wallet/wallet.d.ts.map +1 -0
- package/package.json +8 -7
- package/src/account/{contract.ts → account_contract.ts} +17 -4
- package/src/account/index.ts +2 -3
- package/src/account/interface.ts +1 -12
- package/src/account_manager/account_manager.ts +235 -0
- package/src/account_manager/deploy_account_method.ts +35 -15
- package/src/account_manager/deploy_account_sent_tx.ts +4 -4
- package/src/account_manager/index.ts +1 -227
- package/src/api/account.ts +2 -8
- package/src/api/contract.ts +5 -5
- package/src/api/fee.ts +1 -1
- package/src/api/utils.ts +1 -1
- package/src/api/wallet.ts +7 -1
- package/src/contract/base_contract_interaction.ts +32 -88
- package/src/contract/batch_call.ts +40 -43
- package/src/contract/contract.ts +1 -1
- package/src/contract/contract_base.ts +1 -1
- package/src/contract/contract_function_interaction.ts +85 -56
- package/src/contract/deploy_method.ts +24 -26
- package/src/contract/deploy_proven_tx.ts +2 -3
- package/src/contract/deploy_sent_tx.ts +6 -6
- package/src/contract/protocol_contracts.ts +1 -1
- package/src/contract/proven_tx.ts +2 -3
- package/src/contract/sent_tx.ts +6 -47
- package/src/contract/unsafe_contract.ts +1 -1
- package/src/contract/wait_for_proven.ts +38 -0
- package/src/deployment/broadcast_function.ts +40 -40
- package/src/deployment/contract_deployer.ts +1 -1
- package/src/deployment/register_class.ts +9 -22
- package/src/entrypoint/default_multi_call_entrypoint.ts +14 -7
- package/src/ethereum/portal_manager.ts +73 -24
- package/src/fee/fee_juice_payment_method.ts +4 -5
- package/src/fee/fee_juice_payment_method_with_claim.ts +24 -20
- package/src/fee/private_fee_payment_method.ts +29 -28
- package/src/fee/public_fee_payment_method.ts +29 -29
- package/src/fee/utils.ts +39 -0
- package/src/index.ts +1 -1
- package/src/test/aztec_cheat_codes.ts +3 -3
- package/src/utils/authwit.ts +32 -35
- package/src/wallet/account_wallet.ts +18 -17
- package/src/wallet/base_wallet.ts +27 -88
- package/src/wallet/index.ts +2 -2
- package/src/wallet/signerless_wallet.ts +9 -8
- package/src/wallet/wallet.ts +34 -0
- package/dest/account/contract.d.ts.map +0 -1
- package/dest/account/wallet.d.ts +0 -11
- package/dest/account/wallet.d.ts.map +0 -1
- package/dest/api/entrypoint.d.ts +0 -2
- package/dest/api/entrypoint.d.ts.map +0 -1
- package/dest/api/entrypoint.js +0 -1
- package/dest/entrypoint/default_entrypoint.d.ts +0 -12
- package/dest/entrypoint/default_entrypoint.d.ts.map +0 -1
- package/dest/entrypoint/default_entrypoint.js +0 -28
- package/dest/entrypoint/entrypoint.d.ts +0 -39
- package/dest/entrypoint/entrypoint.d.ts.map +0 -1
- package/dest/entrypoint/entrypoint.js +0 -20
- package/dest/entrypoint/payload.d.ts +0 -128
- package/dest/entrypoint/payload.d.ts.map +0 -1
- package/dest/entrypoint/payload.js +0 -143
- package/dest/fee/fee_payment_method.d.ts +0 -22
- package/dest/fee/fee_payment_method.d.ts.map +0 -1
- package/dest/fee/fee_payment_method.js +0 -3
- package/src/account/wallet.ts +0 -13
- package/src/api/entrypoint.ts +0 -1
- package/src/entrypoint/default_entrypoint.ts +0 -39
- package/src/entrypoint/entrypoint.ts +0 -60
- package/src/entrypoint/payload.ts +0 -238
- package/src/fee/fee_payment_method.ts +0 -22
- /package/dest/{account → wallet}/wallet.js +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { AuthWitnessProvider } from '@aztec/entrypoints/interfaces';
|
|
1
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
3
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
3
4
|
import type { CompleteAddress, NodeInfo } from '@aztec/stdlib/contract';
|
|
4
5
|
import { getContractInstanceFromDeployParams } from '@aztec/stdlib/contract';
|
|
5
6
|
import { deriveKeys } from '@aztec/stdlib/keys';
|
|
6
7
|
|
|
7
|
-
import type { AccountInterface
|
|
8
|
+
import type { AccountInterface } from './interface.js';
|
|
8
9
|
|
|
9
10
|
// docs:start:account-contract-interface
|
|
10
11
|
/**
|
|
@@ -18,9 +19,17 @@ export interface AccountContract {
|
|
|
18
19
|
getContractArtifact(): Promise<ContractArtifact>;
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
|
-
* Returns the deployment arguments for this instance, or undefined if this contract does not require deployment.
|
|
22
|
+
* Returns the deployment function name and arguments for this instance, or undefined if this contract does not require deployment.
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
|
+
getDeploymentFunctionAndArgs(): Promise<
|
|
25
|
+
| {
|
|
26
|
+
/** The name of the function used to deploy the contract */
|
|
27
|
+
constructorName: string;
|
|
28
|
+
/** The args to the function used to deploy the contract */
|
|
29
|
+
constructorArgs: any[];
|
|
30
|
+
}
|
|
31
|
+
| undefined
|
|
32
|
+
>;
|
|
24
33
|
|
|
25
34
|
/**
|
|
26
35
|
* Returns the account interface for this account contract given a deployment at the provided address.
|
|
@@ -45,9 +54,13 @@ export interface AccountContract {
|
|
|
45
54
|
*/
|
|
46
55
|
export async function getAccountContractAddress(accountContract: AccountContract, secret: Fr, salt: Fr) {
|
|
47
56
|
const { publicKeys } = await deriveKeys(secret);
|
|
48
|
-
const constructorArgs = await accountContract.
|
|
57
|
+
const { constructorName, constructorArgs } = (await accountContract.getDeploymentFunctionAndArgs()) ?? {
|
|
58
|
+
constructorName: undefined,
|
|
59
|
+
constructorArgs: undefined,
|
|
60
|
+
};
|
|
49
61
|
const artifact = await accountContract.getContractArtifact();
|
|
50
62
|
const instance = await getContractInstanceFromDeployParams(artifact, {
|
|
63
|
+
constructorArtifact: constructorName,
|
|
51
64
|
constructorArgs,
|
|
52
65
|
salt,
|
|
53
66
|
publicKeys,
|
package/src/account/index.ts
CHANGED
|
@@ -8,9 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { Fr } from '@aztec/foundation/fields';
|
|
10
10
|
|
|
11
|
-
export { type AccountContract, getAccountContractAddress } from './
|
|
12
|
-
export { type AccountInterface
|
|
13
|
-
export * from './wallet.js';
|
|
11
|
+
export { type AccountContract, getAccountContractAddress } from './account_contract.js';
|
|
12
|
+
export { type AccountInterface } from './interface.js';
|
|
14
13
|
|
|
15
14
|
/** A contract deployment salt. */
|
|
16
15
|
export type Salt = Fr | number | bigint;
|
package/src/account/interface.ts
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
|
+
import type { AuthWitnessProvider, EntrypointInterface } from '@aztec/entrypoints/interfaces';
|
|
1
2
|
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
3
3
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
import type { CompleteAddress } from '@aztec/stdlib/contract';
|
|
5
5
|
|
|
6
|
-
import type { EntrypointInterface } from '../entrypoint/entrypoint.js';
|
|
7
|
-
|
|
8
6
|
// docs:start:account-interface
|
|
9
|
-
/** Creates authorization witnesses. */
|
|
10
|
-
export interface AuthWitnessProvider {
|
|
11
|
-
/**
|
|
12
|
-
* Computes an authentication witness from either a message hash
|
|
13
|
-
* @param messageHash - The message hash to approve
|
|
14
|
-
* @returns The authentication witness
|
|
15
|
-
*/
|
|
16
|
-
createAuthWit(messageHash: Fr | Buffer): Promise<AuthWitness>;
|
|
17
|
-
}
|
|
18
7
|
|
|
19
8
|
/**
|
|
20
9
|
* Handler for interfacing with an account. Knows how to create transaction execution
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import { CompleteAddress, type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
3
|
+
import { getContractInstanceFromDeployParams } from '@aztec/stdlib/contract';
|
|
4
|
+
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
5
|
+
import { deriveKeys } from '@aztec/stdlib/keys';
|
|
6
|
+
|
|
7
|
+
import type { AccountContract } from '../account/account_contract.js';
|
|
8
|
+
import type { Salt } from '../account/index.js';
|
|
9
|
+
import type { AccountInterface } from '../account/interface.js';
|
|
10
|
+
import { Contract } from '../contract/contract.js';
|
|
11
|
+
import { DeployMethod, type DeployOptions } from '../contract/deploy_method.js';
|
|
12
|
+
import { DefaultWaitOpts, type WaitOpts } from '../contract/sent_tx.js';
|
|
13
|
+
import { DefaultMultiCallEntrypoint } from '../entrypoint/default_multi_call_entrypoint.js';
|
|
14
|
+
import { AccountWalletWithSecretKey, SignerlessWallet, type Wallet } from '../wallet/index.js';
|
|
15
|
+
import { DeployAccountMethod } from './deploy_account_method.js';
|
|
16
|
+
import { DeployAccountSentTx } from './deploy_account_sent_tx.js';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Options to deploy an account contract.
|
|
20
|
+
*/
|
|
21
|
+
export type DeployAccountOptions = Pick<
|
|
22
|
+
DeployOptions,
|
|
23
|
+
'fee' | 'skipClassRegistration' | 'skipPublicDeployment' | 'skipInitialization'
|
|
24
|
+
> & {
|
|
25
|
+
/**
|
|
26
|
+
* Wallet used for deploying the account contract. Must be funded in order to pay for the fee.
|
|
27
|
+
*/
|
|
28
|
+
deployWallet?: Wallet;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Manages a user account. Provides methods for calculating the account's address, deploying the account contract,
|
|
33
|
+
* and creating and registering the user wallet in the PXE Service.
|
|
34
|
+
*/
|
|
35
|
+
export class AccountManager {
|
|
36
|
+
private constructor(
|
|
37
|
+
private pxe: PXE,
|
|
38
|
+
private secretKey: Fr,
|
|
39
|
+
private accountContract: AccountContract,
|
|
40
|
+
private instance: ContractInstanceWithAddress,
|
|
41
|
+
/**
|
|
42
|
+
* Deployment salt for the account contract
|
|
43
|
+
*/
|
|
44
|
+
public readonly salt: Salt,
|
|
45
|
+
) {}
|
|
46
|
+
|
|
47
|
+
static async create(pxe: PXE, secretKey: Fr, accountContract: AccountContract, salt?: Salt) {
|
|
48
|
+
const { publicKeys } = await deriveKeys(secretKey);
|
|
49
|
+
salt = salt !== undefined ? new Fr(salt) : Fr.random();
|
|
50
|
+
|
|
51
|
+
const { constructorName, constructorArgs } = (await accountContract.getDeploymentFunctionAndArgs()) ?? {
|
|
52
|
+
constructorName: undefined,
|
|
53
|
+
constructorArgs: undefined,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const artifact = await accountContract.getContractArtifact();
|
|
57
|
+
const instance = await getContractInstanceFromDeployParams(artifact, {
|
|
58
|
+
constructorArtifact: constructorName,
|
|
59
|
+
constructorArgs,
|
|
60
|
+
salt: salt,
|
|
61
|
+
publicKeys,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
return new AccountManager(pxe, secretKey, accountContract, instance, salt);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
protected getPublicKeys() {
|
|
68
|
+
return this.instance.publicKeys;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
protected getPublicKeysHash() {
|
|
72
|
+
return this.getPublicKeys().hash();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Returns the entrypoint for this account as defined by its account contract.
|
|
77
|
+
* @returns An entrypoint.
|
|
78
|
+
*/
|
|
79
|
+
public async getAccount(): Promise<AccountInterface> {
|
|
80
|
+
const nodeInfo = await this.pxe.getNodeInfo();
|
|
81
|
+
const completeAddress = await this.getCompleteAddress();
|
|
82
|
+
return this.accountContract.getInterface(completeAddress, nodeInfo);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Gets the calculated complete address associated with this account.
|
|
87
|
+
* Does not require the account to be deployed or registered.
|
|
88
|
+
* @returns The address, partial address, and encryption public key.
|
|
89
|
+
*/
|
|
90
|
+
public getCompleteAddress(): Promise<CompleteAddress> {
|
|
91
|
+
return CompleteAddress.fromSecretKeyAndInstance(this.secretKey, this.instance);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Gets the address for this given account.
|
|
96
|
+
* Does not require the account to be deployed or registered.
|
|
97
|
+
* @returns The address.
|
|
98
|
+
*/
|
|
99
|
+
public getAddress() {
|
|
100
|
+
return this.instance.address;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Returns the contract instance definition associated with this account.
|
|
105
|
+
* Does not require the account to be deployed or registered.
|
|
106
|
+
* @returns ContractInstance instance.
|
|
107
|
+
*/
|
|
108
|
+
public getInstance(): ContractInstanceWithAddress {
|
|
109
|
+
return this.instance;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Returns a Wallet instance associated with this account. Use it to create Contract
|
|
114
|
+
* instances to be interacted with from this account.
|
|
115
|
+
* @returns A Wallet instance.
|
|
116
|
+
*/
|
|
117
|
+
public async getWallet(): Promise<AccountWalletWithSecretKey> {
|
|
118
|
+
const entrypoint = await this.getAccount();
|
|
119
|
+
return new AccountWalletWithSecretKey(this.pxe, entrypoint, this.secretKey, this.salt);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Registers this account in the PXE Service and returns the associated wallet. Registering
|
|
124
|
+
* the account on the PXE Service is required for managing private state associated with it.
|
|
125
|
+
* Use the returned wallet to create Contract instances to be interacted with from this account.
|
|
126
|
+
* @param opts - Options to wait for the account to be synched.
|
|
127
|
+
* @returns A Wallet instance.
|
|
128
|
+
*/
|
|
129
|
+
public async register(): Promise<AccountWalletWithSecretKey> {
|
|
130
|
+
await this.pxe.registerContract({
|
|
131
|
+
artifact: await this.accountContract.getContractArtifact(),
|
|
132
|
+
instance: this.getInstance(),
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
await this.pxe.registerAccount(this.secretKey, (await this.getCompleteAddress()).partialAddress);
|
|
136
|
+
|
|
137
|
+
return this.getWallet();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Returns the pre-populated deployment method to deploy the account contract that backs this account.
|
|
142
|
+
* Typically you will not need this method and can call `deploy` directly. Use this for having finer
|
|
143
|
+
* grained control on when to create, simulate, and send the deployment tx.
|
|
144
|
+
* @param deployWallet - Wallet used for deploying the account contract.
|
|
145
|
+
* @returns A DeployMethod instance that deploys this account contract.
|
|
146
|
+
*/
|
|
147
|
+
public async getDeployMethod(deployWallet?: Wallet) {
|
|
148
|
+
const artifact = await this.accountContract.getContractArtifact();
|
|
149
|
+
|
|
150
|
+
if (!(await this.isDeployable())) {
|
|
151
|
+
throw new Error(`Account contract ${artifact.name} does not require deployment.`);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const completeAddress = await this.getCompleteAddress();
|
|
155
|
+
|
|
156
|
+
await this.pxe.registerAccount(this.secretKey, completeAddress.partialAddress);
|
|
157
|
+
|
|
158
|
+
const { constructorName, constructorArgs } = (await this.accountContract.getDeploymentFunctionAndArgs()) ?? {
|
|
159
|
+
constructorName: undefined,
|
|
160
|
+
constructorArgs: undefined,
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
if (deployWallet) {
|
|
164
|
+
// If deploying using an existing wallet/account, treat it like regular contract deployment.
|
|
165
|
+
const thisWallet = await this.getWallet();
|
|
166
|
+
return new DeployMethod(
|
|
167
|
+
this.getPublicKeys(),
|
|
168
|
+
deployWallet,
|
|
169
|
+
artifact,
|
|
170
|
+
address => Contract.at(address, artifact, thisWallet),
|
|
171
|
+
constructorArgs,
|
|
172
|
+
constructorName,
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const { l1ChainId: chainId, protocolVersion } = await this.pxe.getNodeInfo();
|
|
177
|
+
// We use a signerless wallet with the multi call entrypoint in order to make multiple calls in one go.
|
|
178
|
+
// If we used getWallet, the deployment would get routed via the account contract entrypoint
|
|
179
|
+
// and it can't be used unless the contract is initialized.
|
|
180
|
+
const wallet = new SignerlessWallet(this.pxe, new DefaultMultiCallEntrypoint(chainId, protocolVersion));
|
|
181
|
+
|
|
182
|
+
return new DeployAccountMethod(
|
|
183
|
+
this.accountContract.getAuthWitnessProvider(completeAddress),
|
|
184
|
+
this.getPublicKeys(),
|
|
185
|
+
wallet,
|
|
186
|
+
artifact,
|
|
187
|
+
constructorArgs,
|
|
188
|
+
constructorName,
|
|
189
|
+
'entrypoint',
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Deploys the account contract that backs this account.
|
|
195
|
+
* Does not register the associated class nor publicly deploy the instance by default.
|
|
196
|
+
* Uses the salt provided in the constructor or a randomly generated one.
|
|
197
|
+
* Registers the account in the PXE Service before deploying the contract.
|
|
198
|
+
* @param opts - Fee options to be used for the deployment.
|
|
199
|
+
* @returns A SentTx object that can be waited to get the associated Wallet.
|
|
200
|
+
*/
|
|
201
|
+
public deploy(opts?: DeployAccountOptions): DeployAccountSentTx {
|
|
202
|
+
const sentTx = this.getDeployMethod(opts?.deployWallet)
|
|
203
|
+
.then(deployMethod =>
|
|
204
|
+
deployMethod.send({
|
|
205
|
+
contractAddressSalt: new Fr(this.salt),
|
|
206
|
+
skipClassRegistration: opts?.skipClassRegistration ?? true,
|
|
207
|
+
skipPublicDeployment: opts?.skipPublicDeployment ?? true,
|
|
208
|
+
skipInitialization: opts?.skipInitialization ?? false,
|
|
209
|
+
universalDeploy: true,
|
|
210
|
+
fee: opts?.fee,
|
|
211
|
+
}),
|
|
212
|
+
)
|
|
213
|
+
.then(tx => tx.getTxHash());
|
|
214
|
+
return new DeployAccountSentTx(this.pxe, sentTx, this.getWallet());
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Deploys the account contract that backs this account if needed and awaits the tx to be mined.
|
|
219
|
+
* Uses the salt provided in the constructor or a randomly generated one. If no initialization
|
|
220
|
+
* is required it skips the transaction, and only registers the account in the PXE Service.
|
|
221
|
+
* @param opts - Options to wait for the tx to be mined.
|
|
222
|
+
* @returns A Wallet instance.
|
|
223
|
+
*/
|
|
224
|
+
public async waitSetup(opts: DeployAccountOptions & WaitOpts = DefaultWaitOpts): Promise<AccountWalletWithSecretKey> {
|
|
225
|
+
await ((await this.isDeployable()) ? this.deploy(opts).wait(opts) : this.register());
|
|
226
|
+
return this.getWallet();
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Returns whether this account contract has a constructor and needs deployment.
|
|
231
|
+
*/
|
|
232
|
+
public async isDeployable() {
|
|
233
|
+
return (await this.accountContract.getDeploymentFunctionAndArgs()) !== undefined;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EncodedAppEntrypointCalls,
|
|
3
|
+
EncodedCallsForEntrypoint,
|
|
4
|
+
computeCombinedPayloadHash,
|
|
5
|
+
} from '@aztec/entrypoints/encoding';
|
|
6
|
+
import type { AuthWitnessProvider } from '@aztec/entrypoints/interfaces';
|
|
7
|
+
import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/entrypoints/payload';
|
|
1
8
|
import { type ContractArtifact, type FunctionArtifact, getFunctionArtifactByName } from '@aztec/stdlib/abi';
|
|
2
9
|
import type { PublicKeys } from '@aztec/stdlib/keys';
|
|
3
10
|
|
|
4
|
-
import type { AuthWitnessProvider } from '../account/interface.js';
|
|
5
|
-
import type { Wallet } from '../account/wallet.js';
|
|
6
11
|
import { Contract } from '../contract/contract.js';
|
|
7
12
|
import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
|
|
8
13
|
import { DeployMethod, type DeployOptions } from '../contract/deploy_method.js';
|
|
9
|
-
import {
|
|
14
|
+
import type { Wallet } from '../wallet/wallet.js';
|
|
10
15
|
|
|
11
16
|
/**
|
|
12
17
|
* Contract interaction for deploying an account contract. Handles fee preparation and contract initialization.
|
|
@@ -40,28 +45,43 @@ export class DeployAccountMethod extends DeployMethod {
|
|
|
40
45
|
: feePaymentNameOrArtifact;
|
|
41
46
|
}
|
|
42
47
|
|
|
43
|
-
protected override async
|
|
44
|
-
|
|
48
|
+
protected override async getInitializeExecutionPayload(options: DeployOptions): Promise<ExecutionPayload> {
|
|
49
|
+
let exec = await super.getInitializeExecutionPayload(options);
|
|
45
50
|
|
|
46
51
|
if (options.fee && this.#feePaymentArtifact) {
|
|
47
52
|
const { address } = await this.getInstance();
|
|
48
|
-
const
|
|
53
|
+
const emptyAppCalls = await EncodedAppEntrypointCalls.fromAppExecution([]);
|
|
49
54
|
const fee = await this.getDefaultFeeOptions(options.fee);
|
|
50
|
-
|
|
51
|
-
const
|
|
55
|
+
// Get the execution payload for the fee, it includes the calls and potentially authWitnesses
|
|
56
|
+
const { calls: feeCalls, authWitnesses: feeAuthwitnesses } = await fee.paymentMethod.getExecutionPayload(
|
|
57
|
+
fee.gasSettings,
|
|
58
|
+
);
|
|
59
|
+
// Encode the calls for the fee
|
|
60
|
+
const feePayer = await fee.paymentMethod.getFeePayer(fee.gasSettings);
|
|
61
|
+
const isFeePayer = feePayer.equals(address);
|
|
62
|
+
const feeEncodedCalls = await EncodedCallsForEntrypoint.fromFeeCalls(feeCalls, isFeePayer);
|
|
52
63
|
|
|
53
|
-
|
|
64
|
+
// Get the entrypoint args
|
|
65
|
+
const args = [emptyAppCalls, feeEncodedCalls, false];
|
|
54
66
|
|
|
55
|
-
|
|
56
|
-
|
|
67
|
+
// Compute the authwitness required to verify the combined payload
|
|
68
|
+
const combinedPayloadAuthWitness = await this.#authWitnessProvider.createAuthWit(
|
|
69
|
+
await computeCombinedPayloadHash(emptyAppCalls, feeEncodedCalls),
|
|
57
70
|
);
|
|
58
71
|
|
|
59
|
-
call
|
|
60
|
-
|
|
72
|
+
const call = new ContractFunctionInteraction(
|
|
73
|
+
this.wallet,
|
|
74
|
+
address,
|
|
75
|
+
this.#feePaymentArtifact,
|
|
76
|
+
args,
|
|
77
|
+
[combinedPayloadAuthWitness, ...feeAuthwitnesses],
|
|
78
|
+
[],
|
|
79
|
+
[...emptyAppCalls.hashedArguments, ...feeEncodedCalls.hashedArguments],
|
|
80
|
+
);
|
|
61
81
|
|
|
62
|
-
|
|
82
|
+
exec = mergeExecutionPayloads([exec, await call.request()]);
|
|
63
83
|
}
|
|
64
84
|
|
|
65
|
-
return
|
|
85
|
+
return exec;
|
|
66
86
|
}
|
|
67
87
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
2
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
2
|
+
import type { AztecNode, PXE } from '@aztec/stdlib/interfaces/client';
|
|
3
3
|
import type { TxHash, TxReceipt } from '@aztec/stdlib/tx';
|
|
4
4
|
|
|
5
|
-
import type { Wallet } from '../account/index.js';
|
|
6
5
|
import { DefaultWaitOpts, SentTx, type WaitOpts } from '../contract/sent_tx.js';
|
|
6
|
+
import type { Wallet } from '../wallet/wallet.js';
|
|
7
7
|
|
|
8
8
|
/** Extends a transaction receipt with a wallet instance for the newly deployed contract. */
|
|
9
9
|
export type DeployAccountTxReceipt = FieldsOf<TxReceipt> & {
|
|
@@ -15,8 +15,8 @@ export type DeployAccountTxReceipt = FieldsOf<TxReceipt> & {
|
|
|
15
15
|
* A deployment transaction for an account contract sent to the network, extending SentTx with methods to get the resulting wallet.
|
|
16
16
|
*/
|
|
17
17
|
export class DeployAccountSentTx extends SentTx {
|
|
18
|
-
constructor(
|
|
19
|
-
super(
|
|
18
|
+
constructor(pxeOrNode: AztecNode | PXE, txHashPromise: Promise<TxHash>, private getWalletPromise: Promise<Wallet>) {
|
|
19
|
+
super(pxeOrNode, txHashPromise);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/**
|
|
@@ -1,229 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import { CompleteAddress, type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
3
|
-
import { getContractInstanceFromDeployParams } from '@aztec/stdlib/contract';
|
|
4
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
5
|
-
import { deriveKeys } from '@aztec/stdlib/keys';
|
|
6
|
-
|
|
7
|
-
import type { AccountContract } from '../account/contract.js';
|
|
8
|
-
import type { Salt, Wallet } from '../account/index.js';
|
|
9
|
-
import type { AccountInterface } from '../account/interface.js';
|
|
10
|
-
import { Contract } from '../contract/contract.js';
|
|
11
|
-
import { DeployMethod, type DeployOptions } from '../contract/deploy_method.js';
|
|
12
|
-
import { DefaultWaitOpts, type WaitOpts } from '../contract/sent_tx.js';
|
|
13
|
-
import { DefaultMultiCallEntrypoint } from '../entrypoint/default_multi_call_entrypoint.js';
|
|
14
|
-
import { AccountWalletWithSecretKey, SignerlessWallet } from '../wallet/index.js';
|
|
15
|
-
import { DeployAccountMethod } from './deploy_account_method.js';
|
|
16
|
-
import { DeployAccountSentTx } from './deploy_account_sent_tx.js';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Options to deploy an account contract.
|
|
20
|
-
*/
|
|
21
|
-
export type DeployAccountOptions = Pick<
|
|
22
|
-
DeployOptions,
|
|
23
|
-
'fee' | 'skipClassRegistration' | 'skipPublicDeployment' | 'skipInitialization'
|
|
24
|
-
> & {
|
|
25
|
-
/**
|
|
26
|
-
* Wallet used for deploying the account contract. Must be funded in order to pay for the fee.
|
|
27
|
-
*/
|
|
28
|
-
deployWallet?: Wallet;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Manages a user account. Provides methods for calculating the account's address, deploying the account contract,
|
|
33
|
-
* and creating and registering the user wallet in the PXE Service.
|
|
34
|
-
*/
|
|
35
|
-
export class AccountManager {
|
|
36
|
-
private constructor(
|
|
37
|
-
private pxe: PXE,
|
|
38
|
-
private secretKey: Fr,
|
|
39
|
-
private accountContract: AccountContract,
|
|
40
|
-
private instance: ContractInstanceWithAddress,
|
|
41
|
-
/**
|
|
42
|
-
* Deployment salt for the account contract
|
|
43
|
-
*/
|
|
44
|
-
public readonly salt: Salt,
|
|
45
|
-
) {}
|
|
46
|
-
|
|
47
|
-
static async create(pxe: PXE, secretKey: Fr, accountContract: AccountContract, salt?: Salt) {
|
|
48
|
-
const { publicKeys } = await deriveKeys(secretKey);
|
|
49
|
-
salt = salt !== undefined ? new Fr(salt) : Fr.random();
|
|
50
|
-
|
|
51
|
-
const artifact = await accountContract.getContractArtifact();
|
|
52
|
-
const instance = await getContractInstanceFromDeployParams(artifact, {
|
|
53
|
-
constructorArgs: await accountContract.getDeploymentArgs(),
|
|
54
|
-
salt: salt,
|
|
55
|
-
publicKeys,
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
return new AccountManager(pxe, secretKey, accountContract, instance, salt);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
protected getPublicKeys() {
|
|
62
|
-
return this.instance.publicKeys;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
protected getPublicKeysHash() {
|
|
66
|
-
return this.getPublicKeys().hash();
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Returns the entrypoint for this account as defined by its account contract.
|
|
71
|
-
* @returns An entrypoint.
|
|
72
|
-
*/
|
|
73
|
-
public async getAccount(): Promise<AccountInterface> {
|
|
74
|
-
const nodeInfo = await this.pxe.getNodeInfo();
|
|
75
|
-
const completeAddress = await this.getCompleteAddress();
|
|
76
|
-
return this.accountContract.getInterface(completeAddress, nodeInfo);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Gets the calculated complete address associated with this account.
|
|
81
|
-
* Does not require the account to be deployed or registered.
|
|
82
|
-
* @returns The address, partial address, and encryption public key.
|
|
83
|
-
*/
|
|
84
|
-
public getCompleteAddress(): Promise<CompleteAddress> {
|
|
85
|
-
return CompleteAddress.fromSecretKeyAndInstance(this.secretKey, this.instance);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Gets the address for this given account.
|
|
90
|
-
* Does not require the account to be deployed or registered.
|
|
91
|
-
* @returns The address.
|
|
92
|
-
*/
|
|
93
|
-
public getAddress() {
|
|
94
|
-
return this.instance.address;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Returns the contract instance definition associated with this account.
|
|
99
|
-
* Does not require the account to be deployed or registered.
|
|
100
|
-
* @returns ContractInstance instance.
|
|
101
|
-
*/
|
|
102
|
-
public getInstance(): ContractInstanceWithAddress {
|
|
103
|
-
return this.instance;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Returns a Wallet instance associated with this account. Use it to create Contract
|
|
108
|
-
* instances to be interacted with from this account.
|
|
109
|
-
* @returns A Wallet instance.
|
|
110
|
-
*/
|
|
111
|
-
public async getWallet(): Promise<AccountWalletWithSecretKey> {
|
|
112
|
-
const entrypoint = await this.getAccount();
|
|
113
|
-
return new AccountWalletWithSecretKey(this.pxe, entrypoint, this.secretKey, this.salt);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Registers this account in the PXE Service and returns the associated wallet. Registering
|
|
118
|
-
* the account on the PXE Service is required for managing private state associated with it.
|
|
119
|
-
* Use the returned wallet to create Contract instances to be interacted with from this account.
|
|
120
|
-
* @param opts - Options to wait for the account to be synched.
|
|
121
|
-
* @returns A Wallet instance.
|
|
122
|
-
*/
|
|
123
|
-
public async register(): Promise<AccountWalletWithSecretKey> {
|
|
124
|
-
await this.pxe.registerContract({
|
|
125
|
-
artifact: await this.accountContract.getContractArtifact(),
|
|
126
|
-
instance: this.getInstance(),
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
await this.pxe.registerAccount(this.secretKey, (await this.getCompleteAddress()).partialAddress);
|
|
130
|
-
|
|
131
|
-
return this.getWallet();
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Returns the pre-populated deployment method to deploy the account contract that backs this account.
|
|
136
|
-
* Typically you will not need this method and can call `deploy` directly. Use this for having finer
|
|
137
|
-
* grained control on when to create, simulate, and send the deployment tx.
|
|
138
|
-
* @param deployWallet - Wallet used for deploying the account contract.
|
|
139
|
-
* @returns A DeployMethod instance that deploys this account contract.
|
|
140
|
-
*/
|
|
141
|
-
public async getDeployMethod(deployWallet?: Wallet) {
|
|
142
|
-
const artifact = await this.accountContract.getContractArtifact();
|
|
143
|
-
|
|
144
|
-
if (!(await this.isDeployable())) {
|
|
145
|
-
throw new Error(`Account contract ${artifact.name} does not require deployment.`);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const completeAddress = await this.getCompleteAddress();
|
|
149
|
-
|
|
150
|
-
await this.pxe.registerAccount(this.secretKey, completeAddress.partialAddress);
|
|
151
|
-
|
|
152
|
-
const args = (await this.accountContract.getDeploymentArgs()) ?? [];
|
|
153
|
-
|
|
154
|
-
if (deployWallet) {
|
|
155
|
-
// If deploying using an existing wallet/account, treat it like regular contract deployment.
|
|
156
|
-
const thisWallet = await this.getWallet();
|
|
157
|
-
return new DeployMethod(
|
|
158
|
-
this.getPublicKeys(),
|
|
159
|
-
deployWallet,
|
|
160
|
-
artifact,
|
|
161
|
-
address => Contract.at(address, artifact, thisWallet),
|
|
162
|
-
args,
|
|
163
|
-
'constructor',
|
|
164
|
-
);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
const { l1ChainId: chainId, protocolVersion } = await this.pxe.getNodeInfo();
|
|
168
|
-
// We use a signerless wallet with the multi call entrypoint in order to make multiple calls in one go.
|
|
169
|
-
// If we used getWallet, the deployment would get routed via the account contract entrypoint
|
|
170
|
-
// and it can't be used unless the contract is initialized.
|
|
171
|
-
const wallet = new SignerlessWallet(this.pxe, new DefaultMultiCallEntrypoint(chainId, protocolVersion));
|
|
172
|
-
|
|
173
|
-
return new DeployAccountMethod(
|
|
174
|
-
this.accountContract.getAuthWitnessProvider(completeAddress),
|
|
175
|
-
this.getPublicKeys(),
|
|
176
|
-
wallet,
|
|
177
|
-
artifact,
|
|
178
|
-
args,
|
|
179
|
-
'constructor',
|
|
180
|
-
'entrypoint',
|
|
181
|
-
);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Deploys the account contract that backs this account.
|
|
186
|
-
* Does not register the associated class nor publicly deploy the instance by default.
|
|
187
|
-
* Uses the salt provided in the constructor or a randomly generated one.
|
|
188
|
-
* Registers the account in the PXE Service before deploying the contract.
|
|
189
|
-
* @param opts - Fee options to be used for the deployment.
|
|
190
|
-
* @returns A SentTx object that can be waited to get the associated Wallet.
|
|
191
|
-
*/
|
|
192
|
-
public deploy(opts?: DeployAccountOptions): DeployAccountSentTx {
|
|
193
|
-
const sentTx = this.getDeployMethod(opts?.deployWallet)
|
|
194
|
-
.then(deployMethod =>
|
|
195
|
-
deployMethod.send({
|
|
196
|
-
contractAddressSalt: new Fr(this.salt),
|
|
197
|
-
skipClassRegistration: opts?.skipClassRegistration ?? true,
|
|
198
|
-
skipPublicDeployment: opts?.skipPublicDeployment ?? true,
|
|
199
|
-
skipInitialization: opts?.skipInitialization ?? false,
|
|
200
|
-
universalDeploy: true,
|
|
201
|
-
fee: opts?.fee,
|
|
202
|
-
}),
|
|
203
|
-
)
|
|
204
|
-
.then(tx => tx.getTxHash());
|
|
205
|
-
return new DeployAccountSentTx(this.pxe, sentTx, this.getWallet());
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Deploys the account contract that backs this account if needed and awaits the tx to be mined.
|
|
210
|
-
* Uses the salt provided in the constructor or a randomly generated one. If no initialization
|
|
211
|
-
* is required it skips the transaction, and only registers the account in the PXE Service.
|
|
212
|
-
* @param opts - Options to wait for the tx to be mined.
|
|
213
|
-
* @returns A Wallet instance.
|
|
214
|
-
*/
|
|
215
|
-
public async waitSetup(opts: DeployAccountOptions & WaitOpts = DefaultWaitOpts): Promise<AccountWalletWithSecretKey> {
|
|
216
|
-
await ((await this.isDeployable()) ? this.deploy(opts).wait(opts) : this.register());
|
|
217
|
-
return this.getWallet();
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Returns whether this account contract has a constructor and needs deployment.
|
|
222
|
-
*/
|
|
223
|
-
public async isDeployable() {
|
|
224
|
-
return (await this.accountContract.getDeploymentArgs()) !== undefined;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
1
|
+
export { AccountManager, type DeployAccountOptions } from './account_manager.js';
|
|
228
2
|
export { DeployAccountMethod } from './deploy_account_method.js';
|
|
229
3
|
export { type DeployAccountTxReceipt, DeployAccountSentTx } from './deploy_account_sent_tx.js';
|
package/src/api/account.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
type AccountInterface,
|
|
4
|
-
type AuthWitnessProvider,
|
|
5
|
-
type Salt,
|
|
6
|
-
type Wallet,
|
|
7
|
-
getAccountContractAddress,
|
|
8
|
-
} from '../account/index.js';
|
|
1
|
+
export { type AccountContract, type AccountInterface, type Salt, getAccountContractAddress } from '../account/index.js';
|
|
2
|
+
export type { AuthWitnessProvider } from '@aztec/entrypoints/interfaces';
|
|
9
3
|
|
|
10
4
|
export { AccountManager, type DeployAccountOptions } from '../account_manager/index.js';
|