@aztec/aztec.js 0.0.0-test.0 → 0.0.1-commit.0208eb9
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/account.d.ts +44 -0
- package/dest/account/account.d.ts.map +1 -0
- package/dest/account/account.js +31 -0
- package/dest/account/account_contract.d.ts +42 -0
- package/dest/account/account_contract.d.ts.map +1 -0
- package/dest/account/{contract.js → account_contract.js} +7 -4
- package/dest/account/account_with_secret_key.d.ts +36 -0
- 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} +22 -5
- package/dest/account/index.d.ts +6 -9
- package/dest/account/index.d.ts.map +1 -1
- package/dest/account/index.js +4 -6
- package/dest/account/signerless_account.d.ts +22 -0
- package/dest/account/signerless_account.d.ts.map +1 -0
- package/dest/account/signerless_account.js +24 -0
- package/dest/api/abi.d.ts +3 -2
- package/dest/api/abi.d.ts.map +1 -1
- package/dest/api/abi.js +1 -1
- package/dest/api/account.d.ts +5 -3
- package/dest/api/account.d.ts.map +1 -1
- package/dest/api/account.js +3 -2
- package/dest/api/addresses.d.ts +2 -1
- package/dest/api/addresses.d.ts.map +1 -1
- package/dest/api/addresses.js +1 -0
- package/dest/api/authorization.d.ts +5 -0
- package/dest/api/authorization.d.ts.map +1 -0
- package/dest/api/authorization.js +4 -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 +55 -0
- package/dest/api/contract.d.ts.map +1 -0
- package/dest/api/contract.js +53 -0
- 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/deployment.d.ts +5 -4
- package/dest/api/deployment.d.ts.map +1 -1
- package/dest/api/deployment.js +4 -3
- package/dest/api/eth_address.d.ts +1 -1
- package/dest/api/ethereum.d.ts +2 -0
- package/dest/api/ethereum.d.ts.map +1 -0
- package/dest/api/ethereum.js +1 -0
- 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 +2 -2
- package/dest/api/fee.d.ts.map +1 -1
- package/dest/api/fee.js +1 -1
- package/dest/api/fee_testing.d.ts +2 -0
- package/dest/api/fee_testing.d.ts.map +1 -0
- package/dest/api/fee_testing.js +1 -0
- package/dest/api/fields.d.ts +3 -2
- package/dest/api/fields.d.ts.map +1 -1
- package/dest/api/fields.js +2 -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 +2 -1
- 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 +25 -0
- package/dest/api/node.d.ts.map +1 -0
- package/dest/api/node.js +22 -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 +9 -0
- package/dest/api/protocol.d.ts.map +1 -0
- package/dest/api/protocol.js +8 -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 +13 -0
- package/dest/api/utils.d.ts.map +1 -0
- package/dest/api/utils.js +12 -0
- package/dest/api/wallet.d.ts +5 -2
- package/dest/api/wallet.d.ts.map +1 -1
- package/dest/api/wallet.js +4 -1
- package/dest/authorization/call_authorization_request.d.ts +67 -0
- package/dest/authorization/call_authorization_request.d.ts.map +1 -0
- package/dest/authorization/call_authorization_request.js +49 -0
- package/dest/contract/base_contract_interaction.d.ts +18 -84
- package/dest/contract/base_contract_interaction.d.ts.map +1 -1
- package/dest/contract/base_contract_interaction.js +11 -136
- package/dest/contract/batch_call.d.ts +19 -21
- package/dest/contract/batch_call.d.ts.map +1 -1
- package/dest/contract/batch_call.js +89 -69
- package/dest/contract/checker.d.ts +2 -2
- package/dest/contract/checker.d.ts.map +1 -1
- package/dest/contract/checker.js +2 -2
- package/dest/contract/contract.d.ts +9 -8
- package/dest/contract/contract.d.ts.map +1 -1
- package/dest/contract/contract.js +10 -20
- package/dest/contract/contract_base.d.ts +8 -18
- package/dest/contract/contract_base.d.ts.map +1 -1
- package/dest/contract/contract_base.js +7 -14
- package/dest/contract/contract_function_interaction.d.ts +53 -45
- package/dest/contract/contract_function_interaction.d.ts.map +1 -1
- package/dest/contract/contract_function_interaction.js +78 -74
- package/dest/contract/deploy_method.d.ts +155 -62
- package/dest/contract/deploy_method.d.ts.map +1 -1
- package/dest/contract/deploy_method.js +152 -142
- package/dest/contract/get_gas_limits.d.ts +6 -7
- package/dest/contract/get_gas_limits.d.ts.map +1 -1
- package/dest/contract/get_gas_limits.js +9 -3
- package/dest/contract/interaction_options.d.ts +151 -0
- package/dest/contract/interaction_options.d.ts.map +1 -0
- package/dest/contract/interaction_options.js +53 -0
- package/dest/contract/protocol_contracts/auth-registry.d.ts +27 -0
- package/dest/contract/protocol_contracts/auth-registry.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/auth-registry.js +558 -0
- package/dest/contract/protocol_contracts/contract-class-registry.d.ts +26 -0
- package/dest/contract/protocol_contracts/contract-class-registry.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/contract-class-registry.js +385 -0
- package/dest/contract/protocol_contracts/contract-instance-registry.d.ts +22 -0
- package/dest/contract/protocol_contracts/contract-instance-registry.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/contract-instance-registry.js +465 -0
- package/dest/contract/protocol_contracts/fee-juice.d.ts +21 -0
- package/dest/contract/protocol_contracts/fee-juice.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/fee-juice.js +426 -0
- package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts +34 -0
- package/dest/contract/protocol_contracts/multi-call-entrypoint.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/multi-call-entrypoint.js +585 -0
- package/dest/contract/protocol_contracts/public-checks.d.ts +26 -0
- package/dest/contract/protocol_contracts/public-checks.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/public-checks.js +593 -0
- package/dest/contract/wait_for_proven.d.ts +17 -0
- package/dest/contract/wait_for_proven.d.ts.map +1 -0
- package/dest/contract/wait_for_proven.js +17 -0
- package/dest/contract/wait_opts.d.ts +16 -0
- package/dest/contract/wait_opts.d.ts.map +1 -0
- package/dest/contract/wait_opts.js +5 -0
- package/dest/deployment/broadcast_function.d.ts +4 -4
- package/dest/deployment/broadcast_function.d.ts.map +1 -1
- package/dest/deployment/broadcast_function.js +28 -24
- package/dest/deployment/contract_deployer.d.ts +2 -2
- package/dest/deployment/contract_deployer.d.ts.map +1 -1
- package/dest/deployment/contract_deployer.js +1 -1
- package/dest/deployment/publish_class.d.ts +6 -0
- package/dest/deployment/publish_class.d.ts.map +1 -0
- package/dest/deployment/publish_class.js +17 -0
- package/dest/deployment/publish_instance.d.ts +10 -0
- package/dest/deployment/publish_instance.d.ts.map +1 -0
- package/dest/deployment/publish_instance.js +11 -0
- package/dest/ethereum/portal_manager.d.ts +141 -0
- package/dest/ethereum/portal_manager.d.ts.map +1 -0
- package/dest/ethereum/portal_manager.js +345 -0
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts +17 -12
- package/dest/fee/fee_juice_payment_method_with_claim.d.ts.map +1 -1
- package/dest/fee/fee_juice_payment_method_with_claim.js +27 -17
- package/dest/fee/fee_payment_method.d.ts +12 -8
- package/dest/fee/fee_payment_method.d.ts.map +1 -1
- package/dest/fee/private_fee_payment_method.d.ts +26 -9
- package/dest/fee/private_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/private_fee_payment_method.js +45 -23
- package/dest/fee/public_fee_payment_method.d.ts +27 -10
- package/dest/fee/public_fee_payment_method.d.ts.map +1 -1
- package/dest/fee/public_fee_payment_method.js +47 -25
- package/dest/fee/sponsored_fee_payment.d.ts +17 -0
- package/dest/fee/sponsored_fee_payment.d.ts.map +1 -0
- package/dest/fee/sponsored_fee_payment.js +34 -0
- package/dest/scripts/generate_protocol_contract_types.d.ts +2 -0
- package/dest/scripts/generate_protocol_contract_types.d.ts.map +1 -0
- package/dest/scripts/generate_protocol_contract_types.js +120 -0
- package/dest/utils/abi_types.d.ts +2 -4
- package/dest/utils/abi_types.d.ts.map +1 -1
- package/dest/utils/authwit.d.ts +85 -26
- package/dest/utils/authwit.d.ts.map +1 -1
- package/dest/utils/authwit.js +234 -41
- package/dest/utils/cross_chain.d.ts +24 -0
- package/dest/utils/cross_chain.d.ts.map +1 -0
- package/dest/utils/cross_chain.js +30 -0
- package/dest/utils/fee_juice.d.ts +4 -3
- package/dest/utils/fee_juice.d.ts.map +1 -1
- package/dest/utils/fee_juice.js +4 -3
- package/dest/utils/field_compressed_string.d.ts +1 -1
- package/dest/utils/field_compressed_string.d.ts.map +1 -1
- package/dest/utils/field_compressed_string.js +1 -1
- package/dest/utils/node.d.ts +13 -2
- package/dest/utils/node.d.ts.map +1 -1
- package/dest/utils/node.js +47 -1
- package/dest/utils/pub_key.d.ts +2 -2
- package/dest/utils/pub_key.d.ts.map +1 -1
- package/dest/utils/pub_key.js +2 -3
- package/dest/wallet/account_entrypoint_meta_payment_method.d.ts +31 -0
- package/dest/wallet/account_entrypoint_meta_payment_method.d.ts.map +1 -0
- package/dest/wallet/account_entrypoint_meta_payment_method.js +61 -0
- package/dest/wallet/account_manager.d.ts +63 -0
- package/dest/wallet/account_manager.d.ts.map +1 -0
- package/dest/wallet/account_manager.js +107 -0
- package/dest/wallet/capabilities.d.ts +444 -0
- package/dest/wallet/capabilities.d.ts.map +1 -0
- package/dest/wallet/capabilities.js +3 -0
- package/dest/wallet/deploy_account_method.d.ts +80 -0
- package/dest/wallet/deploy_account_method.d.ts.map +1 -0
- package/dest/wallet/deploy_account_method.js +79 -0
- package/dest/wallet/index.d.ts +4 -17
- package/dest/wallet/index.d.ts.map +1 -1
- package/dest/wallet/index.js +3 -20
- package/dest/wallet/wallet.d.ts +2590 -0
- package/dest/wallet/wallet.d.ts.map +1 -0
- package/dest/wallet/wallet.js +291 -0
- package/package.json +47 -36
- package/src/account/account.ts +72 -0
- package/src/account/account_contract.ts +66 -0
- package/src/account/account_with_secret_key.ts +63 -0
- package/src/account/index.ts +5 -8
- package/src/account/signerless_account.ts +46 -0
- package/src/api/abi.ts +26 -0
- package/src/api/account.ts +8 -5
- package/src/api/addresses.ts +1 -0
- package/src/api/authorization.ts +15 -0
- package/src/api/block.ts +2 -0
- package/src/api/contract.ts +88 -0
- package/src/api/crypto.ts +1 -0
- package/src/api/deployment.ts +4 -3
- package/src/api/ethereum.ts +10 -0
- package/src/api/events.ts +44 -0
- package/src/api/fee.ts +1 -1
- package/src/api/fee_testing.ts +1 -0
- package/src/api/fields.ts +2 -1
- 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 +24 -0
- package/src/api/note.ts +1 -0
- package/src/api/protocol.ts +9 -0
- package/src/api/trees.ts +2 -0
- package/src/api/tx.ts +15 -0
- package/src/api/utils.ts +14 -0
- package/src/api/wallet.ts +72 -5
- package/src/authorization/call_authorization_request.ts +63 -0
- package/src/contract/base_contract_interaction.ts +40 -171
- package/src/contract/batch_call.ts +108 -57
- package/src/contract/checker.ts +8 -3
- package/src/contract/contract.ts +14 -21
- package/src/contract/contract_base.ts +9 -26
- package/src/contract/contract_function_interaction.ts +135 -106
- package/src/contract/deploy_method.ts +307 -143
- package/src/contract/get_gas_limits.ts +15 -8
- package/src/contract/interaction_options.ts +208 -0
- package/src/contract/protocol_contracts/auth-registry.ts +351 -0
- package/src/contract/protocol_contracts/contract-class-registry.ts +241 -0
- package/src/contract/protocol_contracts/contract-instance-registry.ts +302 -0
- package/src/contract/protocol_contracts/fee-juice.ts +264 -0
- package/src/contract/protocol_contracts/multi-call-entrypoint.ts +332 -0
- package/src/contract/protocol_contracts/public-checks.ts +316 -0
- package/src/contract/wait_for_proven.ts +38 -0
- package/src/contract/wait_opts.ts +21 -0
- package/src/deployment/broadcast_function.ts +58 -58
- package/src/deployment/contract_deployer.ts +4 -3
- package/src/deployment/publish_class.ts +34 -0
- package/src/deployment/publish_instance.ts +23 -0
- package/src/{api/ethereum → ethereum}/portal_manager.ts +166 -89
- package/src/fee/fee_juice_payment_method_with_claim.ts +49 -34
- package/src/fee/fee_payment_method.ts +11 -7
- package/src/fee/private_fee_payment_method.ts +80 -58
- package/src/fee/public_fee_payment_method.ts +94 -68
- package/src/fee/sponsored_fee_payment.ts +46 -0
- package/src/scripts/generate_protocol_contract_types.ts +150 -0
- package/src/utils/abi_types.ts +1 -1
- package/src/utils/authwit.ts +274 -54
- package/src/utils/cross_chain.ts +53 -0
- package/src/utils/fee_juice.ts +5 -5
- package/src/utils/field_compressed_string.ts +1 -1
- package/src/utils/node.ts +63 -1
- package/src/utils/pub_key.ts +3 -4
- package/src/wallet/account_entrypoint_meta_payment_method.ts +74 -0
- package/src/wallet/account_manager.ts +146 -0
- package/src/wallet/capabilities.ts +491 -0
- package/src/wallet/deploy_account_method.ts +150 -0
- package/src/wallet/index.ts +3 -33
- package/src/wallet/wallet.ts +533 -0
- package/dest/account/contract.d.ts +0 -37
- package/dest/account/contract.d.ts.map +0 -1
- package/dest/account/interface.d.ts +0 -31
- package/dest/account/interface.d.ts.map +0 -1
- package/dest/account/interface.js +0 -4
- package/dest/account/wallet.d.ts +0 -11
- package/dest/account/wallet.d.ts.map +0 -1
- package/dest/account/wallet.js +0 -3
- 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_method.js +0 -43
- 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 -108
- package/dest/account_manager/index.d.ts.map +0 -1
- package/dest/account_manager/index.js +0 -159
- package/dest/api/cheat_codes.d.ts +0 -26
- package/dest/api/cheat_codes.d.ts.map +0 -1
- package/dest/api/cheat_codes.js +0 -25
- package/dest/api/entrypoint.d.ts +0 -2
- package/dest/api/entrypoint.d.ts.map +0 -1
- package/dest/api/entrypoint.js +0 -1
- package/dest/api/ethereum/anvil_test_watcher.d.ts +0 -32
- package/dest/api/ethereum/anvil_test_watcher.d.ts.map +0 -1
- package/dest/api/ethereum/anvil_test_watcher.js +0 -133
- package/dest/api/ethereum/chain_monitor.d.ts +0 -25
- package/dest/api/ethereum/chain_monitor.d.ts.map +0 -1
- package/dest/api/ethereum/chain_monitor.js +0 -74
- package/dest/api/ethereum/cheat_codes.d.ts +0 -63
- package/dest/api/ethereum/cheat_codes.d.ts.map +0 -1
- package/dest/api/ethereum/cheat_codes.js +0 -162
- package/dest/api/ethereum/index.d.ts +0 -7
- package/dest/api/ethereum/index.d.ts.map +0 -1
- package/dest/api/ethereum/index.js +0 -6
- package/dest/api/ethereum/l1_contracts.d.ts +0 -3
- package/dest/api/ethereum/l1_contracts.d.ts.map +0 -1
- package/dest/api/ethereum/l1_contracts.js +0 -13
- package/dest/api/ethereum/portal_manager.d.ts +0 -136
- package/dest/api/ethereum/portal_manager.d.ts.map +0 -1
- package/dest/api/ethereum/portal_manager.js +0 -286
- package/dest/api/interfaces/pxe.d.ts +0 -2
- package/dest/api/interfaces/pxe.d.ts.map +0 -1
- package/dest/api/interfaces/pxe.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/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 -19
- package/dest/contract/deploy_sent_tx.d.ts +0 -45
- package/dest/contract/deploy_sent_tx.d.ts.map +0 -1
- package/dest/contract/deploy_sent_tx.js +0 -43
- package/dest/contract/index.d.ts +0 -45
- package/dest/contract/index.d.ts.map +0 -1
- package/dest/contract/index.js +0 -43
- package/dest/contract/protocol_contracts.d.ts +0 -9
- package/dest/contract/protocol_contracts.d.ts.map +0 -1
- package/dest/contract/protocol_contracts.js +0 -26
- package/dest/contract/proven_tx.d.ts +0 -17
- package/dest/contract/proven_tx.d.ts.map +0 -1
- package/dest/contract/proven_tx.js +0 -22
- package/dest/contract/sent_tx.d.ts +0 -61
- package/dest/contract/sent_tx.d.ts.map +0 -1
- package/dest/contract/sent_tx.js +0 -102
- package/dest/contract/unsafe_contract.d.ts +0 -15
- package/dest/contract/unsafe_contract.d.ts.map +0 -1
- package/dest/contract/unsafe_contract.js +0 -6
- package/dest/deployment/deploy_instance.d.ts +0 -10
- package/dest/deployment/deploy_instance.d.ts.map +0 -1
- package/dest/deployment/deploy_instance.js +0 -14
- package/dest/deployment/index.d.ts +0 -2
- package/dest/deployment/index.d.ts.map +0 -1
- package/dest/deployment/index.js +0 -1
- package/dest/deployment/register_class.d.ts +0 -6
- package/dest/deployment/register_class.d.ts.map +0 -1
- package/dest/deployment/register_class.js +0 -22
- package/dest/entrypoint/default_entrypoint.d.ts +0 -12
- package/dest/entrypoint/default_entrypoint.d.ts.map +0 -1
- package/dest/entrypoint/default_entrypoint.js +0 -28
- package/dest/entrypoint/default_multi_call_entrypoint.d.ts +0 -15
- package/dest/entrypoint/default_multi_call_entrypoint.d.ts.map +0 -1
- package/dest/entrypoint/default_multi_call_entrypoint.js +0 -130
- package/dest/entrypoint/entrypoint.d.ts +0 -35
- package/dest/entrypoint/entrypoint.d.ts.map +0 -1
- package/dest/entrypoint/entrypoint.js +0 -4
- package/dest/entrypoint/payload.d.ts +0 -128
- package/dest/entrypoint/payload.d.ts.map +0 -1
- package/dest/entrypoint/payload.js +0 -143
- package/dest/fee/fee_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 -20
- package/dest/index.d.ts +0 -66
- package/dest/index.d.ts.map +0 -1
- package/dest/index.js +0 -69
- package/dest/rpc_clients/index.d.ts +0 -3
- package/dest/rpc_clients/index.d.ts.map +0 -1
- package/dest/rpc_clients/index.js +0 -2
- 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 -78
- 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/aztec_cheatcodes.d.ts +0 -59
- package/dest/utils/aztec_cheatcodes.d.ts.map +0 -1
- package/dest/utils/aztec_cheatcodes.js +0 -62
- package/dest/utils/index.d.ts +0 -8
- package/dest/utils/index.d.ts.map +0 -1
- package/dest/utils/index.js +0 -6
- 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 -76
- package/dest/wallet/account_wallet.d.ts.map +0 -1
- package/dest/wallet/account_wallet.js +0 -231
- 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 -73
- package/dest/wallet/base_wallet.d.ts.map +0 -1
- package/dest/wallet/base_wallet.js +0 -123
- package/dest/wallet/signerless_wallet.d.ts +0 -25
- package/dest/wallet/signerless_wallet.d.ts.map +0 -1
- package/dest/wallet/signerless_wallet.js +0 -36
- package/src/account/contract.ts +0 -56
- package/src/account/interface.ts +0 -36
- package/src/account/wallet.ts +0 -13
- package/src/account_manager/deploy_account_method.ts +0 -86
- package/src/account_manager/deploy_account_sent_tx.ts +0 -42
- package/src/account_manager/index.ts +0 -229
- package/src/api/cheat_codes.ts +0 -35
- package/src/api/entrypoint.ts +0 -1
- package/src/api/ethereum/anvil_test_watcher.ts +0 -158
- package/src/api/ethereum/chain_monitor.ts +0 -88
- package/src/api/ethereum/cheat_codes.ts +0 -184
- package/src/api/ethereum/index.ts +0 -19
- package/src/api/ethereum/l1_contracts.ts +0 -21
- package/src/api/interfaces/pxe.ts +0 -1
- package/src/api/log_id.ts +0 -1
- package/src/api/tx_hash.ts +0 -1
- package/src/contract/deploy_proven_tx.ts +0 -34
- package/src/contract/deploy_sent_tx.ts +0 -74
- package/src/contract/index.ts +0 -48
- package/src/contract/protocol_contracts.ts +0 -35
- package/src/contract/proven_tx.ts +0 -42
- package/src/contract/sent_tx.ts +0 -141
- package/src/contract/unsafe_contract.ts +0 -19
- package/src/deployment/deploy_instance.ts +0 -31
- package/src/deployment/index.ts +0 -1
- package/src/deployment/register_class.ts +0 -44
- package/src/entrypoint/default_entrypoint.ts +0 -39
- package/src/entrypoint/default_multi_call_entrypoint.ts +0 -93
- package/src/entrypoint/entrypoint.ts +0 -39
- package/src/entrypoint/payload.ts +0 -238
- package/src/fee/fee_juice_payment_method.ts +0 -26
- package/src/index.ts +0 -106
- package/src/rpc_clients/index.ts +0 -2
- package/src/rpc_clients/node/index.ts +0 -77
- package/src/rpc_clients/pxe_client.ts +0 -25
- package/src/utils/aztec_cheatcodes.ts +0 -77
- package/src/utils/index.ts +0 -21
- package/src/utils/pxe.ts +0 -17
- package/src/wallet/account_wallet.ts +0 -242
- package/src/wallet/account_wallet_with_private_key.ts +0 -40
- package/src/wallet/base_wallet.ts +0 -198
- package/src/wallet/signerless_wallet.ts +0 -52
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
import type { ChainInfo } from '@aztec/entrypoints/interfaces';
|
|
2
|
+
import { BlockNumber, BlockNumberPositiveSchema } from '@aztec/foundation/branded-types';
|
|
3
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
|
+
import {
|
|
5
|
+
type AbiDecoded,
|
|
6
|
+
AbiTypeSchema,
|
|
7
|
+
type ContractArtifact,
|
|
8
|
+
ContractArtifactSchema,
|
|
9
|
+
type EventMetadataDefinition,
|
|
10
|
+
type FunctionCall,
|
|
11
|
+
FunctionType,
|
|
12
|
+
} from '@aztec/stdlib/abi';
|
|
13
|
+
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
14
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
15
|
+
import { type ContractInstanceWithAddress, ContractInstanceWithAddressSchema } from '@aztec/stdlib/contract';
|
|
16
|
+
import { Gas } from '@aztec/stdlib/gas';
|
|
17
|
+
import { AbiDecodedSchema, type ApiSchemaFor, optional, schemas, zodFor } from '@aztec/stdlib/schemas';
|
|
18
|
+
import type { ExecutionPayload, InTx } from '@aztec/stdlib/tx';
|
|
19
|
+
import {
|
|
20
|
+
Capsule,
|
|
21
|
+
HashedValues,
|
|
22
|
+
TxHash,
|
|
23
|
+
TxProfileResult,
|
|
24
|
+
TxReceipt,
|
|
25
|
+
TxSimulationResult,
|
|
26
|
+
UtilitySimulationResult,
|
|
27
|
+
inTxSchema,
|
|
28
|
+
} from '@aztec/stdlib/tx';
|
|
29
|
+
|
|
30
|
+
import { z } from 'zod';
|
|
31
|
+
|
|
32
|
+
import {
|
|
33
|
+
type FeeEstimationOptions,
|
|
34
|
+
type GasSettingsOption,
|
|
35
|
+
type InteractionWaitOptions,
|
|
36
|
+
NO_WAIT,
|
|
37
|
+
type ProfileInteractionOptions,
|
|
38
|
+
type SendInteractionOptionsWithoutWait,
|
|
39
|
+
type SendReturn,
|
|
40
|
+
type SimulateInteractionOptions,
|
|
41
|
+
} from '../contract/interaction_options.js';
|
|
42
|
+
import type { CallIntent, IntentInnerHash } from '../utils/authwit.js';
|
|
43
|
+
import type { AppCapabilities, WalletCapabilities } from './capabilities.js';
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* A wrapper type that allows any item to be associated with an alias.
|
|
47
|
+
*/
|
|
48
|
+
export type Aliased<T> = {
|
|
49
|
+
/**
|
|
50
|
+
* The alias
|
|
51
|
+
*/
|
|
52
|
+
alias: string;
|
|
53
|
+
/**
|
|
54
|
+
* The item being aliased.
|
|
55
|
+
*/
|
|
56
|
+
item: T;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Options for simulating interactions with the wallet. Overrides the fee settings of an interaction with
|
|
61
|
+
* a simplified version that only hints at the wallet whether the interaction contains a
|
|
62
|
+
* fee payment method or not
|
|
63
|
+
*/
|
|
64
|
+
export type SimulateOptions = Omit<SimulateInteractionOptions, 'fee'> & {
|
|
65
|
+
/** The fee options */
|
|
66
|
+
fee?: GasSettingsOption & FeeEstimationOptions;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Options for profiling interactions with the wallet. Overrides the fee settings of an interaction with
|
|
71
|
+
* a simplified version that only hints at the wallet whether the interaction contains a
|
|
72
|
+
* fee payment method or not
|
|
73
|
+
*/
|
|
74
|
+
export type ProfileOptions = Omit<ProfileInteractionOptions, 'fee'> & {
|
|
75
|
+
/** The fee options */
|
|
76
|
+
fee?: GasSettingsOption;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Options for sending/proving interactions with the wallet. Overrides the fee settings of an interaction with
|
|
81
|
+
* a simplified version that only hints at the wallet whether the interaction contains a
|
|
82
|
+
* fee payment method or not
|
|
83
|
+
*/
|
|
84
|
+
export type SendOptions<W extends InteractionWaitOptions = undefined> = Omit<
|
|
85
|
+
SendInteractionOptionsWithoutWait,
|
|
86
|
+
'fee'
|
|
87
|
+
> & {
|
|
88
|
+
/** The fee options */
|
|
89
|
+
fee?: GasSettingsOption;
|
|
90
|
+
/** Whether to wait for the transaction to be mined */
|
|
91
|
+
wait?: W;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Helper type that represents all methods that can be batched (all methods except batch itself).
|
|
96
|
+
*/
|
|
97
|
+
export type BatchableMethods = Omit<Wallet, 'batch'>;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* A method call with its name and arguments.
|
|
101
|
+
*/
|
|
102
|
+
type BatchedMethodInternal<T extends keyof BatchableMethods> = {
|
|
103
|
+
/** The method name */
|
|
104
|
+
name: T;
|
|
105
|
+
/** The method arguments */
|
|
106
|
+
args: Parameters<BatchableMethods[T]>;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Union of all possible batched method calls.
|
|
111
|
+
* This ensures type safety: the `args` must match the specific `name`.
|
|
112
|
+
*/
|
|
113
|
+
export type BatchedMethod = {
|
|
114
|
+
[K in keyof BatchableMethods]: BatchedMethodInternal<K>;
|
|
115
|
+
}[keyof BatchableMethods];
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Helper type to extract the return type of a batched method
|
|
119
|
+
*/
|
|
120
|
+
export type BatchedMethodResult<T> =
|
|
121
|
+
T extends BatchedMethodInternal<infer K> ? Awaited<ReturnType<BatchableMethods[K]>> : never;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Wrapper type for batch results that includes the method name for discriminated union deserialization.
|
|
125
|
+
* Each result is wrapped as \{ name: 'methodName', result: ActualResult \} to allow proper deserialization
|
|
126
|
+
* when AztecAddress and TxHash would otherwise be ambiguous (both are hex strings).
|
|
127
|
+
*/
|
|
128
|
+
export type BatchedMethodResultWrapper<T extends BatchedMethod> = {
|
|
129
|
+
/** The method name */
|
|
130
|
+
name: T['name'];
|
|
131
|
+
/** The method result */
|
|
132
|
+
result: BatchedMethodResult<T>;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Maps a tuple of BatchedMethod to a tuple of their wrapped return types
|
|
137
|
+
*/
|
|
138
|
+
export type BatchResults<T extends readonly BatchedMethod[]> = {
|
|
139
|
+
[K in keyof T]: BatchedMethodResultWrapper<T[K]>;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Filter options when querying private events.
|
|
144
|
+
*/
|
|
145
|
+
export type PrivateEventFilter = {
|
|
146
|
+
/** The address of the contract that emitted the events. */
|
|
147
|
+
contractAddress: AztecAddress;
|
|
148
|
+
/** Addresses of accounts that are in scope for this filter. */
|
|
149
|
+
scopes: AztecAddress[];
|
|
150
|
+
/** Transaction in which the events were emitted. */
|
|
151
|
+
txHash?: TxHash;
|
|
152
|
+
/** The block number from which to start fetching events (inclusive).
|
|
153
|
+
* Optional. If provided, it must be greater or equal than 1.
|
|
154
|
+
* Defaults to the initial L2 block number (INITIAL_L2_BLOCK_NUM).
|
|
155
|
+
* */
|
|
156
|
+
fromBlock?: BlockNumber;
|
|
157
|
+
/** The block number until which to fetch logs (not inclusive).
|
|
158
|
+
* Optional. If provided, it must be greater than fromBlock.
|
|
159
|
+
* Defaults to the latest known block to PXE + 1.
|
|
160
|
+
*/
|
|
161
|
+
toBlock?: BlockNumber;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* An ABI decoded private event with associated metadata.
|
|
166
|
+
*/
|
|
167
|
+
export type PrivateEvent<T> = {
|
|
168
|
+
/** The ABI decoded event */
|
|
169
|
+
event: T;
|
|
170
|
+
/** Metadata describing event context information such as tx and block */
|
|
171
|
+
metadata: InTx;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Contract metadata including deployment and registration status.
|
|
176
|
+
*/
|
|
177
|
+
export type ContractMetadata = {
|
|
178
|
+
/** The contract instance */
|
|
179
|
+
instance?: ContractInstanceWithAddress;
|
|
180
|
+
/** Whether the contract has been initialized (init nullifier exists) */
|
|
181
|
+
isContractInitialized: boolean;
|
|
182
|
+
/** Whether the contract instance is publicly deployed on-chain */
|
|
183
|
+
isContractPublished: boolean;
|
|
184
|
+
/** Whether the contract has been updated to a different class */
|
|
185
|
+
isContractUpdated: boolean;
|
|
186
|
+
/** The updated contract class ID if the contract has been updated */
|
|
187
|
+
updatedContractClassId?: Fr | undefined;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Contract class metadata.
|
|
192
|
+
*/
|
|
193
|
+
export type ContractClassMetadata = {
|
|
194
|
+
/** Whether the artifact is registered in the wallet */
|
|
195
|
+
isArtifactRegistered: boolean;
|
|
196
|
+
/** Whether the contract class is publicly registered on-chain */
|
|
197
|
+
isContractClassPubliclyRegistered: boolean;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* The wallet interface.
|
|
202
|
+
*/
|
|
203
|
+
export type Wallet = {
|
|
204
|
+
getPrivateEvents<T>(
|
|
205
|
+
eventMetadata: EventMetadataDefinition,
|
|
206
|
+
eventFilter: PrivateEventFilter,
|
|
207
|
+
): Promise<PrivateEvent<T>[]>;
|
|
208
|
+
getChainInfo(): Promise<ChainInfo>;
|
|
209
|
+
getContractMetadata(address: AztecAddress): Promise<ContractMetadata>;
|
|
210
|
+
getContractClassMetadata(id: Fr): Promise<ContractClassMetadata>;
|
|
211
|
+
registerSender(address: AztecAddress, alias?: string): Promise<AztecAddress>;
|
|
212
|
+
getAddressBook(): Promise<Aliased<AztecAddress>[]>;
|
|
213
|
+
getAccounts(): Promise<Aliased<AztecAddress>[]>;
|
|
214
|
+
registerContract(
|
|
215
|
+
instance: ContractInstanceWithAddress,
|
|
216
|
+
artifact?: ContractArtifact,
|
|
217
|
+
secretKey?: Fr,
|
|
218
|
+
): Promise<ContractInstanceWithAddress>;
|
|
219
|
+
simulateTx(exec: ExecutionPayload, opts: SimulateOptions): Promise<TxSimulationResult>;
|
|
220
|
+
simulateUtility(call: FunctionCall, authwits?: AuthWitness[]): Promise<UtilitySimulationResult>;
|
|
221
|
+
profileTx(exec: ExecutionPayload, opts: ProfileOptions): Promise<TxProfileResult>;
|
|
222
|
+
sendTx<W extends InteractionWaitOptions = undefined>(
|
|
223
|
+
exec: ExecutionPayload,
|
|
224
|
+
opts: SendOptions<W>,
|
|
225
|
+
): Promise<SendReturn<W>>;
|
|
226
|
+
createAuthWit(from: AztecAddress, messageHashOrIntent: IntentInnerHash | CallIntent): Promise<AuthWitness>;
|
|
227
|
+
requestCapabilities(manifest: AppCapabilities): Promise<WalletCapabilities>;
|
|
228
|
+
batch<const T extends readonly BatchedMethod[]>(methods: T): Promise<BatchResults<T>>;
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
export const FunctionCallSchema = z.object({
|
|
232
|
+
name: z.string(),
|
|
233
|
+
to: schemas.AztecAddress,
|
|
234
|
+
selector: schemas.FunctionSelector,
|
|
235
|
+
type: z.nativeEnum(FunctionType),
|
|
236
|
+
isStatic: z.boolean(),
|
|
237
|
+
hideMsgSender: z.boolean(),
|
|
238
|
+
args: z.array(schemas.Fr),
|
|
239
|
+
returnTypes: z.array(AbiTypeSchema),
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
export const ExecutionPayloadSchema = z.object({
|
|
243
|
+
calls: z.array(FunctionCallSchema),
|
|
244
|
+
authWitnesses: z.array(AuthWitness.schema),
|
|
245
|
+
capsules: z.array(Capsule.schema),
|
|
246
|
+
extraHashedArgs: z.array(HashedValues.schema),
|
|
247
|
+
feePayer: optional(schemas.AztecAddress),
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
export const GasSettingsOptionSchema = z.object({
|
|
251
|
+
gasSettings: optional(
|
|
252
|
+
z.object({
|
|
253
|
+
gasLimits: optional(Gas.schema),
|
|
254
|
+
teardownGasLimits: optional(Gas.schema),
|
|
255
|
+
maxFeePerGas: optional(z.object({ feePerDaGas: schemas.BigInt, feePerL2Gas: schemas.BigInt })),
|
|
256
|
+
maxPriorityFeePerGas: optional(z.object({ feePerDaGas: schemas.BigInt, feePerL2Gas: schemas.BigInt })),
|
|
257
|
+
}),
|
|
258
|
+
),
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
export const WalletSimulationFeeOptionSchema = GasSettingsOptionSchema.extend({
|
|
262
|
+
estimatedGasPadding: optional(z.number()),
|
|
263
|
+
estimateGas: optional(z.boolean()),
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
export const WaitOptsSchema = z.object({
|
|
267
|
+
ignoreDroppedReceiptsFor: optional(z.number()),
|
|
268
|
+
timeout: optional(z.number()),
|
|
269
|
+
interval: optional(z.number()),
|
|
270
|
+
dontThrowOnRevert: optional(z.boolean()),
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
export const SendOptionsSchema = z.object({
|
|
274
|
+
from: schemas.AztecAddress,
|
|
275
|
+
authWitnesses: optional(z.array(AuthWitness.schema)),
|
|
276
|
+
capsules: optional(z.array(Capsule.schema)),
|
|
277
|
+
fee: optional(GasSettingsOptionSchema),
|
|
278
|
+
wait: optional(z.union([z.literal(NO_WAIT), WaitOptsSchema])),
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
export const SimulateOptionsSchema = z.object({
|
|
282
|
+
from: schemas.AztecAddress,
|
|
283
|
+
authWitnesses: optional(z.array(AuthWitness.schema)),
|
|
284
|
+
capsules: optional(z.array(Capsule.schema)),
|
|
285
|
+
fee: optional(WalletSimulationFeeOptionSchema),
|
|
286
|
+
skipTxValidation: optional(z.boolean()),
|
|
287
|
+
skipFeeEnforcement: optional(z.boolean()),
|
|
288
|
+
includeMetadata: optional(z.boolean()),
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
export const ProfileOptionsSchema = SimulateOptionsSchema.extend({
|
|
292
|
+
profileMode: z.enum(['gates', 'execution-steps', 'full']),
|
|
293
|
+
skipProofGeneration: optional(z.boolean()),
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
export const MessageHashOrIntentSchema = z.union([
|
|
297
|
+
z.object({ consumer: schemas.AztecAddress, innerHash: schemas.Fr }),
|
|
298
|
+
z.object({
|
|
299
|
+
caller: schemas.AztecAddress,
|
|
300
|
+
call: FunctionCallSchema,
|
|
301
|
+
}),
|
|
302
|
+
]);
|
|
303
|
+
|
|
304
|
+
export const EventMetadataDefinitionSchema = z.object({
|
|
305
|
+
eventSelector: schemas.EventSelector,
|
|
306
|
+
abiType: AbiTypeSchema,
|
|
307
|
+
fieldNames: z.array(z.string()),
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
export const PrivateEventSchema: z.ZodType<any> = zodFor<PrivateEvent<AbiDecoded>>()(
|
|
311
|
+
z.object({
|
|
312
|
+
event: AbiDecodedSchema,
|
|
313
|
+
metadata: inTxSchema(),
|
|
314
|
+
}),
|
|
315
|
+
);
|
|
316
|
+
|
|
317
|
+
export const PrivateEventFilterSchema = z.object({
|
|
318
|
+
contractAddress: schemas.AztecAddress,
|
|
319
|
+
scopes: z.array(schemas.AztecAddress),
|
|
320
|
+
txHash: optional(TxHash.schema),
|
|
321
|
+
fromBlock: optional(BlockNumberPositiveSchema),
|
|
322
|
+
toBlock: optional(BlockNumberPositiveSchema),
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
export const ContractMetadataSchema = z.object({
|
|
326
|
+
instance: optional(ContractInstanceWithAddressSchema),
|
|
327
|
+
isContractInitialized: z.boolean(),
|
|
328
|
+
isContractPublished: z.boolean(),
|
|
329
|
+
isContractUpdated: z.boolean(),
|
|
330
|
+
updatedContractClassId: optional(schemas.Fr),
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
export const ContractClassMetadataSchema = z.object({
|
|
334
|
+
isArtifactRegistered: z.boolean(),
|
|
335
|
+
isContractClassPubliclyRegistered: z.boolean(),
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
export const ContractFunctionPatternSchema = z.object({
|
|
339
|
+
contract: z.union([schemas.AztecAddress, z.literal('*')]),
|
|
340
|
+
function: z.union([z.string(), z.literal('*')]),
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
export const AccountsCapabilitySchema = z.object({
|
|
344
|
+
type: z.literal('accounts'),
|
|
345
|
+
canGet: optional(z.boolean()),
|
|
346
|
+
canCreateAuthWit: optional(z.boolean()),
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
export const GrantedAccountsCapabilitySchema = AccountsCapabilitySchema.extend({
|
|
350
|
+
accounts: z.array(z.object({ alias: z.string(), item: schemas.AztecAddress })),
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
export const ContractsCapabilitySchema = z.object({
|
|
354
|
+
type: z.literal('contracts'),
|
|
355
|
+
contracts: z.union([z.literal('*'), z.array(schemas.AztecAddress)]),
|
|
356
|
+
canRegister: optional(z.boolean()),
|
|
357
|
+
canGetMetadata: optional(z.boolean()),
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
export const GrantedContractsCapabilitySchema = ContractsCapabilitySchema;
|
|
361
|
+
|
|
362
|
+
export const ContractClassesCapabilitySchema = z.object({
|
|
363
|
+
type: z.literal('contractClasses'),
|
|
364
|
+
classes: z.union([z.literal('*'), z.array(schemas.Fr)]),
|
|
365
|
+
canGetMetadata: z.boolean(),
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
export const GrantedContractClassesCapabilitySchema = ContractClassesCapabilitySchema;
|
|
369
|
+
|
|
370
|
+
export const SimulationCapabilitySchema = z.object({
|
|
371
|
+
type: z.literal('simulation'),
|
|
372
|
+
transactions: optional(
|
|
373
|
+
z.object({
|
|
374
|
+
scope: z.union([z.literal('*'), z.array(ContractFunctionPatternSchema)]),
|
|
375
|
+
}),
|
|
376
|
+
),
|
|
377
|
+
utilities: optional(
|
|
378
|
+
z.object({
|
|
379
|
+
scope: z.union([z.literal('*'), z.array(ContractFunctionPatternSchema)]),
|
|
380
|
+
}),
|
|
381
|
+
),
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
export const GrantedSimulationCapabilitySchema = SimulationCapabilitySchema;
|
|
385
|
+
|
|
386
|
+
export const TransactionCapabilitySchema = z.object({
|
|
387
|
+
type: z.literal('transaction'),
|
|
388
|
+
scope: z.union([z.literal('*'), z.array(ContractFunctionPatternSchema)]),
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
export const GrantedTransactionCapabilitySchema = TransactionCapabilitySchema;
|
|
392
|
+
|
|
393
|
+
export const DataCapabilitySchema = z.object({
|
|
394
|
+
type: z.literal('data'),
|
|
395
|
+
addressBook: optional(z.boolean()),
|
|
396
|
+
privateEvents: optional(
|
|
397
|
+
z.object({
|
|
398
|
+
contracts: z.union([z.literal('*'), z.array(schemas.AztecAddress)]),
|
|
399
|
+
}),
|
|
400
|
+
),
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
export const GrantedDataCapabilitySchema = DataCapabilitySchema;
|
|
404
|
+
|
|
405
|
+
export const CapabilitySchema = z.discriminatedUnion('type', [
|
|
406
|
+
AccountsCapabilitySchema,
|
|
407
|
+
ContractsCapabilitySchema,
|
|
408
|
+
ContractClassesCapabilitySchema,
|
|
409
|
+
SimulationCapabilitySchema,
|
|
410
|
+
TransactionCapabilitySchema,
|
|
411
|
+
DataCapabilitySchema,
|
|
412
|
+
]);
|
|
413
|
+
|
|
414
|
+
export const GrantedCapabilitySchema = z.discriminatedUnion('type', [
|
|
415
|
+
GrantedAccountsCapabilitySchema,
|
|
416
|
+
GrantedContractsCapabilitySchema,
|
|
417
|
+
GrantedContractClassesCapabilitySchema,
|
|
418
|
+
GrantedSimulationCapabilitySchema,
|
|
419
|
+
GrantedTransactionCapabilitySchema,
|
|
420
|
+
GrantedDataCapabilitySchema,
|
|
421
|
+
]);
|
|
422
|
+
|
|
423
|
+
export const AppCapabilitiesSchema = z.object({
|
|
424
|
+
version: z.literal('1.0'),
|
|
425
|
+
metadata: z.object({
|
|
426
|
+
name: z.string(),
|
|
427
|
+
version: z.string(),
|
|
428
|
+
description: optional(z.string()),
|
|
429
|
+
url: optional(z.string()),
|
|
430
|
+
icon: optional(z.string()),
|
|
431
|
+
}),
|
|
432
|
+
capabilities: z.array(CapabilitySchema),
|
|
433
|
+
behavior: optional(
|
|
434
|
+
z.object({
|
|
435
|
+
mode: optional(z.enum(['strict', 'permissive'])),
|
|
436
|
+
expiration: optional(z.number()),
|
|
437
|
+
}),
|
|
438
|
+
),
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
export const WalletCapabilitiesSchema = z.object({
|
|
442
|
+
version: z.literal('1.0'),
|
|
443
|
+
granted: z.array(GrantedCapabilitySchema),
|
|
444
|
+
wallet: z.object({
|
|
445
|
+
name: z.string(),
|
|
446
|
+
version: z.string(),
|
|
447
|
+
}),
|
|
448
|
+
expiresAt: optional(z.number()),
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Record of all wallet method schemas (excluding batch).
|
|
453
|
+
* This is the single source of truth for method schemas - batch schemas are derived from this.
|
|
454
|
+
*/
|
|
455
|
+
const WalletMethodSchemas = {
|
|
456
|
+
getChainInfo: z
|
|
457
|
+
.function()
|
|
458
|
+
.args()
|
|
459
|
+
.returns(z.object({ chainId: schemas.Fr, version: schemas.Fr })),
|
|
460
|
+
getContractMetadata: z.function().args(schemas.AztecAddress).returns(ContractMetadataSchema),
|
|
461
|
+
getContractClassMetadata: z.function().args(schemas.Fr).returns(ContractClassMetadataSchema),
|
|
462
|
+
getPrivateEvents: z
|
|
463
|
+
.function()
|
|
464
|
+
.args(EventMetadataDefinitionSchema, PrivateEventFilterSchema)
|
|
465
|
+
.returns(z.array(PrivateEventSchema)),
|
|
466
|
+
registerSender: z.function().args(schemas.AztecAddress, optional(z.string())).returns(schemas.AztecAddress),
|
|
467
|
+
getAddressBook: z
|
|
468
|
+
.function()
|
|
469
|
+
.args()
|
|
470
|
+
.returns(z.array(z.object({ alias: z.string(), item: schemas.AztecAddress }))),
|
|
471
|
+
getAccounts: z
|
|
472
|
+
.function()
|
|
473
|
+
.args()
|
|
474
|
+
.returns(z.array(z.object({ alias: z.string(), item: schemas.AztecAddress }))),
|
|
475
|
+
registerContract: z
|
|
476
|
+
.function()
|
|
477
|
+
.args(ContractInstanceWithAddressSchema, optional(ContractArtifactSchema), optional(schemas.Fr))
|
|
478
|
+
.returns(ContractInstanceWithAddressSchema),
|
|
479
|
+
simulateTx: z.function().args(ExecutionPayloadSchema, SimulateOptionsSchema).returns(TxSimulationResult.schema),
|
|
480
|
+
simulateUtility: z
|
|
481
|
+
.function()
|
|
482
|
+
.args(FunctionCallSchema, optional(z.array(AuthWitness.schema)))
|
|
483
|
+
.returns(UtilitySimulationResult.schema),
|
|
484
|
+
profileTx: z.function().args(ExecutionPayloadSchema, ProfileOptionsSchema).returns(TxProfileResult.schema),
|
|
485
|
+
sendTx: z
|
|
486
|
+
.function()
|
|
487
|
+
.args(ExecutionPayloadSchema, SendOptionsSchema)
|
|
488
|
+
.returns(z.union([TxHash.schema, TxReceipt.schema])),
|
|
489
|
+
createAuthWit: z.function().args(schemas.AztecAddress, MessageHashOrIntentSchema).returns(AuthWitness.schema),
|
|
490
|
+
requestCapabilities: z.function().args(AppCapabilitiesSchema).returns(WalletCapabilitiesSchema),
|
|
491
|
+
};
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Creates batch schemas from the individual wallet methods.
|
|
495
|
+
* This allows us to define them once and derive batch schemas automatically,
|
|
496
|
+
* reducing duplication and ensuring consistency.
|
|
497
|
+
*/
|
|
498
|
+
function createBatchSchemas<T extends Record<string, z.ZodFunction<z.ZodTuple<any, any>, z.ZodTypeAny>>>(
|
|
499
|
+
methodSchemas: T,
|
|
500
|
+
) {
|
|
501
|
+
const names = Object.keys(methodSchemas) as (keyof T)[];
|
|
502
|
+
|
|
503
|
+
const namesAndArgs = names.map(name =>
|
|
504
|
+
z.object({
|
|
505
|
+
name: z.literal(name),
|
|
506
|
+
args: methodSchemas[name].parameters(),
|
|
507
|
+
}),
|
|
508
|
+
);
|
|
509
|
+
|
|
510
|
+
const namesAndReturns = names.map(name =>
|
|
511
|
+
z.object({
|
|
512
|
+
name: z.literal(name),
|
|
513
|
+
result: methodSchemas[name].returnType(),
|
|
514
|
+
}),
|
|
515
|
+
);
|
|
516
|
+
|
|
517
|
+
// Type assertion needed because discriminatedUnion expects a tuple type [T, T, ...T[]]
|
|
518
|
+
// but we're building the array dynamically. The runtime behavior is correct.
|
|
519
|
+
return {
|
|
520
|
+
input: z.discriminatedUnion('name', namesAndArgs as [(typeof namesAndArgs)[0], ...typeof namesAndArgs]),
|
|
521
|
+
output: z.discriminatedUnion('name', namesAndReturns as [(typeof namesAndReturns)[0], ...typeof namesAndReturns]),
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
const { input: BatchedMethodSchema, output: BatchedResultSchema } = createBatchSchemas(WalletMethodSchemas);
|
|
526
|
+
|
|
527
|
+
export { BatchedMethodSchema, BatchedResultSchema };
|
|
528
|
+
|
|
529
|
+
export const WalletSchema: ApiSchemaFor<Wallet> = {
|
|
530
|
+
...WalletMethodSchemas,
|
|
531
|
+
// @ts-expect-error - ApiSchemaFor cannot properly type generic methods with readonly arrays
|
|
532
|
+
batch: z.function().args(z.array(BatchedMethodSchema)).returns(z.array(BatchedResultSchema)),
|
|
533
|
+
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
3
|
-
import type { CompleteAddress, NodeInfo } from '@aztec/stdlib/contract';
|
|
4
|
-
import type { AccountInterface, 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(): Promise<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
|
-
/**
|
|
34
|
-
* Compute the address of an account contract from secret and salt.
|
|
35
|
-
*/
|
|
36
|
-
export declare function getAccountContractAddress(accountContract: AccountContract, secret: Fr, salt: Fr): Promise<import("@aztec/stdlib/aztec-address").AztecAddress>;
|
|
37
|
-
//# 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,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG5E;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEjD;;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;AAGD;;GAEG;AACH,wBAAsB,yBAAyB,CAAC,eAAe,EAAE,eAAe,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,+DAUrG"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
import type { Fr } from '@aztec/foundation/fields';
|
|
4
|
-
import type { 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 { EntrypointInterface } from '../entrypoint/entrypoint.js';
|
|
8
|
-
/** Creates authorization witnesses. */
|
|
9
|
-
export interface AuthWitnessProvider {
|
|
10
|
-
/**
|
|
11
|
-
* Computes an authentication witness from either a message hash
|
|
12
|
-
* @param messageHash - The message hash to approve
|
|
13
|
-
* @returns The authentication witness
|
|
14
|
-
*/
|
|
15
|
-
createAuthWit(messageHash: Fr | Buffer): Promise<AuthWitness>;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Handler for interfacing with an account. Knows how to create transaction execution
|
|
19
|
-
* requests and authorize actions for its corresponding account.
|
|
20
|
-
*/
|
|
21
|
-
export interface AccountInterface extends EntrypointInterface, AuthWitnessProvider {
|
|
22
|
-
/** Returns the complete address for this account. */
|
|
23
|
-
getCompleteAddress(): CompleteAddress;
|
|
24
|
-
/** Returns the address for this account. */
|
|
25
|
-
getAddress(): AztecAddress;
|
|
26
|
-
/** Returns the chain id for this account */
|
|
27
|
-
getChainId(): Fr;
|
|
28
|
-
/** Returns the rollup version for this account */
|
|
29
|
-
getVersion(): Fr;
|
|
30
|
-
}
|
|
31
|
-
//# 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,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,KAAK,EAAE,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,11 +0,0 @@
|
|
|
1
|
-
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
2
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
3
|
-
import type { IntentAction, IntentInnerHash } from '../utils/authwit.js';
|
|
4
|
-
import type { AccountInterface } from './interface.js';
|
|
5
|
-
/**
|
|
6
|
-
* The wallet interface.
|
|
7
|
-
*/
|
|
8
|
-
export type Wallet = AccountInterface & PXE & {
|
|
9
|
-
createAuthWit(intent: IntentInnerHash | IntentAction): Promise<AuthWitness>;
|
|
10
|
-
};
|
|
11
|
-
//# 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,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,EAAE,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"}
|
package/dest/account/wallet.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type ContractArtifact, type FunctionArtifact } from '@aztec/stdlib/abi';
|
|
2
|
-
import type { PublicKeys } from '@aztec/stdlib/keys';
|
|
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,EACL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAItB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,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"}
|