Skip to main content

Token class

Create a standard crypto token or cryptocurrency.

Example

import { ThirdwebSDK } from "@thirdweb-dev/sdk";

const sdk = new ThirdwebSDK("{{chainName}}");
const contract = await sdk.getContract("{{contract_address}}", "token");

Constructors

ConstructorModifiersDescription
(constructor)(network, address, storage, options, abi, chainId, contractWrapper)Constructs a new instance of the Token class

Properties

PropertyModifiersTypeDescription
abiAbi
contractRolesstaticreadonly ["admin", "minter", "transfer"]
encoderContractEncoder<TokenERC20>
estimatorGasCostEstimator<TokenERC20>
eventsContractEvents<TokenERC20>
historyTokenERC20History
metadataContractMetadata<TokenERC20, typeof TokenErc20ContractSchema>
platformFeesContractPlatformFee<TokenERC20>
rolesContractRoles<TokenERC20, typeof Token.contractRoles[number]>
salesContractPrimarySale<TokenERC20>
signatureErc20SignatureMintableSignature Minting

Methods

MethodModifiersDescription
burn(amount)Burn Tokens
burnFrom(holder, amount)Burn Tokens
getDelegation()Get your voting delegatee address
getDelegationOf(account)Get a specific address voting delegatee address
getMintTransaction(to, amount)Construct a mint transaction without executing it. This is useful for estimating the gas cost of a mint transaction, overriding transaction options and having fine grained control over the transaction execution.
getVoteBalance()Get your wallet voting power for the current checkpoints
getVoteBalanceOf(account)
isTransferRestricted()Get whether users can transfer tokens from this contract
mint(amount)Mint Tokens for the connected wallet
mintBatchTo(args)Mint Tokens To Many Wallets
mintTo(to, amount)Mint Tokens

Signature:

export declare class Token extends StandardErc20<TokenERC20>

Extends: StandardErc20<TokenERC20>