# 6.5 Send a Credit (CCC) to another address

Let's perform another important task:

Send CCC to another account.

# Use cases

Send a Commercio Cash Credit to another account

# Tools

The Commercio SDK, our own open source tool to format transactions to Commercio.network

# Functions and APIs

  • TxHelper createSignAndSendTx.

# Step by step sequence

  1. Set up the amounts list;
  2. Set up the messages list;
  3. Finally, execute the TxHelper createSignAndSendTx function to send the token.

# Code Examples

Here's an example of the implementation in all the available languages.

# Dart

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,
);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

# Kotlin

 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
)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19