@defillama/sdk 5.0.238 → 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 +1 -1
  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 -310
  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 -116
  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 -367
  81. package/build/util/blocks.d.ts +0 -36
  82. package/build/util/blocks.js +0 -500
  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 -1425
  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 -124
  90. package/build/util/common.d.ts +0 -34
  91. package/build/util/common.js +0 -376
  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 -20
  103. package/build/util/env.js +0 -175
  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 -850
  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 -58
  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 -432
  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 -275
@@ -1,230 +0,0 @@
1
- export declare const DEFAULT_ENDPOINTS: Record<string, string>;
2
- /**
3
- * Archival nodes used when the primary answers 410 `block_pruned` / `version_pruned`
4
- * (the public aptos fullnode keeps only a few weeks of blocks). Override with `<CHAIN>_ARCHIVAL_RPC`.
5
- */
6
- export declare const ARCHIVAL_ENDPOINTS: Record<string, string>;
7
- export declare const aptosChains: string[];
8
- export declare const APT_COIN_TYPE = "0x1::aptos_coin::AptosCoin";
9
- export declare const APT_DECIMALS = 8;
10
- export type AptosChain = 'aptos' | 'move' | string;
11
- export interface ChainOptions {
12
- /** chain key, default `aptos` */
13
- chain?: AptosChain;
14
- }
15
- export interface RequestOptions extends ChainOptions {
16
- timeout?: number;
17
- retries?: number;
18
- /** send straight to the archival endpoint(s) instead of falling back to them on 410 */
19
- archival?: boolean;
20
- }
21
- export interface LedgerInfo {
22
- chainId: number;
23
- ledgerVersion: number;
24
- /** unix seconds */
25
- ledgerTimestamp: number;
26
- blockHeight: number;
27
- oldestLedgerVersion: number;
28
- oldestBlockHeight: number;
29
- epoch: number;
30
- raw: any;
31
- }
32
- export interface AptosBlock {
33
- /** block height */
34
- number: number;
35
- /** unix seconds */
36
- timestamp: number;
37
- hash: string;
38
- firstVersion: number;
39
- lastVersion: number;
40
- transactions?: any[];
41
- raw: any;
42
- }
43
- export interface CoinInfo {
44
- decimals: number;
45
- symbol: string;
46
- name: string;
47
- /** raw supply (only when directly available on the metadata resource) */
48
- supply?: string;
49
- }
50
- export interface TypeTag {
51
- /** full type string as given */
52
- raw: string;
53
- /** module address (`0x1`), empty for primitives */
54
- address: string;
55
- /** module name (`coin`), empty for primitives */
56
- module: string;
57
- /** struct / primitive name (`CoinInfo`, `u64`) */
58
- name: string;
59
- /** generic type arguments, unparsed (`['0x1::aptos_coin::AptosCoin']`) */
60
- typeArgs: string[];
61
- /** true when the tag is a struct (`addr::module::Name`) */
62
- isStruct: boolean;
63
- }
64
- export declare function isAptosChain(chain?: string): boolean;
65
- /** All configured endpoints for the chain (env override first, then defaults). */
66
- export declare function getEndpointList({ chain }?: ChainOptions): string[];
67
- /** First configured endpoint for the chain. */
68
- export declare function getEndpoint({ chain }?: ChainOptions): string;
69
- /** Archival endpoints for the chain (`<CHAIN>_ARCHIVAL_RPC` env, then built-in); empty when none. */
70
- export declare function getArchivalEndpointList({ chain }?: ChainOptions): string[];
71
- /** GET `path` (relative to the node root, e.g. `/v1/accounts/0x1`). 404 -> `null` when `allowNotFound`. */
72
- export declare function get({ chain, path, params, allowNotFound, timeout, retries, archival }: RequestOptions & {
73
- path: string;
74
- params?: Record<string, any>;
75
- allowNotFound?: boolean;
76
- }): Promise<any>;
77
- /** POST `body` to `path` (relative to the node root, e.g. `/v1/view`). */
78
- export declare function post({ chain, path, body, params, allowNotFound, timeout, retries, archival }: RequestOptions & {
79
- path: string;
80
- body: any;
81
- params?: Record<string, any>;
82
- allowNotFound?: boolean;
83
- }): Promise<any>;
84
- export declare function getLedgerInfo({ chain, archival }?: ChainOptions & {
85
- archival?: boolean;
86
- }): Promise<LedgerInfo>;
87
- /** `{ sequence_number, authentication_key }` or `null` when the account does not exist. */
88
- export declare function getAccount({ chain, address, ledgerVersion }: ChainOptions & {
89
- address: string;
90
- ledgerVersion?: number | string;
91
- }): Promise<any>;
92
- /** Every resource of `account` (`{ type, data }[]`), following `x-aptos-cursor` pagination. */
93
- export declare function getResources({ chain, account, ledgerVersion }: ChainOptions & {
94
- account: string;
95
- ledgerVersion?: number | string;
96
- }): Promise<any[]>;
97
- /** `data` of one resource, or `null` when the account does not hold it. */
98
- export declare function getResource({ chain, account, type, ledgerVersion }: ChainOptions & {
99
- account: string;
100
- type: string;
101
- ledgerVersion?: number | string;
102
- }): Promise<any>;
103
- /** Every module published by `account`, following `x-aptos-cursor` pagination. */
104
- export declare function getAccountModules({ chain, account, ledgerVersion }: ChainOptions & {
105
- account: string;
106
- ledgerVersion?: number | string;
107
- }): Promise<any[]>;
108
- /** Single module ABI/bytecode, or `null` when missing. */
109
- export declare function getAccountModule({ chain, account, name, ledgerVersion }: ChainOptions & {
110
- account: string;
111
- name: string;
112
- ledgerVersion?: number | string;
113
- }): Promise<any>;
114
- /**
115
- * Read one table item. Returns the decoded value, or `null` when `allowNotFound` is set and the
116
- * key is missing (the node answers 404 for absent keys).
117
- */
118
- export declare function getTableItem({ chain, handle, keyType, valueType, key, ledgerVersion, allowNotFound }: ChainOptions & {
119
- handle: string;
120
- keyType: string;
121
- valueType: string;
122
- key: any;
123
- ledgerVersion?: number | string;
124
- allowNotFound?: boolean;
125
- }): Promise<any>;
126
- /** Run a `#[view]` function. Returns the result array as the node encodes it (u64/u128 as strings). */
127
- export declare function view<T extends any[] = any[]>({ chain, function: fn, typeArguments, args, ledgerVersion }: ChainOptions & {
128
- function: string;
129
- typeArguments?: string[];
130
- args?: any[];
131
- ledgerVersion?: number | string;
132
- }): Promise<T>;
133
- /** Events of an event handle field, e.g. `{ eventHandle: '0x1::coin::CoinStore<...>', field: 'deposit_events' }`. */
134
- export declare function getEvents({ chain, account, eventHandle, field, start, limit }: ChainOptions & {
135
- account: string;
136
- eventHandle: string;
137
- field: string;
138
- start?: number | string;
139
- limit?: number;
140
- }): Promise<any[]>;
141
- export declare function getEventsByCreationNumber({ chain, account, creationNumber, start, limit }: ChainOptions & {
142
- account: string;
143
- creationNumber: number | string;
144
- start?: number | string;
145
- limit?: number;
146
- }): Promise<any[]>;
147
- /**
148
- * Block by height; `null` when it does not exist (yet). Heights pruned from the primary are
149
- * fetched from the archival endpoint when one is configured, otherwise the 410 error propagates.
150
- */
151
- export declare function getBlockByHeight({ chain, height, withTransactions, archival }: ChainOptions & {
152
- height: number | string;
153
- withTransactions?: boolean;
154
- archival?: boolean;
155
- }): Promise<AptosBlock | null>;
156
- /** Block containing ledger version `version`; `null` when unknown. Pruned versions fall back to archival like `getBlockByHeight`. */
157
- export declare function getBlockByVersion({ chain, version, withTransactions, archival }: ChainOptions & {
158
- version: number | string;
159
- withTransactions?: boolean;
160
- archival?: boolean;
161
- }): Promise<AptosBlock | null>;
162
- /** Latest block height + timestamp (seconds) from ledger info; `version` is the latest ledger version. */
163
- export declare function getLatestBlock({ chain }?: ChainOptions): Promise<{
164
- number: number;
165
- timestamp: number;
166
- version: number;
167
- }>;
168
- /**
169
- * Binary search over block heights (REST only) for the last block whose timestamp is at or
170
- * before `timestamp` (unix seconds). Starts on the primary node; when the target predates the
171
- * primary's oldest block the search moves to the archival endpoint (the public aptos fullnode
172
- * keeps only a few weeks). Throws when `timestamp` predates all available history.
173
- */
174
- export declare function getBlockAtTimestamp({ chain, timestamp, minBlock }: ChainOptions & {
175
- timestamp: number;
176
- minBlock?: number;
177
- }): Promise<AptosBlock>;
178
- /**
179
- * Last ledger version at or before `timestamp` (unix seconds). Every transaction in a block
180
- * shares the block timestamp, so this is the `last_version` of the block found by `getBlockAtTimestamp`.
181
- */
182
- export declare function getVersionAtTimestamp({ chain, timestamp, minBlock }: ChainOptions & {
183
- timestamp: number;
184
- minBlock?: number;
185
- }): Promise<number>;
186
- /**
187
- * Raw balance of `account` for a coin type (`0x1::aptos_coin::AptosCoin`) or a fungible asset
188
- * metadata address. Coins: `CoinStore<T>` resource, falling back to the `0x1::coin::balance` view
189
- * (which also counts the paired FA store after a coin -> FA migration). FA: `0x1::primary_fungible_store::balance`.
190
- */
191
- export declare function getBalance({ chain, account, coinType, ledgerVersion }: ChainOptions & {
192
- account: string;
193
- coinType?: string;
194
- ledgerVersion?: number | string;
195
- }): Promise<string>;
196
- /**
197
- * Token metadata: `0x1::coin::CoinInfo<T>` for coin types, `0x1::fungible_asset::Metadata` for
198
- * fungible asset addresses. Throws when the token is unknown.
199
- */
200
- export declare function getCoinInfo({ chain, coinType, ledgerVersion }: ChainOptions & {
201
- coinType: string;
202
- ledgerVersion?: number | string;
203
- }): Promise<CoinInfo>;
204
- /**
205
- * Raw total supply of a coin type or fungible asset address. Resolution order (ported from the
206
- * server l2 adapter):
207
- * 1. `0x1::coin::supply<T>` view: sums the legacy CoinInfo supply and the paired FA supply, which
208
- * matters for coins that migrated to the FA standard (CoinInfo alone undercounts).
209
- * 2. `CoinInfo<T>.supply` integer value, or the aggregator table item it points at (native APT).
210
- * 3. The paired FA metadata (`0x1::coin::paired_metadata<T>`), then the FA branch.
211
- * 4. FA: `0x1::fungible_asset::supply` view -> `ConcurrentSupply` -> `Supply` resource.
212
- * Throws when nothing resolves (e.g. coins initialised with `monitor_supply = false`).
213
- */
214
- export declare function getCoinSupply({ chain, coinType, ledgerVersion }: ChainOptions & {
215
- coinType: string;
216
- ledgerVersion?: number | string;
217
- }): Promise<string>;
218
- /** Decode a hex string (with or without `0x`) as UTF-8. */
219
- export declare function hexToString(hex: string): string;
220
- /** Octas (1e-8 APT) to APT as a JS number. */
221
- export declare function octasToApt(octas: string | number | bigint): number;
222
- /** Fungible asset tokens are identified by an object address (no `::`), coins by `addr::module::Name`. */
223
- export declare function isFungibleAssetAddress(type: string): boolean;
224
- /** `0x1` -> `0x0000...0001` (64 hex chars, lowercase). Throws on non-hex input. */
225
- export declare function normalizeAddress(address: string): string;
226
- /**
227
- * Parse `0x1::coin::CoinInfo<0x1::aptos_coin::AptosCoin>` into address / module / name / generics.
228
- * Primitive and vector types (`u64`, `vector<u8>`) parse with an empty address and module.
229
- */
230
- export declare function parseTypeTag(type: string): TypeTag;