Stellar — Trades, Transactions (3/3)
API reference for Stellar. All methods ->
Transactions
POST /transactions
Submits a transaction.
This endpoint actually submits a transaction to the Stellar network. It only takes a single, required parameter: the signed transaction. Refer to the Transactions page for details on how to craft a proper one. If you submit a transaction that has already been included in a ledger, this endpoint will return the same response as would’ve been returned for the original transaction submission. This allows for safe resubmission of transactions in error scenarios, as highlighted in the error-handling guide.
Parameters
tx(string; query; required): a signed transaction.
Returns
{
"_embedded": {
"records": [
{
"memo": "string",
"memo_bytes": "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 -X POST https://rpc.ankr.com/http/YOUR_ANKR_API_KEY/stellar_horizon/transactions{?tx}
curl -X POST https://rpc.ankr.com/http/YOUR_ANKR_API_KEY/stellar_horizon/transactions{?tx} \
-H 'Accept: text/event-stream'
Response example
{
"memo": "Test Transaction",
"memo_bytes": "VGVzdCBUcmFuc2FjdGlvbg==",
"_links": {
"self": {
"href": "https://rpc.ankr.com/transactions/8ef0c6d60357bf91b0b0d7800b747ff02bf73117d3e017690cbff641ca67f124"
},
"account": {
"href": "https://rpc.ankr.com/accounts/GCIHAQVWZH2AB5BB5NP63FBSIREG77LQZZNUVKD2LN2IOCLOT6N72MJN"
},
"ledger": {
"href": "https://rpc.ankr.com/ledgers/139575"
},
"operations": {
"href": "https://rpc.ankr.com/transactions/8ef0c6d60357bf91b0b0d7800b747ff02bf73117d3e017690cbff641ca67f124/operations{?cursor,limit,order}",
"templated": true
},
"effects": {
"href": "https://rpc.ankr.com/transactions/8ef0c6d60357bf91b0b0d7800b747ff02bf73117d3e017690cbff641ca67f124/effects{?cursor,limit,order}",
"templated": true
},
"precedes": {
"href": "https://rpc.ankr.com/transactions?order=asc&cursor=599470060347392"
},
"succeeds": {
"href": "https://rpc.ankr.com/transactions?order=desc&cursor=599470060347392"
},
"transaction": {
"href": "https://rpc.ankr.com/transactions/8ef0c6d60357bf91b0b0d7800b747ff02bf73117d3e017690cbff641ca67f124"
}
},
"id": "8ef0c6d60357bf91b0b0d7800b747ff02bf73117d3e017690cbff641ca67f124",
"paging_token": "599470060347392",
"successful": true,
"hash": "8ef0c6d60357bf91b0b0d7800b747ff02bf73117d3e017690cbff641ca67f124",
"ledger": 139575,
"created_at": "2021-03-25T21:14:11Z",
"source_account": "GCIHAQVWZH2AB5BB5NP63FBSIREG77LQZZNUVKD2LN2IOCLOT6N72MJN",
"source_account_sequence": "599336916353025",
"fee_account": "GCIHAQVWZH2AB5BB5NP63FBSIREG77LQZZNUVKD2LN2IOCLOT6N72MJN",
"fee_charged": "100",
"max_fee": "100",
"operation_count": 1,
"envelope_xdr": "AAAAAgAAAACQcEK2yfQA9CHrX+2UMkRIb/1wzltKqHpbdIcJbp+b/QAAAGQAAiEYAAAAAQAAAAEAAAAAAAAAAAAAAABgXP3QAAAAAQAAABBUZXN0IFRyYW5zYWN0aW9uAAAAAQAAAAAAAAABAAAAAJBwQrbJ9AD0Ietf7ZQyREhv/XDOW0qoelt0hwlun5v9AAAAAAAAAAAF9eEAAAAAAAAAAAFun5v9AAAAQKdJnG8QRiv9xGp1Oq7ACv/xR2BnNqjfUHrGNua7m4tWbrun3+GmAj6ca3xz+4ZppWRTbvTUcCxvpbHERZ85QgY=",
"result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAA=",
"result_meta_xdr": "AAAAAgAAAAIAAAADAAIhNwAAAAAAAAAAkHBCtsn0APQh61/tlDJESG/9cM5bSqh6W3SHCW6fm/0AAAAXSHbnnAACIRgAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAIhNwAAAAAAAAAAkHBCtsn0APQh61/tlDJESG/9cM5bSqh6W3SHCW6fm/0AAAAXSHbnnAACIRgAAAABAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAA=",
"fee_meta_xdr": "AAAAAgAAAAMAAiEYAAAAAAAAAACQcEK2yfQA9CHrX+2UMkRIb/1wzltKqHpbdIcJbp+b/QAAABdIdugAAAIhGAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAiE3AAAAAAAAAACQcEK2yfQA9CHrX+2UMkRIb/1wzltKqHpbdIcJbp+b/QAAABdIduecAAIhGAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==",
"memo_type": "text",
"signatures": [
"p0mcbxBGK/3EanU6rsAK//FHYGc2qN9QesY25rubi1Zuu6ff4aYCPpxrfHP7hmmlZFNu9NRwLG+lscRFnzlCBg=="
],
"valid_after": "1970-01-01T00:00:00Z",
"valid_before": "2021-03-25T21:17:04Z"
}
GET /transactions/{transaction_hash}
Retrieves a particular transaction.
The single transaction endpoint provides information on a specific transaction.
Parameters
transaction_hash(string; path; required): transactions are commands that modify the ledger state and consist of one or more operations.
Returns
{
"_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
}
},
"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"
]
}
Request example
- Standard
- Streaming
curl https://rpc.ankr.com/http/stellar_horizon/transactions/{transaction_hash}
curl https://rpc.ankr.com/http/stellar_horizon/transactions/{transaction_hash} \
-H 'Accept: text/event-stream'
Response example
{
"_links": {
"self": {
"href": "https://rpc.ankr.com/transactions/5ebd5c0af4385500b53dd63b0ef5f6e8feef1a7e1c86989be3cdcce825f3c0cc"
},
"account": {
"href": "https://rpc.ankr.com/accounts/GDI5EK4HNMBHJJQGP3GUXQJIIOHU2CJO3LABPWD6WYSPJZP5NP67TMNN"
},
"ledger": {
"href": "https://rpc.ankr.com/ledgers/27963785"
},
"operations": {
"href": "https://rpc.ankr.com/transactions/5ebd5c0af4385500b53dd63b0ef5f6e8feef1a7e1c86989be3cdcce825f3c0cc/operations{?cursor,limit,order}",
"templated": true
},
"effects": {
"href": "https://rpc.ankr.com/transactions/5ebd5c0af4385500b53dd63b0ef5f6e8feef1a7e1c86989be3cdcce825f3c0cc/effects{?cursor,limit,order}",
"templated": true
},
"precedes": {
"href": "https://rpc.ankr.com/transactions?order=asc\u0026cursor=120103542047408128"
},
"succeeds": {
"href": "https://rpc.ankr.com/transactions?order=desc\u0026cursor=120103542047408128"
},
"transaction": {
"href": "https://rpc.ankr.com/transactions/5ebd5c0af4385500b53dd63b0ef5f6e8feef1a7e1c86989be3cdcce825f3c0cc"
}
},
"id": "5ebd5c0af4385500b53dd63b0ef5f6e8feef1a7e1c86989be3cdcce825f3c0cc",
"paging_token": "120103542047408128",
"successful": true,
"hash": "5ebd5c0af4385500b53dd63b0ef5f6e8feef1a7e1c86989be3cdcce825f3c0cc",
"ledger": 27963785,
"created_at": "2020-01-28T10:03:33Z",
"source_account": "GDI5EK4HNMBHJJQGP3GUXQJIIOHU2CJO3LABPWD6WYSPJZP5NP67TMNN",
"source_account_sequence": "65046128646685383",
"fee_account": "GDI5EK4HNMBHJJQGP3GUXQJIIOHU2CJO3LABPWD6WYSPJZP5NP67TMNN",
"fee_charged": "100",
"max_fee": "100",
"operation_count": 1,
"envelope_xdr": "AAAAANHSK4drAnSmBn7NS8EoQ49NCS7awBfYfrYk9OX9a/35AAAAZADnFxwAAALHAAAAAAAAAAAAAAABAAAAAQAAAADR0iuHawJ0pgZ+zUvBKEOPTQku2sAX2H62JPTl/Wv9+QAAAAEAAAAA+qpaPAsU/CGcSeS4KnvqE9y+Bcjhyr1l6jiwixRsvu8AAAABTkdOVAAAAAAs4YIuYne69wMuNtfiZ64gb7E3qnTR7A4yD4jZDSS8AQAAAdGpSiAAAAAAAAAAAAH9a/35AAAAQM5LSBiFRQKtFYRPpNabwVuvIhZSVRDaajf0KzYaqJmgaXAlFaTOYyYc11YuxUM1Fzl1VT4UEbI22BvO/8HzUgQ=",
"result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAA=",
"result_meta_xdr": "AAAAAgAAAAIAAAADAaqxiQAAAAAAAAAA0dIrh2sCdKYGfs1LwShDj00JLtrAF9h+tiT05f1r/fkAAAAAAhWQlADnFxwAAALGAAAAAQAAAAEAAAAAhD8B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uhAAAAAAAAAADR0iuHawJ0pgZ+zUvBKEOPTQku2sAX2H62JPTl/Wv9+QAAAAACFZD4AOcXHAAAAsYAAAABAAAAAQAAAACEPwEuxkVAQXfespLpiilBRPdvqIsEbieyl7rz8ME0FgAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQGqsYkAAAAAAAAAANHSK4drAnSmBn7NS8EoQ49NCS7awBfYfrYk9OX9a/35AAAAAAIVkJQA5xccAAACxgAAAAEAAAABAAAAAIQ/AS7GRUBBd96ykumKKUFE92+oiwRuJ7KXuvPwwTQWAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
"memo_type": "none",
"signatures": [
"zktIGIVFAq0VhE+k1pvBW68iFlJVENpqN/QrNhqomaBpcCUVpM5jJhzXVi7FQzUXOXVVPhQRsjbYG87/wfNSBA=="
]
}
GET /transactions/{transaction_hash}/operations
Retrieves all operations of a particular transaction.
This endpoint returns Successful operations for a specific transaction.
Parameters
transaction_hash(string; path; required): transactions are commands that modify the ledger state and consist of one or more operations.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
},
"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",
"type_i": 0,
"type": "create_account"
}
Request example
- Standard
- Streaming
curl https://rpc.ankr.com/http/stellar_horizon/transactions/{transaction_hash}/operations{?cursor,order,limit,include_failed,join}
curl https://rpc.ankr.com/http/stellar_horizon/transactions/{transaction_hash}/operations{?cursor,order,limit,include_failed,join} \
-H 'Accept: text/event-stream'
Response example
{
"_links": {
"self": {
"href": "https://rpc.ankr.com/transactions/6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a/operations?cursor=\u0026limit=1\u0026order=asc"
},
"next": {
"href": "https://rpc.ankr.com/transactions/6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a/operations?cursor=120133379185221633\u0026limit=1\u0026order=asc"
},
"prev": {
"href": "https://rpc.ankr.com/transactions/6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a/operations?cursor=120133379185221633\u0026limit=1\u0026order=desc"
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"href": "https://rpc.ankr.com/operations/120133379185221633"
},
"transaction": {
"href": "https://rpc.ankr.com/transactions/6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a"
},
"effects": {
"href": "https://rpc.ankr.com/operations/120133379185221633/effects"
},
"succeeds": {
"href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=120133379185221633"
},
"precedes": {
"href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=120133379185221633"
}
},
"id": "120133379185221633",
"paging_token": "120133379185221633",
"transaction_successful": true,
"source_account": "GDJX67SFY2N73H72TWMKKBQP5UPBNKBNUMNE2IGFKNES43S4327X6DHG",
"type": "manage_buy_offer",
"type_i": 12,
"created_at": "2020-01-28T21:14:59Z",
"transaction_hash": "6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a",
"amount": "0.0000000",
"price": "0.0001000",
"price_r": {
"n": 1,
"d": 10000
},
"buying_asset_type": "native",
"selling_asset_type": "credit_alphanum4",
"selling_asset_code": "ETH",
"selling_asset_issuer": "GBDEVU63Y6NTHJQQZIKVTC23NWLQVP3WJ2RI2OTSJTNYOIGICST6DUXR",
"offer_id": "149983118"
}
]
}
}