RESTful API
Last updated
Last updated
GET
https://api.zks.app/:version/:network/contract-address
Returns the contracts being used for deposit, etc. In most time, the response won't be changed.
Name | Type | Description |
---|---|---|
GET
https://api.zks.app/:version/:network/tokens
Returns all tokens which have been listed on ZKSwap.
Here's the schema of each token:
GET
https://api.zks.app/:version/:network/tokens/price
Returns all tokens' prices on ZKSwap.
GET
https://api.zks.app/:version/:network/pairs
Returns all pairs which have been added on ZKSwap.
GET
https://api.zks.app/:version/:network/pairs/price
Returns all pairs' prices on ZKSwap.
GET
https://api.zks.app/:version/:network/account/:address/balances
Returns the balances of an address. If the address never had a token/pair, it won't be listed. All the unit of asset is USD.
GET
https://api.zks.app/:version/:network/account/:address/info
Returns the id, nonce and pubKeyHash of the account. If the address never had any asset on ZKSwap, the id is 0.
GET
https://api.zks.app/:version/:network/account/:address/fee
All fees are in USD.
GET
https://api.zks.app/:version/:network/txs
Returns the list of transactions.
Each transaction contains the following fields:
GET
https://api.zks.app/:version/:network/tx/:tx_hash
Return the transaction data.
POST
https://api.zks.app/:network/tx
Submit the transaction to ZKSwap Layer-2. Returns the transaction hash if it's accepted.
Click here to see how to make a transaction.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
network
number
The network number. 1 for mainnet, 3 for ropsten, etc.
network
number
The network number. 1 for mainnet, 3 for ropsten, etc.
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.
network
number
The network number. 1 for mainnet, 3 for ropsten, etc.
Field
Type
Comment
id
number
The unique ID.
price
string
The unit is USD.
network
number
The network number. 1 for mainnet, 3 for ropsten, etc.
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.
network
number
The network number. 1 for mainnet, 3 for ropsten, etc.网
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
network
number
The network number. 1 for mainnet, 3 for ropsten, etc.
address
string
The account's address, which is case insensitive.
network
number
The network number. 1 for mainnet, 3 for ropsten, etc.
address
string
The account's address, which is case insensitive.
network
number
The network number. 1 for mainnet, 3 for ropsten, etc.
address
string
The account's address, which is case insensitive.
network
number
The network number. 1 for mainnet, 3 for ropsten, etc.
address
string
The transaction address. No matter it's sender or receiver.
types
string
The list of types, seperated with |. See below for all types. e.g. AddLiquidity|RemoveLiquidity
token
number
The unique ID of a token
start
number
Default 0.
limit
number
Default 50. Maximum 50.
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.
network
number
The network number. 1 for mainnet, 3 for ropsten, etc.
tx_hash
string
The transaction hash.
network
number
The network number. 1 for mainnet, 3 for ropsten, etc.
tx
object
The signed transaction data.
signature
object
Layer1 signature. For ChangePubKey, it should be null.
fastProcessing
boolean
null