import { PopulatedTransaction, UnsignedTransaction, providers } from "ethers"; import { Environment, Transfer, TransferType } from '../../types'; import { BaseAssetTransfer } from '../BaseAssetTransfer'; import { EvmFee } from '.'; /** * Class used for sending ERC20 and ERC721 transfers from EVM based chains. * * * @example * const provider = new ethers.providers.JsonRpcProvider(''); * const wallet = new Wallet( * '', * provider, * ); * const assetTransfer = new EVMAssetTransfer(); * await assetTransfer.init(provider); * const domains = assetTransfer.config.getDomains(); * const resources = assetTransfer.config.getDomainResources(); * const transfer: Transfer = { * from: domains[0], * to: domains[1], * resource: resource[0], * sender: await wallet.getAddress(), * recipient: , * amount: { * amount: 200 * } * } * const fee = await assetTransfer.getFee(transfer); * const approvals = await assetTransfer.buildApprovals(transfer, fee); * const transferTx = await assetTransfer.buildTransferTransaction(transfer, fee); * for (const approval of approvals) { * await wallet.sendTransaction(approval); * } * await wallet.sendTransaction(trasnferTx); * */ export declare class EVMAssetTransfer extends BaseAssetTransfer { private provider; init(provider: providers.BaseProvider, environment: Environment | undefined, customConfigUrl: string): Promise; /** * Calculates fee required for the requested transfer. * Fee can be paid in native currency or ERC20 token if the 'tokenAddress' * is defined. * * @param transfer instance of transfer * @returns fee that needs to paid */ getFee(transfer: Transfer): Promise; /** * Builds approval transactions that are required before executing * deposit. Returns multiple approvals if fee is payed in ERC20 token. * * @param transfer requested transfer * @param fee Fee calculated by 'getFee' function * @returns array of unsigned approval transaction */ buildApprovals(transfer: Transfer, fee: EvmFee): Promise>; /** * Builds an unsigned transfer transaction. * Should be executed after the approval transactions. * * @param transfer * @param fee * @returns unsigned transfer transaction */ buildTransferTransaction(transfer: Transfer, fee: EvmFee): Promise; private getERC20Approvals; private getERC721Approvals; } //# sourceMappingURL=assetTransfer.d.ts.map