FT Kit
FT Manager Service
The FT Manager Service provides methods for managing ERC-20 tokens.
Table of Contents
createERC20Token
mintERC20Token
getTotalSupply
transferERC20
approveERC20
createERC20Token
Deploys a new ERC-20 token on a specific blockchain network.
Parameters:
chainId
(string): The ID of the blockchain network where the token will be deployed.name
(string): The name of the token.symbol
(string): The symbol or ticker of the token.decimals
(number): The number of decimals for the token.initialHolder
(string): The address of the initial token holder.initialSupply
(number): The initial supply of tokens.accessToken
(string): The access token for wallet authentication.
Usage:
const deployERC20tokenStatus = await FTManagerService.createERC20Token("80001", "Stacks Token", "STX", 18, "0xf782678E53d1bd5B5d23633158e0EC9504FbA8DF", 100000, process.env.WALLET_ACCESS_TOKEN);
console.log(deployERC20tokenStatus);
mintERC20Token
Mints additional tokens for an existing ERC-20 token.
Parameters:
chainId
(string): The ID of the blockchain network where the token exists.contractAddress
(string): The address of the ERC-20 token contract.amount
(number): The amount of tokens to mint.recipientAddress
(string): The address of the recipient.accessToken
(string): The access token for wallet authentication.
Usage:
const mintERC20Status = await FTManagerService.mintERC20Token("80001", "0x1D712Ee042655B0b20F09E1A8ed3A0702ED3638F", 1000000, "0x69e53791d3ec6ad611c60ea84e38c3e76c25342f", process.env.WALLET_ACCESS_TOKEN);
console.log(mintERC20Status);
getTotalSupply
Gets the total supply of an ERC-20 token.
Parameters:
chainId
(string): The ID of the blockchain network where the token exists.contractAddress
(string): The address of the ERC-20 token contract.
Usage:
const totalSupplyStatus = await FTManagerService.getTotalSupply("80001", "0x1D712Ee042655B0b20F09E1A8ed3A0702ED3638F");
console.log(totalSupplyStatus);
transferERC20
Transfers ERC-20 tokens from the sender's address to a recipient.
Parameters:
chainId
(string): The ID of the blockchain network where the token exists.contractAddress
(string): The address of the ERC-20 token contract.amount
(number): The amount of tokens to transfer.recipientAddress
(string): The address of the recipient.accessToken
(string): The access token for wallet authentication.
Usage:
const transferERC20Status = await FTManagerService.transferERC20("80001", "0x1D712Ee042655B0b20F09E1A8ed3A0702ED3638F", 100, "0xf782678E53d1bd5B5d23633158e0EC9504FbA8DF", process.env.WALLET_ACCESS_TOKEN);
console.log(transferERC20Status);
approveERC20
Approves spending a specific amount of ERC-20 tokens on behalf of the sender.
Parameters:
chainId
(string): The ID of the blockchain network where the token exists.contractAddress
(string): The address of the ERC-20 token contract.amount
(number): The amount of tokens to approve.spenderAddress
(string): The address of the spender.accessToken
(string): The access token for wallet authentication.
Usage:
const approveFTSStatus = await FTManagerService.approveERC20("80001", "0x1D712Ee042655B0b20F09E1A8ed3A0702ED3638F", 100, "0xf782678E53d1bd5B5d23633158e0EC9504FbA8DF", process.env.WALLET_ACCESS_TOKEN);
console.log(approveFTSStatus);
These methods allow you to create, mint, get information, transfer, and approve ERC-20 tokens on the specified blockchain network. Provide the necessary parameters based on your requirements and utilize the returned data as needed.
Last updated
Was this helpful?