exporttypeButterTransactionOption= { signerOrProvider?: Signer | Provider | Eth; // When source chain is EVM provide Ethers.js Signer/Provider or Web3.js Eth info
nearProvider?:NearProviderType; // mandatory when src chain is near gas?:string; gasPrice?:string;};
signerOrProvider: Butter supports both ethers.js and web3.js. If you are using ethers.js, provider the Signer object. If your application choose to use web3.js, please provide Eth object in order to send a transaction.
nearProvider: Whenever send a transaction from Near Protocol, you have to provide NearNetworkConfig with keystore provided or WalletConnection object
export type NearProviderType = NearNetworkConfig | WalletConnection;
interfaceVaultBalance { token:BaseCurrency; // token in vault balance:string; // amount of token in vault on target chain isMintable:boolean; // if token is mintable by Butter}
exportinterfaceButterFee { feeToken:BaseCurrency; // the token that to be charged amount:string; // in minimal unit feeRate:ButterFeeRate; // fee rate inforamtion feeDistribution?:ButterFeeDistribution; // fee distribution inforamtion}
exporttypeButterFeeRate= { lowest:string; // lowest AMOUNT of fee token to be charged highest:string; // highest AMOUNT of fee token to be charged rate:string; // fee rate in bps};
Response datatype when invoke cross-chain transaction
exportinterfaceButterTransactionResponse { hash:string;wait?: () =>Promise<ButterTransactionReceipt>; promiReceipt?:PromiEvent<Web3TransactionReceipt>; // only when use web3.js}
promiReceipt is only available when you are using web.js.