asset-tracker
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -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. |
{ | ||
"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'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34855
1080
161