get withdraw fee info
Retrieve the withdrawal fee details for the asset. Note: If the asset supports cross-chain interoperability, be sure to provide the root asset ID, along with the target chain and chain network parameters.
Query parameters
RootAssetIdstringOptional
TargetChainstringOptional
TargetChainNetworkstringOptional
Responses
200
OK
400
Bad Request
401
Unauthorized
403
Forbidden
404
Not Found
500
Internal Server Error
501
Not Implemented
get
GET /v1/asset/withdrawal-fee HTTP/1.1
Host: testnetopenapi.hibit.app
Accept: */*
{
"code": 1,
"message": "text",
"data": {
"rootAssetId": "text",
"targetAssetId": "text",
"feeRate": "text",
"rateDecimal": "text",
"minFee": "text"
}
}
Code example
import {
hibitClient,
HibitNetwork,
Chain,
ChainNetwork,
MetaMaskWalletApi
} from '@delandlabs/hibit-sdk';
// Set up client options
hibitClient.setOptions({
network: HibitNetwork.Testnet, // or HibitNetwork.Mainnet
});
async function fetchWithdrawFee() {
const assetId = BigInt('10001');
const targetChain = Chain.Ethereum;
const targetChainNetwork = ChainNetwork.EvmMainNet;
try {
const feeInfo = await hibitClient.getWithdrawFee({
rootAssetId: assetId,
targetChain,
targetNetwork: targetChainNetwork
});
console.log('Withdraw fee info:', feeInfo);
} catch (err) {
console.error('Failed to fetch withdraw fee:', err);
}
}
fetchWithdrawFee();
SDK
Source code https://github.com/Deland-Labs/hibit-sdk
Last updated