-
Notifications
You must be signed in to change notification settings - Fork 15
Stellar
Oleg Baturov edited this page Jun 1, 2018
·
28 revisions
Stellar apis
Get ledgers
Get transactions
Get ledger by hash or height
Get transactions by ledger
Get Latest operations
Get operations by transaction
Get transaction by transaction hash
Get account information by accountID
Get operations by accountID
Get transactions by account
Get payments by account
Get Offers by account
Get effects by account
Get Latest effects
GET /api/v1/ledgers
Get ledger list.
Name | Type | Mandatory | Default | Description |
---|---|---|---|---|
count | Number | No | 10 | ledger count to get |
order | Number | No | 0 | 0 => newest first, 1 => oldest first |
cursor | String | No | 0 | 0 for first page, and next or prev value of response of this api |
- for successed case
status code:
200
{
"status": 200,
"msg": "success",
"next": "23442324233",
"prev": "23442324128",
"data": [ledger]
}
- for failed case
status code:
400
{
"error": "" //error message
}
GET /api/v1/ledger/:hash
Name | Type | Mandatory | Description |
---|---|---|---|
hash | String | YES | ledger hash or height |
- for successed case
status code:
200
{
status: 200,
"msg": "success",
"data": ledger
}
- for failed case
status code:
400
{
"error": "" //error message
}
GET /api/v1/transactions
Name | Type | Mandatory | Default | Description |
---|---|---|---|---|
count | Number | No | 10 | ledger count to get |
order | Number | No | 0 | 0 => newest first, 1 => oldest first |
cursor | String | No | 0 | 0 for first page, and next or prev value of response of this api |
- for successed case
status code:
200
{
"status": 200,
"msg": "success",
"next": "23442324233",
"next": "23442324128",
"data": [transaction]
}
transaction: {
"id": "e974960c67a19311b2ef507a8ecaf7efc0e504de07de6982a556e8030c380d70",
"paging_token": "38693085491765248",
"hash": "e974960c67a19311b2ef507a8ecaf7efc0e504de07de6982a556e8030c380d70",
"ledger": 9008936,
"created_at": "2018-05-17T09:04:35Z",
"source_account": "GCTHNQGSSHOKSLHN75ZLRRCAZYKD3TCNQ57NKOB4SWNXXTDTTL23TUEN",
"source_account_sequence": "37537369921953584",
"fee_paid": 3800,
"operation_count": 38,
}
- for failed case
status code:
400
{
"error": "" //error message
}
/api/v1/ledger/txs
Name | Type | Mandatory | Description |
---|---|---|---|
ledger | String | YES | sequence or hash |
- for successed case
status code:
200
{
"msg": "success",
"data": [
{
"hash": "8febfdb00d2920f65af42d4f28d118742a95b0f3ea134ebd980cf302e7818317",
"account": "GARMAQQ45FYTFSCLBREX5M3JTTBZ5MWDMU5DOGZRHXU6SG2GX4CB7IAF",
"timeStamp": "2015-09-24T10:07:09Z",
"operations": 11,
},
...
]
}
- for failed case
status code:
400
{
"error": "" //error message
}
/api/v1/operations
Name | Type | Mandatory | Description |
---|---|---|---|
count | Number | YES | count of operations |
- for successed case
status code:
200
{
"msg": "success",
"data": [
{
"transaction": "8febfdb00d2920f65af42d4f28d118742a95b0f3ea134ebd980cf302e7818317",
"account": "GARMAQQ45FYTFSCLBREX5M3JTTBZ5MWDMU5DOGZRHXU6SG2GX4CB7IAF",
"type": "payment",
"asset_type": 'credit_alphanum12',
"asset_code": 'nCntGameCoin',
"asset_issuer": 'GDLMDXI6EVVUIXWRU4S2YVZRMELHUEX3WKOX6XFW77QQC6KZJ4CZ7NRB',
"from": 'GAK3NSB43EVCZKDH4PYGJPCVPOYZ7X7KIR3ZTWSYRKRMJWGG5TABM6TH',
"to": 'GCHKKQ5VWJBRQZHNMODO5BWYZKPNM2HDSJ26T4O644CNEQBYK7IXATKM',
"amount": '2.0000000'
"timeStamp": "2015-09-24T10:07:09Z",
},
...
]
}
- for failed case
status code:
400
{
"error": "" //error message
}
/api/v1/txs/operations
Name | Type | Mandatory | Description |
---|---|---|---|
txHash | String | YES | sequence or hash |
- for successed case
status code:
200
{
"msg": "success",
"data": [
{
"account": "GARMAQQ45FYTFSCLBREX5M3JTTBZ5MWDMU5DOGZRHXU6SG2GX4CB7IAF",
"type": "payment",
"asset_type": 'credit_alphanum12',
"asset_code": 'nCntGameCoin',
"asset_issuer": 'GDLMDXI6EVVUIXWRU4S2YVZRMELHUEX3WKOX6XFW77QQC6KZJ4CZ7NRB',
"from": 'GAK3NSB43EVCZKDH4PYGJPCVPOYZ7X7KIR3ZTWSYRKRMJWGG5TABM6TH',
"to": 'GCHKKQ5VWJBRQZHNMODO5BWYZKPNM2HDSJ26T4O644CNEQBYK7IXATKM',
"amount": '2.0000000'
"timeStamp": "2015-09-24T10:07:09Z"
},
...
]
}
- for failed case
status code:
400
{
"error": "" //error message
}
/api/v1/tx
Name | Type | Mandatory | Description |
---|---|---|---|
txHash | String | YES | hash of transaction |
- for successed case
status code:
200
{
"msg": "success",
"data": {
"timeStamp": "2015-09-24T10:07:09Z",
"ledger": 17733198,
"account": "GA4K4BUZ4SLAKQA5T2OE64FM3BWTUJXQQ3J4QPCEQBHCQZWQHRHGPPSO",
"fee": 0.00004,
},
}
- for failed case
status code:
400
{
"error": "" //error message
}
/api/v1/account
Get overview from account
Name | Type | Mandatory | Description |
---|---|---|---|
account | String | YES | account ID |
- for successed case
status code:
200
{
"msg": "success",
"data":
{
"subentry_count": 1,
"thresholds": {
"low_threshold": 0,
"med_threshold": 0,
"high_threshold": 0
},
"flags": {
"auth_required": false,
"auth_revocable": false
},
"balances": [
{
"balance": "49881.0000000",
"limit": "922337203685.4775807",
"asset_type": "credit_alphanum12",
"asset_code": "nCntGameCoin",
"asset_issuer": "GDLMDXI6EVVUIXWRU4S2YVZRMELHUEX3WKOX6XFW77QQC6KZJ4CZ7NRB"
},
{
"balance": "9999.9530300",
"asset_type": "native"
}
],
"signers": [
{
"public_key": "GBYLPSBGNBG2RNGOQ66RSSYLWOGD6MNYRFNEB4UH3QY6CBH5IPMPXIBH",
"weight": 1,
"key": "GBYLPSBGNBG2RNGOQ66RSSYLWOGD6MNYRFNEB4UH3QY6CBH5IPMPXIBH",
"type": "ed25519_public_key"
}
],
"data": {}
},
}
- for failed case
status code:
400
{
"error": "" //error message
}
/api/v1/account/operations
Get operations related to account
Name | Type | Mandatory | Description |
---|---|---|---|
account | String | YES | account ID |
- for successed case
status code:
200
{
"msg": "success",
"data": [
{
"account": "GARMAQQ45FYTFSCLBREX5M3JTTBZ5MWDMU5DOGZRHXU6SG2GX4CB7IAF",
"timeStamp": "2015-09-24T10:07:09Z",
"type": 11,
"ledger": "payment",
},
],
...
}
- for failed case
status code:
400
{
"error": "" //error message
}
/api/v1/account/txs
Name | Type | Mandatory | Description |
---|---|---|---|
account | String | YES | account ID |
- for successed case
status code:
200
{
"msg": "success",
"data": [
{
"hash": "8febfdb00d2920f65af42d4f28d118742a95b0f3ea134ebd980cf302e7818317",
"ledger": 17733198,
"timeStamp": "2015-09-24T10:07:09Z",
"operations": 11,
},
...
]
}
- for failed case
status code:
400
{
"error": "" //error message
}
/api/v1/account/payments
Name | Type | Mandatory | Description |
---|---|---|---|
account | String | YES | account ID |
count | Number | YES | count of transactions |
cursor | String | YES | 0 for first page, and next or prev value of response of this api |
- for successed case
status code:
200
{
"msg": "success",
"next": "23442324233",
"next": "23442324128",
"data": [
{
"hash": "8febfdb00d2920f65af42d4f28d118742a95b0f3ea134ebd980cf302e7818317",
"account": "GARMAQQ45FYTFSCLBREX5M3JTTBZ5MWDMU5DOGZRHXU6SG2GX4CB7IAF",
"asset_type": 'credit_alphanum12',
"asset_code": 'nCntGameCoin',
"asset_issuer": 'GDLMDXI6EVVUIXWRU4S2YVZRMELHUEX3WKOX6XFW77QQC6KZJ4CZ7NRB',
"from": 'GAK3NSB43EVCZKDH4PYGJPCVPOYZ7X7KIR3ZTWSYRKRMJWGG5TABM6TH',
"to": 'GCHKKQ5VWJBRQZHNMODO5BWYZKPNM2HDSJ26T4O644CNEQBYK7IXATKM',
"amount": '2.0000000'
"timeStamp": "2015-09-24T10:07:09Z"
},
...
]
}
- for failed case
status code:
400
{
"error": "" //error message
}
/api/v1/account/offers
Name | Type | Mandatory | Description |
---|---|---|---|
account | String | YES | account ID |
count | Number | YES | count of transactions |
cursor | String | YES | 0 for first page, and next or prev value of response of this api |
- for successed case
status code:
200
{
"msg": "success",
"next": "23442324233",
"next": "23442324128",
"data": [
{
"sell": XLM,
"buy": USD,
"amount": 4622.8710000,
"price": 0.364310
},
...
]
}
- for failed case
status code:
400
{
"error": "" //error message
}
/api/v1/account/effects
Name | Type | Mandatory | Description |
---|---|---|---|
account | String | YES | account ID |
count | Number | YES | count of transactions |
cursor | String | YES | 0 for first page, and next or prev value of response of this api |
- for successed case
status code:
200
{
"msg": "success",
"next": "23442324233",
"next": "23442324128",
"data": [
{
"hash": "8febfdb00d2920f65af42d4f28d118742a95b0f3ea134ebd980cf302e7818317",
"account": "GARMAQQ45FYTFSCLBREX5M3JTTBZ5MWDMU5DOGZRHXU6SG2GX4CB7IAF",
"asset_type": 'credit_alphanum12',
"asset_code": 'nCntGameCoin',
"asset_issuer": 'GDLMDXI6EVVUIXWRU4S2YVZRMELHUEX3WKOX6XFW77QQC6KZJ4CZ7NRB',
"from": 'GAK3NSB43EVCZKDH4PYGJPCVPOYZ7X7KIR3ZTWSYRKRMJWGG5TABM6TH',
"to": 'GCHKKQ5VWJBRQZHNMODO5BWYZKPNM2HDSJ26T4O644CNEQBYK7IXATKM',
"amount": '2.0000000'
"timeStamp": "2015-09-24T10:07:09Z"
},
...
]
}
- for failed case
status code:
400
{
"error": "" //error message
}
/api/v1/effects
Name | Type | Mandatory | Description |
---|---|---|---|
count | Number | YES | count of transactions |
cursor | String | YES | 0 for first page, and next or prev value of response of this api |
- for successed case
status code:
200
{
"msg": "success",
"next": "23442324233",
"next": "23442324128",
"data": [
{
"hash": "8febfdb00d2920f65af42d4f28d118742a95b0f3ea134ebd980cf302e7818317",
"account": "GD5WH732DRJWCTMQLNC57UECV44WORONOZ7L3TALNRV3TGFSGIXSNKCB",
"type": "account_debited",
"type_i": 3,
"asset_type": "credit_alphanum4",
"asset_code": "ATN",
"asset_issuer": "GCAUZH5OGE4HU4NZPBXX67A66D6DVR2IIZMT2BU635UN5PJXWUPUO3A7",
"amount": "1.0000000",
"timestamp": "2018-05-12T14:05:15Z",
"transaction_hash": "e67f79d3eae73a661f21cccdf719b05deec49419e47eb9e5431a3f048c2fa5ac"
},
...
]
}
- for failed case
status code:
400
{
"error": "" //error message
}