@aztec/aztec.js 0.0.0-test.1 → 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
package/dest/utils/authwit.d.ts
CHANGED
|
@@ -1,30 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import type { ChainInfo } from '@aztec/entrypoints/interfaces';
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import { type FunctionCall } from '@aztec/stdlib/abi';
|
|
4
|
+
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
5
5
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
|
+
import type { TxProfileResult, TxReceipt } from '@aztec/stdlib/tx';
|
|
6
7
|
import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/** The chain id to approve */
|
|
10
|
-
chainId: Fr;
|
|
11
|
-
/** The version to approve */
|
|
12
|
-
version: Fr;
|
|
13
|
-
};
|
|
8
|
+
import type { InteractionWaitOptions, ProfileInteractionOptions, SendInteractionOptions, SendInteractionOptionsWithoutWait, SendReturn, SimulateInteractionOptions, SimulationReturn } from '../contract/interaction_options.js';
|
|
9
|
+
import type { Wallet } from '../wallet/index.js';
|
|
14
10
|
/** Intent with an inner hash */
|
|
15
11
|
export type IntentInnerHash = {
|
|
16
12
|
/** The consumer */
|
|
17
13
|
consumer: AztecAddress;
|
|
18
14
|
/** The action to approve */
|
|
19
|
-
innerHash:
|
|
15
|
+
innerHash: Fr;
|
|
16
|
+
};
|
|
17
|
+
/** Intent with a call */
|
|
18
|
+
export type CallIntent = {
|
|
19
|
+
/** The caller to approve */
|
|
20
|
+
caller: AztecAddress;
|
|
21
|
+
/** The call to approve */
|
|
22
|
+
call: FunctionCall;
|
|
20
23
|
};
|
|
21
|
-
/** Intent with
|
|
22
|
-
export type
|
|
24
|
+
/** Intent with a ContractFunctionInteraction */
|
|
25
|
+
export type ContractFunctionInteractionCallIntent = {
|
|
23
26
|
/** The caller to approve */
|
|
24
27
|
caller: AztecAddress;
|
|
25
28
|
/** The action to approve */
|
|
26
|
-
action: ContractFunctionInteraction
|
|
29
|
+
action: ContractFunctionInteraction;
|
|
27
30
|
};
|
|
31
|
+
/** Identifies ContractFunctionInteractionCallIntents */
|
|
32
|
+
export declare function isContractFunctionInteractionCallIntent(messageHashOrIntent: Fr | IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent): messageHashOrIntent is ContractFunctionInteractionCallIntent;
|
|
28
33
|
/**
|
|
29
34
|
* Compute an authentication witness message hash from an intent and metadata
|
|
30
35
|
*
|
|
@@ -35,7 +40,7 @@ export type IntentAction = {
|
|
|
35
40
|
* and use it for the authentication check.
|
|
36
41
|
* Therefore, any allowed `innerHash` will therefore also have information around where it can be spent (version, chainId) and who can spend it (consumer).
|
|
37
42
|
*
|
|
38
|
-
* If using the `
|
|
43
|
+
* If using the `CallIntent`, the caller is the address that is making the call, for a token approval from Alice to Bob, this would be Bob.
|
|
39
44
|
* The action is then used along with the `caller` to compute the `innerHash` and the consumer.
|
|
40
45
|
*
|
|
41
46
|
*
|
|
@@ -46,15 +51,69 @@ export type IntentAction = {
|
|
|
46
51
|
* @param metadata - The metadata for the intent (chainId, version)
|
|
47
52
|
* @returns The message hash for the action
|
|
48
53
|
*/
|
|
49
|
-
export declare const computeAuthWitMessageHash: (intent:
|
|
50
|
-
|
|
54
|
+
export declare const computeAuthWitMessageHash: (intent: CallIntent | ContractFunctionInteractionCallIntent | IntentInnerHash, metadata: ChainInfo) => Promise<Fr>;
|
|
55
|
+
/**
|
|
56
|
+
* Compute an authentication witness message hash from an intent and metadata. This is just
|
|
57
|
+
* a wrapper around computeAuthwitMessageHash that allows receiving an already computed messageHash as input
|
|
58
|
+
* @param messageHashOrIntent - The precomputed messageHash or intent to approve (consumer and innerHash or caller and call/action)
|
|
59
|
+
* @param metadata - The metadata for the intent (chainId, version)
|
|
60
|
+
* @returns The message hash for the intent
|
|
61
|
+
*/
|
|
62
|
+
export declare function getMessageHashFromIntent(messageHashOrIntent: Fr | IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent, chainInfo: ChainInfo): Promise<Fr>;
|
|
63
|
+
/**
|
|
64
|
+
* Computes the inner authwitness hash for either a function call or an action, for it to later be combined with the metadata
|
|
65
|
+
* required for the outer hash and eventually the full AuthWitness.
|
|
66
|
+
* @param caller - Who is going to be calling the function
|
|
67
|
+
* @param action - The action to compute the inner hash from
|
|
68
|
+
* @returns The inner hash for the action
|
|
69
|
+
**/
|
|
70
|
+
export declare const computeInnerAuthWitHashFromAction: (caller: AztecAddress, action: ContractFunctionInteraction | FunctionCall) => Promise<Fr>;
|
|
71
|
+
/**
|
|
72
|
+
* Lookup the validity of an authwit in private and public contexts.
|
|
73
|
+
*
|
|
74
|
+
* Uses the chain id and version of the wallet.
|
|
75
|
+
*
|
|
76
|
+
* @param wallet - The wallet use to simulate and read the public data
|
|
77
|
+
* @param onBehalfOf - The address of the "approver"
|
|
78
|
+
* @param intent - The consumer and inner hash or the caller and action to lookup
|
|
79
|
+
* @param witness - The computed authentication witness to check
|
|
80
|
+
* @returns - A struct containing the validity of the authwit in private and public contexts.
|
|
81
|
+
*/
|
|
82
|
+
export declare function lookupValidity(wallet: Wallet, onBehalfOf: AztecAddress, intent: IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent, witness: AuthWitness): Promise<{
|
|
83
|
+
/** boolean flag indicating if the authwit is valid in private context */
|
|
84
|
+
isValidInPrivate: boolean;
|
|
85
|
+
/** boolean flag indicating if the authwit is valid in public context */
|
|
86
|
+
isValidInPublic: boolean;
|
|
87
|
+
}>;
|
|
51
88
|
/**
|
|
52
|
-
*
|
|
53
|
-
* This is the "intent" of the message, before siloed with the consumer.
|
|
54
|
-
* It is used as part of the `computeAuthWitMessageHash` but can also be used
|
|
55
|
-
* in case the message is not a "call" to a function, but arbitrary data.
|
|
56
|
-
* @param args - The arguments to hash
|
|
57
|
-
* @returns The inner hash for the witness
|
|
89
|
+
* Convenience class designed to wrap the very common interaction of setting a public authwit in the AuthRegistry contract
|
|
58
90
|
*/
|
|
59
|
-
export declare
|
|
60
|
-
|
|
91
|
+
export declare class SetPublicAuthwitContractInteraction extends ContractFunctionInteraction {
|
|
92
|
+
private from;
|
|
93
|
+
private constructor();
|
|
94
|
+
static create(wallet: Wallet, from: AztecAddress, messageHashOrIntent: Fr | IntentInnerHash | CallIntent | ContractFunctionInteractionCallIntent, authorized: boolean): Promise<SetPublicAuthwitContractInteraction>;
|
|
95
|
+
/**
|
|
96
|
+
* Overrides the simulate method, adding the sender of the authwit (authorizer) as from
|
|
97
|
+
* and preventing misuse
|
|
98
|
+
* @param options - An optional object containing additional configuration for the transaction.
|
|
99
|
+
* @returns The result of the transaction as returned by the contract function.
|
|
100
|
+
*/
|
|
101
|
+
simulate<T extends SimulateInteractionOptions>(options: Omit<T, 'from'>): Promise<SimulationReturn<T['includeMetadata']>>;
|
|
102
|
+
/**
|
|
103
|
+
* Overrides the profile method, adding the sender of the authwit (authorizer) as from
|
|
104
|
+
* and preventing misuse
|
|
105
|
+
* @param options - Same options as `simulate`, plus profiling method
|
|
106
|
+
* @returns An object containing the function return value and profile result.
|
|
107
|
+
*/
|
|
108
|
+
profile(options?: Omit<ProfileInteractionOptions, 'from'>): Promise<TxProfileResult>;
|
|
109
|
+
/**
|
|
110
|
+
* Overrides the send method, adding the sender of the authwit (authorizer) as from
|
|
111
|
+
* and preventing misuse
|
|
112
|
+
* @param options - An optional object containing 'fee' options information
|
|
113
|
+
* @returns A TxReceipt (if wait is true/undefined) or TxHash (if wait is false)
|
|
114
|
+
*/
|
|
115
|
+
send(options?: Omit<SendInteractionOptionsWithoutWait, 'from'>): Promise<TxReceipt>;
|
|
116
|
+
send<W extends InteractionWaitOptions>(options?: Omit<SendInteractionOptions<W>, 'from'>): Promise<SendReturn<W>>;
|
|
117
|
+
private static getSetAuthorizedAbi;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aHdpdC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWxzL2F1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file":"authwit.d.ts","sourceRoot":"","sources":["../../src/utils/authwit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"authwit.d.ts","sourceRoot":"","sources":["../../src/utils/authwit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAEpD,OAAO,EAAiD,KAAK,YAAY,EAAgB,MAAM,mBAAmB,CAAC;AACnH,OAAO,EAAE,WAAW,EAAoD,MAAM,4BAA4B,CAAC;AAC3G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAU,eAAe,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,KAAK,EACV,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,iCAAiC,EACjC,UAAU,EACV,0BAA0B,EAC1B,gBAAgB,EACjB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,gCAAgC;AAChC,MAAM,MAAM,eAAe,GAAG;IAC5B,qBAAqB;IACrB,QAAQ,EAAE,YAAY,CAAC;IACvB,4BAA4B;IAC5B,SAAS,EAAE,EAAE,CAAC;CACf,CAAC;AAEF,yBAAyB;AACzB,MAAM,MAAM,UAAU,GAAG;IACvB,6BAA6B;IAC7B,MAAM,EAAE,YAAY,CAAC;IACrB,0BAA0B;IAC1B,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC;AAEF,gDAAgD;AAChD,MAAM,MAAM,qCAAqC,GAAG;IAClD,6BAA6B;IAC7B,MAAM,EAAE,YAAY,CAAC;IACrB,4BAA4B;IAC5B,MAAM,EAAE,2BAA2B,CAAC;CACrC,CAAC;AAEF,wDAAwD;AACxD,wBAAgB,uCAAu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E1B;IAED;;;;;OAKG;IAEa,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,iCAAiC,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAGpF,IAAI,CAAC,CAAC,SAAS,sBAAsB,EACnD,OAAO,CAAC,EAAE,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,GAChD,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAQ1B,OAAO,CAAC,MAAM,CAAC,mBAAmB;CAuBnC"}
|
package/dest/utils/authwit.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
3
|
+
import { FunctionType } from '@aztec/stdlib/abi';
|
|
4
|
+
import { computeInnerAuthWitHash, computeOuterAuthWitHash } from '@aztec/stdlib/auth-witness';
|
|
5
|
+
import { computeVarArgsHash } from '@aztec/stdlib/hash';
|
|
5
6
|
import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
|
|
6
|
-
|
|
7
|
+
/** Identifies ContractFunctionInteractionCallIntents */ export function isContractFunctionInteractionCallIntent(messageHashOrIntent) {
|
|
8
|
+
return 'caller' in messageHashOrIntent && 'action' in messageHashOrIntent && messageHashOrIntent.action instanceof ContractFunctionInteraction;
|
|
9
|
+
}
|
|
7
10
|
/**
|
|
8
11
|
* Compute an authentication witness message hash from an intent and metadata
|
|
9
12
|
*
|
|
@@ -14,7 +17,7 @@ import { ContractFunctionInteraction } from '../contract/contract_function_inter
|
|
|
14
17
|
* and use it for the authentication check.
|
|
15
18
|
* Therefore, any allowed `innerHash` will therefore also have information around where it can be spent (version, chainId) and who can spend it (consumer).
|
|
16
19
|
*
|
|
17
|
-
* If using the `
|
|
20
|
+
* If using the `CallIntent`, the caller is the address that is making the call, for a token approval from Alice to Bob, this would be Bob.
|
|
18
21
|
* The action is then used along with the `caller` to compute the `innerHash` and the consumer.
|
|
19
22
|
*
|
|
20
23
|
*
|
|
@@ -28,47 +31,237 @@ import { ContractFunctionInteraction } from '../contract/contract_function_inter
|
|
|
28
31
|
const chainId = metadata.chainId;
|
|
29
32
|
const version = metadata.version;
|
|
30
33
|
if ('caller' in intent) {
|
|
31
|
-
const
|
|
32
|
-
return computeOuterAuthWitHash(
|
|
34
|
+
const call = isContractFunctionInteractionCallIntent(intent) ? await intent.action.getFunctionCall() : intent.call;
|
|
35
|
+
return computeOuterAuthWitHash(call.to, chainId, version, await computeInnerAuthWitHashFromAction(intent.caller, call));
|
|
33
36
|
} else {
|
|
34
37
|
const inner = Buffer.isBuffer(intent.innerHash) ? Fr.fromBuffer(intent.innerHash) : intent.innerHash;
|
|
35
38
|
return computeOuterAuthWitHash(intent.consumer, chainId, version, inner);
|
|
36
39
|
}
|
|
37
40
|
};
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Compute an authentication witness message hash from an intent and metadata. This is just
|
|
43
|
+
* a wrapper around computeAuthwitMessageHash that allows receiving an already computed messageHash as input
|
|
44
|
+
* @param messageHashOrIntent - The precomputed messageHash or intent to approve (consumer and innerHash or caller and call/action)
|
|
45
|
+
* @param metadata - The metadata for the intent (chainId, version)
|
|
46
|
+
* @returns The message hash for the intent
|
|
47
|
+
*/ export async function getMessageHashFromIntent(messageHashOrIntent, chainInfo) {
|
|
48
|
+
let messageHash;
|
|
49
|
+
const { chainId, version } = chainInfo;
|
|
50
|
+
if (messageHashOrIntent instanceof Fr) {
|
|
51
|
+
messageHash = messageHashOrIntent;
|
|
52
|
+
} else {
|
|
53
|
+
messageHash = await computeAuthWitMessageHash(messageHashOrIntent, {
|
|
54
|
+
chainId,
|
|
55
|
+
version
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return messageHash;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Computes the inner authwitness hash for either a function call or an action, for it to later be combined with the metadata
|
|
62
|
+
* required for the outer hash and eventually the full AuthWitness.
|
|
63
|
+
* @param caller - Who is going to be calling the function
|
|
64
|
+
* @param action - The action to compute the inner hash from
|
|
65
|
+
* @returns The inner hash for the action
|
|
66
|
+
**/ export const computeInnerAuthWitHashFromAction = async (caller, action)=>{
|
|
67
|
+
const call = action instanceof ContractFunctionInteraction ? await action.getFunctionCall() : action;
|
|
68
|
+
return computeInnerAuthWitHash([
|
|
40
69
|
caller.toField(),
|
|
41
|
-
|
|
42
|
-
|
|
70
|
+
call.selector.toField(),
|
|
71
|
+
await computeVarArgsHash(call.args)
|
|
43
72
|
]);
|
|
44
|
-
/**
|
|
45
|
-
* Compute the inner hash for an authentication witness.
|
|
46
|
-
* This is the "intent" of the message, before siloed with the consumer.
|
|
47
|
-
* It is used as part of the `computeAuthWitMessageHash` but can also be used
|
|
48
|
-
* in case the message is not a "call" to a function, but arbitrary data.
|
|
49
|
-
* @param args - The arguments to hash
|
|
50
|
-
* @returns The inner hash for the witness
|
|
51
|
-
*/ export const computeInnerAuthWitHash = (args)=>{
|
|
52
|
-
return poseidon2HashWithSeparator(args, GeneratorIndex.AUTHWIT_INNER);
|
|
53
73
|
};
|
|
54
74
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* @param
|
|
63
|
-
* @
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
consumer.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
* Lookup the validity of an authwit in private and public contexts.
|
|
76
|
+
*
|
|
77
|
+
* Uses the chain id and version of the wallet.
|
|
78
|
+
*
|
|
79
|
+
* @param wallet - The wallet use to simulate and read the public data
|
|
80
|
+
* @param onBehalfOf - The address of the "approver"
|
|
81
|
+
* @param intent - The consumer and inner hash or the caller and action to lookup
|
|
82
|
+
* @param witness - The computed authentication witness to check
|
|
83
|
+
* @returns - A struct containing the validity of the authwit in private and public contexts.
|
|
84
|
+
*/ export async function lookupValidity(wallet, onBehalfOf, intent, witness) {
|
|
85
|
+
let innerHash, consumer;
|
|
86
|
+
if ('caller' in intent) {
|
|
87
|
+
const call = isContractFunctionInteractionCallIntent(intent) ? await intent.action.getFunctionCall() : intent.call;
|
|
88
|
+
innerHash = await computeInnerAuthWitHashFromAction(intent.caller, call);
|
|
89
|
+
consumer = call.to;
|
|
90
|
+
} else {
|
|
91
|
+
({ innerHash, consumer } = intent);
|
|
92
|
+
}
|
|
93
|
+
const chainInfo = await wallet.getChainInfo();
|
|
94
|
+
const messageHash = await getMessageHashFromIntent(intent, chainInfo);
|
|
95
|
+
const results = {
|
|
96
|
+
isValidInPrivate: false,
|
|
97
|
+
isValidInPublic: false
|
|
98
|
+
};
|
|
99
|
+
// Check private
|
|
100
|
+
const lookupValidityAbi = {
|
|
101
|
+
name: 'lookup_validity',
|
|
102
|
+
isInitializer: false,
|
|
103
|
+
functionType: FunctionType.UTILITY,
|
|
104
|
+
isOnlySelf: false,
|
|
105
|
+
isStatic: false,
|
|
106
|
+
parameters: [
|
|
107
|
+
{
|
|
108
|
+
name: 'consumer',
|
|
109
|
+
type: {
|
|
110
|
+
fields: [
|
|
111
|
+
{
|
|
112
|
+
name: 'inner',
|
|
113
|
+
type: {
|
|
114
|
+
kind: 'field'
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
kind: 'struct',
|
|
119
|
+
path: 'aztec::protocol_types::address::aztec_address::AztecAddress'
|
|
120
|
+
},
|
|
121
|
+
visibility: 'private'
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: 'inner_hash',
|
|
125
|
+
type: {
|
|
126
|
+
kind: 'field'
|
|
127
|
+
},
|
|
128
|
+
visibility: 'private'
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
returnTypes: [
|
|
132
|
+
{
|
|
133
|
+
kind: 'boolean'
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
errorTypes: {}
|
|
137
|
+
};
|
|
138
|
+
try {
|
|
139
|
+
results.isValidInPrivate = await new ContractFunctionInteraction(wallet, onBehalfOf, lookupValidityAbi, [
|
|
140
|
+
consumer,
|
|
141
|
+
innerHash
|
|
142
|
+
]).simulate({
|
|
143
|
+
from: onBehalfOf,
|
|
144
|
+
authWitnesses: [
|
|
145
|
+
witness
|
|
146
|
+
]
|
|
147
|
+
});
|
|
148
|
+
// TODO: Narrow down the error to make sure simulation failed due to an invalid authwit
|
|
149
|
+
// eslint-disable-next-line no-empty
|
|
150
|
+
} catch {}
|
|
151
|
+
// check public
|
|
152
|
+
const isConsumableAbi = {
|
|
153
|
+
name: 'utility_is_consumable',
|
|
154
|
+
isInitializer: false,
|
|
155
|
+
functionType: FunctionType.UTILITY,
|
|
156
|
+
isOnlySelf: false,
|
|
157
|
+
isStatic: false,
|
|
158
|
+
parameters: [
|
|
159
|
+
{
|
|
160
|
+
name: 'address',
|
|
161
|
+
type: {
|
|
162
|
+
fields: [
|
|
163
|
+
{
|
|
164
|
+
name: 'inner',
|
|
165
|
+
type: {
|
|
166
|
+
kind: 'field'
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
kind: 'struct',
|
|
171
|
+
path: 'authwit::aztec::protocol_types::address::aztec_address::AztecAddress'
|
|
172
|
+
},
|
|
173
|
+
visibility: 'private'
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: 'message_hash',
|
|
177
|
+
type: {
|
|
178
|
+
kind: 'field'
|
|
179
|
+
},
|
|
180
|
+
visibility: 'private'
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
returnTypes: [
|
|
184
|
+
{
|
|
185
|
+
kind: 'boolean'
|
|
186
|
+
}
|
|
187
|
+
],
|
|
188
|
+
errorTypes: {}
|
|
189
|
+
};
|
|
190
|
+
results.isValidInPublic = await new ContractFunctionInteraction(wallet, ProtocolContractAddress.AuthRegistry, isConsumableAbi, [
|
|
191
|
+
onBehalfOf,
|
|
192
|
+
messageHash
|
|
193
|
+
]).simulate({
|
|
194
|
+
from: onBehalfOf
|
|
195
|
+
});
|
|
196
|
+
return results;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Convenience class designed to wrap the very common interaction of setting a public authwit in the AuthRegistry contract
|
|
200
|
+
*/ export class SetPublicAuthwitContractInteraction extends ContractFunctionInteraction {
|
|
201
|
+
from;
|
|
202
|
+
constructor(wallet, from, messageHash, authorized){
|
|
203
|
+
super(wallet, ProtocolContractAddress.AuthRegistry, SetPublicAuthwitContractInteraction.getSetAuthorizedAbi(), [
|
|
204
|
+
messageHash,
|
|
205
|
+
authorized
|
|
206
|
+
]), this.from = from;
|
|
207
|
+
}
|
|
208
|
+
static async create(wallet, from, messageHashOrIntent, authorized) {
|
|
209
|
+
const chainInfo = await wallet.getChainInfo();
|
|
210
|
+
const messageHash = await getMessageHashFromIntent(messageHashOrIntent, chainInfo);
|
|
211
|
+
return new SetPublicAuthwitContractInteraction(wallet, from, messageHash, authorized);
|
|
212
|
+
}
|
|
213
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
214
|
+
simulate(options = {}) {
|
|
215
|
+
return super.simulate({
|
|
216
|
+
...options,
|
|
217
|
+
from: this.from
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Overrides the profile method, adding the sender of the authwit (authorizer) as from
|
|
222
|
+
* and preventing misuse
|
|
223
|
+
* @param options - Same options as `simulate`, plus profiling method
|
|
224
|
+
* @returns An object containing the function return value and profile result.
|
|
225
|
+
*/ profile(options = {
|
|
226
|
+
profileMode: 'gates'
|
|
227
|
+
}) {
|
|
228
|
+
return super.profile({
|
|
229
|
+
...options,
|
|
230
|
+
from: this.from
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
234
|
+
send(options) {
|
|
235
|
+
return super.send({
|
|
236
|
+
...options,
|
|
237
|
+
from: this.from
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
static getSetAuthorizedAbi() {
|
|
241
|
+
return {
|
|
242
|
+
name: 'set_authorized',
|
|
243
|
+
isInitializer: false,
|
|
244
|
+
functionType: FunctionType.PUBLIC,
|
|
245
|
+
isOnlySelf: true,
|
|
246
|
+
isStatic: false,
|
|
247
|
+
parameters: [
|
|
248
|
+
{
|
|
249
|
+
name: 'message_hash',
|
|
250
|
+
type: {
|
|
251
|
+
kind: 'field'
|
|
252
|
+
},
|
|
253
|
+
visibility: 'private'
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
name: 'authorize',
|
|
257
|
+
type: {
|
|
258
|
+
kind: 'boolean'
|
|
259
|
+
},
|
|
260
|
+
visibility: 'private'
|
|
261
|
+
}
|
|
262
|
+
],
|
|
263
|
+
returnTypes: [],
|
|
264
|
+
errorTypes: {}
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
3
|
+
/**
|
|
4
|
+
* Waits for the L1 to L2 message to be ready to be consumed.
|
|
5
|
+
* @param node - Aztec node instance used to obtain the information about the message
|
|
6
|
+
* @param l1ToL2MessageHash - Hash of the L1 to L2 message
|
|
7
|
+
* @param opts - Options
|
|
8
|
+
*/
|
|
9
|
+
export declare function waitForL1ToL2MessageReady(node: Pick<AztecNode, 'getBlockNumber' | 'getL1ToL2MessageBlock'>, l1ToL2MessageHash: Fr, opts: {
|
|
10
|
+
/** Timeout for the operation in seconds */ timeoutSeconds: number;
|
|
11
|
+
/** True if the message is meant to be consumed from a public function */ forPublicConsumption: boolean;
|
|
12
|
+
}): Promise<boolean>;
|
|
13
|
+
/**
|
|
14
|
+
* Returns whether the L1 to L2 message is ready to be consumed.
|
|
15
|
+
* @param node - Aztec node instance used to obtain the information about the message
|
|
16
|
+
* @param l1ToL2MessageHash - Hash of the L1 to L2 message
|
|
17
|
+
* @param opts - Options
|
|
18
|
+
* @returns True if the message is ready to be consumed, false otherwise
|
|
19
|
+
*/
|
|
20
|
+
export declare function isL1ToL2MessageReady(node: Pick<AztecNode, 'getBlockNumber' | 'getL1ToL2MessageBlock'>, l1ToL2MessageHash: Fr, opts: {
|
|
21
|
+
/** True if the message is meant to be consumed from a public function */ forPublicConsumption: boolean;
|
|
22
|
+
/** Cached synced block number for the message (will be fetched from PXE otherwise) */ messageBlockNumber?: number;
|
|
23
|
+
}): Promise<boolean>;
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3Jvc3NfY2hhaW4uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9jcm9zc19jaGFpbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUV6RCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUVqRTs7Ozs7R0FLRztBQUNILHdCQUFzQix5QkFBeUIsQ0FDN0MsSUFBSSxFQUFFLElBQUksQ0FBQyxTQUFTLEVBQUUsZ0JBQWdCLEdBQUcsdUJBQXVCLENBQUMsRUFDakUsaUJBQWlCLEVBQUUsRUFBRSxFQUNyQixJQUFJLEVBQUU7SUFDSiwyQ0FBMkMsQ0FBQyxjQUFjLEVBQUUsTUFBTSxDQUFDO0lBQ25FLHlFQUF5RSxDQUFDLG9CQUFvQixFQUFFLE9BQU8sQ0FBQztDQ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
1
|
+
import { retryUntil } from '@aztec/foundation/retry';
|
|
2
|
+
/**
|
|
3
|
+
* Waits for the L1 to L2 message to be ready to be consumed.
|
|
4
|
+
* @param node - Aztec node instance used to obtain the information about the message
|
|
5
|
+
* @param l1ToL2MessageHash - Hash of the L1 to L2 message
|
|
6
|
+
* @param opts - Options
|
|
7
|
+
*/ export async function waitForL1ToL2MessageReady(node, l1ToL2MessageHash, opts) {
|
|
8
|
+
const messageBlockNumber = await node.getL1ToL2MessageBlock(l1ToL2MessageHash);
|
|
9
|
+
return retryUntil(()=>isL1ToL2MessageReady(node, l1ToL2MessageHash, {
|
|
10
|
+
...opts,
|
|
11
|
+
messageBlockNumber
|
|
12
|
+
}), `L1 to L2 message ${l1ToL2MessageHash.toString()} ready`, opts.timeoutSeconds, 1);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Returns whether the L1 to L2 message is ready to be consumed.
|
|
16
|
+
* @param node - Aztec node instance used to obtain the information about the message
|
|
17
|
+
* @param l1ToL2MessageHash - Hash of the L1 to L2 message
|
|
18
|
+
* @param opts - Options
|
|
19
|
+
* @returns True if the message is ready to be consumed, false otherwise
|
|
20
|
+
*/ export async function isL1ToL2MessageReady(node, l1ToL2MessageHash, opts) {
|
|
21
|
+
const blockNumber = await node.getBlockNumber();
|
|
22
|
+
const messageBlockNumber = opts.messageBlockNumber ?? await node.getL1ToL2MessageBlock(l1ToL2MessageHash);
|
|
23
|
+
if (messageBlockNumber === undefined) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
// Note that public messages can be consumed 1 block earlier, since the sequencer will include the messages
|
|
27
|
+
// in the L1 to L2 message tree before executing the txs for the block. In private, however, we need to wait
|
|
28
|
+
// until the message is included so we can make use of the membership witness.
|
|
29
|
+
return opts.forPublicConsumption ? blockNumber + 1 >= messageBlockNumber : blockNumber >= messageBlockNumber;
|
|
30
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
3
3
|
/**
|
|
4
4
|
* Returns the owner's fee juice balance.
|
|
5
|
+
* Note: This is used only e2e_local_network_example test. TODO: Consider nuking.
|
|
5
6
|
*/
|
|
6
|
-
export declare function getFeeJuiceBalance(owner: AztecAddress,
|
|
7
|
-
//# sourceMappingURL=
|
|
7
|
+
export declare function getFeeJuiceBalance(owner: AztecAddress, node: AztecNode): Promise<bigint>;
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmVlX2p1aWNlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvZmVlX2p1aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBRWhFLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBRWpFOzs7R0FHRztBQUNILHdCQUFzQixrQkFBa0IsQ0FBQyxLQUFLLEVBQUUsWUFBWSxFQUFFLElBQUksRUFBRSxTQUFTLEdBQUcsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUc5RiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fee_juice.d.ts","sourceRoot":"","sources":["../../src/utils/fee_juice.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"fee_juice.d.ts","sourceRoot":"","sources":["../../src/utils/fee_juice.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAG9F"}
|
package/dest/utils/fee_juice.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
3
3
|
import { deriveStorageSlotInMap } from '@aztec/stdlib/hash';
|
|
4
4
|
/**
|
|
5
5
|
* Returns the owner's fee juice balance.
|
|
6
|
-
|
|
6
|
+
* Note: This is used only e2e_local_network_example test. TODO: Consider nuking.
|
|
7
|
+
*/ export async function getFeeJuiceBalance(owner, node) {
|
|
7
8
|
const slot = await deriveStorageSlotInMap(new Fr(1), owner);
|
|
8
|
-
return (await
|
|
9
|
+
return (await node.getPublicStorageAt('latest', ProtocolContractAddress.FeeJuice, slot)).toBigInt();
|
|
9
10
|
}
|
|
@@ -14,4 +14,4 @@ interface NoirFieldCompressedString {
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const readFieldCompressedString: (field: NoirFieldCompressedString) => string;
|
|
16
16
|
export {};
|
|
17
|
-
//# sourceMappingURL=
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmllbGRfY29tcHJlc3NlZF9zdHJpbmcuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9maWVsZF9jb21wcmVzc2VkX3N0cmluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQTs7R0FFRztBQUNILFVBQVUseUJBQXlCO0lBQ2pDOztPQUVHO0lBQ0gsS0FBSyxFQUFFLE1BQU0sQ0FBQztDQUNmO0FBQ0Q7Ozs7R0FJRztBQUNILGVBQU8sTUFBTSx5QkFBeUIsOENBVXJDLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field_compressed_string.d.ts","sourceRoot":"","sources":["../../src/utils/field_compressed_string.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,UAAU,yBAAyB;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AACD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,
|
|
1
|
+
{"version":3,"file":"field_compressed_string.d.ts","sourceRoot":"","sources":["../../src/utils/field_compressed_string.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,UAAU,yBAAyB;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AACD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,8CAUrC,CAAC"}
|
package/dest/utils/node.d.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import type { Logger } from '@aztec/foundation/log';
|
|
2
2
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
3
|
-
|
|
3
|
+
import type { TxHash, TxReceipt } from '@aztec/stdlib/tx';
|
|
4
|
+
import { type WaitOpts } from '../contract/wait_opts.js';
|
|
5
|
+
export declare const waitForNode: (node: AztecNode, logger?: Logger | undefined) => Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* Waits for a transaction to be mined and returns its receipt.
|
|
8
|
+
* @param node - The Aztec node to query for transaction status
|
|
9
|
+
* @param txHash - The hash of the transaction to wait for
|
|
10
|
+
* @param opts - Optional configuration for waiting behavior
|
|
11
|
+
* @returns The transaction receipt
|
|
12
|
+
* @throws If the transaction fails and dontThrowOnRevert is not set
|
|
13
|
+
*/
|
|
14
|
+
export declare function waitForTx(node: AztecNode, txHash: TxHash, opts?: WaitOpts): Promise<TxReceipt>;
|
|
4
15
|
export { createAztecNodeClient, type AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
5
|
-
//# sourceMappingURL=
|
|
16
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWxzL25vZGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFFcEQsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDakUsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLFNBQVMsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBRzFELE9BQU8sRUFBbUIsS0FBSyxRQUFRLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUUxRSxlQUFPLE1BQU0sV0FBVyxpRUFZdkIsQ0FBQztBQU9GOzs7Ozs7O0dBT0c7QUFDSCx3QkFBc0IsU0FBUyxDQUFDLElBQUksRUFBRSxTQUFTLEVBQUUsTUFBTSxFQUFFLE1BQU0sRUFBRSxJQUFJLENBQUMsRUFBRSxRQUFRLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQTJDcEc7QUFFRCxPQUFPLEVBQUUscUJBQXFCLEVBQUUsS0FBSyxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQyJ9
|
package/dest/utils/node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/utils/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/utils/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG1D,OAAO,EAAmB,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAE1E,eAAO,MAAM,WAAW,iEAYvB,CAAC;AAOF;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CA2CpG;AAED,OAAO,EAAE,qBAAqB,EAAE,KAAK,SAAS,EAAE,MAAM,iCAAiC,CAAC"}
|