Closes the CDP having the given timestamp (height).
Before closing the CDP you must have opened it previously with MintHelper function openCdp (Chapter 6.2).
The Commercio SDK, our own open source tool to format transactions to Commercio.network.
- MintHelper closeCdp.
From Wikipedia:
A timestamp is a sequence of characters or encoded information identifying when a certain event occurred, usually giving date and time of day, sometimes accurate to a small fraction of a second.
- Execute the MintHelper closeCdp function.
Here's an example of the implemetation in all the available languages.
final response = await MintHelper.closeCdp(
757, wallet,
);
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 fee = StdFee(gas = "200000", amount = listOf(StdCoin(denom = "ucommercio", amount = "10000")))// optional
val mode = TxHelper.BroadcastingMode.BLOCK // optional
val response = MintHelper.closeCdp(
timestamp = 757, // to replace with height value in url $lcdUrl/txs/$txHash open in chapter6.2
wallet = wallet,
fee = fee, // optional
mode = mode // optional
)
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.closeCdp(757, wallet);