Token Event
Methods in Common functions are also available.
Get Event Type
Returns type of the event.
Returns
Returns string
of the event type, which could be "execution"
or "token"
.
Example
Get Event Chain
Returns chain of the event.
Returns
Returns string
of the chain name, which could be "eth"
"bsc"
"polygon"
"goerli"
or "bitkub"
.
Example
Get Ethereum Transaction
Return an Ethereum transaction of the event.
Returns
Returns object
:
hash -
string
: Hash of the transaction.nonce - number: The number of transactions made by the sender prior to this one.
blockHash - string: Hash of the block where this transaction was in.
null
if pending.blockNumber - number: Block number where this transaction was in.
null
if pending.transactionIndex - number: Integer of the transactions index position in the block.
null
if pending.from - string: Address of the sender.
to - string: Address of the receiver.
null
if it’s a contract creation transaction.value - string: Value transferred in wei.
gas - number: Gas provided by the sender.
gasPrice - string: Gas price provided by the sender in wei.
input - string: The data sent along with the transaction.
Example
Get Token Info
Returns information of the token
Returns
Returns object
:
contractAddress -
string
: Address of the contracttokenName -
string
: Name of the token.symbol -
string
: Symbol of the token.divisor -
string
: divisor of the token.tokenType -
string
: Type of the token.totalSupply -
string
: Supply of the token.
Example
Get Token Action Type
Returns action type of the token
Returns
Returns string
of the event type, which could be:
"native-transfer"
"erc20-transfer"
"erc20-approval"
"erc20-mint"
"erc721-transfer"
"erc721-approval"
"erc721-approval-for-all"
Example
Get Token Action
Returns token action data
Returns
Returns object
with varied info depending on the kind of token:
"native-transfer"
:from -
string
: Address of the sender.to -
string
: Address of the receiver.value -
string
: Value transferred in wei.
"erc20-transfer"
:from -
string
: Address of the sender.to -
string
: Address of the receiver.value -
string
: Value transferred in wei.
"erc20-approval"
:owner -
string
: Address of the owner.spender -
string
: Address of the spender.value -
string
: Value Approved in wei.
"erc20-mint":
from -
string
: Address of the sender.to -
string
: Address of the receiver.value -
string
: Value transferred in wei.
"erc721-transfer"
:from -
string
: Address of the sender.to -
string
: Address of the receiver.tokenId -
string
: Id of the token.
"erc721-approval"
:owner -
string
: Address of the owner.approved -
string
: Address of the approval.tokenId -
string
: Id of the token.
"erc721-approval-for-all"
:owner -
string
: Address of the owner.operator -
string
: Address of the operator.approved -
boolean
: Status of Approval.
Exmaple
Last updated