1.0.8 • Published 2 years ago

@getsafle/custom-token-controller v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Custom Token Controller

This SDK can be used to get the details of any token by it's contract address and it's balance for a specific address.

Installation

To install this SDK,

npm install --save @getsafle/custom-token-controller

Initialization

Initialize the constructor,

const safleTokenController = require('@getsafle/custom-token-controller');

const tokenController = new safleTokenController.CustomTokenController({ userAddress, rpcURL, chain });
  • userAddress - User Public Address
  • rpcURL - Web3 RPC provider URL
  • chain - blockchain name

Get Token Details

This function returns the token decimal and symbol for the contract address passed as parameter.

const tokenDetails = await tokenController.getTokenDetails(contractAddress);
  • contractAddress - Token contract address

Get Token Balance

const tokenDetails = await tokenController.getTokenBalance(contractAddress);
  • contractAddress - Token contract address
1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago