{"id":18000156,"url":"https://github.com/kommitters/stellar_sdk","last_synced_at":"2026-03-02T21:09:38.982Z","repository":{"id":39673620,"uuid":"394467538","full_name":"kommitters/stellar_sdk","owner":"kommitters","description":"Elixir library to interact with the Stellar blockchain","archived":false,"fork":false,"pushed_at":"2024-08-16T23:31:17.000Z","size":860,"stargazers_count":14,"open_issues_count":7,"forks_count":16,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-30T00:34:14.696Z","etag":null,"topics":["blockchain","elixir","elixir-lang","hacktoberfest","sdk","stellar","stellar-network"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/stellar_sdk","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kommitters.png","metadata":{"funding":{"github":["kommitters"]},"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-09T23:27:46.000Z","updated_at":"2024-08-16T23:28:19.000Z","dependencies_parsed_at":"2023-10-15T03:27:00.634Z","dependency_job_id":"3c77f7ed-143b-4110-a45f-fb5f99f28cbf","html_url":"https://github.com/kommitters/stellar_sdk","commit_stats":{"total_commits":143,"total_committers":13,"mean_commits":11.0,"dds":0.7132867132867133,"last_synced_commit":"d8afcfa953619920a918e0b52a09069261ac0f33"},"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kommitters%2Fstellar_sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kommitters%2Fstellar_sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kommitters%2Fstellar_sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kommitters%2Fstellar_sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kommitters","download_url":"https://codeload.github.com/kommitters/stellar_sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238362525,"owners_count":19459399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","elixir","elixir-lang","hacktoberfest","sdk","stellar","stellar-network"],"created_at":"2024-10-29T23:09:55.004Z","updated_at":"2025-10-29T04:30:21.172Z","avatar_url":"https://github.com/kommitters.png","language":"Elixir","funding_links":["https://github.com/sponsors/kommitters"],"categories":[],"sub_categories":[],"readme":"# Elixir Stellar SDK\n\n![stability-beta](https://img.shields.io/badge/stability-beta-33bbff.svg?style=for-the-badge)\n![Build Badge](https://img.shields.io/github/actions/workflow/status/kommitters/stellar_sdk/ci.yml?branch=main\u0026style=for-the-badge)\n[![Coverage Status](https://img.shields.io/coveralls/github/kommitters/stellar_sdk?style=for-the-badge)](https://coveralls.io/github/kommitters/stellar_sdk)\n[![Version Badge](https://img.shields.io/hexpm/v/stellar_sdk?style=for-the-badge)](https://hexdocs.pm/stellar_sdk)\n![Downloads Badge](https://img.shields.io/hexpm/dt/stellar_sdk?style=for-the-badge)\n[![License badge](https://img.shields.io/hexpm/l/stellar_sdk.svg?style=for-the-badge)](https://github.com/kommitters/stellar_sdk/blob/main/LICENSE.md)\n[![OpenSSF Best Practices](https://img.shields.io/cii/summary/6367?label=openssf%20best%20practices\u0026style=for-the-badge)](https://bestpractices.coreinfrastructure.org/projects/6367)\n[![OpenSSF Scorecard](https://img.shields.io/ossf-scorecard/github.com/kommitters/stellar_sdk?label=openssf%20scorecard\u0026style=for-the-badge)](https://api.securityscorecards.dev/projects/github.com/kommitters/stellar_sdk)\n\nThe **Stellar SDK** enables the construction, signing and encoding of Stellar [transactions][stellar-docs-tx] and [operations][stellar-docs-list-operations] in **Elixir**, as well as provides a client for interfacing with [Horizon][horizon-api] server REST endpoints to retrieve ledger information, and to submit transactions.\n\nThis library is aimed at developers building Elixir applications that interact with the [**Stellar network**][stellar].\n\n\u003e [!NOTE]\n\u003e If you are a smart contract developer building on Soroban, we recommend using [Soroban.ex][soroban.ex], a library built on top of Stellar SDK which offers a developer-friendly interface for interacting with Soroban smart contracts and Soroban-RPC server.\n\n#### Protocol Version Support\n| Protocol | Version    |\n| -------- | ---------- |\n| 18       | \u003e= v0.8    |\n| 19       | \u003e= v0.9    |\n| 20       | \u003e= v0.20   |\n| 21       | \u003e= v0.21.2 |\n\n## Documentation\nThe **Stellar SDK** is composed of two complementary components: **`TxBuild`** + **`Horizon`**.\n* **`TxBuild`** - used for [**building transactions.**](#building-transactions)\n* **`Horizon`** - used for [**querying Horizon.**](#querying-horizon)\n* [**Examples.**](/docs/README.md)\n\n## Installation\n[**Available in Hex**][hex], add `stellar_sdk` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:stellar_sdk, \"~\u003e 0.22.0\"}\n  ]\nend\n```\n\n## Configuration\n\nThe default HTTP Client is `:hackney`. Options to `:hackney` can be passed through configuration params.\n```elixir\nconfig :stellar_sdk, hackney_opts: [{:connect_timeout, 1000}, {:recv_timeout, 5000}]\n```\n\n### Custom HTTP Client\nStellar allows you to use your HTTP client of choice. Specification in [**Stellar.Horizon.Client.Spec**][http_client_spec]\n\n```elixir\nconfig :stellar_sdk, :http_client_impl, YourApp.CustomClientImpl\n```\n\n## Building transactions\n\n### Accounts\nAccounts are the central data structure in Stellar. They hold balances, sign transactions, and issue assets. All entries that persist on the ledger are owned by a particular account.\n\n```elixir\n# initialize an account\naccount = Stellar.TxBuild.Account.new(\"GDC3W2X5KUTZRTQIKXM5D2I5WG5JYSEJQWEELVPQ5YMWZR6CA2JJ35RW\")\n\n```\n\n### Muxed accounts\nA **muxed** (or **multiplexed**) account is an account that exists “virtually” under a traditional Stellar account address. It combines the familiar `GABC...` address with a `64-bit` integer `ID` and can be used to distinguish multiple “virtual” accounts that share an underlying “real” account. More details in [**CAP-27**][stellar-cap-27].\n\n```elixir\n# initialize an account with a muxed address\naccount = Stellar.TxBuild.Account.new(\"MBXV5U2D67J7HUW42JKBGD4WNZON4SOPXXDFTYQ7BCOG5VCARGCRMAAAAAAAAAAAARKPQ\")\n\naccount.account_id\n# GBXV5U2D67J7HUW42JKBGD4WNZON4SOPXXDFTYQ7BCOG5VCARGCRMQQH\n\naccount.muxed_id\n# 4\n\n```\n#### Create a muxed account\n\n```elixir\n# create a muxed account\naccount = Stellar.TxBuild.Account.create_muxed(\"GBXV5U2D67J7HUW42JKBGD4WNZON4SOPXXDFTYQ7BCOG5VCARGCRMQQH\", 4)\n\naccount.address\n# MBXV5U2D67J7HUW42JKBGD4WNZON4SOPXXDFTYQ7BCOG5VCARGCRMAAAAAAAAAAAARKPQ\n\n```\n\n### KeyPairs\nStellar relies on public key cryptography to ensure that transactions are secure: every account requires a valid keypair consisting of a public key and a private key.\n\n```elixir\n# generate a random key pair\n{public_key, secret_seed} = Stellar.KeyPair.random()\n\n# derive a key pair from a secret seed\n{public_key, secret_seed} = Stellar.KeyPair.from_secret_seed(\"SA33J3ACZZCV35FNSS655WXLIPTQOJS6WPQCKKYJSREDQY7KRLECEZSZ\")\n```\n\n### Transactions\n[Transactions][stellar-docs-tx] are commands that modify the ledger state. They consist of a list of operations (up to 100) used to send payments, enter orders into the decentralized exchange, change settings on accounts, and authorize accounts to hold assets.\n\n```elixir\n# set the source account (this account should exist in the ledger)\nsource_account = Stellar.TxBuild.Account.new(\"GDC3W2X5KUTZRTQIKXM5D2I5WG5JYSEJQWEELVPQ5YMWZR6CA2JJ35RW\")\n\n# initialize a transaction\nStellar.TxBuild.new(source_account) # network_passphrase defaults to Stellar.Network.testnet_passphrase()\n\n# initialize a transaction with options\n# allowed options: network_passphrase, memo, sequence_number, base_fee, preconditions\nStellar.TxBuild.new(source_account, network_passphrase: Stellar.Network.public_passphrase(), memo: memo, sequence_number: sequence_number)\n```\n\n#### Memos\nA [memo][stellar-docs-memo] contains optional extra information for the transaction. Memos can be one of the following types:\n\n* **`MEMO_TEXT`** : A string encoded using either ASCII or UTF-8, up to 28-bytes long.\n* **`MEMO_ID`** A 64 bit unsigned integer.\n* **`MEMO_HASH`** : A 32 byte hash.\n* **`MEMO_RETURN`** : A 32 byte hash intended to be interpreted as the hash of the transaction the sender is refunding.\n\n```elixir\n# set the source account (this account should exist in the ledger)\nsource_account = Stellar.TxBuild.Account.new(\"GDC3W2X5KUTZRTQIKXM5D2I5WG5JYSEJQWEELVPQ5YMWZR6CA2JJ35RW\")\n\n# build a memo\nmemo = Stellar.TxBuild.Memo.new(:none)\nmemo = Stellar.TxBuild.Memo.new(text: \"MEMO\")\nmemo = Stellar.TxBuild.Memo.new(id: 123_4565)\nmemo = Stellar.TxBuild.Memo.new(hash: \"0859239b58d3f32972fc9124559cea7251225f2dbc6f0d83f67dc041e6608510\")\nmemo = Stellar.TxBuild.Memo.new(return: \"d83f67dc041e66085100859239b58d3f32924559cea72512272fc915f2dbc6f0\")\n\n# add a memo for the transaction\n{:ok, tx_build} =\n  source_account\n  |\u003e Stellar.TxBuild.new()\n  |\u003e Stellar.TxBuild.add_memo(memo)\n```\n\n#### Sequence number\nEach transaction has a [sequence number][stellar-docs-sequence-number] associated with the source account. Transactions follow a strict ordering rule when it comes to processing transactions per account in order to prevent double-spending.\n\n```elixir\n# set the source account (this account should exist in the ledger)\nsource_account = Stellar.TxBuild.Account.new(\"GDC3W2X5KUTZRTQIKXM5D2I5WG5JYSEJQWEELVPQ5YMWZR6CA2JJ35RW\")\n\n# fetch next account's sequence number from Horizon\n{:ok, seq_num} =\n  Stellar.Horizon.Accounts.fetch_next_sequence_number(\n    Stellar.Horizon.Server.testnet(),\n    \"GDC3W2X5KUTZRTQIKXM5D2I5WG5JYSEJQWEELVPQ5YMWZR6CA2JJ35RW\"\n  )\n\n# set the sequence number\nsequence_number = Stellar.TxBuild.SequenceNumber.new(seq_num)\n\n# set the sequence number for the transaction\n{:ok, tx_build} =\n  source_account\n  |\u003e Stellar.TxBuild.new()\n  |\u003e Stellar.TxBuild.set_sequence_number(sequence_number)\n```\n\n#### Base fee\nEach transaction incurs a [fee][stellar-docs-fee], which is paid by the source account. When you submit a transaction, you set the maximum that you are willing to pay per operation, but you’re charged the minimum fee possible based on network activity.\n\n```elixir\n# set the source account (this account should exist in the ledger)\nsource_account = Stellar.TxBuild.Account.new(\"GDC3W2X5KUTZRTQIKXM5D2I5WG5JYSEJQWEELVPQ5YMWZR6CA2JJ35RW\")\n\n# build a fee\nbase_fee = Stellar.TxBuild.BaseFee.new(1_000)\n\n# set a fee for the transaction\n{:ok, tx_build} =\n  source_account\n  |\u003e Stellar.TxBuild.new()\n  |\u003e Stellar.TxBuild.set_base_fee(base_fee)\n```\n\n#### Preconditions\nProposed on the [Stellar protocol-19][stellar-protocol-19] implementation, [Preconditions][stellar-docs-preconditions] are conditions that determines if a transaction is valid or not, and implements the following conditions:\n\n- **Time bounds**: [TimeBounds][stellar-docs-time-bounds] are optional UNIX timestamps (in seconds), determined by ledger time. A lower and upper bound of when this transaction will be valid.\n\n- **Ledger bounds**: [LedgerBounds][stellar-docs-ledger-bounds] are like Time Bounds, except they apply to ledger numbers. With them set, a transaction will only be valid for ledger numbers that fall into the range you set.\n\n- **Minimum Sequence Number**: [Minimum sequence number][stellar-docs-min-seq-num] if is set, the transaction will only be valid when `S` (the minimum sequence number) satisfies `minSeqNum \u003c= S \u003c tx.seqNum`. If is not set, the default behavior applies (the transaction’s sequence number must be exactly one greater than the account’s sequence number)\n\n- **Minimum Sequence Age**: [Minimum sequence age][stellar-docs-min-seq-age] is based on the account's [sequence number age][stellar-docs-account-seq-num-age]. When is set, the transaction is only valid after a particular duration (in seconds) elapses since the account’s sequence number age.\n\n- **Minimum Sequence Ledger Gap**: [Minimum sequence ledger gap][stellar-docs-min-seq-ledger-gap] is based on the account's [sequence number age][stellar-docs-account-seq-num-age], this is similar to the minimum sequence age, except it’s expressed as a number of ledgers rather than a duration of time.\n\n- **Extra Signers**: A transaction can specify up to two [Extra signers][stellar-docs-extra-signers] (of any type) even if those signatures would not otherwise be required to authorize the transaction.\n\n```elixir\n# set the source account (this account should exist in the ledger)\nsource_account = Stellar.TxBuild.Account.new(\"GDC3W2X5KUTZRTQIKXM5D2I5WG5JYSEJQWEELVPQ5YMWZR6CA2JJ35RW\")\n\n# TimeBounds ---------------------------------------------------------------------------\n\n# no time bounds for a transaction\ntime_bounds = Stellar.TxBuild.TimeBounds.new(:none)\n\n# time bounds using UNIX timestamps\ntime_bounds = Stellar.TxBuild.TimeBounds.new(\n    min_time: 1_643_558_792,\n    max_time: 1_643_990_815\n  )\n\n# time bounds using DateTime\ntime_bounds = Stellar.TxBuild.TimeBounds.new(\n    min_time: ~U[2022-01-30 16:06:32.963238Z],\n    max_time: ~U[2022-02-04 16:06:55.734317Z]\n  )\n\n# timeout\ntime_bounds = Stellar.TxBuild.TimeBounds.set_timeout(1_643_990_815)\n\n# LedgerBounds -------------------------------------------------------------------------\n\n# no ledger bounds for a transaction\nledger_bounds = Stellar.TxBuild.LedgerBounds.new(:none)\n\n# ledger bounds with ledger numbers\nledger_bounds = Stellar.TxBuild.LedgerBounds.new(min_ledger: 0, max_ledger: 1_234_567_890)\n\n# SequenceNumber -----------------------------------------------------------------------\n\n# minimum sequence number for a transaction with value 0\nmin_seq_num = Stellar.TxBuild.SequenceNumber.new()\n\n# minimum sequence number\nmin_seq_num = Stellar.TxBuild.SequenceNumber.new(1_000_000)\n\n# ExtraSigners\n\nextra_signers = [\"GA2YG3YULNTUEMMLN4HUQVL7B37GJTYSRZYH6HZUFLXFDCCGKLXIXMDT\"]\n\n# Preconditions ------------------------------------------------------------------------\n\npreconditions =\n  Stellar.TxBuild.Preconditions.new(\n    time_bounds: time_bounds,\n    ledger_bounds: ledger_bounds,\n    min_seq_num: min_seq_num,\n    min_seq_age: 30,\n    min_seq_ledger_gap: 5,\n    extra_signers: extra_signers\n  )\n\n# set the preconditions for the transaction\n{:ok, tx_build} =\n  source_account\n  |\u003e Stellar.TxBuild.new()\n  |\u003e Stellar.TxBuild.set_preconditions(preconditions)\n```\n\n#### Operations\n[Operations][stellar-docs-list-operations] represent a desired change to the ledger: payments, offers to exchange currency, changes made to account options, etc. Operations are submitted to the Stellar network grouped in a Transaction. Single transactions may have up to 100 operations.\n\n```elixir\n# set the source account (this account should exist in the ledger)\nsource_account = Stellar.TxBuild.Account.new(\"GDC3W2X5KUTZRTQIKXM5D2I5WG5JYSEJQWEELVPQ5YMWZR6CA2JJ35RW\")\n\n# build a create_account operation\n# the destination account does not exist in the ledger\ncreate_account_op = Stellar.TxBuild.CreateAccount.new(\n    destination: \"GDWD36NCYNN4UFX63F2235QGA2XVGTXG7NQW6MN754SHTQM4XSLTXLYK\",\n    starting_balance: 2\n  )\n\n# build a payment operation\n# the destination account should exist in the ledger\npayment_op = Stellar.TxBuild.Payment.new(\n    destination: \"GDWD36NCYNN4UFX63F2235QGA2XVGTXG7NQW6MN754SHTQM4XSLTXLYK\",\n    asset: :native,\n    amount: 5\n  )\n\n# add a single operation to a transaction\n{:ok, tx_build} =\n  source_account\n  |\u003e Stellar.TxBuild.new()\n  |\u003e Stellar.TxBuild.add_operation(create_account_op)\n\n\n# add multiple operations to a transaction\n{:ok, tx_build} =\n  source_account\n  |\u003e Stellar.TxBuild.new()\n  |\u003e Stellar.TxBuild.add_operations([create_account_op, payment_op])\n```\n\n#### Signing and multi-sig\nStellar uses [signatures][stellar-docs-tx-signatures] as authorization. Transactions always need authorization from at least one public key in order to be considered valid.\n\nIt is possible to use different signature types settled by the `SetOptions` operation into the network.\n\n```elixir\n# ed25519\n# ed25519 keypair or ed25519 secret key.\nsigner_key_pair = Stellar.KeyPair.from_secret_seed(\"SBJJSBBXGKNXALBZ3F3UTHAPKJSESACSKPLW2ZEMM5E5WPVNNKTW55XN\")\nsignature = Stellar.TxBuild.Signature.new(signer_key_pair)\n\nsignature = Stellar.TxBuild.Signature.new(ed25519: \"SC7SEV3LXAIA727BI3QY67YMHXXNWATIZEW7GY4DUSR6KDVGMF546W7T\")\n\n# hash_x\n# signatures of type hash(x) require the preimage (x) in hex generated by a 256-bit random value.\nsignature = Stellar.TxBuild.Signature.new(hash_x: \"dea550a5e5897ef98a37a828e183d8d313486159329df646c1137147e766282c\")\n\n# signed_payload - {payload, ed25519}\n# payload is a hex string, maximum 32 bytes.\n# ed25519 is a ed25519 secret key.\nsignature =\n  Stellar.TxBuild.Signature.new(\n    signed_payload: [\n      payload: \"01020304\",\n      ed25519: \"SACHJRYLY43MUXRRCRFA6CZ5ZW5JVPPR4CWYWIX6BWRAOHOFVPVYDO5Z\"\n    ]\n  )\n\n```\n\nIn some cases, a transaction may need more than one signature. If the transaction has operations with multiple source accounts, it requires the source account signature for each operation. Additional signatures are required if the account associated with the transaction has multiple public keys.\n\n```elixir\n# set the source account (this account should exist in the ledger)\nsource_account = Stellar.TxBuild.Account.new(\"GDC3W2X5KUTZRTQIKXM5D2I5WG5JYSEJQWEELVPQ5YMWZR6CA2JJ35RW\")\n\n# build an operation\n# the destination account should exist in the ledger\noperation = Stellar.TxBuild.Payment.new(\n    destination: \"GDWD36NCYNN4UFX63F2235QGA2XVGTXG7NQW6MN754SHTQM4XSLTXLYK\",\n    asset: :native,\n    amount: 5\n  )\n\n# build transaction signatures\n# signer accounts should exist in the ledger\nsignature1 = Stellar.TxBuild.Signature.new(ed25519: \"SBJJSBBXGKNXALBZ3F3UTHAPKJSESACSKPLW2ZEMM5E5WPVNNKTW55XN\")\nsignature2 = Stellar.TxBuild.Signature.new(ed25519: \"SA2NWVOPQMQYAU5RATOE7HJLMPLQZRNPGSOQGGEG6P2ZSYTWFORY5AV5\")\n\n# add a single signature to a transaction\n{:ok, tx_build} =\n  source_account\n  |\u003e Stellar.TxBuild.new()\n  |\u003e Stellar.TxBuild.add_operation(operation)\n  |\u003e Stellar.TxBuild.sign(signature1)\n\n\n# add multiple signatures to a transaction\n{:ok, tx_build} =\n  source_account\n  |\u003e Stellar.TxBuild.new()\n  |\u003e Stellar.TxBuild.add_operation(operation)\n  |\u003e Stellar.TxBuild.sign([signature1, signature2])\n```\n\n#### Transaction envelope\nOnce a transaction has been filled out, it is wrapped in a [Transaction envelope][stellar-docs-tx-envelope] containing the transaction as well as a set of signatures.\n\n```elixir\n# set the source account (this account should exist in the ledger)\nsource_account = Stellar.TxBuild.Account.new(\"GDC3W2X5KUTZRTQIKXM5D2I5WG5JYSEJQWEELVPQ5YMWZR6CA2JJ35RW\")\n\n# build an operation\n# the destination account should exist in the ledger\noperation = Stellar.TxBuild.Payment.new(\n    destination: \"GDWD36NCYNN4UFX63F2235QGA2XVGTXG7NQW6MN754SHTQM4XSLTXLYK\",\n    asset: :native,\n    amount: 5\n  )\n\n# build the transaction signatures\n# signer account should exist in the ledger\nsignature = Stellar.TxBuild.Signature.new(ed25519: \"SBJJSBBXGKNXALBZ3F3UTHAPKJSESACSKPLW2ZEMM5E5WPVNNKTW55XN\")\n\n# build a base64 transaction envelope\nsource_account\n|\u003e Stellar.TxBuild.new()\n|\u003e Stellar.TxBuild.add_operation(operation)\n|\u003e Stellar.TxBuild.sign(signature)\n|\u003e Stellar.TxBuild.envelope()\n\n{:ok, \"AAAAAgAAAACuy1AULv6LOdXRYjVYl9u0g62aLg/LPRx+KKAgsCUp2wAAAGQAAA+pAAAAFAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAL5xix0HYeCnnvADhMs2eqCLBfE+WT3Kh7axgdzPzWX0AAAAAAAAAAAC+vCAAAAAAAAAAAKwJSnbAAAAQMhnGfygZvau5bXFHnJ1rCLIiqiZiI+C4Xf4bWCrxTERPOM/nJKuDottj48bep8NlI42WIUgqZVeQAKykWE74AXPzWX0AAAAQHp0wWKyv80frbOkX3QgOFtflxExX9H46b8ws8fMznSt6/9Le567cqoPxLb/SYvw3Wh6j3B5Vl04CBWyKnLYUwg=\"}\n```\n\n#### Submitting a transaction\nThe transaction can now be submitted to the Stellar network.\n\n```elixir\n# set the source account (this account should exist in the ledger)\nsource_account = Stellar.TxBuild.Account.new(\"GDC3W2X5KUTZRTQIKXM5D2I5WG5JYSEJQWEELVPQ5YMWZR6CA2JJ35RW\")\n\n# fetch next account's sequence number from Horizon\n{:ok, seq_num} = Stellar.Horizon.Accounts.fetch_next_sequence_number(\"GDC3W2X5KUTZRTQIKXM5D2I5WG5JYSEJQWEELVPQ5YMWZR6CA2JJ35RW\")\n\n# set the sequence number\nsequence_number = Stellar.TxBuild.SequenceNumber.new(seq_num)\n\n# set a memo\nmemo = Stellar.TxBuild.Memo.new(text: \"MEMO\")\n\n# build an operation\n# the destination account should exist in the ledger\noperation = Stellar.TxBuild.Payment.new(\n    destination: \"GDWD36NCYNN4UFX63F2235QGA2XVGTXG7NQW6MN754SHTQM4XSLTXLYK\",\n    asset: :native,\n    amount: 5\n  )\n\n# build the transaction signatures\n# signer account should exist in the ledger\nsignature = Stellar.TxBuild.Signature.new(ed25519: \"SBJJSBBXGKNXALBZ3F3UTHAPKJSESACSKPLW2ZEMM5E5WPVNNKTW55XN\")\n\n# build a base64 transaction envelope\n{:ok, base64_envelope} =\n  source_account\n  |\u003e Stellar.TxBuild.new(sequence_number: sequence_number)\n  |\u003e Stellar.TxBuild.add_memo(memo)\n  |\u003e Stellar.TxBuild.add_operation(operation)\n  |\u003e Stellar.TxBuild.sign(signature)\n  |\u003e Stellar.TxBuild.envelope()\n\n# submit transaction to Horizon\n{:ok, submitted_tx} = Stellar.Horizon.Transactions.create(base64_envelope)\n```\nMore examples can be found in the [**tests**][sdk-tests].\n\n## Querying Horizon\nHorizon is an API for interacting with the Stellar network.\n\nTo query Horizon, you need to specify the Horizon server to use.\n\n```elixir\n# public horizon server\nStellar.Horizon.Server.public()\n\n# testnet horizon server\nStellar.Horizon.Server.testnet()\n\n# futurenet horizon server\nStellar.Horizon.Server.futurenet()\n\n# local horizon server\nStellar.Horizon.Server.local()\n\n# custom horizon server\nStellar.Horizon.Server.new(\"https://horizon-standalone.com\")\n```\n\nSee [**Stellar.Horizon.Server**](https://hexdocs.pm/stellar_sdk/Stellar.Horizon.Server.html) for more details.\n\n\nTo make it possible to explore the millions of records for resources like transactions and operations, this library paginates the data it returns for collection-based resources. Each individual transaction, operation, ledger, etc. is returned as a record.\n\n```elixir\n{:ok,\n %Ledger{\n   base_fee_in_stroops: 100,\n   closed_at: ~U[2015-09-30 17:16:29Z],\n   failed_transaction_count: 0,\n   fee_pool: 3.0e-5,\n   ...\n }} = Ledgers.retrieve(Stellar.Horizon.Server.testnet(), 1234)\n```\n\nA group of records is called a **collection**, records are returned as a list in the [**Stellar.Horizon.Collection**](https://hexdocs.pm/stellar_sdk/Stellar.Horizon.Collection.html#content) structure. To move between pages of a collection of records, use the `next` and `prev` attributes.\n\n\n```elixir\n{:ok,\n %Stellar.Horizon.Collection{\n   next: #Function\u003c1.1390483/0 in Stellar.Horizon.Collection.paginate/1\u003e,\n   prev: #Function\u003c1.1390483/0 in Stellar.Horizon.Collection.paginate/1\u003e,\n   records: [\n     %Stellar.Horizon.Ledger{...},\n     %Stellar.Horizon.Ledger{...},\n     %Stellar.Horizon.Ledger{...}\n   ]\n }} = Stellar.Horizon.Ledgers.all(Stellar.Horizon.Server.testnet())\n```\n\n### Pagination\nThe [HAL format links](https://developers.stellar.org/api/introduction/response-format/) returned with the Horizon response are converted into functions you can call on the returned structure. This allows you to simply use `next.()` and `prev.()` to page through results.\n\n```elixir\n{:ok,\n %Stellar.Horizon.Collection{\n   next: paginate_next_fn,\n   prev: paginate_prev_fn,\n   records: [...]\n }} = Stellar.Horizon.Transactions.all(Stellar.Horizon.Server.testnet())\n\n# next page records for the collection\npaginate_next_fn.()\n\n{:ok,\n %Stellar.Horizon.Collection{\n   next: paginate_next_fn,\n   prev: paginate_prev_fn,\n   records: [...]\n }}\n\n# prev page records for the collection\npaginate_prev_fn.()\n\n{:ok,\n %Stellar.Horizon.Collection{\n   next: paginate_next_fn,\n   prev: paginate_prev_fn,\n   records: []\n }}\n```\n\n### Accounts\n```elixir\n# retrieve an account\nStellar.Horizon.Accounts.retrieve(\n  Stellar.Horizon.Server.testnet(),\n  \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\"\n)\n\n# fetch the ledger's sequence number for the account\nStellar.Horizon.Accounts.fetch_next_sequence_number(\n  Stellar.Horizon.Server.testnet(),\n  \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\"\n)\n\n# list accounts\nStellar.Horizon.Accounts.all(\n  Stellar.Horizon.Server.testnet(),\n  limit: 10,\n  order: :asc\n)\n\n# list accounts by sponsor\nStellar.Horizon.Accounts.all(\n  Stellar.Horizon.Server.testnet(),\n  sponsor: \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\"\n)\n\n# list accounts by signer\nStellar.Horizon.Accounts.all(\n  Stellar.Horizon.Server.testnet(),\n  signer: \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\",\n  order: :desc\n)\n\n# list accounts by canonical asset address\nStellar.Horizon.Accounts.all(\n  Stellar.Horizon.Server.testnet(),\n  asset: \"TEST:GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\",\n  limit: 20\n)\n\n# list account's transactions\nStellar.Horizon.Accounts.list_transactions(\n  Stellar.Horizon.Server.testnet(),\n  \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\",\n  limit: 20\n)\n\n# list account's payments\nStellar.Horizon.Accounts.list_payments(\n  Stellar.Horizon.Server.testnet(),\n  \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\",\n  limit: 20\n)\n```\n\nSee [**Stellar.Horizon.Accounts**](https://hexdocs.pm/stellar_sdk/Stellar.Horizon.Accounts.html#content) for more details.\n\n### Transactions\n```elixir\n# submit a transaction\nStellar.Horizon.Transactions.create(Stellar.Horizon.Server.testnet(), base64_tx_envelope)\n\n# submit a transaction asynchronously\nStellar.Horizon.Transactions.create_async(Stellar.Horizon.Server.testnet(), base64_tx_envelope)\n\n# retrieve a transaction\nStellar.Horizon.Transactions.retrieve(Stellar.Horizon.Server.testnet(), \"5ebd5c0af4385500b53dd63b0ef5f6e8feef1a7e1c86989be3cdcce825f3c0cc\")\n\n# list transactions\nStellar.Horizon.Transactions.all(Stellar.Horizon.Server.testnet(), limit: 10, order: :asc)\n\n# include failed transactions\nStellar.Horizon.Transactions.all(Stellar.Horizon.Server.testnet(), limit: 10, include_failed: true)\n\n# list transaction's effects\nStellar.Horizon.Transactions.list_effects(\n  Stellar.Horizon.Server.testnet(),\n  \"6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a\",\n  limit: 20\n)\n\n# list transaction's operations\nStellar.Horizon.Transactions.list_operations(\n  Stellar.Horizon.Server.testnet(),\n  \"6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a\",\n  limit: 20\n)\n\n# join transactions in the operations response\nStellar.Horizon.Transactions.list_operations(\n  Stellar.Horizon.Server.testnet(),\n  \"6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a\",\n  join: \"transactions\"\n)\n```\n\nSee [**Stellar.Horizon.Transactions**](https://hexdocs.pm/stellar_sdk/Stellar.Horizon.Transactions.html#content) for more details.\n\n\n### Operations\n```elixir\n# retrieve an operation\nStellar.Horizon.Operations.retrieve(Stellar.Horizon.Server.testnet(), 121693057904021505)\n\n# list operations\nStellar.Horizon.Operations.all(Stellar.Horizon.Server.testnet(), limit: 10, order: :asc)\n\n# include failed operations\nStellar.Horizon.Operations.all(Stellar.Horizon.Server.testnet(), limit: 10, include_failed: true)\n\n# include operation's transactions\nStellar.Horizon.Operations.all(Stellar.Horizon.Server.testnet(), limit: 10, join: \"transactions\")\n\n# list operation's payments\nStellar.Horizon.Operations.list_payments(Stellar.Horizon.Server.testnet(), limit: 20)\n\n# list operation's effects\nStellar.Horizon.Operations.list_effects(Stellar.Horizon.Server.testnet(), 121693057904021505, limit: 20)\n```\n\nSee [**Stellar.Horizon.Operations**](https://hexdocs.pm/stellar_sdk/Stellar.Horizon.Operations.html#content) for more details.\n\n\n### Assets\n```elixir\n# list ledger's assets\nStellar.Horizon.Assets.all(Stellar.Horizon.Server.testnet(), limit: 20, order: :desc)\n\n# list assets by asset issuer\nStellar.Horizon.Assets.all(Stellar.Horizon.Server.testnet(), asset_issuer: \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\")\n\n# list assets by asset code\nStellar.Horizon.Assets.list_by_asset_code(Stellar.Horizon.Server.testnet(), \"TEST\")\nStellar.Horizon.Assets.all(Stellar.Horizon.Server.testnet(), asset_code: \"TEST\")\n\n# list assets by asset issuer\nStellar.Horizon.Assets.all(\n  Stellar.Horizon.Server.testnet(),\n  asset_issuer: \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\"\n)\nStellar.Horizon.Assets.list_by_asset_issuer(\n  Stellar.Horizon.Server.testnet(),\n  \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\"\n)\n```\n\nSee [**Stellar.Horizon.Assets**](https://hexdocs.pm/stellar_sdk/Stellar.Horizon.Assets.html#content) for more details.\n\n\n### Ledgers\n```elixir\n# retrieve a ledger\nStellar.Horizon.Ledgers.retrieve(Stellar.Horizon.Server.testnet(), 27147222)\n\n# list ledgers\nStellar.Horizon.Ledgers.all(Stellar.Horizon.Server.testnet(), limit: 10, order: :asc)\n\n# list ledger's transactions\nStellar.Horizon.Ledgers.list_transactions(Stellar.Horizon.Server.testnet(), 27147222, limit: 20)\n\n# list ledger's operations\nStellar.Horizon.Ledgers.list_operations(Stellar.Horizon.Server.testnet(), 27147222, join: \"transactions\")\n\n# list ledger's payments including failed transactions\nStellar.Horizon.Ledgers.list_payments(Stellar.Horizon.Server.testnet(), 27147222, include_failed: true)\n\n# list ledger's effects\nStellar.Horizon.Ledgers.list_effects(Stellar.Horizon.Server.testnet(), 27147222, limit: 20)\n```\n\nSee [**Stellar.Horizon.Ledgers**](https://hexdocs.pm/stellar_sdk/Stellar.Horizon.Ledgers.html#content) for more details.\n\n\n### Offers\n```elixir\n# list offers\nStellar.Horizon.Offers.all(Stellar.Horizon.Server.testnet(), limit: 20, order: :asc)\n\n# list offers by sponsor\nStellar.Horizon.Offers.all(\n  Stellar.Horizon.Server.testnet(),\n  sponsor: \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\"\n)\n\n# list offers by seller\nStellar.Horizon.Offers.all(\n  Stellar.Horizon.Server.testnet(),\n  seller: \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\",\n  order: :desc\n)\n\n# list offers by selling_asset\nStellar.Horizon.Offers.all(\n  Stellar.Horizon.Server.testnet(),\n  selling_asset: [\n    code: \"TEST\",\n    issuer: \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\"\n  ]\n)\n\n# list offers by buying_asset\nStellar.Horizon.Offers.all(\n  Stellar.Horizon.Server.testnet(),\n  buying_asset: [\n    code: \"TEST\",\n    issuer: \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\"\n  ]\n)\n\n# list offers by selling_asset and buying_asset\nStellar.Horizon.Trades.all(\n  Stellar.Horizon.Server.testnet(),\n  selling_asset: [\n    code: \"TEST\",\n    issuer: \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\"\n  ],\n  buying_asset: [\n    code: \"TOKEN\",\n    issuer: \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\"\n  ]\n)\n\nStellar.Horizon.Offers.all(\n  Stellar.Horizon.Server.testnet(),\n  selling_asset: [\n    code: \"TEST\",\n    issuer: \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\"\n  ],\n  buying_asset: :native\n)\n\n# list offer's trades\nStellar.Horizon.Offers.list_trades(Stellar.Horizon.Server.testnet(), 165563085, limit: 20)\n```\n\nSee [**Stellar.Horizon.Offers**](https://hexdocs.pm/stellar_sdk/Stellar.Horizon.Offers.html#content) for more details.\n\n\n### Trades\n```elixir\n# list tardes\nStellar.Horizon.Trades.all(Stellar.Horizon.Server.testnet(), limit: 20, order: :asc)\n\n# list trades by offer_id\nStellar.Horizon.Trades.all(Stellar.Horizon.Server.testnet(), offer_id: 165563085)\n\n# list trades by specific orderbook\nStellar.Horizon.Trades.all(\n  Stellar.Horizon.Server.testnet(),\n  base_asset: [\n    code: \"TEST\",\n    issuer: \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\"\n  ],\n  counter_asset: [\n    code: \"TOKEN\",\n    issuer: \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\"\n  ]\n)\n\nStellar.Horizon.Trades.all(\n  Stellar.Horizon.Server.testnet(),\n  base_asset: [\n    code: \"TEST\",\n    issuer: \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\"\n  ],\n  counter_asset: :native\n)\n\n# list trades by trade_type\nStellar.Horizon.Trades.all(Stellar.Horizon.Server.testnet(), trade_type: \"liquidity_pools\", limit: 20)\n```\n\nSee [**Stellar.Horizon.Trades**](https://hexdocs.pm/stellar_sdk/Stellar.Horizon.Trades.html#content) for more details.\n\n\n### ClaimableBalances\n```elixir\n# retrieve a claimable balance\nStellar.Horizon.ClaimableBalances.retrieve(\n  Stellar.Horizon.Server.testnet(),\n  \"00000000ca6aba5fb0993844e0076f75bee53f2b8014be29cd8f2e6ae19fb0a17fc68695\"\n)\n\n# list claimable balances\nStellar.Horizon.ClaimableBalances.all(Stellar.Horizon.Server.testnet(), limit: 2, order: :asc)\n\n# list claimable balances by sponsor\nStellar.Horizon.ClaimableBalances.list_by_sponsor(\n  Stellar.Horizon.Server.testnet(),\n  \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\"\n)\nStellar.Horizon.ClaimableBalances.all(\n  Stellar.Horizon.Server.testnet(),\n  sponsor: \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\"\n)\n\n# list claimable balances by claimant\nStellar.Horizon.ClaimableBalances.list_by_claimant(\n  Stellar.Horizon.Server.testnet(),\n  \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\"\n)\nStellar.Horizon.ClaimableBalances.all(\n  Stellar.Horizon.Server.testnet(),\n  claimant: \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\",\n  order: :desc\n)\n\n# list claimable balances by canonical asset address\nStellar.Horizon.ClaimableBalances.list_by_asset(\n  Stellar.Horizon.Server.testnet(),\n  \"TEST:GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\"\n)\nStellar.Horizon.ClaimableBalances.all(\n  Stellar.Horizon.Server.testnet(),\n  asset: \"TEST:GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\",\n  limit: 20\n)\n\n# list claimable balance's transactions\nStellar.Horizon.ClaimableBalances.list_transactions(\n  Stellar.Horizon.Server.testnet(),\n  \"00000000ca6aba5fb0993844e0076f75bee53f2b8014be29cd8f2e6ae19fb0a17fc68695\",\n  limit: 20\n)\n\n# list claimable balance's operations\nStellar.Horizon.ClaimableBalances.list_operations(\n  Stellar.Horizon.Server.testnet(),\n  \"00000000ca6aba5fb0993844e0076f75bee53f2b8014be29cd8f2e6ae19fb0a17fc68695\",\n  limit: 20\n)\n\n# join transactions in the operations response\nStellar.Horizon.ClaimableBalances.list_operations(\n  Stellar.Horizon.Server.testnet(),\n  \"00000000ca6aba5fb0993844e0076f75bee53f2b8014be29cd8f2e6ae19fb0a17fc68695\",\n  join: \"transactions\"\n)\n```\n\nSee [**Stellar.Horizon.Balances**](https://hexdocs.pm/stellar_sdk/Stellar.Horizon.ClaimableBalances.html#content) for more details.\n\n\n### LiquidityPools\n```elixir\n# retrieve a liquidity pool\nStellar.Horizon.LiquidityPools.retrieve(\n  Stellar.Horizon.Server.testnet(),\n  \"001365fc79ca661f31ba3ee0849ae4ba36f5c377243242d37fad5b1bb8912dbc\"\n)\n\n# list liquidity pools\nStellar.Horizon.LiquidityPools.all(Stellar.Horizon.Server.testnet(), limit: 2, order: :asc)\n\n# list liquidity pools by reserves\nStellar.Horizon.LiquidityPools.all(\n  Stellar.Horizon.Server.testnet(),\n  reserves: \"TEST:GCXMW..., TEST2:GCXMW...\"\n)\n\n# list liquidity pools by account\nStellar.Horizon.LiquidityPools.all(\n  Stellar.Horizon.Server.testnet(),\n  account: \"GCXMWUAUF37IWOOV2FRDKWEX3O2IHLM2FYH4WPI4PYUKAIFQEUU5X3TD\",\n  order: :desc\n)\n\n# list liquidity pool's effects\nStellar.Horizon.LiquidityPools.list_effects(\n  Stellar.Horizon.Server.testnet(),\n  \"001365fc79ca661f31ba3ee0849ae4ba36f5c377243242d37fad5b1bb8912dbc\",\n  limit: 20\n)\n\n# list liquidity pool's trades\nStellar.Horizon.LiquidityPools.list_trades(\n  Stellar.Horizon.Server.testnet(),\n  \"001365fc79ca661f31ba3ee0849ae4ba36f5c377243242d37fad5b1bb8912dbc\",\n  limit: 20\n)\n\n# list liquidity pool's transactions\nStellar.Horizon.LiquidityPools.list_transactions(\n  Stellar.Horizon.Server.testnet(),\n  \"001365fc79ca661f31ba3ee0849ae4ba36f5c377243242d37fad5b1bb8912dbc\",\n  limit: 20\n)\n\n# list liquidity pool's operations\nStellar.Horizon.LiquidityPools.list_operations(\n  Stellar.Horizon.Server.testnet(),\n  \"001365fc79ca661f31ba3ee0849ae4ba36f5c377243242d37fad5b1bb8912dbc\",\n  limit: 20\n)\n```\n\nSee [**Stellar.Horizon.Pools**](https://hexdocs.pm/stellar_sdk/Stellar.Horizon.LiquidityPools.html#content) for more details.\n\n\n### Effects\n```elixir\n# list effects\nStellar.Horizon.Effects.all(\n  Stellar.Horizon.Server.testnet(),\n  limit: 10,\n  order: :asc\n)\n```\n\nSee [**Stellar.Horizon.Effects**](https://hexdocs.pm/stellar_sdk/Stellar.Horizon.Effects.html#content) for more details.\n\n### FeeStats\n```elixir\n# retrieve fee stats\nStellar.Horizon.FeeStats.retrieve(Stellar.Horizon.Server.testnet())\n```\n\nSee [**Stellar.Horizon.FeeStats**](https://developers.stellar.org/api/aggregations/fee-stats/single/) for more details.\n\n### Paths\n\n#### List paths\nThis will return information about potential path payments:\n- [Required] source_account. The Stellar address of the sender.\n- [Required] destination_asset. **:native** or **[code: \"DESTINATION_ASSET_CODE\", issuer: \"DESTINATION_ASSET_ISSUER\"]**.\n- [Required] destination_amount. The destination amount specified in the search that found this path.\n- [Optional] destination_account. The Stellar address of the reciever.\n\n```elixir\nStellar.Horizon.PaymentPaths.list_paths(\n  Stellar.Horizon.Server.testnet(),\n  source_account: \"GBRSLTT74SKP62KJ7ENTMP5V4R7UGB6E5UQESNIIRWUNRCCUO4ZMFM4C\",\n  destination_asset: :native,\n  destination_amount: 5\n)\n```\n\n#### List strict receive payment paths\n- [Required] destination_asset. **:native** or **[code: \"DESTINATION_ASSET_CODE\", issuer: \"DESTINATION_ASSET_ISSUER\"]**.\n- [Required] destination_amount. The amount of the destination asset that should be received.\n- [Optional] source_account. The Stellar address of the sender.\n- [Optional] source_assets. A comma-separated list of assets available to the sender.\n\n```elixir\nStellar.Horizon.PaymentPaths.list_receive_paths(\n  Stellar.Horizon.Server.testnet(),\n  destination_asset: :native,\n  destination_amount: 5,\n  source_account: \"GBTKSXOTFMC5HR25SNL76MOVQW7GA3F6CQEY622ASLUV4VMLITI6TCOO\"\n)\n```\n\n#### List strict send payment paths\n- [Required] source_asset. **:native** or **[code: \"SOURCE_ASSET_CODE\", issuer: \"SOURCE_ASSET_ISSUER\"]**.\n- [Required] source_amount. The amount of the source asset that should be sent.\n- [Optional] destination_account. The Stellar address of the reciever.\n- [Optional] destination_assets. A comma-separated list of assets that the recipient can receive.\n\n```elixir\nStellar.Horizon.PaymentPaths.list_send_paths(\n  Stellar.Horizon.Server.testnet(),\n  source_asset: :native,\n  source_amount: 5,\n  destination_assets: \"TEST:GA654JC6QLA3ZH4O5V7X5NPM7KEWHKRG5GJA4PETK4SOFBUJLCCN74KQ\"\n)\n```\n\nSee [**Stellar.Horizon.Paths**](https://developers.stellar.org/api/aggregations/paths/) for more details.\n\n### Order Books\n\n#### Retrieve order Books\nProvides an order book’s bids and asks:\n- [Required] selling_asset. **:native** or **[code: \"SELLING_ASSET_CODE\", issuer: \"SELLING_ASSET_ISSUER\"]**.\n- [Required] buying_asset. **:native** or **[code: \"BUYING_ASSET_CODE\", issuer: \"BUYING_ASSET_ISSUER\"]**.\n- [Optional] limit. The maximum number of records returned\n\n```elixir\nStellar.Horizon.OrderBooks.retrieve(\n  Stellar.Horizon.Server.testnet(),\n  selling_asset: :native,\n  buying_asset: :native\n)\n\nStellar.Horizon.OrderBooks.retrieve(\n  Stellar.Horizon.Server.testnet(),\n  selling_asset: :native,\n  buying_asset: [\n    code: \"BB1\",\n    issuer: \"GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN\"\n  ],\n  limit: 2\n)\n```\n\nSee [**Stellar.Horizon.OrderBooks**](https://developers.stellar.org/api/aggregations/order-books/) for more details.\n\n### Trade Aggregations\n\n#### List trade aggregations\nDisplays trade data based on filters set in the arguments:\n- [Required] base_asset. **:native** or **[code: \"BASE_ASSET_CODE\", issuer: \"BASE_ASSET_ISSUER\"]**.\n- [Required] counter_asset. **:native** or **[code: \"COUNTER_ASSET_CODE\", issuer: \"COUNTER_ASSET_ISSUER\"]**.\n- [Required] resolution. The segment duration represented as milliseconds.\n- [Optional] start_time. The lower time boundary represented as milliseconds since epoch.\n- [Optional] end_time. The upper time boundary represented as milliseconds since epoch.\n- [Optional] offset. Segments can be offset using this parameter. Expressed in milliseconds.\n- [Optional] order. A designation of the order in which records should appear.\n- [Optional] limit. The maximum number of records returned.\n\n```elixir\nStellar.Horizon.TradeAggregations.list_trade_aggregations(\n  Stellar.Horizon.Server.testnet(),\n  base_asset: :native,\n  counter_asset: :native,\n  resolution: \"60000\"\n)\n\nStellar.Horizon.TradeAggregations.list_trade_aggregations(\n  Stellar.Horizon.Server.testnet(),\n  base_asset: :native,\n  counter_asset: [\n    code: \"EURT\",\n    issuer: \"GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S\"\n  ],\n  resolution: \"3600000\",\n  start_time: \"1582156800000\",\n  end_time: \"1582178400000\"\n)\n```\n\nSee [**Stellar.Horizon.TradeAggregations**](https://developers.stellar.org/api/aggregations/trade-aggregations/) for more details.\n\n---\n\n## Development\n* Install any Elixir version above 1.12.\n* Compile dependencies: `mix deps.get`.\n* Run tests: `mix test`.\n\n## Code of conduct\nWe welcome everyone to contribute. Make sure you have read the [CODE_OF_CONDUCT][coc] before.\n\n## Contributing\nFor information on how to contribute, please refer to our [CONTRIBUTING][contributing] guide.\n\n## Changelog\nFeatures and bug fixes are listed in the [CHANGELOG][changelog] file.\n\n## License\nThis library is licensed under an MIT license. See [LICENSE][license] for details.\n\n## Acknowledgements\nMade with 💙 by [kommitters Open Source](https://kommit.co)\n\n[license]: https://github.com/kommitters/stellar_sdk/blob/main/LICENSE.md\n[coc]: https://github.com/kommitters/stellar_sdk/blob/main/CODE_OF_CONDUCT.md\n[changelog]: https://github.com/kommitters/stellar_sdk/blob/main/CHANGELOG.md\n[contributing]: https://github.com/kommitters/stellar_sdk/blob/main/CONTRIBUTING.md\n[base]: https://github.com/kommitters/stellar_base\n[sdk]: https://github.com/kommitters/stellar_sdk\n[sdk-tests]: https://github.com/kommitters/stellar_sdk/blob/main/test/tx_build\n[hex]: https://hex.pm/packages/stellar_sdk\n[stellar]: https://www.stellar.org/\n[horizon-api]: https://developers.stellar.org/api/introduction\n[http_client_spec]: https://github.com/kommitters/stellar_sdk/blob/main/lib/horizon/client/spec.ex\n[stellar-docs-tx]: https://developers.stellar.org/docs/glossary/transactions\n[stellar-docs-sequence-number]: https://developers.stellar.org/docs/glossary/transactions/#sequence-number\n[stellar-docs-fee]: https://developers.stellar.org/docs/glossary/transactions/#fee\n[stellar-docs-memo]: https://developers.stellar.org/docs/glossary/transactions/#memo\n[stellar-docs-preconditions]: https://developers.stellar.org/docs/glossary/transactions/#validity-conditions\n[stellar-docs-time-bounds]: https://developers.stellar.org/docs/glossary/transactions/#time-bounds\n[stellar-docs-ledger-bounds]: https://developers.stellar.org/docs/glossary/transactions/#ledger-bounds\n[stellar-docs-min-seq-num]: https://developers.stellar.org/docs/glossary/transactions/#minimum-sequence-number\n[stellar-docs-min-seq-age]: https://developers.stellar.org/docs/glossary/transactions/#minimum-sequence-age\n[stellar-docs-min-seq-ledger-gap]: https://developers.stellar.org/docs/glossary/transactions/#minimum-sequence-ledger-gap\n[stellar-docs-extra-signers]: https://developers.stellar.org/docs/glossary/transactions/#extra-signers\n[stellar-docs-tx-envelope]: https://developers.stellar.org/docs/glossary/transactions/#transaction-envelopes\n[stellar-docs-list-operations]: https://developers.stellar.org/docs/start/list-of-operations\n[stellar-docs-tx-signatures]: https://developers.stellar.org/docs/encyclopedia/signatures-multisig\n[stellar-cap-27]: https://stellar.org/protocol/cap-27\n[stellar-protocol-19]: https://stellar.org/blog/announcing-protocol-19\n[stellar-docs-account-seq-num-age]: https://developers.stellar.org/docs/glossary/accounts/#sequence-time-and-ledger\n[soroban.ex]: https://github.com/kommitters/soroban.ex\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkommitters%2Fstellar_sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkommitters%2Fstellar_sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkommitters%2Fstellar_sdk/lists"}