algokit-utils 5.0.0a3__py3-none-any.whl
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.
- algokit_abi/__init__.py +9 -0
- algokit_abi/_arc32_to_arc56.py +242 -0
- algokit_abi/_arc56_serde.py +161 -0
- algokit_abi/abi.py +667 -0
- algokit_abi/arc32.py +210 -0
- algokit_abi/arc56.py +821 -0
- algokit_abi/py.typed +0 -0
- algokit_algo25/__init__.py +38 -0
- algokit_algo25/_encoding.py +46 -0
- algokit_algo25/_wordlist.py +2065 -0
- algokit_algo25/exceptions.py +29 -0
- algokit_algo25/mnemonic.py +128 -0
- algokit_algo25/py.typed +0 -0
- algokit_algod_client/__init__.py +10 -0
- algokit_algod_client/client.py +1585 -0
- algokit_algod_client/config.py +36 -0
- algokit_algod_client/exceptions.py +59 -0
- algokit_algod_client/models/__init__.py +229 -0
- algokit_algod_client/models/_account.py +150 -0
- algokit_algod_client/models/_account_application_response.py +25 -0
- algokit_algod_client/models/_account_asset_response.py +25 -0
- algokit_algod_client/models/_account_participation.py +53 -0
- algokit_algod_client/models/_account_state_delta.py +30 -0
- algokit_algod_client/models/_allocations_for_genesis_file.py +23 -0
- algokit_algod_client/models/_allocations_for_genesis_file_state_model.py +42 -0
- algokit_algod_client/models/_application.py +23 -0
- algokit_algod_client/models/_application_initial_states.py +37 -0
- algokit_algod_client/models/_application_kvstorage.py +29 -0
- algokit_algod_client/models/_application_local_state.py +33 -0
- algokit_algod_client/models/_application_params.py +63 -0
- algokit_algod_client/models/_application_state_operation.py +41 -0
- algokit_algod_client/models/_application_state_schema.py +22 -0
- algokit_algod_client/models/_asset.py +23 -0
- algokit_algod_client/models/_asset_holding.py +29 -0
- algokit_algod_client/models/_asset_params.py +102 -0
- algokit_algod_client/models/_avm_key_value.py +28 -0
- algokit_algod_client/models/_avm_value.py +32 -0
- algokit_algod_client/models/_block.py +363 -0
- algokit_algod_client/models/_block_hash_response.py +14 -0
- algokit_algod_client/models/_block_txids_response.py +14 -0
- algokit_algod_client/models/_box.py +36 -0
- algokit_algod_client/models/_box_descriptor.py +24 -0
- algokit_algod_client/models/_boxes_response.py +21 -0
- algokit_algod_client/models/_build_version_contains_the_current_algod_build_version_information.py +34 -0
- algokit_algod_client/models/_compile_response.py +24 -0
- algokit_algod_client/models/_disassemble_response.py +14 -0
- algokit_algod_client/models/_error_response.py +22 -0
- algokit_algod_client/models/_eval_delta.py +32 -0
- algokit_algod_client/models/_eval_delta_key_value.py +28 -0
- algokit_algod_client/models/_genesis_file_in_json.py +53 -0
- algokit_algod_client/models/_get_block_time_stamp_offset_response.py +14 -0
- algokit_algod_client/models/_get_sync_round_response.py +14 -0
- algokit_algod_client/models/_ledger_state_delta.py +389 -0
- algokit_algod_client/models/_light_block_header_proof.py +32 -0
- algokit_algod_client/models/_node_status_response.py +118 -0
- algokit_algod_client/models/_pending_transaction_response.py +91 -0
- algokit_algod_client/models/_pending_transactions_response.py +29 -0
- algokit_algod_client/models/_post_transactions_response.py +14 -0
- algokit_algod_client/models/_scratch_change.py +23 -0
- algokit_algod_client/models/_serde_helpers.py +241 -0
- algokit_algod_client/models/_simulate_initial_states.py +25 -0
- algokit_algod_client/models/_simulate_request.py +54 -0
- algokit_algod_client/models/_simulate_request_transaction_group.py +25 -0
- algokit_algod_client/models/_simulate_response.py +44 -0
- algokit_algod_client/models/_simulate_trace_config.py +30 -0
- algokit_algod_client/models/_simulate_transaction_group_result.py +46 -0
- algokit_algod_client/models/_simulate_transaction_result.py +41 -0
- algokit_algod_client/models/_simulate_unnamed_resources_accessed.py +64 -0
- algokit_algod_client/models/_simulation_eval_overrides.py +40 -0
- algokit_algod_client/models/_simulation_opcode_trace_unit.py +55 -0
- algokit_algod_client/models/_simulation_transaction_exec_trace.py +82 -0
- algokit_algod_client/models/_source_map.py +30 -0
- algokit_algod_client/models/_state_delta.py +6 -0
- algokit_algod_client/models/_state_proof.py +28 -0
- algokit_algod_client/models/_state_proof_message.py +44 -0
- algokit_algod_client/models/_supply_response.py +26 -0
- algokit_algod_client/models/_teal_key_value.py +28 -0
- algokit_algod_client/models/_teal_key_value_store.py +6 -0
- algokit_algod_client/models/_teal_value.py +32 -0
- algokit_algod_client/models/_transaction_group_ledger_state_deltas_for_round_response.py +21 -0
- algokit_algod_client/models/_transaction_parameters_response.py +45 -0
- algokit_algod_client/models/_transaction_proof.py +44 -0
- algokit_algod_client/models/_version_contains_the_current_algod_version.py +38 -0
- algokit_algod_client/models/suggested_params.py +42 -0
- algokit_algod_client/py.typed +1 -0
- algokit_algod_client/types.py +7 -0
- algokit_algosdk/__init__.py +38 -0
- algokit_algosdk/account.py +32 -0
- algokit_algosdk/app_access.py +228 -0
- algokit_algosdk/box_reference.py +100 -0
- algokit_algosdk/constants.py +147 -0
- algokit_algosdk/encoding.py +89 -0
- algokit_algosdk/error.py +180 -0
- algokit_algosdk/logic.py +61 -0
- algokit_algosdk/logicsig.py +218 -0
- algokit_algosdk/mnemonic.py +216 -0
- algokit_algosdk/multisig.py +161 -0
- algokit_algosdk/py.typed +0 -0
- algokit_algosdk/transaction.py +596 -0
- algokit_algosdk/wordlist.py +2054 -0
- algokit_common/__init__.py +50 -0
- algokit_common/address.py +34 -0
- algokit_common/constants.py +47 -0
- algokit_common/hashing.py +25 -0
- algokit_common/py.typed +0 -0
- algokit_common/serde/__init__.py +40 -0
- algokit_common/serde/_core.py +610 -0
- algokit_common/serde/_primitives.py +135 -0
- algokit_common/source_map.py +158 -0
- algokit_indexer_client/__init__.py +10 -0
- algokit_indexer_client/client.py +1456 -0
- algokit_indexer_client/config.py +36 -0
- algokit_indexer_client/exceptions.py +59 -0
- algokit_indexer_client/models/__init__.py +148 -0
- algokit_indexer_client/models/_account.py +161 -0
- algokit_indexer_client/models/_account_participation.py +53 -0
- algokit_indexer_client/models/_account_response.py +19 -0
- algokit_indexer_client/models/_account_state_delta.py +29 -0
- algokit_indexer_client/models/_accounts_response.py +29 -0
- algokit_indexer_client/models/_application.py +35 -0
- algokit_indexer_client/models/_application_local_state.py +45 -0
- algokit_indexer_client/models/_application_local_states_response.py +29 -0
- algokit_indexer_client/models/_application_log_data.py +28 -0
- algokit_indexer_client/models/_application_logs_response.py +33 -0
- algokit_indexer_client/models/_application_params.py +62 -0
- algokit_indexer_client/models/_application_response.py +20 -0
- algokit_indexer_client/models/_application_state_schema.py +22 -0
- algokit_indexer_client/models/_applications_response.py +29 -0
- algokit_indexer_client/models/_asset.py +35 -0
- algokit_indexer_client/models/_asset_balances_response.py +29 -0
- algokit_indexer_client/models/_asset_holding.py +41 -0
- algokit_indexer_client/models/_asset_holdings_response.py +29 -0
- algokit_indexer_client/models/_asset_params.py +102 -0
- algokit_indexer_client/models/_asset_response.py +19 -0
- algokit_indexer_client/models/_assets_response.py +29 -0
- algokit_indexer_client/models/_block.py +150 -0
- algokit_indexer_client/models/_block_headers_response.py +29 -0
- algokit_indexer_client/models/_block_rewards.py +38 -0
- algokit_indexer_client/models/_block_upgrade_state.py +34 -0
- algokit_indexer_client/models/_block_upgrade_vote.py +26 -0
- algokit_indexer_client/models/_box.py +36 -0
- algokit_indexer_client/models/_box_descriptor.py +24 -0
- algokit_indexer_client/models/_box_reference.py +28 -0
- algokit_indexer_client/models/_boxes_response.py +29 -0
- algokit_indexer_client/models/_error_response.py +18 -0
- algokit_indexer_client/models/_eval_delta.py +32 -0
- algokit_indexer_client/models/_eval_delta_key_value.py +28 -0
- algokit_indexer_client/models/_hash_factory.py +14 -0
- algokit_indexer_client/models/_hb_proof_fields.py +57 -0
- algokit_indexer_client/models/_health_check.py +42 -0
- algokit_indexer_client/models/_holding_ref.py +23 -0
- algokit_indexer_client/models/_indexer_state_proof_message.py +40 -0
- algokit_indexer_client/models/_locals_ref.py +23 -0
- algokit_indexer_client/models/_merkle_array_proof.py +29 -0
- algokit_indexer_client/models/_mini_asset_holding.py +38 -0
- algokit_indexer_client/models/_on_completion.py +25 -0
- algokit_indexer_client/models/_participation_updates.py +22 -0
- algokit_indexer_client/models/_resource_ref.py +42 -0
- algokit_indexer_client/models/_serde_helpers.py +241 -0
- algokit_indexer_client/models/_state_delta.py +6 -0
- algokit_indexer_client/models/_state_proof_fields.py +57 -0
- algokit_indexer_client/models/_state_proof_participant.py +20 -0
- algokit_indexer_client/models/_state_proof_reveal.py +25 -0
- algokit_indexer_client/models/_state_proof_sig_slot.py +20 -0
- algokit_indexer_client/models/_state_proof_signature.py +37 -0
- algokit_indexer_client/models/_state_proof_tracking.py +32 -0
- algokit_indexer_client/models/_state_proof_verifier.py +24 -0
- algokit_indexer_client/models/_state_schema.py +25 -0
- algokit_indexer_client/models/_teal_key_value.py +28 -0
- algokit_indexer_client/models/_teal_key_value_store.py +6 -0
- algokit_indexer_client/models/_teal_value.py +32 -0
- algokit_indexer_client/models/_transaction.py +213 -0
- algokit_indexer_client/models/_transaction_application.py +105 -0
- algokit_indexer_client/models/_transaction_asset_config.py +31 -0
- algokit_indexer_client/models/_transaction_asset_freeze.py +29 -0
- algokit_indexer_client/models/_transaction_asset_transfer.py +41 -0
- algokit_indexer_client/models/_transaction_heartbeat.py +52 -0
- algokit_indexer_client/models/_transaction_keyreg.py +59 -0
- algokit_indexer_client/models/_transaction_payment.py +33 -0
- algokit_indexer_client/models/_transaction_response.py +19 -0
- algokit_indexer_client/models/_transaction_signature.py +35 -0
- algokit_indexer_client/models/_transaction_signature_logicsig.py +59 -0
- algokit_indexer_client/models/_transaction_signature_multisig.py +36 -0
- algokit_indexer_client/models/_transaction_signature_multisig_subsignature.py +28 -0
- algokit_indexer_client/models/_transaction_state_proof.py +32 -0
- algokit_indexer_client/models/_transactions_response.py +29 -0
- algokit_indexer_client/py.typed +1 -0
- algokit_indexer_client/types.py +7 -0
- algokit_kmd_client/__init__.py +10 -0
- algokit_kmd_client/client.py +1240 -0
- algokit_kmd_client/config.py +36 -0
- algokit_kmd_client/exceptions.py +59 -0
- algokit_kmd_client/models/__init__.py +112 -0
- algokit_kmd_client/models/_classical_signatures.py +4 -0
- algokit_kmd_client/models/_create_wallet_request.py +30 -0
- algokit_kmd_client/models/_create_wallet_response.py +19 -0
- algokit_kmd_client/models/_delete_key_request.py +27 -0
- algokit_kmd_client/models/_delete_multisig_request.py +27 -0
- algokit_kmd_client/models/_digest_represents_a32_byte_value_holding_the256_bit_hash_digest.py +4 -0
- algokit_kmd_client/models/_ed25519_public_key.py +4 -0
- algokit_kmd_client/models/_export_key_request.py +27 -0
- algokit_kmd_client/models/_export_key_response.py +24 -0
- algokit_kmd_client/models/_export_master_key_request.py +22 -0
- algokit_kmd_client/models/_export_master_key_response.py +18 -0
- algokit_kmd_client/models/_export_multisig_request.py +23 -0
- algokit_kmd_client/models/_export_multisig_response.py +26 -0
- algokit_kmd_client/models/_generate_key_request.py +18 -0
- algokit_kmd_client/models/_generate_key_response.py +19 -0
- algokit_kmd_client/models/_import_key_request.py +28 -0
- algokit_kmd_client/models/_import_key_response.py +19 -0
- algokit_kmd_client/models/_import_multisig_request.py +30 -0
- algokit_kmd_client/models/_import_multisig_response.py +19 -0
- algokit_kmd_client/models/_init_wallet_handle_token_request.py +22 -0
- algokit_kmd_client/models/_init_wallet_handle_token_response.py +18 -0
- algokit_kmd_client/models/_list_keys_request.py +18 -0
- algokit_kmd_client/models/_list_keys_response.py +18 -0
- algokit_kmd_client/models/_list_multisig_request.py +18 -0
- algokit_kmd_client/models/_list_multisig_response.py +18 -0
- algokit_kmd_client/models/_list_wallets_request.py +11 -0
- algokit_kmd_client/models/_list_wallets_response.py +25 -0
- algokit_kmd_client/models/_master_derivation_key.py +4 -0
- algokit_kmd_client/models/_multisig_sig.py +33 -0
- algokit_kmd_client/models/_multisig_subsig.py +23 -0
- algokit_kmd_client/models/_public_key.py +4 -0
- algokit_kmd_client/models/_release_wallet_handle_token_request.py +18 -0
- algokit_kmd_client/models/_rename_wallet_request.py +26 -0
- algokit_kmd_client/models/_rename_wallet_response.py +19 -0
- algokit_kmd_client/models/_renew_wallet_handle_token_request.py +18 -0
- algokit_kmd_client/models/_renew_wallet_handle_token_response.py +19 -0
- algokit_kmd_client/models/_serde_helpers.py +241 -0
- algokit_kmd_client/models/_sign_multisig_response.py +24 -0
- algokit_kmd_client/models/_sign_multisig_txn_request.py +45 -0
- algokit_kmd_client/models/_sign_program_multisig_request.py +50 -0
- algokit_kmd_client/models/_sign_program_multisig_response.py +24 -0
- algokit_kmd_client/models/_sign_program_request.py +37 -0
- algokit_kmd_client/models/_sign_program_response.py +24 -0
- algokit_kmd_client/models/_sign_transaction_response.py +24 -0
- algokit_kmd_client/models/_sign_txn_request.py +36 -0
- algokit_kmd_client/models/_signature.py +4 -0
- algokit_kmd_client/models/_tx_type.py +4 -0
- algokit_kmd_client/models/_versions_request.py +11 -0
- algokit_kmd_client/models/_versions_response.py +19 -0
- algokit_kmd_client/models/_wallet.py +38 -0
- algokit_kmd_client/models/_wallet_handle.py +24 -0
- algokit_kmd_client/models/_wallet_info_request.py +18 -0
- algokit_kmd_client/models/_wallet_info_response.py +19 -0
- algokit_kmd_client/py.typed +1 -0
- algokit_kmd_client/types.py +7 -0
- algokit_transact/__init__.py +190 -0
- algokit_transact/codec/__init__.py +0 -0
- algokit_transact/codec/msgpack.py +11 -0
- algokit_transact/codec/serde.py +7 -0
- algokit_transact/codec/signed.py +57 -0
- algokit_transact/codec/transaction.py +65 -0
- algokit_transact/exceptions.py +17 -0
- algokit_transact/logicsig.py +220 -0
- algokit_transact/models/__init__.py +0 -0
- algokit_transact/models/app_call.py +447 -0
- algokit_transact/models/asset_config.py +19 -0
- algokit_transact/models/asset_freeze.py +11 -0
- algokit_transact/models/asset_transfer.py +13 -0
- algokit_transact/models/common.py +17 -0
- algokit_transact/models/heartbeat.py +21 -0
- algokit_transact/models/key_registration.py +14 -0
- algokit_transact/models/payment.py +14 -0
- algokit_transact/models/signed_transaction.py +21 -0
- algokit_transact/models/state_proof.py +150 -0
- algokit_transact/models/transaction.py +88 -0
- algokit_transact/multisig.py +93 -0
- algokit_transact/ops/__init__.py +0 -0
- algokit_transact/ops/fees.py +47 -0
- algokit_transact/ops/group.py +28 -0
- algokit_transact/ops/ids.py +14 -0
- algokit_transact/ops/validate.py +503 -0
- algokit_transact/py.typed +0 -0
- algokit_transact/signer.py +195 -0
- algokit_transact/signing/__init__.py +0 -0
- algokit_transact/signing/logic_signature.py +19 -0
- algokit_transact/signing/multisig.py +84 -0
- algokit_transact/signing/types.py +39 -0
- algokit_transact/signing/validation.py +63 -0
- algokit_utils/__init__.py +23 -0
- algokit_utils/_debugging.py +304 -0
- algokit_utils/accounts/__init__.py +2 -0
- algokit_utils/accounts/account_manager.py +1051 -0
- algokit_utils/accounts/kmd_account_manager.py +206 -0
- algokit_utils/algo25.py +46 -0
- algokit_utils/algorand.py +383 -0
- algokit_utils/applications/__init__.py +7 -0
- algokit_utils/applications/abi.py +280 -0
- algokit_utils/applications/app_client.py +2193 -0
- algokit_utils/applications/app_deployer.py +788 -0
- algokit_utils/applications/app_factory.py +1140 -0
- algokit_utils/applications/app_manager.py +575 -0
- algokit_utils/applications/app_spec/__init__.py +6 -0
- algokit_utils/applications/enums.py +40 -0
- algokit_utils/assets/__init__.py +1 -0
- algokit_utils/assets/asset_manager.py +344 -0
- algokit_utils/clients/__init__.py +41 -0
- algokit_utils/clients/client_manager.py +756 -0
- algokit_utils/clients/dispenser_api_client.py +212 -0
- algokit_utils/common.py +40 -0
- algokit_utils/config.py +159 -0
- algokit_utils/errors/__init__.py +1 -0
- algokit_utils/errors/logic_error.py +160 -0
- algokit_utils/models/__init__.py +7 -0
- algokit_utils/models/account.py +12 -0
- algokit_utils/models/amount.py +198 -0
- algokit_utils/models/application.py +90 -0
- algokit_utils/models/network.py +29 -0
- algokit_utils/models/simulate.py +7 -0
- algokit_utils/models/state.py +53 -0
- algokit_utils/models/transaction.py +49 -0
- algokit_utils/protocols/__init__.py +3 -0
- algokit_utils/protocols/account.py +11 -0
- algokit_utils/protocols/signer.py +17 -0
- algokit_utils/protocols/typed_clients.py +110 -0
- algokit_utils/py.typed +0 -0
- algokit_utils/transact.py +195 -0
- algokit_utils/transactions/__init__.py +3 -0
- algokit_utils/transactions/builders/__init__.py +67 -0
- algokit_utils/transactions/builders/app.py +248 -0
- algokit_utils/transactions/builders/asset.py +256 -0
- algokit_utils/transactions/builders/common.py +263 -0
- algokit_utils/transactions/builders/keyreg.py +103 -0
- algokit_utils/transactions/builders/method_call.py +380 -0
- algokit_utils/transactions/builders/payment.py +43 -0
- algokit_utils/transactions/composer_resources.py +409 -0
- algokit_utils/transactions/fee_coverage.py +79 -0
- algokit_utils/transactions/helpers.py +9 -0
- algokit_utils/transactions/transaction_composer.py +1574 -0
- algokit_utils/transactions/transaction_creator.py +699 -0
- algokit_utils/transactions/transaction_sender.py +1240 -0
- algokit_utils/transactions/types.py +262 -0
- algokit_utils-5.0.0a3.dist-info/METADATA +105 -0
- algokit_utils-5.0.0a3.dist-info/RECORD +337 -0
- algokit_utils-5.0.0a3.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,699 @@
|
|
|
1
|
+
from collections.abc import Callable
|
|
2
|
+
from dataclasses import replace
|
|
3
|
+
from typing import TypeVar
|
|
4
|
+
|
|
5
|
+
from algokit_transact import Transaction
|
|
6
|
+
from algokit_utils.transactions.transaction_composer import (
|
|
7
|
+
AppCallMethodCallParams,
|
|
8
|
+
AppCallParams,
|
|
9
|
+
AppCreateMethodCallParams,
|
|
10
|
+
AppCreateParams,
|
|
11
|
+
AppDeleteMethodCallParams,
|
|
12
|
+
AppDeleteParams,
|
|
13
|
+
AppUpdateMethodCallParams,
|
|
14
|
+
AppUpdateParams,
|
|
15
|
+
AssetConfigParams,
|
|
16
|
+
AssetCreateParams,
|
|
17
|
+
AssetDestroyParams,
|
|
18
|
+
AssetFreezeParams,
|
|
19
|
+
AssetOptInParams,
|
|
20
|
+
AssetOptOutParams,
|
|
21
|
+
AssetTransferParams,
|
|
22
|
+
BuiltTransactions,
|
|
23
|
+
OfflineKeyRegistrationParams,
|
|
24
|
+
OnlineKeyRegistrationParams,
|
|
25
|
+
PaymentParams,
|
|
26
|
+
TransactionComposer,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
__all__ = [
|
|
30
|
+
"AlgorandClientTransactionCreator",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
TxnParam = TypeVar("TxnParam")
|
|
34
|
+
TxnResult = TypeVar("TxnResult")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class AlgorandClientTransactionCreator:
|
|
38
|
+
"""A creator for Algorand transactions.
|
|
39
|
+
|
|
40
|
+
Provides methods to create various types of Algorand transactions including payments,
|
|
41
|
+
asset operations, application calls and key registrations.
|
|
42
|
+
|
|
43
|
+
:param new_group: A lambda that starts a new TransactionComposer transaction group
|
|
44
|
+
|
|
45
|
+
:example:
|
|
46
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
47
|
+
>>> creator.payment(PaymentParams(sender="sender", receiver="receiver", amount=AlgoAmount.from_algo(1)))
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
def __init__(self, new_group: Callable[[], TransactionComposer]) -> None:
|
|
51
|
+
self._new_group = new_group
|
|
52
|
+
|
|
53
|
+
def _transaction(
|
|
54
|
+
self, c: Callable[[TransactionComposer], Callable[[TxnParam], TransactionComposer]]
|
|
55
|
+
) -> Callable[[TxnParam], Transaction]:
|
|
56
|
+
def create_transaction(params: TxnParam) -> Transaction:
|
|
57
|
+
composer = self._new_group()
|
|
58
|
+
result = _with_group_ids_cleared(c(composer)(params).build_transactions())
|
|
59
|
+
return result.transactions[-1]
|
|
60
|
+
|
|
61
|
+
return create_transaction
|
|
62
|
+
|
|
63
|
+
def _transactions(
|
|
64
|
+
self, c: Callable[[TransactionComposer], Callable[[TxnParam], TransactionComposer]]
|
|
65
|
+
) -> Callable[[TxnParam], BuiltTransactions]:
|
|
66
|
+
def create_transactions(params: TxnParam) -> BuiltTransactions:
|
|
67
|
+
composer = self._new_group()
|
|
68
|
+
return _with_group_ids_cleared(c(composer)(params).build_transactions())
|
|
69
|
+
|
|
70
|
+
return create_transactions
|
|
71
|
+
|
|
72
|
+
@property
|
|
73
|
+
def payment(self) -> Callable[[PaymentParams], Transaction]:
|
|
74
|
+
"""Create a payment transaction to transfer Algo between accounts.
|
|
75
|
+
|
|
76
|
+
:example:
|
|
77
|
+
>>> #Basic example
|
|
78
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
79
|
+
>>> creator.payment(PaymentParams(sender="sender", receiver="receiver", amount=AlgoAmount.from_algo(4)))
|
|
80
|
+
:example:
|
|
81
|
+
>>> #Advanced example
|
|
82
|
+
>>> creator.payment(PaymentParams(
|
|
83
|
+
sender="SENDERADDRESS",
|
|
84
|
+
receiver="RECEIVERADDRESS",
|
|
85
|
+
amount=AlgoAmount.from_algo(4),
|
|
86
|
+
close_remainder_to="CLOSEREMAINDERTOADDRESS",
|
|
87
|
+
lease="lease",
|
|
88
|
+
note=b"note",
|
|
89
|
+
rekey_to="REKEYTOADDRESS",
|
|
90
|
+
first_valid_round=1000,
|
|
91
|
+
validity_window=10,
|
|
92
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
93
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
94
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
95
|
+
))
|
|
96
|
+
"""
|
|
97
|
+
return self._transaction(lambda c: c.add_payment)
|
|
98
|
+
|
|
99
|
+
@property
|
|
100
|
+
def asset_create(self) -> Callable[[AssetCreateParams], Transaction]:
|
|
101
|
+
"""Create a create Algorand Standard Asset transaction.
|
|
102
|
+
|
|
103
|
+
:example:
|
|
104
|
+
>>> #Basic example
|
|
105
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
106
|
+
>>> params = AssetCreateParams(sender="SENDER_ADDRESS", total=1000)
|
|
107
|
+
>>> txn = creator.asset_create(params)
|
|
108
|
+
:example:
|
|
109
|
+
>>> #Advanced example
|
|
110
|
+
>>> creator.asset_create(AssetCreateParams(
|
|
111
|
+
sender="SENDER_ADDRESS",
|
|
112
|
+
total=1000,
|
|
113
|
+
asset_name="MyAsset",
|
|
114
|
+
unit_name="MA",
|
|
115
|
+
url="https://example.com/asset",
|
|
116
|
+
decimals=0,
|
|
117
|
+
default_frozen=False,
|
|
118
|
+
manager="MANAGER_ADDRESS",
|
|
119
|
+
reserve="RESERVE_ADDRESS",
|
|
120
|
+
freeze="FREEZE_ADDRESS",
|
|
121
|
+
clawback="CLAWBACK_ADDRESS",
|
|
122
|
+
lease="lease",
|
|
123
|
+
note=b"note",
|
|
124
|
+
rekey_to="REKEYTOADDRESS",
|
|
125
|
+
first_valid_round=1000,
|
|
126
|
+
validity_window=10,
|
|
127
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
128
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
129
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
130
|
+
))
|
|
131
|
+
"""
|
|
132
|
+
return self._transaction(lambda c: c.add_asset_create)
|
|
133
|
+
|
|
134
|
+
@property
|
|
135
|
+
def asset_config(self) -> Callable[[AssetConfigParams], Transaction]:
|
|
136
|
+
"""Create an asset config transaction to reconfigure an existing Algorand Standard Asset.
|
|
137
|
+
|
|
138
|
+
:example:
|
|
139
|
+
>>> #Basic example
|
|
140
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
141
|
+
>>> params = AssetConfigParams(sender="SENDER_ADDRESS", asset_id=123456, manager="NEW_MANAGER_ADDRESS")
|
|
142
|
+
>>> txn = creator.asset_config(params)
|
|
143
|
+
:example:
|
|
144
|
+
>>> #Advanced example
|
|
145
|
+
>>> creator.asset_config(AssetConfigParams(
|
|
146
|
+
sender="SENDER_ADDRESS",
|
|
147
|
+
asset_id=123456,
|
|
148
|
+
manager="NEW_MANAGER_ADDRESS",
|
|
149
|
+
reserve="NEW_RESERVE_ADDRESS",
|
|
150
|
+
freeze="NEW_FREEZE_ADDRESS",
|
|
151
|
+
clawback="NEW_CLAWBACK_ADDRESS",
|
|
152
|
+
lease="lease",
|
|
153
|
+
note=b"note",
|
|
154
|
+
rekey_to="REKEYTOADDRESS",
|
|
155
|
+
first_valid_round=1000,
|
|
156
|
+
validity_window=10,
|
|
157
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
158
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
159
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
160
|
+
))
|
|
161
|
+
"""
|
|
162
|
+
return self._transaction(lambda c: c.add_asset_config)
|
|
163
|
+
|
|
164
|
+
@property
|
|
165
|
+
def asset_freeze(self) -> Callable[[AssetFreezeParams], Transaction]:
|
|
166
|
+
"""Create an Algorand Standard Asset freeze transaction.
|
|
167
|
+
|
|
168
|
+
:example:
|
|
169
|
+
>>> #Basic example
|
|
170
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
171
|
+
>>> params = AssetFreezeParams(sender="SENDER_ADDRESS",
|
|
172
|
+
asset_id=123456,
|
|
173
|
+
account="ACCOUNT_TO_FREEZE",
|
|
174
|
+
frozen=True)
|
|
175
|
+
>>> txn = creator.asset_freeze(params)
|
|
176
|
+
|
|
177
|
+
:example:
|
|
178
|
+
>>> #Advanced example
|
|
179
|
+
>>> creator.asset_freeze(AssetFreezeParams(
|
|
180
|
+
sender="SENDER_ADDRESS",
|
|
181
|
+
asset_id=123456,
|
|
182
|
+
account="ACCOUNT_TO_FREEZE",
|
|
183
|
+
frozen=True,
|
|
184
|
+
lease="lease",
|
|
185
|
+
note=b"note",
|
|
186
|
+
rekey_to="REKEYTOADDRESS",
|
|
187
|
+
first_valid_round=1000,
|
|
188
|
+
validity_window=10,
|
|
189
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
190
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
191
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
192
|
+
))
|
|
193
|
+
"""
|
|
194
|
+
return self._transaction(lambda c: c.add_asset_freeze)
|
|
195
|
+
|
|
196
|
+
@property
|
|
197
|
+
def asset_destroy(self) -> Callable[[AssetDestroyParams], Transaction]:
|
|
198
|
+
"""Create an Algorand Standard Asset destroy transaction.
|
|
199
|
+
|
|
200
|
+
:example:
|
|
201
|
+
>>> #Basic example
|
|
202
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
203
|
+
>>> params = AssetDestroyParams(sender="SENDER_ADDRESS", asset_id=123456)
|
|
204
|
+
>>> txn = creator.asset_destroy(params)
|
|
205
|
+
|
|
206
|
+
:example:
|
|
207
|
+
>>> #Advanced example
|
|
208
|
+
>>> creator.asset_destroy(AssetDestroyParams(
|
|
209
|
+
sender="SENDER_ADDRESS",
|
|
210
|
+
asset_id=123456,
|
|
211
|
+
lease="lease",
|
|
212
|
+
note=b"note",
|
|
213
|
+
rekey_to="REKEYTOADDRESS",
|
|
214
|
+
first_valid_round=1000,
|
|
215
|
+
validity_window=10,
|
|
216
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
217
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
218
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
219
|
+
))
|
|
220
|
+
"""
|
|
221
|
+
return self._transaction(lambda c: c.add_asset_destroy)
|
|
222
|
+
|
|
223
|
+
@property
|
|
224
|
+
def asset_transfer(self) -> Callable[[AssetTransferParams], Transaction]:
|
|
225
|
+
"""Create an Algorand Standard Asset transfer transaction.
|
|
226
|
+
|
|
227
|
+
:example:
|
|
228
|
+
>>> #Basic example
|
|
229
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
230
|
+
>>> params = AssetTransferParams(sender="SENDER_ADDRESS",
|
|
231
|
+
asset_id=123456,
|
|
232
|
+
amount=10,
|
|
233
|
+
receiver="RECEIVER_ADDRESS")
|
|
234
|
+
>>> txn = creator.asset_transfer(params)
|
|
235
|
+
|
|
236
|
+
:example:
|
|
237
|
+
>>> #Advanced example
|
|
238
|
+
>>> creator.asset_transfer(AssetTransferParams(
|
|
239
|
+
sender="SENDER_ADDRESS",
|
|
240
|
+
asset_id=123456,
|
|
241
|
+
amount=10,
|
|
242
|
+
receiver="RECEIVER_ADDRESS",
|
|
243
|
+
clawback_target="CLAWBACK_TARGET_ADDRESS",
|
|
244
|
+
close_asset_to="CLOSE_ASSET_TO_ADDRESS",
|
|
245
|
+
lease="lease",
|
|
246
|
+
note=b"note",
|
|
247
|
+
rekey_to="REKEYTOADDRESS",
|
|
248
|
+
first_valid_round=1000,
|
|
249
|
+
validity_window=10,
|
|
250
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
251
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
252
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
253
|
+
))
|
|
254
|
+
"""
|
|
255
|
+
return self._transaction(lambda c: c.add_asset_transfer)
|
|
256
|
+
|
|
257
|
+
@property
|
|
258
|
+
def asset_opt_in(self) -> Callable[[AssetOptInParams], Transaction]:
|
|
259
|
+
"""Create an Algorand Standard Asset opt-in transaction.
|
|
260
|
+
|
|
261
|
+
:example:
|
|
262
|
+
>>> # Basic example
|
|
263
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
264
|
+
>>> params = AssetOptInParams(sender="SENDER_ADDRESS", asset_id=123456)
|
|
265
|
+
>>> txn = creator.asset_opt_in(params)
|
|
266
|
+
|
|
267
|
+
:example:
|
|
268
|
+
>>> # Advanced example
|
|
269
|
+
>>> creator.asset_opt_in(AssetOptInParams(
|
|
270
|
+
sender="SENDER_ADDRESS",
|
|
271
|
+
asset_id=123456,
|
|
272
|
+
lease="lease",
|
|
273
|
+
note=b"note",
|
|
274
|
+
rekey_to="REKEYTOADDRESS",
|
|
275
|
+
first_valid_round=1000,
|
|
276
|
+
validity_window=10,
|
|
277
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
278
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
279
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
280
|
+
))
|
|
281
|
+
"""
|
|
282
|
+
return self._transaction(lambda c: c.add_asset_opt_in)
|
|
283
|
+
|
|
284
|
+
@property
|
|
285
|
+
def asset_opt_out(self) -> Callable[[AssetOptOutParams], Transaction]:
|
|
286
|
+
"""Create an asset opt-out transaction.
|
|
287
|
+
|
|
288
|
+
:example:
|
|
289
|
+
>>> #Basic example
|
|
290
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
291
|
+
>>> params = AssetOptOutParams(sender="SENDER_ADDRESS", asset_id=123456, creator="CREATOR_ADDRESS")
|
|
292
|
+
>>> txn = creator.asset_opt_out(params)
|
|
293
|
+
|
|
294
|
+
:example:
|
|
295
|
+
>>> #Advanced example
|
|
296
|
+
>>> creator.asset_opt_out(AssetOptOutParams(
|
|
297
|
+
sender="SENDER_ADDRESS",
|
|
298
|
+
asset_id=123456,
|
|
299
|
+
creator="CREATOR_ADDRESS",
|
|
300
|
+
lease="lease",
|
|
301
|
+
note=b"note",
|
|
302
|
+
rekey_to="REKEYTOADDRESS",
|
|
303
|
+
first_valid_round=1000,
|
|
304
|
+
validity_window=10,
|
|
305
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
306
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
307
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
308
|
+
))
|
|
309
|
+
"""
|
|
310
|
+
return self._transaction(lambda c: c.add_asset_opt_out)
|
|
311
|
+
|
|
312
|
+
@property
|
|
313
|
+
def app_create(self) -> Callable[[AppCreateParams], Transaction]:
|
|
314
|
+
"""Create an application create transaction.
|
|
315
|
+
|
|
316
|
+
:example:
|
|
317
|
+
>>> #Basic example
|
|
318
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
319
|
+
>>> params = AppCreateParams(
|
|
320
|
+
... sender="SENDER_ADDRESS",
|
|
321
|
+
... approval_program="TEAL_APPROVAL_CODE",
|
|
322
|
+
... clear_state_program="TEAL_CLEAR_CODE",
|
|
323
|
+
... schema={
|
|
324
|
+
... 'global_ints': 1,
|
|
325
|
+
... 'global_byte_slices': 1,
|
|
326
|
+
... 'local_ints': 1,
|
|
327
|
+
... 'local_byte_slices': 1
|
|
328
|
+
... }
|
|
329
|
+
... )
|
|
330
|
+
>>> txn = creator.app_create(params)
|
|
331
|
+
|
|
332
|
+
:example:
|
|
333
|
+
>>> #Advanced example
|
|
334
|
+
>>> creator.app_create(AppCreateParams(
|
|
335
|
+
sender="SENDER_ADDRESS",
|
|
336
|
+
approval_program="TEAL_APPROVAL_CODE",
|
|
337
|
+
clear_state_program="TEAL_CLEAR_CODE",
|
|
338
|
+
schema={'global_ints': 1, 'global_byte_slices': 1, 'local_ints': 1, 'local_byte_slices': 1},
|
|
339
|
+
on_complete=OnApplicationComplete.NoOp,
|
|
340
|
+
args=[b'arg1', b'arg2'],
|
|
341
|
+
account_references=["ACCOUNT1"],
|
|
342
|
+
app_references=[789],
|
|
343
|
+
asset_references=[123],
|
|
344
|
+
box_references=[],
|
|
345
|
+
extra_program_pages=0,
|
|
346
|
+
lease="lease",
|
|
347
|
+
note=b"note",
|
|
348
|
+
rekey_to="REKEYTOADDRESS",
|
|
349
|
+
first_valid_round=1000,
|
|
350
|
+
validity_window=10,
|
|
351
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
352
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
353
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
354
|
+
))
|
|
355
|
+
"""
|
|
356
|
+
return self._transaction(lambda c: c.add_app_create)
|
|
357
|
+
|
|
358
|
+
@property
|
|
359
|
+
def app_update(self) -> Callable[[AppUpdateParams], Transaction]:
|
|
360
|
+
"""Create an application update transaction.
|
|
361
|
+
|
|
362
|
+
:example:
|
|
363
|
+
>>> #Basic example
|
|
364
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
365
|
+
>>> txn = creator.app_update(AppUpdateParams(sender="SENDER_ADDRESS",
|
|
366
|
+
app_id=789,
|
|
367
|
+
approval_program="TEAL_NEW_APPROVAL_CODE",
|
|
368
|
+
clear_state_program="TEAL_NEW_CLEAR_CODE",
|
|
369
|
+
args=[b'new_arg1', b'new_arg2']))
|
|
370
|
+
|
|
371
|
+
:example:
|
|
372
|
+
>>> #Advanced example
|
|
373
|
+
>>> creator.app_update(AppUpdateParams(
|
|
374
|
+
sender="SENDER_ADDRESS",
|
|
375
|
+
app_id=789,
|
|
376
|
+
approval_program="TEAL_NEW_APPROVAL_CODE",
|
|
377
|
+
clear_state_program="TEAL_NEW_CLEAR_CODE",
|
|
378
|
+
args=[b'new_arg1', b'new_arg2'],
|
|
379
|
+
account_references=["ACCOUNT1"],
|
|
380
|
+
app_references=[789],
|
|
381
|
+
asset_references=[123],
|
|
382
|
+
box_references=[],
|
|
383
|
+
on_complete=OnApplicationComplete.UpdateApplication,
|
|
384
|
+
lease="lease",
|
|
385
|
+
note=b"note",
|
|
386
|
+
rekey_to="REKEYTOADDRESS",
|
|
387
|
+
first_valid_round=1000,
|
|
388
|
+
validity_window=10,
|
|
389
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
390
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
391
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
392
|
+
))
|
|
393
|
+
"""
|
|
394
|
+
return self._transaction(lambda c: c.add_app_update)
|
|
395
|
+
|
|
396
|
+
@property
|
|
397
|
+
def app_delete(self) -> Callable[[AppDeleteParams], Transaction]:
|
|
398
|
+
"""Create an application delete transaction.
|
|
399
|
+
|
|
400
|
+
:example:
|
|
401
|
+
>>> #Basic example
|
|
402
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
403
|
+
>>> params = AppDeleteParams(sender="SENDER_ADDRESS", app_id=789, args=[b'delete_arg'])
|
|
404
|
+
>>> txn = creator.app_delete(params)
|
|
405
|
+
|
|
406
|
+
:example:
|
|
407
|
+
>>> #Advanced example
|
|
408
|
+
>>> creator.app_delete(AppDeleteParams(
|
|
409
|
+
sender="SENDER_ADDRESS",
|
|
410
|
+
app_id=789,
|
|
411
|
+
args=[b'delete_arg'],
|
|
412
|
+
account_references=["ACCOUNT1"],
|
|
413
|
+
app_references=[789],
|
|
414
|
+
asset_references=[123],
|
|
415
|
+
box_references=[],
|
|
416
|
+
on_complete=OnApplicationComplete.DeleteApplication,
|
|
417
|
+
lease="lease",
|
|
418
|
+
note=b"note",
|
|
419
|
+
rekey_to="REKEYTOADDRESS",
|
|
420
|
+
first_valid_round=1000,
|
|
421
|
+
validity_window=10,
|
|
422
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
423
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
424
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
425
|
+
))
|
|
426
|
+
"""
|
|
427
|
+
return self._transaction(lambda c: c.add_app_delete)
|
|
428
|
+
|
|
429
|
+
@property
|
|
430
|
+
def app_call(self) -> Callable[[AppCallParams], Transaction]:
|
|
431
|
+
"""Create an application call transaction.
|
|
432
|
+
|
|
433
|
+
:example:
|
|
434
|
+
>>> #Basic example
|
|
435
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
436
|
+
>>> params = AppCallParams(
|
|
437
|
+
... sender="SENDER_ADDRESS",
|
|
438
|
+
... on_complete=OnApplicationComplete.NoOp,
|
|
439
|
+
... app_id=789,
|
|
440
|
+
... approval_program="TEAL_APPROVAL_CODE",
|
|
441
|
+
... clear_state_program="TEAL_CLEAR_CODE",
|
|
442
|
+
... schema={
|
|
443
|
+
... 'global_ints': 1,
|
|
444
|
+
... 'global_byte_slices': 1,
|
|
445
|
+
... 'local_ints': 1,
|
|
446
|
+
... 'local_byte_slices': 1
|
|
447
|
+
... },
|
|
448
|
+
... args=[b'arg1', b'arg2'],
|
|
449
|
+
... account_references=["ACCOUNT1"],
|
|
450
|
+
... app_references=[789],
|
|
451
|
+
... asset_references=[123],
|
|
452
|
+
... extra_pages=0,
|
|
453
|
+
... box_references=[]
|
|
454
|
+
... )
|
|
455
|
+
>>> txn = creator.app_call(params)
|
|
456
|
+
|
|
457
|
+
:example:
|
|
458
|
+
>>> #Advanced example
|
|
459
|
+
>>> creator.app_call(AppCallParams(
|
|
460
|
+
sender="SENDER_ADDRESS",
|
|
461
|
+
on_complete=OnApplicationComplete.NoOp,
|
|
462
|
+
app_id=789,
|
|
463
|
+
approval_program="TEAL_APPROVAL_CODE",
|
|
464
|
+
clear_state_program="TEAL_CLEAR_CODE",
|
|
465
|
+
schema={'global_ints': 1, 'global_byte_slices': 1, 'local_ints': 1, 'local_byte_slices': 1},
|
|
466
|
+
args=[b'arg1', b'arg2'],
|
|
467
|
+
account_references=["ACCOUNT1"],
|
|
468
|
+
app_references=[789],
|
|
469
|
+
asset_references=[123],
|
|
470
|
+
extra_pages=0,
|
|
471
|
+
box_references=[],
|
|
472
|
+
lease="lease",
|
|
473
|
+
note=b"note",
|
|
474
|
+
rekey_to="REKEYTOADDRESS",
|
|
475
|
+
first_valid_round=1000,
|
|
476
|
+
validity_window=10,
|
|
477
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
478
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
479
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
480
|
+
))
|
|
481
|
+
"""
|
|
482
|
+
return self._transaction(lambda c: c.add_app_call)
|
|
483
|
+
|
|
484
|
+
@property
|
|
485
|
+
def app_create_method_call(self) -> Callable[[AppCreateMethodCallParams], BuiltTransactions]:
|
|
486
|
+
"""Create an application create call with ABI method call transaction.
|
|
487
|
+
|
|
488
|
+
:example:
|
|
489
|
+
>>> #Basic example
|
|
490
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
491
|
+
>>> params = AppCreateMethodCallParams(sender="SENDER_ADDRESS", app_id=0, method=some_abi_method_object)
|
|
492
|
+
>>> built_txns = creator.app_create_method_call(params)
|
|
493
|
+
|
|
494
|
+
:example:
|
|
495
|
+
>>> #Advanced example
|
|
496
|
+
>>> creator.app_create_method_call(AppCreateMethodCallParams(
|
|
497
|
+
sender="SENDER_ADDRESS",
|
|
498
|
+
app_id=0,
|
|
499
|
+
method=some_abi_method_object,
|
|
500
|
+
args=[b'method_arg'],
|
|
501
|
+
account_references=["ACCOUNT1"],
|
|
502
|
+
app_references=[789],
|
|
503
|
+
asset_references=[123],
|
|
504
|
+
box_references=[],
|
|
505
|
+
schema={'global_ints': 1, 'global_byte_slices': 1, 'local_ints': 1, 'local_byte_slices': 1},
|
|
506
|
+
approval_program="TEAL_APPROVAL_CODE",
|
|
507
|
+
clear_state_program="TEAL_CLEAR_CODE",
|
|
508
|
+
on_complete=OnApplicationComplete.NoOp,
|
|
509
|
+
extra_program_pages=0,
|
|
510
|
+
lease="lease",
|
|
511
|
+
note=b"note",
|
|
512
|
+
rekey_to="REKEYTOADDRESS",
|
|
513
|
+
first_valid_round=1000,
|
|
514
|
+
validity_window=10,
|
|
515
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
516
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
517
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
518
|
+
))
|
|
519
|
+
"""
|
|
520
|
+
return self._transactions(lambda c: c.add_app_create_method_call)
|
|
521
|
+
|
|
522
|
+
@property
|
|
523
|
+
def app_update_method_call(self) -> Callable[[AppUpdateMethodCallParams], BuiltTransactions]:
|
|
524
|
+
"""Create an application update call with ABI method call transaction.
|
|
525
|
+
|
|
526
|
+
:example:
|
|
527
|
+
>>> #Basic example
|
|
528
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
529
|
+
>>> params = AppUpdateMethodCallParams(sender="SENDER_ADDRESS", app_id=789, method=some_abi_method_object)
|
|
530
|
+
>>> built_txns = creator.app_update_method_call(params)
|
|
531
|
+
|
|
532
|
+
:example:
|
|
533
|
+
>>> #Advanced example
|
|
534
|
+
>>> creator.app_update_method_call(AppUpdateMethodCallParams(
|
|
535
|
+
sender="SENDER_ADDRESS",
|
|
536
|
+
app_id=789,
|
|
537
|
+
method=some_abi_method_object,
|
|
538
|
+
args=[b'method_arg'],
|
|
539
|
+
account_references=["ACCOUNT1"],
|
|
540
|
+
app_references=[789],
|
|
541
|
+
asset_references=[123],
|
|
542
|
+
box_references=[],
|
|
543
|
+
schema={'global_ints': 1, 'global_byte_slices': 1, 'local_ints': 1, 'local_byte_slices': 1},
|
|
544
|
+
approval_program="TEAL_NEW_APPROVAL_CODE",
|
|
545
|
+
clear_state_program="TEAL_NEW_CLEAR_CODE",
|
|
546
|
+
on_complete=OnApplicationComplete.UpdateApplication,
|
|
547
|
+
lease="lease",
|
|
548
|
+
note=b"note",
|
|
549
|
+
rekey_to="REKEYTOADDRESS",
|
|
550
|
+
first_valid_round=1000,
|
|
551
|
+
validity_window=10,
|
|
552
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
553
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
554
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
555
|
+
))
|
|
556
|
+
"""
|
|
557
|
+
return self._transactions(lambda c: c.add_app_update_method_call)
|
|
558
|
+
|
|
559
|
+
@property
|
|
560
|
+
def app_delete_method_call(self) -> Callable[[AppDeleteMethodCallParams], BuiltTransactions]:
|
|
561
|
+
"""Create an application delete call with ABI method call transaction.
|
|
562
|
+
|
|
563
|
+
:example:
|
|
564
|
+
>>> #Basic example
|
|
565
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
566
|
+
>>> params = AppDeleteMethodCallParams(sender="SENDER_ADDRESS", app_id=789, method=some_abi_method_object)
|
|
567
|
+
>>> built_txns = creator.app_delete_method_call(params)
|
|
568
|
+
|
|
569
|
+
:example:
|
|
570
|
+
>>> #Advanced example
|
|
571
|
+
>>> creator.app_delete_method_call(AppDeleteMethodCallParams(
|
|
572
|
+
sender="SENDER_ADDRESS",
|
|
573
|
+
app_id=789,
|
|
574
|
+
method=some_abi_method_object,
|
|
575
|
+
args=[b'method_arg'],
|
|
576
|
+
account_references=["ACCOUNT1"],
|
|
577
|
+
app_references=[789],
|
|
578
|
+
asset_references=[123],
|
|
579
|
+
box_references=[],
|
|
580
|
+
lease="lease",
|
|
581
|
+
note=b"note",
|
|
582
|
+
rekey_to="REKEYTOADDRESS",
|
|
583
|
+
first_valid_round=1000,
|
|
584
|
+
validity_window=10,
|
|
585
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
586
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
587
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
588
|
+
))
|
|
589
|
+
"""
|
|
590
|
+
return self._transactions(lambda c: c.add_app_delete_method_call)
|
|
591
|
+
|
|
592
|
+
@property
|
|
593
|
+
def app_call_method_call(self) -> Callable[[AppCallMethodCallParams], BuiltTransactions]:
|
|
594
|
+
"""Create an application call with ABI method call transaction.
|
|
595
|
+
|
|
596
|
+
:example:
|
|
597
|
+
>>> #Basic example
|
|
598
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
599
|
+
>>> params = AppCallMethodCallParams(sender="SENDER_ADDRESS", app_id=789, method=some_abi_method_object)
|
|
600
|
+
>>> built_txns = creator.app_call_method_call(params)
|
|
601
|
+
:example: Advanced example
|
|
602
|
+
>>> creator.app_call_method_call(AppCallMethodCallParams(
|
|
603
|
+
sender="SENDER_ADDRESS",
|
|
604
|
+
app_id=789,
|
|
605
|
+
method=some_abi_method_object,
|
|
606
|
+
args=[b'method_arg'],
|
|
607
|
+
account_references=["ACCOUNT1"],
|
|
608
|
+
app_references=[789],
|
|
609
|
+
asset_references=[123],
|
|
610
|
+
box_references=[],
|
|
611
|
+
lease="lease",
|
|
612
|
+
note=b"note",
|
|
613
|
+
rekey_to="REKEYTOADDRESS",
|
|
614
|
+
first_valid_round=1000,
|
|
615
|
+
validity_window=10,
|
|
616
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
617
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
618
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
619
|
+
))
|
|
620
|
+
"""
|
|
621
|
+
return self._transactions(lambda c: c.add_app_call_method_call)
|
|
622
|
+
|
|
623
|
+
@property
|
|
624
|
+
def online_key_registration(self) -> Callable[[OnlineKeyRegistrationParams], Transaction]:
|
|
625
|
+
"""Create an online key registration transaction.
|
|
626
|
+
|
|
627
|
+
:example:
|
|
628
|
+
>>> #Basic example
|
|
629
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
630
|
+
>>> params = OnlineKeyRegistrationParams(
|
|
631
|
+
sender="SENDER_ADDRESS",
|
|
632
|
+
vote_key="VOTE_KEY",
|
|
633
|
+
selection_key="SELECTION_KEY",
|
|
634
|
+
vote_first=1000,
|
|
635
|
+
vote_last=2000,
|
|
636
|
+
vote_key_dilution=10,
|
|
637
|
+
state_proof_key=b"state_proof_key_bytes"
|
|
638
|
+
)
|
|
639
|
+
>>> txn = creator.online_key_registration(params)
|
|
640
|
+
|
|
641
|
+
:example:
|
|
642
|
+
>>> #Advanced example
|
|
643
|
+
>>> creator.online_key_registration(OnlineKeyRegistrationParams(
|
|
644
|
+
sender="SENDER_ADDRESS",
|
|
645
|
+
vote_key="VOTE_KEY",
|
|
646
|
+
selection_key="SELECTION_KEY",
|
|
647
|
+
vote_first=1000,
|
|
648
|
+
vote_last=2000,
|
|
649
|
+
vote_key_dilution=10,
|
|
650
|
+
state_proof_key=b"state_proof_key_bytes",
|
|
651
|
+
lease="lease",
|
|
652
|
+
note=b"note",
|
|
653
|
+
rekey_to="REKEYTOADDRESS",
|
|
654
|
+
first_valid_round=1000,
|
|
655
|
+
validity_window=10,
|
|
656
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
657
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
658
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
659
|
+
))
|
|
660
|
+
"""
|
|
661
|
+
return self._transaction(lambda c: c.add_online_key_registration)
|
|
662
|
+
|
|
663
|
+
@property
|
|
664
|
+
def offline_key_registration(self) -> Callable[[OfflineKeyRegistrationParams], Transaction]:
|
|
665
|
+
"""Create an offline key registration transaction.
|
|
666
|
+
|
|
667
|
+
:example:
|
|
668
|
+
>>> #Basic example
|
|
669
|
+
>>> creator = AlgorandClientTransactionCreator(lambda: TransactionComposer())
|
|
670
|
+
>>> txn = creator.offline_key_registration(OfflineKeyRegistrationParams(sender="SENDER_ADDRESS",
|
|
671
|
+
prevent_account_from_ever_participating_again=True))
|
|
672
|
+
|
|
673
|
+
:example:
|
|
674
|
+
>>> #Advanced example
|
|
675
|
+
>>> creator.offline_key_registration(OfflineKeyRegistrationParams(
|
|
676
|
+
sender="SENDER_ADDRESS",
|
|
677
|
+
prevent_account_from_ever_participating_again=True,
|
|
678
|
+
lease="lease",
|
|
679
|
+
note=b"note",
|
|
680
|
+
rekey_to="REKEYTOADDRESS",
|
|
681
|
+
first_valid_round=1000,
|
|
682
|
+
validity_window=10,
|
|
683
|
+
extra_fee=AlgoAmount.from_micro_algo(1000),
|
|
684
|
+
static_fee=AlgoAmount.from_micro_algo(1000),
|
|
685
|
+
max_fee=AlgoAmount.from_micro_algo(3000)
|
|
686
|
+
))
|
|
687
|
+
"""
|
|
688
|
+
return self._transaction(lambda c: c.add_offline_key_registration)
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
def _with_group_ids_cleared(built: BuiltTransactions) -> BuiltTransactions:
|
|
692
|
+
"""Return a copy of BuiltTransactions with group IDs cleared so callers can regroup or reuse transactions."""
|
|
693
|
+
|
|
694
|
+
stripped_transactions = [replace(txn, group=None) if txn.group is not None else txn for txn in built.transactions]
|
|
695
|
+
return BuiltTransactions(
|
|
696
|
+
transactions=stripped_transactions,
|
|
697
|
+
method_calls=built.method_calls,
|
|
698
|
+
signers=built.signers,
|
|
699
|
+
)
|