Stellar — Accounts (2/3)
API reference for Stellar. All methods ->
Accounts
GET /accounts/{account_id}/transactions
Parameters
account_id(string; path; required): the account’s public key encoded in a base32 string representation.cursor(integer; query): a number that points to a specific location in a collection of responses and is pulled from thepaging_tokenvalue of a record.order(string; query): a designation of the order in which records should appear. Options includeasc(ascending) ordesc(descending). If this argument isn’t set, it defaults toasc.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 includetrueandfalse.
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
- Standard
- Streaming
curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/transactions{?cursor,limit,order}
curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/transactions{?cursor,limit,order} \
-H 'Accept: text/event-stream'
Response example
{
"_links": {
"self": {
"href": "https://rpc.ankr.com/accounts/GBVFTZL5HIPT4PFQVTZVIWR77V7LWYCXU4CLYWWHHOEXB64XPG5LDMTU/transactions?cursor=\u0026limit=1\u0026order=asc"
},
"next": {
"href": "https://rpc.ankr.com/accounts/GBVFTZL5HIPT4PFQVTZVIWR77V7LWYCXU4CLYWWHHOEXB64XPG5LDMTU/transactions?cursor=94658837230923776\u0026limit=1\u0026order=asc"
},
"prev": {
"href": "https://rpc.ankr.com/accounts/GBVFTZL5HIPT4PFQVTZVIWR77V7LWYCXU4CLYWWHHOEXB64XPG5LDMTU/transactions?cursor=94658837230923776\u0026limit=1\u0026order=desc"
}
},
"_embedded": {
"records": [
{
"memo": "",
"memo_bytes": "",
"_links": {
"self": {
"href": "https://rpc.ankr.com/transactions/4826a3d41a5a795bf795767d0fb5e39c4abbcf695cf888b3578aa126b5b257ee"
},
"account": {
"href": "https://rpc.ankr.com/accounts/GBYSOAM7D42RMUN4LCKCFYNXZU3F7TJVKD2NMR672J4372BCH6DE4BKR"
},
"ledger": {
"href": "https://rpc.ankr.com/ledgers/22039478"
},
"operations": {
"href": "https://rpc.ankr.com/transactions/4826a3d41a5a795bf795767d0fb5e39c4abbcf695cf888b3578aa126b5b257ee/operations{?cursor,limit,order}",
"templated": true
},
"effects": {
"href": "https://rpc.ankr.com/transactions/4826a3d41a5a795bf795767d0fb5e39c4abbcf695cf888b3578aa126b5b257ee/effects{?cursor,limit,order}",
"templated": true
},
"precedes": {
"href": "https://rpc.ankr.com/transactions?order=asc\u0026cursor=94658837230923776"
},
"succeeds": {
"href": "https://rpc.ankr.com/transactions?order=desc\u0026cursor=94658837230923776"
},
"transaction": {
"href": "https://rpc.ankr.com/transactions/4826a3d41a5a795bf795767d0fb5e39c4abbcf695cf888b3578aa126b5b257ee"
}
},
"id": "4826a3d41a5a795bf795767d0fb5e39c4abbcf695cf888b3578aa126b5b257ee",
"paging_token": "94658837230923776",
"successful": true,
"hash": "4826a3d41a5a795bf795767d0fb5e39c4abbcf695cf888b3578aa126b5b257ee",
"ledger": 22039478,
"created_at": "2019-01-18T14:40:47Z",
"source_account": "GBYSOAM7D42RMUN4LCKCFYNXZU3F7TJVKD2NMR672J4372BCH6DE4BKR",
"source_account_sequence": "90296735301107721",
"fee_account": "GBYSOAM7D42RMUN4LCKCFYNXZU3F7TJVKD2NMR672J4372BCH6DE4BKR",
"fee_charged": "100",
"max_fee": "100",
"operation_count": 1,
"envelope_xdr": "AAAAAHEnAZ8fNRZRvFiUIuG3zTZfzTVQ9NZH39J5v+giP4ZOAAAAZAFAzGcAAAAJAAAAAQAAAAAAAAAAAAAAAFxB5cMAAAABAAAAAAAAAAEAAAAAAAAAAAAAAABqWeV9Oh8+PLCs81RaP/1+u2BXpwS8Wsc7iXD7l3m6sQAAAAAC+vCAAAAAAAAAAAEiP4ZOAAAAQO421wcb/JYfBpnYEJzHpMyQnrM8rHd4PUoyHXpPlvQAUGzARqwbX8hcLSM4tlk51AwbuZOaZfWCaFQfzFZJuAA=",
"result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAA=",
"result_meta_xdr": "AAAAAgAAAAIAAAADAVBLtgAAAAAAAAAAcScBnx81FlG8WJQi4bfNNl/NNVD01kff0nm/6CI/hk4AAAAAI9MEZAFAzGcAAAAIAAAAAAAAAAEAAAAA7Nxp7lmV7taqQfqoSP+tlqjOHWeANaQYFqhDkCQERZQAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAVBLtgAAAAAAAAAAcScBnx81FlG8WJQi4bfNNl/NNVD01kff0nm/6CI/hk4AAAAAI9MEZAFAzGcAAAAJAAAA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
],
"valid_after": "1970-01-01T00:00:00Z",
"valid_before": "2019-01-18T14:42:11Z",
"preconditions": {
"timebounds": {
"min_time": "0",
"max_time": "1547822531"
}
}
}
]
}
}
GET /accounts/{account_id}/operations
Retrieves an account's operations.
The endpoint represents successful operations for a given account and can be used in streaming mode. Streaming mode allows you to listen for new operations for this account 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
account_id(string; path; required): the account’s public key encoded in a base32 string representation.cursor(integer; query): a number that points to a specific location in a collection of responses and is pulled from thepaging_tokenvalue of a record.order(string; query): a designation of the order in which records should appear. Options includeasc(ascending) ordesc(descending). If this argument isn’t set, it defaults toasc.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 includetrueandfalse.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
- Standard
- Streaming
curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/operations
curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/operations \
-H 'Accept: text/event-stream'
Response example
{
"_links": {
"self": {
"href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/operations?cursor=120194466505179137\u0026limit=10\u0026order=asc"
},
"next": {
"href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/operations?cursor=213638377747542068\u0026limit=10\u0026order=asc"
},
"prev": {
"href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/operations?cursor=213638377747542068\u0026limit=10\u0026order=desc"
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"href": "https://rpc.ankr.com/operations/213638377747542068"
},
"transaction": {
"href": "https://rpc.ankr.com/transactions/64946c9e2ea9e30bf076bbc92068dcfdafcfaaf0fa77f4fee1060858751b9974"
},
"effects": {
"href": "https://rpc.ankr.com/operations/213638377747542068/effects"
},
"succeeds": {
"href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=213638377747542068"
},
"precedes": {
"href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=213638377747542068"
}
},
"id": "213638377747542068",
"paging_token": "213638377747542068",
"transaction_successful": true,
"source_account": "GCAHDBWNRTRNYGE5CX4RDVC74BVW3DOZOP5U6NMH3HLWTV46QZBZPFH4",
"type": "payment",
"type_i": 1,
"created_at": "2024-01-02T18:20:33Z",
"transaction_hash": "64946c9e2ea9e30bf076bbc92068dcfdafcfaaf0fa77f4fee1060858751b9974",
"asset_type": "native",
"from": "GCAHDBWNRTRNYGE5CX4RDVC74BVW3DOZOP5U6NMH3HLWTV46QZBZPFH4",
"to": "GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA",
"amount": "0.0610489"
}
]
}
}
GET /accounts/{account_id}/payments
Retrieves an account's payments.
This endpoint represents successful payments for a given account and can be used in streaming mode. Streaming mode allows you to listen for new payments for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known payment unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream payments created since your request time.
Parameters
account_id(string; path; required): the account’s public key encoded in a base32 string representation.cursor(integer; query): a number that points to a specific location in a collection of responses and is pulled from thepaging_tokenvalue of a record.order(string; query): a designation of the order in which records should appear. Options includeasc(ascending) ordesc(descending). If this argument isn’t set, it defaults toasc.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 includetrueandfalse.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
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"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": "payment",
"type_i": "string",
"created_at": "string",
"transaction_hash": "string",
"asset_type": "string",
"asset_issuer": "string",
"from": "string",
"to": "string",
"amount": "string"
}
]
}
}
Request example
- Standard
- Streaming
curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/payments{?cursor,limit,order}
curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/payments{?cursor,limit,order} \
-H 'Accept: text/event-stream'
Response example
{
"_links": {
"self": {
"href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/payments?cursor=148289273518190684\u0026limit=10\u0026order=asc"
},
"next": {
"href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/payments?cursor=213638377747542068\u0026limit=10\u0026order=asc"
},
"prev": {
"href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/payments?cursor=213638377747542068\u0026limit=10\u0026order=desc"
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"href": "https://rpc.ankr.com/operations/213638377747542068"
},
"transaction": {
"href": "https://rpc.ankr.com/transactions/64946c9e2ea9e30bf076bbc92068dcfdafcfaaf0fa77f4fee1060858751b9974"
},
"effects": {
"href": "https://rpc.ankr.com/operations/213638377747542068/effects"
},
"succeeds": {
"href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=213638377747542068"
},
"precedes": {
"href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=213638377747542068"
}
},
"id": "213638377747542068",
"paging_token": "213638377747542068",
"transaction_successful": true,
"source_account": "GCAHDBWNRTRNYGE5CX4RDVC74BVW3DOZOP5U6NMH3HLWTV46QZBZPFH4",
"type": "payment",
"type_i": 1,
"created_at": "2024-01-02T18:20:33Z",
"transaction_hash": "64946c9e2ea9e30bf076bbc92068dcfdafcfaaf0fa77f4fee1060858751b9974",
"asset_type": "native",
"from": "GCAHDBWNRTRNYGE5CX4RDVC74BVW3DOZOP5U6NMH3HLWTV46QZBZPFH4",
"to": "GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA",
"amount": "0.0610489"
}
]
}
}
GET /accounts/{account_id}/effects
Retrieves an account's effects.
This endpoint returns the effects of a specific account and can be used in streaming mode. Streaming mode allows you to listen for new effects for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known effect unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream effects created since your request time.
Parameters
account_id(string; path; required): the account’s public key encoded in a base32 string representation.cursor(integer; query): a number that points to a specific location in a collection of responses and is pulled from thepaging_tokenvalue of a record.order(string; query): a designation of the order in which records should appear. Options includeasc(ascending) ordesc(descending). If this argument isn’t set, it defaults toasc.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
},
"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
- Standard
- Streaming
curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/effects{?cursor,limit,order}
curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/effects{?cursor,limit,order} \
-H 'Accept: text/event-stream'
Response example
{
"_links": {
"self": {
"href": "https://rpc.ankr.com/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/effects?cursor=\u0026limit=1\u0026order=asc"
},
"next": {
"href": "https://rpc.ankr.com/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/effects?cursor=110694007436259329-1\u0026limit=1\u0026order=asc"
},
"prev": {
"href": "https://rpc.ankr.com/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/effects?cursor=110694007436259329-1\u0026limit=1\u0026order=desc"
}
},
"_embedded": {
"records": [
{
"_links": {
"operation": {
"href": "https://rpc.ankr.com/operations/110694007436259329"
},
"succeeds": {
"href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=110694007436259329-1"
},
"precedes": {
"href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=110694007436259329-1"
}
},
"id": "0110694007436259329-0000000001",
"paging_token": "110694007436259329-1",
"account": "GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE",
"type": "account_created",
"type_i": 0,
"created_at": "2019-09-11T13:16:44Z",
"starting_balance": "1.0000000"
}
]
}
}