@aztec/aztec.js 2.1.0-rc.9 → 3.0.0-devnet.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/account/account.d.ts +60 -0
- package/dest/account/account.d.ts.map +1 -0
- package/dest/account/account.js +59 -0
- package/dest/account/account_contract.d.ts +5 -5
- package/dest/account/account_contract.d.ts.map +1 -1
- package/dest/account/account_contract.js +0 -1
- package/dest/{wallet/account_wallet_with_private_key.d.ts → account/account_with_secret_key.d.ts} +7 -8
- package/dest/account/account_with_secret_key.d.ts.map +1 -0
- package/dest/{wallet/account_wallet_with_private_key.js → account/account_with_secret_key.js} +5 -5
- package/dest/account/index.d.ts +1 -4
- package/dest/account/index.d.ts.map +1 -1
- package/dest/account/index.js +1 -4
- package/dest/account/signerless_account.d.ts +24 -0
- package/dest/account/signerless_account.d.ts.map +1 -0
- package/dest/account/signerless_account.js +27 -0
- package/dest/api/abi.d.ts +1 -0
- package/dest/api/abi.d.ts.map +1 -1
- package/dest/api/account.d.ts +4 -2
- package/dest/api/account.d.ts.map +1 -1
- package/dest/api/account.js +3 -1
- package/dest/api/addresses.d.ts +1 -0
- package/dest/api/addresses.d.ts.map +1 -1
- package/dest/api/addresses.js +1 -0
- package/dest/api/authorization.d.ts +2 -0
- package/dest/api/authorization.d.ts.map +1 -1
- package/dest/api/authorization.js +2 -0
- package/dest/api/block.d.ts +3 -0
- package/dest/api/block.d.ts.map +1 -0
- package/dest/api/block.js +2 -0
- package/dest/api/contract.d.ts +4 -5
- package/dest/api/contract.d.ts.map +1 -1
- package/dest/api/contract.js +3 -3
- package/dest/api/crypto.d.ts +2 -0
- package/dest/api/crypto.d.ts.map +1 -0
- package/dest/api/crypto.js +1 -0
- package/dest/api/ethereum.d.ts +0 -1
- package/dest/api/ethereum.d.ts.map +1 -1
- package/dest/api/ethereum.js +0 -1
- package/dest/api/events.d.ts +12 -0
- package/dest/api/events.d.ts.map +1 -0
- package/dest/api/events.js +30 -0
- package/dest/api/fee.d.ts +1 -2
- package/dest/api/fee.d.ts.map +1 -1
- package/dest/api/fee.js +0 -1
- package/dest/api/keys.d.ts +4 -0
- package/dest/api/keys.d.ts.map +1 -0
- package/dest/api/keys.js +3 -0
- package/dest/api/log.d.ts +1 -0
- package/dest/api/log.d.ts.map +1 -1
- package/dest/api/log.js +1 -0
- package/dest/api/messaging.d.ts +3 -0
- package/dest/api/messaging.d.ts.map +1 -0
- package/dest/api/messaging.js +2 -0
- package/dest/api/node.d.ts +21 -0
- package/dest/api/node.d.ts.map +1 -0
- package/dest/api/node.js +18 -0
- package/dest/api/note.d.ts +2 -0
- package/dest/api/note.d.ts.map +1 -0
- package/dest/api/note.js +1 -0
- package/dest/api/protocol.d.ts +3 -0
- package/dest/api/protocol.d.ts.map +1 -0
- package/dest/api/protocol.js +2 -0
- package/dest/api/trees.d.ts +3 -0
- package/dest/api/trees.d.ts.map +1 -0
- package/dest/api/trees.js +2 -0
- package/dest/api/tx.d.ts +2 -0
- package/dest/api/tx.d.ts.map +1 -0
- package/dest/api/tx.js +1 -0
- package/dest/api/utils.d.ts +10 -7
- package/dest/api/utils.d.ts.map +1 -1
- package/dest/api/utils.js +10 -6
- package/dest/api/wallet.d.ts +4 -1
- package/dest/api/wallet.d.ts.map +1 -1
- package/dest/api/wallet.js +4 -1
- package/dest/contract/base_contract_interaction.d.ts +6 -48
- package/dest/contract/base_contract_interaction.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.js +6 -106
- package/dest/contract/batch_call.d.ts +6 -19
- package/dest/contract/batch_call.d.ts.map +1 -1
- package/dest/contract/batch_call.js +42 -58
- package/dest/contract/contract.d.ts +1 -1
- package/dest/contract/contract.d.ts.map +1 -1
- package/dest/contract/contract.js +2 -12
- package/dest/contract/contract_base.d.ts +1 -1
- package/dest/contract/contract_base.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.d.ts +29 -40
- package/dest/contract/contract_function_interaction.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.js +41 -53
- package/dest/contract/deploy_method.d.ts +63 -56
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +68 -86
- package/dest/contract/deploy_sent_tx.d.ts +0 -1
- package/dest/contract/deploy_sent_tx.d.ts.map +1 -1
- package/dest/contract/deploy_sent_tx.js +7 -10
- package/dest/contract/interaction_options.d.ts +74 -19
- package/dest/contract/interaction_options.d.ts.map +1 -1
- package/dest/contract/interaction_options.js +51 -3
- package/dest/contract/sent_tx.d.ts +3 -3
- package/dest/contract/sent_tx.d.ts.map +1 -1
- package/dest/contract/sent_tx.js +5 -5
- package/dest/contract/wait_for_proven.d.ts +3 -3
- package/dest/contract/wait_for_proven.d.ts.map +1 -1
- package/dest/contract/wait_for_proven.js +2 -2
- package/dest/deployment/publish_instance.d.ts +1 -1
- package/dest/deployment/publish_instance.d.ts.map +1 -1
- package/dest/deployment/publish_instance.js +2 -5
- package/dest/ethereum/portal_manager.d.ts +3 -4
- package/dest/ethereum/portal_manager.d.ts.map +1 -1
- package/dest/ethereum/portal_manager.js +3 -5
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts +12 -7
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
- package/dest/fee/fee_juice_payment_method_with_claim.js +21 -12
- package/dest/fee/fee_payment_method.d.ts +26 -0
- package/dest/fee/fee_payment_method.d.ts.map +1 -0
- package/dest/fee/fee_payment_method.js +3 -0
- package/dest/fee/private_fee_payment_method.d.ts +22 -5
- package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/private_fee_payment_method.js +34 -13
- package/dest/fee/public_fee_payment_method.d.ts +22 -5
- package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/public_fee_payment_method.js +37 -14
- package/dest/fee/sponsored_fee_payment.d.ts +2 -0
- package/dest/fee/sponsored_fee_payment.d.ts.map +1 -1
- package/dest/fee/sponsored_fee_payment.js +4 -0
- package/dest/utils/authwit.d.ts +77 -25
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/authwit.js +219 -24
- package/dest/utils/cross_chain.d.ts +5 -5
- package/dest/utils/cross_chain.d.ts.map +1 -1
- package/dest/utils/cross_chain.js +8 -8
- package/dest/utils/fee_juice.d.ts +3 -2
- package/dest/utils/fee_juice.d.ts.map +1 -1
- package/dest/utils/fee_juice.js +3 -2
- package/dest/{fee → wallet}/account_entrypoint_meta_payment_method.d.ts +13 -10
- package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -0
- package/dest/wallet/account_entrypoint_meta_payment_method.js +76 -0
- package/dest/wallet/account_manager.d.ts +69 -0
- package/dest/wallet/account_manager.d.ts.map +1 -0
- package/dest/wallet/account_manager.js +113 -0
- package/dest/wallet/base_wallet.d.ts +78 -35
- package/dest/wallet/base_wallet.d.ts.map +1 -1
- package/dest/wallet/base_wallet.js +216 -48
- package/dest/wallet/deploy_account_method.d.ts +52 -0
- package/dest/wallet/deploy_account_method.d.ts.map +1 -0
- package/dest/wallet/deploy_account_method.js +77 -0
- package/dest/wallet/index.d.ts +2 -15
- package/dest/wallet/index.d.ts.map +1 -1
- package/dest/wallet/index.js +2 -19
- package/dest/wallet/wallet.d.ts +2473 -6
- package/dest/wallet/wallet.d.ts.map +1 -1
- package/dest/wallet/wallet.js +202 -3
- package/package.json +23 -19
- package/src/account/account.ts +97 -0
- package/src/account/account_contract.ts +4 -6
- package/src/{wallet/account_wallet_with_private_key.ts → account/account_with_secret_key.ts} +6 -8
- package/src/account/index.ts +1 -4
- package/src/account/signerless_account.ts +46 -0
- package/src/api/abi.ts +11 -0
- package/src/api/account.ts +4 -2
- package/src/api/addresses.ts +1 -0
- package/src/api/authorization.ts +11 -0
- package/src/api/block.ts +2 -0
- package/src/api/contract.ts +16 -8
- package/src/api/crypto.ts +1 -0
- package/src/api/ethereum.ts +0 -1
- package/src/api/events.ts +44 -0
- package/src/api/fee.ts +1 -2
- package/src/api/keys.ts +8 -0
- package/src/api/log.ts +1 -0
- package/src/api/messaging.ts +2 -0
- package/src/api/node.ts +20 -0
- package/src/api/note.ts +1 -0
- package/src/api/protocol.ts +2 -0
- package/src/api/trees.ts +2 -0
- package/src/api/tx.ts +11 -0
- package/src/api/utils.ts +12 -20
- package/src/api/wallet.ts +33 -5
- package/src/contract/base_contract_interaction.ts +9 -138
- package/src/contract/batch_call.ts +52 -69
- package/src/contract/contract.ts +2 -12
- package/src/contract/contract_function_interaction.ts +65 -97
- package/src/contract/deploy_method.ts +117 -99
- package/src/contract/deploy_sent_tx.ts +4 -10
- package/src/contract/interaction_options.ts +126 -24
- package/src/contract/sent_tx.ts +4 -4
- package/src/contract/wait_for_proven.ts +4 -4
- package/src/deployment/publish_instance.ts +3 -8
- package/src/ethereum/portal_manager.ts +4 -12
- package/src/fee/fee_juice_payment_method_with_claim.ts +26 -17
- package/src/fee/fee_payment_method.ts +26 -0
- package/src/fee/private_fee_payment_method.ts +60 -41
- package/src/fee/public_fee_payment_method.ts +73 -49
- package/src/fee/sponsored_fee_payment.ts +6 -0
- package/src/utils/authwit.ts +250 -38
- package/src/utils/cross_chain.ts +9 -10
- package/src/utils/fee_juice.ts +4 -3
- package/src/wallet/account_entrypoint_meta_payment_method.ts +105 -0
- package/src/wallet/account_manager.ts +154 -0
- package/src/wallet/base_wallet.ts +287 -78
- package/src/wallet/deploy_account_method.ts +125 -0
- package/src/wallet/index.ts +2 -32
- package/src/wallet/wallet.ts +357 -29
- package/dest/account_manager/account_manager.d.ts +0 -119
- package/dest/account_manager/account_manager.d.ts.map +0 -1
- package/dest/account_manager/account_manager.js +0 -202
- package/dest/account_manager/deploy_account_sent_tx.d.ts +0 -30
- package/dest/account_manager/deploy_account_sent_tx.d.ts.map +0 -1
- package/dest/account_manager/deploy_account_sent_tx.js +0 -29
- package/dest/account_manager/index.d.ts +0 -3
- package/dest/account_manager/index.d.ts.map +0 -1
- package/dest/account_manager/index.js +0 -2
- package/dest/api/interfaces.d.ts +0 -2
- package/dest/api/interfaces.d.ts.map +0 -1
- package/dest/api/interfaces.js +0 -1
- package/dest/api/log_id.d.ts +0 -2
- package/dest/api/log_id.d.ts.map +0 -1
- package/dest/api/log_id.js +0 -1
- package/dest/api/rpc.d.ts +0 -3
- package/dest/api/rpc.d.ts.map +0 -1
- package/dest/api/rpc.js +0 -2
- package/dest/api/tx_hash.d.ts +0 -2
- package/dest/api/tx_hash.d.ts.map +0 -1
- package/dest/api/tx_hash.js +0 -1
- package/dest/contract/deploy_proven_tx.d.ts +0 -21
- package/dest/contract/deploy_proven_tx.d.ts.map +0 -1
- package/dest/contract/deploy_proven_tx.js +0 -21
- package/dest/contract/proven_tx.d.ts +0 -21
- package/dest/contract/proven_tx.d.ts.map +0 -1
- package/dest/contract/proven_tx.js +0 -23
- package/dest/ethereum/l1_contracts.d.ts +0 -3
- package/dest/ethereum/l1_contracts.d.ts.map +0 -1
- package/dest/ethereum/l1_contracts.js +0 -13
- package/dest/fee/account_entrypoint_meta_payment_method.d.ts.map +0 -1
- package/dest/fee/account_entrypoint_meta_payment_method.js +0 -64
- 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.js +0 -21
- package/dest/fee/utils.d.ts +0 -13
- package/dest/fee/utils.d.ts.map +0 -1
- package/dest/fee/utils.js +0 -32
- package/dest/index.d.ts +0 -59
- package/dest/index.d.ts.map +0 -1
- package/dest/index.js +0 -62
- package/dest/rpc_clients/node/index.d.ts +0 -12
- package/dest/rpc_clients/node/index.d.ts.map +0 -1
- package/dest/rpc_clients/node/index.js +0 -72
- package/dest/rpc_clients/pxe_client.d.ts +0 -10
- package/dest/rpc_clients/pxe_client.d.ts.map +0 -1
- package/dest/rpc_clients/pxe_client.js +0 -23
- package/dest/utils/pxe.d.ts +0 -4
- package/dest/utils/pxe.d.ts.map +0 -1
- package/dest/utils/pxe.js +0 -14
- package/dest/wallet/account_wallet.d.ts +0 -74
- package/dest/wallet/account_wallet.d.ts.map +0 -1
- package/dest/wallet/account_wallet.js +0 -232
- package/dest/wallet/account_wallet_with_private_key.d.ts.map +0 -1
- package/dest/wallet/signerless_wallet.d.ts +0 -23
- package/dest/wallet/signerless_wallet.d.ts.map +0 -1
- package/dest/wallet/signerless_wallet.js +0 -33
- package/src/account_manager/account_manager.ts +0 -276
- package/src/account_manager/deploy_account_sent_tx.ts +0 -46
- package/src/account_manager/index.ts +0 -2
- package/src/api/interfaces.ts +0 -1
- package/src/api/log_id.ts +0 -1
- package/src/api/rpc.ts +0 -2
- package/src/api/tx_hash.ts +0 -1
- package/src/contract/deploy_proven_tx.ts +0 -45
- package/src/contract/proven_tx.ts +0 -36
- package/src/ethereum/l1_contracts.ts +0 -21
- package/src/fee/account_entrypoint_meta_payment_method.ts +0 -89
- package/src/fee/fee_juice_payment_method.ts +0 -25
- package/src/fee/utils.ts +0 -39
- package/src/index.ts +0 -85
- package/src/rpc_clients/node/index.ts +0 -77
- package/src/rpc_clients/pxe_client.ts +0 -25
- package/src/utils/pxe.ts +0 -17
- package/src/wallet/account_wallet.ts +0 -246
- package/src/wallet/signerless_wallet.ts +0 -56
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
|
|
2
|
+
import type { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
3
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
4
|
+
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
5
|
+
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
6
|
+
import type { TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
7
|
+
import { type CallIntent, type IntentInnerHash } from '../utils/authwit.js';
|
|
8
|
+
import type { AccountInterface } from './interface.js';
|
|
9
|
+
/**
|
|
10
|
+
* An authwit provider that can create both private and public authwits
|
|
11
|
+
* with an intent as input, as opposed to just a precomputed inner hash
|
|
12
|
+
*/
|
|
13
|
+
interface AuthwitnessIntentProvider {
|
|
14
|
+
/**
|
|
15
|
+
* Creates a private authwit from an intent or inner hash, to be provided
|
|
16
|
+
* during function execution
|
|
17
|
+
* @param intent - The action (or inner hash) to authorize
|
|
18
|
+
*/
|
|
19
|
+
createAuthWit(intent: IntentInnerHash | CallIntent | Buffer | Fr): Promise<AuthWitness>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A type defining an account, capable of both creating authwits and using them
|
|
23
|
+
* to authenticate transaction execution requests.
|
|
24
|
+
*/
|
|
25
|
+
export type Account = AccountInterface & AuthwitnessIntentProvider;
|
|
26
|
+
/**
|
|
27
|
+
* An account implementation that uses authwits as an authentication mechanism
|
|
28
|
+
* and can assemble transaction execution requests for an entrypoint.
|
|
29
|
+
*/
|
|
30
|
+
export declare class BaseAccount implements Account {
|
|
31
|
+
protected account: AccountInterface;
|
|
32
|
+
constructor(account: AccountInterface);
|
|
33
|
+
createTxExecutionRequest(exec: ExecutionPayload, gasSettings: GasSettings, options: DefaultAccountEntrypointOptions): Promise<TxExecutionRequest>;
|
|
34
|
+
getChainId(): Fr;
|
|
35
|
+
getVersion(): Fr;
|
|
36
|
+
/** Returns the complete address of the account that implements this wallet. */
|
|
37
|
+
getCompleteAddress(): import("../api/addresses.js").CompleteAddress;
|
|
38
|
+
/** Returns the address of the account that implements this wallet. */
|
|
39
|
+
getAddress(): import("../api/addresses.js").AztecAddress;
|
|
40
|
+
/**
|
|
41
|
+
* Computes an authentication witness from either a message hash or an intent.
|
|
42
|
+
*
|
|
43
|
+
* If a message hash is provided, it will create a witness for the hash directly.
|
|
44
|
+
* Otherwise, it will compute the message hash using the intent, along with the
|
|
45
|
+
* chain id and the version values provided by the wallet.
|
|
46
|
+
*
|
|
47
|
+
* @param messageHashOrIntent - The message hash of the intent to approve
|
|
48
|
+
* @returns The authentication witness
|
|
49
|
+
*/
|
|
50
|
+
createAuthWit(messageHashOrIntent: Fr | Buffer | CallIntent | IntentInnerHash): Promise<AuthWitness>;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the message hash for the given intent
|
|
53
|
+
*
|
|
54
|
+
* @param intent - A tuple of (consumer and inner hash) or (caller and action)
|
|
55
|
+
* @returns The message hash
|
|
56
|
+
*/
|
|
57
|
+
private getMessageHash;
|
|
58
|
+
}
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/account/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAA6B,MAAM,qBAAqB,CAAC;AACvG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;GAGG;AACH,UAAU,yBAAyB;IACjC;;;;OAIG;IACH,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,UAAU,GAAG,MAAM,GAAG,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CACzF;AAED;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,gBAAgB,GAAG,yBAAyB,CAAC;AAEnE;;;GAGG;AACH,qBAAa,WAAY,YAAW,OAAO;IAC7B,SAAS,CAAC,OAAO,EAAE,gBAAgB;gBAAzB,OAAO,EAAE,gBAAgB;IAE/C,wBAAwB,CACtB,IAAI,EAAE,gBAAgB,EACtB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,kBAAkB,CAAC;IAI9B,UAAU,IAAI,EAAE;IAIhB,UAAU,IAAI,EAAE;IAIhB,+EAA+E;IACxE,kBAAkB;IAIzB,sEAAsE;IAC/D,UAAU;IAIjB;;;;;;;;;OASG;IACG,aAAa,CAAC,mBAAmB,EAAE,EAAE,GAAG,MAAM,GAAG,UAAU,GAAG,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IAa1G;;;;;OAKG;IACH,OAAO,CAAC,cAAc;CAKvB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import { computeAuthWitMessageHash } from '../utils/authwit.js';
|
|
3
|
+
/**
|
|
4
|
+
* An account implementation that uses authwits as an authentication mechanism
|
|
5
|
+
* and can assemble transaction execution requests for an entrypoint.
|
|
6
|
+
*/ export class BaseAccount {
|
|
7
|
+
account;
|
|
8
|
+
constructor(account){
|
|
9
|
+
this.account = account;
|
|
10
|
+
}
|
|
11
|
+
createTxExecutionRequest(exec, gasSettings, options) {
|
|
12
|
+
return this.account.createTxExecutionRequest(exec, gasSettings, options);
|
|
13
|
+
}
|
|
14
|
+
getChainId() {
|
|
15
|
+
return this.account.getChainId();
|
|
16
|
+
}
|
|
17
|
+
getVersion() {
|
|
18
|
+
return this.account.getVersion();
|
|
19
|
+
}
|
|
20
|
+
/** Returns the complete address of the account that implements this wallet. */ getCompleteAddress() {
|
|
21
|
+
return this.account.getCompleteAddress();
|
|
22
|
+
}
|
|
23
|
+
/** Returns the address of the account that implements this wallet. */ getAddress() {
|
|
24
|
+
return this.getCompleteAddress().address;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Computes an authentication witness from either a message hash or an intent.
|
|
28
|
+
*
|
|
29
|
+
* If a message hash is provided, it will create a witness for the hash directly.
|
|
30
|
+
* Otherwise, it will compute the message hash using the intent, along with the
|
|
31
|
+
* chain id and the version values provided by the wallet.
|
|
32
|
+
*
|
|
33
|
+
* @param messageHashOrIntent - The message hash of the intent to approve
|
|
34
|
+
* @returns The authentication witness
|
|
35
|
+
*/ async createAuthWit(messageHashOrIntent) {
|
|
36
|
+
let messageHash;
|
|
37
|
+
if (Buffer.isBuffer(messageHashOrIntent)) {
|
|
38
|
+
messageHash = Fr.fromBuffer(messageHashOrIntent);
|
|
39
|
+
} else if (messageHashOrIntent instanceof Fr) {
|
|
40
|
+
messageHash = messageHashOrIntent;
|
|
41
|
+
} else {
|
|
42
|
+
messageHash = await this.getMessageHash(messageHashOrIntent);
|
|
43
|
+
}
|
|
44
|
+
return this.account.createAuthWit(messageHash);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Returns the message hash for the given intent
|
|
48
|
+
*
|
|
49
|
+
* @param intent - A tuple of (consumer and inner hash) or (caller and action)
|
|
50
|
+
* @returns The message hash
|
|
51
|
+
*/ getMessageHash(intent) {
|
|
52
|
+
const chainId = this.getChainId();
|
|
53
|
+
const version = this.getVersion();
|
|
54
|
+
return computeAuthWitMessageHash(intent, {
|
|
55
|
+
chainId,
|
|
56
|
+
version
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AuthWitnessProvider } from '@aztec/entrypoints/interfaces';
|
|
1
|
+
import type { AuthWitnessProvider, ChainInfo } from '@aztec/entrypoints/interfaces';
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
4
|
-
import type { CompleteAddress
|
|
4
|
+
import type { CompleteAddress } from '@aztec/stdlib/contract';
|
|
5
5
|
import type { AccountInterface } from './interface.js';
|
|
6
6
|
/**
|
|
7
7
|
* An account contract instance. Knows its artifact, deployment arguments, how to create
|
|
@@ -26,10 +26,10 @@ export interface AccountContract {
|
|
|
26
26
|
* The account interface is responsible for assembling tx requests given requested function calls, and
|
|
27
27
|
* for creating signed auth witnesses given action identifiers (message hashes).
|
|
28
28
|
* @param address - Address of this account contract.
|
|
29
|
-
* @param
|
|
29
|
+
* @param chainInfo - Chain id and version of the rollup where the account contract is initialized / published.
|
|
30
30
|
* @returns An account interface instance for creating tx requests and authorizing actions.
|
|
31
31
|
*/
|
|
32
|
-
getInterface(address: CompleteAddress,
|
|
32
|
+
getInterface(address: CompleteAddress, chainInfo: ChainInfo): AccountInterface;
|
|
33
33
|
/**
|
|
34
34
|
* Returns the auth witness provider for the given address.
|
|
35
35
|
* @param address - Address for which to create auth witnesses.
|
|
@@ -39,5 +39,5 @@ export interface AccountContract {
|
|
|
39
39
|
/**
|
|
40
40
|
* Compute the address of an account contract from secret and salt.
|
|
41
41
|
*/
|
|
42
|
-
export declare function getAccountContractAddress(accountContract: AccountContract, secret: Fr, salt: Fr): Promise<import("../
|
|
42
|
+
export declare function getAccountContractAddress(accountContract: AccountContract, secret: Fr, salt: Fr): Promise<import("../api/addresses.js").AztecAddress>;
|
|
43
43
|
//# sourceMappingURL=account_contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account_contract.d.ts","sourceRoot":"","sources":["../../src/account/account_contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"account_contract.d.ts","sourceRoot":"","sources":["../../src/account/account_contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEjD;;OAEG;IACH,gCAAgC,IAAI,OAAO,CACvC;QACE,+DAA+D;QAC/D,eAAe,EAAE,MAAM,CAAC;QACxB,+DAA+D;QAC/D,eAAe,EAAE,GAAG,EAAE,CAAC;KACxB,GACD,SAAS,CACZ,CAAC;IAEF;;;;;;;OAOG;IACH,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,GAAG,gBAAgB,CAAC;IAE/E;;;OAGG;IACH,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,mBAAmB,CAAC;CACvE;AAED;;GAEG;AACH,wBAAsB,yBAAyB,CAAC,eAAe,EAAE,eAAe,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,uDAcrG"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
|
|
2
2
|
import { deriveKeys } from '@aztec/stdlib/keys';
|
|
3
|
-
// docs:end:account-contract-interface
|
|
4
3
|
/**
|
|
5
4
|
* Compute the address of an account contract from secret and salt.
|
|
6
5
|
*/ export async function getAccountContractAddress(accountContract, secret, salt) {
|
package/dest/{wallet/account_wallet_with_private_key.d.ts → account/account_with_secret_key.d.ts}
RENAMED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import
|
|
3
|
-
import type { Salt } from '
|
|
4
|
-
import type { AccountInterface } from '
|
|
5
|
-
import { AccountWallet } from './account_wallet.js';
|
|
2
|
+
import { BaseAccount } from './account.js';
|
|
3
|
+
import type { Salt } from './index.js';
|
|
4
|
+
import type { AccountInterface } from './interface.js';
|
|
6
5
|
/**
|
|
7
|
-
* Extends {@link
|
|
6
|
+
* Extends {@link Account} with the encryption private key. Not required for
|
|
8
7
|
* implementing the wallet interface but useful for testing purposes or exporting
|
|
9
8
|
* an account to another pxe.
|
|
10
9
|
*/
|
|
11
|
-
export declare class
|
|
10
|
+
export declare class AccountWithSecretKey extends BaseAccount {
|
|
12
11
|
private secretKey;
|
|
13
12
|
/** Deployment salt for this account contract. */
|
|
14
13
|
readonly salt: Salt;
|
|
15
|
-
constructor(
|
|
14
|
+
constructor(account: AccountInterface, secretKey: Fr,
|
|
16
15
|
/** Deployment salt for this account contract. */
|
|
17
16
|
salt: Salt);
|
|
18
17
|
/** Returns the encryption private key associated with this account. */
|
|
@@ -23,4 +22,4 @@ export declare class AccountWalletWithSecretKey extends AccountWallet {
|
|
|
23
22
|
*/
|
|
24
23
|
getEncryptionSecret(): Promise<import("@aztec/foundation/fields").Fq>;
|
|
25
24
|
}
|
|
26
|
-
//# sourceMappingURL=
|
|
25
|
+
//# sourceMappingURL=account_with_secret_key.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account_with_secret_key.d.ts","sourceRoot":"","sources":["../../src/account/account_with_secret_key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAGnD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,WAAW;IAGjD,OAAO,CAAC,SAAS;IACjB,iDAAiD;aACjC,IAAI,EAAE,IAAI;gBAH1B,OAAO,EAAE,gBAAgB,EACjB,SAAS,EAAE,EAAE;IACrB,iDAAiD;IACjC,IAAI,EAAE,IAAI;IAK5B,uEAAuE;IAChE,YAAY;IAInB;;;OAGG;IACU,mBAAmB;CAMjC"}
|
package/dest/{wallet/account_wallet_with_private_key.js → account/account_with_secret_key.js}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { computeAddressSecret, deriveMasterIncomingViewingSecretKey } from '@aztec/stdlib/keys';
|
|
2
|
-
import {
|
|
2
|
+
import { BaseAccount } from './account.js';
|
|
3
3
|
/**
|
|
4
|
-
* Extends {@link
|
|
4
|
+
* Extends {@link Account} with the encryption private key. Not required for
|
|
5
5
|
* implementing the wallet interface but useful for testing purposes or exporting
|
|
6
6
|
* an account to another pxe.
|
|
7
|
-
*/ export class
|
|
7
|
+
*/ export class AccountWithSecretKey extends BaseAccount {
|
|
8
8
|
secretKey;
|
|
9
9
|
salt;
|
|
10
|
-
constructor(
|
|
11
|
-
super(
|
|
10
|
+
constructor(account, secretKey, /** Deployment salt for this account contract. */ salt){
|
|
11
|
+
super(account), this.secretKey = secretKey, this.salt = salt;
|
|
12
12
|
}
|
|
13
13
|
/** Returns the encryption private key associated with this account. */ getSecretKey() {
|
|
14
14
|
return this.secretKey;
|
package/dest/account/index.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `account` module provides utilities for managing accounts.
|
|
3
|
-
* allows to instantiate, initialize and publish a fresh account, or to obtain a `Wallet` instance out of an
|
|
4
|
-
* already-deployed account. Use the `@aztec/accounts` package to load default account implementations that rely
|
|
5
|
-
* on ECDSA or Schnorr signatures.
|
|
2
|
+
* The `account` module provides utilities for managing accounts.
|
|
6
3
|
*
|
|
7
4
|
* @packageDocumentation
|
|
8
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/account/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/account/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,KAAK,eAAe,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,kCAAkC;AAClC,MAAM,MAAM,IAAI,GAAG,EAAE,GAAG,MAAM,GAAG,MAAM,CAAC"}
|
package/dest/account/index.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `account` module provides utilities for managing accounts.
|
|
3
|
-
* allows to instantiate, initialize and publish a fresh account, or to obtain a `Wallet` instance out of an
|
|
4
|
-
* already-deployed account. Use the `@aztec/accounts` package to load default account implementations that rely
|
|
5
|
-
* on ECDSA or Schnorr signatures.
|
|
2
|
+
* The `account` module provides utilities for managing accounts.
|
|
6
3
|
*
|
|
7
4
|
* @packageDocumentation
|
|
8
5
|
*/ export { getAccountContractAddress } from './account_contract.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ChainInfo } from '@aztec/entrypoints/interfaces';
|
|
2
|
+
import type { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
3
|
+
import type { Fr } from '@aztec/foundation/fields';
|
|
4
|
+
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
5
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
|
+
import type { CompleteAddress } from '@aztec/stdlib/contract';
|
|
7
|
+
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
8
|
+
import type { TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
9
|
+
import type { CallIntent, IntentInnerHash } from '../utils/authwit.js';
|
|
10
|
+
import type { Account } from './account.js';
|
|
11
|
+
/**
|
|
12
|
+
* Account implementation which creates a transaction using the multicall protocol contract as entrypoint.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SignerlessAccount implements Account {
|
|
15
|
+
private entrypoint;
|
|
16
|
+
constructor(chainInfo: ChainInfo);
|
|
17
|
+
createTxExecutionRequest(exec: ExecutionPayload, gasSettings: GasSettings): Promise<TxExecutionRequest>;
|
|
18
|
+
getChainId(): Fr;
|
|
19
|
+
getVersion(): Fr;
|
|
20
|
+
getCompleteAddress(): CompleteAddress;
|
|
21
|
+
getAddress(): AztecAddress;
|
|
22
|
+
createAuthWit(_intent: Fr | Buffer | IntentInnerHash | CallIntent): Promise<AuthWitness>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=signerless_account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signerless_account.d.ts","sourceRoot":"","sources":["../../src/account/signerless_account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAuB,MAAM,+BAA+B,CAAC;AAEpF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,qBAAa,iBAAkB,YAAW,OAAO;IAC/C,OAAO,CAAC,UAAU,CAAsB;gBAC5B,SAAS,EAAE,SAAS;IAIhC,wBAAwB,CAAC,IAAI,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIvG,UAAU,IAAI,EAAE;IAIhB,UAAU,IAAI,EAAE;IAIhB,kBAAkB,IAAI,eAAe;IAIrC,UAAU,IAAI,YAAY;IAI1B,aAAa,CAAC,OAAO,EAAE,EAAE,GAAG,MAAM,GAAG,eAAe,GAAG,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC;CAGzF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
|
|
2
|
+
/**
|
|
3
|
+
* Account implementation which creates a transaction using the multicall protocol contract as entrypoint.
|
|
4
|
+
*/ export class SignerlessAccount {
|
|
5
|
+
entrypoint;
|
|
6
|
+
constructor(chainInfo){
|
|
7
|
+
this.entrypoint = new DefaultMultiCallEntrypoint(chainInfo.chainId.toNumber(), chainInfo.version.toNumber());
|
|
8
|
+
}
|
|
9
|
+
createTxExecutionRequest(exec, gasSettings) {
|
|
10
|
+
return this.entrypoint.createTxExecutionRequest(exec, gasSettings);
|
|
11
|
+
}
|
|
12
|
+
getChainId() {
|
|
13
|
+
throw new Error('SignerlessAccount: Method getChainId not implemented.');
|
|
14
|
+
}
|
|
15
|
+
getVersion() {
|
|
16
|
+
throw new Error('SignerlessAccount: Method getVersion not implemented.');
|
|
17
|
+
}
|
|
18
|
+
getCompleteAddress() {
|
|
19
|
+
throw new Error('SignerlessAccount: Method getCompleteAddress not implemented.');
|
|
20
|
+
}
|
|
21
|
+
getAddress() {
|
|
22
|
+
throw new Error('SignerlessAccount: Method getAddress not implemented.');
|
|
23
|
+
}
|
|
24
|
+
createAuthWit(_intent) {
|
|
25
|
+
throw new Error('SignerlessAccount: Method createAuthWit not implemented.');
|
|
26
|
+
}
|
|
27
|
+
}
|
package/dest/api/abi.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { type ContractArtifact, type FunctionArtifact, type FunctionAbi, EventSelector, FunctionType, FunctionSelector, FunctionCall, NoteSelector, type ABIParameter, decodeFromAbi, encodeArguments, type AbiType, isAddressStruct, isAztecAddressStruct, isEthAddressStruct, isWrappedFieldStruct, isFunctionSelectorStruct, loadContractArtifact, loadContractArtifactForPublic, getAllFunctionAbis, contractArtifactToBuffer, contractArtifactFromBuffer, } from '@aztec/stdlib/abi';
|
|
2
2
|
export { type NoirCompiledContract } from '@aztec/stdlib/noir';
|
|
3
|
+
export { type AztecAddressLike, type EthAddressLike, type EventSelectorLike, type FieldLike, type FunctionSelectorLike, type U128Like, type WrappedFieldLike, } from '../utils/abi_types.js';
|
|
3
4
|
//# sourceMappingURL=abi.d.ts.map
|
package/dest/api/abi.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abi.d.ts","sourceRoot":"","sources":["../../src/api/abi.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,KAAK,YAAY,EACjB,aAAa,EACb,eAAe,EACf,KAAK,OAAO,EACZ,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,6BAA6B,EAC7B,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"abi.d.ts","sourceRoot":"","sources":["../../src/api/abi.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,KAAK,YAAY,EACjB,aAAa,EACb,eAAe,EACf,KAAK,OAAO,EACZ,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,6BAA6B,EAC7B,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAG/D,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,oBAAoB,EACzB,KAAK,QAAQ,EACb,KAAK,gBAAgB,GACtB,MAAM,uBAAuB,CAAC"}
|
package/dest/api/account.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { type AccountContract, type AccountInterface, type Salt, getAccountContractAddress } from '../account/index.js';
|
|
2
|
-
export type { AuthWitnessProvider } from '@aztec/entrypoints/interfaces';
|
|
3
|
-
export {
|
|
2
|
+
export type { AuthWitnessProvider, ChainInfo } from '@aztec/entrypoints/interfaces';
|
|
3
|
+
export { AccountWithSecretKey } from '../account/account_with_secret_key.js';
|
|
4
|
+
export { type Account, BaseAccount } from '../account/account.js';
|
|
5
|
+
export { SignerlessAccount } from '../account/signerless_account.js';
|
|
4
6
|
//# sourceMappingURL=account.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,IAAI,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACxH,YAAY,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,IAAI,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACxH,YAAY,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAEpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,KAAK,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC"}
|
package/dest/api/account.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { getAccountContractAddress } from '../account/index.js';
|
|
2
|
-
export {
|
|
2
|
+
export { AccountWithSecretKey } from '../account/account_with_secret_key.js';
|
|
3
|
+
export { BaseAccount } from '../account/account.js';
|
|
4
|
+
export { SignerlessAccount } from '../account/signerless_account.js';
|
package/dest/api/addresses.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../src/api/addresses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../src/api/addresses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC"}
|
package/dest/api/addresses.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
2
|
+
export { SetPublicAuthwitContractInteraction, type ContractFunctionInteractionCallIntent, getMessageHashFromIntent, computeAuthWitMessageHash, computeInnerAuthWitHashFromAction, lookupValidity, type CallIntent, type IntentInnerHash, } from '../utils/authwit.js';
|
|
3
|
+
export { computeInnerAuthWitHash } from '@aztec/stdlib/auth-witness';
|
|
2
4
|
export { CallAuthorizationRequest } from '../authorization/call_authorization_request.js';
|
|
3
5
|
//# sourceMappingURL=authorization.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization.d.ts","sourceRoot":"","sources":["../../src/api/authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"authorization.d.ts","sourceRoot":"","sources":["../../src/api/authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EACL,mCAAmC,EACnC,KAAK,qCAAqC,EAC1C,wBAAwB,EACxB,yBAAyB,EACzB,iCAAiC,EACjC,cAAc,EACd,KAAK,UAAU,EACf,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAErE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
2
|
+
export { SetPublicAuthwitContractInteraction, getMessageHashFromIntent, computeAuthWitMessageHash, computeInnerAuthWitHashFromAction, lookupValidity } from '../utils/authwit.js';
|
|
3
|
+
export { computeInnerAuthWitHash } from '@aztec/stdlib/auth-witness';
|
|
2
4
|
export { CallAuthorizationRequest } from '../authorization/call_authorization_request.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../src/api/block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dest/api/contract.d.ts
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* or obtaining the `request` for aggregating into a {@link BatchCall}.
|
|
27
27
|
*
|
|
28
28
|
* The result of `send`ing a transaction is a {@link SentTx} object, from which you can get the
|
|
29
|
-
* transaction hash, or simply `wait` until the transaction is mined and the local PXE
|
|
29
|
+
* transaction hash, or simply `wait` until the transaction is mined and the local PXE
|
|
30
30
|
* has synchronized its changes.
|
|
31
31
|
*
|
|
32
32
|
* @remarks If you are using typescript, consider using the
|
|
@@ -37,14 +37,13 @@
|
|
|
37
37
|
*/
|
|
38
38
|
export { Contract } from '../contract/contract.js';
|
|
39
39
|
export { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
|
|
40
|
-
export { type
|
|
41
|
-
export { TxProfileResult } from '@aztec/stdlib/tx';
|
|
40
|
+
export { type RequestInteractionOptions, type SendInteractionOptions, type ProfileInteractionOptions, type SimulateInteractionOptions, type InteractionFeeOptions, toProfileOptions, toSendOptions, toSimulateOptions, } from '../contract/interaction_options.js';
|
|
42
41
|
export { DefaultWaitOpts, SentTx, type WaitOpts } from '../contract/sent_tx.js';
|
|
43
|
-
export { ProvenTx } from '../contract/proven_tx.js';
|
|
44
42
|
export { ContractBase, type ContractMethod, type ContractStorageLayout } from '../contract/contract_base.js';
|
|
45
43
|
export { BatchCall } from '../contract/batch_call.js';
|
|
46
|
-
export { type DeployOptions, DeployMethod } from '../contract/deploy_method.js';
|
|
44
|
+
export { type DeployOptions, DeployMethod, type RequestDeployOptions, type SimulateDeployOptions, } from '../contract/deploy_method.js';
|
|
47
45
|
export { DeploySentTx } from '../contract/deploy_sent_tx.js';
|
|
48
46
|
export { waitForProven, type WaitForProvenOpts, DefaultWaitForProvenOpts } from '../contract/wait_for_proven.js';
|
|
47
|
+
export { getGasLimits } from '../contract/get_gas_limits.js';
|
|
49
48
|
export { type PartialAddress, type ContractClassWithId, type ContractInstanceWithAddress, getContractClassFromArtifact, getContractInstanceFromInstantiationParams, type NodeInfo, } from '@aztec/stdlib/contract';
|
|
50
49
|
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/api/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAE3F,OAAO,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/api/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAE3F,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,gBAAgB,EAChB,aAAa,EACb,iBAAiB,GAClB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC7G,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EACL,KAAK,aAAa,EAClB,YAAY,EACZ,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,GAC3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,KAAK,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AACjH,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,4BAA4B,EAC5B,0CAA0C,EAC1C,KAAK,QAAQ,GACd,MAAM,wBAAwB,CAAC"}
|
package/dest/api/contract.js
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* or obtaining the `request` for aggregating into a {@link BatchCall}.
|
|
27
27
|
*
|
|
28
28
|
* The result of `send`ing a transaction is a {@link SentTx} object, from which you can get the
|
|
29
|
-
* transaction hash, or simply `wait` until the transaction is mined and the local PXE
|
|
29
|
+
* transaction hash, or simply `wait` until the transaction is mined and the local PXE
|
|
30
30
|
* has synchronized its changes.
|
|
31
31
|
*
|
|
32
32
|
* @remarks If you are using typescript, consider using the
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
* @packageDocumentation
|
|
37
37
|
*/ export { Contract } from '../contract/contract.js';
|
|
38
38
|
export { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
|
|
39
|
-
export {
|
|
39
|
+
export { toProfileOptions, toSendOptions, toSimulateOptions } from '../contract/interaction_options.js';
|
|
40
40
|
export { DefaultWaitOpts, SentTx } from '../contract/sent_tx.js';
|
|
41
|
-
export { ProvenTx } from '../contract/proven_tx.js';
|
|
42
41
|
export { ContractBase } from '../contract/contract_base.js';
|
|
43
42
|
export { BatchCall } from '../contract/batch_call.js';
|
|
44
43
|
export { DeployMethod } from '../contract/deploy_method.js';
|
|
45
44
|
export { DeploySentTx } from '../contract/deploy_sent_tx.js';
|
|
46
45
|
export { waitForProven, DefaultWaitForProvenOpts } from '../contract/wait_for_proven.js';
|
|
46
|
+
export { getGasLimits } from '../contract/get_gas_limits.js';
|
|
47
47
|
export { getContractClassFromArtifact, getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/api/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { computeSecretHash } from '@aztec/stdlib/hash';
|
package/dest/api/ethereum.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export { L1FeeJuicePortalManager, L1ToL2TokenPortalManager, L1TokenManager, L1TokenPortalManager, type L2AmountClaim, type L2AmountClaimWithRecipient, type L2Claim, generateClaimSecret, } from '../ethereum/portal_manager.js';
|
|
2
|
-
export { getL1ContractAddresses } from '../ethereum/l1_contracts.js';
|
|
3
2
|
//# sourceMappingURL=ethereum.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ethereum.d.ts","sourceRoot":"","sources":["../../src/api/ethereum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,cAAc,EACd,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,OAAO,EACZ,mBAAmB,GACpB,MAAM,+BAA+B,CAAC
|
|
1
|
+
{"version":3,"file":"ethereum.d.ts","sourceRoot":"","sources":["../../src/api/ethereum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,cAAc,EACd,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,OAAO,EACZ,mBAAmB,GACpB,MAAM,+BAA+B,CAAC"}
|
package/dest/api/ethereum.js
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type EventMetadataDefinition } from '@aztec/stdlib/abi';
|
|
2
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
3
|
+
/**
|
|
4
|
+
* Returns decoded public events given search parameters.
|
|
5
|
+
* @param node - The node to request events from
|
|
6
|
+
* @param eventMetadata - Metadata of the event. This should be the class generated from the contract. e.g. Contract.events.Event
|
|
7
|
+
* @param from - The block number to search from.
|
|
8
|
+
* @param limit - The amount of blocks to search.
|
|
9
|
+
* @returns - The deserialized events.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getDecodedPublicEvents<T>(node: AztecNode, eventMetadataDef: EventMetadataDefinition, from: number, limit: number): Promise<T[]>;
|
|
12
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/api/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,uBAAuB,EAAgC,MAAM,mBAAmB,CAAC;AAC/F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAAC,CAAC,EAC5C,IAAI,EAAE,SAAS,EACf,gBAAgB,EAAE,uBAAuB,EACzC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,CAAC,EAAE,CAAC,CA2Bd"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { EventSelector, decodeFromAbi } from '@aztec/stdlib/abi';
|
|
2
|
+
/**
|
|
3
|
+
* Returns decoded public events given search parameters.
|
|
4
|
+
* @param node - The node to request events from
|
|
5
|
+
* @param eventMetadata - Metadata of the event. This should be the class generated from the contract. e.g. Contract.events.Event
|
|
6
|
+
* @param from - The block number to search from.
|
|
7
|
+
* @param limit - The amount of blocks to search.
|
|
8
|
+
* @returns - The deserialized events.
|
|
9
|
+
*/ export async function getDecodedPublicEvents(node, eventMetadataDef, from, limit) {
|
|
10
|
+
const { logs } = await node.getPublicLogs({
|
|
11
|
+
fromBlock: from,
|
|
12
|
+
toBlock: from + limit
|
|
13
|
+
});
|
|
14
|
+
const decodedEvents = logs.map((log)=>{
|
|
15
|
+
// +1 for the event selector
|
|
16
|
+
const expectedLength = eventMetadataDef.fieldNames.length + 1;
|
|
17
|
+
if (log.log.fields.length !== expectedLength) {
|
|
18
|
+
throw new Error(`Something is weird here, we have matching EventSelectors, but the actual payload has mismatched length. Expected ${expectedLength}. Got ${log.log.fields.length}.`);
|
|
19
|
+
}
|
|
20
|
+
const logFields = log.log.getEmittedFields();
|
|
21
|
+
// We are assuming here that event logs are the last 4 bytes of the event. This is not enshrined but is a function of aztec.nr raw log emission.
|
|
22
|
+
if (!EventSelector.fromField(logFields[logFields.length - 1]).equals(eventMetadataDef.eventSelector)) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
return decodeFromAbi([
|
|
26
|
+
eventMetadataDef.abiType
|
|
27
|
+
], log.log.fields);
|
|
28
|
+
}).filter((log)=>log !== undefined);
|
|
29
|
+
return decodedEvents;
|
|
30
|
+
}
|
package/dest/api/fee.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export type { FeePaymentMethod } from '
|
|
2
|
-
export { FeeJuicePaymentMethod } from '../fee/fee_juice_payment_method.js';
|
|
1
|
+
export type { FeePaymentMethod } from '../fee/fee_payment_method.js';
|
|
3
2
|
export { PrivateFeePaymentMethod } from '../fee/private_fee_payment_method.js';
|
|
4
3
|
export { PublicFeePaymentMethod } from '../fee/public_fee_payment_method.js';
|
|
5
4
|
export { FeeJuicePaymentMethodWithClaim } from '../fee/fee_juice_payment_method_with_claim.js';
|
package/dest/api/fee.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fee.d.ts","sourceRoot":"","sources":["../../src/api/fee.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM
|
|
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,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,yBAAyB,EAAE,MAAM,iCAAiC,CAAC"}
|
package/dest/api/fee.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { FeeJuicePaymentMethod } from '../fee/fee_juice_payment_method.js';
|
|
2
1
|
export { PrivateFeePaymentMethod } from '../fee/private_fee_payment_method.js';
|
|
3
2
|
export { PublicFeePaymentMethod } from '../fee/public_fee_payment_method.js';
|
|
4
3
|
export { FeeJuicePaymentMethodWithClaim } from '../fee/fee_juice_payment_method_with_claim.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { type PublicKey, PublicKeys } from '@aztec/stdlib/keys';
|
|
2
|
+
export { computeAppNullifierSecretKey, deriveKeys, deriveMasterIncomingViewingSecretKey, deriveMasterNullifierSecretKey, } from '@aztec/stdlib/keys';
|
|
3
|
+
export { generatePublicKey } from '../utils/pub_key.js';
|
|
4
|
+
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/api/keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EACL,4BAA4B,EAC5B,UAAU,EACV,oCAAoC,EACpC,8BAA8B,GAC/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dest/api/keys.js
ADDED
package/dest/api/log.d.ts
CHANGED
package/dest/api/log.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/api/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/api/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dest/api/log.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../../src/api/messaging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC"}
|