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

Commit

Permalink
Update /assets and add /claimable_balances/*/(operations|transactions…
Browse files Browse the repository at this point in the history
…) endpoints (#373)
  • Loading branch information
Paul Bellamy authored May 11, 2021
1 parent a0f399f commit 687f016
Show file tree
Hide file tree
Showing 9 changed files with 576 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SUDO := $(shell docker version >/dev/null 2>&1 || echo "sudo")
# If TAG is not provided set default value
TAG ?= stellar/developers:$(shell git rev-parse --short HEAD)$(and $(shell git status -s),-dirty-$(shell id -u -n))
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
BUILD_DATE := $(shell date --utc --rfc-3339=seconds)
BUILD_DATE := $(shell date -u +%FT%TZ)

docker-build:
$(SUDO) docker build --pull --label org.opencontainers.image.created="$(BUILD_DATE)" \
Expand Down
46 changes: 46 additions & 0 deletions content/api/resources/assets/list.mdx
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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>

8 changes: 5 additions & 3 deletions content/api/resources/claimablebalances/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ A Claimable Balance represents the transfer of ownership of some amount of an as
<EndpointsTable title="Endpoints">


| | |
| --- | --------------------------------------------------------- |
| | |
| --- | --- |
| GET | [/claimable_balances](./list.mdx) |
| GET | [/claimable_balances/:claimable_balance_id](./single.mdx) |
| GET | [/claimable_balances](./list.mdx) |
| GET | [/claimable_balances/:claimable_balance_id/transactions](./transactions.mdx) |
| GET | [/claimable_balances/:claimable_balance_id/operations](./operations.mdx) |

</EndpointsTable>

34 changes: 33 additions & 1 deletion content/api/resources/claimablebalances/list.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: List Claimable Balances
order: 30
order: 15
---

import { Endpoint } from "components/Endpoint";
Expand Down Expand Up @@ -96,6 +96,14 @@ server
"_links": {
"self": {
"href": "https://horizon.stellar.org/claimable_balances/00000000929b20b72e5890ab51c24f1cc46fa01c4f318d8d33367d24dd614cfdf5491072"
},
"operations": {
"href": "https://horizon.stellar.org/claimable_balances/00000000929b20b72e5890ab51c24f1cc46fa01c4f318d8d33367d24dd614cfdf5491072/operations{?cursor,limit,order}",
"templated": true
},
"transactions": {
"href": "https://horizon.stellar.org/claimable_balances/00000000929b20b72e5890ab51c24f1cc46fa01c4f318d8d33367d24dd614cfdf5491072/transactions{?cursor,limit,order}",
"templated": true
}
},
"id": "00000000929b20b72e5890ab51c24f1cc46fa01c4f318d8d33367d24dd614cfdf5491072",
Expand All @@ -118,6 +126,14 @@ server
"_links": {
"self": {
"href": "https://horizon.stellar.org/claimable_balances/00000000be7e37b24927c095e2292d5d0e6db8b0f2dbeb1355847c7fccb458cbdd61bfd0"
},
"operations": {
"href": "https://horizon.stellar.org/claimable_balances/00000000be7e37b24927c095e2292d5d0e6db8b0f2dbeb1355847c7fccb458cbdd61bfd0/operations{?cursor,limit,order}",
"templated": true
},
"transactions": {
"href": "https://horizon.stellar.org/claimable_balances/00000000be7e37b24927c095e2292d5d0e6db8b0f2dbeb1355847c7fccb458cbdd61bfd0/transactions{?cursor,limit,order}",
"templated": true
}
},
"id": "00000000be7e37b24927c095e2292d5d0e6db8b0f2dbeb1355847c7fccb458cbdd61bfd0",
Expand All @@ -142,6 +158,14 @@ server
"_links": {
"self": {
"href": "https://horizon.stellar.org/claimable_balances/0000000084ec48a1c44df5396625e4560bdc1d48d2371dece73cbe7e790d2b7b277347b7"
},
"operations": {
"href": "https://horizon.stellar.org/claimable_balances/0000000084ec48a1c44df5396625e4560bdc1d48d2371dece73cbe7e790d2b7b277347b7/operations{?cursor,limit,order}",
"templated": true
},
"transactions": {
"href": "https://horizon.stellar.org/claimable_balances/0000000084ec48a1c44df5396625e4560bdc1d48d2371dece73cbe7e790d2b7b277347b7/transactions{?cursor,limit,order}",
"templated": true
}
},
"id": "0000000084ec48a1c44df5396625e4560bdc1d48d2371dece73cbe7e790d2b7b277347b7",
Expand All @@ -164,6 +188,14 @@ server
"_links": {
"self": {
"href": "https://horizon.stellar.org/claimable_balances/00000000c582697b67cbec7f9ce64f4dc67bfb2bfd26318bb9f964f4d70e3f41f650b1e6"
},
"operations": {
"href": "https://horizon.stellar.org/claimable_balances/00000000c582697b67cbec7f9ce64f4dc67bfb2bfd26318bb9f964f4d70e3f41f650b1e6/operations{?cursor,limit,order}",
"templated": true
},
"transactions": {
"href": "https://horizon.stellar.org/claimable_balances/00000000c582697b67cbec7f9ce64f4dc67bfb2bfd26318bb9f964f4d70e3f41f650b1e6/transactions{?cursor,limit,order}",
"templated": true
}
},
"id": "00000000c582697b67cbec7f9ce64f4dc67bfb2bfd26318bb9f964f4d70e3f41f650b1e6",
Expand Down
8 changes: 8 additions & 0 deletions content/api/resources/claimablebalances/object.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ When Horizon returns information about a claimable balance, it uses the followin
"_links": {
"self": {
"href": "https://horizon.stellar.org/claimable_balances/000000000102030000000000000000000000000000000000000000000000000000000000"
},
"operations": {
"href": "https://horizon.stellar.org/claimable_balances/000000000102030000000000000000000000000000000000000000000000000000000000/operations{?cursor,limit,order}",
"templated": true
},
"transactions": {
"href": "https://horizon.stellar.org/claimable_balances/000000000102030000000000000000000000000000000000000000000000000000000000/transactions{?cursor,limit,order}",
"templated": true
}
},
"id": "000000000102030000000000000000000000000000000000000000000000000000000000",
Expand Down
Loading

0 comments on commit 687f016

Please sign in to comment.