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
- blockHash
- blockNumber
- blockTimestamp
- chain
- contractAddress
- logIndex
- result
- toWallet
- tokenDecimals
- tokenLogo
- tokenName
- tokenSymbol
- transactionHash
- transactionIndex
- value
Constructors
Methods
create
▸ Static create(data): Erc20Mint
Create a new instance of Erc20Mint from any valid input
Example
const mint = Erc20Mint.create(data);
Parameters
| Name | Type | Description |
|---|---|---|
data | Erc20MintInput | Erc20Mint | Erc20Mint instance or valid Erc20MintInput |
Returns
equals
▸ Static equals(dataA, dataB): boolean
Check the equality between two Erc20 mints
Example
Erc20Mint.equals(dataA, dataB)
Parameters
| Name | Type | Description |
|---|---|---|
dataA | Erc20MintInput | Erc20Mint | The first mint to compare |
dataB | Erc20MintInput | Erc20Mint | The second mint to compare |
Returns
boolean
true if the mints are equal, false otherwise
parse
▸ Static parse(data): Erc20MintData
Parameters
| Name | Type |
|---|---|
data | Erc20MintInput |
Returns
equals
▸ equals(data): boolean
Checks the equality of the current mint with another erc20 mint
Example
mint.equals(data)
Parameters
| Name | Type | Description |
|---|---|---|
data | Erc20MintInput | Erc20Mint | the 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
| Name | Type |
|---|---|
blockHash | string |
blockNumber | string |
blockTimestamp | Date |
chain | string |
contractAddress | string |
logIndex | number |
toWallet | string |
tokenDecimals | number |
tokenLogo? | string |
tokenName | string |
tokenSymbol | string |
transactionHash | string |
transactionIndex | number |
value | string |
Implementation of
MoralisDataObject.format
toJSON
▸ toJSON(): Object
Example
mint.toJSON()
Returns
Object
a JSON representation of the mint.
| Name | Type |
|---|---|
blockHash | string |
blockNumber | string |
blockTimestamp | Date |
chain | string |
contractAddress | string |
logIndex | number |
toWallet | string |
tokenDecimals | number |
tokenLogo? | string |
tokenName | string |
tokenSymbol | string |
transactionHash | string |
transactionIndex | number |
value | string |
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
the chain of the mint
contractAddress
• get contractAddress(): EvmAddress
Example
mint.contractAddress // EvmAddress
Returns
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
all the data without casting it to JSON.
toWallet
• get toWallet(): EvmAddress
Example
mint.toWallet // EvmAddress
Returns
the toWallet of the mint
tokenDecimals
• get tokenDecimals(): number
Example
burn.tokenDecimals // 18
Returns
number
The decimals of the token.
tokenLogo
• 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
| Name | Type |
|---|---|
data | Erc20MintInput |