All Gas Fee Mapping
Returns the allGasFee Mapping.
Note: Rate limit for this API is 10req/min
Returns the all Gas Fee mapping
POST
https://api.onramp.money/onramp/api/v2/common/transaction/allGasFee
Headers
Name | Type | Description |
---|---|---|
X-ONRAMP-APIKEY* | String | Your api key |
X-ONRAMP-PAYLOAD* | String | payload generated for the request |
X-ONRAMP-SIGNATURE* | String | signature generated for the request |
{
"status": 1,
"code": 200,
"data": {
"0": {
"0": {
"withdrawalFee": "0.00019",
"minimumWithdrawal": "0.00041800",
"nodeInSync": 1,
"depositEnable": 1
},
"1": {
"withdrawalFee": "0.0000087",
"minimumWithdrawal": "0.00001870",
"nodeInSync": 1,
"depositEnable": 1
},
"5": {
"withdrawalFee": "0.0000036",
"minimumWithdrawal": "0.00000792",
"nodeInSync": 1,
"depositEnable": 1
},
"10002": {
"withdrawalFee": "0.00025",
"minimumWithdrawal": "0.00088000",
"nodeInSync": 1,
"depositEnable": 1
},
"10004": {
"withdrawalFee": "0.00062",
"minimumWithdrawal": "0.00165000",
"nodeInSync": 0,
"depositEnable": 1
},
"10116": {
"withdrawalFee": "0.00002",
"minimumWithdrawal": "0.00090",
"nodeInSync": 0,
"depositEnable": 1
},
"10172": {
"withdrawalFee": "0.0005",
"minimumWithdrawal": "0.00138",
"nodeInSync": 0,
"depositEnable": 1
}
},
"1": {
"0": {
"withdrawalFee": "15",
"minimumWithdrawal": "33.00",
"nodeInSync": 1,
"depositEnable": 1
},
"1": {
"withdrawalFee": "0.7",
"minimumWithdrawal": "1.54",
"nodeInSync": 1,
"depositEnable": 1
},
"5": {
"withdrawalFee": "0.29",
"minimumWithdrawal": "0.64",
"nodeInSync": 1,
"depositEnable": 1
},
"10007": {
"withdrawalFee": "0.2",
"minimumWithdrawal": "16.50",
"nodeInSync": 1,
"depositEnable": 1
}
},
}
}
Sample Request
var CryptoJS = require('crypto-js');
var axios = require('axios');
async function allGasFeeMapping() {
try {
let body = {}
let payload = {
timestamp: new Date().getTime(),
body
}
let apiKey = 'API_KEY', apiSecret = 'API_SECRET';
payload = Buffer.from(JSON.stringify(payload)).toString('base64');
let signature = CryptoJS.enc.Hex.stringify(CryptoJS.HmacSHA512(payload, apiSecret));
let options = {
url: 'https://api.onramp.money/onramp/api/v2/common/transaction/allGasFee',
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json;charset=UTF-8',
'X-ONRAMP-SIGNATURE': signature,
'X-ONRAMP-APIKEY': apiKey,
'X-ONRAMP-PAYLOAD': payload
},
data: body
};
let data = await axios(options)
console.log(data?.data);
} catch (error) {
console.log(error?.response?.data)
}
}
allGasFeeMapping();
import json
import requests
import hashlib
import hmac
from base64 import b64encode
from datetime import datetime
async def all_gas_fee_mapping():
try:
body = {}
payload = {
"timestamp": int(datetime.now().timestamp() * 1000),
"body": body
}
api_key = 'API_KEY'
api_secret = 'API_SECRET'
payload_base64 = b64encode(json.dumps(payload).encode()).decode()
signature = hmac.new(api_secret.encode(), payload_base64.encode(), hashlib.sha512).hexdigest()
url = 'https://api.onramp.money/onramp/api/v2/common/transaction/allGasFee'
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json;charset=UTF-8',
'X-ONRAMP-SIGNATURE': signature,
'X-ONRAMP-APIKEY': api_key,
'X-ONRAMP-PAYLOAD': payload_base64
}
options = {
'url': url,
'method': 'POST',
'headers': headers,
'json': body
}
response = await requests.post(**options)
print(response.json())
except Exception as error:
print(error)
await all_gas_fee_mapping()
{
"status": 1,
"code": 200,
"data": {
"0": {
"0": {
"withdrawalFee": "0.00019",
"minimumWithdrawal": "0.00041800",
"nodeInSync": 1,
"depositEnable": 1
},
"1": {
"withdrawalFee": "0.0000087",
"minimumWithdrawal": "0.00001870",
"nodeInSync": 1,
"depositEnable": 1
},
"5": {
"withdrawalFee": "0.0000036",
"minimumWithdrawal": "0.00000792",
"nodeInSync": 1,
"depositEnable": 1
},
"10002": {
"withdrawalFee": "0.00025",
"minimumWithdrawal": "0.00088000",
"nodeInSync": 1,
"depositEnable": 1
},
"10004": {
"withdrawalFee": "0.00062",
"minimumWithdrawal": "0.00165000",
"nodeInSync": 0,
"depositEnable": 1
},
"10116": {
"withdrawalFee": "0.00002",
"minimumWithdrawal": "0.00090",
"nodeInSync": 0,
"depositEnable": 1
},
"10172": {
"withdrawalFee": "0.0005",
"minimumWithdrawal": "0.00138",
"nodeInSync": 0,
"depositEnable": 1
}
},
"1": {
"0": {
"withdrawalFee": "15",
"minimumWithdrawal": "33.00",
"nodeInSync": 1,
"depositEnable": 1
},
"1": {
"withdrawalFee": "0.7",
"minimumWithdrawal": "1.54",
"nodeInSync": 1,
"depositEnable": 1
},
"5": {
"withdrawalFee": "0.29",
"minimumWithdrawal": "0.64",
"nodeInSync": 1,
"depositEnable": 1
},
"10007": {
"withdrawalFee": "0.2",
"minimumWithdrawal": "16.50",
"nodeInSync": 1,
"depositEnable": 1
}
},
}
}
Onramp Explanation
status -> 0 is for unsuccessful request, 1 is for a successful one.
data -> JSON with gasFee mapping will follow the structure (coinId: {chainId: {withdrawalFee, minimumWithdrawal, nodeInSync, depositEnable}}). This is the same coinId/chainId returned from allConfigMapping API.
Last updated