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,37 @@
|
|
|
1
|
+
# AUTO-GENERATED: oas_generator
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
|
+
|
|
6
|
+
from algokit_common.constants import ZERO_ADDRESS
|
|
7
|
+
from algokit_common.serde import wire
|
|
8
|
+
|
|
9
|
+
from ._serde_helpers import decode_bytes_base64, encode_bytes_base64
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass(slots=True)
|
|
13
|
+
class SignProgramRequest:
|
|
14
|
+
"""
|
|
15
|
+
The request for `POST /v1/program/sign`
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
address: str = field(
|
|
19
|
+
default=ZERO_ADDRESS,
|
|
20
|
+
metadata=wire("address"),
|
|
21
|
+
)
|
|
22
|
+
program: bytes = field(
|
|
23
|
+
default=b"",
|
|
24
|
+
metadata=wire(
|
|
25
|
+
"data",
|
|
26
|
+
encode=encode_bytes_base64,
|
|
27
|
+
decode=decode_bytes_base64,
|
|
28
|
+
),
|
|
29
|
+
)
|
|
30
|
+
wallet_handle_token: str = field(
|
|
31
|
+
default="",
|
|
32
|
+
metadata=wire("wallet_handle_token"),
|
|
33
|
+
)
|
|
34
|
+
wallet_password: str | None = field(
|
|
35
|
+
default=None,
|
|
36
|
+
metadata=wire("wallet_password"),
|
|
37
|
+
)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# AUTO-GENERATED: oas_generator
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
|
+
|
|
6
|
+
from algokit_common.serde import wire
|
|
7
|
+
|
|
8
|
+
from ._serde_helpers import decode_bytes_base64, encode_bytes_base64
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass(slots=True)
|
|
12
|
+
class SignProgramResponse:
|
|
13
|
+
"""
|
|
14
|
+
SignProgramResponse is the response to `POST /v1/data/sign`
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
sig: bytes = field(
|
|
18
|
+
default=b"",
|
|
19
|
+
metadata=wire(
|
|
20
|
+
"sig",
|
|
21
|
+
encode=encode_bytes_base64,
|
|
22
|
+
decode=decode_bytes_base64,
|
|
23
|
+
),
|
|
24
|
+
)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# AUTO-GENERATED: oas_generator
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
|
+
|
|
6
|
+
from algokit_common.serde import wire
|
|
7
|
+
|
|
8
|
+
from ._serde_helpers import decode_bytes_base64, encode_bytes_base64
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass(slots=True)
|
|
12
|
+
class SignTransactionResponse:
|
|
13
|
+
"""
|
|
14
|
+
SignTransactionResponse is the response to `POST /v1/transaction/sign`
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
signed_transaction: bytes = field(
|
|
18
|
+
default=b"",
|
|
19
|
+
metadata=wire(
|
|
20
|
+
"signed_transaction",
|
|
21
|
+
encode=encode_bytes_base64,
|
|
22
|
+
decode=decode_bytes_base64,
|
|
23
|
+
),
|
|
24
|
+
)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# AUTO-GENERATED: oas_generator
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
|
+
|
|
6
|
+
from algokit_common.serde import wire
|
|
7
|
+
|
|
8
|
+
from ._serde_helpers import decode_bytes_base64, encode_bytes_base64
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass(slots=True)
|
|
12
|
+
class SignTxnRequest:
|
|
13
|
+
"""
|
|
14
|
+
The request for `POST /v1/transaction/sign`
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
transaction: bytes = field(
|
|
18
|
+
default=b"",
|
|
19
|
+
metadata=wire(
|
|
20
|
+
"transaction",
|
|
21
|
+
encode=encode_bytes_base64,
|
|
22
|
+
decode=decode_bytes_base64,
|
|
23
|
+
),
|
|
24
|
+
)
|
|
25
|
+
wallet_handle_token: str = field(
|
|
26
|
+
default="",
|
|
27
|
+
metadata=wire("wallet_handle_token"),
|
|
28
|
+
)
|
|
29
|
+
public_key: list[int] | None = field(
|
|
30
|
+
default=None,
|
|
31
|
+
metadata=wire("public_key"),
|
|
32
|
+
)
|
|
33
|
+
wallet_password: str | None = field(
|
|
34
|
+
default=None,
|
|
35
|
+
metadata=wire("wallet_password"),
|
|
36
|
+
)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# AUTO-GENERATED: oas_generator
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
|
+
|
|
6
|
+
from algokit_common.serde import wire
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass(slots=True)
|
|
10
|
+
class VersionsResponse:
|
|
11
|
+
"""
|
|
12
|
+
VersionsResponse is the response to `GET /versions`
|
|
13
|
+
friendly:VersionsResponse
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
versions: list[str] = field(
|
|
17
|
+
default_factory=list,
|
|
18
|
+
metadata=wire("versions"),
|
|
19
|
+
)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# AUTO-GENERATED: oas_generator
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
|
+
|
|
6
|
+
from algokit_common.serde import wire
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass(slots=True)
|
|
10
|
+
class Wallet:
|
|
11
|
+
"""
|
|
12
|
+
Wallet is the API's representation of a wallet
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
driver_name: str = field(
|
|
16
|
+
default="",
|
|
17
|
+
metadata=wire("driver_name"),
|
|
18
|
+
)
|
|
19
|
+
driver_version: int = field(
|
|
20
|
+
default=0,
|
|
21
|
+
metadata=wire("driver_version"),
|
|
22
|
+
)
|
|
23
|
+
id_: str = field(
|
|
24
|
+
default="",
|
|
25
|
+
metadata=wire("id"),
|
|
26
|
+
)
|
|
27
|
+
mnemonic_ux: bool = field(
|
|
28
|
+
default=False,
|
|
29
|
+
metadata=wire("mnemonic_ux"),
|
|
30
|
+
)
|
|
31
|
+
name: str = field(
|
|
32
|
+
default="",
|
|
33
|
+
metadata=wire("name"),
|
|
34
|
+
)
|
|
35
|
+
supported_txs: list[str] = field(
|
|
36
|
+
default_factory=list,
|
|
37
|
+
metadata=wire("supported_txs"),
|
|
38
|
+
)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# AUTO-GENERATED: oas_generator
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
|
+
|
|
6
|
+
from algokit_common.serde import nested, wire
|
|
7
|
+
|
|
8
|
+
from ._wallet import Wallet
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass(slots=True)
|
|
12
|
+
class WalletHandle:
|
|
13
|
+
"""
|
|
14
|
+
WalletHandle includes the wallet the handle corresponds to
|
|
15
|
+
and the number of number of seconds to expiration
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
wallet: Wallet = field(
|
|
19
|
+
metadata=nested("wallet", lambda: Wallet, required=True),
|
|
20
|
+
)
|
|
21
|
+
expires_seconds: int = field(
|
|
22
|
+
default=0,
|
|
23
|
+
metadata=wire("expires_seconds"),
|
|
24
|
+
)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# AUTO-GENERATED: oas_generator
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
|
+
|
|
6
|
+
from algokit_common.serde import wire
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass(slots=True)
|
|
10
|
+
class WalletInfoRequest:
|
|
11
|
+
"""
|
|
12
|
+
The request for `POST /v1/wallet/info`
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
wallet_handle_token: str = field(
|
|
16
|
+
default="",
|
|
17
|
+
metadata=wire("wallet_handle_token"),
|
|
18
|
+
)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# AUTO-GENERATED: oas_generator
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
|
+
|
|
6
|
+
from algokit_common.serde import nested
|
|
7
|
+
|
|
8
|
+
from ._wallet_handle import WalletHandle
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass(slots=True)
|
|
12
|
+
class WalletInfoResponse:
|
|
13
|
+
"""
|
|
14
|
+
WalletInfoResponse is the response to `POST /v1/wallet/info`
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
wallet_handle: WalletHandle = field(
|
|
18
|
+
metadata=nested("wallet_handle", lambda: WalletHandle, required=True),
|
|
19
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# AUTO-GENERATED: oas_generator
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
from algokit_transact.codec.signed import (
|
|
2
|
+
decode_logic_signature,
|
|
3
|
+
decode_signed_transaction,
|
|
4
|
+
decode_signed_transactions,
|
|
5
|
+
encode_signed_transaction,
|
|
6
|
+
encode_signed_transactions,
|
|
7
|
+
)
|
|
8
|
+
from algokit_transact.codec.transaction import (
|
|
9
|
+
decode_transaction,
|
|
10
|
+
decode_transactions,
|
|
11
|
+
encode_transaction,
|
|
12
|
+
encode_transaction_raw,
|
|
13
|
+
encode_transactions,
|
|
14
|
+
from_transaction_dto,
|
|
15
|
+
get_encoded_transaction_type,
|
|
16
|
+
to_transaction_dto,
|
|
17
|
+
)
|
|
18
|
+
from algokit_transact.exceptions import (
|
|
19
|
+
AlgokitTransactError,
|
|
20
|
+
TransactionValidationError,
|
|
21
|
+
)
|
|
22
|
+
from algokit_transact.logicsig import LogicSigAccount
|
|
23
|
+
from algokit_transact.models.app_call import (
|
|
24
|
+
AppCallTransactionFields,
|
|
25
|
+
BoxReference,
|
|
26
|
+
HoldingReference,
|
|
27
|
+
LocalsReference,
|
|
28
|
+
ResourceReference,
|
|
29
|
+
)
|
|
30
|
+
from algokit_transact.models.asset_config import AssetConfigTransactionFields
|
|
31
|
+
from algokit_transact.models.asset_freeze import AssetFreezeTransactionFields
|
|
32
|
+
from algokit_transact.models.asset_transfer import AssetTransferTransactionFields
|
|
33
|
+
from algokit_transact.models.common import OnApplicationComplete, StateSchema
|
|
34
|
+
from algokit_transact.models.heartbeat import HeartbeatProof, HeartbeatTransactionFields
|
|
35
|
+
from algokit_transact.models.key_registration import KeyRegistrationTransactionFields
|
|
36
|
+
from algokit_transact.models.payment import PaymentTransactionFields
|
|
37
|
+
from algokit_transact.models.signed_transaction import SignedTransaction
|
|
38
|
+
from algokit_transact.models.state_proof import (
|
|
39
|
+
FalconSignatureStruct,
|
|
40
|
+
FalconVerifier,
|
|
41
|
+
HashFactory,
|
|
42
|
+
MerkleArrayProof,
|
|
43
|
+
MerkleSignatureVerifier,
|
|
44
|
+
Participant,
|
|
45
|
+
Reveal,
|
|
46
|
+
SigslotCommit,
|
|
47
|
+
StateProof,
|
|
48
|
+
StateProofMessage,
|
|
49
|
+
StateProofTransactionFields,
|
|
50
|
+
)
|
|
51
|
+
from algokit_transact.models.transaction import Transaction, TransactionType
|
|
52
|
+
from algokit_transact.multisig import MultisigAccount, MultisigMetadata
|
|
53
|
+
from algokit_transact.ops.fees import (
|
|
54
|
+
assign_fee,
|
|
55
|
+
calculate_fee,
|
|
56
|
+
estimate_transaction_size,
|
|
57
|
+
)
|
|
58
|
+
from algokit_transact.ops.group import (
|
|
59
|
+
group_transactions,
|
|
60
|
+
)
|
|
61
|
+
from algokit_transact.ops.ids import (
|
|
62
|
+
get_transaction_id,
|
|
63
|
+
get_transaction_id_raw,
|
|
64
|
+
)
|
|
65
|
+
from algokit_transact.ops.validate import (
|
|
66
|
+
ValidationIssue,
|
|
67
|
+
ValidationIssueCode,
|
|
68
|
+
validate_app_call_fields,
|
|
69
|
+
validate_asset_config_fields,
|
|
70
|
+
validate_asset_freeze_fields,
|
|
71
|
+
validate_asset_transfer_fields,
|
|
72
|
+
validate_key_registration_fields,
|
|
73
|
+
validate_transaction,
|
|
74
|
+
)
|
|
75
|
+
from algokit_transact.signer import (
|
|
76
|
+
Addressable,
|
|
77
|
+
AddressWithDelegatedLsigSigner,
|
|
78
|
+
AddressWithMxBytesSigner,
|
|
79
|
+
AddressWithProgramDataSigner,
|
|
80
|
+
AddressWithSigners,
|
|
81
|
+
AddressWithTransactionSigner,
|
|
82
|
+
BytesSigner,
|
|
83
|
+
DelegatedLsigSigner,
|
|
84
|
+
MxBytesSigner,
|
|
85
|
+
ProgramDataSigner,
|
|
86
|
+
TransactionSigner,
|
|
87
|
+
bytes_to_sign_for_delegation,
|
|
88
|
+
generate_address_with_signers,
|
|
89
|
+
make_basic_account_transaction_signer,
|
|
90
|
+
make_empty_transaction_signer,
|
|
91
|
+
program_data_to_sign,
|
|
92
|
+
)
|
|
93
|
+
from algokit_transact.signing.logic_signature import LogicSignature
|
|
94
|
+
from algokit_transact.signing.multisig import (
|
|
95
|
+
address_from_multisig_signature,
|
|
96
|
+
apply_multisig_subsignature,
|
|
97
|
+
merge_multisignatures,
|
|
98
|
+
new_multisig_signature,
|
|
99
|
+
participants_from_multisig_signature,
|
|
100
|
+
)
|
|
101
|
+
from algokit_transact.signing.types import MultisigSignature, MultisigSubsignature
|
|
102
|
+
from algokit_transact.signing.validation import sanity_check_program
|
|
103
|
+
|
|
104
|
+
__all__ = [
|
|
105
|
+
"Addressable",
|
|
106
|
+
"AddressWithDelegatedLsigSigner",
|
|
107
|
+
"AddressWithMxBytesSigner",
|
|
108
|
+
"AddressWithProgramDataSigner",
|
|
109
|
+
"AddressWithSigners",
|
|
110
|
+
"AddressWithTransactionSigner",
|
|
111
|
+
"AlgokitTransactError",
|
|
112
|
+
"AppCallTransactionFields",
|
|
113
|
+
"BoxReference",
|
|
114
|
+
"BytesSigner",
|
|
115
|
+
"HoldingReference",
|
|
116
|
+
"LocalsReference",
|
|
117
|
+
"ResourceReference",
|
|
118
|
+
"AssetConfigTransactionFields",
|
|
119
|
+
"AssetFreezeTransactionFields",
|
|
120
|
+
"AssetTransferTransactionFields",
|
|
121
|
+
"FalconSignatureStruct",
|
|
122
|
+
"FalconVerifier",
|
|
123
|
+
"HashFactory",
|
|
124
|
+
"HeartbeatTransactionFields",
|
|
125
|
+
"HeartbeatProof",
|
|
126
|
+
"KeyRegistrationTransactionFields",
|
|
127
|
+
"LogicSigAccount",
|
|
128
|
+
"LogicSignature",
|
|
129
|
+
"DelegatedLsigSigner",
|
|
130
|
+
"MerkleArrayProof",
|
|
131
|
+
"MerkleSignatureVerifier",
|
|
132
|
+
"MultisigAccount",
|
|
133
|
+
"MultisigMetadata",
|
|
134
|
+
"MultisigSignature",
|
|
135
|
+
"MultisigSubsignature",
|
|
136
|
+
"MxBytesSigner",
|
|
137
|
+
"OnApplicationComplete",
|
|
138
|
+
"Participant",
|
|
139
|
+
"PaymentTransactionFields",
|
|
140
|
+
"ProgramDataSigner",
|
|
141
|
+
"Reveal",
|
|
142
|
+
"SigslotCommit",
|
|
143
|
+
"SignedTransaction",
|
|
144
|
+
"StateProof",
|
|
145
|
+
"StateProofTransactionFields",
|
|
146
|
+
"StateProofMessage",
|
|
147
|
+
"StateSchema",
|
|
148
|
+
"Transaction",
|
|
149
|
+
"TransactionSigner",
|
|
150
|
+
"TransactionType",
|
|
151
|
+
"TransactionValidationError",
|
|
152
|
+
"address_from_multisig_signature",
|
|
153
|
+
"apply_multisig_subsignature",
|
|
154
|
+
"assign_fee",
|
|
155
|
+
"bytes_to_sign_for_delegation",
|
|
156
|
+
"calculate_fee",
|
|
157
|
+
"decode_logic_signature",
|
|
158
|
+
"decode_signed_transaction",
|
|
159
|
+
"decode_signed_transactions",
|
|
160
|
+
"decode_transaction",
|
|
161
|
+
"decode_transactions",
|
|
162
|
+
"encode_signed_transaction",
|
|
163
|
+
"encode_signed_transactions",
|
|
164
|
+
"encode_transaction",
|
|
165
|
+
"encode_transaction_raw",
|
|
166
|
+
"encode_transactions",
|
|
167
|
+
"estimate_transaction_size",
|
|
168
|
+
"from_transaction_dto",
|
|
169
|
+
"generate_address_with_signers",
|
|
170
|
+
"get_encoded_transaction_type",
|
|
171
|
+
"get_transaction_id",
|
|
172
|
+
"get_transaction_id_raw",
|
|
173
|
+
"group_transactions",
|
|
174
|
+
"make_basic_account_transaction_signer",
|
|
175
|
+
"make_empty_transaction_signer",
|
|
176
|
+
"merge_multisignatures",
|
|
177
|
+
"new_multisig_signature",
|
|
178
|
+
"participants_from_multisig_signature",
|
|
179
|
+
"program_data_to_sign",
|
|
180
|
+
"sanity_check_program",
|
|
181
|
+
"to_transaction_dto",
|
|
182
|
+
"validate_app_call_fields",
|
|
183
|
+
"validate_asset_config_fields",
|
|
184
|
+
"validate_asset_freeze_fields",
|
|
185
|
+
"validate_asset_transfer_fields",
|
|
186
|
+
"validate_key_registration_fields",
|
|
187
|
+
"validate_transaction",
|
|
188
|
+
"ValidationIssue",
|
|
189
|
+
"ValidationIssueCode",
|
|
190
|
+
]
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from msgpack import packb, unpackb
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def encode_msgpack(value: object) -> bytes:
|
|
5
|
+
"""Encode a Python value into canonical msgpack bytes."""
|
|
6
|
+
return packb(value, use_bin_type=True, strict_types=True)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def decode_msgpack(data: bytes) -> object:
|
|
10
|
+
"""Decode msgpack bytes into a Python structure."""
|
|
11
|
+
return unpackb(data, raw=False, strict_map_key=False)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
from collections.abc import Iterable
|
|
2
|
+
from typing import cast
|
|
3
|
+
|
|
4
|
+
from algokit_common.constants import SIGNATURE_BYTE_LENGTH
|
|
5
|
+
from algokit_transact.codec.msgpack import decode_msgpack, encode_msgpack
|
|
6
|
+
from algokit_transact.codec.serde import from_wire, to_wire_canonical
|
|
7
|
+
from algokit_transact.models.signed_transaction import SignedTransaction
|
|
8
|
+
from algokit_transact.models.transaction import Transaction
|
|
9
|
+
from algokit_transact.ops.validate import validate_transaction
|
|
10
|
+
from algokit_transact.signing.logic_signature import LogicSignature
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _validate_signed_transaction(stx: SignedTransaction) -> None:
|
|
14
|
+
validate_transaction(stx.txn)
|
|
15
|
+
|
|
16
|
+
signatures = [stx.sig, stx.msig, stx.lsig]
|
|
17
|
+
set_count = sum(1 for item in signatures if item is not None)
|
|
18
|
+
if set_count == 0:
|
|
19
|
+
raise ValueError("At least one signature type must be set")
|
|
20
|
+
if set_count > 1:
|
|
21
|
+
raise ValueError("Only one signature type can be set")
|
|
22
|
+
|
|
23
|
+
if stx.sig is not None and len(stx.sig) != SIGNATURE_BYTE_LENGTH:
|
|
24
|
+
raise ValueError("Signature must be 64 bytes")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def encode_signed_transaction(stx: SignedTransaction) -> bytes:
|
|
28
|
+
_validate_signed_transaction(stx)
|
|
29
|
+
payload = to_wire_canonical(stx)
|
|
30
|
+
return encode_msgpack(payload)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def encode_signed_transactions(signed_transactions: Iterable[SignedTransaction]) -> list[bytes]:
|
|
34
|
+
return [encode_signed_transaction(stx) for stx in signed_transactions]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def decode_signed_transaction(encoded: bytes) -> SignedTransaction:
|
|
38
|
+
raw: object = decode_msgpack(encoded)
|
|
39
|
+
if not isinstance(raw, dict):
|
|
40
|
+
raise ValueError("decoded signed transaction is not a dict")
|
|
41
|
+
dto = cast(dict[str, object], raw)
|
|
42
|
+
stx = from_wire(SignedTransaction, dto)
|
|
43
|
+
if not isinstance(stx.txn, Transaction):
|
|
44
|
+
raise ValueError("signed transaction missing 'txn'")
|
|
45
|
+
return stx
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def decode_signed_transactions(encoded_signed_transactions: Iterable[bytes]) -> list[SignedTransaction]:
|
|
49
|
+
return [decode_signed_transaction(item) for item in encoded_signed_transactions]
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def decode_logic_signature(encoded: bytes) -> LogicSignature:
|
|
53
|
+
raw: object = decode_msgpack(encoded)
|
|
54
|
+
if not isinstance(raw, dict):
|
|
55
|
+
raise ValueError("decoded logic signature is not a dict")
|
|
56
|
+
dto = cast(dict[str, object], raw)
|
|
57
|
+
return from_wire(LogicSignature, dto)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from collections.abc import Iterable, Mapping
|
|
2
|
+
from typing import cast
|
|
3
|
+
|
|
4
|
+
from algokit_common.constants import TRANSACTION_DOMAIN_SEPARATOR
|
|
5
|
+
from algokit_transact.codec.msgpack import decode_msgpack, encode_msgpack
|
|
6
|
+
from algokit_transact.codec.serde import from_wire, to_wire, to_wire_canonical
|
|
7
|
+
from algokit_transact.models.transaction import Transaction, TransactionType
|
|
8
|
+
from algokit_transact.ops.validate import validate_transaction
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _from_type_str(s: str) -> TransactionType:
|
|
12
|
+
return TransactionType(s)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def to_transaction_dto(tx: Transaction) -> dict[str, object]:
|
|
16
|
+
return to_wire(tx)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def encode_transaction_raw(tx: Transaction) -> bytes:
|
|
20
|
+
validate_transaction(tx)
|
|
21
|
+
canonical = to_wire_canonical(tx)
|
|
22
|
+
return encode_msgpack(canonical)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def encode_transaction(tx: Transaction) -> bytes:
|
|
26
|
+
raw = encode_transaction_raw(tx)
|
|
27
|
+
prefix = TRANSACTION_DOMAIN_SEPARATOR.encode()
|
|
28
|
+
return prefix + raw
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def encode_transactions(transactions: Iterable[Transaction]) -> list[bytes]:
|
|
32
|
+
return [encode_transaction(tx) for tx in transactions]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def from_transaction_dto(dto: Mapping[str, object]) -> Transaction:
|
|
36
|
+
return from_wire(Transaction, dto)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def decode_transaction(encoded: bytes) -> Transaction:
|
|
40
|
+
if not encoded:
|
|
41
|
+
raise ValueError("attempted to decode 0 bytes")
|
|
42
|
+
|
|
43
|
+
prefix = TRANSACTION_DOMAIN_SEPARATOR.encode()
|
|
44
|
+
payload = encoded[len(prefix) :] if encoded.startswith(prefix) else encoded
|
|
45
|
+
|
|
46
|
+
raw = decode_msgpack(payload)
|
|
47
|
+
if not isinstance(raw, dict):
|
|
48
|
+
raise ValueError("decoded msgpack is not a dict")
|
|
49
|
+
|
|
50
|
+
return from_transaction_dto(cast(dict[str, object], raw))
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def decode_transactions(encoded_transactions: Iterable[bytes]) -> list[Transaction]:
|
|
54
|
+
return [decode_transaction(item) for item in encoded_transactions]
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def get_encoded_transaction_type(encoded_transaction: bytes) -> TransactionType:
|
|
58
|
+
prefix = TRANSACTION_DOMAIN_SEPARATOR.encode()
|
|
59
|
+
payload = encoded_transaction[len(prefix) :] if encoded_transaction.startswith(prefix) else encoded_transaction
|
|
60
|
+
|
|
61
|
+
raw = decode_msgpack(payload)
|
|
62
|
+
if isinstance(raw, dict) and isinstance(tx_type := raw.get("type"), str):
|
|
63
|
+
return _from_type_str(tx_type)
|
|
64
|
+
|
|
65
|
+
return decode_transaction(encoded_transaction).transaction_type
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from collections.abc import Sequence
|
|
2
|
+
from typing import TYPE_CHECKING
|
|
3
|
+
|
|
4
|
+
if TYPE_CHECKING:
|
|
5
|
+
from algokit_transact.ops.validate import ValidationIssue
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AlgokitTransactError(Exception):
|
|
9
|
+
"""Base error for algokit-transact."""
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class TransactionValidationError(AlgokitTransactError):
|
|
13
|
+
"""Raised when a transaction fails validation."""
|
|
14
|
+
|
|
15
|
+
def __init__(self, message: str, *, issues: "Sequence[ValidationIssue] | None" = None) -> None:
|
|
16
|
+
super().__init__(message)
|
|
17
|
+
self.issues: list[ValidationIssue] = list(issues or [])
|