Skip to main content

Class: Erc20Mint

moralis-monorepo / @moralisweb3/common-evm-utils / Erc20Mint

Class: Erc20Mint

@moralisweb3/common-evm-utils.Erc20Mint

The Erc20Mint is a representation of an Erc20 token mint.

Implements

  • MoralisDataObject

Table of contents

Methods

Accessors

Constructors

Methods

create

Static create(data): Erc20Mint

Create a new instance of Erc20Mint from any valid input

Example

const mint = Erc20Mint.create(data);

Parameters

NameTypeDescription
dataErc20MintInput | Erc20MintErc20Mint instance or valid Erc20MintInput

Returns

Erc20Mint


equals

Static equals(dataA, dataB): boolean

Check the equality between two Erc20 mints

Example

Erc20Mint.equals(dataA, dataB)

Parameters

NameTypeDescription
dataAErc20MintInput | Erc20MintThe first mint to compare
dataBErc20MintInput | Erc20MintThe second mint to compare

Returns

boolean

true if the mints are equal, false otherwise


parse

Static parse(data): Erc20MintData

Parameters

NameType
dataErc20MintInput

Returns

Erc20MintData


equals

equals(data): boolean

Checks the equality of the current mint with another erc20 mint

Example

mint.equals(data)

Parameters

NameTypeDescription
dataErc20MintInput | Erc20Mintthe mint to compare with

Returns

boolean

true if the mints are equal, false otherwise

Implementation of

MoralisDataObject.equals


format

format(): Object

Deprecated

This method will be removed soon. To format the value, use one of the properties.

Returns

Object

NameType
blockHashstring
blockNumberstring
blockTimestampDate
chainstring
contractAddressstring
logIndexnumber
toWalletstring
tokenDecimalsnumber
tokenLogo?string
tokenNamestring
tokenSymbolstring
transactionHashstring
transactionIndexnumber
valuestring

Implementation of

MoralisDataObject.format


toJSON

toJSON(): Object

Example

mint.toJSON()

Returns

Object

a JSON representation of the mint.

NameType
blockHashstring
blockNumberstring
blockTimestampDate
chainstring
contractAddressstring
logIndexnumber
toWalletstring
tokenDecimalsnumber
tokenLogo?string
tokenNamestring
tokenSymbolstring
transactionHashstring
transactionIndexnumber
valuestring

Implementation of

MoralisDataObject.toJSON

Accessors

blockHash

get blockHash(): string

Example

mint.blockHash // "0x0372c302e3c52e8f2e15d155e2c545e6d802e479236564af052759253b20fd86"

Returns

string

the block hash of the mint


blockNumber

get blockNumber(): BigNumber

Example

mint.blockNumber // BigNumber

Returns

BigNumber

the block number of the mint


blockTimestamp

get blockTimestamp(): Date

Example

mint.blockTimestamp // Date

Returns

Date

the block timestamp of the mint


chain

get chain(): EvmChain

Example

mint.chain // EvmChain

Returns

EvmChain

the chain of the mint


contractAddress

get contractAddress(): EvmAddress

Example

mint.contractAddress // EvmAddress

Returns

EvmAddress

the contractAddress of the mint


logIndex

get logIndex(): number

Example

mint.logIndex // 2

Returns

number

the logIndex of the mint


result

get result(): Erc20MintData

Example

mint.result

Returns

Erc20MintData

all the data without casting it to JSON.


toWallet

get toWallet(): EvmAddress

Example

mint.toWallet // EvmAddress

Returns

EvmAddress

the toWallet of the mint


tokenDecimals

get tokenDecimals(): number

Example

burn.tokenDecimals // 18

Returns

number

The decimals of the token.


get tokenLogo(): undefined | string

Example

burn.tokenLogo // "https://cdn.moralis.io/eth/0x67b6d479c7bb412c54e03dca8e1bc6740ce6b99c.png"

Returns

undefined | string

The logo of the token


tokenName

get tokenName(): string

Example

burn.tokenName // "Kylin Network"

Returns

string

The name of the token.


tokenSymbol

get tokenSymbol(): string

Example

burn.tokenSymbol // "KYL"

Returns

string

The symbol of the token.


transactionHash

get transactionHash(): string

Example

mint.transactionHash // "0x0372c302e3c52e8f2e15d155e2c545e6d802e479236564af052759253b20fd86"

Returns

string

the transaction hash of the mint


transactionIndex

get transactionIndex(): number

Example

mint.transactionIndex // 3

Returns

number

the transactionIndex of the mint


value

get value(): BigNumber

Example

mint.value // BigNumber

Returns

BigNumber

the value of the mint

Constructors

constructor

new Erc20Mint(data)

Parameters

NameType
dataErc20MintInput