Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Commit

Permalink
Update /api/resources/assets docs for new balance and accounts fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Bellamy committed Apr 7, 2021
1 parent f826587 commit c52b272
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 3 deletions.
46 changes: 46 additions & 0 deletions content/api/resources/assets/list.mdx
Expand Up @@ -12,14 +12,17 @@ This endpoint lists all assets.

<Endpoint>


| | |
| --- | --- |
| GET | /assets?asset_code{:asset_code}&asset_issuer={:account_id}&cursor={paging_token}&order={asc,desc}&limit={1-200}&include_failed{true,false} |

</Endpoint>


<AttributeTable>


- ARGUMENT
- REQUIRED
- DESCRIPTION
Expand All @@ -41,8 +44,10 @@ This endpoint lists all assets.

</AttributeTable>


<CodeExample title="Example Request">


```curl
curl "https://horizon.stellar.org/assets?asset_code=CNY&limit=3"
```
Expand All @@ -65,8 +70,10 @@ server

</CodeExample>


<ExampleResponse title="Example Response">


```json
{
"_links": {
Expand All @@ -92,6 +99,18 @@ server
"asset_code": "CNY",
"asset_issuer": "GAOT23KBW2HL6HVZFPNFLLT5VGIKGTLGR3AFDHYSRIWS4QKBYRPUW4N3",
"paging_token": "CNY_GAOT23KBW2HL6HVZFPNFLLT5VGIKGTLGR3AFDHYSRIWS4QKBYRPUW4N3_credit_alphanum4",
"accounts": {
"authorized": 23,
"authorized_to_maintain_liabilities": 11,
"unauthorized": 6
},
"num_claimable_balances": 3,
"balances": {
"authorized": "997268.0000000",
"authorized_to_maintain_liabilities": "498634.0000000",
"unauthorized": "249317.0000000"
},
"claimable_balances_amount": "124658.5000000",
"amount": "997268.0000000",
"num_accounts": 23,
"flags": {
Expand All @@ -110,6 +129,18 @@ server
"asset_code": "CNY",
"asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX",
"paging_token": "CNY_GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX_credit_alphanum4",
"accounts": {
"authorized": 5514,
"authorized_to_maintain_liabilities": 2757,
"unauthorized": 1378
},
"num_claimable_balances": 551,
"balances": {
"authorized": "18318343.2623217",
"authorized_to_maintain_liabilities": "7327337.3049290",
"unauthorized": "2930934.9219720"
},
"claimable_balances_amount": "1172373.9687890",
"amount": "18318343.2623217",
"num_accounts": 5514,
"flags": {
Expand All @@ -128,6 +159,18 @@ server
"asset_code": "CNY",
"asset_issuer": "GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH",
"paging_token": "CNY_GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH_credit_alphanum4",
"accounts": {
"authorized": 1,
"authorized_to_maintain_liabilities": 0,
"unauthorized": 0
},
"num_claimable_balances": 0,
"balances": {
"authorized": "0.0000000",
"authorized_to_maintain_liabilities": "0.0000000",
"unauthorized": "0.0000000"
},
"claimable_balances_amount": "0.0000000",
"amount": "0.0000000",
"num_accounts": 1,
"flags": {
Expand All @@ -143,8 +186,10 @@ server

</ExampleResponse>


<CodeExample title="JavaScript Streaming Example">


```js
var StellarSdk = require("stellar-sdk");
var server = new StellarSdk.Server("https://horizon.stellar.org");
Expand All @@ -161,3 +206,4 @@ var es = server
```

</CodeExample>

34 changes: 31 additions & 3 deletions content/api/resources/assets/object.mdx
Expand Up @@ -10,6 +10,7 @@ When Horizon returns information about an asset, it uses the following format:

<AttributeTable>


- ATTRIBUTE
- DATA TYPE
- DESCRIPTION
Expand All @@ -22,12 +23,24 @@ When Horizon returns information about an asset, it uses the following format:
- asset_issuer
- string
- The Stellar address of this asset’s issuer.
- amount
- accounts
- object
- The number of accounts grouped by each trustline flag state.
- num_claimable_balances
- number
- The number of units issued for this asset.
- The current number of claimable_balances for this asset.
- balances
- object
- The number of units issued for this asset grouped by each trustline flag state.
- claimable_balances_amount
- string
- The number of units in claimable balances for this asset.
- amount
- string
- The number of authorized units issued for this asset. This will be deprecated in Horizon v3.
- num_accounts
- number
- The numnber of accounts that have issued a trustline to this asset. If the `auth_required` flag for this asset's issuer is set to `true`, this number only includes the accounts who have both set up a trustline to the asset and have been authorized to hold the asset.
- The number of accounts that have issued a trustline to this asset. If the `auth_required` flag for this asset's issuer is set to `true`, this number only includes the accounts who have both set up a trustline to the asset and have been authorized to hold the asset. This will be deprecated in Horizon v3.
- flags
- object
- Flags denote the enabling/disabling of certain asset issuer privileges.
Expand All @@ -46,8 +59,10 @@ When Horizon returns information about an asset, it uses the following format:

</AttributeTable>


<ExampleResponse>


```json
{
"_links": {
Expand All @@ -73,6 +88,18 @@ When Horizon returns information about an asset, it uses the following format:
"asset_code": "USD",
"asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX",
"paging_token": "USD_GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX_credit_alphanum4",
"accounts": {
"authorized": 9390,
"authorized_to_maintain_liabilities": 1240,
"unauthorized": 5
},
"num_claimable_balances": 253,
"balances": {
"authorized": "1347404.4083346",
"authorized_to_maintain_liabilities": "177931.9984610",
"unauthorized": "717.4677360"
},
"claimable_balances_amount": "36303.8674450",
"amount": "1347404.4083346",
"num_accounts": 9390,
"flags": {
Expand All @@ -87,3 +114,4 @@ When Horizon returns information about an asset, it uses the following format:
```

</ExampleResponse>

0 comments on commit c52b272

Please sign in to comment.