Class: EvmNftTransfer
moralis-monorepo / @moralisweb3/common-evm-utils / EvmNftTransfer
Class: EvmNftTransfer
@moralisweb3/common-evm-utils.EvmNftTransfer
The EvmNftTransfer is a representation of a completed NFT transfer.
Implements
MoralisDataObject
Table of contents
Methods
Accessors
- amount
- blockHash
- blockNumber
- blockTimestamp
- chain
- contractType
- fromAddress
- logIndex
- operator
- possibleSpam
- result
- toAddress
- tokenAddress
- tokenId
- transactionHash
- transactionIndex
- transactionType
- value
Constructors
Properties
Methods
create
▸ Static
create(data
): EvmNftTransfer
Create a new instance of EvmNftTransfer from any valid transfer input
Example
const transfer = EvmNftTransfer.create(data);
Parameters
Name | Type | Description |
---|---|---|
data | EvmNftTransferish | the EvmNftTransferish type |
Returns
equals
▸ Static
equals(dataA
, dataB
): boolean
Check the equality between two NFT transfers. The compares the chain, blockHash, tokenId and logIndex.
Example
EvmNftTransfer.equals(dataA, dataB)
Parameters
Name | Type | Description |
---|---|---|
dataA | EvmNftTransferish | The first transfer to compare |
dataB | EvmNftTransferish | The second transfer to compare |
Returns
boolean
true if the transfers are equal, false otherwise
parse
▸ Static
parse(data
): EvmNftTransferData
Parameters
Name | Type |
---|---|
data | EvmNftTransferInput |
Returns
equals
▸ equals(data
): boolean
Checks the equality of the current transfer instance with another nft transfer
Example
transaction.equals(data)
Parameters
Name | Type | Description |
---|---|---|
data | EvmNftTransferish | the transfer to compare with |
Returns
boolean
true if the transfers are equal, false otherwise
Implementation of
MoralisDataObject.equals
format
▸ format(): Object
Example
transfer.format()
Returns
Object
a JSON represention of the transfer.
Name | Type |
---|---|
amount? | number |
blockHash | string |
blockNumber | string |
blockTimestamp | Date |
chain | string |
contractType | string |
fromAddress | undefined | string |
logIndex | number |
operator | undefined | string |
possibleSpam | boolean |
toAddress | string |
tokenAddress | string |
tokenId | string |
transactionHash | string |
transactionIndex? | number |
transactionType? | string |
value | undefined | string |
Implementation of
MoralisDataObject.format
toJSON
▸ toJSON(): Object
Example
transfer.toJSON()
Returns
Object
a JSON represention of the transfer.
Name | Type |
---|---|
amount? | number |
blockHash | string |
blockNumber | string |
blockTimestamp | Date |
chain | string |
contractType | string |
fromAddress | undefined | string |
logIndex | number |
operator | undefined | string |
possibleSpam | boolean |
toAddress | string |
tokenAddress | string |
tokenId | string |
transactionHash | string |
transactionIndex? | number |
transactionType? | string |
value | undefined | string |
Implementation of
MoralisDataObject.toJSON
Accessors
amount
• get
amount(): undefined
| number
Example
transfer.amount // 1
Returns
undefined
| number
the amount of the transfer.
blockHash
• get
blockHash(): string
Example
transfer.blockHash // "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e"
Returns
string
the block hash of the transfer.
blockNumber
• get
blockNumber(): BigNumber
Example
transfer.blockNumber // BigNumber
Returns
BigNumber
the block number of the transfer.
blockTimestamp
• get
blockTimestamp(): Date
Example
transfer.blockTimestamp // Date
Returns
Date
the block timestamp of the transfer.
chain
• get
chain(): EvmChain
Example
transfer.chain // EvmChain
Returns
the chain of the transfer.
contractType
• get
contractType(): string
Example
transfer.contractType // "ERC721"
Returns
string
the contract type of the transfer.
fromAddress
• get
fromAddress(): undefined
| EvmAddress
Example
transfer.fromAddress // EvmAddress
Returns
undefined
| EvmAddress
the from address of the transfer.
logIndex
• get
logIndex(): number
Example
transfer.logIndex // 0
Returns
number
the log index of the transfer.
operator
• get
operator(): undefined
| EvmAddress
Example
transfer.operator // EvmAddress
Returns
undefined
| EvmAddress
the operator of the transfer.
possibleSpam
• get
possibleSpam(): boolean
Example
transfer.possibleSpam // true
Returns
boolean
possibility of the token being a spam token
result
• get
result(): EvmNftTransferData
Example
transfer.result
Returns
all the data without casting it to JSON.
toAddress
• get
toAddress(): EvmAddress
Example
transfer.toAddress // EvmAddress
Returns
the to address of the transfer.
tokenAddress
• get
tokenAddress(): EvmAddress
Example
transfer.tokenAddress // EvmAddress
Returns
the token address of the transfer.
tokenId
• get
tokenId(): string
Example
transfer.tokenId // "15"
Returns
string
the token id of the transfer.
transactionHash
• get
transactionHash(): string
Example
transfer.transactionHash // "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e"
Returns
string
the transaction hash of the transfer.
transactionIndex
• get
transactionIndex(): undefined
| number
Example
transfer.transactionIndex // 123
Returns
undefined
| number
the transaction index of the transfer.
transactionType
• get
transactionType(): undefined
| string
Example
transfer.transactionType // "1"
Returns
undefined
| string
the transaction type of the transfer.
value
• get
value(): undefined
| EvmNative
Example
transfer.value // EvmNative
Returns
undefined
| EvmNative
the value of the transfer.
Constructors
constructor
• new EvmNftTransfer(data
)
Parameters
Name | Type |
---|---|
data | EvmNftTransferInput |
Properties
_data
• Protected
_data: EvmNftTransferData