Class: StreamErc20Approval
moralis-monorepo / @moralisweb3/common-streams-utils / StreamErc20Approval
Class: StreamErc20Approval
@moralisweb3/common-streams-utils.StreamErc20Approval
The StreamErc20Transfer class is a representation of a erc20 approval that is returned by the Moralis Stream API
Implements
MoralisDataObject
Table of contents
Methods
Accessors
- chain
- contract
- logIndex
- owner
- spender
- tokenDecimals
- tokenName
- tokenSymbol
- transactionHash
- triggers
- value
- valueWithDecimals
Constructors
Methods
create
▸ Static
create(data
): StreamErc20Approval
Create a new instance of StreamErc20Approval
Example
const erc20Approval = StreamErc20Approval.create(data);
Parameters
Name | Type | Description |
---|---|---|
data | StreamErc20Approvalish | the StreamErc20Approvalish type |
Returns
an instance of StreamErc20Approval
equals
▸ Static
equals(valueA
, valueB
): boolean
Compares two StreamErc20Approval data. It checks a deep equality check of both values.
Example
StreamErc20Approval.equals(valueA, valueB);
Parameters
Name | Type | Description |
---|---|---|
valueA | StreamErc20Approvalish | the first StreamErc20Approvalish data to compare |
valueB | StreamErc20Approvalish | the second StreamErc20Approvalish data to compare |
Returns
boolean
true if the values are equal, false otherwise
equals
▸ equals(value
): boolean
Compares an StreamErc20Approvalish data to this StreamErc20Approval instance.
Example
erc20Approval.equals(value);
Parameters
Name | Type | Description |
---|---|---|
value | StreamErc20Approvalish | the value to compare |
Returns
boolean
true if the value is equal to the current instance, false otherwise
Implementation of
MoralisDataObject.equals
format
▸ format(): StreamErc20ApprovalJSON
Deprecated
This method will be removed soon. To format the value, use one of the properties.
Returns
Implementation of
MoralisDataObject.format
toJSON
▸ toJSON(): StreamErc20ApprovalJSON
Converts the StreamErc20Approval instance to a JSON object.
Example
erc20Approval.toJSON()
Returns
JSON object of the StreamErc20Approval instance
Implementation of
MoralisDataObject.toJSON
Accessors
chain
• get
chain(): EvmChain
Returns
EvmChain
contract
• get
contract(): EvmAddress
Returns
EvmAddress
logIndex
• get
logIndex(): string
| number
Returns
string
| number
owner
• get
owner(): EvmAddress
Returns
EvmAddress
spender
• get
spender(): EvmAddress
Returns
EvmAddress
tokenDecimals
• get
tokenDecimals(): undefined
| number
Returns
undefined
| number
tokenName
• get
tokenName(): string
Returns
string
tokenSymbol
• get
tokenSymbol(): string
Returns
string
transactionHash
• get
transactionHash(): string
Returns
string
triggers
• get
triggers(): undefined
| StreamTriggerOutput
[]
Returns
undefined
| StreamTriggerOutput
[]
value
• get
value(): BigNumber
Returns
BigNumber
valueWithDecimals
• get
valueWithDecimals(): undefined
| string
Returns
undefined
| string
Constructors
constructor
• new StreamErc20Approval(data
)
Parameters
Name | Type |
---|---|
data | StreamErc20ApprovalInput |