New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@covalenthq/client-sdk

Package Overview
Dependencies
Maintainers
4
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@covalenthq/client-sdk - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

dist/ApprovalService.d.ts

@@ -54,3 +54,3 @@ interface ApprovalsResponse {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
*

@@ -57,0 +57,0 @@ */

@@ -12,8 +12,9 @@ "use strict";

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
*
*/
async getApprovals(chainName, walletAddress) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -29,5 +30,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -34,0 +41,0 @@ else {

@@ -149,3 +149,3 @@ interface BalancesResponse {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} quoteCurrency - The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.

@@ -162,3 +162,3 @@ * @param {boolean} nft - If `true`, NFTs will be included in the response.

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} quoteCurrency - The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.

@@ -172,3 +172,3 @@ * @param {number} days - The number of days to return data for. Defaults to 30 days.

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} quoteCurrency - The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.

@@ -184,3 +184,3 @@ * @param {string} contractAddress - The requested contract address.

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} tokenAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} tokenAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {number} blockHeight - Ending block to define a block range. Omitting this parameter defaults to the latest block height.

@@ -187,0 +187,0 @@ * @param {number} pageSize - Number of items per page. Note: Currently, only values of `100` and `1000` are supported. Omitting this parameter defaults to 100.

@@ -12,3 +12,3 @@ "use strict";

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} quoteCurrency - The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.

@@ -22,4 +22,5 @@ * @param {boolean} nft - If `true`, NFTs will be included in the response.

async getTokenBalances(chainName, walletAddress, quoteCurrency, nft, noNftFetch, noSpam, noNftAssetMetadata) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -50,5 +51,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -69,3 +76,3 @@ else {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} quoteCurrency - The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.

@@ -76,4 +83,5 @@ * @param {number} days - The number of days to return data for. Defaults to 30 days.

async getAddressPortfolio(chainName, walletAddress, quoteCurrency, days) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -95,5 +103,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -114,3 +128,3 @@ else {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} quoteCurrency - The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.

@@ -123,4 +137,5 @@ * @param {string} contractAddress - The requested contract address.

async getErc20Transfers(chainName, walletAddress, quoteCurrency, contractAddress, startingBlock, endingBlock) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -148,5 +163,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -167,3 +188,3 @@ else {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} tokenAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} tokenAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {number} blockHeight - Ending block to define a block range. Omitting this parameter defaults to the latest block height.

@@ -175,4 +196,5 @@ * @param {number} pageSize - Number of items per page. Note: Currently, only values of `100` and `1000` are supported. Omitting this parameter defaults to 100.

async getTokenHoldersV2(chainName, tokenAddress, blockHeight, pageSize, pageNumber) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -197,5 +219,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -202,0 +230,0 @@ else {

@@ -140,3 +140,3 @@ interface BlockResponse {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} contractAddress - The endpoint will return event logs emitted from this contract address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} contractAddress - The endpoint will return event logs emitted from this contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {number} startingBlock - The first block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`.

@@ -143,0 +143,0 @@ * @param {string} endingBlock - The last block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`.

@@ -16,4 +16,5 @@ "use strict";

async getBlock(chainName, blockHeight) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -29,5 +30,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -53,4 +60,5 @@ else {

async getBlockHeights(chainName, startDate, endDate) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -66,5 +74,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -85,3 +99,3 @@ else {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} contractAddress - The endpoint will return event logs emitted from this contract address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} contractAddress - The endpoint will return event logs emitted from this contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {number} startingBlock - The first block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`.

@@ -92,4 +106,5 @@ * @param {string} endingBlock - The last block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`.

async getLogEventsByAddress(chainName, contractAddress, startingBlock, endingBlock) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -111,5 +126,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -137,4 +158,5 @@ else {

async getLogEventsByTopicHash(chainName, topicHash, startingBlock, endingBlock, secondaryTopics) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -159,5 +181,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -181,4 +209,5 @@ else {

async getAllChains() {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -194,5 +223,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -216,4 +251,5 @@ else {

async getAllChainStatus() {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -229,5 +265,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -234,0 +276,0 @@ else {

@@ -21,4 +21,5 @@ "use strict";

async getLogs(chainName, startingBlock, endingBlock, address, topics, blockHash, skipDecode) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -52,5 +53,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -57,0 +64,0 @@ else {

@@ -28,3 +28,3 @@ interface ResolvedAddress {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
*

@@ -31,0 +31,0 @@ */

@@ -12,8 +12,9 @@ "use strict";

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
*
*/
async getResolvedAddress(chainName, walletAddress) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -29,5 +30,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -34,0 +41,0 @@ else {

@@ -184,12 +184,13 @@ interface ChainCollectionResponse {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {boolean} noSpam - If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
* @param {boolean} noNftAssetMetadata - If `true`, the response shape is limited to a list of collections and token ids, omitting metadata and asset information. Helpful for faster response times and wallets holding a large number of NFTs.
* @param {boolean} withUncached - By defaut, this endpoint only works on chains where we've cached the metadata. When set to `true`, the API will fetch metadata from upstream servers even if it's not cached - the downside being that the upstream streams can block or rate limit us and therefore resulting in time outs or slow response times.
*
*/
getNftsForAddress(chainName: "btc-mainnet" | "eth-mainnet" | "matic-mainnet" | "bsc-mainnet" | "avalanche-mainnet" | "fantom-mainnet" | "moonbeam-mainnet" | "moonbeam-moonriver" | "rsk-mainnet" | "arbitrum-mainnet" | "palm-mainnet" | "klaytn-mainnet" | "heco-mainnet" | "nervos-godwoken-mainnet" | "axie-mainnet" | "evmos-mainnet" | "astar-mainnet" | "iotex-mainnet" | "harmony-mainnet" | "cronos-mainnet" | "aurora-mainnet" | "emerald-paratime-mainnet" | "boba-mainnet" | "eth-goerli" | "matic-mumbai" | "avalanche-testnet" | "bsc-testnet" | "moonbeam-moonbase-alpha" | "rsk-testnet" | "arbitrum-goerli" | "fantom-testnet" | "palm-testnet" | "heco-testnet" | "nervos-godwoken-testnet" | "evmos-testnet" | "astar-shiden" | "iotex-testnet" | "harmony-testnet" | "aurora-testnet" | "scroll-l2-testnet" | "scroll-l1-testnet" | "covalent-internal-network-v1" | "defi-kingdoms-mainnet" | "swimmer-mainnet" | "boba-avalanche-mainnet" | "boba-bobabeam-mainnet" | "boba-bnb-mainnet" | "boba-rinkeby-testnet" | "boba-bobabase-testnet" | "boba-bnb-testnet" | "boba-avalanche-testnet" | "klaytn-testnet" | "gather-mainnet" | "gather-testnet" | "optimism-mainnet" | "skale-calypso" | "skale-mainnet" | "skale-razor" | "avalanche-dexalot-mainnet" | "skale-omnus" | "avalanche-dexalot-testnet" | "astar-shibuya" | "cronos-testnet" | "defi-kingdoms-testnet" | "metis-mainnet" | "metis-testnet" | "milkomeda-a1-mainnet" | "milkomeda-a1-devnet" | "milkomeda-c1-mainnet" | "milkomeda-c1-devnet" | "swimmer-testnet" | "solana-mainnet" | "skale-europa" | "meter-mainnet" | "meter-testnet" | "skale-exorde" | "boba-goerli" | "neon-testnet" | "skale-staging-uum" | "skale-staging-lcc" | "arbitrum-nova-mainnet" | "canto-mainnet" | "bittorrent-mainnet" | "bittorrent-testnet" | "flarenetworks-flare-mainnet" | "flarenetworks-flare-testnet" | "flarenetworks-canary-mainnet" | "flarenetworks-canary-testnet" | "kcc-mainnet" | "kcc-testnet" | "polygon-zkevm-testnet" | "linea-testnet" | "base-testnet" | "mantle-testnet" | "scroll-alpha-testnet" | "oasys-mainnet" | "oasys-testnet" | "findora-mainnet" | "findora-forge-testnet" | "sx-mainnet", walletAddress: string, noSpam?: boolean, noNftAssetMetadata?: boolean): Promise<Response<NftAddressBalanceNftResponse>>;
getNftsForAddress(chainName: "btc-mainnet" | "eth-mainnet" | "matic-mainnet" | "bsc-mainnet" | "avalanche-mainnet" | "fantom-mainnet" | "moonbeam-mainnet" | "moonbeam-moonriver" | "rsk-mainnet" | "arbitrum-mainnet" | "palm-mainnet" | "klaytn-mainnet" | "heco-mainnet" | "nervos-godwoken-mainnet" | "axie-mainnet" | "evmos-mainnet" | "astar-mainnet" | "iotex-mainnet" | "harmony-mainnet" | "cronos-mainnet" | "aurora-mainnet" | "emerald-paratime-mainnet" | "boba-mainnet" | "eth-goerli" | "matic-mumbai" | "avalanche-testnet" | "bsc-testnet" | "moonbeam-moonbase-alpha" | "rsk-testnet" | "arbitrum-goerli" | "fantom-testnet" | "palm-testnet" | "heco-testnet" | "nervos-godwoken-testnet" | "evmos-testnet" | "astar-shiden" | "iotex-testnet" | "harmony-testnet" | "aurora-testnet" | "scroll-l2-testnet" | "scroll-l1-testnet" | "covalent-internal-network-v1" | "defi-kingdoms-mainnet" | "swimmer-mainnet" | "boba-avalanche-mainnet" | "boba-bobabeam-mainnet" | "boba-bnb-mainnet" | "boba-rinkeby-testnet" | "boba-bobabase-testnet" | "boba-bnb-testnet" | "boba-avalanche-testnet" | "klaytn-testnet" | "gather-mainnet" | "gather-testnet" | "optimism-mainnet" | "skale-calypso" | "skale-mainnet" | "skale-razor" | "avalanche-dexalot-mainnet" | "skale-omnus" | "avalanche-dexalot-testnet" | "astar-shibuya" | "cronos-testnet" | "defi-kingdoms-testnet" | "metis-mainnet" | "metis-testnet" | "milkomeda-a1-mainnet" | "milkomeda-a1-devnet" | "milkomeda-c1-mainnet" | "milkomeda-c1-devnet" | "swimmer-testnet" | "solana-mainnet" | "skale-europa" | "meter-mainnet" | "meter-testnet" | "skale-exorde" | "boba-goerli" | "neon-testnet" | "skale-staging-uum" | "skale-staging-lcc" | "arbitrum-nova-mainnet" | "canto-mainnet" | "bittorrent-mainnet" | "bittorrent-testnet" | "flarenetworks-flare-mainnet" | "flarenetworks-flare-testnet" | "flarenetworks-canary-mainnet" | "flarenetworks-canary-testnet" | "kcc-mainnet" | "kcc-testnet" | "polygon-zkevm-testnet" | "linea-testnet" | "base-testnet" | "mantle-testnet" | "scroll-alpha-testnet" | "oasys-mainnet" | "oasys-testnet" | "findora-mainnet" | "findora-forge-testnet" | "sx-mainnet", walletAddress: string, noSpam?: boolean, noNftAssetMetadata?: boolean, withUncached?: boolean): Promise<Response<NftAddressBalanceNftResponse>>;
/**
*
* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} contractAddress - The requested NFT contract. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} contractAddress - The requested NFT contract. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {boolean} noMetadata - Omit metadata.

@@ -200,9 +201,10 @@ * @param {number} pageSize - Number of items on a page.

* @param {string} valuesFilter - Filters NFTs based on a specific trait value. If this filter is used, the API will return all NFTs with the specified trait value. If used with "traits-filter", only NFTs matching both filters will be returned. Accepts comma-separated values, is case-sensitive, and requires proper URL encoding.
* @param {boolean} withUncached - By defaut, this endpoint only works on chains where we've cached the metadata. When set to `true`, the API will fetch metadata from upstream servers even if it's not cached - the downside being that the upstream streams can block or rate limit us and therefore resulting in time outs or slow response times. The `traits-filter` and `values-filter` are also disabled.
*
*/
getTokenIdsForContractWithMetadata(chainName: "btc-mainnet" | "eth-mainnet" | "matic-mainnet" | "bsc-mainnet" | "avalanche-mainnet" | "fantom-mainnet" | "moonbeam-mainnet" | "moonbeam-moonriver" | "rsk-mainnet" | "arbitrum-mainnet" | "palm-mainnet" | "klaytn-mainnet" | "heco-mainnet" | "nervos-godwoken-mainnet" | "axie-mainnet" | "evmos-mainnet" | "astar-mainnet" | "iotex-mainnet" | "harmony-mainnet" | "cronos-mainnet" | "aurora-mainnet" | "emerald-paratime-mainnet" | "boba-mainnet" | "eth-goerli" | "matic-mumbai" | "avalanche-testnet" | "bsc-testnet" | "moonbeam-moonbase-alpha" | "rsk-testnet" | "arbitrum-goerli" | "fantom-testnet" | "palm-testnet" | "heco-testnet" | "nervos-godwoken-testnet" | "evmos-testnet" | "astar-shiden" | "iotex-testnet" | "harmony-testnet" | "aurora-testnet" | "scroll-l2-testnet" | "scroll-l1-testnet" | "covalent-internal-network-v1" | "defi-kingdoms-mainnet" | "swimmer-mainnet" | "boba-avalanche-mainnet" | "boba-bobabeam-mainnet" | "boba-bnb-mainnet" | "boba-rinkeby-testnet" | "boba-bobabase-testnet" | "boba-bnb-testnet" | "boba-avalanche-testnet" | "klaytn-testnet" | "gather-mainnet" | "gather-testnet" | "optimism-mainnet" | "skale-calypso" | "skale-mainnet" | "skale-razor" | "avalanche-dexalot-mainnet" | "skale-omnus" | "avalanche-dexalot-testnet" | "astar-shibuya" | "cronos-testnet" | "defi-kingdoms-testnet" | "metis-mainnet" | "metis-testnet" | "milkomeda-a1-mainnet" | "milkomeda-a1-devnet" | "milkomeda-c1-mainnet" | "milkomeda-c1-devnet" | "swimmer-testnet" | "solana-mainnet" | "skale-europa" | "meter-mainnet" | "meter-testnet" | "skale-exorde" | "boba-goerli" | "neon-testnet" | "skale-staging-uum" | "skale-staging-lcc" | "arbitrum-nova-mainnet" | "canto-mainnet" | "bittorrent-mainnet" | "bittorrent-testnet" | "flarenetworks-flare-mainnet" | "flarenetworks-flare-testnet" | "flarenetworks-canary-mainnet" | "flarenetworks-canary-testnet" | "kcc-mainnet" | "kcc-testnet" | "polygon-zkevm-testnet" | "linea-testnet" | "base-testnet" | "mantle-testnet" | "scroll-alpha-testnet" | "oasys-mainnet" | "oasys-testnet" | "findora-mainnet" | "findora-forge-testnet" | "sx-mainnet", contractAddress: string, noMetadata?: boolean, pageSize?: number, pageNumber?: number, traitsFilter?: string, valuesFilter?: string): Promise<Response<NftMetadataResponse>>;
getTokenIdsForContractWithMetadata(chainName: "btc-mainnet" | "eth-mainnet" | "matic-mainnet" | "bsc-mainnet" | "avalanche-mainnet" | "fantom-mainnet" | "moonbeam-mainnet" | "moonbeam-moonriver" | "rsk-mainnet" | "arbitrum-mainnet" | "palm-mainnet" | "klaytn-mainnet" | "heco-mainnet" | "nervos-godwoken-mainnet" | "axie-mainnet" | "evmos-mainnet" | "astar-mainnet" | "iotex-mainnet" | "harmony-mainnet" | "cronos-mainnet" | "aurora-mainnet" | "emerald-paratime-mainnet" | "boba-mainnet" | "eth-goerli" | "matic-mumbai" | "avalanche-testnet" | "bsc-testnet" | "moonbeam-moonbase-alpha" | "rsk-testnet" | "arbitrum-goerli" | "fantom-testnet" | "palm-testnet" | "heco-testnet" | "nervos-godwoken-testnet" | "evmos-testnet" | "astar-shiden" | "iotex-testnet" | "harmony-testnet" | "aurora-testnet" | "scroll-l2-testnet" | "scroll-l1-testnet" | "covalent-internal-network-v1" | "defi-kingdoms-mainnet" | "swimmer-mainnet" | "boba-avalanche-mainnet" | "boba-bobabeam-mainnet" | "boba-bnb-mainnet" | "boba-rinkeby-testnet" | "boba-bobabase-testnet" | "boba-bnb-testnet" | "boba-avalanche-testnet" | "klaytn-testnet" | "gather-mainnet" | "gather-testnet" | "optimism-mainnet" | "skale-calypso" | "skale-mainnet" | "skale-razor" | "avalanche-dexalot-mainnet" | "skale-omnus" | "avalanche-dexalot-testnet" | "astar-shibuya" | "cronos-testnet" | "defi-kingdoms-testnet" | "metis-mainnet" | "metis-testnet" | "milkomeda-a1-mainnet" | "milkomeda-a1-devnet" | "milkomeda-c1-mainnet" | "milkomeda-c1-devnet" | "swimmer-testnet" | "solana-mainnet" | "skale-europa" | "meter-mainnet" | "meter-testnet" | "skale-exorde" | "boba-goerli" | "neon-testnet" | "skale-staging-uum" | "skale-staging-lcc" | "arbitrum-nova-mainnet" | "canto-mainnet" | "bittorrent-mainnet" | "bittorrent-testnet" | "flarenetworks-flare-mainnet" | "flarenetworks-flare-testnet" | "flarenetworks-canary-mainnet" | "flarenetworks-canary-testnet" | "kcc-mainnet" | "kcc-testnet" | "polygon-zkevm-testnet" | "linea-testnet" | "base-testnet" | "mantle-testnet" | "scroll-alpha-testnet" | "oasys-mainnet" | "oasys-testnet" | "findora-mainnet" | "findora-forge-testnet" | "sx-mainnet", contractAddress: string, noMetadata?: boolean, pageSize?: number, pageNumber?: number, traitsFilter?: string, valuesFilter?: string, withUncached?: boolean): Promise<Response<NftMetadataResponse>>;
/**
*
* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} contractAddress - The requested NFT contract. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} contractAddress - The requested NFT contract. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {boolean} noMetadata - Omit metadata.

@@ -213,7 +215,7 @@ * @param {boolean} withUncached - By defaut, this endpoint only works on chains where we've cached the metadata. When set to `true`, the API will fetch metadata from upstream servers even if it's not cached - the downside being that the upstream streams can block or rate limit us and therefore resulting in time outs or slow response times.

*/
getNftMetadataForGivenTokenIDForContract(chainName: "btc-mainnet" | "eth-mainnet" | "matic-mainnet" | "bsc-mainnet" | "avalanche-mainnet" | "fantom-mainnet" | "moonbeam-mainnet" | "moonbeam-moonriver" | "rsk-mainnet" | "arbitrum-mainnet" | "palm-mainnet" | "klaytn-mainnet" | "heco-mainnet" | "nervos-godwoken-mainnet" | "axie-mainnet" | "evmos-mainnet" | "astar-mainnet" | "iotex-mainnet" | "harmony-mainnet" | "cronos-mainnet" | "aurora-mainnet" | "emerald-paratime-mainnet" | "boba-mainnet" | "eth-goerli" | "matic-mumbai" | "avalanche-testnet" | "bsc-testnet" | "moonbeam-moonbase-alpha" | "rsk-testnet" | "arbitrum-goerli" | "fantom-testnet" | "palm-testnet" | "heco-testnet" | "nervos-godwoken-testnet" | "evmos-testnet" | "astar-shiden" | "iotex-testnet" | "harmony-testnet" | "aurora-testnet" | "scroll-l2-testnet" | "scroll-l1-testnet" | "covalent-internal-network-v1" | "defi-kingdoms-mainnet" | "swimmer-mainnet" | "boba-avalanche-mainnet" | "boba-bobabeam-mainnet" | "boba-bnb-mainnet" | "boba-rinkeby-testnet" | "boba-bobabase-testnet" | "boba-bnb-testnet" | "boba-avalanche-testnet" | "klaytn-testnet" | "gather-mainnet" | "gather-testnet" | "optimism-mainnet" | "skale-calypso" | "skale-mainnet" | "skale-razor" | "avalanche-dexalot-mainnet" | "skale-omnus" | "avalanche-dexalot-testnet" | "astar-shibuya" | "cronos-testnet" | "defi-kingdoms-testnet" | "metis-mainnet" | "metis-testnet" | "milkomeda-a1-mainnet" | "milkomeda-a1-devnet" | "milkomeda-c1-mainnet" | "milkomeda-c1-devnet" | "swimmer-testnet" | "solana-mainnet" | "skale-europa" | "meter-mainnet" | "meter-testnet" | "skale-exorde" | "boba-goerli" | "neon-testnet" | "skale-staging-uum" | "skale-staging-lcc" | "arbitrum-nova-mainnet" | "canto-mainnet" | "bittorrent-mainnet" | "bittorrent-testnet" | "flarenetworks-flare-mainnet" | "flarenetworks-flare-testnet" | "flarenetworks-canary-mainnet" | "flarenetworks-canary-testnet" | "kcc-mainnet" | "kcc-testnet" | "polygon-zkevm-testnet" | "linea-testnet" | "base-testnet" | "mantle-testnet" | "scroll-alpha-testnet" | "oasys-mainnet" | "oasys-testnet" | "findora-mainnet" | "findora-forge-testnet" | "sx-mainnet", contractAddress: string, noMetadata?: boolean, withUncached?: boolean, tokenId?: string): Promise<Response<NftMetadataResponse>>;
getNftMetadataForGivenTokenIDForContract(chainName: "btc-mainnet" | "eth-mainnet" | "matic-mainnet" | "bsc-mainnet" | "avalanche-mainnet" | "fantom-mainnet" | "moonbeam-mainnet" | "moonbeam-moonriver" | "rsk-mainnet" | "arbitrum-mainnet" | "palm-mainnet" | "klaytn-mainnet" | "heco-mainnet" | "nervos-godwoken-mainnet" | "axie-mainnet" | "evmos-mainnet" | "astar-mainnet" | "iotex-mainnet" | "harmony-mainnet" | "cronos-mainnet" | "aurora-mainnet" | "emerald-paratime-mainnet" | "boba-mainnet" | "eth-goerli" | "matic-mumbai" | "avalanche-testnet" | "bsc-testnet" | "moonbeam-moonbase-alpha" | "rsk-testnet" | "arbitrum-goerli" | "fantom-testnet" | "palm-testnet" | "heco-testnet" | "nervos-godwoken-testnet" | "evmos-testnet" | "astar-shiden" | "iotex-testnet" | "harmony-testnet" | "aurora-testnet" | "scroll-l2-testnet" | "scroll-l1-testnet" | "covalent-internal-network-v1" | "defi-kingdoms-mainnet" | "swimmer-mainnet" | "boba-avalanche-mainnet" | "boba-bobabeam-mainnet" | "boba-bnb-mainnet" | "boba-rinkeby-testnet" | "boba-bobabase-testnet" | "boba-bnb-testnet" | "boba-avalanche-testnet" | "klaytn-testnet" | "gather-mainnet" | "gather-testnet" | "optimism-mainnet" | "skale-calypso" | "skale-mainnet" | "skale-razor" | "avalanche-dexalot-mainnet" | "skale-omnus" | "avalanche-dexalot-testnet" | "astar-shibuya" | "cronos-testnet" | "defi-kingdoms-testnet" | "metis-mainnet" | "metis-testnet" | "milkomeda-a1-mainnet" | "milkomeda-a1-devnet" | "milkomeda-c1-mainnet" | "milkomeda-c1-devnet" | "swimmer-testnet" | "solana-mainnet" | "skale-europa" | "meter-mainnet" | "meter-testnet" | "skale-exorde" | "boba-goerli" | "neon-testnet" | "skale-staging-uum" | "skale-staging-lcc" | "arbitrum-nova-mainnet" | "canto-mainnet" | "bittorrent-mainnet" | "bittorrent-testnet" | "flarenetworks-flare-mainnet" | "flarenetworks-flare-testnet" | "flarenetworks-canary-mainnet" | "flarenetworks-canary-testnet" | "kcc-mainnet" | "kcc-testnet" | "polygon-zkevm-testnet" | "linea-testnet" | "base-testnet" | "mantle-testnet" | "scroll-alpha-testnet" | "oasys-mainnet" | "oasys-testnet" | "findora-mainnet" | "findora-forge-testnet" | "sx-mainnet", contractAddress: string, tokenId: string, noMetadata?: boolean, withUncached?: boolean): Promise<Response<NftMetadataResponse>>;
/**
*
* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} contractAddress - The requested NFT contract address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} contractAddress - The requested NFT contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} tokenId - The requested token ID.

@@ -227,3 +229,3 @@ * @param {boolean} noSpam - If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
*

@@ -235,3 +237,3 @@ */

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} trait - The requested trait.

@@ -244,3 +246,3 @@ *

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
*

@@ -252,3 +254,3 @@ */

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} collectionContract - The requested collection address.

@@ -261,4 +263,4 @@ *

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} tokenId - The requested token ID.

@@ -271,3 +273,3 @@ *

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} contractAddress - The requested NFT contract. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} contractAddress - The requested NFT contract. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} tokenId - The requested token ID.

@@ -274,0 +276,0 @@ *

@@ -18,4 +18,5 @@ "use strict";

async getChainCollections(chainName, pageSize, pageNumber, noSpam) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -40,5 +41,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -59,10 +66,12 @@ else {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {boolean} noSpam - If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
* @param {boolean} noNftAssetMetadata - If `true`, the response shape is limited to a list of collections and token ids, omitting metadata and asset information. Helpful for faster response times and wallets holding a large number of NFTs.
* @param {boolean} withUncached - By defaut, this endpoint only works on chains where we've cached the metadata. When set to `true`, the API will fetch metadata from upstream servers even if it's not cached - the downside being that the upstream streams can block or rate limit us and therefore resulting in time outs or slow response times.
*
*/
async getNftsForAddress(chainName, walletAddress, noSpam, noNftAssetMetadata) {
let retryCount = 0;
async getNftsForAddress(chainName, walletAddress, noSpam, noNftAssetMetadata, withUncached) {
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -77,2 +86,5 @@ try {

}
if (withUncached !== undefined) {
urlParams.append("with-uncached", withUncached.toString());
}
const response = await fetch(`https://api.covalenthq.com/v1/${chainName}/address/${walletAddress}/balances_nft/?${urlParams}`, {

@@ -85,5 +97,11 @@ headers: {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -104,3 +122,3 @@ else {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} contractAddress - The requested NFT contract. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} contractAddress - The requested NFT contract. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {boolean} noMetadata - Omit metadata.

@@ -111,7 +129,9 @@ * @param {number} pageSize - Number of items on a page.

* @param {string} valuesFilter - Filters NFTs based on a specific trait value. If this filter is used, the API will return all NFTs with the specified trait value. If used with "traits-filter", only NFTs matching both filters will be returned. Accepts comma-separated values, is case-sensitive, and requires proper URL encoding.
* @param {boolean} withUncached - By defaut, this endpoint only works on chains where we've cached the metadata. When set to `true`, the API will fetch metadata from upstream servers even if it's not cached - the downside being that the upstream streams can block or rate limit us and therefore resulting in time outs or slow response times. The `traits-filter` and `values-filter` are also disabled.
*
*/
async getTokenIdsForContractWithMetadata(chainName, contractAddress, noMetadata, pageSize, pageNumber, traitsFilter, valuesFilter) {
let retryCount = 0;
async getTokenIdsForContractWithMetadata(chainName, contractAddress, noMetadata, pageSize, pageNumber, traitsFilter, valuesFilter, withUncached) {
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -135,2 +155,5 @@ try {

}
if (withUncached !== undefined) {
urlParams.append("with-uncached", withUncached.toString());
}
const response = await fetch(`https://api.covalenthq.com/v1/${chainName}/nft/${contractAddress}/metadata/?${urlParams}`, {

@@ -143,5 +166,11 @@ headers: {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -162,3 +191,3 @@ else {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} contractAddress - The requested NFT contract. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} contractAddress - The requested NFT contract. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {boolean} noMetadata - Omit metadata.

@@ -169,5 +198,6 @@ * @param {boolean} withUncached - By defaut, this endpoint only works on chains where we've cached the metadata. When set to `true`, the API will fetch metadata from upstream servers even if it's not cached - the downside being that the upstream streams can block or rate limit us and therefore resulting in time outs or slow response times.

*/
async getNftMetadataForGivenTokenIDForContract(chainName, contractAddress, noMetadata, withUncached, tokenId) {
let retryCount = 0;
async getNftMetadataForGivenTokenIDForContract(chainName, contractAddress, tokenId, noMetadata, withUncached) {
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -189,5 +219,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -208,3 +244,3 @@ else {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} contractAddress - The requested NFT contract address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} contractAddress - The requested NFT contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} tokenId - The requested token ID.

@@ -215,4 +251,5 @@ * @param {boolean} noSpam - If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.

async getNftTransactionsForContractTokenId(chainName, contractAddress, tokenId, noSpam) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -231,5 +268,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -250,8 +293,9 @@ else {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
*
*/
async getTraitsForCollection(chainName, collectionContract) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -267,5 +311,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -286,3 +336,3 @@ else {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} trait - The requested trait.

@@ -292,4 +342,5 @@ *

async getAttributesForTraitInCollection(chainName, collectionContract, trait) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -305,5 +356,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -324,8 +381,9 @@ else {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
*
*/
async getCollectionTraitsSummary(chainName, collectionContract) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -341,5 +399,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -360,3 +424,3 @@ else {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} collectionContract - The requested collection address.

@@ -366,4 +430,5 @@ *

async checkOwnershipInNft(chainName, walletAddress, collectionContract) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -379,5 +444,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -398,4 +469,4 @@ else {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} tokenId - The requested token ID.

@@ -405,4 +476,5 @@ *

async checkOwnershipInNftForSpecificTokenId(chainName, walletAddress, collectionContract, tokenId) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -418,5 +490,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -437,3 +515,3 @@ else {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} contractAddress - The requested NFT contract. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} contractAddress - The requested NFT contract. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} tokenId - The requested token ID.

@@ -443,4 +521,5 @@ *

async getNftExternalMetadataForContract(chainName, contractAddress, tokenId) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -456,5 +535,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -461,0 +546,0 @@ else {

@@ -44,3 +44,3 @@ interface TokenPricesResponse {

* @param {string} quoteCurrency - The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
* @param {string} contractAddress - Contract address for the token. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} contractAddress - Contract address for the token. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} from - The start day of the historical price range (YYYY-MM-DD).

@@ -47,0 +47,0 @@ * @param {string} to - The end day of the historical price range (YYYY-MM-DD).

@@ -13,3 +13,3 @@ "use strict";

* @param {string} quoteCurrency - The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
* @param {string} contractAddress - Contract address for the token. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} contractAddress - Contract address for the token. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
* @param {string} from - The start day of the historical price range (YYYY-MM-DD).

@@ -21,4 +21,5 @@ * @param {string} to - The end day of the historical price range (YYYY-MM-DD).

async getTokenPrices(chainName, quoteCurrency, contractAddress, from, to, pricesAtAsc) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -43,5 +44,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -48,0 +55,0 @@ else {

@@ -110,9 +110,9 @@ interface TransactionResponse {

/**
*
* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {number} blockHeight - The requested block height.
* @param {string} quoteCurrency - The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
* @param {boolean} noLogs - Omit log events.
*
*/
*
* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {number} blockHeight - The requested block height.
* @param {string} quoteCurrency - The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
* @param {boolean} noLogs - Omit log events.
*
*/
getTransactionsForBlock(chainName: "btc-mainnet" | "eth-mainnet" | "matic-mainnet" | "bsc-mainnet" | "avalanche-mainnet" | "fantom-mainnet" | "moonbeam-mainnet" | "moonbeam-moonriver" | "rsk-mainnet" | "arbitrum-mainnet" | "palm-mainnet" | "klaytn-mainnet" | "heco-mainnet" | "nervos-godwoken-mainnet" | "axie-mainnet" | "evmos-mainnet" | "astar-mainnet" | "iotex-mainnet" | "harmony-mainnet" | "cronos-mainnet" | "aurora-mainnet" | "emerald-paratime-mainnet" | "boba-mainnet" | "eth-goerli" | "matic-mumbai" | "avalanche-testnet" | "bsc-testnet" | "moonbeam-moonbase-alpha" | "rsk-testnet" | "arbitrum-goerli" | "fantom-testnet" | "palm-testnet" | "heco-testnet" | "nervos-godwoken-testnet" | "evmos-testnet" | "astar-shiden" | "iotex-testnet" | "harmony-testnet" | "aurora-testnet" | "scroll-l2-testnet" | "scroll-l1-testnet" | "covalent-internal-network-v1" | "defi-kingdoms-mainnet" | "swimmer-mainnet" | "boba-avalanche-mainnet" | "boba-bobabeam-mainnet" | "boba-bnb-mainnet" | "boba-rinkeby-testnet" | "boba-bobabase-testnet" | "boba-bnb-testnet" | "boba-avalanche-testnet" | "klaytn-testnet" | "gather-mainnet" | "gather-testnet" | "optimism-mainnet" | "skale-calypso" | "skale-mainnet" | "skale-razor" | "avalanche-dexalot-mainnet" | "skale-omnus" | "avalanche-dexalot-testnet" | "astar-shibuya" | "cronos-testnet" | "defi-kingdoms-testnet" | "metis-mainnet" | "metis-testnet" | "milkomeda-a1-mainnet" | "milkomeda-a1-devnet" | "milkomeda-c1-mainnet" | "milkomeda-c1-devnet" | "swimmer-testnet" | "solana-mainnet" | "skale-europa" | "meter-mainnet" | "meter-testnet" | "skale-exorde" | "boba-goerli" | "neon-testnet" | "skale-staging-uum" | "skale-staging-lcc" | "arbitrum-nova-mainnet" | "canto-mainnet" | "bittorrent-mainnet" | "bittorrent-testnet" | "flarenetworks-flare-mainnet" | "flarenetworks-flare-testnet" | "flarenetworks-canary-mainnet" | "flarenetworks-canary-testnet" | "kcc-mainnet" | "kcc-testnet" | "polygon-zkevm-testnet" | "linea-testnet" | "base-testnet" | "mantle-testnet" | "scroll-alpha-testnet" | "oasys-mainnet" | "oasys-testnet" | "findora-mainnet" | "findora-forge-testnet" | "sx-mainnet", blockHeight: number, quoteCurrency?: "USD" | "CAD" | "EUR" | "SGD" | "INR" | "JPY" | "VND" | "CNY" | "KRW" | "RUB" | "TRY" | "NGN" | "ARS" | "AUD" | "CHF" | "GBP", noLogs?: boolean): Promise<Response<TransactionsBlockResponse>>;

@@ -122,3 +122,3 @@ /**

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
*

@@ -125,0 +125,0 @@ */

@@ -7,3 +7,4 @@ "use strict";

let hasNext = true;
let retryCount = 0;
let retryCount = 1;
const maxRetries = 5;
while (hasNext) {

@@ -18,8 +19,15 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
hasNext = false;
yield data;
}
}
else {
yield data;
retryCount = 1;
if (data.data.links.prev === null) {

@@ -53,4 +61,5 @@ hasNext = false;

async getTransaction(chainName, txHash, quoteCurrency, noLogs, withDex, withNftSales, withLending) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -81,5 +90,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -106,3 +121,2 @@ else {

async *getRecentTransactionsForAddress(chainName, walletAddress, quoteCurrency, noLogs) {
let retryCount = 0;
let success = false;

@@ -130,12 +144,13 @@ while (!success) {

/**
*
* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {number} blockHeight - The requested block height.
* @param {string} quoteCurrency - The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
* @param {boolean} noLogs - Omit log events.
*
*/
*
* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {number} blockHeight - The requested block height.
* @param {string} quoteCurrency - The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
* @param {boolean} noLogs - Omit log events.
*
*/
async getTransactionsForBlock(chainName, blockHeight, quoteCurrency, noLogs) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -157,5 +172,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -176,8 +197,9 @@ else {

* @param {string} chainName - The chain name eg: `eth-mainnet`.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
*
*/
async getTransactionSummary(chainName, walletAddress) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -193,5 +215,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -198,0 +226,0 @@ else {

@@ -311,3 +311,3 @@ interface PoolResponse {

* @param {string} dexName - The DEX name eg: `uniswap_v2`.
* @param {string} poolAddress - The pool contract address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} poolAddress - The pool contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
*

@@ -341,3 +341,3 @@ */

* @param {string} dexName - The DEX name eg: `uniswap`.
* @param {string} tokenAddress - The token contract address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} tokenAddress - The token contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
*

@@ -358,3 +358,3 @@ */

* @param {string} dexName - The DEX name eg: `uniswap`.
* @param {string} tokenAddress - The token contract address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} tokenAddress - The token contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
*

@@ -367,3 +367,3 @@ */

* @param {string} dexName - The DEX name eg: `uniswap`.
* @param {string} poolAddress - The pool contract address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} poolAddress - The pool contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
*

@@ -370,0 +370,0 @@ */

@@ -16,4 +16,5 @@ "use strict";

async getPools(chainName, dexName) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -29,5 +30,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -49,8 +56,9 @@ else {

* @param {string} dexName - The DEX name eg: `uniswap_v2`.
* @param {string} poolAddress - The pool contract address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} poolAddress - The pool contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
*
*/
async getPoolByAddress(chainName, dexName, poolAddress) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -66,5 +74,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -90,4 +104,5 @@ else {

async getAddressExchangeBalances(chainName, dexName, accountAddress) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -103,5 +118,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -126,4 +147,5 @@ else {

async getNetworkExchangeTokens(chainName, dexName) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -139,5 +161,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -161,4 +189,5 @@ else {

async getSupportedDEXes() {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -174,5 +203,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -194,8 +229,9 @@ else {

* @param {string} dexName - The DEX name eg: `uniswap`.
* @param {string} tokenAddress - The token contract address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} tokenAddress - The token contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
*
*/
async getSingleNetworkExchangeToken(chainName, dexName, tokenAddress) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -211,5 +247,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -235,4 +277,5 @@ else {

async getTransactionsForAccountAddress(chainName, dexName, accountAddress) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -248,5 +291,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -268,8 +317,9 @@ else {

* @param {string} dexName - The DEX name eg: `uniswap`.
* @param {string} tokenAddress - The token contract address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} tokenAddress - The token contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
*
*/
async getTransactionsForTokenAddress(chainName, dexName, tokenAddress) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -285,5 +335,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -305,8 +361,9 @@ else {

* @param {string} dexName - The DEX name eg: `uniswap`.
* @param {string} poolAddress - The pool contract address. Passing in an `ENS`, `RNS`, or an `Unstoppable Domain` resolves automatically.
* @param {string} poolAddress - The pool contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
*
*/
async getTransactionsForExchange(chainName, dexName, poolAddress) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -322,5 +379,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -345,4 +408,5 @@ else {

async getEcosystemChartData(chainName, dexName) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -358,5 +422,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -381,4 +451,5 @@ else {

async getHealthData(chainName, dexName) {
let retryCount = 0;
let retryCount = 1;
let success = false;
const maxRetries = 5;
while (!success) {

@@ -394,5 +465,11 @@ try {

if (data.error && data.error_code === 429) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
if (retryCount < maxRetries) {
retryCount++;
const delayMs = Math.pow(2, retryCount) * baseDelayMs; // Exponential delay calculation
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
else {
success = true;
return data;
}
}

@@ -399,0 +476,0 @@ else {

{
"name": "@covalenthq/client-sdk",
"version": "0.1.0",
"version": "0.1.1",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "types": "dist/index.d.ts",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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