axelar-gmp-sdk-solidity

Solidity API

IInterchainGasEstimation

This is an interface for the InterchainGasEstimation contract which allows for estimating gas fees for cross-chain communication on the Axelar network.

UnsupportedEstimationType

error UnsupportedEstimationType(enum GasEstimationType gasEstimationType)

GasInfoUpdated

event GasInfoUpdated(string chain, struct GasInfo info)

Event emitted when the gas price for a specific chain is updated.

Parameters

Name Type Description
chain string The name of the chain
info struct GasInfo The gas info for the chain

getGasInfo

function getGasInfo(string chain) external view returns (struct GasInfo)

Returns the gas price for a specific chain.

Parameters

Name Type Description
chain string The name of the chain

Return Values

Name Type Description
[0] struct GasInfo gasInfo The gas info for the chain

estimateGasFee

function estimateGasFee(string destinationChain, string destinationAddress, bytes payload, uint256 executionGasLimit, bytes params) external view returns (uint256 gasEstimate)

Estimates the gas fee for a cross-chain contract call.

Parameters

Name Type Description
destinationChain string Axelar registered name of the destination chain
destinationAddress string Destination contract address being called
payload bytes  
executionGasLimit uint256 The gas limit to be used for the destination contract execution, e.g. pass in 200k if your app consumes needs upto 200k for this contract call
params bytes Additional parameters for the gas estimation

Return Values

Name Type Description
gasEstimate uint256 The cross-chain gas estimate, in terms of source chain’s native gas token that should be forwarded to the gas service.