Let's perform another important task:
Send CCC to another account.
Send a Commercio Cash Credit to another account
The Commercio SDK, our own open source tool to format transactions to Commercio.network
- TxHelper createSignAndSendTx.
- Set up the amounts list;
- Set up the messages list;
- Finally, execute the TxHelper createSignAndSendTx function to send the token.
Here's an example of the implementation in all the available languages.
final amount = [const StdCoin(denom: 'ucommercio', amount: '500')];
final msgs = [
MsgSend(
amount: amount,
fromAddress: "did:com:1z6ezqssnqqc6un3henna0flr05aukcwcr5ge6t",
toAddress: "did:com:150jp3tx96frukqg6v870etf02q0cp7em78wu48",
),
];
final response = await TxHelper.createSignAndSendTx(
msgs,
wallet,
fee: StdFee(
gas: '200000',
amount: [
const StdCoin(
denom: 'ucommercio', amount: '10000'
),
],
),
mode: BroadcastingMode.SYNC,
);
val amount = listOf(StdCoin(denom = "ucommercio", amount = "500"))
val msgs = listOf(
MsgSend(
amount = amount,
fromAddress = wallet.bech32Address,
toAddress = "did:com:14ttg3eyu88jda8udvxpwjl2pwxemh72w0grsau"
)
)
val fee = StdFee(gas = "200000", amount = listOf(StdCoin(denom = "ucommercio", amount = "10000"))) // optional
val mode = TxHelper.BroadcastingMode.SYNC // optional
val response = TxHelper.createSignAndSendTx(
msgs = msgs,
wallet = wallet,
fee = fee, // optional
mode = mode // optional
)