Skip to content

Latest commit

 

History

History
56 lines (42 loc) · 2.14 KB

mint-batch-tx.md

File metadata and controls

56 lines (42 loc) · 2.14 KB
description
Mint 𝔉rc20 token

Mint(batch) - tx

Example of Fixes Inscription data string:

op=mint,tick=fixes,amt=1000.0

Transaction parameters:

KeyRequiredFTypeDescription
ticktruet.StringTicker: identity of the 𝔉rc20 token
amttruet.UFix64Amount to mint: States the amount of the 𝔉rc20 token to mint. Has to be less or equal to "limit"
repeatstruet.UInt64How many times to repeat the mint action. Better less than or equal to 100 times.

Transaction code example:

import txBatchMintFRC20 from "@fixes/contracts/transactions/batch-mint-frc20.cdc?raw";
import txMintFRC20 from "@fixes/contracts/transactions/mint-frc20.cdc?raw";

async function mint(
  tick: string,
  amt: number,
  repeats: number = 1
) {
  let txid: string;
  if (repeats > 1) {
    txid = await flow.sendTransaction(txBatchMintFRC20, (arg, t) => [
      arg(tick, t.String),
      arg(amt.toFixed(8), t.UFix64),
      arg(repeats, t.UInt64),
    ]);
  } else {
    txid = await flow.sendTransaction(txMintFRC20, (arg, t) => [
      arg(tick, t.String),
      arg(amt.toFixed(8), t.UFix64),
    ]);
  }
  return txid;
}

Transaction source code

{% @github-files/github-code-block url="https://github.com/fixes-world/fixes/blob/main/cadence/transactions/batch-mint-frc20.cdc" %}

Or mint simple inscription

https://github.com/fixes-world/fixes/blob/main/cadence/transactions/mint-frc20.cdc

Related docs