RESTful API
get
https://api.zks.app/v2
/:network/contract-address
Get Contract Address
get
https://api.zks.app/v2
/: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 native coin.
address
address
Native coin's address is 0x0000000000000000000000000000000000000000
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/v2
/: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/v2
/:network/pairs
Get Pair List
Field
Type
Comment
id
number
The unique ID starting from 16384.
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.
get
https://api.zks.app/v2
/: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/v2
/:network/account/:address/balances
Get Account Balance
get
https://api.zks.app/v2
/:network/account/:address/info
Get Account Info
get
https://api.zks.app/v2
/:network/account/:address/fee
Get Account Fee
get
https://api.zks.app/v2
/:network/txs
Get Transaction List
Each transaction contains the following fields:
Field
Type
Comment
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_token
number
The ID of transaction fee token.
fee
string
The transaction fee.
fee_value
string
The value of transaction fee 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/v2
/:network/tx/:tx_hash
Get Transaction
post
https://api.zks.app/v2
/:network/tx
Submit Transaction
Click here to see how to make a transaction.