Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

asset-tracker

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asset-tracker - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

6

CHANGELOG.md

@@ -22,1 +22,7 @@ ### 1.0.0 (16-10-2022)

* `getSupportedChains(functionName)` - Get the list of all the supported chains. This list can be filtered by `functionName` supported by the chains.
### 1.2.0 (22-10-2022)
##### Get Native Asset Details
* `getNativeAssetDetails()` - Get the details of the native token of the initialized chain.

2

package.json
{
"name": "asset-tracker",
"version": "1.1.0",
"version": "1.2.0",
"description": "Asset tracker to track all your multichain assets.",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -149,3 +149,13 @@ # **Asset Tracker**

> Get Native Asset Details
This function will return the details of the native asset of the chain initialized.
```js
getNativeAssetDetails();
```
<br>
> **Note** <br />
> Please note that currently, this library only supports EVM chains. Will soon be adding support for non EVM chains.

@@ -16,3 +16,4 @@ module.exports = {

getNFTDetails: true,
getNativeAssetDetails: false,
},
};

@@ -16,3 +16,4 @@ module.exports = {

getNFTDetails: true,
getNativeAssetDetails: false,
},
};

@@ -8,2 +8,3 @@ module.exports = {

GET_TXN_LIST_API: 'https://api.bscscan.com/api?module=account&action=txlist',
ASSET_API: 'https://api.coingecko.com/api/v3/coins/binancecoin',
FUNCTIONALITY_SUPPORT: {

@@ -17,3 +18,4 @@ getTransactions: true,

getNFTDetails: true,
getNativeAssetDetails: true,
},
};

@@ -8,2 +8,3 @@ module.exports = {

GET_TXN_LIST_API: 'https://api.etherscan.io/api?module=account&action=txlist',
ASSET_API: 'https://api.coingecko.com/api/v3/coins/ethereum',
FUNCTIONALITY_SUPPORT: {

@@ -17,3 +18,4 @@ getTransactions: true,

getNFTDetails: true,
getNativeAssetDetails: true,
},
};

@@ -8,2 +8,3 @@ module.exports = {

GET_TXN_LIST_API: 'https://api.ftmscan.com/api?module=account&action=txlist',
ASSET_API: 'https://api.coingecko.com/api/v3/coins/fantom',
FUNCTIONALITY_SUPPORT: {

@@ -17,3 +18,4 @@ getTransactions: true,

getNFTDetails: true,
getNativeAssetDetails: true,
},
};

@@ -6,2 +6,3 @@ module.exports = {

RPC: 'https://rpc.ankr.com/harmony',
ASSET_API: 'https://api.coingecko.com/api/v3/coins/harmony',
DECIMALS: 18,

@@ -16,3 +17,4 @@ FUNCTIONALITY_SUPPORT: {

getNFTDetails: true,
getNativeAssetDetails: true,
},
};

@@ -8,2 +8,3 @@ module.exports = {

GET_TXN_LIST_API: 'https://api-optimistic.etherscan.io/api?module=account&action=txlist',
ASSET_API: 'https://api.coingecko.com/api/v3/coins/optimism',
FUNCTIONALITY_SUPPORT: {

@@ -17,3 +18,4 @@ getTransactions: true,

getNFTDetails: true,
getNativeAssetDetails: true,
},
};

@@ -8,2 +8,3 @@ module.exports = {

GET_TXN_LIST_API: 'https://api.polygonscan.com/api?module=account&action=txlist',
ASSET_API: 'https://api.coingecko.com/api/v3/coins/matic-network',
FUNCTIONALITY_SUPPORT: {

@@ -17,3 +18,4 @@ getTransactions: true,

getNFTDetails: true,
getNativeAssetDetails: true,
},
};

@@ -6,2 +6,3 @@ module.exports = {

RPC: 'https://explorer.velas.com/rpc',
ASSET_API: 'https://api.coingecko.com/api/v3/coins/velas',
DECIMALS: 18,

@@ -16,3 +17,4 @@ FUNCTIONALITY_SUPPORT: {

getNFTDetails: true,
getNativeAssetDetails: true,
},
};

@@ -35,2 +35,20 @@ const Web3 = require('web3');

async getNativeAssetDetails() {
validator.checkSupportForChains(this.chain, 'getNativeAssetDetails');
const details = await helper.getRequest(`${chains[this.chain].ASSET_API}`);
let response = {};
response.chain = details.name;
response.symbol = details.symbol;
response.image = details.image.large;
response.currentPrice = details.market_data.current_price.usd;
response.marketCap = details.market_data.market_cap.usd;
response.high_24h = details.market_data.high_24h.usd;
response.low_24h = details.market_data.low_24h.usd;
return response;
}
async discoverFungibleAssets(address) {

@@ -37,0 +55,0 @@ validator.checkSupportForChains(this.chain, 'discoverFungibleAssets');

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc