Socket
Socket
Sign inDemoInstall

@getsafle/custom-token-controller

Package Overview
Dependencies
322
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @getsafle/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.


Version published
Weekly downloads
21
increased by162.5%
Maintainers
4
Created
Weekly downloads
 

Changelog

Source

1.0.8 (2023-06-01)

  • Updated metadata URL's

Readme

Source

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

FAQs

Last updated on 01 Jun 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc