@covalenthq/client-sdk 2.3.6 → 2.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "2.3.6";
3
+ var version = "2.3.8";
4
4
 
5
5
  const bigIntParser = (val) => {
6
6
  if (val === null || val === undefined) {
@@ -39,6 +39,8 @@ class AllChainsService {
39
39
  *
40
40
  * Commonly used to locate chains which an address is active on with a single API call.
41
41
  *
42
+ * **Credit Cost**: 0.5 per call
43
+ *
42
44
  * @param {string} walletAddress - The requested wallet address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
43
45
  * @param {GetAddressActivityQueryParamOpts} queryParamOpts
44
46
  * - `testnets`: Set to true to include testnets with activity in the response. By default, it's set to `false` and only returns mainnet activity.
@@ -165,6 +167,10 @@ class AllChainsService {
165
167
  return await this.getMultiChainMultiAddressTransactions(queryParamOpts);
166
168
  }
167
169
  /**
170
+ *
171
+ * Fetch paginated spot & historical native and token balances for a single address on up to 10 EVM chains with one API call.
172
+ *
173
+ * **Credit Cost**: 2.5 per call
168
174
  *
169
175
  * @param {string} walletAddress - The requested wallet Address.
170
176
  * @param {GetMultiChainBalanceQueryParamOpts} queryParamOpts
@@ -253,13 +259,12 @@ async function* paginateEndpoint(endpoint, execution, parseData, implementation)
253
259
  }
254
260
  catch (error) {
255
261
  hasMore = false;
262
+ const err = error;
256
263
  yield {
257
264
  data: null,
258
265
  error: true,
259
- error_code: error?.cause?.code || error?.error_code || 500,
260
- error_message: error?.cause?.message ||
261
- error?.error_message ||
262
- "Internal server error",
266
+ error_code: err?.cause?.code || err?.error_code || 500,
267
+ error_message: err?.cause?.message || err?.error_message || "Internal server error",
263
268
  };
264
269
  }
265
270
  }
@@ -275,7 +280,9 @@ class BalanceService {
275
280
  }
276
281
  /**
277
282
  *
278
- * Commonly used to fetch the native, fungible (ERC20), and non-fungible (ERC721 & ERC1155) tokens held by an address. Response includes spot prices and other metadata.
283
+ * Commonly used to fetch the native and fungible (ERC20) tokens held by an address. Response includes spot prices and other metadata.
284
+ *
285
+ * **Credit Cost**: 1 per call
279
286
  *
280
287
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
281
288
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
@@ -342,6 +349,8 @@ class BalanceService {
342
349
  *
343
350
  * Commonly used to render a daily portfolio balance for an address broken down by the token. The timeframe is user-configurable, defaults to 30 days.
344
351
  *
352
+ * **Credit Cost**: 2 per 30 days
353
+ *
345
354
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
346
355
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
347
356
  * @param {GetHistoricalPortfolioForWalletAddressQueryParamOpts} queryParamOpts
@@ -400,6 +409,8 @@ class BalanceService {
400
409
  *
401
410
  * Commonly used to render the transfer-in and transfer-out of a token along with historical prices from an address.
402
411
  *
412
+ * **Credit Cost**: 0.05 per item
413
+ *
403
414
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
404
415
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
405
416
  * @param {GetErc20TransfersForWalletAddressQueryParamOpts} queryParamOpts
@@ -474,6 +485,8 @@ class BalanceService {
474
485
  *
475
486
  * Commonly used to render the transfer-in and transfer-out of a token along with historical prices from an address.
476
487
  *
488
+ * **Credit Cost**: 0.05 per item
489
+ *
477
490
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
478
491
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
479
492
  * @param {GetErc20TransfersForWalletAddressQueryParamOpts} queryParamOpts
@@ -542,7 +555,9 @@ class BalanceService {
542
555
  }
543
556
  /**
544
557
  *
545
- * Commonly used to get a list of all the token holders for a specified ERC20 or ERC721 token. Returns historic token holders when block-height is set (defaults to `latest`). Useful for building pie charts of token holders.
558
+ * Used to get a paginated list of current or historical token holders for a specified ERC20 or ERC721 token.
559
+ *
560
+ * **Credit Cost**: 0.02 per item
546
561
  *
547
562
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
548
563
  * @param {string} tokenAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
@@ -593,7 +608,9 @@ class BalanceService {
593
608
  }
594
609
  /**
595
610
  *
596
- * Commonly used to get a list of all the token holders for a specified ERC20 or ERC721 token. Returns historic token holders when block-height is set (defaults to `latest`). Useful for building pie charts of token holders.
611
+ * Used to get a paginated list of current or historical token holders for a specified ERC20 or ERC721 token.
612
+ *
613
+ * **Credit Cost**: 0.02 per item
597
614
  *
598
615
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
599
616
  * @param {string} tokenAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
@@ -642,7 +659,9 @@ class BalanceService {
642
659
  }
643
660
  /**
644
661
  *
645
- * Commonly used to fetch the historical native, fungible (ERC20), and non-fungible (ERC721 & ERC1155) tokens held by an address at a given block height or date. Response includes daily prices and other metadata.
662
+ * Commonly used to fetch the historical native and fungible (ERC20) tokens held by an address at a given block height or date. Response includes daily prices and other metadata.
663
+ *
664
+ * **Credit Cost**: 1 per call
646
665
  *
647
666
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
648
667
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
@@ -715,6 +734,10 @@ class BalanceService {
715
734
  return await this.execution.execute(endpoint, parseData);
716
735
  }
717
736
  /**
737
+ *
738
+ * Lightweight endpoint to just get the native token balance for an EVM address.
739
+ *
740
+ * **Credit Cost**: 0.5 per call
718
741
  *
719
742
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
720
743
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
@@ -764,6 +787,8 @@ class BaseService {
764
787
  *
765
788
  * Commonly used to fetch and render a single block for a block explorer.
766
789
  *
790
+ * **Credit Cost**: 1 per call
791
+ *
767
792
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
768
793
  * @param {string} blockHeight - The block height or `latest` for the latest block available.
769
794
  *
@@ -790,7 +815,9 @@ class BaseService {
790
815
  }
791
816
  /**
792
817
  *
793
- * Commonly used to resolve ENS, RNS and Unstoppable Domains addresses.
818
+ * Commonly used to resolve ENS, RNS and Unstoppable Domains addresses. Only supports the resolution of a registered domain to an address.
819
+ *
820
+ * **Credit Cost**: 1 per call
794
821
  *
795
822
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
796
823
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
@@ -807,6 +834,8 @@ class BaseService {
807
834
  *
808
835
  * Commonly used to get all the block heights within a particular date range. Useful for rendering a display where you sort blocks by day.
809
836
  *
837
+ * **Credit Cost**: 1 per call
838
+ *
810
839
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
811
840
  * @param {string} startDate - The start date in YYYY-MM-DD format.
812
841
  * @param {string | "latest"} endDate - The end date in YYYY-MM-DD format. Also accepts "latest" for the latest block height
@@ -850,6 +879,8 @@ class BaseService {
850
879
  *
851
880
  * Commonly used to get all the block heights within a particular date range. Useful for rendering a display where you sort blocks by day.
852
881
  *
882
+ * **Credit Cost**: 1 per call
883
+ *
853
884
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
854
885
  * @param {string} startDate - The start date in YYYY-MM-DD format.
855
886
  * @param {string | "latest"} endDate - The end date in YYYY-MM-DD format. Also accepts "latest" for the latest block height
@@ -891,6 +922,8 @@ class BaseService {
891
922
  *
892
923
  * Commonly used to get all the event logs of the latest block, or for a range of blocks. Includes sender contract metadata as well as decoded logs.
893
924
  *
925
+ * **Credit Cost**: 0.01 per item
926
+ *
894
927
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
895
928
  * @param {GetLogsQueryParamOpts} queryParamOpts
896
929
  * - `startingBlock`: The first block to retrieve log events with. Accepts decimals, hexadecimals, or the strings `earliest` and `latest`.
@@ -950,6 +983,8 @@ class BaseService {
950
983
  *
951
984
  * Commonly used to get all the event logs emitted from a particular contract address. Useful for building dashboards that examine on-chain interactions.
952
985
  *
986
+ * **Credit Cost**: 0.01 per item
987
+ *
953
988
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
954
989
  * @param {string} contractAddress - The requested contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
955
990
  * @param {GetLogEventsByAddressQueryParamOpts} queryParamOpts
@@ -1002,6 +1037,8 @@ class BaseService {
1002
1037
  *
1003
1038
  * Commonly used to get all the event logs emitted from a particular contract address. Useful for building dashboards that examine on-chain interactions.
1004
1039
  *
1040
+ * **Credit Cost**: 0.01 per item
1041
+ *
1005
1042
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
1006
1043
  * @param {string} contractAddress - The requested contract address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
1007
1044
  * @param {GetLogEventsByAddressQueryParamOpts} queryParamOpts
@@ -1052,6 +1089,8 @@ class BaseService {
1052
1089
  *
1053
1090
  * Commonly used to get all event logs of the same topic hash across all contracts within a particular chain. Useful for cross-sectional analysis of event logs that are emitted on-chain.
1054
1091
  *
1092
+ * **Credit Cost**: 0.01 per item
1093
+ *
1055
1094
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
1056
1095
  * @param {string} topicHash - The endpoint will return event logs that contain this topic hash.
1057
1096
  * @param {GetLogEventsByTopicHashQueryParamOpts} queryParamOpts
@@ -1109,6 +1148,8 @@ class BaseService {
1109
1148
  *
1110
1149
  * Commonly used to get all event logs of the same topic hash across all contracts within a particular chain. Useful for cross-sectional analysis of event logs that are emitted on-chain.
1111
1150
  *
1151
+ * **Credit Cost**: 0.01 per item
1152
+ *
1112
1153
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
1113
1154
  * @param {string} topicHash - The endpoint will return event logs that contain this topic hash.
1114
1155
  * @param {GetLogEventsByTopicHashQueryParamOpts} queryParamOpts
@@ -1164,6 +1205,7 @@ class BaseService {
1164
1205
  *
1165
1206
  * Commonly used to build internal dashboards for all supported chains on Covalent.
1166
1207
  *
1208
+ * **Credit Cost**: 0.01 per call
1167
1209
  *
1168
1210
  */
1169
1211
  async getAllChains() {
@@ -1188,6 +1230,7 @@ class BaseService {
1188
1230
  *
1189
1231
  * Commonly used to build internal status dashboards of all supported chains.
1190
1232
  *
1233
+ * **Credit Cost**: 1 per call
1191
1234
  *
1192
1235
  */
1193
1236
  async getAllChainStatus() {
@@ -1209,6 +1252,11 @@ class BaseService {
1209
1252
  return await this.execution.execute(endpoint, parseData);
1210
1253
  }
1211
1254
  /**
1255
+ *
1256
+ * Commonly used to locate chains which an address is active on with a single API call.
1257
+ *
1258
+ * **Credit Cost**: 0.5 per call
1259
+ *
1212
1260
  * @deprecated This method is deprecated and will be removed in the upcoming versions. Please use `AllChainsService.getAddressActivity` instead.
1213
1261
  *
1214
1262
  * Commonly used to locate chains which an address is active on with a single API call.
@@ -1244,6 +1292,10 @@ class BaseService {
1244
1292
  return await this.execution.execute(endpoint, parseData);
1245
1293
  }
1246
1294
  /**
1295
+ *
1296
+ * Get real-time gas estimates for different transaction speeds on a specific network, enabling users to optimize transaction costs and confirmation times.
1297
+ *
1298
+ * **Credit Cost**: 1 per call
1247
1299
  *
1248
1300
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
1249
1301
  * @param {string} eventType - The desired event type to retrieve gas prices for. Supports `erc20` transfer events, `uniswapv3` swap events and `nativetokens` transfers.
@@ -1276,6 +1328,7 @@ exports.ChainName = void 0;
1276
1328
  ChainName["ETH_MAINNET"] = "eth-mainnet";
1277
1329
  ChainName["ETH_SEPOLIA"] = "eth-sepolia";
1278
1330
  ChainName["ETH_HOLESKY"] = "eth-holesky";
1331
+ ChainName["ETH_HOODI"] = "eth-hoodi";
1279
1332
  ChainName["MATIC_MAINNET"] = "matic-mainnet";
1280
1333
  ChainName["AVALANCHE_MAINNET"] = "avalanche-mainnet";
1281
1334
  ChainName["AVALANCHE_TESTNET"] = "avalanche-testnet";
@@ -1288,93 +1341,48 @@ exports.ChainName = void 0;
1288
1341
  ChainName["ARBITRUM_NOVA_MAINNET"] = "arbitrum-nova-mainnet";
1289
1342
  ChainName["FANTOM_MAINNET"] = "fantom-mainnet";
1290
1343
  ChainName["FANTOM_TESTNET"] = "fantom-testnet";
1291
- ChainName["PALM_MAINNET"] = "palm-mainnet";
1292
- ChainName["PALM_TESTNET"] = "palm-testnet";
1293
1344
  ChainName["BTC_MAINNET"] = "btc-mainnet";
1294
1345
  ChainName["SOLANA_MAINNET"] = "solana-mainnet";
1295
1346
  ChainName["AXIE_MAINNET"] = "axie-mainnet";
1296
1347
  ChainName["OPTIMISM_MAINNET"] = "optimism-mainnet";
1297
1348
  ChainName["OPTIMISM_SEPOLIA"] = "optimism-sepolia";
1298
- ChainName["CRONOS_ZKEVM_TESTNET"] = "cronos-zkevm-testnet";
1299
1349
  ChainName["CRONOS_ZKEVM_MAINNET"] = "cronos-zkevm-mainnet";
1300
- ChainName["AURORA_MAINNET"] = "aurora-mainnet";
1301
- ChainName["AURORA_TESTNET"] = "aurora-testnet";
1302
1350
  ChainName["EMERALD_PARATIME_MAINNET"] = "emerald-paratime-mainnet";
1303
- ChainName["DEFI_KINGDOMS_MAINNET"] = "defi-kingdoms-mainnet";
1304
- ChainName["DEFI_KINGDOMS_TESTNET"] = "defi-kingdoms-testnet";
1305
- ChainName["BOBA_MAINNET"] = "boba-mainnet";
1306
- ChainName["BOBA_BNB_MAINNET"] = "boba-bnb-mainnet";
1307
- ChainName["BOBA_BNB_TESTNET"] = "boba-bnb-testnet";
1308
- ChainName["SCROLL_SEPOLIA_TESTNET"] = "scroll-sepolia-testnet";
1309
- ChainName["METIS_MAINNET"] = "metis-mainnet";
1310
- ChainName["AVALANCHE_DEXALOT_MAINNET"] = "avalanche-dexalot-mainnet";
1311
- ChainName["AVALANCHE_DEXALOT_TESTNET"] = "avalanche-dexalot-testnet";
1312
- ChainName["AVALANCHE_SHRAPNEL_MAINNET"] = "avalanche-shrapnel-mainnet";
1313
- ChainName["AVALANCHE_NUMBERS"] = "avalanche-numbers";
1314
- ChainName["AVALANCHE_XANACHAIN"] = "avalanche-xanachain";
1315
- ChainName["AVALANCHE_STEP_NETWORK"] = "avalanche-step-network";
1316
- ChainName["AVALANCHE_SHRAPNEL_TESTNET"] = "avalanche-shrapnel-testnet";
1317
- ChainName["AVALANCHE_BEAM_TESTNET"] = "avalanche-beam-testnet";
1318
- ChainName["AVALANCHE_BLITZ_TESTNET"] = "avalanche-blitz-testnet";
1319
- ChainName["AVALANCHE_UPTN"] = "avalanche-uptn";
1320
- ChainName["AVALANCHE_BEAM_MAINNET"] = "avalanche-beam-mainnet";
1321
- ChainName["AVALANCHE_MIRAI_TESTNET"] = "avalanche-mirai-testnet";
1351
+ ChainName["MONAD_TESTNET"] = "monad-testnet";
1352
+ ChainName["MONAD_MAINNET"] = "monad-mainnet";
1322
1353
  ChainName["BERACHAIN_MAINNET"] = "berachain-mainnet";
1354
+ ChainName["PLASMA_MAINNET"] = "plasma-mainnet";
1323
1355
  ChainName["UNICHAIN_MAINNET"] = "unichain-mainnet";
1356
+ ChainName["PLASMA_TESTNET"] = "plasma-testnet";
1357
+ ChainName["ARC_TESTNET"] = "arc-testnet";
1324
1358
  ChainName["CANTO_MAINNET"] = "canto-mainnet";
1325
- ChainName["FLARENETWORKS_FLARE_MAINNET"] = "flarenetworks-flare-mainnet";
1326
- ChainName["FLARENETWORKS_FLARE_TESTNET"] = "flarenetworks-flare-testnet";
1327
1359
  ChainName["LINEA_MAINNET"] = "linea-mainnet";
1328
- ChainName["POLYGON_ZKEVM_MAINNET"] = "polygon-zkevm-mainnet";
1329
1360
  ChainName["LINEA_SEPOLIA_TESTNET"] = "linea-sepolia-testnet";
1330
- ChainName["POLYGON_ZKEVM_TESTNET"] = "polygon-zkevm-testnet";
1331
1361
  ChainName["POLYGON_AMOY_TESTNET"] = "polygon-amoy-testnet";
1332
1362
  ChainName["MANTLE_MAINNET"] = "mantle-mainnet";
1333
- ChainName["POLYGON_ZKEVM_CARDONA_TESTNET"] = "polygon-zkevm-cardona-testnet";
1334
- ChainName["MANTLE_SEPOLIA_TESTNET"] = "mantle-sepolia-testnet";
1335
1363
  ChainName["BASE_MAINNET"] = "base-mainnet";
1336
- ChainName["BASE_SEPOLIA_TESTNET"] = "base-sepolia-testnet";
1337
1364
  ChainName["OASIS_SAPPHIRE_MAINNET"] = "oasis-sapphire-mainnet";
1338
- ChainName["SYNDR_TESTNET"] = "syndr-testnet";
1339
- ChainName["OASIS_SAPPHIRE_TESTNET"] = "oasis-sapphire-testnet";
1340
1365
  ChainName["CELO_MAINNET"] = "celo-mainnet";
1341
- ChainName["X1_MAINNET"] = "x1-mainnet";
1342
1366
  ChainName["HYPEREVM_MAINNET"] = "hyperevm-mainnet";
1343
- ChainName["HORIZEN_EON_MAINNET"] = "horizen-eon-mainnet";
1344
- ChainName["HORIZEN_GOBI_TESTNET"] = "horizen-gobi-testnet";
1345
- ChainName["FRAXTAL_MAINNET"] = "fraxtal-mainnet";
1346
- ChainName["APECHAIN_TESTNET"] = "apechain-testnet";
1367
+ ChainName["ADI_MAINNET"] = "adi-mainnet";
1347
1368
  ChainName["REDSTONE_MAINNET"] = "redstone-mainnet";
1348
1369
  ChainName["SEI_MAINNET"] = "sei-mainnet";
1349
1370
  ChainName["APECHAIN_MAINNET"] = "apechain-mainnet";
1350
1371
  ChainName["UNICHAIN_SEPOLIA_TESTNET"] = "unichain-sepolia-testnet";
1372
+ ChainName["SONIC_MAINNET"] = "sonic-mainnet";
1351
1373
  ChainName["WORLD_MAINNET"] = "world-mainnet";
1352
1374
  ChainName["WORLD_SEPOLIA_TESTNET"] = "world-sepolia-testnet";
1353
1375
  ChainName["LENS_SEPOLIA_TESTNET"] = "lens-sepolia-testnet";
1354
1376
  ChainName["INK_SEPOLIA_TESTNET"] = "ink-sepolia-testnet";
1355
1377
  ChainName["INK_MAINNET"] = "ink-mainnet";
1356
1378
  ChainName["LENS_MAINNET"] = "lens-mainnet";
1357
- ChainName["AVALANCHE_MELD_TESTNET"] = "avalanche-meld-testnet";
1358
- ChainName["AVALANCHE_MELD_MAINNET"] = "avalanche-meld-mainnet";
1359
- ChainName["GUNZILLA_TESTNET"] = "gunzilla-testnet";
1360
- ChainName["ZORA_MAINNET"] = "zora-mainnet";
1361
- ChainName["ZORA_SEPOLIA_TESTNET"] = "zora-sepolia-testnet";
1362
1379
  ChainName["ZKSYNC_MAINNET"] = "zksync-mainnet";
1363
- ChainName["ZKSYNC_SEPOLIA_TESTNET"] = "zksync-sepolia-testnet";
1364
- ChainName["BNB_OPBNB_TESTNET"] = "bnb-opbnb-testnet";
1365
1380
  ChainName["BNB_OPBNB_MAINNET"] = "bnb-opbnb-mainnet";
1366
- ChainName["ZETACHAIN_TESTNET"] = "zetachain-testnet";
1367
1381
  ChainName["ZETACHAIN_MAINNET"] = "zetachain-mainnet";
1368
- ChainName["KINTO_TESTNET"] = "kinto-testnet";
1369
1382
  ChainName["GNOSIS_MAINNET"] = "gnosis-mainnet";
1370
1383
  ChainName["GNOSIS_TESTNET"] = "gnosis-testnet";
1371
1384
  ChainName["VICTION_MAINNET"] = "viction-mainnet";
1372
- ChainName["VICTION_TESTNET"] = "viction-testnet";
1373
1385
  ChainName["TAIKO_MAINNET"] = "taiko-mainnet";
1374
- ChainName["TAIKO_HEKLA_TESTNET"] = "taiko-hekla-testnet";
1375
- ChainName["MERLIN_MAINNET"] = "merlin-mainnet";
1376
- ChainName["MERLIN_TESTNET"] = "merlin-testnet";
1377
- ChainName["MOVEMENT_MEVM_TESTNET"] = "movement-mevm-testnet";
1378
1386
  ChainName["BLAST_MAINNET"] = "blast-mainnet";
1379
1387
  ChainName["SCROLL_MAINNET"] = "scroll-mainnet";
1380
1388
  })(exports.ChainName || (exports.ChainName = {}));
@@ -1383,6 +1391,7 @@ exports.ChainID = void 0;
1383
1391
  ChainID[ChainID["ETH_MAINNET"] = 1] = "ETH_MAINNET";
1384
1392
  ChainID[ChainID["ETH_SEPOLIA"] = 11155111] = "ETH_SEPOLIA";
1385
1393
  ChainID[ChainID["ETH_HOLESKY"] = 17000] = "ETH_HOLESKY";
1394
+ ChainID[ChainID["ETH_HOODI"] = 560048] = "ETH_HOODI";
1386
1395
  ChainID[ChainID["MATIC_MAINNET"] = 137] = "MATIC_MAINNET";
1387
1396
  ChainID[ChainID["AVALANCHE_MAINNET"] = 43114] = "AVALANCHE_MAINNET";
1388
1397
  ChainID[ChainID["AVALANCHE_TESTNET"] = 43113] = "AVALANCHE_TESTNET";
@@ -1395,93 +1404,48 @@ exports.ChainID = void 0;
1395
1404
  ChainID[ChainID["ARBITRUM_NOVA_MAINNET"] = 42170] = "ARBITRUM_NOVA_MAINNET";
1396
1405
  ChainID[ChainID["FANTOM_MAINNET"] = 250] = "FANTOM_MAINNET";
1397
1406
  ChainID[ChainID["FANTOM_TESTNET"] = 4002] = "FANTOM_TESTNET";
1398
- ChainID[ChainID["PALM_MAINNET"] = 11297108109] = "PALM_MAINNET";
1399
- ChainID[ChainID["PALM_TESTNET"] = 11297108099] = "PALM_TESTNET";
1400
1407
  ChainID[ChainID["BTC_MAINNET"] = 20090103] = "BTC_MAINNET";
1401
1408
  ChainID[ChainID["SOLANA_MAINNET"] = 1399811149] = "SOLANA_MAINNET";
1402
1409
  ChainID[ChainID["AXIE_MAINNET"] = 2020] = "AXIE_MAINNET";
1403
1410
  ChainID[ChainID["OPTIMISM_MAINNET"] = 10] = "OPTIMISM_MAINNET";
1404
1411
  ChainID[ChainID["OPTIMISM_SEPOLIA"] = 11155420] = "OPTIMISM_SEPOLIA";
1405
- ChainID[ChainID["CRONOS_ZKEVM_TESTNET"] = 282] = "CRONOS_ZKEVM_TESTNET";
1406
1412
  ChainID[ChainID["CRONOS_ZKEVM_MAINNET"] = 388] = "CRONOS_ZKEVM_MAINNET";
1407
- ChainID[ChainID["AURORA_MAINNET"] = 1313161554] = "AURORA_MAINNET";
1408
- ChainID[ChainID["AURORA_TESTNET"] = 1313161555] = "AURORA_TESTNET";
1409
1413
  ChainID[ChainID["EMERALD_PARATIME_MAINNET"] = 42262] = "EMERALD_PARATIME_MAINNET";
1410
- ChainID[ChainID["DEFI_KINGDOMS_MAINNET"] = 53935] = "DEFI_KINGDOMS_MAINNET";
1411
- ChainID[ChainID["DEFI_KINGDOMS_TESTNET"] = 335] = "DEFI_KINGDOMS_TESTNET";
1412
- ChainID[ChainID["BOBA_MAINNET"] = 288] = "BOBA_MAINNET";
1413
- ChainID[ChainID["BOBA_BNB_MAINNET"] = 56288] = "BOBA_BNB_MAINNET";
1414
- ChainID[ChainID["BOBA_BNB_TESTNET"] = 9728] = "BOBA_BNB_TESTNET";
1415
- ChainID[ChainID["SCROLL_SEPOLIA_TESTNET"] = 534351] = "SCROLL_SEPOLIA_TESTNET";
1416
- ChainID[ChainID["METIS_MAINNET"] = 1088] = "METIS_MAINNET";
1417
- ChainID[ChainID["AVALANCHE_DEXALOT_MAINNET"] = 432204] = "AVALANCHE_DEXALOT_MAINNET";
1418
- ChainID[ChainID["AVALANCHE_DEXALOT_TESTNET"] = 432201] = "AVALANCHE_DEXALOT_TESTNET";
1419
- ChainID[ChainID["AVALANCHE_SHRAPNEL_MAINNET"] = 2044] = "AVALANCHE_SHRAPNEL_MAINNET";
1420
- ChainID[ChainID["AVALANCHE_NUMBERS"] = 10507] = "AVALANCHE_NUMBERS";
1421
- ChainID[ChainID["AVALANCHE_XANACHAIN"] = 8888] = "AVALANCHE_XANACHAIN";
1422
- ChainID[ChainID["AVALANCHE_STEP_NETWORK"] = 1234] = "AVALANCHE_STEP_NETWORK";
1423
- ChainID[ChainID["AVALANCHE_SHRAPNEL_TESTNET"] = 2038] = "AVALANCHE_SHRAPNEL_TESTNET";
1424
- ChainID[ChainID["AVALANCHE_BEAM_TESTNET"] = 13337] = "AVALANCHE_BEAM_TESTNET";
1425
- ChainID[ChainID["AVALANCHE_BLITZ_TESTNET"] = 1343] = "AVALANCHE_BLITZ_TESTNET";
1426
- ChainID[ChainID["AVALANCHE_UPTN"] = 6119] = "AVALANCHE_UPTN";
1427
- ChainID[ChainID["AVALANCHE_BEAM_MAINNET"] = 4337] = "AVALANCHE_BEAM_MAINNET";
1428
- ChainID[ChainID["AVALANCHE_MIRAI_TESTNET"] = 2195] = "AVALANCHE_MIRAI_TESTNET";
1414
+ ChainID[ChainID["MONAD_TESTNET"] = 10143] = "MONAD_TESTNET";
1415
+ ChainID[ChainID["MONAD_MAINNET"] = 143] = "MONAD_MAINNET";
1429
1416
  ChainID[ChainID["BERACHAIN_MAINNET"] = 80094] = "BERACHAIN_MAINNET";
1417
+ ChainID[ChainID["PLASMA_MAINNET"] = 9745] = "PLASMA_MAINNET";
1430
1418
  ChainID[ChainID["UNICHAIN_MAINNET"] = 130] = "UNICHAIN_MAINNET";
1419
+ ChainID[ChainID["PLASMA_TESTNET"] = 9746] = "PLASMA_TESTNET";
1420
+ ChainID[ChainID["ARC_TESTNET"] = 5042002] = "ARC_TESTNET";
1431
1421
  ChainID[ChainID["CANTO_MAINNET"] = 7700] = "CANTO_MAINNET";
1432
- ChainID[ChainID["FLARENETWORKS_FLARE_MAINNET"] = 14] = "FLARENETWORKS_FLARE_MAINNET";
1433
- ChainID[ChainID["FLARENETWORKS_FLARE_TESTNET"] = 114] = "FLARENETWORKS_FLARE_TESTNET";
1434
1422
  ChainID[ChainID["LINEA_MAINNET"] = 59144] = "LINEA_MAINNET";
1435
- ChainID[ChainID["POLYGON_ZKEVM_MAINNET"] = 1101] = "POLYGON_ZKEVM_MAINNET";
1436
1423
  ChainID[ChainID["LINEA_SEPOLIA_TESTNET"] = 59141] = "LINEA_SEPOLIA_TESTNET";
1437
- ChainID[ChainID["POLYGON_ZKEVM_TESTNET"] = 1422] = "POLYGON_ZKEVM_TESTNET";
1438
1424
  ChainID[ChainID["POLYGON_AMOY_TESTNET"] = 80002] = "POLYGON_AMOY_TESTNET";
1439
1425
  ChainID[ChainID["MANTLE_MAINNET"] = 5000] = "MANTLE_MAINNET";
1440
- ChainID[ChainID["POLYGON_ZKEVM_CARDONA_TESTNET"] = 2442] = "POLYGON_ZKEVM_CARDONA_TESTNET";
1441
- ChainID[ChainID["MANTLE_SEPOLIA_TESTNET"] = 5003] = "MANTLE_SEPOLIA_TESTNET";
1442
1426
  ChainID[ChainID["BASE_MAINNET"] = 8453] = "BASE_MAINNET";
1443
- ChainID[ChainID["BASE_SEPOLIA_TESTNET"] = 84532] = "BASE_SEPOLIA_TESTNET";
1444
1427
  ChainID[ChainID["OASIS_SAPPHIRE_MAINNET"] = 23294] = "OASIS_SAPPHIRE_MAINNET";
1445
- ChainID[ChainID["SYNDR_TESTNET"] = 412346] = "SYNDR_TESTNET";
1446
- ChainID[ChainID["OASIS_SAPPHIRE_TESTNET"] = 23295] = "OASIS_SAPPHIRE_TESTNET";
1447
1428
  ChainID[ChainID["CELO_MAINNET"] = 42220] = "CELO_MAINNET";
1448
- ChainID[ChainID["X1_MAINNET"] = 196] = "X1_MAINNET";
1449
1429
  ChainID[ChainID["HYPEREVM_MAINNET"] = 999] = "HYPEREVM_MAINNET";
1450
- ChainID[ChainID["HORIZEN_EON_MAINNET"] = 7332] = "HORIZEN_EON_MAINNET";
1451
- ChainID[ChainID["HORIZEN_GOBI_TESTNET"] = 1663] = "HORIZEN_GOBI_TESTNET";
1452
- ChainID[ChainID["FRAXTAL_MAINNET"] = 252] = "FRAXTAL_MAINNET";
1453
- ChainID[ChainID["APECHAIN_TESTNET"] = 1798] = "APECHAIN_TESTNET";
1430
+ ChainID[ChainID["ADI_MAINNET"] = 36900] = "ADI_MAINNET";
1454
1431
  ChainID[ChainID["REDSTONE_MAINNET"] = 690] = "REDSTONE_MAINNET";
1455
1432
  ChainID[ChainID["SEI_MAINNET"] = 1329] = "SEI_MAINNET";
1456
1433
  ChainID[ChainID["APECHAIN_MAINNET"] = 33139] = "APECHAIN_MAINNET";
1457
1434
  ChainID[ChainID["UNICHAIN_SEPOLIA_TESTNET"] = 1301] = "UNICHAIN_SEPOLIA_TESTNET";
1435
+ ChainID[ChainID["SONIC_MAINNET"] = 146] = "SONIC_MAINNET";
1458
1436
  ChainID[ChainID["WORLD_MAINNET"] = 480] = "WORLD_MAINNET";
1459
1437
  ChainID[ChainID["WORLD_SEPOLIA_TESTNET"] = 4801] = "WORLD_SEPOLIA_TESTNET";
1460
1438
  ChainID[ChainID["LENS_SEPOLIA_TESTNET"] = 37111] = "LENS_SEPOLIA_TESTNET";
1461
1439
  ChainID[ChainID["INK_SEPOLIA_TESTNET"] = 763373] = "INK_SEPOLIA_TESTNET";
1462
1440
  ChainID[ChainID["INK_MAINNET"] = 57073] = "INK_MAINNET";
1463
1441
  ChainID[ChainID["LENS_MAINNET"] = 232] = "LENS_MAINNET";
1464
- ChainID[ChainID["AVALANCHE_MELD_TESTNET"] = 222000222] = "AVALANCHE_MELD_TESTNET";
1465
- ChainID[ChainID["AVALANCHE_MELD_MAINNET"] = 333000333] = "AVALANCHE_MELD_MAINNET";
1466
- ChainID[ChainID["GUNZILLA_TESTNET"] = 49321] = "GUNZILLA_TESTNET";
1467
- ChainID[ChainID["ZORA_MAINNET"] = 7777777] = "ZORA_MAINNET";
1468
- ChainID[ChainID["ZORA_SEPOLIA_TESTNET"] = 999999999] = "ZORA_SEPOLIA_TESTNET";
1469
1442
  ChainID[ChainID["ZKSYNC_MAINNET"] = 324] = "ZKSYNC_MAINNET";
1470
- ChainID[ChainID["ZKSYNC_SEPOLIA_TESTNET"] = 300] = "ZKSYNC_SEPOLIA_TESTNET";
1471
- ChainID[ChainID["BNB_OPBNB_TESTNET"] = 5611] = "BNB_OPBNB_TESTNET";
1472
1443
  ChainID[ChainID["BNB_OPBNB_MAINNET"] = 204] = "BNB_OPBNB_MAINNET";
1473
- ChainID[ChainID["ZETACHAIN_TESTNET"] = 7001] = "ZETACHAIN_TESTNET";
1474
1444
  ChainID[ChainID["ZETACHAIN_MAINNET"] = 7000] = "ZETACHAIN_MAINNET";
1475
- ChainID[ChainID["KINTO_TESTNET"] = 42888] = "KINTO_TESTNET";
1476
1445
  ChainID[ChainID["GNOSIS_MAINNET"] = 100] = "GNOSIS_MAINNET";
1477
1446
  ChainID[ChainID["GNOSIS_TESTNET"] = 10200] = "GNOSIS_TESTNET";
1478
1447
  ChainID[ChainID["VICTION_MAINNET"] = 88] = "VICTION_MAINNET";
1479
- ChainID[ChainID["VICTION_TESTNET"] = 89] = "VICTION_TESTNET";
1480
1448
  ChainID[ChainID["TAIKO_MAINNET"] = 167000] = "TAIKO_MAINNET";
1481
- ChainID[ChainID["TAIKO_HEKLA_TESTNET"] = 167009] = "TAIKO_HEKLA_TESTNET";
1482
- ChainID[ChainID["MERLIN_MAINNET"] = 4200] = "MERLIN_MAINNET";
1483
- ChainID[ChainID["MERLIN_TESTNET"] = 686868] = "MERLIN_TESTNET";
1484
- ChainID[ChainID["MOVEMENT_MEVM_TESTNET"] = 336] = "MOVEMENT_MEVM_TESTNET";
1485
1449
  ChainID[ChainID["BLAST_MAINNET"] = 81457] = "BLAST_MAINNET";
1486
1450
  ChainID[ChainID["SCROLL_MAINNET"] = 534352] = "SCROLL_MAINNET";
1487
1451
  })(exports.ChainID || (exports.ChainID = {}));
@@ -1495,6 +1459,10 @@ class BitcoinService {
1495
1459
  this.execution = execution;
1496
1460
  }
1497
1461
  /**
1462
+ *
1463
+ * Commonly used to fetch the historical Bitcoin balance held by an address at a given block height or date. Response includes daily prices and other metadata.
1464
+ *
1465
+ * **Credit Cost**: 1 per call
1498
1466
  *
1499
1467
  * @param {string} walletAddress - The requested Bitcoin HD address.
1500
1468
  * @param {GetBitcoinHdWalletBalancesQueryParamOpts} queryParamOpts
@@ -1570,7 +1538,9 @@ class BitcoinService {
1570
1538
  }
1571
1539
  /**
1572
1540
  *
1573
- * Commonly used to fetch the tokens held by an address. Response includes spot prices and other metadata.
1541
+ * Fetch Bitcoin balance for a non-HD address. Response includes spot prices and other metadata.
1542
+ *
1543
+ * **Credit Cost**: 1 per call
1574
1544
  *
1575
1545
  * @param {string} walletAddress - The requested Bitcoin Non HD address.
1576
1546
  * @param {GetBitcoinNonHdWalletBalancesQueryParamOpts} queryParamOpts
@@ -1632,6 +1602,7 @@ class NftService {
1632
1602
  * - `pageNumber`: 0-indexed page number to begin pagination.
1633
1603
  * - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
1634
1604
  *
1605
+ * @deprecated This endpoint is no longer supported by the GoldRush API.
1635
1606
  */
1636
1607
  async *getChainCollections(chainName, queryParamOpts) {
1637
1608
  const endpoint = endpointGenerator(`${chainName}/nft/collections`, [
@@ -1678,6 +1649,7 @@ class NftService {
1678
1649
  * - `pageNumber`: 0-indexed page number to begin pagination.
1679
1650
  * - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
1680
1651
  *
1652
+ * @deprecated This endpoint is no longer supported by the GoldRush API.
1681
1653
  */
1682
1654
  async getChainCollectionsByPage(chainName, queryParamOpts) {
1683
1655
  const endpoint = endpointGenerator(`${chainName}/nft/collections`, [
@@ -1716,6 +1688,8 @@ class NftService {
1716
1688
  *
1717
1689
  * Commonly used to render the NFTs (including ERC721 and ERC1155) held by an address.
1718
1690
  *
1691
+ * **Credit Cost**: 1 per call
1692
+ *
1719
1693
  * @param {string} chainName - The chain name eg: `eth-mainnet`.
1720
1694
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
1721
1695
  * @param {GetNftsForAddressQueryParamOpts} queryParamOpts
@@ -1776,6 +1750,7 @@ class NftService {
1776
1750
  * - `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.
1777
1751
  * - `withUncached`: By default, this endpoint only works on chains where we've cached the assets and 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 server can block or rate limit the call and therefore resulting in time outs or slow response times on the Covalent side.
1778
1752
  *
1753
+ * @deprecated This endpoint is no longer supported by the GoldRush API.
1779
1754
  */
1780
1755
  async *getTokenIdsForContractWithMetadata(chainName, contractAddress, queryParamOpts) {
1781
1756
  const endpoint = endpointGenerator(`${chainName}/nft/${contractAddress}/metadata`, [
@@ -1839,6 +1814,7 @@ class NftService {
1839
1814
  * - `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.
1840
1815
  * - `withUncached`: By default, this endpoint only works on chains where we've cached the assets and 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 server can block or rate limit the call and therefore resulting in time outs or slow response times on the Covalent side.
1841
1816
  *
1817
+ * @deprecated This endpoint is no longer supported by the GoldRush API.
1842
1818
  */
1843
1819
  async getTokenIdsForContractWithMetadataByPage(chainName, contractAddress, queryParamOpts) {
1844
1820
  const endpoint = endpointGenerator(`${chainName}/nft/${contractAddress}/metadata`, [
@@ -1897,6 +1873,7 @@ class NftService {
1897
1873
  * - `noMetadata`: Omit metadata.
1898
1874
  * - `withUncached`: By default, this endpoint only works on chains where we've cached the assets and 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 server can block or rate limit the call and therefore resulting in time outs or slow response times on the Covalent side.
1899
1875
  *
1876
+ * @deprecated This endpoint is no longer supported by the GoldRush API.
1900
1877
  */
1901
1878
  async getNftMetadataForGivenTokenIdForContract(chainName, contractAddress, tokenId, queryParamOpts) {
1902
1879
  const endpoint = endpointGenerator(`${chainName}/nft/${contractAddress}/metadata/${tokenId}`, [
@@ -1938,6 +1915,7 @@ class NftService {
1938
1915
  * @param {GetNftTransactionsForContractTokenIdQueryParamOpts} queryParamOpts
1939
1916
  * - `noSpam`: If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`.
1940
1917
  *
1918
+ * @deprecated This endpoint is no longer supported by the GoldRush API.
1941
1919
  */
1942
1920
  async getNftTransactionsForContractTokenId(chainName, contractAddress, tokenId, queryParamOpts) {
1943
1921
  const endpoint = endpointGenerator(`${chainName}/tokens/${contractAddress}/nft_transactions/${tokenId}`, [
@@ -1986,6 +1964,7 @@ class NftService {
1986
1964
  * @param {string} chainName - The chain name eg: `eth-mainnet`.
1987
1965
  * @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
1988
1966
  *
1967
+ * @deprecated This endpoint is no longer supported by the GoldRush API.
1989
1968
  */
1990
1969
  async getTraitsForCollection(chainName, collectionContract) {
1991
1970
  const endpoint = endpointGenerator(`${chainName}/nft/${collectionContract}/traits`, []);
@@ -2007,6 +1986,7 @@ class NftService {
2007
1986
  * @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
2008
1987
  * @param {string} trait - The requested trait.
2009
1988
  *
1989
+ * @deprecated This endpoint is no longer supported by the GoldRush API.
2010
1990
  */
2011
1991
  async getAttributesForTraitInCollection(chainName, collectionContract, trait) {
2012
1992
  const endpoint = endpointGenerator(`${chainName}/nft/${collectionContract}/traits/${trait}/attributes`, []);
@@ -2027,6 +2007,7 @@ class NftService {
2027
2007
  * @param {string} chainName - The chain name eg: `eth-mainnet`.
2028
2008
  * @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
2029
2009
  *
2010
+ * @deprecated This endpoint is no longer supported by the GoldRush API.
2030
2011
  */
2031
2012
  async getCollectionTraitsSummary(chainName, collectionContract) {
2032
2013
  const endpoint = endpointGenerator(`${chainName}/nft/${collectionContract}/traits_summary`, []);
@@ -2050,6 +2031,7 @@ class NftService {
2050
2031
  * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
2051
2032
  * - `days`: The number of days to return data for. Request up 365 days. Defaults to 30 days.
2052
2033
  *
2034
+ * @deprecated This endpoint is no longer supported by the GoldRush API.
2053
2035
  */
2054
2036
  async getHistoricalFloorPricesForCollection(chainName, collectionAddress, queryParamOpts) {
2055
2037
  const endpoint = endpointGenerator(`${chainName}/nft_market/${collectionAddress}/floor_price`, [
@@ -2088,6 +2070,7 @@ class NftService {
2088
2070
  * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
2089
2071
  * - `days`: The number of days to return data for. Request up 365 days. Defaults to 30 days.
2090
2072
  *
2073
+ * @deprecated This endpoint is no longer supported by the GoldRush API.
2091
2074
  */
2092
2075
  async getHistoricalVolumeForCollection(chainName, collectionAddress, queryParamOpts) {
2093
2076
  const endpoint = endpointGenerator(`${chainName}/nft_market/${collectionAddress}/volume`, [
@@ -2126,6 +2109,7 @@ class NftService {
2126
2109
  * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
2127
2110
  * - `days`: The number of days to return data for. Request up 365 days. Defaults to 30 days.
2128
2111
  *
2112
+ * @deprecated This endpoint is no longer supported by the GoldRush API.
2129
2113
  */
2130
2114
  async getHistoricalSalesCountForCollection(chainName, collectionAddress, queryParamOpts) {
2131
2115
  const endpoint = endpointGenerator(`${chainName}/nft_market/${collectionAddress}/sale_count`, [
@@ -2158,6 +2142,8 @@ class NftService {
2158
2142
  *
2159
2143
  * Commonly used to verify ownership of NFTs (including ERC-721 and ERC-1155) within a collection.
2160
2144
  *
2145
+ * **Credit Cost**: 1 per call
2146
+ *
2161
2147
  * @param {string} chainName - The chain name eg: `eth-mainnet`.
2162
2148
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
2163
2149
  * @param {string} collectionContract - The requested collection address.
@@ -2203,6 +2189,8 @@ class NftService {
2203
2189
  *
2204
2190
  * Commonly used to verify ownership of a specific token (ERC-721 or ERC-1155) within a collection.
2205
2191
  *
2192
+ * **Credit Cost**: 1 per call
2193
+ *
2206
2194
  * @param {string} chainName - The chain name eg: `eth-mainnet`.
2207
2195
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
2208
2196
  * @param {string} collectionContract - The requested collection address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
@@ -2244,7 +2232,9 @@ class PricingService {
2244
2232
  }
2245
2233
  /**
2246
2234
  *
2247
- * Commonly used to get historic prices of a token between date ranges. Supports native tokens.
2235
+ * Get the historical prices of one (or many) large cap ERC20 tokens between specified date ranges. Also supports native tokens.
2236
+ *
2237
+ * **Credit Cost**: 1 per call
2248
2238
  *
2249
2239
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
2250
2240
  * @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`.
@@ -2292,6 +2282,8 @@ class PricingService {
2292
2282
  *
2293
2283
  * Get the spot token pair prices for a specified pool contract address. Supports pools on Uniswap V2, V3 and their forks.
2294
2284
  *
2285
+ * **Credit Cost**: 1 per call
2286
+ *
2295
2287
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
2296
2288
  * @param {string} contractAddress - The pool contract address.
2297
2289
  * @param {GetTokenPricesQueryParamOpts} queryParamOpts
@@ -2331,6 +2323,8 @@ class SecurityService {
2331
2323
  *
2332
2324
  * Commonly used to get a list of approvals across all token contracts categorized by spenders for a wallet’s assets.
2333
2325
  *
2326
+ * **Credit Cost**: 2 per call
2327
+ *
2334
2328
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
2335
2329
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
2336
2330
  *
@@ -3149,7 +3143,12 @@ class StreamingService {
3149
3143
  });
3150
3144
  }
3151
3145
  /**
3152
- * Subscribe to OHLCV data for specific pairs
3146
+ *
3147
+ * The OHLCV Pairs stream provides real-time updates on the Open, High, Low, Close prices and Volume of one or many token pairs at configurable intervals.
3148
+ *
3149
+ * **Credit Cost**: 0 per call
3150
+ *
3151
+ * **Beta**: This endpoint is in beta.
3153
3152
  *
3154
3153
  * @param params - Parameters for the OHLCV pairs stream
3155
3154
  * @param callbacks - Subscription callbacks
@@ -3177,41 +3176,42 @@ class StreamingService {
3177
3176
  const pairAddressesString = params.pair_addresses
3178
3177
  .map((addr) => `"${addr}"`)
3179
3178
  .join(", ");
3180
- const query = `
3181
- subscription {
3182
- ohlcvCandlesForPair(
3183
- chain_name: ${params.chain_name}
3184
- pair_addresses: [${pairAddressesString}]
3185
- interval: ${params.interval}
3186
- timeframe: ${params.timeframe}
3187
- ${params.limit ? `limit: ${params.limit}` : ""}
3188
- ) {
3189
- open
3190
- high
3191
- low
3192
- close
3193
- volume
3194
- price_usd
3195
- volume_usd
3196
- chain_name
3197
- pair_address
3198
- interval
3199
- timeframe
3200
- timestamp
3201
- base_token {
3202
- contract_name
3203
- contract_address
3204
- contract_decimals
3205
- contract_ticker_symbol
3206
- }
3207
- quote_token {
3208
- contract_name
3209
- contract_address
3210
- contract_decimals
3211
- contract_ticker_symbol
3212
- }
3213
- }
3214
- }
3179
+ const query = `
3180
+ subscription {
3181
+ ohlcvCandlesForPair(
3182
+ chain_name: ${params.chain_name}
3183
+ pair_addresses: [${pairAddressesString}]
3184
+ interval: ${params.interval}
3185
+ timeframe: ${params.timeframe}
3186
+ ${params.limit ? `limit: ${params.limit}` : ""}
3187
+ ) {
3188
+ chain_name
3189
+ pair_address
3190
+ interval
3191
+ timeframe
3192
+ timestamp
3193
+ open
3194
+ high
3195
+ low
3196
+ close
3197
+ volume
3198
+ volume_usd
3199
+ quote_rate
3200
+ quote_rate_usd
3201
+ base_token {
3202
+ contract_name
3203
+ contract_address
3204
+ contract_decimals
3205
+ contract_ticker_symbol
3206
+ }
3207
+ quote_token {
3208
+ contract_name
3209
+ contract_address
3210
+ contract_decimals
3211
+ contract_ticker_symbol
3212
+ }
3213
+ }
3214
+ }
3215
3215
  `;
3216
3216
  const client = StreamingWebSocketClient.getClient();
3217
3217
  return client.subscribe({
@@ -3233,7 +3233,12 @@ class StreamingService {
3233
3233
  });
3234
3234
  }
3235
3235
  /**
3236
- * Subscribe to OHLCV data for specific tokens
3236
+ *
3237
+ * The OHLCV Tokens stream provides real-time updates on the Open, High, Low, Close prices and Volume of one or many tokens at configurable intervals.
3238
+ *
3239
+ * **Credit Cost**: 0 per call
3240
+ *
3241
+ * **Beta**: This endpoint is in beta.
3237
3242
  *
3238
3243
  * @param params - Parameters for the OHLCV tokens stream
3239
3244
  * @param callbacks - Subscription callbacks
@@ -3261,42 +3266,42 @@ class StreamingService {
3261
3266
  const tokenAddressesString = params.token_addresses
3262
3267
  .map((addr) => `"${addr}"`)
3263
3268
  .join(", ");
3264
- const query = `
3265
- subscription {
3266
- ohlcvCandlesForToken(
3267
- chain_name: ${params.chain_name}
3268
- token_addresses: [${tokenAddressesString}]
3269
- interval: ${params.interval}
3270
- timeframe: ${params.timeframe}
3271
- ${params.limit ? `limit: ${params.limit}` : ""}
3272
- ) {
3273
- chain_name
3274
- pair_address
3275
- interval
3276
- timeframe
3277
- timestamp
3278
- open
3279
- high
3280
- low
3281
- close
3282
- volume
3283
- volume_usd
3284
- quote_rate
3285
- quote_rate_usd
3286
- base_token {
3287
- contract_name
3288
- contract_address
3289
- contract_decimals
3290
- contract_ticker_symbol
3291
- }
3292
- quote_token {
3293
- contract_name
3294
- contract_address
3295
- contract_decimals
3296
- contract_ticker_symbol
3297
- }
3298
- }
3299
- }
3269
+ const query = `
3270
+ subscription {
3271
+ ohlcvCandlesForToken(
3272
+ chain_name: ${params.chain_name}
3273
+ token_addresses: [${tokenAddressesString}]
3274
+ interval: ${params.interval}
3275
+ timeframe: ${params.timeframe}
3276
+ ${params.limit ? `limit: ${params.limit}` : ""}
3277
+ ) {
3278
+ chain_name
3279
+ pair_address
3280
+ interval
3281
+ timeframe
3282
+ timestamp
3283
+ open
3284
+ high
3285
+ low
3286
+ close
3287
+ volume
3288
+ volume_usd
3289
+ quote_rate
3290
+ quote_rate_usd
3291
+ base_token {
3292
+ contract_name
3293
+ contract_address
3294
+ contract_decimals
3295
+ contract_ticker_symbol
3296
+ }
3297
+ quote_token {
3298
+ contract_name
3299
+ contract_address
3300
+ contract_decimals
3301
+ contract_ticker_symbol
3302
+ }
3303
+ }
3304
+ }
3300
3305
  `;
3301
3306
  const client = StreamingWebSocketClient.getClient();
3302
3307
  return client.subscribe({
@@ -3318,7 +3323,12 @@ class StreamingService {
3318
3323
  });
3319
3324
  }
3320
3325
  /**
3321
- * Subscribe to new DEX pairs created on supported decentralized exchanges
3326
+ *
3327
+ * The New DEX Pairs stream provides real-time updates when new liquidity pairs are created on decentralized exchanges (DEXes). This documentation follows our standard streaming API structure.
3328
+ *
3329
+ * **Credit Cost**: 0 per call
3330
+ *
3331
+ * **Beta**: This endpoint is in beta.
3322
3332
  *
3323
3333
  * @param params - Parameters for the new pairs stream
3324
3334
  * @param callbacks - Subscription callbacks
@@ -3340,45 +3350,45 @@ class StreamingService {
3340
3350
  * ```
3341
3351
  */
3342
3352
  subscribeToNewPairs(params, callbacks) {
3343
- const query = `
3344
- subscription {
3345
- newPairs(
3346
- chain_name: ${params.chain_name},
3347
- protocols: [${params.protocols.join(", ")}]
3348
- ) {
3349
- chain_name
3350
- protocol
3351
- protocol_version
3352
- pair_address
3353
- deployer_address
3354
- tx_hash
3355
- block_signed_at
3356
- liquidity
3357
- supply
3358
- market_cap
3359
- event_name
3360
- quote_rate
3361
- quote_rate_usd
3362
- base_token_metadata {
3363
- contract_address
3364
- contract_decimals
3365
- contract_name
3366
- contract_ticker_symbol
3367
- }
3368
- pair_metadata {
3369
- contract_address
3370
- contract_decimals
3371
- contract_name
3372
- contract_ticker_symbol
3373
- }
3374
- quote_token_metadata {
3375
- contract_address
3376
- contract_decimals
3377
- contract_name
3378
- contract_ticker_symbol
3379
- }
3380
- }
3381
- }
3353
+ const query = `
3354
+ subscription {
3355
+ newPairs(
3356
+ chain_name: ${params.chain_name},
3357
+ protocols: [${params.protocols.join(", ")}]
3358
+ ) {
3359
+ chain_name
3360
+ protocol
3361
+ protocol_version
3362
+ pair_address
3363
+ deployer_address
3364
+ tx_hash
3365
+ block_signed_at
3366
+ liquidity
3367
+ supply
3368
+ market_cap
3369
+ event_name
3370
+ quote_rate
3371
+ quote_rate_usd
3372
+ base_token {
3373
+ contract_address
3374
+ contract_decimals
3375
+ contract_name
3376
+ contract_ticker_symbol
3377
+ }
3378
+ pair {
3379
+ contract_address
3380
+ contract_decimals
3381
+ contract_name
3382
+ contract_ticker_symbol
3383
+ }
3384
+ quote_token {
3385
+ contract_address
3386
+ contract_decimals
3387
+ contract_name
3388
+ contract_ticker_symbol
3389
+ }
3390
+ }
3391
+ }
3382
3392
  `;
3383
3393
  const client = StreamingWebSocketClient.getClient();
3384
3394
  return client.subscribe({
@@ -3400,7 +3410,12 @@ class StreamingService {
3400
3410
  });
3401
3411
  }
3402
3412
  /**
3403
- * Subscribe to real-time updates for specific trading pairs including price, volume, and liquidity data
3413
+ *
3414
+ * The Update DEX Pairs stream provides real-time event updates on the prices, volumes, market cap and liquidity of one or many token pairs.
3415
+ *
3416
+ * **Credit Cost**: 0 per call
3417
+ *
3418
+ * **Beta**: This endpoint is in beta.
3404
3419
  *
3405
3420
  * @param params - Parameters for the update pairs stream
3406
3421
  * @param callbacks - Subscription callbacks
@@ -3427,45 +3442,47 @@ class StreamingService {
3427
3442
  const pairAddressesString = params.pair_addresses
3428
3443
  .map((addr) => `"${addr}"`)
3429
3444
  .join(", ");
3430
- const query = `
3431
- subscription {
3432
- updatePairs(
3433
- chain_name: ${params.chain_name}
3434
- pair_addresses: [${pairAddressesString}]
3435
- ) {
3436
- chain_name
3437
- pair_address
3438
- timestamp
3439
- price
3440
- price_usd
3441
- volume
3442
- volume_usd
3443
- base_token {
3444
- contract_name
3445
- contract_address
3446
- contract_decimals
3447
- contract_ticker_symbol
3448
- }
3449
- quote_token {
3450
- contract_name
3451
- contract_address
3452
- contract_decimals
3453
- contract_ticker_symbol
3454
- }
3455
- price_deltas {
3456
- last_5m
3457
- last_1hr
3458
- last_6hr
3459
- last_24hr
3460
- }
3461
- swap_counts {
3462
- last_5m
3463
- last_1hr
3464
- last_6hr
3465
- last_24hr
3466
- }
3467
- }
3468
- }
3445
+ const query = `
3446
+ subscription {
3447
+ updatePairs(
3448
+ chain_name: ${params.chain_name}
3449
+ pair_addresses: [${pairAddressesString}]
3450
+ ) {
3451
+ chain_name
3452
+ pair_address
3453
+ timestamp
3454
+ quote_rate
3455
+ quote_rate_usd
3456
+ volume
3457
+ volume_usd
3458
+ market_cap
3459
+ liquidity
3460
+ base_token {
3461
+ contract_name
3462
+ contract_address
3463
+ contract_decimals
3464
+ contract_ticker_symbol
3465
+ }
3466
+ quote_token {
3467
+ contract_name
3468
+ contract_address
3469
+ contract_decimals
3470
+ contract_ticker_symbol
3471
+ }
3472
+ price_deltas {
3473
+ last_5m
3474
+ last_1hr
3475
+ last_6hr
3476
+ last_24hr
3477
+ }
3478
+ swap_counts {
3479
+ last_5m
3480
+ last_1hr
3481
+ last_6hr
3482
+ last_24hr
3483
+ }
3484
+ }
3485
+ }
3469
3486
  `;
3470
3487
  const client = StreamingWebSocketClient.getClient();
3471
3488
  return client.subscribe({
@@ -3487,74 +3504,12 @@ class StreamingService {
3487
3504
  });
3488
3505
  }
3489
3506
  /**
3490
- * Subscribe to real-time token balance updates for a specific wallet address
3491
3507
  *
3492
- * @param params - Parameters for the token balances stream
3493
- * @param callbacks - Subscription callbacks
3494
- * @returns Unsubscribe function
3508
+ * The Wallet Activity stream provides real-time updates on wallet transactions, token transfers, and interactions with smart contracts . This documentation follows our standard Streaming API structure.
3495
3509
  *
3496
- * @example
3497
- * ```typescript
3498
- * const unsubscribe = streamingService.subscribeToTokenBalances(
3499
- * {
3500
- * chain_name: StreamingChain.BASE_MAINNET,
3501
- * wallet_address: "0x198ef79f1f515f02dfe9e3115ed9fc07183f02fc"
3502
- * },
3503
- * {
3504
- * next: (data) => console.log("Token Balances:", data),
3505
- * error: (err) => console.error("Error:", err),
3506
- * complete: () => console.log("Stream completed")
3507
- * }
3508
- * );
3509
- * ```
3510
- */
3511
- subscribeToTokenBalances(params, callbacks) {
3512
- const query = `
3513
- subscription {
3514
- tokenBalancesForWalletAddress(
3515
- chain_name: ${params.chain_name},
3516
- wallet_address: "${params.wallet_address}"
3517
- ) {
3518
- wallet_address
3519
- chain_name
3520
- last_block
3521
- items {
3522
- balance
3523
- balance_pretty
3524
- quote_rate_usd
3525
- quote_usd
3526
- metadata {
3527
- contract_name
3528
- contract_address
3529
- contract_decimals
3530
- contract_ticker_symbol
3531
- }
3532
- is_native
3533
- }
3534
- }
3535
- }
3536
- `;
3537
- const client = StreamingWebSocketClient.getClient();
3538
- return client.subscribe({
3539
- query,
3540
- }, {
3541
- next: (data) => {
3542
- if (data.data) {
3543
- const tokenBalancesData = data.data.tokenBalancesForWalletAddress;
3544
- if (tokenBalancesData) {
3545
- callbacks.next(tokenBalancesData);
3546
- }
3547
- }
3548
- else if (data.errors) {
3549
- callbacks.error?.(data.errors);
3550
- }
3551
- },
3552
- error: callbacks.error || (() => { }),
3553
- complete: callbacks.complete || (() => { }),
3554
- });
3555
- }
3556
- /**
3557
- * Subscribe to real-time wallet activity including transactions, token transfers, and smart contract interactions
3510
+ * **Credit Cost**: 0 per call
3511
+ *
3512
+ * **Beta**: This endpoint is in beta.
3558
3513
  *
3559
3514
  * @param params - Parameters for the wallet activity stream
3560
3515
  * @param callbacks - Subscription callbacks
@@ -3580,33 +3535,110 @@ class StreamingService {
3580
3535
  const walletAddressesString = params.wallet_addresses
3581
3536
  .map((addr) => `"${addr}"`)
3582
3537
  .join(", ");
3583
- const query = `
3584
- subscription {
3585
- walletTxs(
3586
- chain_name: ${params.chain_name},
3587
- wallet_addresses: [${walletAddressesString}]
3588
- ) {
3589
- tx_hash
3590
- from_address
3591
- to_address
3592
- value
3593
- chain_name
3594
- block_signed_at
3595
- block_height
3596
- block_hash
3597
- miner_address
3598
- gas_used
3599
- tx_offset
3600
- successful
3601
- decoded_type
3602
- logs {
3603
- emitter_address
3604
- log_offset
3605
- data
3606
- topics
3607
- }
3608
- }
3609
- }
3538
+ const query = `
3539
+ subscription {
3540
+ walletTxs(
3541
+ chain_name: ${params.chain_name},
3542
+ wallet_addresses: [${walletAddressesString}]
3543
+ ) {
3544
+ tx_hash
3545
+ from_address
3546
+ to_address
3547
+ value
3548
+ chain_name
3549
+ block_signed_at
3550
+ block_height
3551
+ block_hash
3552
+ miner_address
3553
+ gas_used
3554
+ tx_offset
3555
+ successful
3556
+ decoded_type
3557
+ decoded_details {
3558
+ ... on TransferTransaction {
3559
+ from
3560
+ to
3561
+ amount
3562
+ quote_usd
3563
+ quote_rate_usd
3564
+ contract_metadata {
3565
+ contract_name
3566
+ contract_address
3567
+ contract_decimals
3568
+ contract_ticker_symbol
3569
+ }
3570
+ }
3571
+ ... on SwapTransaction {
3572
+ token_in
3573
+ token_out
3574
+ amount_in
3575
+ amount_out
3576
+ }
3577
+ ... on BridgeTransaction {
3578
+ type
3579
+ typeString
3580
+ from
3581
+ to
3582
+ amount
3583
+ quote_usd
3584
+ quote_rate_usd
3585
+ contract_metadata {
3586
+ contract_name
3587
+ contract_address
3588
+ contract_decimals
3589
+ contract_ticker_symbol
3590
+ }
3591
+ }
3592
+ ... on DepositTransaction {
3593
+ from
3594
+ to
3595
+ amount
3596
+ quote_usd
3597
+ quote_rate_usd
3598
+ contract_metadata {
3599
+ contract_name
3600
+ contract_address
3601
+ contract_decimals
3602
+ contract_ticker_symbol
3603
+ }
3604
+ }
3605
+ ... on WithdrawTransaction {
3606
+ from
3607
+ to
3608
+ amount
3609
+ quote_usd
3610
+ quote_rate_usd
3611
+ contract_metadata {
3612
+ contract_name
3613
+ contract_address
3614
+ contract_decimals
3615
+ contract_ticker_symbol
3616
+ }
3617
+ }
3618
+ ... on ApproveTransaction {
3619
+ spender
3620
+ amount
3621
+ quote_usd
3622
+ quote_rate_usd
3623
+ contract_metadata {
3624
+ contract_name
3625
+ contract_address
3626
+ contract_decimals
3627
+ contract_ticker_symbol
3628
+ }
3629
+ }
3630
+ ... on ErrorDetails {
3631
+ message
3632
+ }
3633
+ }
3634
+ logs {
3635
+ emitter_address
3636
+ log_offset
3637
+ data
3638
+ topics
3639
+ }
3640
+ }
3641
+ }
3610
3642
  `;
3611
3643
  const client = StreamingWebSocketClient.getClient();
3612
3644
  return client.subscribe({
@@ -3627,6 +3659,181 @@ class StreamingService {
3627
3659
  complete: callbacks.complete || (() => { }),
3628
3660
  });
3629
3661
  }
3662
+ /**
3663
+ * Search for tokens by keyword, ticker, or contract address
3664
+ *
3665
+ * @param params - Parameters for the token search query
3666
+ * @returns Promise resolving to an array of matching tokens
3667
+ *
3668
+ * @example
3669
+ * ```typescript
3670
+ * const results = await streamingService.searchToken({
3671
+ * query: "PEPE"
3672
+ * });
3673
+ * console.log("Search Results:", results);
3674
+ * ```
3675
+ */
3676
+ searchToken(params) {
3677
+ const query = `
3678
+ query SearchToken($query: String!) {
3679
+ searchToken(query: $query) {
3680
+ pair_address
3681
+ chain_name
3682
+ quote_rate
3683
+ quote_rate_usd
3684
+ volume
3685
+ volume_usd
3686
+ market_cap
3687
+ base_token {
3688
+ contract_name
3689
+ contract_address
3690
+ contract_decimals
3691
+ contract_ticker_symbol
3692
+ }
3693
+ quote_token {
3694
+ contract_name
3695
+ contract_address
3696
+ contract_decimals
3697
+ contract_ticker_symbol
3698
+ }
3699
+ }
3700
+ }
3701
+ `;
3702
+ const client = StreamingWebSocketClient.getClient();
3703
+ return new Promise((resolve, reject) => {
3704
+ let result = [];
3705
+ client.subscribe({
3706
+ query,
3707
+ variables: { query: params.query },
3708
+ }, {
3709
+ next: (data) => {
3710
+ if (data.data) {
3711
+ result = data.data.searchToken ?? [];
3712
+ }
3713
+ else if (data.errors) {
3714
+ reject(data.errors);
3715
+ }
3716
+ },
3717
+ error: (err) => reject(err),
3718
+ complete: () => resolve(result),
3719
+ });
3720
+ });
3721
+ }
3722
+ /**
3723
+ * Get top trader wallets and their PnL for a specific token
3724
+ *
3725
+ * @param params - Parameters for the UPnL token query
3726
+ * @returns Promise resolving to an array of top trader wallet data
3727
+ *
3728
+ * @example
3729
+ * ```typescript
3730
+ * const traders = await streamingService.getUPnLForToken({
3731
+ * chain_name: StreamingChain.ETH_MAINNET,
3732
+ * token_address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
3733
+ * });
3734
+ * console.log("Top Traders:", traders);
3735
+ * ```
3736
+ */
3737
+ getUPnLForToken(params) {
3738
+ const query = `
3739
+ query {
3740
+ upnlForToken(
3741
+ chain_name: ${params.chain_name}
3742
+ token_address: "${params.token_address}"
3743
+ ) {
3744
+ token_address
3745
+ wallet_address
3746
+ volume
3747
+ transactions_count
3748
+ pnl_realized_usd
3749
+ balance
3750
+ balance_pretty
3751
+ pnl_unrealized_usd
3752
+ contract_metadata {
3753
+ contract_name
3754
+ contract_address
3755
+ contract_decimals
3756
+ contract_ticker_symbol
3757
+ }
3758
+ }
3759
+ }
3760
+ `;
3761
+ const client = StreamingWebSocketClient.getClient();
3762
+ return new Promise((resolve, reject) => {
3763
+ let result = [];
3764
+ client.subscribe({
3765
+ query,
3766
+ }, {
3767
+ next: (data) => {
3768
+ if (data.data) {
3769
+ result = data.data.upnlForToken ?? [];
3770
+ }
3771
+ else if (data.errors) {
3772
+ reject(data.errors);
3773
+ }
3774
+ },
3775
+ error: (err) => reject(err),
3776
+ complete: () => resolve(result),
3777
+ });
3778
+ });
3779
+ }
3780
+ /**
3781
+ * Get unrealized and realized PnL for all tokens held by a wallet
3782
+ *
3783
+ * @param params - Parameters for the UPnL wallet query
3784
+ * @returns Promise resolving to an array of token PnL data for the wallet
3785
+ *
3786
+ * @example
3787
+ * ```typescript
3788
+ * const pnl = await streamingService.getUPnLForWallet({
3789
+ * chain_name: StreamingChain.ETH_MAINNET,
3790
+ * wallet_address: "0xfe97b0C517a84F98fc6eDe3CD26B43012d31992a"
3791
+ * });
3792
+ * console.log("Wallet PnL:", pnl);
3793
+ * ```
3794
+ */
3795
+ getUPnLForWallet(params) {
3796
+ const query = `
3797
+ query {
3798
+ upnlForWallet(
3799
+ chain_name: ${params.chain_name}
3800
+ wallet_address: "${params.wallet_address}"
3801
+ ) {
3802
+ token_address
3803
+ cost_basis
3804
+ current_price
3805
+ pnl_realized_usd
3806
+ pnl_unrealized_usd
3807
+ net_balance_change
3808
+ marketcap_usd
3809
+ contract_metadata {
3810
+ contract_name
3811
+ contract_address
3812
+ contract_decimals
3813
+ contract_ticker_symbol
3814
+ }
3815
+ }
3816
+ }
3817
+ `;
3818
+ const client = StreamingWebSocketClient.getClient();
3819
+ return new Promise((resolve, reject) => {
3820
+ let result = [];
3821
+ client.subscribe({
3822
+ query,
3823
+ }, {
3824
+ next: (data) => {
3825
+ if (data.data) {
3826
+ result = data.data.upnlForWallet ?? [];
3827
+ }
3828
+ else if (data.errors) {
3829
+ reject(data.errors);
3830
+ }
3831
+ },
3832
+ error: (err) => reject(err),
3833
+ complete: () => resolve(result),
3834
+ });
3835
+ });
3836
+ }
3630
3837
  }
3631
3838
  /**
3632
3839
  * Singleton WebSocket Client for GoldRush Streaming
@@ -3656,6 +3863,7 @@ class StreamingWebSocketClient {
3656
3863
  return;
3657
3864
  StreamingWebSocketClient.client = createClient({
3658
3865
  url: "wss://gr-staging-v2.streaming.covalenthq.com/graphql",
3866
+ lazyCloseTimeout: 3000,
3659
3867
  connectionParams: {
3660
3868
  GOLDRUSH_API_KEY: StreamingWebSocketClient.apiKey,
3661
3869
  },
@@ -3711,7 +3919,9 @@ class TransactionService {
3711
3919
  }
3712
3920
  /**
3713
3921
  *
3714
- * Commonly used to fetch and render a single transaction including its decoded log events.
3922
+ * Used to fetch and render a single transaction including its decoded event logs. For foundational chains, can also retrieve internal transactions, state changes and method ID where available.
3923
+ *
3924
+ * **Credit Cost**: 0.1 per call
3715
3925
  *
3716
3926
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
3717
3927
  * @param {string} txHash - The transaction hash.
@@ -3776,7 +3986,9 @@ class TransactionService {
3776
3986
  }
3777
3987
  /**
3778
3988
  *
3779
- * Commonly used to fetch the earliest and latest transactions, and the transaction count for a wallet. Calculate the age of the wallet and the time it has been idle and quickly gain insights into their engagement with web3.
3989
+ * Used to fetch the earliest and latest transactions, and the transaction count for a wallet. Also enriched with gas expenditure details and total ERC20 token transfers count.
3990
+ *
3991
+ * **Credit Cost**: 1 per call
3780
3992
  *
3781
3993
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
3782
3994
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
@@ -3891,6 +4103,8 @@ class TransactionService {
3891
4103
  *
3892
4104
  * Commonly used to fetch and render the most recent transactions involving an address. Frequently seen in wallet applications.
3893
4105
  *
4106
+ * **Credit Cost**: 0.1 per item
4107
+ *
3894
4108
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
3895
4109
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
3896
4110
  * @param {GetAllTransactionsForAddressQueryParamOpts} queryParamOpts
@@ -3963,6 +4177,8 @@ class TransactionService {
3963
4177
  *
3964
4178
  * Commonly used to fetch and render the most recent transactions involving an address. Frequently seen in wallet applications.
3965
4179
  *
4180
+ * **Credit Cost**: 0.1 per item
4181
+ *
3966
4182
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
3967
4183
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
3968
4184
  * @param {GetAllTransactionsForAddressQueryParamOpts} queryParamOpts
@@ -4157,6 +4373,8 @@ class TransactionService {
4157
4373
  *
4158
4374
  * Commonly used to fetch all transactions including their decoded log events in a block and further flag interesting wallets or transactions.
4159
4375
  *
4376
+ * **Credit Cost**: 0.1 per item
4377
+ *
4160
4378
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
4161
4379
  * @param {number} blockHeight - The requested block height.
4162
4380
  * @param {number} page - The requested page, 0-indexed.
@@ -4215,6 +4433,8 @@ class TransactionService {
4215
4433
  *
4216
4434
  * Commonly used to fetch all transactions including their decoded log events in a block and further flag interesting wallets or transactions.
4217
4435
  *
4436
+ * **Credit Cost**: 0.1 per item
4437
+ *
4218
4438
  * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
4219
4439
  * @param {string} blockHash - The requested block hash.
4220
4440
  * @param {getTransactionsForBlockByPageQueryParamOpts} queryParamOpts
@@ -4460,9 +4680,10 @@ class Execution {
4460
4680
  };
4461
4681
  }
4462
4682
  catch (error) {
4683
+ const err = error;
4463
4684
  debugOutput(this.settings, `Request URL: ${endpoint} | Retry Enabled: ${this.enableRetry} | Retry Count: ${retryCount} | Max Retries: ${this.maxRetries} | Retry Delay: ${this.retryDelay}ms`, error);
4464
4685
  if (this.enableRetry &&
4465
- (error?.error_code === 429 || error?.cause?.code === 429)) {
4686
+ (err?.error_code === 429 || err?.cause?.code === 429)) {
4466
4687
  if (retryCount >= this.maxRetries) {
4467
4688
  completed = true;
4468
4689
  return {
@@ -4483,9 +4704,9 @@ class Execution {
4483
4704
  return {
4484
4705
  data: null,
4485
4706
  error: true,
4486
- error_code: error?.cause?.code || error?.error_code || 500,
4487
- error_message: error?.cause?.message ||
4488
- error?.error_message ||
4707
+ error_code: err?.cause?.code || err?.error_code || 500,
4708
+ error_message: err?.cause?.message ||
4709
+ err?.error_message ||
4489
4710
  "Internal server error",
4490
4711
  };
4491
4712
  }
@@ -5725,16 +5946,19 @@ exports.StreamingChain = void 0;
5725
5946
  StreamingChain["ETH_MAINNET"] = "ETH_MAINNET";
5726
5947
  StreamingChain["BSC_MAINNET"] = "BSC_MAINNET";
5727
5948
  StreamingChain["HYPERCORE_MAINNET"] = "HYPERCORE_MAINNET";
5949
+ StreamingChain["HYPEREVM_MAINNET"] = "HYPEREVM_MAINNET";
5950
+ StreamingChain["MONAD_MAINNET"] = "MONAD_MAINNET";
5951
+ StreamingChain["POLYGON_MAINNET"] = "POLYGON_MAINNET";
5952
+ StreamingChain["MEGAETH_MAINNET"] = "MEGAETH_MAINNET";
5728
5953
  })(exports.StreamingChain || (exports.StreamingChain = {}));
5729
5954
  exports.StreamingInterval = void 0;
5730
5955
  (function (StreamingInterval) {
5731
5956
  StreamingInterval["ONE_SECOND"] = "ONE_SECOND";
5957
+ StreamingInterval["FIVE_SECONDS"] = "FIVE_SECONDS";
5732
5958
  StreamingInterval["FIFTEEN_SECONDS"] = "FIFTEEN_SECONDS";
5733
- StreamingInterval["THIRTY_SECONDS"] = "THIRTY_SECONDS";
5734
5959
  StreamingInterval["ONE_MINUTE"] = "ONE_MINUTE";
5735
5960
  StreamingInterval["FIVE_MINUTES"] = "FIVE_MINUTES";
5736
5961
  StreamingInterval["FIFTEEN_MINUTES"] = "FIFTEEN_MINUTES";
5737
- StreamingInterval["THIRTY_MINUTES"] = "THIRTY_MINUTES";
5738
5962
  StreamingInterval["ONE_HOUR"] = "ONE_HOUR";
5739
5963
  StreamingInterval["FOUR_HOURS"] = "FOUR_HOURS";
5740
5964
  StreamingInterval["ONE_DAY"] = "ONE_DAY";
@@ -5744,21 +5968,19 @@ exports.StreamingTimeframe = void 0;
5744
5968
  StreamingTimeframe["ONE_MINUTE"] = "ONE_MINUTE";
5745
5969
  StreamingTimeframe["FIVE_MINUTES"] = "FIVE_MINUTES";
5746
5970
  StreamingTimeframe["FIFTEEN_MINUTES"] = "FIFTEEN_MINUTES";
5747
- StreamingTimeframe["THIRTY_MINUTES"] = "THIRTY_MINUTES";
5748
5971
  StreamingTimeframe["ONE_HOUR"] = "ONE_HOUR";
5749
5972
  StreamingTimeframe["FOUR_HOURS"] = "FOUR_HOURS";
5750
5973
  StreamingTimeframe["ONE_DAY"] = "ONE_DAY";
5751
- StreamingTimeframe["ONE_WEEK"] = "ONE_WEEK";
5752
- StreamingTimeframe["ONE_MONTH"] = "ONE_MONTH";
5974
+ StreamingTimeframe["SEVEN_DAYS"] = "SEVEN_DAYS";
5753
5975
  })(exports.StreamingTimeframe || (exports.StreamingTimeframe = {}));
5754
5976
  exports.StreamingProtocol = void 0;
5755
5977
  (function (StreamingProtocol) {
5756
5978
  StreamingProtocol["UNISWAP_V2"] = "UNISWAP_V2";
5757
5979
  StreamingProtocol["UNISWAP_V3"] = "UNISWAP_V3";
5758
- StreamingProtocol["UNISWAP_V4"] = "UNISWAP_V4";
5759
5980
  StreamingProtocol["VIRTUALS_V2"] = "VIRTUALS_V2";
5760
- StreamingProtocol["CLANKER"] = "CLANKER";
5981
+ StreamingProtocol["CLANKER_V3"] = "CLANKER";
5761
5982
  StreamingProtocol["RAYDIUM_AMM"] = "RAYDIUM_AMM";
5983
+ StreamingProtocol["RAYDIUM_CLMM"] = "RAYDIUM_CLMM";
5762
5984
  StreamingProtocol["RAYDIUM_CPMM"] = "RAYDIUM_CPMM";
5763
5985
  StreamingProtocol["PUMP_DOT_FUN"] = "PUMP_DOT_FUN";
5764
5986
  StreamingProtocol["PUMP_FUN_AMM"] = "PUMP_FUN_AMM";
@@ -5771,6 +5993,14 @@ exports.StreamingProtocol = void 0;
5771
5993
  StreamingProtocol["PANCAKESWAP_V3"] = "PANCAKESWAP_V3";
5772
5994
  StreamingProtocol["SHADOW_V2"] = "SHADOW_V2";
5773
5995
  StreamingProtocol["SHADOW_V3"] = "SHADOW_V3";
5996
+ StreamingProtocol["OCTOSWAP_V2"] = "OCTOSWAP_V2";
5997
+ StreamingProtocol["OCTOSWAP_V3"] = "OCTOSWAP_V3";
5998
+ StreamingProtocol["QUICKSWAP_V2"] = "QUICKSWAP_V2";
5999
+ StreamingProtocol["QUICKSWAP_V3"] = "QUICKSWAP_V3";
6000
+ StreamingProtocol["SUSHISWAP_V2"] = "SUSHISWAP_V2";
6001
+ StreamingProtocol["PROJECT_X"] = "PROJECT_X";
6002
+ StreamingProtocol["KUMBAYA_V1"] = "KUMBAYA_V1";
6003
+ StreamingProtocol["JOE_V2"] = "JOE_V2";
5774
6004
  })(exports.StreamingProtocol || (exports.StreamingProtocol = {}));
5775
6005
 
5776
6006
  exports.GoldRushClient = GoldRushClient;