RESTful API
get
https://api.zks.app
/:network/contract-address
Get Contract Address
get
https://api.zks.app
/:network/tokens
Get Token List
Here's the schema of each token:
Field | Type | Comment |
id | number | The unique ID starting from 0, which is ETH. |
address | address | 0x0000000000000000000000000000000000000000 is ETH. |
decimals | number | The number of decimals used to get its user representation. |
symbol | string | The unique symbol indicates the symbol. |
icon | string | The image url shows the icon. |
get
https://api.zks.app
/:network/tokens/price
Get Token Prices
Field | Type | Comment |
id | number | The unique ID . |
price | string | The unit is USD. |
get
https://api.zks.app
/:network/pairs
Get Pair List
Field | Type | Comment |
id | number | The unique ID starting from 128. |
address | address | It's the same as the LP token on Layer-1. |
decimals | number | The number of decimals used to get its user representation, it's always 18. |
symbol | string | The unique symbol follows the format liquidity_{idA}_{idB} . |
id_a | string | The ID of token A. |
id_b | string | The ID of token B. |
icon | string | |
get
https://api.zks.app
/:network/pairs/price
Get Pair Prices
Field | Type | Comment |
id | number | The unique ID. |
amount_a | string | The formatted amount of token A in the pair (also known as reverse0 ). |
amount_b | string | The formatted amount of token B in the pair (also known as reverse1 ). |
price | string | The number indicates how much 1 LP token values. |
totalSupply | string | |
get
https://api.zks.app
/:network/account/:address/balances
Get Account Balance
get
https://api.zks.app
/:network/account/:address/info
Get Account Info
get
https://api.zks.app
/:network/account/:address/fee
Get Account Fee
get
https://api.zks.app
/:network/txs
Get Transaction List
Each transaction contains the following fields:
Field | Type | Comment |
id | number | The unique ID. You should not use this. Use tx_hash instead. |
tx_hash | string | The hash of the transaction. |
tx_type | string | One of the following: Deposit , Transfer , Withdraw , Swap , AddLiquidity and RemoveLiquidity . |
status | string | pending or verified . |
from | address | The transaction sender. |
to | address | The transaction receiver. For Swap , AddLiquidity and RemoveLiquidity , the receiver is the pair address. |
token | object | It always contains id . For Swap , AddLiquidity and RemoveLiquidity , it contains id_a and id_b . |
amount | mixed | For Deposit , Withdraw and Transfer , it's the formatted amount. For other type, it's an object contains amount_a and amount_b . |
value | string | The value of transaction in USD. |
fee | string | The transaction fee. |
fee_value | string | The value of transaction fee in USD. |
fee_b | string | The transaction fee B. |
fee_b_value | string | The value of transaction fee B in USD. |
block_number | number | The block it belongs |
created_at | number | The UNIX timestamp when the transaction created. |
success | boolean | Indicates the transaction is successful or not. |
fail_reason | string | Only contains message when transaction failed. |
nonce | number | Similar with ETH's nonce. |
get
https://api.zks.app
/:network/tx/:tx_hash
Get Transaction
post
https://api.zks.app
/:network/tx
Submit Transaction
Last modified 1yr ago