import { L1XProvider, FTTokenCreateArg } from "@l1x/l1x-wallet-sdk";
let l1xProvider = new L1XProvider({
clusterType: "mainnet",
endpoint: "https://v2-mainnet-rpc.l1x.foundation",
});
let params: FTTokenCreateArg = {
attrib: {
baseContract: "d9a11a844eeaa9fbeb2d06cd63f7b4268de0e97c",
name: "MyToken",
decimals: 18,
symbol: "MTK",
initial_supply: 1000000000,
},
private_key: "YOUR_PRIVATE_KEY",
fee_limit: 0,
};
l1xProvider.tokens.FT.create(params)
.then((response) => console.log(response)) // log response
.catch((err) => console.error(err)); // log error
Token creation request object.
{
attrib: {
baseContract: string,
name: "MyToken",
decimals: 18,
symbol: "MTK",
initial_supply: 1000000000,
},
private_key: "YOUR_PRIVATE_KEY",
fee_limit: 0,
}
Token creation response.
{
"hash": "dc224ba854d5fbd3371f6d509b9a0b5451fff78a70ad3a209b5c273f8da0abfb",
"contract_address": "cf0289e86714d97979d726eeb2fa3a23b9c007c1"
}