@aztec/aztec.js 0.0.0-test.1 → 0.0.1-commit.023c3e5
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 +575 -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 +583 -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,316 @@
|
|
|
1
|
+
/* Autogenerated file, do not edit! */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
4
|
+
import { FunctionType } from '@aztec/stdlib/abi';
|
|
5
|
+
|
|
6
|
+
import type { ContractArtifact } from '../../api/abi.js';
|
|
7
|
+
import { PublicKeys } from '../../api/keys.js';
|
|
8
|
+
import type {
|
|
9
|
+
AztecAddressLike,
|
|
10
|
+
EthAddressLike,
|
|
11
|
+
FieldLike,
|
|
12
|
+
FunctionSelectorLike,
|
|
13
|
+
WrappedFieldLike,
|
|
14
|
+
} from '../../utils/abi_types.js';
|
|
15
|
+
import type { Wallet } from '../../wallet/wallet.js';
|
|
16
|
+
import { ContractBase, type ContractMethod } from '../contract_base.js';
|
|
17
|
+
import { ContractFunctionInteraction } from '../contract_function_interaction.js';
|
|
18
|
+
|
|
19
|
+
const PublicChecksContractArtifact: ContractArtifact = {
|
|
20
|
+
name: 'PublicChecks',
|
|
21
|
+
functions: [
|
|
22
|
+
{
|
|
23
|
+
...{
|
|
24
|
+
functionType: FunctionType.UTILITY,
|
|
25
|
+
name: 'process_message',
|
|
26
|
+
isOnlySelf: false,
|
|
27
|
+
isStatic: false,
|
|
28
|
+
isInitializer: false,
|
|
29
|
+
parameters: [
|
|
30
|
+
{
|
|
31
|
+
name: 'message_ciphertext',
|
|
32
|
+
type: {
|
|
33
|
+
kind: 'struct',
|
|
34
|
+
fields: [
|
|
35
|
+
{ name: 'storage', type: { kind: 'array', length: 17, type: { kind: 'field' } } },
|
|
36
|
+
{ name: 'len', type: { kind: 'integer', sign: 'unsigned', width: 32 } },
|
|
37
|
+
],
|
|
38
|
+
path: 'std::collections::bounded_vec::BoundedVec',
|
|
39
|
+
},
|
|
40
|
+
visibility: 'private',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'message_context',
|
|
44
|
+
type: {
|
|
45
|
+
kind: 'struct',
|
|
46
|
+
fields: [
|
|
47
|
+
{ name: 'tx_hash', type: { kind: 'field' } },
|
|
48
|
+
{
|
|
49
|
+
name: 'unique_note_hashes_in_tx',
|
|
50
|
+
type: {
|
|
51
|
+
kind: 'struct',
|
|
52
|
+
fields: [
|
|
53
|
+
{ name: 'storage', type: { kind: 'array', length: 64, type: { kind: 'field' } } },
|
|
54
|
+
{ name: 'len', type: { kind: 'integer', sign: 'unsigned', width: 32 } },
|
|
55
|
+
],
|
|
56
|
+
path: 'std::collections::bounded_vec::BoundedVec',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{ name: 'first_nullifier_in_tx', type: { kind: 'field' } },
|
|
60
|
+
{
|
|
61
|
+
name: 'recipient',
|
|
62
|
+
type: {
|
|
63
|
+
kind: 'struct',
|
|
64
|
+
fields: [{ name: 'inner', type: { kind: 'field' } }],
|
|
65
|
+
path: 'aztec::protocol_types::address::aztec_address::AztecAddress',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
path: 'aztec::messages::processing::message_context::MessageContext',
|
|
70
|
+
},
|
|
71
|
+
visibility: 'private',
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
returnTypes: [],
|
|
75
|
+
errorTypes: {
|
|
76
|
+
'361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
|
|
77
|
+
'992401946138144806': { error_kind: 'string', string: 'Attempted to read past end of BoundedVec' },
|
|
78
|
+
'1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
|
|
79
|
+
'2967937905572420042': {
|
|
80
|
+
error_kind: 'fmtstring',
|
|
81
|
+
length: 61,
|
|
82
|
+
item_types: [{ kind: 'field' }, { kind: 'field' }],
|
|
83
|
+
},
|
|
84
|
+
'3330370348214585450': {
|
|
85
|
+
error_kind: 'fmtstring',
|
|
86
|
+
length: 48,
|
|
87
|
+
item_types: [{ kind: 'field' }, { kind: 'field' }],
|
|
88
|
+
},
|
|
89
|
+
'3670003311596808700': {
|
|
90
|
+
error_kind: 'fmtstring',
|
|
91
|
+
length: 77,
|
|
92
|
+
item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
|
|
93
|
+
},
|
|
94
|
+
'4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
|
|
95
|
+
'4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
|
|
96
|
+
'9530675838293881722': { error_kind: 'string', string: 'Writer did not write all data' },
|
|
97
|
+
'9791669845391776238': {
|
|
98
|
+
error_kind: 'string',
|
|
99
|
+
string: '0 has a square root; you cannot claim it is not square',
|
|
100
|
+
},
|
|
101
|
+
'10135509984888824963': { error_kind: 'fmtstring', length: 58, item_types: [{ kind: 'field' }] },
|
|
102
|
+
'10791800398362570014': { error_kind: 'string', string: 'extend_from_bounded_vec out of bounds' },
|
|
103
|
+
'11692359521570349358': { error_kind: 'fmtstring', length: 40, item_types: [] },
|
|
104
|
+
'12469291177396340830': { error_kind: 'string', string: 'call to assert_max_bit_size' },
|
|
105
|
+
'12913276134398371456': { error_kind: 'string', string: 'push out of bounds' },
|
|
106
|
+
'13557316507370296400': {
|
|
107
|
+
error_kind: 'fmtstring',
|
|
108
|
+
length: 130,
|
|
109
|
+
item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
|
|
110
|
+
},
|
|
111
|
+
'14938672389828944159': {
|
|
112
|
+
error_kind: 'fmtstring',
|
|
113
|
+
length: 146,
|
|
114
|
+
item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
|
|
115
|
+
},
|
|
116
|
+
'14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
|
|
117
|
+
'15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
|
|
118
|
+
'16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
|
|
119
|
+
'17531474008201752295': {
|
|
120
|
+
error_kind: 'fmtstring',
|
|
121
|
+
length: 133,
|
|
122
|
+
item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
bytecode: Buffer.from([]),
|
|
127
|
+
debugSymbols: '',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
...{
|
|
131
|
+
functionType: FunctionType.PUBLIC,
|
|
132
|
+
name: 'public_dispatch',
|
|
133
|
+
isOnlySelf: false,
|
|
134
|
+
isStatic: false,
|
|
135
|
+
isInitializer: false,
|
|
136
|
+
parameters: [{ name: 'selector', type: { kind: 'field' }, visibility: 'private' }],
|
|
137
|
+
returnTypes: [],
|
|
138
|
+
errorTypes: {
|
|
139
|
+
'3445904810750103705': { error_kind: 'string', string: 'Block number mismatch.' },
|
|
140
|
+
'6989792215391248978': {
|
|
141
|
+
error_kind: 'string',
|
|
142
|
+
string: 'Function check_timestamp can only be called statically',
|
|
143
|
+
},
|
|
144
|
+
'7259463707251703666': {
|
|
145
|
+
error_kind: 'string',
|
|
146
|
+
string: 'Function check_block_number can only be called statically',
|
|
147
|
+
},
|
|
148
|
+
'12511970388699677811': { error_kind: 'fmtstring', length: 27, item_types: [{ kind: 'field' }] },
|
|
149
|
+
'13950240626967988787': { error_kind: 'string', string: 'Timestamp mismatch.' },
|
|
150
|
+
'15015303112667403944': { error_kind: 'fmtstring', length: 17, item_types: [] },
|
|
151
|
+
'15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
bytecode: Buffer.from([]),
|
|
155
|
+
debugSymbols: '',
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
...{
|
|
159
|
+
functionType: FunctionType.UTILITY,
|
|
160
|
+
name: 'sync_state',
|
|
161
|
+
isOnlySelf: false,
|
|
162
|
+
isStatic: false,
|
|
163
|
+
isInitializer: false,
|
|
164
|
+
parameters: [],
|
|
165
|
+
returnTypes: [],
|
|
166
|
+
errorTypes: {
|
|
167
|
+
'361444214588792908': { error_kind: 'string', string: 'attempt to multiply with overflow' },
|
|
168
|
+
'992401946138144806': { error_kind: 'string', string: 'Attempted to read past end of BoundedVec' },
|
|
169
|
+
'1998584279744703196': { error_kind: 'string', string: 'attempt to subtract with overflow' },
|
|
170
|
+
'2967937905572420042': {
|
|
171
|
+
error_kind: 'fmtstring',
|
|
172
|
+
length: 61,
|
|
173
|
+
item_types: [{ kind: 'field' }, { kind: 'field' }],
|
|
174
|
+
},
|
|
175
|
+
'3330370348214585450': {
|
|
176
|
+
error_kind: 'fmtstring',
|
|
177
|
+
length: 48,
|
|
178
|
+
item_types: [{ kind: 'field' }, { kind: 'field' }],
|
|
179
|
+
},
|
|
180
|
+
'3670003311596808700': {
|
|
181
|
+
error_kind: 'fmtstring',
|
|
182
|
+
length: 77,
|
|
183
|
+
item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
|
|
184
|
+
},
|
|
185
|
+
'4261968856572588300': { error_kind: 'string', string: 'Value does not fit in field' },
|
|
186
|
+
'4440399188109668273': { error_kind: 'string', string: 'Input length must be a multiple of 32' },
|
|
187
|
+
'9530675838293881722': { error_kind: 'string', string: 'Writer did not write all data' },
|
|
188
|
+
'9791669845391776238': {
|
|
189
|
+
error_kind: 'string',
|
|
190
|
+
string: '0 has a square root; you cannot claim it is not square',
|
|
191
|
+
},
|
|
192
|
+
'9885968605480832328': {
|
|
193
|
+
error_kind: 'string',
|
|
194
|
+
string: 'Attempted to read past the length of a CapsuleArray',
|
|
195
|
+
},
|
|
196
|
+
'10135509984888824963': { error_kind: 'fmtstring', length: 58, item_types: [{ kind: 'field' }] },
|
|
197
|
+
'10791800398362570014': { error_kind: 'string', string: 'extend_from_bounded_vec out of bounds' },
|
|
198
|
+
'11021520179822076911': {
|
|
199
|
+
error_kind: 'string',
|
|
200
|
+
string: 'Attempted to delete past the length of a CapsuleArray',
|
|
201
|
+
},
|
|
202
|
+
'11692359521570349358': { error_kind: 'fmtstring', length: 40, item_types: [] },
|
|
203
|
+
'12327971061804302172': { error_kind: 'fmtstring', length: 98, item_types: [] },
|
|
204
|
+
'12469291177396340830': { error_kind: 'string', string: 'call to assert_max_bit_size' },
|
|
205
|
+
'12913276134398371456': { error_kind: 'string', string: 'push out of bounds' },
|
|
206
|
+
'13557316507370296400': {
|
|
207
|
+
error_kind: 'fmtstring',
|
|
208
|
+
length: 130,
|
|
209
|
+
item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
|
|
210
|
+
},
|
|
211
|
+
'14938672389828944159': {
|
|
212
|
+
error_kind: 'fmtstring',
|
|
213
|
+
length: 146,
|
|
214
|
+
item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
|
|
215
|
+
},
|
|
216
|
+
'14990209321349310352': { error_kind: 'string', string: 'attempt to add with overflow' },
|
|
217
|
+
'15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
|
|
218
|
+
'16431471497789672479': { error_kind: 'string', string: 'Index out of bounds' },
|
|
219
|
+
'17531474008201752295': {
|
|
220
|
+
error_kind: 'fmtstring',
|
|
221
|
+
length: 133,
|
|
222
|
+
item_types: [{ kind: 'integer', sign: 'unsigned', width: 32 }],
|
|
223
|
+
},
|
|
224
|
+
'17655676068928457687': { error_kind: 'string', string: 'Reader did not read all data' },
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
bytecode: Buffer.from([]),
|
|
228
|
+
debugSymbols: '',
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
nonDispatchPublicFunctions: [
|
|
232
|
+
{
|
|
233
|
+
functionType: FunctionType.PUBLIC,
|
|
234
|
+
name: 'check_block_number',
|
|
235
|
+
isOnlySelf: false,
|
|
236
|
+
isStatic: true,
|
|
237
|
+
isInitializer: false,
|
|
238
|
+
parameters: [
|
|
239
|
+
{ name: 'operation', type: { kind: 'integer', sign: 'unsigned', width: 8 }, visibility: 'private' },
|
|
240
|
+
{ name: 'value', type: { kind: 'integer', sign: 'unsigned', width: 32 }, visibility: 'private' },
|
|
241
|
+
],
|
|
242
|
+
returnTypes: [],
|
|
243
|
+
errorTypes: {
|
|
244
|
+
'3445904810750103705': { error_kind: 'string', string: 'Block number mismatch.' },
|
|
245
|
+
'7259463707251703666': {
|
|
246
|
+
error_kind: 'string',
|
|
247
|
+
string: 'Function check_block_number can only be called statically',
|
|
248
|
+
},
|
|
249
|
+
'15015303112667403944': { error_kind: 'fmtstring', length: 17, item_types: [] },
|
|
250
|
+
'15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
functionType: FunctionType.PUBLIC,
|
|
255
|
+
name: 'check_timestamp',
|
|
256
|
+
isOnlySelf: false,
|
|
257
|
+
isStatic: true,
|
|
258
|
+
isInitializer: false,
|
|
259
|
+
parameters: [
|
|
260
|
+
{ name: 'operation', type: { kind: 'integer', sign: 'unsigned', width: 8 }, visibility: 'private' },
|
|
261
|
+
{ name: 'value', type: { kind: 'integer', sign: 'unsigned', width: 64 }, visibility: 'private' },
|
|
262
|
+
],
|
|
263
|
+
returnTypes: [],
|
|
264
|
+
errorTypes: {
|
|
265
|
+
'6989792215391248978': {
|
|
266
|
+
error_kind: 'string',
|
|
267
|
+
string: 'Function check_timestamp can only be called statically',
|
|
268
|
+
},
|
|
269
|
+
'13950240626967988787': { error_kind: 'string', string: 'Timestamp mismatch.' },
|
|
270
|
+
'15015303112667403944': { error_kind: 'fmtstring', length: 17, item_types: [] },
|
|
271
|
+
'15764276373176857197': { error_kind: 'string', string: 'Stack too deep' },
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
],
|
|
275
|
+
outputs: { structs: {}, globals: {} },
|
|
276
|
+
storageLayout: {},
|
|
277
|
+
fileMap: {},
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
export class PublicChecksContract extends ContractBase {
|
|
281
|
+
private constructor(wallet: Wallet) {
|
|
282
|
+
super(ProtocolContractAddress.PublicChecks, PublicChecksContractArtifact, wallet);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
public static at(wallet: Wallet): PublicChecksContract {
|
|
286
|
+
return new PublicChecksContract(wallet);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
declare public methods: {
|
|
290
|
+
/** check_block_number(operation: integer, value: integer) */
|
|
291
|
+
check_block_number: ((operation: bigint | number, value: bigint | number) => ContractFunctionInteraction) &
|
|
292
|
+
Pick<ContractMethod, 'selector'>;
|
|
293
|
+
|
|
294
|
+
/** check_timestamp(operation: integer, value: integer) */
|
|
295
|
+
check_timestamp: ((operation: bigint | number, value: bigint | number) => ContractFunctionInteraction) &
|
|
296
|
+
Pick<ContractMethod, 'selector'>;
|
|
297
|
+
|
|
298
|
+
/** process_message(message_ciphertext: struct, message_context: struct) */
|
|
299
|
+
process_message: ((
|
|
300
|
+
message_ciphertext: FieldLike[],
|
|
301
|
+
message_context: {
|
|
302
|
+
tx_hash: FieldLike;
|
|
303
|
+
unique_note_hashes_in_tx: FieldLike[];
|
|
304
|
+
first_nullifier_in_tx: FieldLike;
|
|
305
|
+
recipient: AztecAddressLike;
|
|
306
|
+
},
|
|
307
|
+
) => ContractFunctionInteraction) &
|
|
308
|
+
Pick<ContractMethod, 'selector'>;
|
|
309
|
+
|
|
310
|
+
/** public_dispatch(selector: field) */
|
|
311
|
+
public_dispatch: ((selector: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
|
|
312
|
+
|
|
313
|
+
/** sync_state() */
|
|
314
|
+
sync_state: (() => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
|
|
315
|
+
};
|
|
316
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { retryUntil } from '@aztec/foundation/retry';
|
|
2
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
3
|
+
import type { TxReceipt } from '@aztec/stdlib/tx';
|
|
4
|
+
|
|
5
|
+
import { DefaultWaitOpts } from './wait_opts.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Options for waiting for a transaction to be proven.
|
|
9
|
+
*/
|
|
10
|
+
export type WaitForProvenOpts = {
|
|
11
|
+
/** Time to wait for the tx to be proven before timing out */
|
|
12
|
+
provenTimeout?: number;
|
|
13
|
+
/** Elapsed time between polls to the node */
|
|
14
|
+
interval?: number;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const DefaultWaitForProvenOpts: WaitForProvenOpts = {
|
|
18
|
+
provenTimeout: 600,
|
|
19
|
+
interval: DefaultWaitOpts.interval,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Wait for a transaction to be proven by polling the node
|
|
24
|
+
*/
|
|
25
|
+
export async function waitForProven(node: AztecNode, receipt: TxReceipt, opts?: WaitForProvenOpts) {
|
|
26
|
+
if (!receipt.blockNumber) {
|
|
27
|
+
throw new Error(`Cannot wait for proven: receipt of tx ${receipt.txHash} does not have a block number`);
|
|
28
|
+
}
|
|
29
|
+
return await retryUntil(
|
|
30
|
+
async () => {
|
|
31
|
+
const provenBlock = await node.getProvenBlockNumber();
|
|
32
|
+
return provenBlock >= receipt.blockNumber! ? provenBlock : undefined;
|
|
33
|
+
},
|
|
34
|
+
'isProven',
|
|
35
|
+
opts?.provenTimeout ?? DefaultWaitForProvenOpts.provenTimeout,
|
|
36
|
+
opts?.interval ?? DefaultWaitForProvenOpts.interval,
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { TxStatus } from '@aztec/stdlib/tx';
|
|
2
|
+
|
|
3
|
+
/** Options related to waiting for a tx. */
|
|
4
|
+
export type WaitOpts = {
|
|
5
|
+
/** The amount of time to ignore TxStatus.DROPPED receipts (in seconds) due to the presumption that it is being propagated by the p2p network. Defaults to 5. */
|
|
6
|
+
ignoreDroppedReceiptsFor?: number;
|
|
7
|
+
/** The maximum time (in seconds) to wait for the transaction to be mined. Defaults to 60. */
|
|
8
|
+
timeout?: number;
|
|
9
|
+
/** The time interval (in seconds) between retries to fetch the transaction receipt. Defaults to 1. */
|
|
10
|
+
interval?: number;
|
|
11
|
+
/** Whether to accept a revert as a status code for the tx when waiting for it. If false, will throw if the tx reverts. */
|
|
12
|
+
dontThrowOnRevert?: boolean;
|
|
13
|
+
/** The minimum inclusion status to wait for. If set, waits until the receipt reaches this status or higher. Defaults to CHECKPOINTED. */
|
|
14
|
+
waitForStatus?: TxStatus;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const DefaultWaitOpts: WaitOpts = {
|
|
18
|
+
ignoreDroppedReceiptsFor: 5,
|
|
19
|
+
timeout: 300,
|
|
20
|
+
interval: 1,
|
|
21
|
+
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ARTIFACT_FUNCTION_TREE_MAX_HEIGHT,
|
|
3
|
+
CONTRACT_CLASS_REGISTRY_BYTECODE_CAPSULE_SLOT,
|
|
3
4
|
MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS,
|
|
4
|
-
REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT,
|
|
5
5
|
} from '@aztec/constants';
|
|
6
6
|
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
7
|
-
import { Fr } from '@aztec/foundation/
|
|
7
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
8
8
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
9
9
|
import { type ContractArtifact, FunctionSelector, FunctionType, bufferAsFields } from '@aztec/stdlib/abi';
|
|
10
10
|
import {
|
|
11
11
|
computeVerificationKeyHash,
|
|
12
12
|
createPrivateFunctionMembershipProof,
|
|
13
|
-
|
|
13
|
+
createUtilityFunctionMembershipProof,
|
|
14
14
|
getContractClassFromArtifact,
|
|
15
15
|
} from '@aztec/stdlib/contract';
|
|
16
16
|
import { Capsule } from '@aztec/stdlib/tx';
|
|
17
17
|
|
|
18
18
|
import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
|
|
19
|
-
import {
|
|
19
|
+
import { ContractClassRegistryContract } from '../contract/protocol_contracts/contract-class-registry.js';
|
|
20
20
|
import type { Wallet } from '../wallet/index.js';
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* Sets up a call to broadcast a private function's bytecode via the
|
|
23
|
+
* Sets up a call to broadcast a private function's bytecode via the ClassRegistry contract.
|
|
24
24
|
* Note that this is not required for users to call the function, but is rather a convenience to make
|
|
25
25
|
* this code publicly available so dapps or wallets do not need to redistribute it.
|
|
26
26
|
* @param wallet - Wallet to send the transaction.
|
|
@@ -51,43 +51,43 @@ export async function broadcastPrivateFunction(
|
|
|
51
51
|
artifactTreeLeafIndex,
|
|
52
52
|
artifactMetadataHash,
|
|
53
53
|
functionMetadataHash,
|
|
54
|
-
|
|
54
|
+
utilityFunctionsTreeRoot,
|
|
55
55
|
privateFunctionTreeSiblingPath,
|
|
56
56
|
privateFunctionTreeLeafIndex,
|
|
57
57
|
} = await createPrivateFunctionMembershipProof(selector, artifact);
|
|
58
58
|
|
|
59
59
|
const vkHash = await computeVerificationKeyHash(privateFunctionArtifact);
|
|
60
60
|
|
|
61
|
-
const
|
|
62
|
-
const fn = registerer.methods.broadcast_private_function(
|
|
63
|
-
contractClass.id,
|
|
64
|
-
artifactMetadataHash,
|
|
65
|
-
unconstrainedFunctionsArtifactTreeRoot,
|
|
66
|
-
privateFunctionTreeSiblingPath,
|
|
67
|
-
privateFunctionTreeLeafIndex,
|
|
68
|
-
padArrayEnd(artifactTreeSiblingPath, Fr.ZERO, ARTIFACT_FUNCTION_TREE_MAX_HEIGHT),
|
|
69
|
-
artifactTreeLeafIndex,
|
|
70
|
-
// eslint-disable-next-line camelcase
|
|
71
|
-
{ selector, metadata_hash: functionMetadataHash, vk_hash: vkHash },
|
|
72
|
-
);
|
|
73
|
-
|
|
61
|
+
const classRegistry = ContractClassRegistryContract.at(wallet);
|
|
74
62
|
const bytecode = bufferAsFields(
|
|
75
63
|
privateFunctionArtifact.bytecode,
|
|
76
64
|
MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS,
|
|
77
65
|
);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
66
|
+
return classRegistry.methods
|
|
67
|
+
.broadcast_private_function(
|
|
68
|
+
contractClass.id,
|
|
69
|
+
artifactMetadataHash,
|
|
70
|
+
utilityFunctionsTreeRoot,
|
|
71
|
+
privateFunctionTreeSiblingPath,
|
|
72
|
+
privateFunctionTreeLeafIndex,
|
|
73
|
+
padArrayEnd(artifactTreeSiblingPath, Fr.ZERO, ARTIFACT_FUNCTION_TREE_MAX_HEIGHT),
|
|
74
|
+
artifactTreeLeafIndex,
|
|
75
|
+
// eslint-disable-next-line camelcase
|
|
76
|
+
{ selector, metadata_hash: functionMetadataHash, vk_hash: vkHash },
|
|
77
|
+
)
|
|
78
|
+
.with({
|
|
79
|
+
capsules: [
|
|
80
|
+
new Capsule(
|
|
81
|
+
ProtocolContractAddress.ContractClassRegistry,
|
|
82
|
+
new Fr(CONTRACT_CLASS_REGISTRY_BYTECODE_CAPSULE_SLOT),
|
|
83
|
+
bytecode,
|
|
84
|
+
),
|
|
85
|
+
],
|
|
86
|
+
});
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
|
-
* Sets up a call to broadcast
|
|
90
|
+
* Sets up a call to broadcast a utility function's bytecode via the ClassRegistry contract.
|
|
91
91
|
* Note that this is not required for users to call the function, but is rather a convenience to make
|
|
92
92
|
* this code publicly available so dapps or wallets do not need to redistribute it.
|
|
93
93
|
* @param wallet - Wallet to send the transaction.
|
|
@@ -95,22 +95,22 @@ export async function broadcastPrivateFunction(
|
|
|
95
95
|
* @param selector - Selector of the function to be broadcast.
|
|
96
96
|
* @returns A ContractFunctionInteraction object that can be used to send the transaction.
|
|
97
97
|
*/
|
|
98
|
-
export async function
|
|
98
|
+
export async function broadcastUtilityFunction(
|
|
99
99
|
wallet: Wallet,
|
|
100
100
|
artifact: ContractArtifact,
|
|
101
101
|
selector: FunctionSelector,
|
|
102
102
|
): Promise<ContractFunctionInteraction> {
|
|
103
103
|
const contractClass = await getContractClassFromArtifact(artifact);
|
|
104
|
-
const
|
|
105
|
-
const
|
|
106
|
-
|
|
104
|
+
const utilityFunctions = artifact.functions.filter(fn => fn.functionType === FunctionType.UTILITY);
|
|
105
|
+
const utilityFunctionsAndSelectors = await Promise.all(
|
|
106
|
+
utilityFunctions.map(async fn => ({
|
|
107
107
|
f: fn,
|
|
108
108
|
selector: await FunctionSelector.fromNameAndParameters(fn.name, fn.parameters),
|
|
109
109
|
})),
|
|
110
110
|
);
|
|
111
|
-
const
|
|
112
|
-
if (!
|
|
113
|
-
throw new Error(`
|
|
111
|
+
const utilityFunctionArtifact = utilityFunctionsAndSelectors.find(fn => selector.equals(fn.selector))?.f;
|
|
112
|
+
if (!utilityFunctionArtifact) {
|
|
113
|
+
throw new Error(`Utility function with selector ${selector.toString()} not found`);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
const {
|
|
@@ -119,30 +119,30 @@ export async function broadcastUnconstrainedFunction(
|
|
|
119
119
|
artifactTreeSiblingPath,
|
|
120
120
|
functionMetadataHash,
|
|
121
121
|
privateFunctionsArtifactTreeRoot,
|
|
122
|
-
} = await
|
|
123
|
-
|
|
124
|
-
const registerer = await getRegistererContract(wallet);
|
|
125
|
-
const fn = registerer.methods.broadcast_unconstrained_function(
|
|
126
|
-
contractClass.id,
|
|
127
|
-
artifactMetadataHash,
|
|
128
|
-
privateFunctionsArtifactTreeRoot,
|
|
129
|
-
padArrayEnd(artifactTreeSiblingPath, Fr.ZERO, ARTIFACT_FUNCTION_TREE_MAX_HEIGHT),
|
|
130
|
-
artifactTreeLeafIndex,
|
|
131
|
-
// eslint-disable-next-line camelcase
|
|
132
|
-
{ selector, metadata_hash: functionMetadataHash },
|
|
133
|
-
);
|
|
122
|
+
} = await createUtilityFunctionMembershipProof(selector, artifact);
|
|
134
123
|
|
|
124
|
+
const classRegistry = ContractClassRegistryContract.at(wallet);
|
|
135
125
|
const bytecode = bufferAsFields(
|
|
136
|
-
|
|
126
|
+
utilityFunctionArtifact.bytecode,
|
|
137
127
|
MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS,
|
|
138
128
|
);
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
129
|
+
return classRegistry.methods
|
|
130
|
+
.broadcast_utility_function(
|
|
131
|
+
contractClass.id,
|
|
132
|
+
artifactMetadataHash,
|
|
133
|
+
privateFunctionsArtifactTreeRoot,
|
|
134
|
+
padArrayEnd(artifactTreeSiblingPath, Fr.ZERO, ARTIFACT_FUNCTION_TREE_MAX_HEIGHT),
|
|
135
|
+
artifactTreeLeafIndex,
|
|
136
|
+
// eslint-disable-next-line camelcase
|
|
137
|
+
{ selector, metadata_hash: functionMetadataHash },
|
|
138
|
+
)
|
|
139
|
+
.with({
|
|
140
|
+
capsules: [
|
|
141
|
+
new Capsule(
|
|
142
|
+
ProtocolContractAddress.ContractClassRegistry,
|
|
143
|
+
new Fr(CONTRACT_CLASS_REGISTRY_BYTECODE_CAPSULE_SLOT),
|
|
144
|
+
bytecode,
|
|
145
|
+
),
|
|
146
|
+
],
|
|
147
|
+
});
|
|
148
148
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
2
|
-
import {
|
|
2
|
+
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
3
3
|
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
4
4
|
|
|
5
|
-
import type { Wallet } from '../account/wallet.js';
|
|
6
5
|
import { Contract } from '../contract/contract.js';
|
|
7
6
|
import { DeployMethod } from '../contract/deploy_method.js';
|
|
7
|
+
import type { Wallet } from '../wallet/wallet.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* A class for deploying contract.
|
|
@@ -28,7 +28,8 @@ export class ContractDeployer {
|
|
|
28
28
|
* @returns A DeployMethod instance configured with the ABI, PXE, and constructor arguments.
|
|
29
29
|
*/
|
|
30
30
|
public deploy(...args: any[]) {
|
|
31
|
-
const postDeployCtor = (
|
|
31
|
+
const postDeployCtor = (instance: ContractInstanceWithAddress, wallet: Wallet) =>
|
|
32
|
+
Contract.at(instance.address, this.artifact, wallet);
|
|
32
33
|
return new DeployMethod(
|
|
33
34
|
this.publicKeys ?? PublicKeys.default(),
|
|
34
35
|
this.wallet,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CONTRACT_CLASS_REGISTRY_BYTECODE_CAPSULE_SLOT,
|
|
3
|
+
MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS,
|
|
4
|
+
} from '@aztec/constants';
|
|
5
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
6
|
+
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
7
|
+
import { type ContractArtifact, bufferAsFields } from '@aztec/stdlib/abi';
|
|
8
|
+
import { getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
9
|
+
import { Capsule } from '@aztec/stdlib/tx';
|
|
10
|
+
|
|
11
|
+
import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
|
|
12
|
+
import { ContractClassRegistryContract } from '../contract/protocol_contracts/contract-class-registry.js';
|
|
13
|
+
import type { Wallet } from '../wallet/index.js';
|
|
14
|
+
|
|
15
|
+
/** Sets up a call to publish a contract class given its artifact. */
|
|
16
|
+
export async function publishContractClass(
|
|
17
|
+
wallet: Wallet,
|
|
18
|
+
artifact: ContractArtifact,
|
|
19
|
+
): Promise<ContractFunctionInteraction> {
|
|
20
|
+
const { artifactHash, privateFunctionsRoot, publicBytecodeCommitment, packedBytecode } =
|
|
21
|
+
await getContractClassFromArtifact(artifact);
|
|
22
|
+
const classRegistry = ContractClassRegistryContract.at(wallet);
|
|
23
|
+
|
|
24
|
+
const encodedBytecode = bufferAsFields(packedBytecode, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS);
|
|
25
|
+
return classRegistry.methods.publish(artifactHash, privateFunctionsRoot, publicBytecodeCommitment).with({
|
|
26
|
+
capsules: [
|
|
27
|
+
new Capsule(
|
|
28
|
+
ProtocolContractAddress.ContractClassRegistry,
|
|
29
|
+
new Fr(CONTRACT_CLASS_REGISTRY_BYTECODE_CAPSULE_SLOT),
|
|
30
|
+
encodedBytecode,
|
|
31
|
+
),
|
|
32
|
+
],
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
2
|
+
|
|
3
|
+
import type { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
|
|
4
|
+
import { ContractInstanceRegistryContract } from '../contract/protocol_contracts/contract-instance-registry.js';
|
|
5
|
+
import type { Wallet } from '../wallet/wallet.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Sets up a call to the canonical contract instance registry to publish a contract instance.
|
|
9
|
+
* @param wallet - The wallet to use for the publication (setup) tx.
|
|
10
|
+
* @param instance - The instance to publish.
|
|
11
|
+
*/
|
|
12
|
+
export function publishInstance(wallet: Wallet, instance: ContractInstanceWithAddress): ContractFunctionInteraction {
|
|
13
|
+
const contractInstanceRegistry = ContractInstanceRegistryContract.at(wallet);
|
|
14
|
+
const { salt, currentContractClassId: contractClassId, publicKeys, deployer: instanceDeployer } = instance;
|
|
15
|
+
const isUniversalDeploy = instanceDeployer.isZero();
|
|
16
|
+
return contractInstanceRegistry.methods.publish_for_public_execution(
|
|
17
|
+
salt,
|
|
18
|
+
contractClassId,
|
|
19
|
+
instance.initializationHash,
|
|
20
|
+
publicKeys,
|
|
21
|
+
isUniversalDeploy,
|
|
22
|
+
);
|
|
23
|
+
}
|