import { ethers } from 'ethers'; import { EvmFee, OracleResource } from '../types/index.js'; /** * Creates feeData structure with the following parameters. * * @category Fee * @param {object} oracleResponse - Response received from the Oracle resource. * @param {string} amount - Amount in string format. * @returns {string} - Returns the oracleMessage, signature and amount. */ export declare const createOracleFeeData: (oracleResponse: OracleResource, amount: string) => string; /** * Calculates the dynamic fee for a transaction using the provided parameters and the Fee Oracle. * * @example * import { ethers } from 'ethers'; * import { calculateDynamicFee } from '@buildwithsygma/sygma-sdk/EVM'; * // also you can use valid alchemy API KEY * const provider = new ethers.providers.JsonRpcProvider('https://mainnet.infura.io/v3/YOUR-PROJECT-ID'); * const result = await calculateDynamicFee({ * provider, * sender: '0x123...', * recipientAddress: '0x456...', * fromDomainID: 1, * toDomainID: 2, * resourceID: '0x0000000...123', * tokenAmount: '1000', * feeOracleBaseUrl: 'https://fee-oracle.example.com/', * feeHandlerAddress: '0x789...', * }); * console.log(result); * // { * // type: 'feeOracle', * // fee: BigNumber { _hex: '0x...' }, * // calculatedRate: '0.000000000000000001', * // erc20TokenAddress: '0x...', * // feeData: '0x...', * // } * * @category Fee * @param {Object} options - An object containing the following properties: * @param {ethers.providers.Provider} options.provider - The ethers provider to use. * @param {string} options.sender - The address of the sender. * @param {string} options.recipientAddress - The address of the recipient. * @param {number} options.fromDomainID - The domainId of the home network * @param {number} options.toDomainID - The domainId of the destination network * @param {string} options.resourceID - The resourceId of the token/asset * @param {string} options.tokenAmount - The amount of tokens being transferred. * @param {string} options.feeOracleBaseUrl - The base URL of the Fee Oracle. * @param {string} options.feeHandlerAddress - The address of dynamic fee handler * @returns {Promise} The result of the calculation, containing the fee, calculated rate, ERC20 token address, fee data, and type. */ export declare const calculateDynamicFee: ({ provider, sender, recipientAddress, fromDomainID, toDomainID, resourceID, tokenAmount, feeOracleBaseUrl, feeHandlerAddress, }: { provider: ethers.providers.Provider; sender: string; recipientAddress: string; fromDomainID: number; toDomainID: number; resourceID: string; tokenAmount: string; feeOracleBaseUrl: string; feeHandlerAddress: string; }) => Promise; /** * Fetches oracle resource data from the FeeOracle service. * * @category Fee * @param {Object} options - The options for the request. * @param {string} options.feeOracleBaseUrl - The base URL for the FeeOracle service. * @param {number} options.fromDomainID - The domain ID of the sending domain. * @param {number} options.toDomainID - The domain ID of the receiving domain. * @param {string} options.resourceID - The ID of the requested resource. * @param {number} [options.msgGasLimit=0] - The gas limit for the message (optional, defaults to 0). * @return {Promise} - A Promise that resolves to the OracleResource data, or undefined if it is not available. */ export declare const requestFeeFromFeeOracle: ({ feeOracleBaseUrl, fromDomainID, toDomainID, resourceID, msgGasLimit, }: { feeOracleBaseUrl: string; fromDomainID: number; toDomainID: number; resourceID: string; msgGasLimit?: number | undefined; }) => Promise; //# sourceMappingURL=dynamicFee.d.ts.map