For AI agents: an LLM-friendly Markdown version of every page is available by appending .md to its URL or by sending an Accept: text/markdown request header. The full documentation index is at https://www.ankr.com/docs/llms.txt
Skip to main content

Stellar — Assets, Claimable balances, Effects, Ledgers (2/3)

API reference for Stellar. All methods ->

Part 2 of 3: 1 · 2 · 3

Claimable balances

A claimable balance represents the transfer of ownership of some amount of an asset. Claimable balances provide a mechanism for setting up a payment which can be claimed in the future. This allows you to make payments to accounts which are currently not able to accept them.

GET /claimable_balances

Lists all claimable balances.

This endpoint lists all available claimable balances.

Parameters

  • sponsor (string; query): an account ID of the sponsor. Every account in the response will either be sponsored by the given account ID or have a sub-entry (trustline, offer, or data entry) which is sponsored by the given account ID.
  • asset (any; query): an issued asset represented as “Code:IssuerAccountID”. Every account in the response will have a trustline for the given asset.
  • claimant (any; query): an account ID of the destination address. Only include claimable balances which can be claimed by the given account ID.
  • cursor (integer; query): a number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.
  • order (string; query): a designation of the order in which records should appear. Options include asc (ascending) or desc (descending). If this argument isn’t set, it defaults to asc.
  • limit (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.

Returns

{
"_links": {
"self": {
"href": "string",
"templated": true
},
"next": {
"href": "string",
"templated": true
},
"prev": {
"href": "string",
"templated": true
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"href": "string",
"templated": true
},
"operations": {
"href": "string",
"templated": true
},
"transactions": {
"href": "string",
"templated": true
}
},
"id": "string",
"paging_token": "string",
"asset": "string",
"amount": "string",
"sponsor": "string",
"last_modified_ledger": "string",
"last_modified_time": "string",
"claimants": [
{
"destination": "string",
"predicate": {
"and": [
{
"or": [
{
"relBefore": "string",
"absBefore": "string",
"absBeforeEpoch": "string"
}
],
"not": {
"unconditional": true,
"relBefore": "string",
"absBefore": "string",
"absBeforeEpoch": "string"
}
}
]
}
}
],
"flags": 0
}
]
}
}

Request example

curl https://rpc.ankr.com/http/stellar_horizon/claimable_balances{?asset,sponsor,claimant,cursor,limit,order}

Response example

{
"_links": {
"self": {
"href": "https://rpc.ankr.com/claimable_balances?asset=native\u0026cursor=\u0026limit=1\u0026order=asc"
},
"next": {
"href": "https://rpc.ankr.com/claimable_balances?asset=native\u0026cursor=33324106-00000000691787983bc3ea12361092fe49ae83cbbe37804ee1590fe2b9b3e3860fc8261f\u0026limit=1\u0026order=asc"
},
"prev": {
"href": "https://rpc.ankr.com/claimable_balances?asset=native\u0026cursor=33324106-00000000691787983bc3ea12361092fe49ae83cbbe37804ee1590fe2b9b3e3860fc8261f\u0026limit=1\u0026order=desc"
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"href": "https://rpc.ankr.com/claimable_balances/00000000691787983bc3ea12361092fe49ae83cbbe37804ee1590fe2b9b3e3860fc8261f"
},
"transactions": {
"href": "https://rpc.ankr.com/claimable_balances/00000000691787983bc3ea12361092fe49ae83cbbe37804ee1590fe2b9b3e3860fc8261f/transactions{?cursor,limit,order}",
"templated": true
},
"operations": {
"href": "https://rpc.ankr.com/claimable_balances/00000000691787983bc3ea12361092fe49ae83cbbe37804ee1590fe2b9b3e3860fc8261f/operations{?cursor,limit,order}",
"templated": true
}
},
"id": "00000000691787983bc3ea12361092fe49ae83cbbe37804ee1590fe2b9b3e3860fc8261f",
"asset": "native",
"amount": "0.1000000",
"sponsor": "GDOZMXWISPB57FITUQIGTFH2KNNW7QTFESXF5DZEAMZK6QHE3KVO5TRT",
"last_modified_ledger": 33324106,
"last_modified_time": null,
"claimants": [
{
"destination": "GCD3T6UIQLYZPGRCYVSE7LKQB5HYYNVT7ENY6RCSFRFQYR5JTBDCECO3",
"predicate": {
"and": [
{
"abs_before": "2020-12-30T23:03:56Z",
"abs_before_epoch": "1609369436"
},
{
"not": {
"abs_before": "2020-12-30T23:05:56Z",
"abs_before_epoch": "1609369556"
}
}
]
}
}
],
"flags": {
"clawback_enabled": false
},
"paging_token": "33324106-00000000691787983bc3ea12361092fe49ae83cbbe37804ee1590fe2b9b3e3860fc8261f"
}
]
}
}

GET /claimable_balances/{claimable_balance_id}

Retrieves a particular claimable balance.

The single claimable balance endpoint provides information on a claimable balance.

Parameters

  • claimable_balance_id (string; path; required): a unique identifier for this claimable balance.

Returns

{
"_links": {
"self": {
"href": "string",
"templated": true
},
"operations": {
"href": "string",
"templated": true
},
"transactions": {
"href": "string",
"templated": true
}
},
"id": "string",
"asset": "string",
"amount": "string",
"sponsor": "string",
"last_modified_ledger": "string",
"last_modified_time": "string",
"claimants": [
{
"destination": "string",
"predicate": {
"and": [
{
"or": [
{
"relBefore": "string",
"absBefore": "string",
"absBeforeEpoch": "string"
}
],
"not": {
"unconditional": true,
"relBefore": "string",
"absBefore": "string",
"absBeforeEpoch": "string"
}
}
]
}
}
],
"flags": 0,
"paging_token": "string"
}

Request example

curl https://rpc.ankr.com/http/stellar_horizon/claimable_balances/{claimable_balance_id}

Response example

{
"_links": {
"self": {
"href": "https://rpc.ankr.com/claimable_balances/000000000102030000000000000000000000000000000000000000000000000000000000"
},
"operations": {
"href": "https://rpc.ankr.com/claimable_balances/000000000102030000000000000000000000000000000000000000000000000000000000/operations{?cursor,limit,order}",
"templated": true
},
"transactions": {
"href": "https://rpc.ankr.com/claimable_balances/000000000102030000000000000000000000000000000000000000000000000000000000/transactions{?cursor,limit,order}",
"templated": true
}
},
"id": "000000000102030000000000000000000000000000000000000000000000000000000000",
"paging_token": "000000000102030000000000000000000000000000000000000000000000000000000000",
"asset": "native",
"amount": "10.0000000",
"claimants": [
{
"destination": "GC3C4AKRBQLHOJ45U4XG35ESVWRDECWO5XLDGYADO6DPR3L7KIDVUMML",
"predicate": {
"and": [
{
"or": [
{
"relBefore": "12"
},
{
"absBefore": "2020-08-26T11:15:39Z",
"absBeforeEpoch": "1598440539"
}
]
},
{
"not": {
"unconditional": true
}
}
]
}
}
],
"last_modified_ledger": 28411995,
"last_modified_time": "2020-02-26T19:29:16Z"
}

GET /claimable_balances/{claimable_balance_id}/transactions

Retrieves transactions of a particular claimable balance.

This endpoint represents successful transactions referencing a given claimable balance and can be used in streaming mode. Streaming mode allows you to listen for new transactions referencing this claimable balance as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known transaction unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream transactions created since your request time.

Parameters

  • claimable_balance_id (string; path; required): a unique identifier for this claimable balance.
  • cursor (integer; query): a number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.
  • order (string; query): a designation of the order in which records should appear. Options include asc (ascending) or desc (descending). If this argument isn’t set, it defaults to asc.
  • limit (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.
  • include_failed (boolean; query): set to true to include failed operations in results. Options include true and false.

Returns

{
"_links": {
"self": {
"href": "string",
"templated": true
},
"next": {
"href": "string",
"templated": true
},
"prev": {
"href": "string",
"templated": true
}
},
"_embedded": {
"records": [
{
"memo": "string",
"_links": {
"self": {
"href": "string",
"templated": true
},
"account": {
"href": "string",
"templated": true
},
"ledger": {
"href": "string",
"templated": true
},
"operations": {
"href": "string",
"templated": true
},
"effects": {
"href": "string",
"templated": true
},
"precedes": {
"href": "string",
"templated": true
},
"succeeds": {
"href": "string",
"templated": true
},
"transaction": {
"href": "string",
"templated": true
}
},
"id": "string",
"paging_token": "string",
"successful": true,
"hash": "string",
"ledger": 0,
"created_at": "string",
"source_account": "string",
"account_muxed": "string",
"account_muxed_id": "string",
"source_account_sequence": "string",
"fee_account": "string",
"fee_account_muxed": "string",
"fee_account_muxed_id": "string",
"fee_charged": "string",
"max_fee": "string",
"operation_count": 0,
"envelope_xdr": "string",
"result_xdr": "string",
"result_meta_xdr": "string",
"fee_meta_xdr": "string",
"memo_type": "string",
"signatures": [
"string"
],
"valid_after": "string",
"valid_before": "string",
"preconditions": {
"timebounds": {
"min_time": "string",
"max_time": "string"
},
"ledgerbounds": {
"min_ledger": "string",
"max_ledger": "string"
},
"min_account_sequence": "string",
"min_account_sequence_age": "string",
"min_account_sequence_ledger_gap": 0,
"extra_signers": [
"string"
]
},
"fee_bump_transaction": {
"hash": "string",
"signatures": [
"string"
]
},
"inner_transaction": {
"hash": "string",
"signatures": [
"string"
],
"max_fee": "string"
}
}
]
}
}

Request example

curl https://rpc.ankr.com/http/stellar_horizon/claimable_balances/{claimable_balance_id}/transactions{?cursor,order,limit,include_failed}

Response

{
"_links": {
"self": {
"href": "https://rpc.ankr.com/claimable_balances/00000000178826fbfe339e1f5c53417c6fedfe2c05e8bec14303143ec46b38981b09c3f9/transactions?cursor=&limit=2&order=asc"
},
"next": {
"href": "https://rpc.ankr.com/claimable_balances/00000000178826fbfe339e1f5c53417c6fedfe2c05e8bec14303143ec46b38981b09c3f9/transactions?cursor=140648659841806336&limit=2&order=asc"
},
"prev": {
"href": "https://rpc.ankr.com/claimable_balances/00000000178826fbfe339e1f5c53417c6fedfe2c05e8bec14303143ec46b38981b09c3f9/transactions?cursor=140648659841806336&limit=2&order=desc"
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"href": "https://rpc.ankr.com/transactions/fc5a98fc3869df408ebd4ac1c2e3fefec8b0a858e82ff1d14e362676708b91e8"
},
"account": {
"href": "https://rpc.ankr.com/accounts/GDCJIHD3623OCYNH65UUQC3NLG2D6YCNCDPZULRLCLOA76TBQRL6A3TF"
},
"ledger": {
"href": "https://rpc.ankr.com/ledgers/32747318"
},
"operations": {
"href": "https://rpc.ankr.com/transactions/fc5a98fc3869df408ebd4ac1c2e3fefec8b0a858e82ff1d14e362676708b91e8/operations{?cursor,limit,order}",
"templated": true
},
"effects": {
"href": "https://rpc.ankr.com/transactions/fc5a98fc3869df408ebd4ac1c2e3fefec8b0a858e82ff1d14e362676708b91e8/effects{?cursor,limit,order}",
"templated": true
},
"precedes": {
"href": "https://rpc.ankr.com/transactions?order=asc&cursor=140648659841806336"
},
"succeeds": {
"href": "https://rpc.ankr.com/transactions?order=desc&cursor=140648659841806336"
},
"transaction": {
"href": "https://rpc.ankr.com/transactions/fc5a98fc3869df408ebd4ac1c2e3fefec8b0a858e82ff1d14e362676708b91e8"
}
},
"id": "fc5a98fc3869df408ebd4ac1c2e3fefec8b0a858e82ff1d14e362676708b91e8",
"paging_token": "140648659841806336",
"successful": true,
"hash": "fc5a98fc3869df408ebd4ac1c2e3fefec8b0a858e82ff1d14e362676708b91e8",
"ledger": 32747318,
"created_at": "2020-11-23T16:02:38Z",
"source_account": "GDCJIHD3623OCYNH65UUQC3NLG2D6YCNCDPZULRLCLOA76TBQRL6A3TF",
"source_account_sequence": "140646847365513218",
"fee_account": "GDCJIHD3623OCYNH65UUQC3NLG2D6YCNCDPZULRLCLOA76TBQRL6A3TF",
"fee_charged": "100",
"max_fee": "100",
"operation_count": 1,
"envelope_xdr": "AAAAAgAAAADElBx79rbhYaf3aUgLbVm0P2BNEN+aLisS3A/6YYRX4AAAAGQB862QAAAAAgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAADgAAAAJCT0RISQAAAAAAAAAAAAAAxJQce/a24WGn92lIC21ZtD9gTRDfmi4rEtwP+mGEV+AAAAAAAA9CQAAAAAEAAAAAAAAAAElBqA1BXzKd9k9nuPoodv0YBKY+Hgh6Uz/UxozgnvyzAAAAAAAAAAAAAAABYYRX4AAAAEDf41ykW+eq8IVpJNOc4iDaht5Beil8NpQB8WMHkOxW3rocUBF3EHKqUXDIsD9CzzY7Xr1PbzVk5FZ4iBKNF4MM",
"result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAAOAAAAAAAAAAAXiCb7/jOeH1xTQXxv7f4sBei+wUMDFD7EaziYGwnD+QAAAAA=",
"result_meta_xdr": "AAAAAgAAAAIAAAADAfOvNgAAAAAAAAAAxJQce/a24WGn92lIC21ZtD9gTRDfmi4rEtwP+mGEV+AAAAAAAcnCVAHzrZAAAAABAAAAAAAAAAAAAAAAAAAAD2dpdmluZ2JvZGhpLm9yZwABAAAAAA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AAAAAAAAAAD2dpdmluZ2JvZGhpLm9yZwABAAAAAAAAAAAAAAAAAAAA",
"memo_type": "none",
"signatures": [
"3+NcpFvnqvCFaSTTnOIg2obeQXopfDaUAfFjB5DsVt66HFARdxByqlFwyLA/Qs82O169T281ZORWeIgSjReDDA=="
],
"valid_after": "1970-01-01T00:00:00Z",
"preconditions": {
"timebounds": {
"min_time": "0"
}
}
}
]
}
}

GET /claimable_balances/{claimable_balance_id}/operations

Retrieves operations of a particular claimable balance.

This endpoint represents successful operations referencing a given claimable balance and can be used in streaming mode. Streaming mode allows you to listen for new operations referencing this claimable balance as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known operation unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream operations created since your request time.

Parameters

  • claimable_balance_id (string; path; required): a unique identifier for this claimable balance.
  • cursor (integer; query): a number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.
  • order (string; query): a designation of the order in which records should appear. Options include asc (ascending) or desc (descending). If this argument isn’t set, it defaults to asc.
  • limit (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.
  • include_failed (boolean; query): set to true to include failed operations in results. Options include true and false.
  • join (any; query): set to transactions to include the transactions which created each of the operations in the response.

Returns

{
"_links": {
"self": {
"href": "string",
"templated": true
},
"next": {
"href": "string",
"templated": true
},
"prev": {
"href": "string",
"templated": true
},
"transaction": {
"href": "string",
"templated": true
},
"effects": {
"href": "string",
"templated": true
},
"succeeds": {
"href": "string",
"templated": true
},
"precedes": {
"href": "string",
"templated": true
}
},
"id": "string",
"paging_token": "string",
"transaction_successful": true,
"source_account": "string",
"type": "create_account",
"type_i": 0,
"created_at": "string",
"transaction_hash": "string",
"starting_balance": "string",
"funder": "string",
"account": "string"
}

Request example

curl https://rpc.ankr.com/http/stellar_horizon/claimable_balances/{claimable_balance_id}/operations{?cursor,order,limit,include_failed,join}

Response example

{
"_links": {
"self": {
"href": "https://rpc.ankr.com/claimable_balances/00000000178826fbfe339e1f5c53417c6fedfe2c05e8bec14303143ec46b38981b09c3f9/operations?cursor=&limit=3&order=asc"
},
"next": {
"href": "https://rpc.ankr.com/claimable_balances/00000000178826fbfe339e1f5c53417c6fedfe2c05e8bec14303143ec46b38981b09c3f9/operations?cursor=140648659841806337&limit=3&order=asc"
},
"prev": {
"href": "https://rpc.ankr.com/claimable_balances/00000000178826fbfe339e1f5c53417c6fedfe2c05e8bec14303143ec46b38981b09c3f9/operations?cursor=140648659841806337&limit=3&order=desc"
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"href": "https://rpc.ankr.com/operations/140648659841806337"
},
"transaction": {
"href": "https://rpc.ankr.com/transactions/fc5a98fc3869df408ebd4ac1c2e3fefec8b0a858e82ff1d14e362676708b91e8"
},
"effects": {
"href": "https://rpc.ankr.com/operations/140648659841806337/effects"
},
"succeeds": {
"href": "https://rpc.ankr.com/effects?order=desc&cursor=140648659841806337"
},
"precedes": {
"href": "https://rpc.ankr.com/effects?order=asc&cursor=140648659841806337"
}
},
"id": "140648659841806337",
"paging_token": "140648659841806337",
"transaction_successful": true,
"source_account": "GDCJIHD3623OCYNH65UUQC3NLG2D6YCNCDPZULRLCLOA76TBQRL6A3TF",
"type": "create_claimable_balance",
"type_i": 14,
"created_at": "2020-11-23T16:02:38Z",
"transaction_hash": "fc5a98fc3869df408ebd4ac1c2e3fefec8b0a858e82ff1d14e362676708b91e8",
"sponsor": "GDCJIHD3623OCYNH65UUQC3NLG2D6YCNCDPZULRLCLOA76TBQRL6A3TF",
"asset": "BODHI:GDCJIHD3623OCYNH65UUQC3NLG2D6YCNCDPZULRLCLOA76TBQRL6A3TF",
"amount": "0.1000000",
"claimants": [
{
"destination": "GBEUDKANIFPTFHPWJ5T3R6RIO36RQBFGHYPAQ6STH7KMNDHAT36LHOLD",
"predicate": {
"unconditional": true
}
}
]
}
]
}
}