import { Address, Asset, BaseAmount } from '@xchainjs/xchain-util'; import { Signer, InterfaceAbi, Provider } from 'ethers'; import BigNumber from 'bignumber.js'; export declare const MAX_APPROVAL: BigNumber; /** * Validate the given address. * * @param {Address} address * @returns {boolean} `true` or `false` */ export declare const validateAddress: (address: Address) => boolean; /** * Get token address from asset. * * @param {Asset} asset * @returns {Address|null} The token address. */ export declare const getTokenAddress: (asset: Asset) => Address | null; /** * Check if the symbol is valid. * * @param {string|null|undefined} symbol * @returns {boolean} `true` or `false`. */ export declare const validateSymbol: (symbol?: string | null) => boolean; /** * Calculate fees by multiplying . * * @returns {BaseAmount} The default gas price. */ export declare const getFee: ({ gasPrice, gasLimit, decimals, }: { gasPrice: BaseAmount; gasLimit: BigNumber; decimals: number; }) => BaseAmount; /** * Get address prefix based on the network. * * @returns {string} The address prefix based on the network. * **/ export declare const getPrefix: () => string; /** * Filter self txs * * @returns {T[]} * **/ export declare const filterSelfTxs: (txs: T[]) => T[]; /** * Returns approval amount * * If amount is not provided, returns `MAX_APPROVAL`. * An explicit amount (including zero) is returned as-is, enabling revocation. */ export declare const getApprovalAmount: (amount?: BaseAmount) => BigNumber; /** * Call a contract function. * * @param {Provider} provider Provider to interact with the contract. * @param {Address} contractAddress The contract address. * @param {ContractInterface} abi The contract ABI json. * @param {string} funcName The function to be called. * @param {unknown[]} funcParams The parameters of the function. * @returns {BigNumber} The result of the contract function call. */ export declare const estimateCall: ({ provider, contractAddress, abi, funcName, funcParams, }: { provider: Provider; contractAddress: Address; abi: InterfaceAbi; funcName: string; funcParams?: unknown[]; }) => Promise; /** * Calls a contract function. * * @param {Provider} provider Provider to interact with the contract. * @param {signer} Signer of the transaction (optional - needed for sending transactions only) * @param {Address} contractAddress The contract address. * @param {ContractInterface} abi The contract ABI json. * @param {string} funcName The function to be called. * @param {unknow[]} funcParams (optional) The parameters of the function. * * @returns {T} The result of the contract function call. */ export declare const call: ({ provider, signer, contractAddress, abi, funcName, funcParams, }: { provider: Provider; signer?: Signer; contractAddress: Address; abi: InterfaceAbi; funcName: string; funcParams?: unknown[]; }) => Promise; /** * Estimate gas for calling `approve`. * * @param {Provider} provider Provider to interact with the contract. * @param {Address} contractAddress The contract address. * @param {Address} spenderAddress The spender address. * @param {Address} fromAddress The address a transaction is sent from. * @param {BaseAmount} amount (optional) The amount of token. By default, it will be unlimited token allowance. * * @returns {BigNumber} Estimated gas */ export declare function estimateApprove({ provider, contractAddress, spenderAddress, fromAddress, abi, amount, }: { provider: Provider; contractAddress: Address; spenderAddress: Address; fromAddress: Address; abi: InterfaceAbi; amount?: BaseAmount; }): Promise; /** * Check allowance. * * @param {Provider} provider Provider to interact with the contract. * @param {Address} contractAddress The contract (ERC20 token) address. * @param {Address} spenderAddress The spender address (router). * @param {Address} fromAddress The address a transaction is sent from. * @param {BaseAmount} amount The amount to check if it's allowed to spend or not (optional). * @param {number} walletIndex (optional) HD wallet index * @returns {boolean} `true` or `false`. */ export declare function isApproved({ provider, contractAddress, spenderAddress, fromAddress, amount, }: { provider: Provider; contractAddress: Address; spenderAddress: Address; fromAddress: Address; amount?: BaseAmount; }): Promise; /** * Removes `0x` or `0X` from address */ export declare const strip0x: (addr: Address) => string;