How to mint fungible token?

  • mint

This function is used to mint new tokens and assigns them to an account.

import { L1XProvider, FTTokenMintArg } from "@l1x/l1x-wallet-sdk";

let l1xProvider = new L1XProvider({
  clusterType: "mainnet",
    endpoint: "https://v2-mainnet-rpc.l1x.foundation",

});

let params: FTTokenMintArg = {
    attrib: {
        contract_address: '2e15a979ebc2de6ebafb373dae52e0c1809096c9',
        recipient_address: '346fb07c43e88b58c058e8d6c4bf2f5080a01999',
        value: 10000000000
    },
    private_key: 'YOUR_PRIVATE_KEY',
    fee_limit: 1
};

l1xProvider.tokens.FT.mint(params)
  .then((response) => console.log(response)) // log response
  .catch((err) => console.error(err)); // log error

Parameters:

Mint fungible token requests parameter

{
    attrib: {
        contract_address: '2e15a979ebc2de6ebafb373dae52e0c1809096c9',
        recipient_address: '346fb07c43e88b58c058e8d6c4bf2f5080a01999',
        value: 10000000000
    },
    private_key: 'YOUR_PRIVATE_KEY',
    fee_limit: 1
}

Returns:

A promise that resolves with the minted fungible token response object

{
    "hash": "dc224ba854d5fbd3371f6d509b9a0b5451fff78a70ad3a209b5c273f8da0abfb"
}

Last updated