This endpoint represents all effects.
This endpoint can also be used in streaming mode so it is possible to use it to listen for new effects as transactions happen in the Stellar network.
If called in streaming mode Horizon will start at the earliest known effect unless a cursor
is set. In that case it will start from the cursor
. You can also set cursor
value to now
to only stream effects created since your request time.
Request
GET /effects{?cursor,limit,order}
Arguments
name |
notes |
description |
example |
?cursor |
optional, default null |
A paging token, specifying where to start returning records from. When streaming this can be set to now to stream object created since your request time. |
12884905984 |
?order |
optional, string, default asc |
The order in which to return rows, “asc” or “desc”. |
asc |
?limit |
optional, number, default 10 |
Maximum number of records to return. |
200 |
curl Example Request
curl "https://horizon-testnet.stellar.org/effects"
JavaScript Example Request
var StellarSdk = require('stellar-sdk');
var server = new StellarSdk.Server('https://horizon-testnet.stellar.org');
server.effects()
.call()
.then(function (effectResults) {
//page 1
console.log(effectResults.records)
})
.catch(function (err) {
console.log(err)
})
Response
The list of effects.
Example Response
{
"_embedded": {
"records": [
{
"_links": {
"operation": {
"href": "/operations/279172878337"
},
"precedes": {
"href": "/effects?cursor=279172878337-1\u0026order=asc"
},
"succeeds": {
"href": "/effects?cursor=279172878337-1\u0026order=desc"
}
},
"account": "GBS43BF24ENNS3KPACUZVKK2VYPOZVBQO2CISGZ777RYGOPYC2FT6S3K",
"paging_token": "279172878337-1",
"starting_balance": "10000000.0",
"type_i": 0,
"type": "account_created"
},
{
"_links": {
"operation": {
"href": "/operations/279172878337"
},
"precedes": {
"href": "/effects?cursor=279172878337-2\u0026order=asc"
},
"succeeds": {
"href": "/effects?cursor=279172878337-2\u0026order=desc"
}
},
"account": "GBRPYHIL2CI3FNQ4BXLFMNDLFJUNPU2HY3ZMFSHONUCEOASW7QC7OX2H",
"amount": "10000000.0",
"asset_type": "native",
"paging_token": "279172878337-2",
"type_i": 3,
"type": "account_debited"
}
]
},
"_links": {
"next": {
"href": "/effects?order=asc\u0026limit=2\u0026cursor=279172878337-2"
},
"prev": {
"href": "/effects?order=desc\u0026limit=2\u0026cursor=279172878337-1"
},
"self": {
"href": "/effects?order=asc\u0026limit=2\u0026cursor="
}
}
}
Possible Errors
在 GitHub 上编辑此页面