UNPKG

barterjs-sdk

Version:
33 lines (32 loc) 1.99 kB
import { IMapCrossChainService } from '../interfaces/IMapCrossChainService'; import { BarterTransactionResponse } from '../../types/responseTypes'; import { TransferOutOptions } from '../../types'; import { BarterContractType, BarterProviderType } from '../../types/paramTypes'; export declare class EVMCrossChainService implements IMapCrossChainService { contract: BarterContractType; provider: BarterProviderType; constructor(contractAddress: string, abi: any, signerOrProvider: BarterProviderType); /** * transfer out token(not native coin) from source chain to designated token on target chain * @param fromAddress * @param tokenAddress input token address * @param amount amount in minimal unit * @param toAddress target chain receiving address * @param toChainId target chain id * @param options */ doTransferOutToken(fromAddress: string, tokenAddress: string, amount: string, toAddress: string, toChainId: string, options: TransferOutOptions): Promise<BarterTransactionResponse>; gasEstimateTransferOutToken(fromAddress: string, tokenAddress: string, amount: string, toAddress: string, toChainId: string): Promise<string>; /** * transfer out native coin from source chain to designated token on target chain * @param fromAddress * @param toAddress target chain receiving address * @param toChainId target chain id * @param amount amount to bridge in minimal unit * @param options */ doTransferOutNative(fromAddress: string, toAddress: string, toChainId: string, amount: string, options: TransferOutOptions): Promise<BarterTransactionResponse>; gasEstimateTransferOutNative(fromAddress: string, toAddress: string, toChainId: string, amount: string): Promise<string>; doDepositOutToken(tokenAddress: string, from: string, to: string, amount: string): Promise<string>; doSetCanBridgeToken(tokenAddress: string, toChainId: string, canBridge: boolean): Promise<void>; }