stellar-sdk 13.2.1__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.
- stellar_sdk/__init__.py +47 -0
- stellar_sdk/__version__.py +17 -0
- stellar_sdk/account.py +126 -0
- stellar_sdk/address.py +250 -0
- stellar_sdk/asset.py +253 -0
- stellar_sdk/auth.py +150 -0
- stellar_sdk/base_server.py +342 -0
- stellar_sdk/base_soroban_server.py +74 -0
- stellar_sdk/base_transaction_envelope.py +152 -0
- stellar_sdk/call_builder/__init__.py +0 -0
- stellar_sdk/call_builder/base/__init__.py +19 -0
- stellar_sdk/call_builder/base/base_accounts_call_builder.py +76 -0
- stellar_sdk/call_builder/base/base_assets_call_builder.py +39 -0
- stellar_sdk/call_builder/base/base_call_builder.py +118 -0
- stellar_sdk/call_builder/base/base_claimable_balances_call_builder.py +63 -0
- stellar_sdk/call_builder/base/base_data_call_builder.py +18 -0
- stellar_sdk/call_builder/base/base_effects_call_builder.py +73 -0
- stellar_sdk/call_builder/base/base_fee_stats_call_builder.py +16 -0
- stellar_sdk/call_builder/base/base_ledgers_call_builder.py +27 -0
- stellar_sdk/call_builder/base/base_liquidity_pools_builder.py +56 -0
- stellar_sdk/call_builder/base/base_offers_call_builder.py +106 -0
- stellar_sdk/call_builder/base/base_operations_call_builder.py +105 -0
- stellar_sdk/call_builder/base/base_orderbook_call_builder.py +28 -0
- stellar_sdk/call_builder/base/base_payments_call_builder.py +69 -0
- stellar_sdk/call_builder/base/base_root_call_builder.py +13 -0
- stellar_sdk/call_builder/base/base_strict_receive_paths_call_builder.py +64 -0
- stellar_sdk/call_builder/base/base_strict_send_paths_call_builder.py +65 -0
- stellar_sdk/call_builder/base/base_trades_aggregation_call_builder.py +78 -0
- stellar_sdk/call_builder/base/base_trades_call_builder.py +84 -0
- stellar_sdk/call_builder/base/base_transactions_call_builder.py +83 -0
- stellar_sdk/call_builder/call_builder_async/__init__.py +19 -0
- stellar_sdk/call_builder/call_builder_async/accounts_call_builder.py +31 -0
- stellar_sdk/call_builder/call_builder_async/assets_call_builder.py +19 -0
- stellar_sdk/call_builder/call_builder_async/base_call_builder.py +110 -0
- stellar_sdk/call_builder/call_builder_async/claimable_balances_call_builder.py +19 -0
- stellar_sdk/call_builder/call_builder_async/data_call_builder.py +44 -0
- stellar_sdk/call_builder/call_builder_async/effects_call_builder.py +31 -0
- stellar_sdk/call_builder/call_builder_async/fee_stats_call_builder.py +19 -0
- stellar_sdk/call_builder/call_builder_async/ledgers_call_builder.py +31 -0
- stellar_sdk/call_builder/call_builder_async/liquidity_pools_builder.py +19 -0
- stellar_sdk/call_builder/call_builder_async/offers_call_builder.py +19 -0
- stellar_sdk/call_builder/call_builder_async/operations_call_builder.py +31 -0
- stellar_sdk/call_builder/call_builder_async/orderbook_call_builder.py +42 -0
- stellar_sdk/call_builder/call_builder_async/payments_call_builder.py +31 -0
- stellar_sdk/call_builder/call_builder_async/root_call_builder.py +17 -0
- stellar_sdk/call_builder/call_builder_async/strict_receive_paths_call_builder.py +55 -0
- stellar_sdk/call_builder/call_builder_async/strict_send_paths_call_builder.py +55 -0
- stellar_sdk/call_builder/call_builder_async/trades_aggregation_call_builder.py +51 -0
- stellar_sdk/call_builder/call_builder_async/trades_call_builder.py +31 -0
- stellar_sdk/call_builder/call_builder_async/transactions_call_builder.py +31 -0
- stellar_sdk/call_builder/call_builder_sync/__init__.py +19 -0
- stellar_sdk/call_builder/call_builder_sync/accounts_call_builder.py +31 -0
- stellar_sdk/call_builder/call_builder_sync/assets_call_builder.py +19 -0
- stellar_sdk/call_builder/call_builder_sync/base_call_builder.py +106 -0
- stellar_sdk/call_builder/call_builder_sync/claimable_balances_call_builder.py +19 -0
- stellar_sdk/call_builder/call_builder_sync/data_call_builder.py +44 -0
- stellar_sdk/call_builder/call_builder_sync/effects_call_builder.py +31 -0
- stellar_sdk/call_builder/call_builder_sync/fee_stats_call_builder.py +25 -0
- stellar_sdk/call_builder/call_builder_sync/ledgers_call_builder.py +31 -0
- stellar_sdk/call_builder/call_builder_sync/liquidity_pools_builder.py +19 -0
- stellar_sdk/call_builder/call_builder_sync/offers_call_builder.py +31 -0
- stellar_sdk/call_builder/call_builder_sync/operations_call_builder.py +31 -0
- stellar_sdk/call_builder/call_builder_sync/orderbook_call_builder.py +42 -0
- stellar_sdk/call_builder/call_builder_sync/payments_call_builder.py +31 -0
- stellar_sdk/call_builder/call_builder_sync/root_call_builder.py +17 -0
- stellar_sdk/call_builder/call_builder_sync/strict_receive_paths_call_builder.py +55 -0
- stellar_sdk/call_builder/call_builder_sync/strict_send_paths_call_builder.py +55 -0
- stellar_sdk/call_builder/call_builder_sync/trades_aggregation_call_builder.py +51 -0
- stellar_sdk/call_builder/call_builder_sync/trades_call_builder.py +31 -0
- stellar_sdk/call_builder/call_builder_sync/transactions_call_builder.py +31 -0
- stellar_sdk/client/__init__.py +0 -0
- stellar_sdk/client/aiohttp_client.py +277 -0
- stellar_sdk/client/base_async_client.py +63 -0
- stellar_sdk/client/base_sync_client.py +60 -0
- stellar_sdk/client/defines.py +7 -0
- stellar_sdk/client/requests_client.py +229 -0
- stellar_sdk/client/response.py +50 -0
- stellar_sdk/client/simple_requests_client.py +90 -0
- stellar_sdk/contract/__init__.py +4 -0
- stellar_sdk/contract/assembled_transaction.py +457 -0
- stellar_sdk/contract/assembled_transaction_async.py +463 -0
- stellar_sdk/contract/contract_client.py +235 -0
- stellar_sdk/contract/contract_client_async.py +222 -0
- stellar_sdk/contract/exceptions.py +68 -0
- stellar_sdk/decorated_signature.py +54 -0
- stellar_sdk/exceptions.py +209 -0
- stellar_sdk/fee_bump_transaction.py +120 -0
- stellar_sdk/fee_bump_transaction_envelope.py +132 -0
- stellar_sdk/helpers.py +38 -0
- stellar_sdk/keypair.py +419 -0
- stellar_sdk/ledger_bounds.py +61 -0
- stellar_sdk/liquidity_pool_asset.py +152 -0
- stellar_sdk/liquidity_pool_id.py +57 -0
- stellar_sdk/memo.py +264 -0
- stellar_sdk/muxed_account.py +159 -0
- stellar_sdk/network.py +67 -0
- stellar_sdk/operation/__init__.py +28 -0
- stellar_sdk/operation/account_merge.py +60 -0
- stellar_sdk/operation/allow_trust.py +149 -0
- stellar_sdk/operation/begin_sponsoring_future_reserves.py +70 -0
- stellar_sdk/operation/bump_sequence.py +57 -0
- stellar_sdk/operation/change_trust.py +85 -0
- stellar_sdk/operation/claim_claimable_balance.py +69 -0
- stellar_sdk/operation/clawback.py +74 -0
- stellar_sdk/operation/clawback_claimable_balance.py +68 -0
- stellar_sdk/operation/create_account.py +85 -0
- stellar_sdk/operation/create_claimable_balance.py +450 -0
- stellar_sdk/operation/create_passive_sell_offer.py +113 -0
- stellar_sdk/operation/end_sponsoring_future_reserves.py +47 -0
- stellar_sdk/operation/extend_footprint_ttl.py +60 -0
- stellar_sdk/operation/inflation.py +43 -0
- stellar_sdk/operation/invoke_host_function.py +65 -0
- stellar_sdk/operation/liquidity_pool_deposit.py +117 -0
- stellar_sdk/operation/liquidity_pool_withdraw.py +102 -0
- stellar_sdk/operation/manage_buy_offer.py +105 -0
- stellar_sdk/operation/manage_data.py +87 -0
- stellar_sdk/operation/manage_sell_offer.py +104 -0
- stellar_sdk/operation/operation.py +130 -0
- stellar_sdk/operation/path_payment_strict_receive.py +130 -0
- stellar_sdk/operation/path_payment_strict_send.py +130 -0
- stellar_sdk/operation/payment.py +80 -0
- stellar_sdk/operation/restore_footprint.py +45 -0
- stellar_sdk/operation/revoke_sponsorship.py +579 -0
- stellar_sdk/operation/set_options.py +254 -0
- stellar_sdk/operation/set_trust_line_flags.py +119 -0
- stellar_sdk/preconditions.py +216 -0
- stellar_sdk/price.py +95 -0
- stellar_sdk/py.typed +0 -0
- stellar_sdk/scval.py +819 -0
- stellar_sdk/sep/__init__.py +0 -0
- stellar_sdk/sep/ed25519_public_key_signer.py +20 -0
- stellar_sdk/sep/exceptions.py +50 -0
- stellar_sdk/sep/federation.py +239 -0
- stellar_sdk/sep/mnemonic.py +96 -0
- stellar_sdk/sep/stellar_soroban_web_authentication.py +670 -0
- stellar_sdk/sep/stellar_toml.py +96 -0
- stellar_sdk/sep/stellar_uri.py +514 -0
- stellar_sdk/sep/stellar_web_authentication.py +632 -0
- stellar_sdk/sep/toid.py +137 -0
- stellar_sdk/sep/txrep.py +1729 -0
- stellar_sdk/server.py +390 -0
- stellar_sdk/server_async.py +392 -0
- stellar_sdk/signer.py +97 -0
- stellar_sdk/signer_key.py +256 -0
- stellar_sdk/soroban_data_builder.py +105 -0
- stellar_sdk/soroban_rpc.py +546 -0
- stellar_sdk/soroban_server.py +576 -0
- stellar_sdk/soroban_server_async.py +575 -0
- stellar_sdk/strkey.py +484 -0
- stellar_sdk/time_bounds.py +68 -0
- stellar_sdk/transaction.py +302 -0
- stellar_sdk/transaction_builder.py +1714 -0
- stellar_sdk/transaction_envelope.py +170 -0
- stellar_sdk/utils.py +179 -0
- stellar_sdk/xdr/__init__.py +467 -0
- stellar_sdk/xdr/account_entry.py +196 -0
- stellar_sdk/xdr/account_entry_ext.py +93 -0
- stellar_sdk/xdr/account_entry_extension_v1.py +92 -0
- stellar_sdk/xdr/account_entry_extension_v1_ext.py +93 -0
- stellar_sdk/xdr/account_entry_extension_v2.py +126 -0
- stellar_sdk/xdr/account_entry_extension_v2_ext.py +93 -0
- stellar_sdk/xdr/account_entry_extension_v3.py +103 -0
- stellar_sdk/xdr/account_flags.py +66 -0
- stellar_sdk/xdr/account_id.py +60 -0
- stellar_sdk/xdr/account_merge_result.py +130 -0
- stellar_sdk/xdr/account_merge_result_code.py +67 -0
- stellar_sdk/xdr/allow_trust_op.py +99 -0
- stellar_sdk/xdr/allow_trust_result.py +104 -0
- stellar_sdk/xdr/allow_trust_result_code.py +66 -0
- stellar_sdk/xdr/alpha_num12.py +84 -0
- stellar_sdk/xdr/alpha_num4.py +84 -0
- stellar_sdk/xdr/asset.py +124 -0
- stellar_sdk/xdr/asset_code.py +117 -0
- stellar_sdk/xdr/asset_code12.py +60 -0
- stellar_sdk/xdr/asset_code4.py +60 -0
- stellar_sdk/xdr/asset_type.py +56 -0
- stellar_sdk/xdr/auth.py +71 -0
- stellar_sdk/xdr/auth_cert.py +97 -0
- stellar_sdk/xdr/authenticated_message.py +92 -0
- stellar_sdk/xdr/authenticated_message_v0.py +97 -0
- stellar_sdk/xdr/base.py +252 -0
- stellar_sdk/xdr/begin_sponsoring_future_reserves_op.py +71 -0
- stellar_sdk/xdr/begin_sponsoring_future_reserves_result.py +116 -0
- stellar_sdk/xdr/begin_sponsoring_future_reserves_result_code.py +59 -0
- stellar_sdk/xdr/binary_fuse_filter_type.py +54 -0
- stellar_sdk/xdr/bucket_entry.py +144 -0
- stellar_sdk/xdr/bucket_entry_type.py +58 -0
- stellar_sdk/xdr/bucket_list_type.py +52 -0
- stellar_sdk/xdr/bucket_metadata.py +94 -0
- stellar_sdk/xdr/bucket_metadata_ext.py +97 -0
- stellar_sdk/xdr/bump_sequence_op.py +71 -0
- stellar_sdk/xdr/bump_sequence_result.py +79 -0
- stellar_sdk/xdr/bump_sequence_result_code.py +54 -0
- stellar_sdk/xdr/change_trust_asset.py +145 -0
- stellar_sdk/xdr/change_trust_op.py +86 -0
- stellar_sdk/xdr/change_trust_result.py +117 -0
- stellar_sdk/xdr/change_trust_result_code.py +72 -0
- stellar_sdk/xdr/claim_atom.py +130 -0
- stellar_sdk/xdr/claim_atom_type.py +54 -0
- stellar_sdk/xdr/claim_claimable_balance_op.py +71 -0
- stellar_sdk/xdr/claim_claimable_balance_result.py +120 -0
- stellar_sdk/xdr/claim_claimable_balance_result_code.py +60 -0
- stellar_sdk/xdr/claim_liquidity_atom.py +119 -0
- stellar_sdk/xdr/claim_offer_atom.py +129 -0
- stellar_sdk/xdr/claim_offer_atom_v0.py +129 -0
- stellar_sdk/xdr/claim_predicate.py +203 -0
- stellar_sdk/xdr/claim_predicate_type.py +60 -0
- stellar_sdk/xdr/claimable_balance_entry.py +144 -0
- stellar_sdk/xdr/claimable_balance_entry_ext.py +93 -0
- stellar_sdk/xdr/claimable_balance_entry_extension_v1.py +92 -0
- stellar_sdk/xdr/claimable_balance_entry_extension_v1_ext.py +73 -0
- stellar_sdk/xdr/claimable_balance_flags.py +52 -0
- stellar_sdk/xdr/claimable_balance_id.py +87 -0
- stellar_sdk/xdr/claimable_balance_id_type.py +50 -0
- stellar_sdk/xdr/claimant.py +91 -0
- stellar_sdk/xdr/claimant_type.py +50 -0
- stellar_sdk/xdr/claimant_v0.py +86 -0
- stellar_sdk/xdr/clawback_claimable_balance_op.py +71 -0
- stellar_sdk/xdr/clawback_claimable_balance_result.py +114 -0
- stellar_sdk/xdr/clawback_claimable_balance_result_code.py +59 -0
- stellar_sdk/xdr/clawback_op.py +97 -0
- stellar_sdk/xdr/clawback_result.py +94 -0
- stellar_sdk/xdr/clawback_result_code.py +61 -0
- stellar_sdk/xdr/config_setting_contract_bandwidth_v0.py +100 -0
- stellar_sdk/xdr/config_setting_contract_compute_v0.py +112 -0
- stellar_sdk/xdr/config_setting_contract_events_v0.py +90 -0
- stellar_sdk/xdr/config_setting_contract_execution_lanes_v0.py +72 -0
- stellar_sdk/xdr/config_setting_contract_historical_data_v0.py +71 -0
- stellar_sdk/xdr/config_setting_contract_ledger_cost_ext_v0.py +91 -0
- stellar_sdk/xdr/config_setting_contract_ledger_cost_v0.py +226 -0
- stellar_sdk/xdr/config_setting_contract_parallel_compute_v0.py +78 -0
- stellar_sdk/xdr/config_setting_entry.py +570 -0
- stellar_sdk/xdr/config_setting_id.py +82 -0
- stellar_sdk/xdr/config_setting_scp_timing.py +125 -0
- stellar_sdk/xdr/config_upgrade_set.py +81 -0
- stellar_sdk/xdr/config_upgrade_set_key.py +86 -0
- stellar_sdk/xdr/constants.py +36 -0
- stellar_sdk/xdr/contract_code_cost_inputs.py +167 -0
- stellar_sdk/xdr/contract_code_entry.py +107 -0
- stellar_sdk/xdr/contract_code_entry_ext.py +97 -0
- stellar_sdk/xdr/contract_code_entry_v1.py +84 -0
- stellar_sdk/xdr/contract_cost_param_entry.py +97 -0
- stellar_sdk/xdr/contract_cost_params.py +74 -0
- stellar_sdk/xdr/contract_cost_type.py +267 -0
- stellar_sdk/xdr/contract_data_durability.py +51 -0
- stellar_sdk/xdr/contract_data_entry.py +116 -0
- stellar_sdk/xdr/contract_event.py +125 -0
- stellar_sdk/xdr/contract_event_body.py +91 -0
- stellar_sdk/xdr/contract_event_type.py +54 -0
- stellar_sdk/xdr/contract_event_v0.py +94 -0
- stellar_sdk/xdr/contract_executable.py +97 -0
- stellar_sdk/xdr/contract_executable_type.py +52 -0
- stellar_sdk/xdr/contract_id.py +60 -0
- stellar_sdk/xdr/contract_id_preimage.py +118 -0
- stellar_sdk/xdr/contract_id_preimage_from_address.py +84 -0
- stellar_sdk/xdr/contract_id_preimage_type.py +52 -0
- stellar_sdk/xdr/create_account_op.py +87 -0
- stellar_sdk/xdr/create_account_result.py +94 -0
- stellar_sdk/xdr/create_account_result_code.py +62 -0
- stellar_sdk/xdr/create_claimable_balance_op.py +108 -0
- stellar_sdk/xdr/create_claimable_balance_result.py +145 -0
- stellar_sdk/xdr/create_claimable_balance_result_code.py +60 -0
- stellar_sdk/xdr/create_contract_args.py +87 -0
- stellar_sdk/xdr/create_contract_args_v2.py +109 -0
- stellar_sdk/xdr/create_passive_sell_offer_op.py +106 -0
- stellar_sdk/xdr/crypto_key_type.py +60 -0
- stellar_sdk/xdr/curve25519_public.py +71 -0
- stellar_sdk/xdr/curve25519_secret.py +71 -0
- stellar_sdk/xdr/data_entry.py +114 -0
- stellar_sdk/xdr/data_entry_ext.py +73 -0
- stellar_sdk/xdr/data_value.py +60 -0
- stellar_sdk/xdr/decorated_signature.py +84 -0
- stellar_sdk/xdr/dependent_tx_cluster.py +73 -0
- stellar_sdk/xdr/diagnostic_event.py +87 -0
- stellar_sdk/xdr/dont_have.py +84 -0
- stellar_sdk/xdr/duration.py +60 -0
- stellar_sdk/xdr/encrypted_body.py +60 -0
- stellar_sdk/xdr/end_sponsoring_future_reserves_result.py +94 -0
- stellar_sdk/xdr/end_sponsoring_future_reserves_result_code.py +55 -0
- stellar_sdk/xdr/envelope_type.py +68 -0
- stellar_sdk/xdr/error.py +84 -0
- stellar_sdk/xdr/error_code.py +58 -0
- stellar_sdk/xdr/eviction_iterator.py +96 -0
- stellar_sdk/xdr/extend_footprint_ttl_op.py +84 -0
- stellar_sdk/xdr/extend_footprint_ttl_result.py +101 -0
- stellar_sdk/xdr/extend_footprint_ttl_result_code.py +59 -0
- stellar_sdk/xdr/extension_point.py +73 -0
- stellar_sdk/xdr/fee_bump_transaction.py +117 -0
- stellar_sdk/xdr/fee_bump_transaction_envelope.py +97 -0
- stellar_sdk/xdr/fee_bump_transaction_ext.py +73 -0
- stellar_sdk/xdr/fee_bump_transaction_inner_tx.py +87 -0
- stellar_sdk/xdr/flood_advert.py +71 -0
- stellar_sdk/xdr/flood_demand.py +71 -0
- stellar_sdk/xdr/generalized_transaction_set.py +92 -0
- stellar_sdk/xdr/hash.py +60 -0
- stellar_sdk/xdr/hash_id_preimage.py +176 -0
- stellar_sdk/xdr/hash_id_preimage_contract_id.py +87 -0
- stellar_sdk/xdr/hash_id_preimage_operation_id.py +97 -0
- stellar_sdk/xdr/hash_id_preimage_revoke_id.py +117 -0
- stellar_sdk/xdr/hash_id_preimage_soroban_authorization.py +107 -0
- stellar_sdk/xdr/hello.py +154 -0
- stellar_sdk/xdr/hmac_sha256_key.py +71 -0
- stellar_sdk/xdr/hmac_sha256_mac.py +71 -0
- stellar_sdk/xdr/host_function.py +150 -0
- stellar_sdk/xdr/host_function_type.py +56 -0
- stellar_sdk/xdr/hot_archive_bucket_entry.py +131 -0
- stellar_sdk/xdr/hot_archive_bucket_entry_type.py +56 -0
- stellar_sdk/xdr/inflation_payout.py +84 -0
- stellar_sdk/xdr/inflation_result.py +103 -0
- stellar_sdk/xdr/inflation_result_code.py +54 -0
- stellar_sdk/xdr/inner_transaction_result.py +130 -0
- stellar_sdk/xdr/inner_transaction_result_ext.py +73 -0
- stellar_sdk/xdr/inner_transaction_result_pair.py +87 -0
- stellar_sdk/xdr/inner_transaction_result_result.py +189 -0
- stellar_sdk/xdr/int128_parts.py +83 -0
- stellar_sdk/xdr/int256_parts.py +104 -0
- stellar_sdk/xdr/int32.py +60 -0
- stellar_sdk/xdr/int64.py +60 -0
- stellar_sdk/xdr/invoke_contract_args.py +107 -0
- stellar_sdk/xdr/invoke_host_function_op.py +97 -0
- stellar_sdk/xdr/invoke_host_function_result.py +128 -0
- stellar_sdk/xdr/invoke_host_function_result_code.py +63 -0
- stellar_sdk/xdr/invoke_host_function_success_pre_image.py +95 -0
- stellar_sdk/xdr/ip_addr_type.py +52 -0
- stellar_sdk/xdr/ledger_bounds.py +85 -0
- stellar_sdk/xdr/ledger_close_meta.py +122 -0
- stellar_sdk/xdr/ledger_close_meta_batch.py +112 -0
- stellar_sdk/xdr/ledger_close_meta_ext.py +93 -0
- stellar_sdk/xdr/ledger_close_meta_ext_v1.py +87 -0
- stellar_sdk/xdr/ledger_close_meta_v0.py +157 -0
- stellar_sdk/xdr/ledger_close_meta_v1.py +228 -0
- stellar_sdk/xdr/ledger_close_meta_v2.py +206 -0
- stellar_sdk/xdr/ledger_close_value_signature.py +84 -0
- stellar_sdk/xdr/ledger_entry.py +130 -0
- stellar_sdk/xdr/ledger_entry_change.py +151 -0
- stellar_sdk/xdr/ledger_entry_change_type.py +58 -0
- stellar_sdk/xdr/ledger_entry_changes.py +73 -0
- stellar_sdk/xdr/ledger_entry_data.py +258 -0
- stellar_sdk/xdr/ledger_entry_ext.py +93 -0
- stellar_sdk/xdr/ledger_entry_extension_v1.py +90 -0
- stellar_sdk/xdr/ledger_entry_extension_v1_ext.py +73 -0
- stellar_sdk/xdr/ledger_entry_type.py +68 -0
- stellar_sdk/xdr/ledger_footprint.py +104 -0
- stellar_sdk/xdr/ledger_header.py +239 -0
- stellar_sdk/xdr/ledger_header_ext.py +93 -0
- stellar_sdk/xdr/ledger_header_extension_v1.py +90 -0
- stellar_sdk/xdr/ledger_header_extension_v1_ext.py +73 -0
- stellar_sdk/xdr/ledger_header_flags.py +54 -0
- stellar_sdk/xdr/ledger_header_history_entry.py +104 -0
- stellar_sdk/xdr/ledger_header_history_entry_ext.py +73 -0
- stellar_sdk/xdr/ledger_key.py +299 -0
- stellar_sdk/xdr/ledger_key_account.py +71 -0
- stellar_sdk/xdr/ledger_key_claimable_balance.py +71 -0
- stellar_sdk/xdr/ledger_key_config_setting.py +71 -0
- stellar_sdk/xdr/ledger_key_contract_code.py +71 -0
- stellar_sdk/xdr/ledger_key_contract_data.py +97 -0
- stellar_sdk/xdr/ledger_key_data.py +84 -0
- stellar_sdk/xdr/ledger_key_liquidity_pool.py +71 -0
- stellar_sdk/xdr/ledger_key_offer.py +84 -0
- stellar_sdk/xdr/ledger_key_trust_line.py +84 -0
- stellar_sdk/xdr/ledger_key_ttl.py +72 -0
- stellar_sdk/xdr/ledger_scp_messages.py +95 -0
- stellar_sdk/xdr/ledger_upgrade.py +216 -0
- stellar_sdk/xdr/ledger_upgrade_type.py +62 -0
- stellar_sdk/xdr/liabilities.py +83 -0
- stellar_sdk/xdr/liquidity_pool_constant_product_parameters.py +96 -0
- stellar_sdk/xdr/liquidity_pool_deposit_op.py +115 -0
- stellar_sdk/xdr/liquidity_pool_deposit_result.py +115 -0
- stellar_sdk/xdr/liquidity_pool_deposit_result_code.py +71 -0
- stellar_sdk/xdr/liquidity_pool_entry.py +102 -0
- stellar_sdk/xdr/liquidity_pool_entry_body.py +102 -0
- stellar_sdk/xdr/liquidity_pool_entry_constant_product.py +118 -0
- stellar_sdk/xdr/liquidity_pool_parameters.py +95 -0
- stellar_sdk/xdr/liquidity_pool_type.py +50 -0
- stellar_sdk/xdr/liquidity_pool_withdraw_op.py +105 -0
- stellar_sdk/xdr/liquidity_pool_withdraw_result.py +117 -0
- stellar_sdk/xdr/liquidity_pool_withdraw_result_code.py +66 -0
- stellar_sdk/xdr/manage_buy_offer_op.py +118 -0
- stellar_sdk/xdr/manage_buy_offer_result.py +148 -0
- stellar_sdk/xdr/manage_buy_offer_result_code.py +81 -0
- stellar_sdk/xdr/manage_data_op.py +89 -0
- stellar_sdk/xdr/manage_data_result.py +94 -0
- stellar_sdk/xdr/manage_data_result_code.py +62 -0
- stellar_sdk/xdr/manage_offer_effect.py +54 -0
- stellar_sdk/xdr/manage_offer_success_result.py +105 -0
- stellar_sdk/xdr/manage_offer_success_result_offer.py +102 -0
- stellar_sdk/xdr/manage_sell_offer_op.py +117 -0
- stellar_sdk/xdr/manage_sell_offer_result.py +148 -0
- stellar_sdk/xdr/manage_sell_offer_result_code.py +84 -0
- stellar_sdk/xdr/memo.py +143 -0
- stellar_sdk/xdr/memo_type.py +58 -0
- stellar_sdk/xdr/message_type.py +104 -0
- stellar_sdk/xdr/muxed_account.py +110 -0
- stellar_sdk/xdr/muxed_account_med25519.py +84 -0
- stellar_sdk/xdr/muxed_ed25519_account.py +84 -0
- stellar_sdk/xdr/node_id.py +60 -0
- stellar_sdk/xdr/offer_entry.py +158 -0
- stellar_sdk/xdr/offer_entry_ext.py +73 -0
- stellar_sdk/xdr/offer_entry_flags.py +52 -0
- stellar_sdk/xdr/operation.py +152 -0
- stellar_sdk/xdr/operation_body.py +620 -0
- stellar_sdk/xdr/operation_meta.py +71 -0
- stellar_sdk/xdr/operation_meta_v2.py +110 -0
- stellar_sdk/xdr/operation_result.py +175 -0
- stellar_sdk/xdr/operation_result_code.py +63 -0
- stellar_sdk/xdr/operation_result_tr.py +718 -0
- stellar_sdk/xdr/operation_type.py +102 -0
- stellar_sdk/xdr/parallel_tx_execution_stage.py +74 -0
- stellar_sdk/xdr/parallel_txs_component.py +105 -0
- stellar_sdk/xdr/path_payment_strict_receive_op.py +139 -0
- stellar_sdk/xdr/path_payment_strict_receive_result.py +252 -0
- stellar_sdk/xdr/path_payment_strict_receive_result_code.py +86 -0
- stellar_sdk/xdr/path_payment_strict_receive_result_success.py +95 -0
- stellar_sdk/xdr/path_payment_strict_send_op.py +139 -0
- stellar_sdk/xdr/path_payment_strict_send_result.py +231 -0
- stellar_sdk/xdr/path_payment_strict_send_result_code.py +85 -0
- stellar_sdk/xdr/path_payment_strict_send_result_success.py +95 -0
- stellar_sdk/xdr/payment_op.py +97 -0
- stellar_sdk/xdr/payment_result.py +119 -0
- stellar_sdk/xdr/payment_result_code.py +71 -0
- stellar_sdk/xdr/peer_address.py +103 -0
- stellar_sdk/xdr/peer_address_ip.py +105 -0
- stellar_sdk/xdr/peer_stats.py +207 -0
- stellar_sdk/xdr/persisted_scp_state.py +102 -0
- stellar_sdk/xdr/persisted_scp_state_v0.py +128 -0
- stellar_sdk/xdr/persisted_scp_state_v1.py +109 -0
- stellar_sdk/xdr/pool_id.py +60 -0
- stellar_sdk/xdr/precondition_type.py +54 -0
- stellar_sdk/xdr/preconditions.py +116 -0
- stellar_sdk/xdr/preconditions_v2.py +177 -0
- stellar_sdk/xdr/price.py +83 -0
- stellar_sdk/xdr/public_key.py +87 -0
- stellar_sdk/xdr/public_key_type.py +50 -0
- stellar_sdk/xdr/restore_footprint_op.py +71 -0
- stellar_sdk/xdr/restore_footprint_result.py +98 -0
- stellar_sdk/xdr/restore_footprint_result_code.py +59 -0
- stellar_sdk/xdr/revoke_sponsorship_op.py +114 -0
- stellar_sdk/xdr/revoke_sponsorship_op_signer.py +86 -0
- stellar_sdk/xdr/revoke_sponsorship_result.py +102 -0
- stellar_sdk/xdr/revoke_sponsorship_result_code.py +63 -0
- stellar_sdk/xdr/revoke_sponsorship_type.py +52 -0
- stellar_sdk/xdr/sc_address.py +174 -0
- stellar_sdk/xdr/sc_address_type.py +58 -0
- stellar_sdk/xdr/sc_bytes.py +60 -0
- stellar_sdk/xdr/sc_contract_instance.py +88 -0
- stellar_sdk/xdr/sc_env_meta_entry.py +97 -0
- stellar_sdk/xdr/sc_env_meta_entry_interface_version.py +82 -0
- stellar_sdk/xdr/sc_env_meta_kind.py +50 -0
- stellar_sdk/xdr/sc_error.py +182 -0
- stellar_sdk/xdr/sc_error_code.py +68 -0
- stellar_sdk/xdr/sc_error_type.py +68 -0
- stellar_sdk/xdr/sc_map.py +71 -0
- stellar_sdk/xdr/sc_map_entry.py +83 -0
- stellar_sdk/xdr/sc_meta_entry.py +87 -0
- stellar_sdk/xdr/sc_meta_kind.py +50 -0
- stellar_sdk/xdr/sc_meta_v0.py +83 -0
- stellar_sdk/xdr/sc_nonce_key.py +70 -0
- stellar_sdk/xdr/sc_spec_entry.py +190 -0
- stellar_sdk/xdr/sc_spec_entry_kind.py +60 -0
- stellar_sdk/xdr/sc_spec_event_data_format.py +54 -0
- stellar_sdk/xdr/sc_spec_event_param_location_v0.py +52 -0
- stellar_sdk/xdr/sc_spec_event_param_v0.py +107 -0
- stellar_sdk/xdr/sc_spec_event_v0.py +147 -0
- stellar_sdk/xdr/sc_spec_function_input_v0.py +97 -0
- stellar_sdk/xdr/sc_spec_function_v0.py +129 -0
- stellar_sdk/xdr/sc_spec_type.py +106 -0
- stellar_sdk/xdr/sc_spec_type_bytes_n.py +71 -0
- stellar_sdk/xdr/sc_spec_type_def.py +297 -0
- stellar_sdk/xdr/sc_spec_type_map.py +83 -0
- stellar_sdk/xdr/sc_spec_type_option.py +71 -0
- stellar_sdk/xdr/sc_spec_type_result.py +83 -0
- stellar_sdk/xdr/sc_spec_type_tuple.py +82 -0
- stellar_sdk/xdr/sc_spec_type_udt.py +71 -0
- stellar_sdk/xdr/sc_spec_type_vec.py +71 -0
- stellar_sdk/xdr/sc_spec_udt_enum_case_v0.py +97 -0
- stellar_sdk/xdr/sc_spec_udt_enum_v0.py +117 -0
- stellar_sdk/xdr/sc_spec_udt_error_enum_case_v0.py +97 -0
- stellar_sdk/xdr/sc_spec_udt_error_enum_v0.py +117 -0
- stellar_sdk/xdr/sc_spec_udt_struct_field_v0.py +97 -0
- stellar_sdk/xdr/sc_spec_udt_struct_v0.py +117 -0
- stellar_sdk/xdr/sc_spec_udt_union_case_tuple_v0.py +108 -0
- stellar_sdk/xdr/sc_spec_udt_union_case_v0.py +114 -0
- stellar_sdk/xdr/sc_spec_udt_union_case_v0_kind.py +52 -0
- stellar_sdk/xdr/sc_spec_udt_union_case_void_v0.py +84 -0
- stellar_sdk/xdr/sc_spec_udt_union_v0.py +117 -0
- stellar_sdk/xdr/sc_string.py +60 -0
- stellar_sdk/xdr/sc_symbol.py +61 -0
- stellar_sdk/xdr/sc_val.py +474 -0
- stellar_sdk/xdr/sc_val_type.py +121 -0
- stellar_sdk/xdr/sc_vec.py +71 -0
- stellar_sdk/xdr/scp_ballot.py +84 -0
- stellar_sdk/xdr/scp_envelope.py +84 -0
- stellar_sdk/xdr/scp_history_entry.py +87 -0
- stellar_sdk/xdr/scp_history_entry_v0.py +98 -0
- stellar_sdk/xdr/scp_nomination.py +117 -0
- stellar_sdk/xdr/scp_quorum_set.py +117 -0
- stellar_sdk/xdr/scp_statement.py +129 -0
- stellar_sdk/xdr/scp_statement_confirm.py +115 -0
- stellar_sdk/xdr/scp_statement_externalize.py +97 -0
- stellar_sdk/xdr/scp_statement_pledges.py +162 -0
- stellar_sdk/xdr/scp_statement_prepare.py +133 -0
- stellar_sdk/xdr/scp_statement_type.py +56 -0
- stellar_sdk/xdr/send_more.py +71 -0
- stellar_sdk/xdr/send_more_extended.py +86 -0
- stellar_sdk/xdr/sequence_number.py +60 -0
- stellar_sdk/xdr/serialized_binary_fuse_filter.py +158 -0
- stellar_sdk/xdr/set_options_op.py +196 -0
- stellar_sdk/xdr/set_options_result.py +124 -0
- stellar_sdk/xdr/set_options_result_code.py +73 -0
- stellar_sdk/xdr/set_trust_line_flags_op.py +107 -0
- stellar_sdk/xdr/set_trust_line_flags_result.py +99 -0
- stellar_sdk/xdr/set_trust_line_flags_result_code.py +64 -0
- stellar_sdk/xdr/short_hash_seed.py +71 -0
- stellar_sdk/xdr/signature.py +60 -0
- stellar_sdk/xdr/signature_hint.py +60 -0
- stellar_sdk/xdr/signed_time_sliced_survey_request_message.py +87 -0
- stellar_sdk/xdr/signed_time_sliced_survey_response_message.py +87 -0
- stellar_sdk/xdr/signed_time_sliced_survey_start_collecting_message.py +89 -0
- stellar_sdk/xdr/signed_time_sliced_survey_stop_collecting_message.py +89 -0
- stellar_sdk/xdr/signer.py +84 -0
- stellar_sdk/xdr/signer_key.py +152 -0
- stellar_sdk/xdr/signer_key_ed25519_signed_payload.py +86 -0
- stellar_sdk/xdr/signer_key_type.py +56 -0
- stellar_sdk/xdr/simple_payment_result.py +97 -0
- stellar_sdk/xdr/soroban_address_credentials.py +107 -0
- stellar_sdk/xdr/soroban_authorization_entries.py +78 -0
- stellar_sdk/xdr/soroban_authorization_entry.py +87 -0
- stellar_sdk/xdr/soroban_authorized_function.py +160 -0
- stellar_sdk/xdr/soroban_authorized_function_type.py +54 -0
- stellar_sdk/xdr/soroban_authorized_invocation.py +97 -0
- stellar_sdk/xdr/soroban_credentials.py +93 -0
- stellar_sdk/xdr/soroban_credentials_type.py +52 -0
- stellar_sdk/xdr/soroban_resources.py +110 -0
- stellar_sdk/xdr/soroban_resources_ext_v0.py +88 -0
- stellar_sdk/xdr/soroban_transaction_data.py +112 -0
- stellar_sdk/xdr/soroban_transaction_data_ext.py +97 -0
- stellar_sdk/xdr/soroban_transaction_meta.py +134 -0
- stellar_sdk/xdr/soroban_transaction_meta_ext.py +93 -0
- stellar_sdk/xdr/soroban_transaction_meta_ext_v1.py +137 -0
- stellar_sdk/xdr/soroban_transaction_meta_v2.py +90 -0
- stellar_sdk/xdr/sponsorship_descriptor.py +67 -0
- stellar_sdk/xdr/state_archival_settings.py +177 -0
- stellar_sdk/xdr/stellar_message.py +550 -0
- stellar_sdk/xdr/stellar_value.py +133 -0
- stellar_sdk/xdr/stellar_value_ext.py +97 -0
- stellar_sdk/xdr/stellar_value_type.py +52 -0
- stellar_sdk/xdr/stored_debug_transaction_set.py +97 -0
- stellar_sdk/xdr/stored_transaction_set.py +110 -0
- stellar_sdk/xdr/string32.py +60 -0
- stellar_sdk/xdr/string64.py +60 -0
- stellar_sdk/xdr/survey_message_command_type.py +50 -0
- stellar_sdk/xdr/survey_message_response_type.py +50 -0
- stellar_sdk/xdr/survey_request_message.py +116 -0
- stellar_sdk/xdr/survey_response_body.py +94 -0
- stellar_sdk/xdr/survey_response_message.py +116 -0
- stellar_sdk/xdr/threshold_indexes.py +56 -0
- stellar_sdk/xdr/thresholds.py +60 -0
- stellar_sdk/xdr/time_bounds.py +83 -0
- stellar_sdk/xdr/time_point.py +60 -0
- stellar_sdk/xdr/time_sliced_node_data.py +167 -0
- stellar_sdk/xdr/time_sliced_peer_data.py +87 -0
- stellar_sdk/xdr/time_sliced_peer_data_list.py +74 -0
- stellar_sdk/xdr/time_sliced_survey_request_message.py +105 -0
- stellar_sdk/xdr/time_sliced_survey_response_message.py +84 -0
- stellar_sdk/xdr/time_sliced_survey_start_collecting_message.py +96 -0
- stellar_sdk/xdr/time_sliced_survey_stop_collecting_message.py +96 -0
- stellar_sdk/xdr/topology_response_body_v2.py +96 -0
- stellar_sdk/xdr/transaction.py +166 -0
- stellar_sdk/xdr/transaction_envelope.py +122 -0
- stellar_sdk/xdr/transaction_event.py +83 -0
- stellar_sdk/xdr/transaction_event_stage.py +59 -0
- stellar_sdk/xdr/transaction_ext.py +97 -0
- stellar_sdk/xdr/transaction_history_entry.py +106 -0
- stellar_sdk/xdr/transaction_history_entry_ext.py +97 -0
- stellar_sdk/xdr/transaction_history_result_entry.py +104 -0
- stellar_sdk/xdr/transaction_history_result_entry_ext.py +73 -0
- stellar_sdk/xdr/transaction_meta.py +168 -0
- stellar_sdk/xdr/transaction_meta_v1.py +97 -0
- stellar_sdk/xdr/transaction_meta_v2.py +109 -0
- stellar_sdk/xdr/transaction_meta_v3.py +137 -0
- stellar_sdk/xdr/transaction_meta_v4.py +180 -0
- stellar_sdk/xdr/transaction_phase.py +124 -0
- stellar_sdk/xdr/transaction_result.py +131 -0
- stellar_sdk/xdr/transaction_result_code.py +90 -0
- stellar_sdk/xdr/transaction_result_ext.py +73 -0
- stellar_sdk/xdr/transaction_result_meta.py +97 -0
- stellar_sdk/xdr/transaction_result_meta_v1.py +118 -0
- stellar_sdk/xdr/transaction_result_pair.py +87 -0
- stellar_sdk/xdr/transaction_result_result.py +220 -0
- stellar_sdk/xdr/transaction_result_set.py +82 -0
- stellar_sdk/xdr/transaction_set.py +98 -0
- stellar_sdk/xdr/transaction_set_v1.py +98 -0
- stellar_sdk/xdr/transaction_signature_payload.py +99 -0
- stellar_sdk/xdr/transaction_signature_payload_tagged_transaction.py +107 -0
- stellar_sdk/xdr/transaction_v0.py +158 -0
- stellar_sdk/xdr/transaction_v0_envelope.py +97 -0
- stellar_sdk/xdr/transaction_v0_ext.py +73 -0
- stellar_sdk/xdr/transaction_v1_envelope.py +97 -0
- stellar_sdk/xdr/trust_line_asset.py +145 -0
- stellar_sdk/xdr/trust_line_entry.py +149 -0
- stellar_sdk/xdr/trust_line_entry_ext.py +105 -0
- stellar_sdk/xdr/trust_line_entry_extension_v2.py +93 -0
- stellar_sdk/xdr/trust_line_entry_extension_v2_ext.py +73 -0
- stellar_sdk/xdr/trust_line_entry_v1.py +92 -0
- stellar_sdk/xdr/trust_line_entry_v1_ext.py +93 -0
- stellar_sdk/xdr/trust_line_flags.py +59 -0
- stellar_sdk/xdr/ttl_entry.py +87 -0
- stellar_sdk/xdr/tx_advert_vector.py +72 -0
- stellar_sdk/xdr/tx_demand_vector.py +72 -0
- stellar_sdk/xdr/tx_set_component.py +102 -0
- stellar_sdk/xdr/tx_set_component_txs_maybe_discounted_fee.py +99 -0
- stellar_sdk/xdr/tx_set_component_type.py +52 -0
- stellar_sdk/xdr/u_int128_parts.py +82 -0
- stellar_sdk/xdr/u_int256_parts.py +103 -0
- stellar_sdk/xdr/uint256.py +60 -0
- stellar_sdk/xdr/uint32.py +60 -0
- stellar_sdk/xdr/uint64.py +60 -0
- stellar_sdk/xdr/upgrade_entry_meta.py +84 -0
- stellar_sdk/xdr/upgrade_type.py +60 -0
- stellar_sdk/xdr/value.py +60 -0
- stellar_sdk-13.2.1.dist-info/METADATA +141 -0
- stellar_sdk-13.2.1.dist-info/RECORD +624 -0
- stellar_sdk-13.2.1.dist-info/WHEEL +4 -0
- stellar_sdk-13.2.1.dist-info/licenses/LICENSE +201 -0
stellar_sdk/__init__.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from . import scval
|
|
2
|
+
from .__version__ import (
|
|
3
|
+
__author__,
|
|
4
|
+
__author_email__,
|
|
5
|
+
__description__,
|
|
6
|
+
__issues__,
|
|
7
|
+
__license__,
|
|
8
|
+
__title__,
|
|
9
|
+
__url__,
|
|
10
|
+
__version__,
|
|
11
|
+
)
|
|
12
|
+
from .account import *
|
|
13
|
+
from .address import *
|
|
14
|
+
from .asset import *
|
|
15
|
+
from .client.requests_client import RequestsClient
|
|
16
|
+
from .decorated_signature import *
|
|
17
|
+
from .fee_bump_transaction import *
|
|
18
|
+
from .fee_bump_transaction_envelope import *
|
|
19
|
+
from .helpers import *
|
|
20
|
+
from .keypair import *
|
|
21
|
+
from .ledger_bounds import *
|
|
22
|
+
from .liquidity_pool_asset import *
|
|
23
|
+
from .liquidity_pool_id import *
|
|
24
|
+
from .memo import *
|
|
25
|
+
from .muxed_account import *
|
|
26
|
+
from .network import *
|
|
27
|
+
from .operation import *
|
|
28
|
+
from .preconditions import *
|
|
29
|
+
from .price import *
|
|
30
|
+
from .server import *
|
|
31
|
+
from .signer import *
|
|
32
|
+
from .signer_key import *
|
|
33
|
+
from .soroban_data_builder import *
|
|
34
|
+
from .soroban_server import *
|
|
35
|
+
from .strkey import *
|
|
36
|
+
from .time_bounds import *
|
|
37
|
+
from .transaction import *
|
|
38
|
+
from .transaction_builder import *
|
|
39
|
+
from .transaction_envelope import *
|
|
40
|
+
|
|
41
|
+
# aiohttp required
|
|
42
|
+
try:
|
|
43
|
+
from .client.aiohttp_client import AiohttpClient
|
|
44
|
+
from .server_async import ServerAsync
|
|
45
|
+
from .soroban_server_async import SorobanServerAsync
|
|
46
|
+
except ImportError:
|
|
47
|
+
pass
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
r"""
|
|
2
|
+
_____ _______ ______ _ _ _____ _____ _____ _ __
|
|
3
|
+
/ ____|__ __| ____| | | | /\ | __ \ / ____| __ \| |/ /
|
|
4
|
+
| (___ | | | |__ | | | | / \ | |__) |____| (___ | | | | ' /
|
|
5
|
+
\___ \ | | | __| | | | | / /\ \ | _ /______\___ \| | | | <
|
|
6
|
+
____) | | | | |____| |____| |____ / ____ \| | \ \ ____) | |__| | . \
|
|
7
|
+
|_____/ |_| |______|______|______/_/ \_\_| \_\ |_____/|_____/|_|\_\
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
__title__ = "stellar-sdk"
|
|
11
|
+
__description__ = "The Python Stellar SDK library provides APIs to build transactions and connect to Horizon and Soroban-RPC server."
|
|
12
|
+
__url__ = "https://github.com/StellarCN/py-stellar-base"
|
|
13
|
+
__issues__ = f"{__url__}/issues"
|
|
14
|
+
__version__ = "13.2.1"
|
|
15
|
+
__author__ = "Eno, overcat"
|
|
16
|
+
__author_email__ = "appweb.cn@gmail.com, 4catcode@gmail.com"
|
|
17
|
+
__license__ = "Apache License 2.0"
|
stellar_sdk/account.py
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
from .muxed_account import MuxedAccount
|
|
4
|
+
from .sep.ed25519_public_key_signer import Ed25519PublicKeySigner
|
|
5
|
+
|
|
6
|
+
__all__ = ["Account"]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Account:
|
|
10
|
+
"""The :class:`Account` object represents a single
|
|
11
|
+
account on the Stellar network and its sequence number.
|
|
12
|
+
|
|
13
|
+
Account tracks the sequence number as it is used
|
|
14
|
+
by :class:`TransactionBuilder <stellar_sdk.transaction_builder.TransactionBuilder>`.
|
|
15
|
+
|
|
16
|
+
Normally, you can get an :class:`Account` instance through :func:`stellar_sdk.server.Server.load_account`
|
|
17
|
+
or :func:`stellar_sdk.server_async.ServerAsync.load_account`.
|
|
18
|
+
|
|
19
|
+
An example::
|
|
20
|
+
|
|
21
|
+
from stellar_sdk import Keypair, Server
|
|
22
|
+
|
|
23
|
+
server = Server(horizon_url="https://horizon-testnet.stellar.org")
|
|
24
|
+
source = Keypair.from_secret("SBFZCHU5645DOKRWYBXVOXY2ELGJKFRX6VGGPRYUWHQ7PMXXJNDZFMKD")
|
|
25
|
+
# `account` can also be a muxed account
|
|
26
|
+
source_account = server.load_account(account=source.public_key)
|
|
27
|
+
|
|
28
|
+
See `Accounts <https://developers.stellar.org/docs/learn/fundamentals/stellar-data-structures/accounts>`__ for
|
|
29
|
+
more information.
|
|
30
|
+
|
|
31
|
+
:param account: Account Id of the
|
|
32
|
+
account (ex. ``"GB3KJPLFUYN5VL6R3GU3EGCGVCKFDSD7BEDX42HWG5BWFKB3KQGJJRMA"``)
|
|
33
|
+
or muxed account (ex. ``"MBZSQ3YZMZEWL5ZRCEQ5CCSOTXCFCMKDGFFP4IEQN2KN6LCHCLI46AAAAAAAAAAE2L2QE"``)
|
|
34
|
+
:param sequence: Current sequence number of the account.
|
|
35
|
+
:param raw_data: Raw horizon response data.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
def __init__(
|
|
39
|
+
self,
|
|
40
|
+
account: str | MuxedAccount,
|
|
41
|
+
sequence: int,
|
|
42
|
+
raw_data: dict[str, Any] | None = None,
|
|
43
|
+
) -> None:
|
|
44
|
+
if isinstance(account, str):
|
|
45
|
+
self.account: MuxedAccount = MuxedAccount.from_account(account)
|
|
46
|
+
else:
|
|
47
|
+
self.account = account
|
|
48
|
+
self.sequence: int = sequence
|
|
49
|
+
self.raw_data: dict[str, Any] | None = raw_data
|
|
50
|
+
|
|
51
|
+
@property
|
|
52
|
+
def universal_account_id(self) -> str:
|
|
53
|
+
"""Get the universal account id,
|
|
54
|
+
if `account` is ed25519 public key, it will return ed25519
|
|
55
|
+
public key (ex. ``"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"``),
|
|
56
|
+
otherwise it will return muxed
|
|
57
|
+
account (ex. ``"MAAAAAAAAAAAJURAAB2X52XFQP6FBXLGT6LWOOWMEXWHEWBDVRZ7V5WH34Y22MPFBHUHY"``)
|
|
58
|
+
"""
|
|
59
|
+
return self.account.universal_account_id
|
|
60
|
+
|
|
61
|
+
def increment_sequence_number(self) -> None:
|
|
62
|
+
"""Increments sequence number in this object by one."""
|
|
63
|
+
self.sequence += 1
|
|
64
|
+
|
|
65
|
+
@property
|
|
66
|
+
def thresholds(self):
|
|
67
|
+
if self.raw_data is None:
|
|
68
|
+
raise ValueError('"raw_data" is None, unable to get thresholds from it.')
|
|
69
|
+
|
|
70
|
+
return Thresholds(
|
|
71
|
+
self.raw_data["thresholds"]["low_threshold"],
|
|
72
|
+
self.raw_data["thresholds"]["med_threshold"],
|
|
73
|
+
self.raw_data["thresholds"]["high_threshold"],
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
def load_ed25519_public_key_signers(self) -> list[Ed25519PublicKeySigner]:
|
|
77
|
+
"""Load ed25519 public key signers."""
|
|
78
|
+
if self.raw_data is None:
|
|
79
|
+
raise ValueError('"raw_data" is None, unable to get signers from it.')
|
|
80
|
+
|
|
81
|
+
signers = self.raw_data["signers"]
|
|
82
|
+
ed25519_public_key_signers = []
|
|
83
|
+
for signer in signers:
|
|
84
|
+
if signer["type"] == "ed25519_public_key":
|
|
85
|
+
ed25519_public_key_signers.append(
|
|
86
|
+
Ed25519PublicKeySigner(signer["key"], signer["weight"])
|
|
87
|
+
)
|
|
88
|
+
return ed25519_public_key_signers
|
|
89
|
+
|
|
90
|
+
def __hash__(self):
|
|
91
|
+
return hash((self.account, self.sequence, self.raw_data))
|
|
92
|
+
|
|
93
|
+
def __eq__(self, other: object) -> bool:
|
|
94
|
+
if not isinstance(other, self.__class__):
|
|
95
|
+
return NotImplemented
|
|
96
|
+
return self.account == other.account and self.sequence == other.sequence
|
|
97
|
+
|
|
98
|
+
def __repr__(self):
|
|
99
|
+
return f"<Account [account={self.account}, sequence={self.sequence}]>"
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
class Thresholds:
|
|
103
|
+
def __init__(
|
|
104
|
+
self, low_threshold: int, med_threshold: int, high_threshold: int
|
|
105
|
+
) -> None:
|
|
106
|
+
self.low_threshold = low_threshold
|
|
107
|
+
self.med_threshold = med_threshold
|
|
108
|
+
self.high_threshold = high_threshold
|
|
109
|
+
|
|
110
|
+
def __hash__(self):
|
|
111
|
+
return hash((self.low_threshold, self.med_threshold, self.high_threshold))
|
|
112
|
+
|
|
113
|
+
def __eq__(self, other: object) -> bool:
|
|
114
|
+
if not isinstance(other, self.__class__):
|
|
115
|
+
return NotImplemented
|
|
116
|
+
return (
|
|
117
|
+
self.low_threshold == other.low_threshold
|
|
118
|
+
and self.med_threshold == other.med_threshold
|
|
119
|
+
and self.high_threshold == other.high_threshold
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
def __repr__(self):
|
|
123
|
+
return (
|
|
124
|
+
f"<Thresholds [low_threshold={self.low_threshold}, med_threshold={self.med_threshold}, "
|
|
125
|
+
f"high_threshold={self.high_threshold}]>"
|
|
126
|
+
)
|
stellar_sdk/address.py
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import binascii
|
|
2
|
+
from enum import IntEnum
|
|
3
|
+
|
|
4
|
+
from . import xdr as stellar_xdr
|
|
5
|
+
from .strkey import StrKey
|
|
6
|
+
|
|
7
|
+
__all__ = ["Address", "AddressType"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AddressType(IntEnum):
|
|
11
|
+
"""Represents an Address type."""
|
|
12
|
+
|
|
13
|
+
ACCOUNT = 0
|
|
14
|
+
"""An account address, address looks like ``GBJCHUKZMTFSLOMNC7P4TS4VJJBTCYL3XKSOLXAUJSD56C4LHND5T...``."""
|
|
15
|
+
|
|
16
|
+
CONTRACT = 1
|
|
17
|
+
"""An contract address, address looks like ``CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2W...``."""
|
|
18
|
+
|
|
19
|
+
MUXED_ACCOUNT = 2
|
|
20
|
+
"""A muxed account address, address looks like ``MAQAA5L65LSYH7CQ3VTJ7F3HHLGCL3DSLAR2Y47263D56MNNGHSQSAAAAAAAAAAE2L...``."""
|
|
21
|
+
|
|
22
|
+
CLAIMABLE_BALANCE = 3
|
|
23
|
+
"""A claimable balance address, address looks like ``BAAD6DBUX6J22DMZOHIEZTEQ64CVCHEDRKWZONFEUL5Q26QD7R76RGR...``."""
|
|
24
|
+
|
|
25
|
+
LIQUIDITY_POOL = 4
|
|
26
|
+
"""A liquidity pool address, address looks like ``LA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJU...``."""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class Address:
|
|
30
|
+
"""Represents a single address in the Stellar network.
|
|
31
|
+
An address can represent an account or a contract.
|
|
32
|
+
|
|
33
|
+
:param address: ID of the account, contract, muxed account, claimable balance, or liquidity pool.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
def __init__(self, address: str):
|
|
37
|
+
if StrKey.is_valid_ed25519_public_key(address):
|
|
38
|
+
self.type = AddressType.ACCOUNT
|
|
39
|
+
self.key = StrKey.decode_ed25519_public_key(address)
|
|
40
|
+
elif StrKey.is_valid_contract(address):
|
|
41
|
+
self.type = AddressType.CONTRACT
|
|
42
|
+
self.key = StrKey.decode_contract(address)
|
|
43
|
+
elif StrKey.is_valid_med25519_public_key(address):
|
|
44
|
+
self.type = AddressType.MUXED_ACCOUNT
|
|
45
|
+
self.key = StrKey.decode_med25519_public_key(address)
|
|
46
|
+
elif StrKey.is_valid_claimable_balance(address):
|
|
47
|
+
self.type = AddressType.CLAIMABLE_BALANCE
|
|
48
|
+
self.key = StrKey.decode_claimable_balance(address)
|
|
49
|
+
elif StrKey.is_valid_liquidity_pool(address):
|
|
50
|
+
self.type = AddressType.LIQUIDITY_POOL
|
|
51
|
+
self.key = StrKey.decode_liquidity_pool(address)
|
|
52
|
+
else:
|
|
53
|
+
raise ValueError("Unsupported address type.")
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def address(self) -> str:
|
|
57
|
+
"""Returns the encoded address.
|
|
58
|
+
|
|
59
|
+
:return: The encoded address.
|
|
60
|
+
"""
|
|
61
|
+
if self.type == AddressType.ACCOUNT:
|
|
62
|
+
return StrKey.encode_ed25519_public_key(self.key)
|
|
63
|
+
elif self.type == AddressType.CONTRACT:
|
|
64
|
+
return StrKey.encode_contract(self.key)
|
|
65
|
+
elif self.type == AddressType.MUXED_ACCOUNT:
|
|
66
|
+
return StrKey.encode_med25519_public_key(self.key)
|
|
67
|
+
elif self.type == AddressType.CLAIMABLE_BALANCE:
|
|
68
|
+
return StrKey.encode_claimable_balance(self.key)
|
|
69
|
+
elif self.type == AddressType.LIQUIDITY_POOL:
|
|
70
|
+
return StrKey.encode_liquidity_pool(self.key)
|
|
71
|
+
else:
|
|
72
|
+
raise ValueError("Unsupported address type.")
|
|
73
|
+
|
|
74
|
+
@staticmethod
|
|
75
|
+
def from_raw_account(account: bytes | str) -> "Address":
|
|
76
|
+
"""Creates a new account Address object from raw bytes.
|
|
77
|
+
|
|
78
|
+
:param account: The raw bytes of the account, it can be a byte array or a hex encoded string.
|
|
79
|
+
:return: A new Address object.
|
|
80
|
+
"""
|
|
81
|
+
if isinstance(account, str):
|
|
82
|
+
account = binascii.unhexlify(account)
|
|
83
|
+
return Address(StrKey.encode_ed25519_public_key(account))
|
|
84
|
+
|
|
85
|
+
@staticmethod
|
|
86
|
+
def from_raw_contract(contract: bytes | str) -> "Address":
|
|
87
|
+
"""Creates a new contract Address object from a buffer of raw bytes.
|
|
88
|
+
|
|
89
|
+
:param contract: The raw bytes of the contract.
|
|
90
|
+
:return: A new Address object.
|
|
91
|
+
"""
|
|
92
|
+
if isinstance(contract, str):
|
|
93
|
+
contract = binascii.unhexlify(contract)
|
|
94
|
+
return Address(StrKey.encode_contract(contract))
|
|
95
|
+
|
|
96
|
+
@staticmethod
|
|
97
|
+
def from_raw_muxed_account(muxed_account: bytes | str) -> "Address":
|
|
98
|
+
"""Creates a new muxed account Address object from raw bytes.
|
|
99
|
+
|
|
100
|
+
:param muxed_account: The raw bytes of the muxed account.
|
|
101
|
+
:return: A new Address object.
|
|
102
|
+
"""
|
|
103
|
+
if isinstance(muxed_account, str):
|
|
104
|
+
muxed_account = binascii.unhexlify(muxed_account)
|
|
105
|
+
return Address(StrKey.encode_med25519_public_key(muxed_account))
|
|
106
|
+
|
|
107
|
+
@staticmethod
|
|
108
|
+
def from_raw_claimable_balance(claimable_balance: bytes | str) -> "Address":
|
|
109
|
+
"""Creates a new claimable balance Address object from raw bytes.
|
|
110
|
+
|
|
111
|
+
:param claimable_balance: The raw bytes of the claimable balance.
|
|
112
|
+
:return: A new Address object.
|
|
113
|
+
"""
|
|
114
|
+
if isinstance(claimable_balance, str):
|
|
115
|
+
claimable_balance = binascii.unhexlify(claimable_balance)
|
|
116
|
+
return Address(StrKey.encode_claimable_balance(claimable_balance))
|
|
117
|
+
|
|
118
|
+
@staticmethod
|
|
119
|
+
def from_raw_liquidity_pool(liquidity_pool: bytes | str) -> "Address":
|
|
120
|
+
"""Creates a new liquidity pool Address object from raw bytes.
|
|
121
|
+
|
|
122
|
+
:param liquidity_pool: The raw bytes of the liquidity pool.
|
|
123
|
+
:return: A new Address object.
|
|
124
|
+
"""
|
|
125
|
+
if isinstance(liquidity_pool, str):
|
|
126
|
+
liquidity_pool = binascii.unhexlify(liquidity_pool)
|
|
127
|
+
return Address(StrKey.encode_liquidity_pool(liquidity_pool))
|
|
128
|
+
|
|
129
|
+
def to_xdr_sc_address(self) -> stellar_xdr.SCAddress:
|
|
130
|
+
"""Converts the Address object to a :class:`stellar_sdk.xdr.SCAddress` XDR object.
|
|
131
|
+
|
|
132
|
+
:return: A :class:`stellar_sdk.xdr.SCAddress` XDR object.
|
|
133
|
+
"""
|
|
134
|
+
if self.type == AddressType.ACCOUNT:
|
|
135
|
+
account = stellar_xdr.AccountID(
|
|
136
|
+
stellar_xdr.PublicKey(
|
|
137
|
+
stellar_xdr.PublicKeyType.PUBLIC_KEY_TYPE_ED25519,
|
|
138
|
+
stellar_xdr.Uint256(self.key),
|
|
139
|
+
)
|
|
140
|
+
)
|
|
141
|
+
return stellar_xdr.SCAddress(
|
|
142
|
+
stellar_xdr.SCAddressType.SC_ADDRESS_TYPE_ACCOUNT, account_id=account
|
|
143
|
+
)
|
|
144
|
+
elif self.type == AddressType.CONTRACT:
|
|
145
|
+
contract = stellar_xdr.ContractID.from_xdr_bytes(self.key)
|
|
146
|
+
return stellar_xdr.SCAddress(
|
|
147
|
+
stellar_xdr.SCAddressType.SC_ADDRESS_TYPE_CONTRACT, contract_id=contract
|
|
148
|
+
)
|
|
149
|
+
elif self.type == AddressType.MUXED_ACCOUNT:
|
|
150
|
+
muxed_account = stellar_xdr.MuxedEd25519Account(
|
|
151
|
+
id=stellar_xdr.Uint64.from_xdr_bytes(self.key[-8:]),
|
|
152
|
+
ed25519=stellar_xdr.Uint256.from_xdr_bytes(self.key[:-8]),
|
|
153
|
+
)
|
|
154
|
+
return stellar_xdr.SCAddress(
|
|
155
|
+
stellar_xdr.SCAddressType.SC_ADDRESS_TYPE_MUXED_ACCOUNT,
|
|
156
|
+
muxed_account=muxed_account,
|
|
157
|
+
)
|
|
158
|
+
elif self.type == AddressType.CLAIMABLE_BALANCE:
|
|
159
|
+
# See https://github.com/stellar/stellar-protocol/pull/1646/files#r1974431825
|
|
160
|
+
if self.key[:1] != b"\x00":
|
|
161
|
+
raise ValueError(
|
|
162
|
+
f"The claimable balance ID type is not supported, it must be {stellar_xdr.ClaimableBalanceIDType.CLAIMABLE_BALANCE_ID_TYPE_V0}."
|
|
163
|
+
)
|
|
164
|
+
claimable_balance_id = stellar_xdr.ClaimableBalanceID(
|
|
165
|
+
stellar_xdr.ClaimableBalanceIDType.CLAIMABLE_BALANCE_ID_TYPE_V0,
|
|
166
|
+
v0=stellar_xdr.Hash.from_xdr_bytes(self.key[1:]),
|
|
167
|
+
)
|
|
168
|
+
return stellar_xdr.SCAddress(
|
|
169
|
+
stellar_xdr.SCAddressType.SC_ADDRESS_TYPE_CLAIMABLE_BALANCE,
|
|
170
|
+
claimable_balance_id=claimable_balance_id,
|
|
171
|
+
)
|
|
172
|
+
elif self.type == AddressType.LIQUIDITY_POOL:
|
|
173
|
+
liquidity_pool_id = stellar_xdr.PoolID.from_xdr_bytes(self.key)
|
|
174
|
+
return stellar_xdr.SCAddress(
|
|
175
|
+
stellar_xdr.SCAddressType.SC_ADDRESS_TYPE_LIQUIDITY_POOL,
|
|
176
|
+
liquidity_pool_id=liquidity_pool_id,
|
|
177
|
+
)
|
|
178
|
+
else:
|
|
179
|
+
raise ValueError("Unsupported address type.")
|
|
180
|
+
|
|
181
|
+
@classmethod
|
|
182
|
+
def from_xdr_sc_address(cls, sc_address: stellar_xdr.SCAddress) -> "Address":
|
|
183
|
+
"""Creates a new Address object from a :class:`stellar_sdk.xdr.SCAddress` XDR object.
|
|
184
|
+
|
|
185
|
+
:param sc_address: The :class:`stellar_sdk.xdr.SCAddress` XDR object.
|
|
186
|
+
:return: A new Address object.
|
|
187
|
+
"""
|
|
188
|
+
if sc_address.type == stellar_xdr.SCAddressType.SC_ADDRESS_TYPE_ACCOUNT:
|
|
189
|
+
assert sc_address.account_id is not None
|
|
190
|
+
assert sc_address.account_id.account_id.ed25519 is not None
|
|
191
|
+
return cls.from_raw_account(
|
|
192
|
+
sc_address.account_id.account_id.ed25519.uint256
|
|
193
|
+
)
|
|
194
|
+
elif sc_address.type == stellar_xdr.SCAddressType.SC_ADDRESS_TYPE_CONTRACT:
|
|
195
|
+
assert sc_address.contract_id is not None
|
|
196
|
+
return cls.from_raw_contract(sc_address.contract_id.to_xdr_bytes())
|
|
197
|
+
elif sc_address.type == stellar_xdr.SCAddressType.SC_ADDRESS_TYPE_MUXED_ACCOUNT:
|
|
198
|
+
assert sc_address.muxed_account is not None
|
|
199
|
+
return cls.from_raw_muxed_account(
|
|
200
|
+
sc_address.muxed_account.ed25519.to_xdr_bytes()
|
|
201
|
+
+ sc_address.muxed_account.id.to_xdr_bytes()
|
|
202
|
+
)
|
|
203
|
+
elif (
|
|
204
|
+
sc_address.type
|
|
205
|
+
== stellar_xdr.SCAddressType.SC_ADDRESS_TYPE_CLAIMABLE_BALANCE
|
|
206
|
+
):
|
|
207
|
+
assert sc_address.claimable_balance_id is not None
|
|
208
|
+
# See https://github.com/stellar/stellar-protocol/pull/1646/files#r1974431825
|
|
209
|
+
if (
|
|
210
|
+
sc_address.claimable_balance_id.type
|
|
211
|
+
!= stellar_xdr.ClaimableBalanceIDType.CLAIMABLE_BALANCE_ID_TYPE_V0
|
|
212
|
+
):
|
|
213
|
+
raise ValueError(
|
|
214
|
+
f"The claimable balance ID type is not supported: {sc_address.claimable_balance_id.type}"
|
|
215
|
+
) # This is a safeguard.
|
|
216
|
+
return cls.from_raw_claimable_balance(
|
|
217
|
+
sc_address.claimable_balance_id.to_xdr_bytes()[3:]
|
|
218
|
+
)
|
|
219
|
+
elif (
|
|
220
|
+
sc_address.type == stellar_xdr.SCAddressType.SC_ADDRESS_TYPE_LIQUIDITY_POOL
|
|
221
|
+
):
|
|
222
|
+
assert sc_address.liquidity_pool_id is not None
|
|
223
|
+
return cls.from_raw_liquidity_pool(
|
|
224
|
+
sc_address.liquidity_pool_id.to_xdr_bytes()
|
|
225
|
+
)
|
|
226
|
+
else:
|
|
227
|
+
raise ValueError("Unsupported address type.")
|
|
228
|
+
|
|
229
|
+
def to_xdr_sc_val(self) -> stellar_xdr.SCVal:
|
|
230
|
+
return stellar_xdr.SCVal(
|
|
231
|
+
stellar_xdr.SCValType.SCV_ADDRESS, address=self.to_xdr_sc_address()
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
@classmethod
|
|
235
|
+
def from_xdr_sc_val(cls, sc_val: stellar_xdr.SCVal) -> "Address":
|
|
236
|
+
if sc_val.type != stellar_xdr.SCValType.SCV_ADDRESS:
|
|
237
|
+
raise ValueError("Unsupported SCVal type.")
|
|
238
|
+
assert sc_val.address is not None
|
|
239
|
+
return cls.from_xdr_sc_address(sc_val.address)
|
|
240
|
+
|
|
241
|
+
def __hash__(self):
|
|
242
|
+
return hash((self.key, self.type))
|
|
243
|
+
|
|
244
|
+
def __eq__(self, other: object) -> bool:
|
|
245
|
+
if not isinstance(other, self.__class__):
|
|
246
|
+
return NotImplemented
|
|
247
|
+
return self.key == other.key and self.type == other.type
|
|
248
|
+
|
|
249
|
+
def __repr__(self):
|
|
250
|
+
return f"<Address [type={self.type.name}, address={self.address}]>"
|