Get a User's ERC20 Balance

Get ERC20 balance of user

Usage in your script

GetUserERC20Balance
  .Initialize(destroyAtEnd: true)
  .SetParameters(
    chainId: "97",
    userAddress: "0x01dw4...",
    tokenAddress: "0x2w474...",
  )
  .OnError(error => Debug.Log(error))
  .OnComplete(result => Debug.Log(result.balance))
  .Run();

Member Functions

.Initialize()

ParameterTypeRequiredDescription

destroyAtEnd

bool

Optional

defines if this component will be destroyed after .Run()

.SetParameters()

ParameterTypeRequiredDescription

tokenAddress

String

Yes

the token contract address

chainId

String

Yes

The chain id

userAddress

String

Yes

address of user

.onError()

Action on Error: returns error information.

.onComplete()

Action on successful: returns ERC20 balance of user.

.Run()

Runs the API call and fills the corresponding model in the component on success.

Last updated