Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@getsafle/asset-controller
Advanced tools
This controller detects tokens for a user and returns token balances.
This SDK is used to detect the tokens and their balances in a given user's public address.
To install this SDK,
npm install --save @getsafle/asset-controller
Initialize the constructor,
const safleAssetController = require('@getsafle/asset-controller');
const assetController = new safleAssetController.AssetController({ rpcURL, chain });
Detect Tokens
This function will detect and return the list of all the tokens in the user's public address.
const tokenBalance = await assetController.detectTokens({ userAddress, tokenType });
userAddress
- User Public AddresstokenType
- optional parameter - valid values- erc20/erc721Get list of chains on which a token exists
This function will return the list of all the chains which a particular token is supported
const chains = await assetController.getChains(tokenSymbol);
tokenSymbol
- Token SymbolGet token balances
This function will return the balances of all the tokens contract addresses passed in the array
const chains = await assetController.getTokenBalances(tokensToDetect, SINGLE_CALL_BALANCES_ADDRESS, userAddress);
tokensToDetect
- array of all the token addressesSINGLE_CALL_BALANCES_ADDRESS
- Contract address of the single call balance checker contractuserAddress
- Public address of the user to query the balance of1.0.12 (2023-05-25)
FAQs
This controller detects tokens for a user and returns token balances.
The npm package @getsafle/asset-controller receives a total of 3 weekly downloads. As such, @getsafle/asset-controller popularity was classified as not popular.
We found that @getsafle/asset-controller demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.