wallet
Estimate network fee from blockchain (all supported chains; not controlled by Mudbase)
**Network fee (from blockchain only).** Returns network fee **estimated directly from the blockchain** via RPC or fee APIs. **Not controlled by Mudbase.** Both POST /api/wallet/estimate-network-fee (or calculate-fee) and this endpoint return network fee only; use either for gas/fee display. This endpoint is chain-oriented and supports full transaction shape for EVM. **EVM chains:** ethereum, polygon, arbitrum, optimism, base, bsc, binance, avalanche, celo — require `transaction` (from, and to/value or tokenAddress/amount). Response includes gasLimit, gasPrice, networkFee, estimatedTime, currency. **Non-EVM chains:** bitcoin, litecoin, dogecoin, solana, tron, ton, cardano — only `chain` is required; `transaction` is optional/ignored. Returns networkFee, estimatedTime, currency (and e.g. satPerVb for UTXO). See docs/FEE_ARCHITECTURE.md. Results cached 15s.
/api/wallet/non-custodial/estimate-gasAuthentication
Authorization: Bearer YOUR_TOKEN header (user-facing apps, RBAC). View authentication guide →Request Body
Chain and optional transaction shape (required for EVM). Returns network fee from blockchain.
{
"chain": "arbitrum",
"transaction": {
"from": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"to": "0x53d284357ec70cE289D6D64134DfAc8E511c8a3D",
"value": "1.0",
"data": "0xa9059cbb000000000000000000000000...",
"tokenAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"amount": "1.0"
}
}{
"chain": "arbitrum",
"transaction": {
"from": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"to": "0x53d284357ec70cE289D6D64134DfAc8E511c8a3D",
"value": "1.0",
"data": "0xa9059cbb000000000000000000000000...",
"tokenAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"amount": "1.0"
}
}SDK setup
Create a client and set credentials (JWT and/or API key) before calling the API. Match the authentication type shown above.
import { MudbaseClient } from "mudbase";
const client = new MudbaseClient();
client.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfbW9yZ2FuX2RlIiwiZW1haWwiOiJtb3JnYW4uY2hlbkBub3J0aHdpbmQuZGV2IiwiZXhwIjoxODI1MTI5NjAwfQ.doc_preview_sig");import { MudbaseClient } from "mudbase";
const client = new MudbaseClient();
client.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfbW9yZ2FuX2RlIiwiZW1haWwiOiJtb3JnYW4uY2hlbkBub3J0aHdpbmQuZGV2IiwiZXhwIjoxODI1MTI5NjAwfQ.doc_preview_sig");Example request
Call this endpoint using the client from SDK setup. Use View HTTP for a raw cURL example.
const result = await client.wallet.estimateGas({
chain: "card quantify",
transaction: "sensor calculate"
});const result = await client.wallet.estimateGas({
chain: "card quantify",
transaction: "sensor calculate"
});Try It Live
Test this endpoint with your own credentials. Your requests will be sent to the live API.
No Request Yet
Send a request to see the full inspector
Responses
Ethereum (ETH) — from RPC
{
"success": true,
"data": {
"chain": "ethereum",
"gasLimit": "21000",
"gasPrice": "30000000000",
"gasPriceGwei": 30,
"estimatedCost": "630000000000000",
"networkFee": "0.00063 ETH",
"estimatedTime": "15 seconds",
"currency": "ETH"
}
}{
"success": true,
"data": {
"chain": "ethereum",
"gasLimit": "21000",
"gasPrice": "30000000000",
"gasPriceGwei": 30,
"estimatedCost": "630000000000000",
"networkFee": "0.00063 ETH",
"estimatedTime": "15 seconds",
"currency": "ETH"
}
}Polygon (MATIC)
{
"success": true,
"data": {
"chain": "polygon",
"gasLimit": "21000",
"gasPrice": "50000000000",
"gasPriceGwei": 50,
"estimatedCost": "1050000000000000",
"networkFee": "0.00105 MATIC",
"estimatedTime": "15 seconds",
"currency": "MATIC"
}
}{
"success": true,
"data": {
"chain": "polygon",
"gasLimit": "21000",
"gasPrice": "50000000000",
"gasPriceGwei": 50,
"estimatedCost": "1050000000000000",
"networkFee": "0.00105 MATIC",
"estimatedTime": "15 seconds",
"currency": "MATIC"
}
}Arbitrum One (ETH)
{
"success": true,
"data": {
"chain": "arbitrum",
"gasLimit": "21000",
"gasPrice": "100000000",
"gasPriceGwei": 0.1,
"estimatedCost": "2100000000000",
"networkFee": "0.0000021 ETH",
"estimatedTime": "15 seconds",
"currency": "ETH"
}
}{
"success": true,
"data": {
"chain": "arbitrum",
"gasLimit": "21000",
"gasPrice": "100000000",
"gasPriceGwei": 0.1,
"estimatedCost": "2100000000000",
"networkFee": "0.0000021 ETH",
"estimatedTime": "15 seconds",
"currency": "ETH"
}
}Optimism (ETH)
{
"success": true,
"data": {
"chain": "optimism",
"gasLimit": "21000",
"gasPrice": "1000000",
"gasPriceGwei": 0.001,
"estimatedCost": "21000000000",
"networkFee": "0.000000021 ETH",
"estimatedTime": "15 seconds",
"currency": "ETH"
}
}{
"success": true,
"data": {
"chain": "optimism",
"gasLimit": "21000",
"gasPrice": "1000000",
"gasPriceGwei": 0.001,
"estimatedCost": "21000000000",
"networkFee": "0.000000021 ETH",
"estimatedTime": "15 seconds",
"currency": "ETH"
}
}Base (ETH)
{
"success": true,
"data": {
"chain": "base",
"gasLimit": "21000",
"gasPrice": "1000000000",
"gasPriceGwei": 0.001,
"estimatedCost": "21000000000000",
"networkFee": "0.000021 ETH",
"estimatedTime": "15 seconds",
"currency": "ETH"
}
}{
"success": true,
"data": {
"chain": "base",
"gasLimit": "21000",
"gasPrice": "1000000000",
"gasPriceGwei": 0.001,
"estimatedCost": "21000000000000",
"networkFee": "0.000021 ETH",
"estimatedTime": "15 seconds",
"currency": "ETH"
}
}BNB Smart Chain (BNB)
{
"success": true,
"data": {
"chain": "bsc",
"gasLimit": "21000",
"gasPrice": "5000000000",
"gasPriceGwei": 5,
"estimatedCost": "105000000000000",
"networkFee": "0.000105 BNB",
"estimatedTime": "15 seconds",
"currency": "BNB"
}
}{
"success": true,
"data": {
"chain": "bsc",
"gasLimit": "21000",
"gasPrice": "5000000000",
"gasPriceGwei": 5,
"estimatedCost": "105000000000000",
"networkFee": "0.000105 BNB",
"estimatedTime": "15 seconds",
"currency": "BNB"
}
}Avalanche C-Chain (AVAX)
{
"success": true,
"data": {
"chain": "avalanche",
"gasLimit": "21000",
"gasPrice": "25000000000",
"gasPriceGwei": 25,
"estimatedCost": "525000000000000",
"networkFee": "0.000525 AVAX",
"estimatedTime": "15 seconds",
"currency": "AVAX"
}
}{
"success": true,
"data": {
"chain": "avalanche",
"gasLimit": "21000",
"gasPrice": "25000000000",
"gasPriceGwei": 25,
"estimatedCost": "525000000000000",
"networkFee": "0.000525 AVAX",
"estimatedTime": "15 seconds",
"currency": "AVAX"
}
}Celo (CELO)
{
"success": true,
"data": {
"chain": "celo",
"gasLimit": "21000",
"gasPrice": "1000000000",
"gasPriceGwei": 1,
"estimatedCost": "21000000000000",
"networkFee": "0.000021 CELO",
"estimatedTime": "15 seconds",
"currency": "CELO"
}
}{
"success": true,
"data": {
"chain": "celo",
"gasLimit": "21000",
"gasPrice": "1000000000",
"gasPriceGwei": 1,
"estimatedCost": "21000000000000",
"networkFee": "0.000021 CELO",
"estimatedTime": "15 seconds",
"currency": "CELO"
}
}Bitcoin (BTC) — non-EVM
{
"success": true,
"data": {
"chain": "bitcoin",
"networkFee": "0.00002500 BTC",
"estimatedTime": "10–30 minutes",
"satPerVb": 15,
"feeSat": 3750
}
}{
"success": true,
"data": {
"chain": "bitcoin",
"networkFee": "0.00002500 BTC",
"estimatedTime": "10–30 minutes",
"satPerVb": 15,
"feeSat": 3750
}
}Solana (SOL) — non-EVM
{
"success": true,
"data": {
"chain": "solana",
"networkFee": "0.000005 SOL",
"lamports": 5000,
"estimatedTime": "15 seconds",
"currency": "SOL"
}
}{
"success": true,
"data": {
"chain": "solana",
"networkFee": "0.000005 SOL",
"lamports": 5000,
"estimatedTime": "15 seconds",
"currency": "SOL"
}
}Tron (TRX) — non-EVM
{
"success": true,
"data": {
"chain": "tron",
"networkFee": "1 TRX",
"estimatedTime": "3 seconds",
"currency": "TRX"
}
}{
"success": true,
"data": {
"chain": "tron",
"networkFee": "1 TRX",
"estimatedTime": "3 seconds",
"currency": "TRX"
}
}Errors
| Code | Meaning |
|---|---|
400 | Bad request or validation error. |
401 | Authentication required or invalid token. |
429 | Rate limit exceeded. |