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.
```curl curl "https://horizon.stellar.org/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/payments?order=desc" ``` ```js var StellarSdk = require("stellar-sdk"); var server = new StellarSdk.Server("https://horizon.stellar.org"); server .payments() .forAccount("GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE") .call() .then(function (resp) { console.log(resp); }) .catch(function (err) { console.error(err); }); ```
Copy {
"_links" : {
"self" : {
"href": "https://expansion-testnet.bantu.network/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/payments?cursor=\u0026limit=10\u0026order=desc"
},
"next" : {
"href": "https://expansion-testnet.bantu.network/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/payments?cursor=110694007436259329\u0026limit=10\u0026order=desc"
},
"prev" : {
"href": "https://expansion-testnet.bantu.network/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/payments?cursor=119400713599217665\u0026limit=10\u0026order=asc"
}
},
"_embedded" : {
"records" : [
{
"_links" : {
"self" : {
"href" : "https://expansion-testnet.bantu.network/operations/119400713599217665"
},
"transaction" : {
"href": "https://expansion-testnet.bantu.network/transactions/b9d7c534b5fa168570a5bffe0f2089de150d00bf8cbd19ec93e897c565958f3f"
},
"effects" : {
"href" : "https://expansion-testnet.bantu.network/operations/119400713599217665/effects"
},
"succeeds" : {
"href" : "https://expansion-testnet.bantu.network/effects?order=desc\u0026cursor=119400713599217665"
},
"precedes" : {
"href" : "https://expansion-testnet.bantu.network/effects?order=asc\u0026cursor=119400713599217665"
}
},
"id" : "119400713599217665" ,
"paging_token" : "119400713599217665" ,
"transaction_successful" : true ,
"source_account" : "GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE" ,
"type" : "payment" ,
"type_i" : 1,
"created_at" : "2020-01-17T20:32:38Z" ,
"transaction_hash" : "b9d7c534b5fa168570a5bffe0f2089de150d00bf8cbd19ec93e897c565958f3f" ,
"asset_type" : "credit_alphanum4" ,
"asset_code" : "USD" ,
"asset_issuer" : "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX" ,
"from" : "GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE" ,
"to" : "GASWJWFRYE55KC7MGANZMMRBK5NPXT3HMPDQ6SEXZN6ZPWYXVVYBFRTE" ,
"amount" : "84.9410878"
},
{
"_links" : {
"self" : {
"href" : "https://expansion-testnet.bantu.network/operations/117356420835532801"
},
"transaction" : {
"href": "https://expansion-testnet.bantu.network/transactions/c25dd84798076ee8ea126c78407d61c7e8f3efdf8739274f56b07a7029500b00"
},
"effects" : {
"href" : "https://expansion-testnet.bantu.network/operations/117356420835532801/effects"
},
"succeeds" : {
"href" : "https://expansion-testnet.bantu.network/effects?order=desc\u0026cursor=117356420835532801"
},
"precedes" : {
"href" : "https://expansion-testnet.bantu.network/effects?order=asc\u0026cursor=117356420835532801"
}
},
"id" : "117356420835532801" ,
"paging_token" : "117356420835532801" ,
"transaction_successful" : true ,
"source_account" : "GDV4KECLSZLKRVH4ZTWVAS4I3W2LPAPV66ADFFUZKGIVOTK6GMKGJT53" ,
"type" : "payment" ,
"type_i" : 1,
"created_at" : "2019-12-18T08:23:35Z" ,
"transaction_hash" : "c25dd84798076ee8ea126c78407d61c7e8f3efdf8739274f56b07a7029500b00" ,
"asset_type" : "native" ,
"from" : "GDV4KECLSZLKRVH4ZTWVAS4I3W2LPAPV66ADFFUZKGIVOTK6GMKGJT53" ,
"to" : "GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE" ,
"amount" : "355.3887598"
},
{
"_links" : {
"self" : {
"href" : "https://expansion-testnet.bantu.network/operations/115354197276323841"
},
"transaction" : {
"href": "https://expansion-testnet.bantu.network/transactions/c09d4cee993d60d73c80f036666966738a26b8f3b25d7275b93fd995505b5e5b"
},
"effects" : {
"href" : "https://expansion-testnet.bantu.network/operations/115354197276323841/effects"
},
"succeeds" : {
"href" : "https://expansion-testnet.bantu.network/effects?order=desc\u0026cursor=115354197276323841"
},
"precedes" : {
"href" : "https://expansion-testnet.bantu.network/effects?order=asc\u0026cursor=115354197276323841"
}
},
"id" : "115354197276323841" ,
"paging_token" : "115354197276323841" ,
"transaction_successful" : true ,
"source_account" : "GDV4KECLSZLKRVH4ZTWVAS4I3W2LPAPV66ADFFUZKGIVOTK6GMKGJT53" ,
"type" : "payment" ,
"type_i" : 1,
"created_at" : "2019-11-18T19:59:40Z" ,
"transaction_hash" : "c09d4cee993d60d73c80f036666966738a26b8f3b25d7275b93fd995505b5e5b" ,
"asset_type" : "native" ,
"from" : "GDV4KECLSZLKRVH4ZTWVAS4I3W2LPAPV66ADFFUZKGIVOTK6GMKGJT53" ,
"to" : "GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE" ,
"amount" : "688.4065454"
},
{
"_links" : {
"self" : {
"href" : "https://expansion-testnet.bantu.network/operations/110694007436259330"
},
"transaction" : {
"href": "https://expansion-testnet.bantu.network/transactions/26c996aa6afb299b6761f2335277196715160ade6aa001a755116448b145d3a7"
},
"effects" : {
"href" : "https://expansion-testnet.bantu.network/operations/110694007436259330/effects"
},
"succeeds" : {
"href" : "https://expansion-testnet.bantu.network/effects?order=desc\u0026cursor=110694007436259330"
},
"precedes" : {
"href" : "https://expansion-testnet.bantu.network/effects?order=asc\u0026cursor=110694007436259330"
}
},
"id" : "110694007436259330" ,
"paging_token" : "110694007436259330" ,
"transaction_successful" : true ,
"source_account" : "GB44UMO65PK5NWMRP4S2OSZA5BD4ACOW5KQ6TWLLO2MP7S7N5MJ2MJVI" ,
"type" : "account_merge" ,
"type_i" : 8,
"created_at" : "2019-09-11T13:16:44Z" ,
"transaction_hash" : "26c996aa6afb299b6761f2335277196715160ade6aa001a755116448b145d3a7" ,
"account" : "GB44UMO65PK5NWMRP4S2OSZA5BD4ACOW5KQ6TWLLO2MP7S7N5MJ2MJVI" ,
"into" : "GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE"
},
{
"_links" : {
"self" : {
"href" : "https://expansion-testnet.bantu.network/operations/110694007436259329"
},
"transaction" : {
"href": "https://expansion-testnet.bantu.network/transactions/26c996aa6afb299b6761f2335277196715160ade6aa001a755116448b145d3a7"
},
"effects" : {
"href" : "https://expansion-testnet.bantu.network/operations/110694007436259329/effects"
},
"succeeds" : {
"href" : "https://expansion-testnet.bantu.network/effects?order=desc\u0026cursor=110694007436259329"
},
"precedes" : {
"href" : "https://expansion-testnet.bantu.network/effects?order=asc\u0026cursor=110694007436259329"
}
},
"id" : "110694007436259329" ,
"paging_token" : "110694007436259329" ,
"transaction_successful" : true ,
"source_account" : "GB44UMO65PK5NWMRP4S2OSZA5BD4ACOW5KQ6TWLLO2MP7S7N5MJ2MJVI" ,
"type" : "create_account" ,
"type_i" : 0,
"created_at" : "2019-09-11T13:16:44Z" ,
"transaction_hash" : "26c996aa6afb299b6761f2335277196715160ade6aa001a755116448b145d3a7" ,
"starting_balance" : "1.0000000" ,
"funder" : "GB44UMO65PK5NWMRP4S2OSZA5BD4ACOW5KQ6TWLLO2MP7S7N5MJ2MJVI" ,
"account" : "GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE"
}
]
}
}
Copy var StellarSdk = require ( "stellar-sdk" );
var server = new StellarSdk.Server ( "https://expansion-testnet.bantu.network" );
var callback = function (resp) {
console.log(resp );
};
var es = server
.payments ()
.forAccount( "GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE" )
.cursor( "now" )
.stream( { onmessage: callback } );