If you have multiple senders and/or multiple recipients, you can use MsgMultiSend, which can batch together the senders and recipients in one message to save on gas fees.
Specify the senders and recipients and their corresponding deposit contribution / receiving amounts with MsgMultiSend.Input or MsgMultiSend.Output.
Example:
import { MsgMultiSend } from "@terra-money/terra.js";const inputs: MsgMultiSend.Input[] = [ new MsgMultiSend.Input( 'terra105rz2q5a4w7nv7239tl9c4px5cjy7axx3axf6p', { ukrw: 123123, }) ), new MsgMultiSend.Input('terra105rz2q5a4w7nv7239tl9c4px5cjy7axx3axfad', [ new Coin('uluna', 123123), ]), ]; const outputs: MsgMultiSend.Output[] = [ new MsgMultiSend.Output( 'terra105rz2q5a4w7nv7239tl9c4px5cjy7axx3axfad', { ukrw: 123123, } ), new MsgMultiSend.Output('terra105rz2q5a4w7nv7239tl9c4px5cjy7axx3axfga', { uluna: 123123, } ), ]; const multisend = new MsgMultiSend(inputs, outputs);
inputs
outputs
If you have multiple senders and/or multiple recipients, you can use MsgMultiSend, which can batch together the senders and recipients in one message to save on gas fees.
Specify the senders and recipients and their corresponding deposit contribution / receiving amounts with MsgMultiSend.Input or MsgMultiSend.Output.
Example: