Closed zemyblue closed 3 months ago
How to Use
export interface SwapAndBridgeOptions { readonly gas?: StdFee | number; readonly memo?: string; /** The balance to swap and bridge. */ readonly amount?: string | number; /** Set broadcast mode. If true, BROADCAST_ASYNC_MODE, if false, BROADCAST_SYNC_MODE */ readonly asyncBroadcast?: boolean; } // swapAndBridge define public async swapAndBridge( senderAddress: string, toAddress: string, { gas = 150_000, memo = "", amount = undefined, asyncBroadcast = false }: SwapAndBridgeOptions = {}, ): Promise<Uint8Array | DeliverTxResponse> // Usage const fromAddr = "link146asaycmtydq45kxc8evntqfgepagygelel00h"; const toAddr = "0xf7bAc63fc7CEaCf0589F25454Ecf5C2ce904997c"; // If you swap and bridge all balance. const result = await client.swapAndBridge(fromAddr, toAddr); // if you swap and bridge part of the balance. const result2 = await client.swapAndBridge(fromAddr, toAddr, { amount: 500_000 }); // if you want to broadcast tx in async mode const result3 = await client.swapAndBridge(from, toAddr, { asyncBroadcast: true });
CHANGELOG.md
Description
How to Use
Motivation and context
How has this been tested?
Screenshots (if appropriate):
Checklist:
CHANGELOG.md
.