exporttypeBridgeRequestParam= { fromAddress:string; // from address fromToken:BaseCurrency; // token to be bridged fromChainId:string; // from chain id toChainId:string; // to chain id toAddress:string; // destination chain receiving address amount:string; // amount to bridge in minimal uint options:ButterTransactionOption; // options};
Where ButterTransactionOption contains all the necessary information required to complete a bridge transaction:
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;};// when send transaction from Near ProtocoltypeNearProviderType=NearNetworkConfig|WalletConnection;
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