@defillama/sdk 5.0.236 → 5.0.240

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.
Files changed (131) hide show
  1. package/package.json +3 -3
  2. package/build/Balances.d.ts +0 -139
  3. package/build/Balances.js +0 -363
  4. package/build/ChainApi.d.ts +0 -142
  5. package/build/ChainApi.js +0 -297
  6. package/build/abi/abi2.d.ts +0 -5
  7. package/build/abi/abi2.js +0 -215
  8. package/build/abi/cachedABIs.d.ts +0 -4
  9. package/build/abi/cachedABIs.js +0 -8
  10. package/build/abi/convertResults.d.ts +0 -5
  11. package/build/abi/convertResults.js +0 -60
  12. package/build/abi/index.d.ts +0 -31
  13. package/build/abi/index.js +0 -327
  14. package/build/abi/multicall.d.ts +0 -23
  15. package/build/abi/multicall.js +0 -382
  16. package/build/abi/multicall3.d.ts +0 -7
  17. package/build/abi/multicall3.js +0 -397
  18. package/build/abi/rpcCall.d.ts +0 -4
  19. package/build/abi/rpcCall.js +0 -62
  20. package/build/abi/tron.d.ts +0 -33
  21. package/build/abi/tron.js +0 -110
  22. package/build/api.d.ts +0 -10
  23. package/build/api.js +0 -45
  24. package/build/api2.d.ts +0 -5
  25. package/build/api2.js +0 -41
  26. package/build/chains/algorand.d.ts +0 -277
  27. package/build/chains/algorand.js +0 -618
  28. package/build/chains/aptos.d.ts +0 -230
  29. package/build/chains/aptos.js +0 -612
  30. package/build/chains/cardano.d.ts +0 -242
  31. package/build/chains/cardano.js +0 -407
  32. package/build/chains/cosmos.d.ts +0 -252
  33. package/build/chains/cosmos.js +0 -618
  34. package/build/chains/icp.d.ts +0 -235
  35. package/build/chains/icp.js +0 -1040
  36. package/build/chains/index.d.ts +0 -23
  37. package/build/chains/index.js +0 -59
  38. package/build/chains/near.d.ts +0 -192
  39. package/build/chains/near.js +0 -446
  40. package/build/chains/rpc.d.ts +0 -125
  41. package/build/chains/rpc.js +0 -326
  42. package/build/chains/starknet.d.ts +0 -205
  43. package/build/chains/starknet.js +0 -884
  44. package/build/chains/stellar.d.ts +0 -410
  45. package/build/chains/stellar.js +0 -1082
  46. package/build/chains/substrate.d.ts +0 -333
  47. package/build/chains/substrate.js +0 -1042
  48. package/build/chains/sui.d.ts +0 -365
  49. package/build/chains/sui.js +0 -1135
  50. package/build/chains/svm.d.ts +0 -340
  51. package/build/chains/svm.js +0 -760
  52. package/build/chains/tezos.d.ts +0 -225
  53. package/build/chains/tezos.js +0 -412
  54. package/build/chains/ton.d.ts +0 -353
  55. package/build/chains/ton.js +0 -788
  56. package/build/chains/tron.d.ts +0 -45
  57. package/build/chains/tron.js +0 -110
  58. package/build/chains/utxo.d.ts +0 -202
  59. package/build/chains/utxo.js +0 -592
  60. package/build/chains/xrpl.d.ts +0 -179
  61. package/build/chains/xrpl.js +0 -467
  62. package/build/computeTVL/blocks.d.ts +0 -1
  63. package/build/computeTVL/blocks.js +0 -12
  64. package/build/computeTVL/humanizeNumber.d.ts +0 -1
  65. package/build/computeTVL/humanizeNumber.js +0 -19
  66. package/build/erc20/index.d.ts +0 -31
  67. package/build/erc20/index.js +0 -56
  68. package/build/eth/index.d.ts +0 -22
  69. package/build/eth/index.js +0 -118
  70. package/build/general.d.ts +0 -5
  71. package/build/general.js +0 -20
  72. package/build/generalUtil.d.ts +0 -8
  73. package/build/generalUtil.js +0 -73
  74. package/build/index.d.ts +0 -32
  75. package/build/index.js +0 -74
  76. package/build/providers.json +0 -1
  77. package/build/types.d.ts +0 -76
  78. package/build/types.js +0 -2
  79. package/build/util/LlamaProvider.d.ts +0 -46
  80. package/build/util/LlamaProvider.js +0 -365
  81. package/build/util/blocks.d.ts +0 -36
  82. package/build/util/blocks.js +0 -292
  83. package/build/util/cache.d.ts +0 -45
  84. package/build/util/cache.js +0 -309
  85. package/build/util/chainUtils/data.json +0 -1356
  86. package/build/util/chainUtils/index.d.ts +0 -11
  87. package/build/util/chainUtils/index.js +0 -136
  88. package/build/util/coins.d.ts +0 -19
  89. package/build/util/coins.js +0 -113
  90. package/build/util/common.d.ts +0 -34
  91. package/build/util/common.js +0 -373
  92. package/build/util/computeTVL.d.ts +0 -19
  93. package/build/util/computeTVL.js +0 -102
  94. package/build/util/cosmos.d.ts +0 -1
  95. package/build/util/cosmos.js +0 -8
  96. package/build/util/debugLog.d.ts +0 -4
  97. package/build/util/debugLog.js +0 -18
  98. package/build/util/discord.d.ts +0 -1
  99. package/build/util/discord.js +0 -33
  100. package/build/util/elastic.d.ts +0 -43
  101. package/build/util/elastic.js +0 -113
  102. package/build/util/env.d.ts +0 -19
  103. package/build/util/env.js +0 -158
  104. package/build/util/graph.d.ts +0 -8
  105. package/build/util/graph.js +0 -50
  106. package/build/util/index.d.ts +0 -32
  107. package/build/util/index.js +0 -227
  108. package/build/util/indexer.compatibility.d.ts +0 -6
  109. package/build/util/indexer.compatibility.js +0 -64
  110. package/build/util/indexer.d.ts +0 -92
  111. package/build/util/indexer.js +0 -744
  112. package/build/util/indexerSql.d.ts +0 -9
  113. package/build/util/indexerSql.js +0 -102
  114. package/build/util/internal-cache.d.ts +0 -11
  115. package/build/util/internal-cache.js +0 -77
  116. package/build/util/logs.d.ts +0 -55
  117. package/build/util/logs.decode.shared.d.ts +0 -8
  118. package/build/util/logs.decode.shared.js +0 -289
  119. package/build/util/logs.js +0 -401
  120. package/build/util/promisePool.d.ts +0 -8
  121. package/build/util/promisePool.js +0 -31
  122. package/build/util/r2.d.ts +0 -4
  123. package/build/util/r2.js +0 -52
  124. package/build/util/removeRedundantRPCs.d.ts +0 -1
  125. package/build/util/removeRedundantRPCs.js +0 -49
  126. package/build/util/transactions.d.ts +0 -35
  127. package/build/util/transactions.js +0 -22
  128. package/build/util/updateChainLabels.d.ts +0 -1
  129. package/build/util/updateChainLabels.js +0 -5
  130. package/build/util/updateProviderList.d.ts +0 -1
  131. package/build/util/updateProviderList.js +0 -274
@@ -1,64 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.normalizeV4Row = normalizeV4Row;
7
- exports.parseTransferResponse = parseTransferResponse;
8
- const stream_1 = require("stream");
9
- const promises_1 = require("stream/promises");
10
- const stream_json_1 = require("stream-json");
11
- const Assembler_1 = __importDefault(require("stream-json/Assembler"));
12
- const numericFields = {
13
- logs: ["chain", "block_number", "log_index"],
14
- transfers: ["chain", "block_number", "log_index", "value", "id"],
15
- transactions: ["chain", "block_number", "transaction_index", "value", "gas", "gas_price",
16
- "gas_used", "effective_gas_price", "max_fee_per_gas", "max_priority_fee_per_gas",
17
- "base_fee_per_gas", "nonce", "transaction_type", "cumulative_gas_used"],
18
- };
19
- const addressFields = {
20
- logs: ["source", "address"],
21
- transfers: ["from_address", "to_address", "token", "operator"],
22
- transactions: ["from_address", "to_address", "contract_created"],
23
- };
24
- const hashFields = {
25
- logs: ["transaction_hash", "topic0", "topic1", "topic2", "topic3"],
26
- transfers: ["transaction_hash"],
27
- transactions: ["hash", "block_hash"],
28
- };
29
- function fixedHex(value, bytes) {
30
- // Empty/absent values are not the zero address or the zero topic.
31
- if (typeof value !== "string" || !/^0x[0-9a-f]+$/i.test(value))
32
- return value;
33
- const hex = value.slice(2);
34
- return hex.length <= bytes * 2 ? `0x${hex.toLowerCase().padStart(bytes * 2, "0")}` : value;
35
- }
36
- /** Preserve v2 REST field types and padding; never applied to SQL results. */
37
- function normalizeV4Row(row, kind) {
38
- for (const key of numericFields[kind]) {
39
- // The exact transfer id is captured for the cursor before restoring the public Number.
40
- if (typeof row[key] === "string" && /^-?\d+(?:\.\d+)?(?:e[+-]?\d+)?$/i.test(row[key]))
41
- row[key] = Number(row[key]);
42
- }
43
- for (const key of addressFields[kind])
44
- if (key in row)
45
- row[key] = fixedHex(row[key], 20);
46
- for (const key of hashFields[kind])
47
- if (key in row)
48
- row[key] = fixedHex(row[key], 32);
49
- if (kind === "logs" && row.source === undefined && row.address !== undefined)
50
- row.source = row.address;
51
- return row;
52
- }
53
- /** Capture an unquoted UInt256 id before JSON.parse can round it. */
54
- async function parseTransferResponse(text) {
55
- const assembler = new Assembler_1.default();
56
- // Assembler only needs packed values, not intermediate string/number chunks.
57
- await (0, promises_1.pipeline)(stream_1.Readable.from([text]), (0, stream_json_1.parser)({ streamValues: false }), async (tokens) => {
58
- for await (const token of tokens) {
59
- assembler.consume(token.name === "numberValue" && assembler.key === "id"
60
- ? { name: "stringValue", value: token.value } : token);
61
- }
62
- });
63
- return assembler.current;
64
- }
@@ -1,92 +0,0 @@
1
- import { Address } from "../types";
2
- import { GetTransactionOptions } from "./transactions";
3
- export type IndexerVersion = "v2" | "v4";
4
- export declare function getChainIndexerVersion(chain: string): IndexerVersion;
5
- export declare const supportedChainSet2: Set<string>;
6
- export type IndexerGetLogsOptions = {
7
- target?: Address;
8
- topic?: string;
9
- fromBlock?: number;
10
- toBlock?: number;
11
- topics?: (string | null)[];
12
- extraTopics?: string[];
13
- chain?: string;
14
- eventAbi?: string | any;
15
- fromTimestamp?: number;
16
- toTimestamp?: number;
17
- entireLog?: boolean;
18
- cacheInCloud?: boolean;
19
- onlyArgs?: boolean;
20
- targets?: Address[];
21
- flatten?: boolean;
22
- all?: boolean;
23
- limit?: number;
24
- offset?: number;
25
- debugMode?: boolean;
26
- noTarget?: boolean;
27
- collect?: boolean;
28
- parseLog?: boolean;
29
- processor?: (logs: any[]) => Promise<void> | void;
30
- maxBlockRange?: number;
31
- allowParseFailure?: boolean;
32
- /** Opt in to streaming /logs instead of paginated requests. */
33
- clientStreaming?: boolean;
34
- /** Decoder type: 'viem' (faster) or 'ethers' (fallback) */
35
- decoderType?: "viem" | "ethers";
36
- /** Metrics hooks (optional) */
37
- onWireStats?: (s: {
38
- chunkSize: number;
39
- bytesReceived: number;
40
- itemsProcessed: number;
41
- }) => void;
42
- onDecodeStats?: (s: {
43
- batchSize: number;
44
- decodeTime: number;
45
- itemsDecoded: number;
46
- }) => void;
47
- };
48
- export type IndexerGetTokenTransfersOptions = {
49
- target?: Address;
50
- targets?: Address[];
51
- fromBlock?: number;
52
- toBlock?: number;
53
- chain?: string;
54
- fromTimestamp?: number;
55
- toTimestamp?: number;
56
- flatten?: boolean;
57
- all?: boolean;
58
- limit?: number;
59
- offset?: number;
60
- debugMode?: boolean;
61
- fromAddressFilter?: string | string[];
62
- transferType?: "in" | "out" | "all";
63
- tokens?: string | string[];
64
- token?: string;
65
- };
66
- export declare function getLogs(options: IndexerGetLogsOptions): Promise<any[]>;
67
- export declare function getTokenTransfers({ chain, fromAddressFilter, fromBlock, toBlock, all, limit, offset, target, targets, flatten, fromTimestamp, toTimestamp, debugMode, transferType, token, tokens, }: IndexerGetTokenTransfersOptions): Promise<any[]>;
68
- export declare function getTransactions({ chain, addresses, transaction_hashes, from_block, to_block, all, limit, offset, debugMode, transactionType, }: GetTransactionOptions): Promise<{
69
- hash: any;
70
- blockNumber: number;
71
- transactionIndex: number;
72
- from: any;
73
- to: any;
74
- value: any;
75
- gasPrice: any;
76
- gas: any;
77
- input: any;
78
- nonce: number;
79
- data: any;
80
- type: any;
81
- maxFeePerGas: any;
82
- maxPriorityFeePerGas: any;
83
- baseFeePerGas: any;
84
- effectiveGasPrice: any;
85
- gasUsed: any;
86
- cumulativeGasUsed: any;
87
- status: number;
88
- contractCreated: any;
89
- timestamp: any;
90
- }[] | null>;
91
- export declare function isIndexerEnabled(chain?: string): boolean;
92
- export declare function isIndexer2Enabled(chain?: string): boolean;