Skip to main content

GasEstimatesResource

Access via urblock.gasEstimates.

Estimate gas costs before submitting blockchain operations. Useful for cost forecasting, UI display, and ensuring sufficient wallet balance.

Methods

estimate(params)

Estimate gas cost for an operation.

ParameterTypeRequiredDescription
operationstringYesOperation type: mint, transfer, burn, approve, deploy
token_idstringYesToken ID
tostringConditionalRecipient address (required for mint/transfer)
amountstringConditionalAmount in smallest unit (required for mint/transfer/burn)
fromstringConditionalSender address (required for transfer/burn)
const estimate = await urblock.gasEstimates.estimate({
operation: "mint",
token_id: "tok_abc123",
to: "0x...",
amount: "1000000000000000000",
});

console.log(estimate.gas_limit); // "21000"
console.log(estimate.gas_price_gwei); // "30"
console.log(estimate.estimated_cost_wei); // "630000000000000"
console.log(estimate.estimated_cost_eth); // "0.00063"

Returns: GasEstimateResponse

FieldTypeDescription
gas_limitstringEstimated gas units
gas_price_gweistringCurrent gas price in Gwei
estimated_cost_weistringEstimated cost in wei
estimated_cost_ethstringEstimated cost in ETH/MATIC

See Also