Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emerald: add tokens api spec #224

Merged
merged 2 commits into from
Nov 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 47 additions & 1 deletion api/spec/v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,27 @@ paths:
'500':
$ref: '#/components/responses/ServerError'

/emerald/tokens:
get:
summary: Returns a list of ERC-20 tokens on Emerald.
parameters:
- *limit
- *offset
responses:
'200':
description: |
A JSON object containing a list of ERC-20 tokens on Emerald.
content:
application/json:
schema:
$ref: '#/components/schemas/RuntimeTokenList'
'400':
$ref: '#/components/responses/InvalidRequest'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/ServerError'

/consensus/stats/tps:
get:
summary: Returns the consensus layer TPS for each 5 minute interval.
Expand Down Expand Up @@ -1406,7 +1427,7 @@ components:
items:
$ref: '#/components/schemas/RuntimeTransaction'
description: |
A list of consensus transactions.
A list of runtime transactions.

RuntimeTransaction:
type: object
Expand Down Expand Up @@ -1475,6 +1496,31 @@ components:
description: |
A runtime transaction.

RuntimeTokenList:
type: object
properties:
tokens:
type: array
items:
$ref: '#/components/schemas/RuntimeToken'
description: |
A list of ERC-20 tokens on a runtime.

RuntimeToken:
type: object
properties:
token_addr:
mitjat marked this conversation as resolved.
Show resolved Hide resolved
type: string
description: The Oasis address of this token's contract.
example: 'oasis1qp2hssandc7dekjdr6ygmtzt783k3gn38uupdeys'
num_holders:
mitjat marked this conversation as resolved.
Show resolved Hide resolved
type: integer
format: int64
description: |
The number of addresses that have a nonzero balance of this token,
as calculated from Transfer events.
example: 123

TpsCheckpoints:
type: object
properties:
Expand Down