@aztec/aztec.js 0.0.0-test.1 → 0.0.1-commit.0b941701
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 +4 -2
- package/dest/api/wallet.d.ts.map +1 -1
- package/dest/api/wallet.js +3 -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 +36 -0
- package/dest/contract/protocol_contracts/auth-registry.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/auth-registry.js +963 -0
- package/dest/contract/protocol_contracts/contract-class-registry.d.ts +35 -0
- package/dest/contract/protocol_contracts/contract-class-registry.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/contract-class-registry.js +784 -0
- package/dest/contract/protocol_contracts/contract-instance-registry.d.ts +31 -0
- package/dest/contract/protocol_contracts/contract-instance-registry.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/contract-instance-registry.js +858 -0
- package/dest/contract/protocol_contracts/fee-juice.d.ts +30 -0
- package/dest/contract/protocol_contracts/fee-juice.d.ts.map +1 -0
- package/dest/contract/protocol_contracts/fee-juice.js +827 -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 +563 -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 +579 -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/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 +3 -17
- package/dest/wallet/index.d.ts.map +1 -1
- package/dest/wallet/index.js +2 -20
- package/dest/wallet/wallet.d.ts +1297 -0
- package/dest/wallet/wallet.d.ts.map +1 -0
- package/dest/wallet/wallet.js +172 -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 +34 -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 +545 -0
- package/src/contract/protocol_contracts/contract-class-registry.ts +433 -0
- package/src/contract/protocol_contracts/contract-instance-registry.ts +493 -0
- package/src/contract/protocol_contracts/fee-juice.ts +457 -0
- package/src/contract/protocol_contracts/multi-call-entrypoint.ts +329 -0
- package/src/contract/protocol_contracts/public-checks.ts +315 -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/deploy_account_method.ts +150 -0
- package/src/wallet/index.ts +2 -33
- package/src/wallet/wallet.ts +417 -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 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAA6B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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQhC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG/B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAMpC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;EAIxC,CAAC;AAEH,eAAO,MAAM,kBAAkB,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAK7C,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;EAMnC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMjC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;EAGtC,CAAC;AA2EH,QAAA,MAAe,mBAAmB;;;;;;;;;;;;;;;;;;QAAU,mBAAmB;;;;;;;;;;;;;;;;;;MAA4C,CAAC;AAE5G,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC;AAEpD,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,MAAM,CAI7C,CAAC"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { BlockNumberPositiveSchema } from '@aztec/foundation/branded-types';
|
|
2
|
+
import { AbiTypeSchema, ContractArtifactSchema, FunctionType } from '@aztec/stdlib/abi';
|
|
3
|
+
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
4
|
+
import { ContractInstanceWithAddressSchema } from '@aztec/stdlib/contract';
|
|
5
|
+
import { Gas } from '@aztec/stdlib/gas';
|
|
6
|
+
import { AbiDecodedSchema, optional, schemas, zodFor } from '@aztec/stdlib/schemas';
|
|
7
|
+
import { Capsule, HashedValues, TxHash, TxProfileResult, TxReceipt, TxSimulationResult, UtilitySimulationResult, inTxSchema } from '@aztec/stdlib/tx';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import { NO_WAIT } from '../contract/interaction_options.js';
|
|
10
|
+
export const FunctionCallSchema = z.object({
|
|
11
|
+
name: z.string(),
|
|
12
|
+
to: schemas.AztecAddress,
|
|
13
|
+
selector: schemas.FunctionSelector,
|
|
14
|
+
type: z.nativeEnum(FunctionType),
|
|
15
|
+
isStatic: z.boolean(),
|
|
16
|
+
hideMsgSender: z.boolean(),
|
|
17
|
+
args: z.array(schemas.Fr),
|
|
18
|
+
returnTypes: z.array(AbiTypeSchema)
|
|
19
|
+
});
|
|
20
|
+
export const ExecutionPayloadSchema = z.object({
|
|
21
|
+
calls: z.array(FunctionCallSchema),
|
|
22
|
+
authWitnesses: z.array(AuthWitness.schema),
|
|
23
|
+
capsules: z.array(Capsule.schema),
|
|
24
|
+
extraHashedArgs: z.array(HashedValues.schema),
|
|
25
|
+
feePayer: optional(schemas.AztecAddress)
|
|
26
|
+
});
|
|
27
|
+
export const GasSettingsOptionSchema = z.object({
|
|
28
|
+
gasSettings: optional(z.object({
|
|
29
|
+
gasLimits: optional(Gas.schema),
|
|
30
|
+
teardownGasLimits: optional(Gas.schema),
|
|
31
|
+
maxFeePerGas: optional(z.object({
|
|
32
|
+
feePerDaGas: schemas.BigInt,
|
|
33
|
+
feePerL2Gas: schemas.BigInt
|
|
34
|
+
})),
|
|
35
|
+
maxPriorityFeePerGas: optional(z.object({
|
|
36
|
+
feePerDaGas: schemas.BigInt,
|
|
37
|
+
feePerL2Gas: schemas.BigInt
|
|
38
|
+
}))
|
|
39
|
+
}))
|
|
40
|
+
});
|
|
41
|
+
export const WalletSimulationFeeOptionSchema = GasSettingsOptionSchema.extend({
|
|
42
|
+
estimatedGasPadding: optional(z.number()),
|
|
43
|
+
estimateGas: optional(z.boolean())
|
|
44
|
+
});
|
|
45
|
+
export const WaitOptsSchema = z.object({
|
|
46
|
+
ignoreDroppedReceiptsFor: optional(z.number()),
|
|
47
|
+
timeout: optional(z.number()),
|
|
48
|
+
interval: optional(z.number()),
|
|
49
|
+
dontThrowOnRevert: optional(z.boolean())
|
|
50
|
+
});
|
|
51
|
+
export const SendOptionsSchema = z.object({
|
|
52
|
+
from: schemas.AztecAddress,
|
|
53
|
+
authWitnesses: optional(z.array(AuthWitness.schema)),
|
|
54
|
+
capsules: optional(z.array(Capsule.schema)),
|
|
55
|
+
fee: optional(GasSettingsOptionSchema),
|
|
56
|
+
wait: optional(z.union([
|
|
57
|
+
z.literal(NO_WAIT),
|
|
58
|
+
WaitOptsSchema
|
|
59
|
+
]))
|
|
60
|
+
});
|
|
61
|
+
export const SimulateOptionsSchema = z.object({
|
|
62
|
+
from: schemas.AztecAddress,
|
|
63
|
+
authWitnesses: optional(z.array(AuthWitness.schema)),
|
|
64
|
+
capsules: optional(z.array(Capsule.schema)),
|
|
65
|
+
fee: optional(WalletSimulationFeeOptionSchema),
|
|
66
|
+
skipTxValidation: optional(z.boolean()),
|
|
67
|
+
skipFeeEnforcement: optional(z.boolean()),
|
|
68
|
+
includeMetadata: optional(z.boolean())
|
|
69
|
+
});
|
|
70
|
+
export const ProfileOptionsSchema = SimulateOptionsSchema.extend({
|
|
71
|
+
profileMode: z.enum([
|
|
72
|
+
'gates',
|
|
73
|
+
'execution-steps',
|
|
74
|
+
'full'
|
|
75
|
+
]),
|
|
76
|
+
skipProofGeneration: optional(z.boolean())
|
|
77
|
+
});
|
|
78
|
+
export const MessageHashOrIntentSchema = z.union([
|
|
79
|
+
z.object({
|
|
80
|
+
consumer: schemas.AztecAddress,
|
|
81
|
+
innerHash: schemas.Fr
|
|
82
|
+
}),
|
|
83
|
+
z.object({
|
|
84
|
+
caller: schemas.AztecAddress,
|
|
85
|
+
call: FunctionCallSchema
|
|
86
|
+
})
|
|
87
|
+
]);
|
|
88
|
+
export const EventMetadataDefinitionSchema = z.object({
|
|
89
|
+
eventSelector: schemas.EventSelector,
|
|
90
|
+
abiType: AbiTypeSchema,
|
|
91
|
+
fieldNames: z.array(z.string())
|
|
92
|
+
});
|
|
93
|
+
export const PrivateEventSchema = zodFor()(z.object({
|
|
94
|
+
event: AbiDecodedSchema,
|
|
95
|
+
metadata: inTxSchema()
|
|
96
|
+
}));
|
|
97
|
+
export const PrivateEventFilterSchema = z.object({
|
|
98
|
+
contractAddress: schemas.AztecAddress,
|
|
99
|
+
scopes: z.array(schemas.AztecAddress),
|
|
100
|
+
txHash: optional(TxHash.schema),
|
|
101
|
+
fromBlock: optional(BlockNumberPositiveSchema),
|
|
102
|
+
toBlock: optional(BlockNumberPositiveSchema)
|
|
103
|
+
});
|
|
104
|
+
export const ContractMetadataSchema = z.object({
|
|
105
|
+
instance: optional(ContractInstanceWithAddressSchema),
|
|
106
|
+
isContractInitialized: z.boolean(),
|
|
107
|
+
isContractPublished: z.boolean(),
|
|
108
|
+
isContractUpdated: z.boolean(),
|
|
109
|
+
updatedContractClassId: optional(schemas.Fr)
|
|
110
|
+
});
|
|
111
|
+
export const ContractClassMetadataSchema = z.object({
|
|
112
|
+
isArtifactRegistered: z.boolean(),
|
|
113
|
+
isContractClassPubliclyRegistered: z.boolean()
|
|
114
|
+
});
|
|
115
|
+
/**
|
|
116
|
+
* Record of all wallet method schemas (excluding batch).
|
|
117
|
+
* This is the single source of truth for method schemas - batch schemas are derived from this.
|
|
118
|
+
*/ const WalletMethodSchemas = {
|
|
119
|
+
getChainInfo: z.function().args().returns(z.object({
|
|
120
|
+
chainId: schemas.Fr,
|
|
121
|
+
version: schemas.Fr
|
|
122
|
+
})),
|
|
123
|
+
getContractMetadata: z.function().args(schemas.AztecAddress).returns(ContractMetadataSchema),
|
|
124
|
+
getContractClassMetadata: z.function().args(schemas.Fr).returns(ContractClassMetadataSchema),
|
|
125
|
+
getPrivateEvents: z.function().args(EventMetadataDefinitionSchema, PrivateEventFilterSchema).returns(z.array(PrivateEventSchema)),
|
|
126
|
+
registerSender: z.function().args(schemas.AztecAddress, optional(z.string())).returns(schemas.AztecAddress),
|
|
127
|
+
getAddressBook: z.function().args().returns(z.array(z.object({
|
|
128
|
+
alias: z.string(),
|
|
129
|
+
item: schemas.AztecAddress
|
|
130
|
+
}))),
|
|
131
|
+
getAccounts: z.function().args().returns(z.array(z.object({
|
|
132
|
+
alias: z.string(),
|
|
133
|
+
item: schemas.AztecAddress
|
|
134
|
+
}))),
|
|
135
|
+
registerContract: z.function().args(ContractInstanceWithAddressSchema, optional(ContractArtifactSchema), optional(schemas.Fr)).returns(ContractInstanceWithAddressSchema),
|
|
136
|
+
simulateTx: z.function().args(ExecutionPayloadSchema, SimulateOptionsSchema).returns(TxSimulationResult.schema),
|
|
137
|
+
simulateUtility: z.function().args(FunctionCallSchema, optional(z.array(AuthWitness.schema))).returns(UtilitySimulationResult.schema),
|
|
138
|
+
profileTx: z.function().args(ExecutionPayloadSchema, ProfileOptionsSchema).returns(TxProfileResult.schema),
|
|
139
|
+
sendTx: z.function().args(ExecutionPayloadSchema, SendOptionsSchema).returns(z.union([
|
|
140
|
+
TxHash.schema,
|
|
141
|
+
TxReceipt.schema
|
|
142
|
+
])),
|
|
143
|
+
createAuthWit: z.function().args(schemas.AztecAddress, MessageHashOrIntentSchema).returns(AuthWitness.schema)
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Creates batch schemas from the individual wallet methods.
|
|
147
|
+
* This allows us to define them once and derive batch schemas automatically,
|
|
148
|
+
* reducing duplication and ensuring consistency.
|
|
149
|
+
*/ function createBatchSchemas(methodSchemas) {
|
|
150
|
+
const names = Object.keys(methodSchemas);
|
|
151
|
+
const namesAndArgs = names.map((name)=>z.object({
|
|
152
|
+
name: z.literal(name),
|
|
153
|
+
args: methodSchemas[name].parameters()
|
|
154
|
+
}));
|
|
155
|
+
const namesAndReturns = names.map((name)=>z.object({
|
|
156
|
+
name: z.literal(name),
|
|
157
|
+
result: methodSchemas[name].returnType()
|
|
158
|
+
}));
|
|
159
|
+
// Type assertion needed because discriminatedUnion expects a tuple type [T, T, ...T[]]
|
|
160
|
+
// but we're building the array dynamically. The runtime behavior is correct.
|
|
161
|
+
return {
|
|
162
|
+
input: z.discriminatedUnion('name', namesAndArgs),
|
|
163
|
+
output: z.discriminatedUnion('name', namesAndReturns)
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
const { input: BatchedMethodSchema, output: BatchedResultSchema } = createBatchSchemas(WalletMethodSchemas);
|
|
167
|
+
export { BatchedMethodSchema, BatchedResultSchema };
|
|
168
|
+
export const WalletSchema = {
|
|
169
|
+
...WalletMethodSchemas,
|
|
170
|
+
// @ts-expect-error - ApiSchemaFor cannot properly type generic methods with readonly arrays
|
|
171
|
+
batch: z.function().args(z.array(BatchedMethodSchema)).returns(z.array(BatchedResultSchema))
|
|
172
|
+
};
|
package/package.json
CHANGED
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec.js",
|
|
3
3
|
"homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec.js",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.1-commit.0b941701",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
|
-
".": "./dest/index.js",
|
|
8
|
-
"./interfaces/pxe": "./dest/api/interfaces/pxe.js",
|
|
9
7
|
"./abi": "./dest/api/abi.js",
|
|
10
8
|
"./account": "./dest/api/account.js",
|
|
11
9
|
"./addresses": "./dest/api/addresses.js",
|
|
12
|
-
"./
|
|
13
|
-
"./
|
|
10
|
+
"./authorization": "./dest/api/authorization.js",
|
|
11
|
+
"./block": "./dest/api/block.js",
|
|
12
|
+
"./contracts": "./dest/api/contract.js",
|
|
13
|
+
"./crypto": "./dest/api/crypto.js",
|
|
14
14
|
"./deployment": "./dest/api/deployment.js",
|
|
15
|
-
"./
|
|
16
|
-
"./
|
|
17
|
-
"./ethereum": "./dest/api/ethereum/index.js",
|
|
15
|
+
"./ethereum": "./dest/api/ethereum.js",
|
|
16
|
+
"./events": "./dest/api/events.js",
|
|
18
17
|
"./fee": "./dest/api/fee.js",
|
|
18
|
+
"./fee/testing": "./dest/api/fee_testing.js",
|
|
19
19
|
"./fields": "./dest/api/fields.js",
|
|
20
|
+
"./keys": "./dest/api/keys.js",
|
|
20
21
|
"./log": "./dest/api/log.js",
|
|
21
|
-
"./
|
|
22
|
-
"./
|
|
23
|
-
"./
|
|
24
|
-
"./
|
|
25
|
-
"./
|
|
22
|
+
"./messaging": "./dest/api/messaging.js",
|
|
23
|
+
"./node": "./dest/api/node.js",
|
|
24
|
+
"./note": "./dest/api/note.js",
|
|
25
|
+
"./protocol": "./dest/api/protocol.js",
|
|
26
|
+
"./trees": "./dest/api/trees.js",
|
|
27
|
+
"./tx": "./dest/api/tx.js",
|
|
28
|
+
"./utils": "./dest/api/utils.js",
|
|
29
|
+
"./wallet": "./dest/api/wallet.js"
|
|
26
30
|
},
|
|
27
31
|
"typedocOptions": {
|
|
28
32
|
"entryPoints": [
|
|
@@ -32,12 +36,11 @@
|
|
|
32
36
|
"tsconfig": "./tsconfig.json"
|
|
33
37
|
},
|
|
34
38
|
"scripts": {
|
|
35
|
-
"build": "yarn clean && tsc
|
|
36
|
-
"build:dev": "tsc
|
|
37
|
-
"build:ts": "tsc
|
|
38
|
-
"clean": "rm -rf ./dest .tsbuildinfo ./src/account_contract/artifacts",
|
|
39
|
-
"
|
|
40
|
-
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
|
|
39
|
+
"build": "yarn clean && yarn generate && ../scripts/tsc.sh",
|
|
40
|
+
"build:dev": "../scripts/tsc.sh --watch",
|
|
41
|
+
"build:ts": "../scripts/tsc.sh",
|
|
42
|
+
"clean": "rm -rf ./dest .tsbuildinfo ./src/account_contract/artifacts ./src/contract/protocol_contracts",
|
|
43
|
+
"generate": "node --no-warnings --loader @swc-node/register/esm src/scripts/generate_protocol_contract_types.ts && run -T prettier -w src/contract/protocol_contracts",
|
|
41
44
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
42
45
|
},
|
|
43
46
|
"inherits": [
|
|
@@ -75,33 +78,41 @@
|
|
|
75
78
|
"testTimeout": 120000,
|
|
76
79
|
"setupFiles": [
|
|
77
80
|
"../../foundation/src/jest/setup.mjs"
|
|
81
|
+
],
|
|
82
|
+
"testEnvironment": "../../foundation/src/jest/env.mjs",
|
|
83
|
+
"setupFilesAfterEnv": [
|
|
84
|
+
"../../foundation/src/jest/setupAfterEnv.mjs"
|
|
78
85
|
]
|
|
79
86
|
},
|
|
80
87
|
"dependencies": {
|
|
81
|
-
"@aztec/constants": "0.0.
|
|
82
|
-
"@aztec/
|
|
83
|
-
"@aztec/
|
|
84
|
-
"@aztec/
|
|
85
|
-
"@aztec/
|
|
86
|
-
"@aztec/
|
|
87
|
-
"
|
|
88
|
+
"@aztec/constants": "0.0.1-commit.0b941701",
|
|
89
|
+
"@aztec/entrypoints": "0.0.1-commit.0b941701",
|
|
90
|
+
"@aztec/ethereum": "0.0.1-commit.0b941701",
|
|
91
|
+
"@aztec/foundation": "0.0.1-commit.0b941701",
|
|
92
|
+
"@aztec/l1-artifacts": "0.0.1-commit.0b941701",
|
|
93
|
+
"@aztec/protocol-contracts": "0.0.1-commit.0b941701",
|
|
94
|
+
"@aztec/stdlib": "0.0.1-commit.0b941701",
|
|
95
|
+
"axios": "^1.12.0",
|
|
88
96
|
"tslib": "^2.4.0",
|
|
89
|
-
"viem": "2.
|
|
97
|
+
"viem": "npm:@aztec/viem@2.38.2",
|
|
98
|
+
"zod": "^3.23.8"
|
|
90
99
|
},
|
|
91
100
|
"devDependencies": {
|
|
92
|
-
"@
|
|
93
|
-
"@
|
|
94
|
-
"@types/
|
|
101
|
+
"@aztec/builder": "0.0.1-commit.0b941701",
|
|
102
|
+
"@jest/globals": "^30.0.0",
|
|
103
|
+
"@types/jest": "^30.0.0",
|
|
104
|
+
"@types/node": "^22.15.17",
|
|
105
|
+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
|
|
95
106
|
"buffer": "^6.0.3",
|
|
96
|
-
"crypto-browserify": "^3.12.
|
|
97
|
-
"jest": "^
|
|
98
|
-
"jest-mock-extended": "^
|
|
107
|
+
"crypto-browserify": "^3.12.1",
|
|
108
|
+
"jest": "^30.0.0",
|
|
109
|
+
"jest-mock-extended": "^4.0.0",
|
|
99
110
|
"process": "^0.11.10",
|
|
100
111
|
"resolve-typescript-plugin": "^2.0.1",
|
|
101
112
|
"stream-browserify": "^3.0.0",
|
|
102
|
-
"ts-loader": "^9.
|
|
113
|
+
"ts-loader": "^9.5.4",
|
|
103
114
|
"ts-node": "^10.9.1",
|
|
104
|
-
"typescript": "^5.
|
|
115
|
+
"typescript": "^5.3.3",
|
|
105
116
|
"util": "^0.12.5"
|
|
106
117
|
},
|
|
107
118
|
"files": [
|
|
@@ -111,6 +122,6 @@
|
|
|
111
122
|
],
|
|
112
123
|
"types": "./dest/index.d.ts",
|
|
113
124
|
"engines": {
|
|
114
|
-
"node": ">=
|
|
125
|
+
"node": ">=20.10"
|
|
115
126
|
}
|
|
116
127
|
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
|
|
2
|
+
import type { AuthWitnessProvider, ChainInfo, EntrypointInterface } from '@aztec/entrypoints/interfaces';
|
|
3
|
+
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
4
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
+
import type { CompleteAddress } from '@aztec/stdlib/contract';
|
|
6
|
+
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
7
|
+
import type { ExecutionPayload, TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
8
|
+
|
|
9
|
+
import { type CallIntent, type IntentInnerHash, computeAuthWitMessageHash } from '../utils/authwit.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Provides authorization for actions via the AuthWitness mechanism.
|
|
13
|
+
*/
|
|
14
|
+
export interface AuthorizationProvider {
|
|
15
|
+
/**
|
|
16
|
+
* Creates an authentication witness from an inner hash with consumer, or a call intent
|
|
17
|
+
* @param intent - The action (or inner hash) to authorize
|
|
18
|
+
* @param chainInfo - Chain information needed for message hash computation
|
|
19
|
+
*/
|
|
20
|
+
createAuthWit(intent: IntentInnerHash | CallIntent, chainInfo: ChainInfo): Promise<AuthWitness>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// docs:start:account-interface
|
|
24
|
+
/**
|
|
25
|
+
* Minimal interface for transaction execution and authorization.
|
|
26
|
+
*/
|
|
27
|
+
export type Account = EntrypointInterface &
|
|
28
|
+
AuthorizationProvider & {
|
|
29
|
+
/** Returns the complete address for this account. */
|
|
30
|
+
getCompleteAddress(): CompleteAddress;
|
|
31
|
+
/** Returns the address for this account. */
|
|
32
|
+
getAddress(): AztecAddress;
|
|
33
|
+
};
|
|
34
|
+
// docs:end:account-interface
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* An account implementation that uses authwits as an authentication mechanism
|
|
38
|
+
* and can assemble transaction execution requests for an entrypoint.
|
|
39
|
+
*/
|
|
40
|
+
export class BaseAccount implements Account {
|
|
41
|
+
constructor(
|
|
42
|
+
private entrypoint: EntrypointInterface,
|
|
43
|
+
private authWitnessProvider: AuthWitnessProvider,
|
|
44
|
+
private completeAddress: CompleteAddress,
|
|
45
|
+
) {}
|
|
46
|
+
|
|
47
|
+
createTxExecutionRequest(
|
|
48
|
+
exec: ExecutionPayload,
|
|
49
|
+
gasSettings: GasSettings,
|
|
50
|
+
chainInfo: ChainInfo,
|
|
51
|
+
options: DefaultAccountEntrypointOptions,
|
|
52
|
+
): Promise<TxExecutionRequest> {
|
|
53
|
+
return this.entrypoint.createTxExecutionRequest(exec, gasSettings, chainInfo, options);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
wrapExecutionPayload(exec: ExecutionPayload, options?: any): Promise<ExecutionPayload> {
|
|
57
|
+
return this.entrypoint.wrapExecutionPayload(exec, options);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async createAuthWit(messageHashOrIntent: CallIntent | IntentInnerHash, chainInfo: ChainInfo): Promise<AuthWitness> {
|
|
61
|
+
const messageHash = await computeAuthWitMessageHash(messageHashOrIntent, chainInfo);
|
|
62
|
+
return this.authWitnessProvider.createAuthWit(messageHash);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
getCompleteAddress(): CompleteAddress {
|
|
66
|
+
return this.completeAddress;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
getAddress(): AztecAddress {
|
|
70
|
+
return this.completeAddress.address;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { AuthWitnessProvider } from '@aztec/entrypoints/interfaces';
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import type { ContractArtifact } from '@aztec/stdlib/abi';
|
|
4
|
+
import type { CompleteAddress } from '@aztec/stdlib/contract';
|
|
5
|
+
import { getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
|
|
6
|
+
import { deriveKeys } from '@aztec/stdlib/keys';
|
|
7
|
+
|
|
8
|
+
import type { Account } from './account.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* An account contract instance. Knows its artifact, deployment arguments, how to create
|
|
12
|
+
* transaction execution requests out of function calls, and how to authorize actions.
|
|
13
|
+
*/
|
|
14
|
+
export interface AccountContract {
|
|
15
|
+
/**
|
|
16
|
+
* Returns the artifact of this account contract.
|
|
17
|
+
*/
|
|
18
|
+
getContractArtifact(): Promise<ContractArtifact>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Returns the initializer function name and arguments for this instance, or undefined if this contract does not require initialization.
|
|
22
|
+
*/
|
|
23
|
+
getInitializationFunctionAndArgs(): Promise<
|
|
24
|
+
| {
|
|
25
|
+
/** The name of the function used to initialize the contract */
|
|
26
|
+
constructorName: string;
|
|
27
|
+
/** The args to the function used to initialize the contract */
|
|
28
|
+
constructorArgs: any[];
|
|
29
|
+
}
|
|
30
|
+
| undefined
|
|
31
|
+
>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Returns the account implementation for this account contract given an instance at the provided address.
|
|
35
|
+
* The account is responsible for assembling tx requests given requested function calls, and
|
|
36
|
+
* for creating signed auth witnesses given action identifiers (message hashes).
|
|
37
|
+
* @param address - Address of this account contract.
|
|
38
|
+
* @returns An account instance for creating tx requests and authorizing actions.
|
|
39
|
+
*/
|
|
40
|
+
getAccount(address: CompleteAddress): Account;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Returns the auth witness provider for the given address.
|
|
44
|
+
* @param address - Address for which to create auth witnesses.
|
|
45
|
+
*/
|
|
46
|
+
getAuthWitnessProvider(address: CompleteAddress): AuthWitnessProvider;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Compute the address of an account contract from secret and salt.
|
|
51
|
+
*/
|
|
52
|
+
export async function getAccountContractAddress(accountContract: AccountContract, secret: Fr, salt: Fr) {
|
|
53
|
+
const { publicKeys } = await deriveKeys(secret);
|
|
54
|
+
const { constructorName, constructorArgs } = (await accountContract.getInitializationFunctionAndArgs()) ?? {
|
|
55
|
+
constructorName: undefined,
|
|
56
|
+
constructorArgs: undefined,
|
|
57
|
+
};
|
|
58
|
+
const artifact = await accountContract.getContractArtifact();
|
|
59
|
+
const instance = await getContractInstanceFromInstantiationParams(artifact, {
|
|
60
|
+
constructorArtifact: constructorName,
|
|
61
|
+
constructorArgs,
|
|
62
|
+
salt,
|
|
63
|
+
publicKeys,
|
|
64
|
+
});
|
|
65
|
+
return instance.address;
|
|
66
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ChainInfo } from '@aztec/entrypoints/interfaces';
|
|
2
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
4
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
+
import type { CompleteAddress } from '@aztec/stdlib/contract';
|
|
6
|
+
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
7
|
+
import { computeAddressSecret, deriveMasterIncomingViewingSecretKey } from '@aztec/stdlib/keys';
|
|
8
|
+
import type { ExecutionPayload, TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
9
|
+
|
|
10
|
+
import type { CallIntent, IntentInnerHash } from '../utils/authwit.js';
|
|
11
|
+
import type { Account, Salt } from './index.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Extends {@link BaseAccount} with the encryption private key. Not required for
|
|
15
|
+
* implementing the wallet interface but useful for testing purposes or exporting
|
|
16
|
+
* an account to another pxe.
|
|
17
|
+
*/
|
|
18
|
+
export class AccountWithSecretKey implements Account {
|
|
19
|
+
constructor(
|
|
20
|
+
private account: Account,
|
|
21
|
+
private secretKey: Fr,
|
|
22
|
+
/** Deployment salt for this account contract. */
|
|
23
|
+
public readonly salt: Salt,
|
|
24
|
+
) {}
|
|
25
|
+
|
|
26
|
+
createTxExecutionRequest(
|
|
27
|
+
exec: ExecutionPayload,
|
|
28
|
+
gasSettings: GasSettings,
|
|
29
|
+
chainInfo: ChainInfo,
|
|
30
|
+
options?: any,
|
|
31
|
+
): Promise<TxExecutionRequest> {
|
|
32
|
+
return this.account.createTxExecutionRequest(exec, gasSettings, chainInfo, options);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
wrapExecutionPayload(exec: ExecutionPayload, options?: any): Promise<ExecutionPayload> {
|
|
36
|
+
return this.account.wrapExecutionPayload(exec, options);
|
|
37
|
+
}
|
|
38
|
+
createAuthWit(intent: IntentInnerHash | CallIntent, chainInfo: ChainInfo): Promise<AuthWitness> {
|
|
39
|
+
return this.account.createAuthWit(intent, chainInfo);
|
|
40
|
+
}
|
|
41
|
+
getCompleteAddress(): CompleteAddress {
|
|
42
|
+
return this.account.getCompleteAddress();
|
|
43
|
+
}
|
|
44
|
+
getAddress(): AztecAddress {
|
|
45
|
+
return this.account.getAddress();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Returns the encryption private key associated with this account. */
|
|
49
|
+
public getSecretKey() {
|
|
50
|
+
return this.secretKey;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Returns the encryption secret, the secret of the encryption point—the point that others use to encrypt messages to this account
|
|
54
|
+
* note - this ensures that the address secret always corresponds to an address point with y being positive
|
|
55
|
+
* dev - this is also referred to as the address secret, which decrypts payloads encrypted to an address point
|
|
56
|
+
*/
|
|
57
|
+
public async getEncryptionSecret() {
|
|
58
|
+
return computeAddressSecret(
|
|
59
|
+
await this.getCompleteAddress().getPreaddress(),
|
|
60
|
+
deriveMasterIncomingViewingSecretKey(this.getSecretKey()),
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
}
|
package/src/account/index.ts
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `account` module provides utilities for managing accounts.
|
|
3
|
-
* allows to deploy and register a fresh account, or to obtain a `Wallet` instance out of an account
|
|
4
|
-
* already deployed. Use the `@aztec/accounts` package to load default account implementations that rely
|
|
5
|
-
* on ECDSA or Schnorr signatures.
|
|
2
|
+
* The `account` module provides utilities for managing accounts.
|
|
6
3
|
*
|
|
7
4
|
* @packageDocumentation
|
|
8
5
|
*/
|
|
9
|
-
import type { Fr } from '@aztec/foundation/
|
|
6
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
10
7
|
|
|
11
|
-
export { type AccountContract, getAccountContractAddress } from './
|
|
12
|
-
export { type
|
|
13
|
-
export
|
|
8
|
+
export { type AccountContract, getAccountContractAddress } from './account_contract.js';
|
|
9
|
+
export { type Account, BaseAccount, type AuthorizationProvider } from './account.js';
|
|
10
|
+
export { AccountWithSecretKey } from './account_with_secret_key.js';
|
|
14
11
|
|
|
15
12
|
/** A contract deployment salt. */
|
|
16
13
|
export type Salt = Fr | number | bigint;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ChainInfo, EntrypointInterface } from '@aztec/entrypoints/interfaces';
|
|
2
|
+
import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
|
|
3
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
|
+
import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
5
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
|
+
import type { CompleteAddress } from '@aztec/stdlib/contract';
|
|
7
|
+
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
8
|
+
import type { ExecutionPayload, TxExecutionRequest } from '@aztec/stdlib/tx';
|
|
9
|
+
|
|
10
|
+
import type { CallIntent, IntentInnerHash } from '../utils/authwit.js';
|
|
11
|
+
import type { Account } from './account.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Account implementation which creates a transaction using the multicall protocol contract as entrypoint.
|
|
15
|
+
*/
|
|
16
|
+
export class SignerlessAccount implements Account {
|
|
17
|
+
private entrypoint: EntrypointInterface;
|
|
18
|
+
|
|
19
|
+
constructor() {
|
|
20
|
+
this.entrypoint = new DefaultMultiCallEntrypoint();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
createTxExecutionRequest(
|
|
24
|
+
exec: ExecutionPayload,
|
|
25
|
+
gasSettings: GasSettings,
|
|
26
|
+
chainInfo: ChainInfo,
|
|
27
|
+
): Promise<TxExecutionRequest> {
|
|
28
|
+
return this.entrypoint.createTxExecutionRequest(exec, gasSettings, chainInfo);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
wrapExecutionPayload(exec: ExecutionPayload, options?: any): Promise<ExecutionPayload> {
|
|
32
|
+
return this.entrypoint.wrapExecutionPayload(exec, options);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
createAuthWit(_intent: Fr | Buffer | IntentInnerHash | CallIntent): Promise<AuthWitness> {
|
|
36
|
+
throw new Error('SignerlessAccount: Method createAuthWit not implemented.');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
getCompleteAddress(): CompleteAddress {
|
|
40
|
+
throw new Error('SignerlessAccount: Method getCompleteAddress not implemented.');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
getAddress(): AztecAddress {
|
|
44
|
+
throw new Error('SignerlessAccount: Method getAddress not implemented.');
|
|
45
|
+
}
|
|
46
|
+
}
|
package/src/api/abi.ts
CHANGED
|
@@ -1,10 +1,36 @@
|
|
|
1
1
|
export {
|
|
2
2
|
type ContractArtifact,
|
|
3
3
|
type FunctionArtifact,
|
|
4
|
+
type FunctionAbi,
|
|
4
5
|
EventSelector,
|
|
6
|
+
FunctionType,
|
|
5
7
|
FunctionSelector,
|
|
8
|
+
FunctionCall,
|
|
9
|
+
NoteSelector,
|
|
10
|
+
type ABIParameter,
|
|
11
|
+
decodeFromAbi,
|
|
12
|
+
encodeArguments,
|
|
13
|
+
type AbiType,
|
|
14
|
+
isAddressStruct,
|
|
15
|
+
isAztecAddressStruct,
|
|
16
|
+
isEthAddressStruct,
|
|
17
|
+
isWrappedFieldStruct,
|
|
18
|
+
isFunctionSelectorStruct,
|
|
6
19
|
loadContractArtifact,
|
|
20
|
+
loadContractArtifactForPublic,
|
|
21
|
+
getAllFunctionAbis,
|
|
7
22
|
contractArtifactToBuffer,
|
|
8
23
|
contractArtifactFromBuffer,
|
|
9
24
|
} from '@aztec/stdlib/abi';
|
|
10
25
|
export { type NoirCompiledContract } from '@aztec/stdlib/noir';
|
|
26
|
+
|
|
27
|
+
// Type converters for flexible parameter types in contract calls
|
|
28
|
+
export {
|
|
29
|
+
type AztecAddressLike,
|
|
30
|
+
type EthAddressLike,
|
|
31
|
+
type EventSelectorLike,
|
|
32
|
+
type FieldLike,
|
|
33
|
+
type FunctionSelectorLike,
|
|
34
|
+
type U128Like,
|
|
35
|
+
type WrappedFieldLike,
|
|
36
|
+
} from '../utils/abi_types.js';
|
package/src/api/account.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
export {
|
|
2
|
+
type Account,
|
|
2
3
|
type AccountContract,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type
|
|
6
|
-
type Wallet,
|
|
4
|
+
AccountWithSecretKey,
|
|
5
|
+
BaseAccount,
|
|
6
|
+
type AuthorizationProvider,
|
|
7
7
|
getAccountContractAddress,
|
|
8
|
+
type Salt,
|
|
8
9
|
} from '../account/index.js';
|
|
10
|
+
export type { AuthWitnessProvider, ChainInfo } from '@aztec/entrypoints/interfaces';
|
|
11
|
+
export { ChainInfoSchema } from '@aztec/entrypoints/interfaces';
|
|
9
12
|
|
|
10
|
-
export {
|
|
13
|
+
export { SignerlessAccount } from '../account/signerless_account.js';
|
package/src/api/addresses.ts
CHANGED