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.
Files changed (624) hide show
  1. stellar_sdk/__init__.py +47 -0
  2. stellar_sdk/__version__.py +17 -0
  3. stellar_sdk/account.py +126 -0
  4. stellar_sdk/address.py +250 -0
  5. stellar_sdk/asset.py +253 -0
  6. stellar_sdk/auth.py +150 -0
  7. stellar_sdk/base_server.py +342 -0
  8. stellar_sdk/base_soroban_server.py +74 -0
  9. stellar_sdk/base_transaction_envelope.py +152 -0
  10. stellar_sdk/call_builder/__init__.py +0 -0
  11. stellar_sdk/call_builder/base/__init__.py +19 -0
  12. stellar_sdk/call_builder/base/base_accounts_call_builder.py +76 -0
  13. stellar_sdk/call_builder/base/base_assets_call_builder.py +39 -0
  14. stellar_sdk/call_builder/base/base_call_builder.py +118 -0
  15. stellar_sdk/call_builder/base/base_claimable_balances_call_builder.py +63 -0
  16. stellar_sdk/call_builder/base/base_data_call_builder.py +18 -0
  17. stellar_sdk/call_builder/base/base_effects_call_builder.py +73 -0
  18. stellar_sdk/call_builder/base/base_fee_stats_call_builder.py +16 -0
  19. stellar_sdk/call_builder/base/base_ledgers_call_builder.py +27 -0
  20. stellar_sdk/call_builder/base/base_liquidity_pools_builder.py +56 -0
  21. stellar_sdk/call_builder/base/base_offers_call_builder.py +106 -0
  22. stellar_sdk/call_builder/base/base_operations_call_builder.py +105 -0
  23. stellar_sdk/call_builder/base/base_orderbook_call_builder.py +28 -0
  24. stellar_sdk/call_builder/base/base_payments_call_builder.py +69 -0
  25. stellar_sdk/call_builder/base/base_root_call_builder.py +13 -0
  26. stellar_sdk/call_builder/base/base_strict_receive_paths_call_builder.py +64 -0
  27. stellar_sdk/call_builder/base/base_strict_send_paths_call_builder.py +65 -0
  28. stellar_sdk/call_builder/base/base_trades_aggregation_call_builder.py +78 -0
  29. stellar_sdk/call_builder/base/base_trades_call_builder.py +84 -0
  30. stellar_sdk/call_builder/base/base_transactions_call_builder.py +83 -0
  31. stellar_sdk/call_builder/call_builder_async/__init__.py +19 -0
  32. stellar_sdk/call_builder/call_builder_async/accounts_call_builder.py +31 -0
  33. stellar_sdk/call_builder/call_builder_async/assets_call_builder.py +19 -0
  34. stellar_sdk/call_builder/call_builder_async/base_call_builder.py +110 -0
  35. stellar_sdk/call_builder/call_builder_async/claimable_balances_call_builder.py +19 -0
  36. stellar_sdk/call_builder/call_builder_async/data_call_builder.py +44 -0
  37. stellar_sdk/call_builder/call_builder_async/effects_call_builder.py +31 -0
  38. stellar_sdk/call_builder/call_builder_async/fee_stats_call_builder.py +19 -0
  39. stellar_sdk/call_builder/call_builder_async/ledgers_call_builder.py +31 -0
  40. stellar_sdk/call_builder/call_builder_async/liquidity_pools_builder.py +19 -0
  41. stellar_sdk/call_builder/call_builder_async/offers_call_builder.py +19 -0
  42. stellar_sdk/call_builder/call_builder_async/operations_call_builder.py +31 -0
  43. stellar_sdk/call_builder/call_builder_async/orderbook_call_builder.py +42 -0
  44. stellar_sdk/call_builder/call_builder_async/payments_call_builder.py +31 -0
  45. stellar_sdk/call_builder/call_builder_async/root_call_builder.py +17 -0
  46. stellar_sdk/call_builder/call_builder_async/strict_receive_paths_call_builder.py +55 -0
  47. stellar_sdk/call_builder/call_builder_async/strict_send_paths_call_builder.py +55 -0
  48. stellar_sdk/call_builder/call_builder_async/trades_aggregation_call_builder.py +51 -0
  49. stellar_sdk/call_builder/call_builder_async/trades_call_builder.py +31 -0
  50. stellar_sdk/call_builder/call_builder_async/transactions_call_builder.py +31 -0
  51. stellar_sdk/call_builder/call_builder_sync/__init__.py +19 -0
  52. stellar_sdk/call_builder/call_builder_sync/accounts_call_builder.py +31 -0
  53. stellar_sdk/call_builder/call_builder_sync/assets_call_builder.py +19 -0
  54. stellar_sdk/call_builder/call_builder_sync/base_call_builder.py +106 -0
  55. stellar_sdk/call_builder/call_builder_sync/claimable_balances_call_builder.py +19 -0
  56. stellar_sdk/call_builder/call_builder_sync/data_call_builder.py +44 -0
  57. stellar_sdk/call_builder/call_builder_sync/effects_call_builder.py +31 -0
  58. stellar_sdk/call_builder/call_builder_sync/fee_stats_call_builder.py +25 -0
  59. stellar_sdk/call_builder/call_builder_sync/ledgers_call_builder.py +31 -0
  60. stellar_sdk/call_builder/call_builder_sync/liquidity_pools_builder.py +19 -0
  61. stellar_sdk/call_builder/call_builder_sync/offers_call_builder.py +31 -0
  62. stellar_sdk/call_builder/call_builder_sync/operations_call_builder.py +31 -0
  63. stellar_sdk/call_builder/call_builder_sync/orderbook_call_builder.py +42 -0
  64. stellar_sdk/call_builder/call_builder_sync/payments_call_builder.py +31 -0
  65. stellar_sdk/call_builder/call_builder_sync/root_call_builder.py +17 -0
  66. stellar_sdk/call_builder/call_builder_sync/strict_receive_paths_call_builder.py +55 -0
  67. stellar_sdk/call_builder/call_builder_sync/strict_send_paths_call_builder.py +55 -0
  68. stellar_sdk/call_builder/call_builder_sync/trades_aggregation_call_builder.py +51 -0
  69. stellar_sdk/call_builder/call_builder_sync/trades_call_builder.py +31 -0
  70. stellar_sdk/call_builder/call_builder_sync/transactions_call_builder.py +31 -0
  71. stellar_sdk/client/__init__.py +0 -0
  72. stellar_sdk/client/aiohttp_client.py +277 -0
  73. stellar_sdk/client/base_async_client.py +63 -0
  74. stellar_sdk/client/base_sync_client.py +60 -0
  75. stellar_sdk/client/defines.py +7 -0
  76. stellar_sdk/client/requests_client.py +229 -0
  77. stellar_sdk/client/response.py +50 -0
  78. stellar_sdk/client/simple_requests_client.py +90 -0
  79. stellar_sdk/contract/__init__.py +4 -0
  80. stellar_sdk/contract/assembled_transaction.py +457 -0
  81. stellar_sdk/contract/assembled_transaction_async.py +463 -0
  82. stellar_sdk/contract/contract_client.py +235 -0
  83. stellar_sdk/contract/contract_client_async.py +222 -0
  84. stellar_sdk/contract/exceptions.py +68 -0
  85. stellar_sdk/decorated_signature.py +54 -0
  86. stellar_sdk/exceptions.py +209 -0
  87. stellar_sdk/fee_bump_transaction.py +120 -0
  88. stellar_sdk/fee_bump_transaction_envelope.py +132 -0
  89. stellar_sdk/helpers.py +38 -0
  90. stellar_sdk/keypair.py +419 -0
  91. stellar_sdk/ledger_bounds.py +61 -0
  92. stellar_sdk/liquidity_pool_asset.py +152 -0
  93. stellar_sdk/liquidity_pool_id.py +57 -0
  94. stellar_sdk/memo.py +264 -0
  95. stellar_sdk/muxed_account.py +159 -0
  96. stellar_sdk/network.py +67 -0
  97. stellar_sdk/operation/__init__.py +28 -0
  98. stellar_sdk/operation/account_merge.py +60 -0
  99. stellar_sdk/operation/allow_trust.py +149 -0
  100. stellar_sdk/operation/begin_sponsoring_future_reserves.py +70 -0
  101. stellar_sdk/operation/bump_sequence.py +57 -0
  102. stellar_sdk/operation/change_trust.py +85 -0
  103. stellar_sdk/operation/claim_claimable_balance.py +69 -0
  104. stellar_sdk/operation/clawback.py +74 -0
  105. stellar_sdk/operation/clawback_claimable_balance.py +68 -0
  106. stellar_sdk/operation/create_account.py +85 -0
  107. stellar_sdk/operation/create_claimable_balance.py +450 -0
  108. stellar_sdk/operation/create_passive_sell_offer.py +113 -0
  109. stellar_sdk/operation/end_sponsoring_future_reserves.py +47 -0
  110. stellar_sdk/operation/extend_footprint_ttl.py +60 -0
  111. stellar_sdk/operation/inflation.py +43 -0
  112. stellar_sdk/operation/invoke_host_function.py +65 -0
  113. stellar_sdk/operation/liquidity_pool_deposit.py +117 -0
  114. stellar_sdk/operation/liquidity_pool_withdraw.py +102 -0
  115. stellar_sdk/operation/manage_buy_offer.py +105 -0
  116. stellar_sdk/operation/manage_data.py +87 -0
  117. stellar_sdk/operation/manage_sell_offer.py +104 -0
  118. stellar_sdk/operation/operation.py +130 -0
  119. stellar_sdk/operation/path_payment_strict_receive.py +130 -0
  120. stellar_sdk/operation/path_payment_strict_send.py +130 -0
  121. stellar_sdk/operation/payment.py +80 -0
  122. stellar_sdk/operation/restore_footprint.py +45 -0
  123. stellar_sdk/operation/revoke_sponsorship.py +579 -0
  124. stellar_sdk/operation/set_options.py +254 -0
  125. stellar_sdk/operation/set_trust_line_flags.py +119 -0
  126. stellar_sdk/preconditions.py +216 -0
  127. stellar_sdk/price.py +95 -0
  128. stellar_sdk/py.typed +0 -0
  129. stellar_sdk/scval.py +819 -0
  130. stellar_sdk/sep/__init__.py +0 -0
  131. stellar_sdk/sep/ed25519_public_key_signer.py +20 -0
  132. stellar_sdk/sep/exceptions.py +50 -0
  133. stellar_sdk/sep/federation.py +239 -0
  134. stellar_sdk/sep/mnemonic.py +96 -0
  135. stellar_sdk/sep/stellar_soroban_web_authentication.py +670 -0
  136. stellar_sdk/sep/stellar_toml.py +96 -0
  137. stellar_sdk/sep/stellar_uri.py +514 -0
  138. stellar_sdk/sep/stellar_web_authentication.py +632 -0
  139. stellar_sdk/sep/toid.py +137 -0
  140. stellar_sdk/sep/txrep.py +1729 -0
  141. stellar_sdk/server.py +390 -0
  142. stellar_sdk/server_async.py +392 -0
  143. stellar_sdk/signer.py +97 -0
  144. stellar_sdk/signer_key.py +256 -0
  145. stellar_sdk/soroban_data_builder.py +105 -0
  146. stellar_sdk/soroban_rpc.py +546 -0
  147. stellar_sdk/soroban_server.py +576 -0
  148. stellar_sdk/soroban_server_async.py +575 -0
  149. stellar_sdk/strkey.py +484 -0
  150. stellar_sdk/time_bounds.py +68 -0
  151. stellar_sdk/transaction.py +302 -0
  152. stellar_sdk/transaction_builder.py +1714 -0
  153. stellar_sdk/transaction_envelope.py +170 -0
  154. stellar_sdk/utils.py +179 -0
  155. stellar_sdk/xdr/__init__.py +467 -0
  156. stellar_sdk/xdr/account_entry.py +196 -0
  157. stellar_sdk/xdr/account_entry_ext.py +93 -0
  158. stellar_sdk/xdr/account_entry_extension_v1.py +92 -0
  159. stellar_sdk/xdr/account_entry_extension_v1_ext.py +93 -0
  160. stellar_sdk/xdr/account_entry_extension_v2.py +126 -0
  161. stellar_sdk/xdr/account_entry_extension_v2_ext.py +93 -0
  162. stellar_sdk/xdr/account_entry_extension_v3.py +103 -0
  163. stellar_sdk/xdr/account_flags.py +66 -0
  164. stellar_sdk/xdr/account_id.py +60 -0
  165. stellar_sdk/xdr/account_merge_result.py +130 -0
  166. stellar_sdk/xdr/account_merge_result_code.py +67 -0
  167. stellar_sdk/xdr/allow_trust_op.py +99 -0
  168. stellar_sdk/xdr/allow_trust_result.py +104 -0
  169. stellar_sdk/xdr/allow_trust_result_code.py +66 -0
  170. stellar_sdk/xdr/alpha_num12.py +84 -0
  171. stellar_sdk/xdr/alpha_num4.py +84 -0
  172. stellar_sdk/xdr/asset.py +124 -0
  173. stellar_sdk/xdr/asset_code.py +117 -0
  174. stellar_sdk/xdr/asset_code12.py +60 -0
  175. stellar_sdk/xdr/asset_code4.py +60 -0
  176. stellar_sdk/xdr/asset_type.py +56 -0
  177. stellar_sdk/xdr/auth.py +71 -0
  178. stellar_sdk/xdr/auth_cert.py +97 -0
  179. stellar_sdk/xdr/authenticated_message.py +92 -0
  180. stellar_sdk/xdr/authenticated_message_v0.py +97 -0
  181. stellar_sdk/xdr/base.py +252 -0
  182. stellar_sdk/xdr/begin_sponsoring_future_reserves_op.py +71 -0
  183. stellar_sdk/xdr/begin_sponsoring_future_reserves_result.py +116 -0
  184. stellar_sdk/xdr/begin_sponsoring_future_reserves_result_code.py +59 -0
  185. stellar_sdk/xdr/binary_fuse_filter_type.py +54 -0
  186. stellar_sdk/xdr/bucket_entry.py +144 -0
  187. stellar_sdk/xdr/bucket_entry_type.py +58 -0
  188. stellar_sdk/xdr/bucket_list_type.py +52 -0
  189. stellar_sdk/xdr/bucket_metadata.py +94 -0
  190. stellar_sdk/xdr/bucket_metadata_ext.py +97 -0
  191. stellar_sdk/xdr/bump_sequence_op.py +71 -0
  192. stellar_sdk/xdr/bump_sequence_result.py +79 -0
  193. stellar_sdk/xdr/bump_sequence_result_code.py +54 -0
  194. stellar_sdk/xdr/change_trust_asset.py +145 -0
  195. stellar_sdk/xdr/change_trust_op.py +86 -0
  196. stellar_sdk/xdr/change_trust_result.py +117 -0
  197. stellar_sdk/xdr/change_trust_result_code.py +72 -0
  198. stellar_sdk/xdr/claim_atom.py +130 -0
  199. stellar_sdk/xdr/claim_atom_type.py +54 -0
  200. stellar_sdk/xdr/claim_claimable_balance_op.py +71 -0
  201. stellar_sdk/xdr/claim_claimable_balance_result.py +120 -0
  202. stellar_sdk/xdr/claim_claimable_balance_result_code.py +60 -0
  203. stellar_sdk/xdr/claim_liquidity_atom.py +119 -0
  204. stellar_sdk/xdr/claim_offer_atom.py +129 -0
  205. stellar_sdk/xdr/claim_offer_atom_v0.py +129 -0
  206. stellar_sdk/xdr/claim_predicate.py +203 -0
  207. stellar_sdk/xdr/claim_predicate_type.py +60 -0
  208. stellar_sdk/xdr/claimable_balance_entry.py +144 -0
  209. stellar_sdk/xdr/claimable_balance_entry_ext.py +93 -0
  210. stellar_sdk/xdr/claimable_balance_entry_extension_v1.py +92 -0
  211. stellar_sdk/xdr/claimable_balance_entry_extension_v1_ext.py +73 -0
  212. stellar_sdk/xdr/claimable_balance_flags.py +52 -0
  213. stellar_sdk/xdr/claimable_balance_id.py +87 -0
  214. stellar_sdk/xdr/claimable_balance_id_type.py +50 -0
  215. stellar_sdk/xdr/claimant.py +91 -0
  216. stellar_sdk/xdr/claimant_type.py +50 -0
  217. stellar_sdk/xdr/claimant_v0.py +86 -0
  218. stellar_sdk/xdr/clawback_claimable_balance_op.py +71 -0
  219. stellar_sdk/xdr/clawback_claimable_balance_result.py +114 -0
  220. stellar_sdk/xdr/clawback_claimable_balance_result_code.py +59 -0
  221. stellar_sdk/xdr/clawback_op.py +97 -0
  222. stellar_sdk/xdr/clawback_result.py +94 -0
  223. stellar_sdk/xdr/clawback_result_code.py +61 -0
  224. stellar_sdk/xdr/config_setting_contract_bandwidth_v0.py +100 -0
  225. stellar_sdk/xdr/config_setting_contract_compute_v0.py +112 -0
  226. stellar_sdk/xdr/config_setting_contract_events_v0.py +90 -0
  227. stellar_sdk/xdr/config_setting_contract_execution_lanes_v0.py +72 -0
  228. stellar_sdk/xdr/config_setting_contract_historical_data_v0.py +71 -0
  229. stellar_sdk/xdr/config_setting_contract_ledger_cost_ext_v0.py +91 -0
  230. stellar_sdk/xdr/config_setting_contract_ledger_cost_v0.py +226 -0
  231. stellar_sdk/xdr/config_setting_contract_parallel_compute_v0.py +78 -0
  232. stellar_sdk/xdr/config_setting_entry.py +570 -0
  233. stellar_sdk/xdr/config_setting_id.py +82 -0
  234. stellar_sdk/xdr/config_setting_scp_timing.py +125 -0
  235. stellar_sdk/xdr/config_upgrade_set.py +81 -0
  236. stellar_sdk/xdr/config_upgrade_set_key.py +86 -0
  237. stellar_sdk/xdr/constants.py +36 -0
  238. stellar_sdk/xdr/contract_code_cost_inputs.py +167 -0
  239. stellar_sdk/xdr/contract_code_entry.py +107 -0
  240. stellar_sdk/xdr/contract_code_entry_ext.py +97 -0
  241. stellar_sdk/xdr/contract_code_entry_v1.py +84 -0
  242. stellar_sdk/xdr/contract_cost_param_entry.py +97 -0
  243. stellar_sdk/xdr/contract_cost_params.py +74 -0
  244. stellar_sdk/xdr/contract_cost_type.py +267 -0
  245. stellar_sdk/xdr/contract_data_durability.py +51 -0
  246. stellar_sdk/xdr/contract_data_entry.py +116 -0
  247. stellar_sdk/xdr/contract_event.py +125 -0
  248. stellar_sdk/xdr/contract_event_body.py +91 -0
  249. stellar_sdk/xdr/contract_event_type.py +54 -0
  250. stellar_sdk/xdr/contract_event_v0.py +94 -0
  251. stellar_sdk/xdr/contract_executable.py +97 -0
  252. stellar_sdk/xdr/contract_executable_type.py +52 -0
  253. stellar_sdk/xdr/contract_id.py +60 -0
  254. stellar_sdk/xdr/contract_id_preimage.py +118 -0
  255. stellar_sdk/xdr/contract_id_preimage_from_address.py +84 -0
  256. stellar_sdk/xdr/contract_id_preimage_type.py +52 -0
  257. stellar_sdk/xdr/create_account_op.py +87 -0
  258. stellar_sdk/xdr/create_account_result.py +94 -0
  259. stellar_sdk/xdr/create_account_result_code.py +62 -0
  260. stellar_sdk/xdr/create_claimable_balance_op.py +108 -0
  261. stellar_sdk/xdr/create_claimable_balance_result.py +145 -0
  262. stellar_sdk/xdr/create_claimable_balance_result_code.py +60 -0
  263. stellar_sdk/xdr/create_contract_args.py +87 -0
  264. stellar_sdk/xdr/create_contract_args_v2.py +109 -0
  265. stellar_sdk/xdr/create_passive_sell_offer_op.py +106 -0
  266. stellar_sdk/xdr/crypto_key_type.py +60 -0
  267. stellar_sdk/xdr/curve25519_public.py +71 -0
  268. stellar_sdk/xdr/curve25519_secret.py +71 -0
  269. stellar_sdk/xdr/data_entry.py +114 -0
  270. stellar_sdk/xdr/data_entry_ext.py +73 -0
  271. stellar_sdk/xdr/data_value.py +60 -0
  272. stellar_sdk/xdr/decorated_signature.py +84 -0
  273. stellar_sdk/xdr/dependent_tx_cluster.py +73 -0
  274. stellar_sdk/xdr/diagnostic_event.py +87 -0
  275. stellar_sdk/xdr/dont_have.py +84 -0
  276. stellar_sdk/xdr/duration.py +60 -0
  277. stellar_sdk/xdr/encrypted_body.py +60 -0
  278. stellar_sdk/xdr/end_sponsoring_future_reserves_result.py +94 -0
  279. stellar_sdk/xdr/end_sponsoring_future_reserves_result_code.py +55 -0
  280. stellar_sdk/xdr/envelope_type.py +68 -0
  281. stellar_sdk/xdr/error.py +84 -0
  282. stellar_sdk/xdr/error_code.py +58 -0
  283. stellar_sdk/xdr/eviction_iterator.py +96 -0
  284. stellar_sdk/xdr/extend_footprint_ttl_op.py +84 -0
  285. stellar_sdk/xdr/extend_footprint_ttl_result.py +101 -0
  286. stellar_sdk/xdr/extend_footprint_ttl_result_code.py +59 -0
  287. stellar_sdk/xdr/extension_point.py +73 -0
  288. stellar_sdk/xdr/fee_bump_transaction.py +117 -0
  289. stellar_sdk/xdr/fee_bump_transaction_envelope.py +97 -0
  290. stellar_sdk/xdr/fee_bump_transaction_ext.py +73 -0
  291. stellar_sdk/xdr/fee_bump_transaction_inner_tx.py +87 -0
  292. stellar_sdk/xdr/flood_advert.py +71 -0
  293. stellar_sdk/xdr/flood_demand.py +71 -0
  294. stellar_sdk/xdr/generalized_transaction_set.py +92 -0
  295. stellar_sdk/xdr/hash.py +60 -0
  296. stellar_sdk/xdr/hash_id_preimage.py +176 -0
  297. stellar_sdk/xdr/hash_id_preimage_contract_id.py +87 -0
  298. stellar_sdk/xdr/hash_id_preimage_operation_id.py +97 -0
  299. stellar_sdk/xdr/hash_id_preimage_revoke_id.py +117 -0
  300. stellar_sdk/xdr/hash_id_preimage_soroban_authorization.py +107 -0
  301. stellar_sdk/xdr/hello.py +154 -0
  302. stellar_sdk/xdr/hmac_sha256_key.py +71 -0
  303. stellar_sdk/xdr/hmac_sha256_mac.py +71 -0
  304. stellar_sdk/xdr/host_function.py +150 -0
  305. stellar_sdk/xdr/host_function_type.py +56 -0
  306. stellar_sdk/xdr/hot_archive_bucket_entry.py +131 -0
  307. stellar_sdk/xdr/hot_archive_bucket_entry_type.py +56 -0
  308. stellar_sdk/xdr/inflation_payout.py +84 -0
  309. stellar_sdk/xdr/inflation_result.py +103 -0
  310. stellar_sdk/xdr/inflation_result_code.py +54 -0
  311. stellar_sdk/xdr/inner_transaction_result.py +130 -0
  312. stellar_sdk/xdr/inner_transaction_result_ext.py +73 -0
  313. stellar_sdk/xdr/inner_transaction_result_pair.py +87 -0
  314. stellar_sdk/xdr/inner_transaction_result_result.py +189 -0
  315. stellar_sdk/xdr/int128_parts.py +83 -0
  316. stellar_sdk/xdr/int256_parts.py +104 -0
  317. stellar_sdk/xdr/int32.py +60 -0
  318. stellar_sdk/xdr/int64.py +60 -0
  319. stellar_sdk/xdr/invoke_contract_args.py +107 -0
  320. stellar_sdk/xdr/invoke_host_function_op.py +97 -0
  321. stellar_sdk/xdr/invoke_host_function_result.py +128 -0
  322. stellar_sdk/xdr/invoke_host_function_result_code.py +63 -0
  323. stellar_sdk/xdr/invoke_host_function_success_pre_image.py +95 -0
  324. stellar_sdk/xdr/ip_addr_type.py +52 -0
  325. stellar_sdk/xdr/ledger_bounds.py +85 -0
  326. stellar_sdk/xdr/ledger_close_meta.py +122 -0
  327. stellar_sdk/xdr/ledger_close_meta_batch.py +112 -0
  328. stellar_sdk/xdr/ledger_close_meta_ext.py +93 -0
  329. stellar_sdk/xdr/ledger_close_meta_ext_v1.py +87 -0
  330. stellar_sdk/xdr/ledger_close_meta_v0.py +157 -0
  331. stellar_sdk/xdr/ledger_close_meta_v1.py +228 -0
  332. stellar_sdk/xdr/ledger_close_meta_v2.py +206 -0
  333. stellar_sdk/xdr/ledger_close_value_signature.py +84 -0
  334. stellar_sdk/xdr/ledger_entry.py +130 -0
  335. stellar_sdk/xdr/ledger_entry_change.py +151 -0
  336. stellar_sdk/xdr/ledger_entry_change_type.py +58 -0
  337. stellar_sdk/xdr/ledger_entry_changes.py +73 -0
  338. stellar_sdk/xdr/ledger_entry_data.py +258 -0
  339. stellar_sdk/xdr/ledger_entry_ext.py +93 -0
  340. stellar_sdk/xdr/ledger_entry_extension_v1.py +90 -0
  341. stellar_sdk/xdr/ledger_entry_extension_v1_ext.py +73 -0
  342. stellar_sdk/xdr/ledger_entry_type.py +68 -0
  343. stellar_sdk/xdr/ledger_footprint.py +104 -0
  344. stellar_sdk/xdr/ledger_header.py +239 -0
  345. stellar_sdk/xdr/ledger_header_ext.py +93 -0
  346. stellar_sdk/xdr/ledger_header_extension_v1.py +90 -0
  347. stellar_sdk/xdr/ledger_header_extension_v1_ext.py +73 -0
  348. stellar_sdk/xdr/ledger_header_flags.py +54 -0
  349. stellar_sdk/xdr/ledger_header_history_entry.py +104 -0
  350. stellar_sdk/xdr/ledger_header_history_entry_ext.py +73 -0
  351. stellar_sdk/xdr/ledger_key.py +299 -0
  352. stellar_sdk/xdr/ledger_key_account.py +71 -0
  353. stellar_sdk/xdr/ledger_key_claimable_balance.py +71 -0
  354. stellar_sdk/xdr/ledger_key_config_setting.py +71 -0
  355. stellar_sdk/xdr/ledger_key_contract_code.py +71 -0
  356. stellar_sdk/xdr/ledger_key_contract_data.py +97 -0
  357. stellar_sdk/xdr/ledger_key_data.py +84 -0
  358. stellar_sdk/xdr/ledger_key_liquidity_pool.py +71 -0
  359. stellar_sdk/xdr/ledger_key_offer.py +84 -0
  360. stellar_sdk/xdr/ledger_key_trust_line.py +84 -0
  361. stellar_sdk/xdr/ledger_key_ttl.py +72 -0
  362. stellar_sdk/xdr/ledger_scp_messages.py +95 -0
  363. stellar_sdk/xdr/ledger_upgrade.py +216 -0
  364. stellar_sdk/xdr/ledger_upgrade_type.py +62 -0
  365. stellar_sdk/xdr/liabilities.py +83 -0
  366. stellar_sdk/xdr/liquidity_pool_constant_product_parameters.py +96 -0
  367. stellar_sdk/xdr/liquidity_pool_deposit_op.py +115 -0
  368. stellar_sdk/xdr/liquidity_pool_deposit_result.py +115 -0
  369. stellar_sdk/xdr/liquidity_pool_deposit_result_code.py +71 -0
  370. stellar_sdk/xdr/liquidity_pool_entry.py +102 -0
  371. stellar_sdk/xdr/liquidity_pool_entry_body.py +102 -0
  372. stellar_sdk/xdr/liquidity_pool_entry_constant_product.py +118 -0
  373. stellar_sdk/xdr/liquidity_pool_parameters.py +95 -0
  374. stellar_sdk/xdr/liquidity_pool_type.py +50 -0
  375. stellar_sdk/xdr/liquidity_pool_withdraw_op.py +105 -0
  376. stellar_sdk/xdr/liquidity_pool_withdraw_result.py +117 -0
  377. stellar_sdk/xdr/liquidity_pool_withdraw_result_code.py +66 -0
  378. stellar_sdk/xdr/manage_buy_offer_op.py +118 -0
  379. stellar_sdk/xdr/manage_buy_offer_result.py +148 -0
  380. stellar_sdk/xdr/manage_buy_offer_result_code.py +81 -0
  381. stellar_sdk/xdr/manage_data_op.py +89 -0
  382. stellar_sdk/xdr/manage_data_result.py +94 -0
  383. stellar_sdk/xdr/manage_data_result_code.py +62 -0
  384. stellar_sdk/xdr/manage_offer_effect.py +54 -0
  385. stellar_sdk/xdr/manage_offer_success_result.py +105 -0
  386. stellar_sdk/xdr/manage_offer_success_result_offer.py +102 -0
  387. stellar_sdk/xdr/manage_sell_offer_op.py +117 -0
  388. stellar_sdk/xdr/manage_sell_offer_result.py +148 -0
  389. stellar_sdk/xdr/manage_sell_offer_result_code.py +84 -0
  390. stellar_sdk/xdr/memo.py +143 -0
  391. stellar_sdk/xdr/memo_type.py +58 -0
  392. stellar_sdk/xdr/message_type.py +104 -0
  393. stellar_sdk/xdr/muxed_account.py +110 -0
  394. stellar_sdk/xdr/muxed_account_med25519.py +84 -0
  395. stellar_sdk/xdr/muxed_ed25519_account.py +84 -0
  396. stellar_sdk/xdr/node_id.py +60 -0
  397. stellar_sdk/xdr/offer_entry.py +158 -0
  398. stellar_sdk/xdr/offer_entry_ext.py +73 -0
  399. stellar_sdk/xdr/offer_entry_flags.py +52 -0
  400. stellar_sdk/xdr/operation.py +152 -0
  401. stellar_sdk/xdr/operation_body.py +620 -0
  402. stellar_sdk/xdr/operation_meta.py +71 -0
  403. stellar_sdk/xdr/operation_meta_v2.py +110 -0
  404. stellar_sdk/xdr/operation_result.py +175 -0
  405. stellar_sdk/xdr/operation_result_code.py +63 -0
  406. stellar_sdk/xdr/operation_result_tr.py +718 -0
  407. stellar_sdk/xdr/operation_type.py +102 -0
  408. stellar_sdk/xdr/parallel_tx_execution_stage.py +74 -0
  409. stellar_sdk/xdr/parallel_txs_component.py +105 -0
  410. stellar_sdk/xdr/path_payment_strict_receive_op.py +139 -0
  411. stellar_sdk/xdr/path_payment_strict_receive_result.py +252 -0
  412. stellar_sdk/xdr/path_payment_strict_receive_result_code.py +86 -0
  413. stellar_sdk/xdr/path_payment_strict_receive_result_success.py +95 -0
  414. stellar_sdk/xdr/path_payment_strict_send_op.py +139 -0
  415. stellar_sdk/xdr/path_payment_strict_send_result.py +231 -0
  416. stellar_sdk/xdr/path_payment_strict_send_result_code.py +85 -0
  417. stellar_sdk/xdr/path_payment_strict_send_result_success.py +95 -0
  418. stellar_sdk/xdr/payment_op.py +97 -0
  419. stellar_sdk/xdr/payment_result.py +119 -0
  420. stellar_sdk/xdr/payment_result_code.py +71 -0
  421. stellar_sdk/xdr/peer_address.py +103 -0
  422. stellar_sdk/xdr/peer_address_ip.py +105 -0
  423. stellar_sdk/xdr/peer_stats.py +207 -0
  424. stellar_sdk/xdr/persisted_scp_state.py +102 -0
  425. stellar_sdk/xdr/persisted_scp_state_v0.py +128 -0
  426. stellar_sdk/xdr/persisted_scp_state_v1.py +109 -0
  427. stellar_sdk/xdr/pool_id.py +60 -0
  428. stellar_sdk/xdr/precondition_type.py +54 -0
  429. stellar_sdk/xdr/preconditions.py +116 -0
  430. stellar_sdk/xdr/preconditions_v2.py +177 -0
  431. stellar_sdk/xdr/price.py +83 -0
  432. stellar_sdk/xdr/public_key.py +87 -0
  433. stellar_sdk/xdr/public_key_type.py +50 -0
  434. stellar_sdk/xdr/restore_footprint_op.py +71 -0
  435. stellar_sdk/xdr/restore_footprint_result.py +98 -0
  436. stellar_sdk/xdr/restore_footprint_result_code.py +59 -0
  437. stellar_sdk/xdr/revoke_sponsorship_op.py +114 -0
  438. stellar_sdk/xdr/revoke_sponsorship_op_signer.py +86 -0
  439. stellar_sdk/xdr/revoke_sponsorship_result.py +102 -0
  440. stellar_sdk/xdr/revoke_sponsorship_result_code.py +63 -0
  441. stellar_sdk/xdr/revoke_sponsorship_type.py +52 -0
  442. stellar_sdk/xdr/sc_address.py +174 -0
  443. stellar_sdk/xdr/sc_address_type.py +58 -0
  444. stellar_sdk/xdr/sc_bytes.py +60 -0
  445. stellar_sdk/xdr/sc_contract_instance.py +88 -0
  446. stellar_sdk/xdr/sc_env_meta_entry.py +97 -0
  447. stellar_sdk/xdr/sc_env_meta_entry_interface_version.py +82 -0
  448. stellar_sdk/xdr/sc_env_meta_kind.py +50 -0
  449. stellar_sdk/xdr/sc_error.py +182 -0
  450. stellar_sdk/xdr/sc_error_code.py +68 -0
  451. stellar_sdk/xdr/sc_error_type.py +68 -0
  452. stellar_sdk/xdr/sc_map.py +71 -0
  453. stellar_sdk/xdr/sc_map_entry.py +83 -0
  454. stellar_sdk/xdr/sc_meta_entry.py +87 -0
  455. stellar_sdk/xdr/sc_meta_kind.py +50 -0
  456. stellar_sdk/xdr/sc_meta_v0.py +83 -0
  457. stellar_sdk/xdr/sc_nonce_key.py +70 -0
  458. stellar_sdk/xdr/sc_spec_entry.py +190 -0
  459. stellar_sdk/xdr/sc_spec_entry_kind.py +60 -0
  460. stellar_sdk/xdr/sc_spec_event_data_format.py +54 -0
  461. stellar_sdk/xdr/sc_spec_event_param_location_v0.py +52 -0
  462. stellar_sdk/xdr/sc_spec_event_param_v0.py +107 -0
  463. stellar_sdk/xdr/sc_spec_event_v0.py +147 -0
  464. stellar_sdk/xdr/sc_spec_function_input_v0.py +97 -0
  465. stellar_sdk/xdr/sc_spec_function_v0.py +129 -0
  466. stellar_sdk/xdr/sc_spec_type.py +106 -0
  467. stellar_sdk/xdr/sc_spec_type_bytes_n.py +71 -0
  468. stellar_sdk/xdr/sc_spec_type_def.py +297 -0
  469. stellar_sdk/xdr/sc_spec_type_map.py +83 -0
  470. stellar_sdk/xdr/sc_spec_type_option.py +71 -0
  471. stellar_sdk/xdr/sc_spec_type_result.py +83 -0
  472. stellar_sdk/xdr/sc_spec_type_tuple.py +82 -0
  473. stellar_sdk/xdr/sc_spec_type_udt.py +71 -0
  474. stellar_sdk/xdr/sc_spec_type_vec.py +71 -0
  475. stellar_sdk/xdr/sc_spec_udt_enum_case_v0.py +97 -0
  476. stellar_sdk/xdr/sc_spec_udt_enum_v0.py +117 -0
  477. stellar_sdk/xdr/sc_spec_udt_error_enum_case_v0.py +97 -0
  478. stellar_sdk/xdr/sc_spec_udt_error_enum_v0.py +117 -0
  479. stellar_sdk/xdr/sc_spec_udt_struct_field_v0.py +97 -0
  480. stellar_sdk/xdr/sc_spec_udt_struct_v0.py +117 -0
  481. stellar_sdk/xdr/sc_spec_udt_union_case_tuple_v0.py +108 -0
  482. stellar_sdk/xdr/sc_spec_udt_union_case_v0.py +114 -0
  483. stellar_sdk/xdr/sc_spec_udt_union_case_v0_kind.py +52 -0
  484. stellar_sdk/xdr/sc_spec_udt_union_case_void_v0.py +84 -0
  485. stellar_sdk/xdr/sc_spec_udt_union_v0.py +117 -0
  486. stellar_sdk/xdr/sc_string.py +60 -0
  487. stellar_sdk/xdr/sc_symbol.py +61 -0
  488. stellar_sdk/xdr/sc_val.py +474 -0
  489. stellar_sdk/xdr/sc_val_type.py +121 -0
  490. stellar_sdk/xdr/sc_vec.py +71 -0
  491. stellar_sdk/xdr/scp_ballot.py +84 -0
  492. stellar_sdk/xdr/scp_envelope.py +84 -0
  493. stellar_sdk/xdr/scp_history_entry.py +87 -0
  494. stellar_sdk/xdr/scp_history_entry_v0.py +98 -0
  495. stellar_sdk/xdr/scp_nomination.py +117 -0
  496. stellar_sdk/xdr/scp_quorum_set.py +117 -0
  497. stellar_sdk/xdr/scp_statement.py +129 -0
  498. stellar_sdk/xdr/scp_statement_confirm.py +115 -0
  499. stellar_sdk/xdr/scp_statement_externalize.py +97 -0
  500. stellar_sdk/xdr/scp_statement_pledges.py +162 -0
  501. stellar_sdk/xdr/scp_statement_prepare.py +133 -0
  502. stellar_sdk/xdr/scp_statement_type.py +56 -0
  503. stellar_sdk/xdr/send_more.py +71 -0
  504. stellar_sdk/xdr/send_more_extended.py +86 -0
  505. stellar_sdk/xdr/sequence_number.py +60 -0
  506. stellar_sdk/xdr/serialized_binary_fuse_filter.py +158 -0
  507. stellar_sdk/xdr/set_options_op.py +196 -0
  508. stellar_sdk/xdr/set_options_result.py +124 -0
  509. stellar_sdk/xdr/set_options_result_code.py +73 -0
  510. stellar_sdk/xdr/set_trust_line_flags_op.py +107 -0
  511. stellar_sdk/xdr/set_trust_line_flags_result.py +99 -0
  512. stellar_sdk/xdr/set_trust_line_flags_result_code.py +64 -0
  513. stellar_sdk/xdr/short_hash_seed.py +71 -0
  514. stellar_sdk/xdr/signature.py +60 -0
  515. stellar_sdk/xdr/signature_hint.py +60 -0
  516. stellar_sdk/xdr/signed_time_sliced_survey_request_message.py +87 -0
  517. stellar_sdk/xdr/signed_time_sliced_survey_response_message.py +87 -0
  518. stellar_sdk/xdr/signed_time_sliced_survey_start_collecting_message.py +89 -0
  519. stellar_sdk/xdr/signed_time_sliced_survey_stop_collecting_message.py +89 -0
  520. stellar_sdk/xdr/signer.py +84 -0
  521. stellar_sdk/xdr/signer_key.py +152 -0
  522. stellar_sdk/xdr/signer_key_ed25519_signed_payload.py +86 -0
  523. stellar_sdk/xdr/signer_key_type.py +56 -0
  524. stellar_sdk/xdr/simple_payment_result.py +97 -0
  525. stellar_sdk/xdr/soroban_address_credentials.py +107 -0
  526. stellar_sdk/xdr/soroban_authorization_entries.py +78 -0
  527. stellar_sdk/xdr/soroban_authorization_entry.py +87 -0
  528. stellar_sdk/xdr/soroban_authorized_function.py +160 -0
  529. stellar_sdk/xdr/soroban_authorized_function_type.py +54 -0
  530. stellar_sdk/xdr/soroban_authorized_invocation.py +97 -0
  531. stellar_sdk/xdr/soroban_credentials.py +93 -0
  532. stellar_sdk/xdr/soroban_credentials_type.py +52 -0
  533. stellar_sdk/xdr/soroban_resources.py +110 -0
  534. stellar_sdk/xdr/soroban_resources_ext_v0.py +88 -0
  535. stellar_sdk/xdr/soroban_transaction_data.py +112 -0
  536. stellar_sdk/xdr/soroban_transaction_data_ext.py +97 -0
  537. stellar_sdk/xdr/soroban_transaction_meta.py +134 -0
  538. stellar_sdk/xdr/soroban_transaction_meta_ext.py +93 -0
  539. stellar_sdk/xdr/soroban_transaction_meta_ext_v1.py +137 -0
  540. stellar_sdk/xdr/soroban_transaction_meta_v2.py +90 -0
  541. stellar_sdk/xdr/sponsorship_descriptor.py +67 -0
  542. stellar_sdk/xdr/state_archival_settings.py +177 -0
  543. stellar_sdk/xdr/stellar_message.py +550 -0
  544. stellar_sdk/xdr/stellar_value.py +133 -0
  545. stellar_sdk/xdr/stellar_value_ext.py +97 -0
  546. stellar_sdk/xdr/stellar_value_type.py +52 -0
  547. stellar_sdk/xdr/stored_debug_transaction_set.py +97 -0
  548. stellar_sdk/xdr/stored_transaction_set.py +110 -0
  549. stellar_sdk/xdr/string32.py +60 -0
  550. stellar_sdk/xdr/string64.py +60 -0
  551. stellar_sdk/xdr/survey_message_command_type.py +50 -0
  552. stellar_sdk/xdr/survey_message_response_type.py +50 -0
  553. stellar_sdk/xdr/survey_request_message.py +116 -0
  554. stellar_sdk/xdr/survey_response_body.py +94 -0
  555. stellar_sdk/xdr/survey_response_message.py +116 -0
  556. stellar_sdk/xdr/threshold_indexes.py +56 -0
  557. stellar_sdk/xdr/thresholds.py +60 -0
  558. stellar_sdk/xdr/time_bounds.py +83 -0
  559. stellar_sdk/xdr/time_point.py +60 -0
  560. stellar_sdk/xdr/time_sliced_node_data.py +167 -0
  561. stellar_sdk/xdr/time_sliced_peer_data.py +87 -0
  562. stellar_sdk/xdr/time_sliced_peer_data_list.py +74 -0
  563. stellar_sdk/xdr/time_sliced_survey_request_message.py +105 -0
  564. stellar_sdk/xdr/time_sliced_survey_response_message.py +84 -0
  565. stellar_sdk/xdr/time_sliced_survey_start_collecting_message.py +96 -0
  566. stellar_sdk/xdr/time_sliced_survey_stop_collecting_message.py +96 -0
  567. stellar_sdk/xdr/topology_response_body_v2.py +96 -0
  568. stellar_sdk/xdr/transaction.py +166 -0
  569. stellar_sdk/xdr/transaction_envelope.py +122 -0
  570. stellar_sdk/xdr/transaction_event.py +83 -0
  571. stellar_sdk/xdr/transaction_event_stage.py +59 -0
  572. stellar_sdk/xdr/transaction_ext.py +97 -0
  573. stellar_sdk/xdr/transaction_history_entry.py +106 -0
  574. stellar_sdk/xdr/transaction_history_entry_ext.py +97 -0
  575. stellar_sdk/xdr/transaction_history_result_entry.py +104 -0
  576. stellar_sdk/xdr/transaction_history_result_entry_ext.py +73 -0
  577. stellar_sdk/xdr/transaction_meta.py +168 -0
  578. stellar_sdk/xdr/transaction_meta_v1.py +97 -0
  579. stellar_sdk/xdr/transaction_meta_v2.py +109 -0
  580. stellar_sdk/xdr/transaction_meta_v3.py +137 -0
  581. stellar_sdk/xdr/transaction_meta_v4.py +180 -0
  582. stellar_sdk/xdr/transaction_phase.py +124 -0
  583. stellar_sdk/xdr/transaction_result.py +131 -0
  584. stellar_sdk/xdr/transaction_result_code.py +90 -0
  585. stellar_sdk/xdr/transaction_result_ext.py +73 -0
  586. stellar_sdk/xdr/transaction_result_meta.py +97 -0
  587. stellar_sdk/xdr/transaction_result_meta_v1.py +118 -0
  588. stellar_sdk/xdr/transaction_result_pair.py +87 -0
  589. stellar_sdk/xdr/transaction_result_result.py +220 -0
  590. stellar_sdk/xdr/transaction_result_set.py +82 -0
  591. stellar_sdk/xdr/transaction_set.py +98 -0
  592. stellar_sdk/xdr/transaction_set_v1.py +98 -0
  593. stellar_sdk/xdr/transaction_signature_payload.py +99 -0
  594. stellar_sdk/xdr/transaction_signature_payload_tagged_transaction.py +107 -0
  595. stellar_sdk/xdr/transaction_v0.py +158 -0
  596. stellar_sdk/xdr/transaction_v0_envelope.py +97 -0
  597. stellar_sdk/xdr/transaction_v0_ext.py +73 -0
  598. stellar_sdk/xdr/transaction_v1_envelope.py +97 -0
  599. stellar_sdk/xdr/trust_line_asset.py +145 -0
  600. stellar_sdk/xdr/trust_line_entry.py +149 -0
  601. stellar_sdk/xdr/trust_line_entry_ext.py +105 -0
  602. stellar_sdk/xdr/trust_line_entry_extension_v2.py +93 -0
  603. stellar_sdk/xdr/trust_line_entry_extension_v2_ext.py +73 -0
  604. stellar_sdk/xdr/trust_line_entry_v1.py +92 -0
  605. stellar_sdk/xdr/trust_line_entry_v1_ext.py +93 -0
  606. stellar_sdk/xdr/trust_line_flags.py +59 -0
  607. stellar_sdk/xdr/ttl_entry.py +87 -0
  608. stellar_sdk/xdr/tx_advert_vector.py +72 -0
  609. stellar_sdk/xdr/tx_demand_vector.py +72 -0
  610. stellar_sdk/xdr/tx_set_component.py +102 -0
  611. stellar_sdk/xdr/tx_set_component_txs_maybe_discounted_fee.py +99 -0
  612. stellar_sdk/xdr/tx_set_component_type.py +52 -0
  613. stellar_sdk/xdr/u_int128_parts.py +82 -0
  614. stellar_sdk/xdr/u_int256_parts.py +103 -0
  615. stellar_sdk/xdr/uint256.py +60 -0
  616. stellar_sdk/xdr/uint32.py +60 -0
  617. stellar_sdk/xdr/uint64.py +60 -0
  618. stellar_sdk/xdr/upgrade_entry_meta.py +84 -0
  619. stellar_sdk/xdr/upgrade_type.py +60 -0
  620. stellar_sdk/xdr/value.py +60 -0
  621. stellar_sdk-13.2.1.dist-info/METADATA +141 -0
  622. stellar_sdk-13.2.1.dist-info/RECORD +624 -0
  623. stellar_sdk-13.2.1.dist-info/WHEEL +4 -0
  624. stellar_sdk-13.2.1.dist-info/licenses/LICENSE +201 -0
@@ -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}]>"