@aztec/aztec.js 0.73.0 → 0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2
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/README.md +1 -1
- package/dest/account/contract.js +5 -3
- package/dest/account/index.js +8 -2
- package/dest/account/interface.js +4 -3
- package/dest/account/wallet.js +3 -2
- package/dest/account_manager/deploy_account_method.js +22 -25
- package/dest/account_manager/deploy_account_sent_tx.js +16 -17
- package/dest/account_manager/index.js +67 -78
- package/dest/api/abi.js +0 -1
- package/dest/api/account.js +0 -1
- package/dest/api/addresses.js +0 -1
- package/dest/api/cheat_codes.js +25 -0
- package/dest/api/deployment.js +0 -1
- package/dest/api/entrypoint.js +0 -1
- package/dest/api/eth_address.js +0 -1
- package/dest/api/ethereum/anvil_test_watcher.js +113 -0
- package/dest/api/ethereum/chain_monitor.js +69 -0
- package/dest/api/ethereum/cheat_codes.js +142 -0
- package/dest/api/ethereum/index.js +6 -0
- package/dest/api/ethereum/l1_contracts.js +13 -0
- package/dest/api/ethereum/portal_manager.js +284 -0
- package/dest/api/fee.js +0 -1
- package/dest/api/fields.js +0 -1
- package/dest/api/interfaces/pxe.js +1 -2
- package/dest/api/log.js +1 -0
- package/dest/api/log_id.js +0 -1
- package/dest/api/tx_hash.js +0 -1
- package/dest/api/wallet.js +1 -2
- package/dest/contract/base_contract_interaction.js +75 -52
- package/dest/contract/batch_call.js +57 -39
- package/dest/contract/checker.js +29 -20
- package/dest/contract/contract.js +22 -27
- package/dest/contract/contract_base.js +21 -30
- package/dest/contract/contract_function_interaction.js +48 -48
- package/dest/contract/deploy_method.js +99 -84
- package/dest/contract/deploy_proven_tx.js +8 -11
- package/dest/contract/deploy_sent_tx.js +19 -22
- package/dest/contract/get_gas_limits.js +2 -4
- package/dest/contract/index.js +4 -6
- package/dest/contract/proven_tx.js +7 -10
- package/dest/contract/sent_tx.js +32 -34
- package/dest/contract/unsafe_contract.js +2 -10
- package/dest/deployment/broadcast_function.js +28 -26
- package/dest/deployment/contract_deployer.js +15 -14
- package/dest/deployment/deploy_instance.js +1 -3
- package/dest/deployment/index.js +0 -1
- package/dest/deployment/protocol_contracts.js +2 -5
- package/dest/deployment/register_class.js +8 -8
- package/dest/entrypoint/default_entrypoint.js +8 -5
- package/dest/entrypoint/default_multi_call_entrypoint.js +66 -23
- package/dest/entrypoint/entrypoint.js +0 -1
- package/dest/entrypoint/payload.js +73 -82
- package/dest/fee/fee_juice_payment_method.js +3 -4
- package/dest/fee/fee_juice_payment_method_with_claim.js +11 -14
- package/dest/fee/fee_payment_method.js +3 -2
- package/dest/fee/no_fee_payment_method.js +2 -4
- package/dest/fee/private_fee_payment_method.js +36 -34
- package/dest/fee/public_fee_payment_method.js +34 -31
- package/dest/index.js +8 -9
- package/dest/rpc_clients/index.js +0 -1
- package/dest/rpc_clients/node/index.js +30 -16
- package/dest/rpc_clients/pxe_client.js +5 -3
- package/dest/utils/abi_types.js +1 -2
- package/dest/utils/authwit.js +15 -15
- package/dest/utils/aztec_cheatcodes.js +62 -0
- package/dest/utils/field_compressed_string.js +2 -4
- package/dest/utils/index.js +5 -12
- package/dest/utils/node.js +4 -5
- package/dest/utils/pub_key.js +1 -3
- package/dest/utils/pxe.js +3 -5
- package/dest/wallet/account_wallet.js +118 -81
- package/dest/wallet/account_wallet_with_private_key.js +9 -15
- package/dest/wallet/base_wallet.js +7 -5
- package/dest/wallet/index.js +2 -4
- package/dest/wallet/signerless_wallet.js +4 -6
- package/package.json +14 -17
- package/src/api/account.ts +7 -1
- package/src/api/cheat_codes.ts +35 -0
- package/src/{utils → api/ethereum}/anvil_test_watcher.ts +2 -1
- package/src/{utils → api/ethereum}/cheat_codes.ts +6 -109
- package/src/api/ethereum/index.ts +15 -0
- package/src/{utils → api/ethereum}/l1_contracts.ts +1 -1
- package/src/{utils → api/ethereum}/portal_manager.ts +4 -9
- package/src/api/interfaces/pxe.ts +1 -1
- package/src/api/log.ts +1 -0
- package/src/api/wallet.ts +1 -1
- package/src/contract/contract_function_interaction.ts +1 -1
- package/src/contract/index.ts +2 -2
- package/src/entrypoint/default_multi_call_entrypoint.ts +2 -1
- package/src/entrypoint/entrypoint.ts +1 -1
- package/src/fee/fee_juice_payment_method_with_claim.ts +1 -1
- package/src/index.ts +7 -35
- package/src/utils/aztec_cheatcodes.ts +75 -0
- package/src/utils/index.ts +19 -11
- package/src/utils/node.ts +2 -0
- package/src/wallet/index.ts +1 -1
- package/dest/account/contract.d.ts +0 -33
- package/dest/account/contract.d.ts.map +0 -1
- package/dest/account/index.d.ts +0 -15
- package/dest/account/index.d.ts.map +0 -1
- package/dest/account/interface.d.ts +0 -30
- package/dest/account/interface.d.ts.map +0 -1
- package/dest/account/wallet.d.ts +0 -10
- package/dest/account/wallet.d.ts.map +0 -1
- package/dest/account_manager/deploy_account_method.d.ts +0 -15
- package/dest/account_manager/deploy_account_method.d.ts.map +0 -1
- package/dest/account_manager/deploy_account_sent_tx.d.ts +0 -29
- package/dest/account_manager/deploy_account_sent_tx.d.ts.map +0 -1
- package/dest/account_manager/index.d.ts +0 -99
- package/dest/account_manager/index.d.ts.map +0 -1
- package/dest/api/abi.d.ts +0 -4
- package/dest/api/abi.d.ts.map +0 -1
- package/dest/api/account.d.ts +0 -4
- package/dest/api/account.d.ts.map +0 -1
- package/dest/api/addresses.d.ts +0 -3
- package/dest/api/addresses.d.ts.map +0 -1
- package/dest/api/deployment.d.ts +0 -4
- package/dest/api/deployment.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/eth_address.d.ts +0 -2
- package/dest/api/eth_address.d.ts.map +0 -1
- package/dest/api/ethereum.d.ts +0 -3
- package/dest/api/ethereum.d.ts.map +0 -1
- package/dest/api/ethereum.js +0 -3
- package/dest/api/fee.d.ts +0 -7
- package/dest/api/fee.d.ts.map +0 -1
- package/dest/api/fields.d.ts +0 -2
- package/dest/api/fields.d.ts.map +0 -1
- package/dest/api/interfaces/pxe.d.ts +0 -2
- package/dest/api/interfaces/pxe.d.ts.map +0 -1
- package/dest/api/log_id.d.ts +0 -2
- package/dest/api/log_id.d.ts.map +0 -1
- package/dest/api/tx_hash.d.ts +0 -2
- package/dest/api/tx_hash.d.ts.map +0 -1
- package/dest/api/wallet.d.ts +0 -2
- package/dest/api/wallet.d.ts.map +0 -1
- package/dest/barretenberg-threads.wasm.gz +0 -0
- package/dest/barretenberg.wasm.gz +0 -0
- package/dest/contract/base_contract_interaction.d.ts +0 -82
- package/dest/contract/base_contract_interaction.d.ts.map +0 -1
- package/dest/contract/batch_call.d.ts +0 -27
- package/dest/contract/batch_call.d.ts.map +0 -1
- package/dest/contract/checker.d.ts +0 -11
- package/dest/contract/checker.d.ts.map +0 -1
- package/dest/contract/contract.d.ts +0 -41
- package/dest/contract/contract.d.ts.map +0 -1
- package/dest/contract/contract_base.d.ts +0 -61
- package/dest/contract/contract_base.d.ts.map +0 -1
- package/dest/contract/contract_function_interaction.d.ts +0 -67
- package/dest/contract/contract_function_interaction.d.ts.map +0 -1
- package/dest/contract/deploy_method.d.ts +0 -110
- package/dest/contract/deploy_method.d.ts.map +0 -1
- package/dest/contract/deploy_proven_tx.d.ts +0 -19
- package/dest/contract/deploy_proven_tx.d.ts.map +0 -1
- package/dest/contract/deploy_sent_tx.d.ts +0 -43
- package/dest/contract/deploy_sent_tx.d.ts.map +0 -1
- package/dest/contract/get_gas_limits.d.ts +0 -18
- package/dest/contract/get_gas_limits.d.ts.map +0 -1
- package/dest/contract/index.d.ts +0 -45
- package/dest/contract/index.d.ts.map +0 -1
- package/dest/contract/proven_tx.d.ts +0 -16
- package/dest/contract/proven_tx.d.ts.map +0 -1
- package/dest/contract/sent_tx.d.ts +0 -60
- package/dest/contract/sent_tx.d.ts.map +0 -1
- package/dest/contract/unsafe_contract.d.ts +0 -15
- package/dest/contract/unsafe_contract.d.ts.map +0 -1
- package/dest/deployment/broadcast_function.d.ts +0 -24
- package/dest/deployment/broadcast_function.d.ts.map +0 -1
- package/dest/deployment/contract_deployer.d.ts +0 -27
- package/dest/deployment/contract_deployer.d.ts.map +0 -1
- package/dest/deployment/deploy_instance.d.ts +0 -10
- package/dest/deployment/deploy_instance.d.ts.map +0 -1
- package/dest/deployment/index.d.ts +0 -2
- package/dest/deployment/index.d.ts.map +0 -1
- package/dest/deployment/protocol_contracts.d.ts +0 -7
- package/dest/deployment/protocol_contracts.d.ts.map +0 -1
- package/dest/deployment/register_class.d.ts +0 -6
- package/dest/deployment/register_class.d.ts.map +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_multi_call_entrypoint.d.ts +0 -15
- package/dest/entrypoint/default_multi_call_entrypoint.d.ts.map +0 -1
- package/dest/entrypoint/entrypoint.d.ts +0 -31
- package/dest/entrypoint/entrypoint.d.ts.map +0 -1
- package/dest/entrypoint/payload.d.ts +0 -125
- package/dest/entrypoint/payload.d.ts.map +0 -1
- package/dest/fee/fee_juice_payment_method.d.ts +0 -14
- package/dest/fee/fee_juice_payment_method.d.ts.map +0 -1
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts +0 -17
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +0 -1
- package/dest/fee/fee_payment_method.d.ts +0 -22
- package/dest/fee/fee_payment_method.d.ts.map +0 -1
- package/dest/fee/no_fee_payment_method.d.ts +0 -13
- package/dest/fee/no_fee_payment_method.d.ts.map +0 -1
- package/dest/fee/private_fee_payment_method.d.ts +0 -51
- package/dest/fee/private_fee_payment_method.d.ts.map +0 -1
- package/dest/fee/public_fee_payment_method.d.ts +0 -41
- package/dest/fee/public_fee_payment_method.d.ts.map +0 -1
- package/dest/index.d.ts +0 -51
- package/dest/index.d.ts.map +0 -1
- package/dest/main.js +0 -2
- package/dest/main.js.LICENSE.txt +0 -25
- package/dest/rpc_clients/index.d.ts +0 -3
- package/dest/rpc_clients/index.d.ts.map +0 -1
- package/dest/rpc_clients/node/index.d.ts +0 -11
- package/dest/rpc_clients/node/index.d.ts.map +0 -1
- package/dest/rpc_clients/pxe_client.d.ts +0 -9
- package/dest/rpc_clients/pxe_client.d.ts.map +0 -1
- package/dest/utils/abi_types.d.ts +0 -26
- package/dest/utils/abi_types.d.ts.map +0 -1
- package/dest/utils/anvil_test_watcher.d.ts +0 -28
- package/dest/utils/anvil_test_watcher.d.ts.map +0 -1
- package/dest/utils/anvil_test_watcher.js +0 -108
- package/dest/utils/authwit.d.ts +0 -59
- package/dest/utils/authwit.d.ts.map +0 -1
- package/dest/utils/chain_monitor.d.ts +0 -21
- package/dest/utils/chain_monitor.d.ts.map +0 -1
- package/dest/utils/chain_monitor.js +0 -58
- package/dest/utils/cheat_codes.d.ts +0 -137
- package/dest/utils/cheat_codes.d.ts.map +0 -1
- package/dest/utils/cheat_codes.js +0 -225
- package/dest/utils/field_compressed_string.d.ts +0 -17
- package/dest/utils/field_compressed_string.d.ts.map +0 -1
- package/dest/utils/index.d.ts +0 -12
- package/dest/utils/index.d.ts.map +0 -1
- package/dest/utils/l1_contracts.d.ts +0 -3
- package/dest/utils/l1_contracts.d.ts.map +0 -1
- package/dest/utils/l1_contracts.js +0 -15
- package/dest/utils/node.d.ts +0 -4
- package/dest/utils/node.d.ts.map +0 -1
- package/dest/utils/portal_manager.d.ts +0 -130
- package/dest/utils/portal_manager.d.ts.map +0 -1
- package/dest/utils/portal_manager.js +0 -265
- package/dest/utils/pub_key.d.ts +0 -8
- package/dest/utils/pub_key.d.ts.map +0 -1
- package/dest/utils/pxe.d.ts +0 -4
- package/dest/utils/pxe.d.ts.map +0 -1
- package/dest/wallet/account_wallet.d.ts +0 -73
- package/dest/wallet/account_wallet.d.ts.map +0 -1
- package/dest/wallet/account_wallet_with_private_key.d.ts +0 -26
- package/dest/wallet/account_wallet_with_private_key.d.ts.map +0 -1
- package/dest/wallet/base_wallet.d.ts +0 -64
- package/dest/wallet/base_wallet.d.ts.map +0 -1
- package/dest/wallet/index.d.ts +0 -17
- package/dest/wallet/index.d.ts.map +0 -1
- package/dest/wallet/signerless_wallet.d.ts +0 -22
- package/dest/wallet/signerless_wallet.d.ts.map +0 -1
- package/src/api/ethereum.ts +0 -2
- /package/src/{utils → api/ethereum}/chain_monitor.ts +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type Note, type PXE } from '@aztec/circuit-types';
|
|
2
|
+
import { type AztecAddress, Fr } from '@aztec/circuits.js';
|
|
3
|
+
import { deriveStorageSlotInMap } from '@aztec/circuits.js/hash';
|
|
4
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A class that provides utility functions for interacting with the aztec chain.
|
|
8
|
+
*/
|
|
9
|
+
export class AztecCheatCodes {
|
|
10
|
+
constructor(
|
|
11
|
+
/**
|
|
12
|
+
* The PXE Service to use for interacting with the chain
|
|
13
|
+
*/
|
|
14
|
+
public pxe: PXE,
|
|
15
|
+
/**
|
|
16
|
+
* The logger to use for the aztec cheatcodes
|
|
17
|
+
*/
|
|
18
|
+
public logger = createLogger('aztecjs:cheat_codes'),
|
|
19
|
+
) {}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Computes the slot value for a given map and key.
|
|
23
|
+
* @param mapSlot - The slot of the map (specified in Aztec.nr contract)
|
|
24
|
+
* @param key - The key to lookup in the map
|
|
25
|
+
* @returns The storage slot of the value in the map
|
|
26
|
+
*/
|
|
27
|
+
public computeSlotInMap(mapSlot: Fr | bigint, key: Fr | bigint | AztecAddress): Promise<Fr> {
|
|
28
|
+
const keyFr = typeof key === 'bigint' ? new Fr(key) : key.toField();
|
|
29
|
+
return deriveStorageSlotInMap(mapSlot, keyFr);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Get the current blocknumber
|
|
34
|
+
* @returns The current block number
|
|
35
|
+
*/
|
|
36
|
+
public async blockNumber(): Promise<number> {
|
|
37
|
+
return await this.pxe.getBlockNumber();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Get the current timestamp
|
|
42
|
+
* @returns The current timestamp
|
|
43
|
+
*/
|
|
44
|
+
public async timestamp(): Promise<number> {
|
|
45
|
+
const res = await this.pxe.getBlock(await this.blockNumber());
|
|
46
|
+
return res?.header.globalVariables.timestamp.toNumber() ?? 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Loads the value stored at the given slot in the public storage of the given contract.
|
|
51
|
+
* @param who - The address of the contract
|
|
52
|
+
* @param slot - The storage slot to lookup
|
|
53
|
+
* @returns The value stored at the given slot
|
|
54
|
+
*/
|
|
55
|
+
public async loadPublic(who: AztecAddress, slot: Fr | bigint): Promise<Fr> {
|
|
56
|
+
const storageValue = await this.pxe.getPublicStorageAt(who, new Fr(slot));
|
|
57
|
+
return storageValue;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Loads the value stored at the given slot in the private storage of the given contract.
|
|
62
|
+
* @param contract - The address of the contract
|
|
63
|
+
* @param owner - The owner for whom the notes are encrypted
|
|
64
|
+
* @param slot - The storage slot to lookup
|
|
65
|
+
* @returns The notes stored at the given slot
|
|
66
|
+
*/
|
|
67
|
+
public async loadPrivate(owner: AztecAddress, contract: AztecAddress, slot: Fr | bigint): Promise<Note[]> {
|
|
68
|
+
const extendedNotes = await this.pxe.getNotes({
|
|
69
|
+
owner,
|
|
70
|
+
contractAddress: contract,
|
|
71
|
+
storageSlot: new Fr(slot),
|
|
72
|
+
});
|
|
73
|
+
return extendedNotes.map(extendedNote => extendedNote.note);
|
|
74
|
+
}
|
|
75
|
+
}
|
package/src/utils/index.ts
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export
|
|
1
|
+
export { generatePublicKey } from './pub_key.js';
|
|
2
|
+
export {
|
|
3
|
+
type AztecAddressLike,
|
|
4
|
+
type EthAddressLike,
|
|
5
|
+
type EventSelectorLike,
|
|
6
|
+
type FieldLike,
|
|
7
|
+
type FunctionSelectorLike,
|
|
8
|
+
type U128Like,
|
|
9
|
+
type WrappedFieldLike,
|
|
10
|
+
} from './abi_types.js';
|
|
11
|
+
export {
|
|
12
|
+
computeAuthWitMessageHash,
|
|
13
|
+
computeInnerAuthWitHash,
|
|
14
|
+
computeInnerAuthWitHashFromAction,
|
|
15
|
+
type IntentAction,
|
|
16
|
+
} from './authwit.js';
|
|
17
|
+
export { waitForPXE } from './pxe.js';
|
|
18
|
+
export { waitForNode, createAztecNodeClient, AztecNode } from './node.js';
|
|
19
|
+
export { readFieldCompressedString } from './field_compressed_string.js';
|
package/src/utils/node.ts
CHANGED
package/src/wallet/index.ts
CHANGED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { type CompleteAddress } from '@aztec/circuit-types';
|
|
2
|
-
import { type NodeInfo } from '@aztec/circuits.js';
|
|
3
|
-
import { type ContractArtifact } from '@aztec/foundation/abi';
|
|
4
|
-
import { type AccountInterface, type AuthWitnessProvider } from './interface.js';
|
|
5
|
-
/**
|
|
6
|
-
* An account contract instance. Knows its artifact, deployment arguments, how to create
|
|
7
|
-
* transaction execution requests out of function calls, and how to authorize actions.
|
|
8
|
-
*/
|
|
9
|
-
export interface AccountContract {
|
|
10
|
-
/**
|
|
11
|
-
* Returns the artifact of this account contract.
|
|
12
|
-
*/
|
|
13
|
-
getContractArtifact(): ContractArtifact;
|
|
14
|
-
/**
|
|
15
|
-
* Returns the deployment arguments for this instance, or undefined if this contract does not require deployment.
|
|
16
|
-
*/
|
|
17
|
-
getDeploymentArgs(): Promise<any[] | undefined>;
|
|
18
|
-
/**
|
|
19
|
-
* Returns the account interface for this account contract given a deployment at the provided address.
|
|
20
|
-
* The account interface is responsible for assembling tx requests given requested function calls, and
|
|
21
|
-
* for creating signed auth witnesses given action identifiers (message hashes).
|
|
22
|
-
* @param address - Address where this account contract is deployed.
|
|
23
|
-
* @param nodeInfo - Info on the chain where it is deployed.
|
|
24
|
-
* @returns An account interface instance for creating tx requests and authorizing actions.
|
|
25
|
-
*/
|
|
26
|
-
getInterface(address: CompleteAddress, nodeInfo: NodeInfo): AccountInterface;
|
|
27
|
-
/**
|
|
28
|
-
* Returns the auth witness provider for the given address.
|
|
29
|
-
* @param address - Address for which to create auth witnesses.
|
|
30
|
-
*/
|
|
31
|
-
getAuthWitnessProvider(address: CompleteAddress): AuthWitnessProvider;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/account/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAGjF;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,mBAAmB,IAAI,gBAAgB,CAAC;IAExC;;OAEG;IACH,iBAAiB,IAAI,OAAO,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,CAAC;IAEhD;;;;;;;OAOG;IACH,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,GAAG,gBAAgB,CAAC;IAE7E;;;OAGG;IACH,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,mBAAmB,CAAC;CACvE"}
|
package/dest/account/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `account` module provides utilities for managing accounts. The {@link AccountManager} class
|
|
3
|
-
* allows to deploy and register a fresh account, or to obtain a `Wallet` instance out of an account
|
|
4
|
-
* already deployed. Use the `@aztec/accounts` package to load default account implementations that rely
|
|
5
|
-
* on ECDSA or Schnorr signatures.
|
|
6
|
-
*
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
*/
|
|
9
|
-
import { type Fr } from '@aztec/circuits.js';
|
|
10
|
-
export { type AccountContract } from './contract.js';
|
|
11
|
-
export { type AccountInterface, type AuthWitnessProvider } from './interface.js';
|
|
12
|
-
export * from './wallet.js';
|
|
13
|
-
/** A contract deployment salt. */
|
|
14
|
-
export type Salt = Fr | number | bigint;
|
|
15
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/account/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACjF,cAAc,aAAa,CAAC;AAE5B,kCAAkC;AAClC,MAAM,MAAM,IAAI,GAAG,EAAE,GAAG,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
import { type AuthWitness, type CompleteAddress } from '@aztec/circuit-types';
|
|
4
|
-
import { type AztecAddress } from '@aztec/circuits.js';
|
|
5
|
-
import { type Fr } from '@aztec/foundation/fields';
|
|
6
|
-
import { type EntrypointInterface } from '../entrypoint/entrypoint.js';
|
|
7
|
-
/** Creates authorization witnesses. */
|
|
8
|
-
export interface AuthWitnessProvider {
|
|
9
|
-
/**
|
|
10
|
-
* Computes an authentication witness from either a message hash
|
|
11
|
-
* @param messageHash - The message hash to approve
|
|
12
|
-
* @returns The authentication witness
|
|
13
|
-
*/
|
|
14
|
-
createAuthWit(messageHash: Fr | Buffer): Promise<AuthWitness>;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Handler for interfacing with an account. Knows how to create transaction execution
|
|
18
|
-
* requests and authorize actions for its corresponding account.
|
|
19
|
-
*/
|
|
20
|
-
export interface AccountInterface extends EntrypointInterface, AuthWitnessProvider {
|
|
21
|
-
/** Returns the complete address for this account. */
|
|
22
|
-
getCompleteAddress(): CompleteAddress;
|
|
23
|
-
/** Returns the address for this account. */
|
|
24
|
-
getAddress(): AztecAddress;
|
|
25
|
-
/** Returns the chain id for this account */
|
|
26
|
-
getChainId(): Fr;
|
|
27
|
-
/** Returns the rollup version for this account */
|
|
28
|
-
getVersion(): Fr;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/account/interface.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGvE,uCAAuC;AACvC,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,aAAa,CAAC,WAAW,EAAE,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CAC/D;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB,EAAE,mBAAmB;IAChF,qDAAqD;IACrD,kBAAkB,IAAI,eAAe,CAAC;IAEtC,4CAA4C;IAC5C,UAAU,IAAI,YAAY,CAAC;IAE3B,4CAA4C;IAC5C,UAAU,IAAI,EAAE,CAAC;IAEjB,kDAAkD;IAClD,UAAU,IAAI,EAAE,CAAC;CAClB"}
|
package/dest/account/wallet.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type AuthWitness, type PXE } from '@aztec/circuit-types';
|
|
2
|
-
import { type IntentAction, type IntentInnerHash } from '../utils/authwit.js';
|
|
3
|
-
import { type AccountInterface } from './interface.js';
|
|
4
|
-
/**
|
|
5
|
-
* The wallet interface.
|
|
6
|
-
*/
|
|
7
|
-
export type Wallet = AccountInterface & PXE & {
|
|
8
|
-
createAuthWit(intent: IntentInnerHash | IntentAction): Promise<AuthWitness>;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=wallet.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/account/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,gBAAgB,GACnC,GAAG,GAAG;IACJ,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CAC7E,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type PublicKeys } from '@aztec/circuits.js';
|
|
2
|
-
import { type ContractArtifact, type FunctionArtifact } from '@aztec/foundation/abi';
|
|
3
|
-
import { type AuthWitnessProvider } from '../account/interface.js';
|
|
4
|
-
import { type Wallet } from '../account/wallet.js';
|
|
5
|
-
import { type ExecutionRequestInit } from '../api/entrypoint.js';
|
|
6
|
-
import { DeployMethod, type DeployOptions } from '../contract/deploy_method.js';
|
|
7
|
-
/**
|
|
8
|
-
* Contract interaction for deploying an account contract. Handles fee preparation and contract initialization.
|
|
9
|
-
*/
|
|
10
|
-
export declare class DeployAccountMethod extends DeployMethod {
|
|
11
|
-
#private;
|
|
12
|
-
constructor(authWitnessProvider: AuthWitnessProvider, publicKeys: PublicKeys, wallet: Wallet, artifact: ContractArtifact, args?: any[], constructorNameOrArtifact?: string | FunctionArtifact, feePaymentNameOrArtifact?: string | FunctionArtifact);
|
|
13
|
-
protected getInitializeFunctionCalls(options: DeployOptions): Promise<Pick<ExecutionRequestInit, 'calls' | 'authWitnesses' | 'hashedArguments'>>;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=deploy_account_method.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_account_method.d.ts","sourceRoot":"","sources":["../../src/account_manager/deploy_account_method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAItB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAGhF;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,YAAY;;gBAKjD,mBAAmB,EAAE,mBAAmB,EACxC,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,gBAAgB,EAC1B,IAAI,GAAE,GAAG,EAAO,EAChB,yBAAyB,CAAC,EAAE,MAAM,GAAG,gBAAgB,EACrD,wBAAwB,CAAC,EAAE,MAAM,GAAG,gBAAgB;cAkB7B,0BAA0B,CACjD,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,OAAO,GAAG,eAAe,GAAG,iBAAiB,CAAC,CAAC;CAmCtF"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { type PXE, type TxHash, type TxReceipt } from '@aztec/circuit-types';
|
|
2
|
-
import { type FieldsOf } from '@aztec/foundation/types';
|
|
3
|
-
import { type Wallet } from '../account/index.js';
|
|
4
|
-
import { SentTx, type WaitOpts } from '../contract/sent_tx.js';
|
|
5
|
-
/** Extends a transaction receipt with a wallet instance for the newly deployed contract. */
|
|
6
|
-
export type DeployAccountTxReceipt = FieldsOf<TxReceipt> & {
|
|
7
|
-
/** Wallet that corresponds to the newly deployed account contract. */
|
|
8
|
-
wallet: Wallet;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* A deployment transaction for an account contract sent to the network, extending SentTx with methods to get the resulting wallet.
|
|
12
|
-
*/
|
|
13
|
-
export declare class DeployAccountSentTx extends SentTx {
|
|
14
|
-
private getWalletPromise;
|
|
15
|
-
constructor(pxe: PXE, txHashPromise: Promise<TxHash>, getWalletPromise: Promise<Wallet>);
|
|
16
|
-
/**
|
|
17
|
-
* Awaits for the tx to be mined and returns the contract instance. Throws if tx is not mined.
|
|
18
|
-
* @param opts - Options for configuring the waiting for the tx to be mined.
|
|
19
|
-
* @returns The deployed contract instance.
|
|
20
|
-
*/
|
|
21
|
-
getWallet(opts?: WaitOpts): Promise<Wallet>;
|
|
22
|
-
/**
|
|
23
|
-
* Awaits for the tx to be mined and returns the receipt along with a wallet instance. Throws if tx is not mined.
|
|
24
|
-
* @param opts - Options for configuring the waiting for the tx to be mined.
|
|
25
|
-
* @returns The transaction receipt with the wallet for the deployed account contract.
|
|
26
|
-
*/
|
|
27
|
-
wait(opts?: WaitOpts): Promise<DeployAccountTxReceipt>;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=deploy_account_sent_tx.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_account_sent_tx.d.ts","sourceRoot":"","sources":["../../src/account_manager/deploy_account_sent_tx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAmB,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEhF,4FAA4F;AAC5F,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC,SAAS,CAAC,GAAG;IACzD,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,MAAM;IACS,OAAO,CAAC,gBAAgB;gBAAlE,GAAG,EAAE,GAAG,EAAE,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,EAAU,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC;IAI/F;;;;OAIG;IACU,SAAS,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAKxD;;;;OAIG;IACmB,IAAI,CAAC,IAAI,GAAE,QAA0B,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAK9F"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { CompleteAddress, type PXE } from '@aztec/circuit-types';
|
|
2
|
-
import { type ContractInstanceWithAddress } from '@aztec/circuits.js';
|
|
3
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
4
|
-
import { type AccountContract } from '../account/contract.js';
|
|
5
|
-
import { type Salt } from '../account/index.js';
|
|
6
|
-
import { type AccountInterface } from '../account/interface.js';
|
|
7
|
-
import { type DeployOptions } from '../contract/deploy_method.js';
|
|
8
|
-
import { type WaitOpts } from '../contract/sent_tx.js';
|
|
9
|
-
import { AccountWalletWithSecretKey } from '../wallet/index.js';
|
|
10
|
-
import { DeployAccountMethod } from './deploy_account_method.js';
|
|
11
|
-
import { DeployAccountSentTx } from './deploy_account_sent_tx.js';
|
|
12
|
-
/**
|
|
13
|
-
* Options to deploy an account contract.
|
|
14
|
-
*/
|
|
15
|
-
export type DeployAccountOptions = Pick<DeployOptions, 'fee' | 'skipClassRegistration' | 'skipPublicDeployment' | 'skipInitialization'>;
|
|
16
|
-
/**
|
|
17
|
-
* Manages a user account. Provides methods for calculating the account's address, deploying the account contract,
|
|
18
|
-
* and creating and registering the user wallet in the PXE Service.
|
|
19
|
-
*/
|
|
20
|
-
export declare class AccountManager {
|
|
21
|
-
private pxe;
|
|
22
|
-
private secretKey;
|
|
23
|
-
private accountContract;
|
|
24
|
-
private instance;
|
|
25
|
-
/**
|
|
26
|
-
* Deployment salt for the account contract
|
|
27
|
-
*/
|
|
28
|
-
readonly salt: Salt;
|
|
29
|
-
private constructor();
|
|
30
|
-
static create(pxe: PXE, secretKey: Fr, accountContract: AccountContract, salt?: Salt): Promise<AccountManager>;
|
|
31
|
-
protected getPublicKeys(): import("@aztec/circuits.js").PublicKeys;
|
|
32
|
-
protected getPublicKeysHash(): Fr | Promise<Fr>;
|
|
33
|
-
/**
|
|
34
|
-
* Returns the entrypoint for this account as defined by its account contract.
|
|
35
|
-
* @returns An entrypoint.
|
|
36
|
-
*/
|
|
37
|
-
getAccount(): Promise<AccountInterface>;
|
|
38
|
-
/**
|
|
39
|
-
* Gets the calculated complete address associated with this account.
|
|
40
|
-
* Does not require the account to be deployed or registered.
|
|
41
|
-
* @returns The address, partial address, and encryption public key.
|
|
42
|
-
*/
|
|
43
|
-
getCompleteAddress(): Promise<CompleteAddress>;
|
|
44
|
-
/**
|
|
45
|
-
* Gets the address for this given account.
|
|
46
|
-
* Does not require the account to be deployed or registered.
|
|
47
|
-
* @returns The address.
|
|
48
|
-
*/
|
|
49
|
-
getAddress(): import("@aztec/circuits.js").AztecAddress;
|
|
50
|
-
/**
|
|
51
|
-
* Returns the contract instance definition associated with this account.
|
|
52
|
-
* Does not require the account to be deployed or registered.
|
|
53
|
-
* @returns ContractInstance instance.
|
|
54
|
-
*/
|
|
55
|
-
getInstance(): ContractInstanceWithAddress;
|
|
56
|
-
/**
|
|
57
|
-
* Returns a Wallet instance associated with this account. Use it to create Contract
|
|
58
|
-
* instances to be interacted with from this account.
|
|
59
|
-
* @returns A Wallet instance.
|
|
60
|
-
*/
|
|
61
|
-
getWallet(): Promise<AccountWalletWithSecretKey>;
|
|
62
|
-
/**
|
|
63
|
-
* Registers this account in the PXE Service and returns the associated wallet. Registering
|
|
64
|
-
* the account on the PXE Service is required for managing private state associated with it.
|
|
65
|
-
* Use the returned wallet to create Contract instances to be interacted with from this account.
|
|
66
|
-
* @param opts - Options to wait for the account to be synched.
|
|
67
|
-
* @returns A Wallet instance.
|
|
68
|
-
*/
|
|
69
|
-
register(): Promise<AccountWalletWithSecretKey>;
|
|
70
|
-
/**
|
|
71
|
-
* Returns the pre-populated deployment method to deploy the account contract that backs this account.
|
|
72
|
-
* Typically you will not need this method and can call `deploy` directly. Use this for having finer
|
|
73
|
-
* grained control on when to create, simulate, and send the deployment tx.
|
|
74
|
-
* @returns A DeployMethod instance that deploys this account contract.
|
|
75
|
-
*/
|
|
76
|
-
getDeployMethod(): Promise<DeployAccountMethod>;
|
|
77
|
-
/**
|
|
78
|
-
* Deploys the account contract that backs this account.
|
|
79
|
-
* Does not register the associated class nor publicly deploy the instance by default.
|
|
80
|
-
* Uses the salt provided in the constructor or a randomly generated one.
|
|
81
|
-
* Registers the account in the PXE Service before deploying the contract.
|
|
82
|
-
* @param opts - Fee options to be used for the deployment.
|
|
83
|
-
* @returns A SentTx object that can be waited to get the associated Wallet.
|
|
84
|
-
*/
|
|
85
|
-
deploy(opts?: DeployAccountOptions): DeployAccountSentTx;
|
|
86
|
-
/**
|
|
87
|
-
* Deploys the account contract that backs this account if needed and awaits the tx to be mined.
|
|
88
|
-
* Uses the salt provided in the constructor or a randomly generated one. If no initialization
|
|
89
|
-
* is required it skips the transaction, and only registers the account in the PXE Service.
|
|
90
|
-
* @param opts - Options to wait for the tx to be mined.
|
|
91
|
-
* @returns A Wallet instance.
|
|
92
|
-
*/
|
|
93
|
-
waitSetup(opts?: WaitOpts): Promise<AccountWalletWithSecretKey>;
|
|
94
|
-
/**
|
|
95
|
-
* Returns whether this account contract has a constructor and needs deployment.
|
|
96
|
-
*/
|
|
97
|
-
isDeployable(): Promise<boolean>;
|
|
98
|
-
}
|
|
99
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/account_manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,GAAG,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,KAAK,2BAA2B,EAAmD,MAAM,oBAAoB,CAAC;AACvH,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAmB,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAExE,OAAO,EAAE,0BAA0B,EAAoB,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,aAAa,EACb,KAAK,GAAG,uBAAuB,GAAG,sBAAsB,GAAG,oBAAoB,CAChF,CAAC;AAEF;;;GAGG;AACH,qBAAa,cAAc;IAEvB,OAAO,CAAC,GAAG;IACX,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,QAAQ;IAChB;;OAEG;aACa,IAAI,EAAE,IAAI;IAR5B,OAAO;WAWM,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,eAAe,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,IAAI;IAa1F,SAAS,CAAC,aAAa;IAIvB,SAAS,CAAC,iBAAiB;IAI3B;;;OAGG;IACU,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAMpD;;;;OAIG;IACI,kBAAkB,IAAI,OAAO,CAAC,eAAe,CAAC;IAIrD;;;;OAIG;IACI,UAAU;IAIjB;;;;OAIG;IACI,WAAW,IAAI,2BAA2B;IAIjD;;;;OAIG;IACU,SAAS,IAAI,OAAO,CAAC,0BAA0B,CAAC;IAK7D;;;;;;OAMG;IACU,QAAQ,IAAI,OAAO,CAAC,0BAA0B,CAAC;IAW5D;;;;;OAKG;IACU,eAAe;IA6B5B;;;;;;;OAOG;IACI,MAAM,CAAC,IAAI,CAAC,EAAE,oBAAoB,GAAG,mBAAmB;IAgB/D;;;;;;OAMG;IACU,SAAS,CAAC,IAAI,GAAE,QAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAK7F;;OAEG;IACU,YAAY;CAG1B"}
|
package/dest/api/abi.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { type ContractArtifact, type FunctionArtifact, EventSelector, FunctionSelector } from '@aztec/foundation/abi';
|
|
2
|
-
export { loadContractArtifact, contractArtifactToBuffer, contractArtifactFromBuffer } from '@aztec/types/abi';
|
|
3
|
-
export { type NoirCompiledContract } from '@aztec/types/noir';
|
|
4
|
-
//# sourceMappingURL=abi.d.ts.map
|
package/dest/api/abi.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"abi.d.ts","sourceRoot":"","sources":["../../src/api/abi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACtH,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9G,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dest/api/account.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE3G,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dest/api/addresses.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../src/api/addresses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dest/api/deployment.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { registerContractClass } from '../deployment/register_class.js';
|
|
2
|
-
export { broadcastPrivateFunction, broadcastUnconstrainedFunction } from '../deployment/broadcast_function.js';
|
|
3
|
-
export { deployInstance } from '../deployment/deploy_instance.js';
|
|
4
|
-
//# sourceMappingURL=deployment.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deployment.d.ts","sourceRoot":"","sources":["../../src/api/deployment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAC/G,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC"}
|
package/dest/api/entrypoint.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entrypoint.d.ts","sourceRoot":"","sources":["../../src/api/entrypoint.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eth_address.d.ts","sourceRoot":"","sources":["../../src/api/eth_address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC"}
|
package/dest/api/ethereum.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ethereum.d.ts","sourceRoot":"","sources":["../../src/api/ethereum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7G,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC"}
|
package/dest/api/ethereum.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { deployL1Contract, deployL1Contracts } from '@aztec/ethereum/deploy-l1-contracts';
|
|
2
|
-
export { EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes';
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXRoZXJldW0uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYXBpL2V0aGVyZXVtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxpQkFBaUIsRUFBcUIsTUFBTSxxQ0FBcUMsQ0FBQztBQUM3RyxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sZ0NBQWdDLENBQUMifQ==
|
package/dest/api/fee.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export type { FeePaymentMethod } from '../fee/fee_payment_method.js';
|
|
2
|
-
export { FeeJuicePaymentMethod } from '../fee/fee_juice_payment_method.js';
|
|
3
|
-
export { PrivateFeePaymentMethod } from '../fee/private_fee_payment_method.js';
|
|
4
|
-
export { PublicFeePaymentMethod } from '../fee/public_fee_payment_method.js';
|
|
5
|
-
export { FeeJuicePaymentMethodWithClaim } from '../fee/fee_juice_payment_method_with_claim.js';
|
|
6
|
-
export { NoFeePaymentMethod } from '../fee/no_fee_payment_method.js';
|
|
7
|
-
//# sourceMappingURL=fee.d.ts.map
|
package/dest/api/fee.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fee.d.ts","sourceRoot":"","sources":["../../src/api/fee.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,8BAA8B,EAAE,MAAM,+CAA+C,CAAC;AAC/F,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC"}
|
package/dest/api/fields.d.ts
DELETED
package/dest/api/fields.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../src/api/fields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pxe.d.ts","sourceRoot":"","sources":["../../../src/api/interfaces/pxe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC"}
|
package/dest/api/log_id.d.ts
DELETED
package/dest/api/log_id.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log_id.d.ts","sourceRoot":"","sources":["../../src/api/log_id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dest/api/tx_hash.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tx_hash.d.ts","sourceRoot":"","sources":["../../src/api/tx_hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC"}
|
package/dest/api/wallet.d.ts
DELETED
package/dest/api/wallet.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/api/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,0BAA0B,IAAI,0BAA0B,EACxD,gBAAgB,EAChB,MAAM,EACN,SAAS,GACV,MAAM,oBAAoB,CAAC"}
|
|
Binary file
|
|
Binary file
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { type TxExecutionRequest, type TxProvingResult } from '@aztec/circuit-types';
|
|
2
|
-
import { type Fr, GasSettings } from '@aztec/circuits.js';
|
|
3
|
-
import { type Wallet } from '../account/wallet.js';
|
|
4
|
-
import { type ExecutionRequestInit } from '../entrypoint/entrypoint.js';
|
|
5
|
-
import { type FeeOptions, type UserFeeOptions } from '../entrypoint/payload.js';
|
|
6
|
-
import { ProvenTx } from './proven_tx.js';
|
|
7
|
-
import { SentTx } from './sent_tx.js';
|
|
8
|
-
/**
|
|
9
|
-
* Represents options for calling a (constrained) function in a contract.
|
|
10
|
-
* Allows the user to specify the sender address and nonce for a transaction.
|
|
11
|
-
*/
|
|
12
|
-
export type SendMethodOptions = {
|
|
13
|
-
/** Wether to skip the simulation of the public part of the transaction. */
|
|
14
|
-
skipPublicSimulation?: boolean;
|
|
15
|
-
/** The fee options for the transaction. */
|
|
16
|
-
fee?: UserFeeOptions;
|
|
17
|
-
/** Custom nonce to inject into the app payload of the transaction. Useful when trying to cancel an ongoing transaction by creating a new one with a higher fee */
|
|
18
|
-
nonce?: Fr;
|
|
19
|
-
/** Whether the transaction can be cancelled. If true, an extra nullifier will be emitted: H(nonce, GENERATOR_INDEX__TX_NULLIFIER) */
|
|
20
|
-
cancellable?: boolean;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Base class for an interaction with a contract, be it a deployment, a function call, or a batch.
|
|
24
|
-
* Implements the sequence create/simulate/send.
|
|
25
|
-
*/
|
|
26
|
-
export declare abstract class BaseContractInteraction {
|
|
27
|
-
protected wallet: Wallet;
|
|
28
|
-
protected log: import("@aztec/foundation/log").Logger;
|
|
29
|
-
constructor(wallet: Wallet);
|
|
30
|
-
/**
|
|
31
|
-
* Create a transaction execution request ready to be simulated.
|
|
32
|
-
* @param options - An optional object containing additional configuration for the transaction.
|
|
33
|
-
* @returns A transaction execution request.
|
|
34
|
-
*/
|
|
35
|
-
abstract create(options?: SendMethodOptions): Promise<TxExecutionRequest>;
|
|
36
|
-
/**
|
|
37
|
-
* Creates a transaction execution request, simulates and proves it. Differs from .prove in
|
|
38
|
-
* that its result does not include the wallet nor the composed tx object, but only the proving result.
|
|
39
|
-
* This object can then be used to either create a ProvenTx ready to be sent, or directly send the transaction.
|
|
40
|
-
* @param options - optional arguments to be used in the creation of the transaction
|
|
41
|
-
* @returns The proving result.
|
|
42
|
-
*/
|
|
43
|
-
protected proveInternal(options?: SendMethodOptions): Promise<TxProvingResult>;
|
|
44
|
-
/**
|
|
45
|
-
* Proves a transaction execution request and returns a tx object ready to be sent.
|
|
46
|
-
* @param options - optional arguments to be used in the creation of the transaction
|
|
47
|
-
* @returns The resulting transaction
|
|
48
|
-
*/
|
|
49
|
-
prove(options?: SendMethodOptions): Promise<ProvenTx>;
|
|
50
|
-
/**
|
|
51
|
-
* Sends a transaction to the contract function with the specified options.
|
|
52
|
-
* This function throws an error if called on an unconstrained function.
|
|
53
|
-
* It creates and signs the transaction if necessary, and returns a SentTx instance,
|
|
54
|
-
* which can be used to track the transaction status, receipt, and events.
|
|
55
|
-
* @param options - An optional object containing 'from' property representing
|
|
56
|
-
* the AztecAddress of the sender. If not provided, the default address is used.
|
|
57
|
-
* @returns A SentTx instance for tracking the transaction status and information.
|
|
58
|
-
*/
|
|
59
|
-
send(options?: SendMethodOptions): SentTx;
|
|
60
|
-
/**
|
|
61
|
-
* Estimates gas for a given tx request and returns gas limits for it.
|
|
62
|
-
* @param opts - Options.
|
|
63
|
-
* @param pad - Percentage to pad the suggested gas limits by, if empty, defaults to 10%.
|
|
64
|
-
* @returns Gas limits.
|
|
65
|
-
*/
|
|
66
|
-
estimateGas(opts?: Omit<SendMethodOptions, 'estimateGas' | 'skipPublicSimulation'>): Promise<Pick<GasSettings, 'gasLimits' | 'teardownGasLimits'>>;
|
|
67
|
-
/**
|
|
68
|
-
* Returns default fee options based on the user opts without running a simulation for gas estimation.
|
|
69
|
-
* @param fee - User-provided fee options.
|
|
70
|
-
*/
|
|
71
|
-
protected getDefaultFeeOptions(fee: UserFeeOptions | undefined): Promise<FeeOptions>;
|
|
72
|
-
/**
|
|
73
|
-
* Return fee options based on the user opts, estimating tx gas if needed.
|
|
74
|
-
* @param request - Request to execute for this interaction.
|
|
75
|
-
* @param pad - Percentage to pad the suggested gas limits by, as decimal (e.g., 0.10 for 10%).
|
|
76
|
-
* @returns Fee options for the actual transaction.
|
|
77
|
-
*/
|
|
78
|
-
protected getFeeOptions(request: Omit<ExecutionRequestInit, 'fee'> & {
|
|
79
|
-
fee?: UserFeeOptions;
|
|
80
|
-
}): Promise<FeeOptions>;
|
|
81
|
-
}
|
|
82
|
-
//# sourceMappingURL=base_contract_interaction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base_contract_interaction.d.ts","sourceRoot":"","sources":["../../src/contract/base_contract_interaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAG1D,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAGhF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,2EAA2E;IAC3E,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,2CAA2C;IAC3C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,kKAAkK;IAClK,KAAK,CAAC,EAAE,EAAE,CAAC;IACX,qIAAqI;IACrI,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,8BAAsB,uBAAuB;IAG/B,SAAS,CAAC,MAAM,EAAE,MAAM;IAFpC,SAAS,CAAC,GAAG,yCAAgD;gBAEvC,MAAM,EAAE,MAAM;IAEpC;;;;OAIG;aACa,MAAM,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAEhF;;;;;;OAMG;cACa,aAAa,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC;IAOxF;;;;OAIG;IACU,KAAK,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAOtE;;;;;;;;OAQG;IACI,IAAI,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM;IAUpD;;;;;OAKG;IACU,WAAW,CACtB,IAAI,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,aAAa,GAAG,sBAAsB,CAAC,GACrE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,mBAAmB,CAAC,CAAC;IAiBhE;;;OAGG;cACa,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC;IAU1F;;;;;OAKG;cACa,aAAa,CAC3B,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC,GAAG;QAAmC,GAAG,CAAC,EAAE,cAAc,CAAA;KAAE,GACrG,OAAO,CAAC,UAAU,CAAC;CA8BvB"}
|