# 6.2 Opening a Collateral Debt Position: mint CCC

# Use cases

Opens a new CDP depositing the given Commercio Token amount.

# Tools

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

# Functions and APIs

  • MintHelper openCdp.

# Background

From Wikipedia:

A blockchain account can provide functions other than making payments, for example in decentralized applications or smart contracts. In this case, the units or coins are sometimes referred to as crypto tokens (or cryptotokens).

# Step by step sequence

  1. Execute the MintHelper openCdp function.

# Code Examples

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

# Dart

final response = await MintHelper.openCdp(
  100, wallet,
);
1
2
3

# Kotlin

val networkInfo = NetworkInfo(
    bech32Hrp = "did:com:",
    lcdUrl = "http://localhost:1317")

val mnemonic = listOf("curve", "attend", "elephant", "garage", "tide", "neither", "enforce", "auction", "dumb", "brief", "divert", "creek", "palm", "equip", "festival", "spice", "race", "message", "domain", "seed", "ship", "hunt", "mercy", "mail")

val wallet = Wallet.derive(mnemonic = mnemonic, networkInfo = networkInfo)

val commercioTokenAmount = 100_000.toUInt()
val fee = StdFee(gas = "200000", amount = listOf(StdCoin(denom = "ucommercio", amount = "10000")))
MintHelper.openCdp(commercioTokenAmount = commercioTokenAmount, wallet = wallet, fee = fee)

1
2
3
4
5
6
7
8
9
10
11
12

# C#

static commercio.sacco.lib.NetworkInfo networkInfo = new commercio.sacco.lib.NetworkInfo(
                bech32Hrp: "did:com:",
                lcdUrl: "http://localhost:1317"
              );

String mnemonicString = "curve attend elephant garage tide neither enforce auction dumb brief divert creek palm equip festival spice race message domain seed ship hunt mercy mail";
List<String> mnemonic = new List<String>(mnemonicString.Split(" ", StringSplitOptions.RemoveEmptyEntries));

var wallet = commercio.sacco.lib.Wallet.derive(mnemonic, networkInfo);

var res = commercio.sdk.MintHelper.openCdp(100000, wallet);
1
2
3
4
5
6
7
8
9
10
11