L
L
Loopring Dev Docs
Search…
⌃K

GET ERC20 Offchain Fee

get fee of updateAccount, transfer, withdraw. etc

EndPoint

GET api/v3/user/offchainFee
Field
Description
Example
X-API-KEY
ApiKey
"HlkcGxbqBeaF76j4rvPaOasyfPwnkQ6B6DQ6THZWbvrAGxzEdulXQvOKLrRWZLnN"

Request

Field
Description
Example
accountId
Account ID
10110
requestType
Off-chain request type Allowable : ['0:ORDER', '1:OFFCHAIN_WITHDRAWAL', '2:UPDATE_ACCOUNT', '3:TRANSFER', '4:FAST_OFFCHAIN_WITHDRAWAL', '5:OPEN_ACCOUNT', '6:AMM_EXIT', '7:DEPOSIT', '8:AMM_JOIN', '15:TRANSFER_AND_UPDATE_ACCOUNT']
1
tokenSymbol
(Optional)The token symbol, needed when requestType is 1 or 4
"LRC"
amount
(Optional) The amount to withdraw
"10000000000000"

Response

Field
Description
Example
gasPrice
gasPrice when calculate the fee
2194508101
fees
List[TokenFee]

Model

TokenFee

Field
Description
Example
token
fee token
"ETH"
fee
fee amount
"200000000000 0000"
discount
token discount. 0.8 means 80% of original fee
1.0

Example

Header

X-API-KEY = bEef7a3Nzk7lgaHm85E0O1JO5ufu0iQ96p3bCmrsZz8TLGG83jTpPDYwcjUC0vlF

Request

GET api/v3/user/offchainFee
https://uat2.loopring.io/api/v3/user/offchainFee?accountId=11329&requestType=2

Response

{
"gasPrice": "1500000008",
"fees": [{
"token": "ETH",
"fee": "26400000000000",
"discount": 1
},
{
"token": "LRC",
"fee": "121500000000000000",
"discount": 0.8
},
{
"token": "USDT",
"fee": "150900",
"discount": 0.8
},
{
"token": "DAI",
"fee": "188600000000000000",
"discount": 1
}
]
}