@defillama/sdk 5.0.240 → 5.0.244

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 (133) hide show
  1. package/build/Balances.d.ts +139 -0
  2. package/build/Balances.js +363 -0
  3. package/build/ChainApi.d.ts +142 -0
  4. package/build/ChainApi.js +310 -0
  5. package/build/abi/abi2.d.ts +5 -0
  6. package/build/abi/abi2.js +215 -0
  7. package/build/abi/cachedABIs.d.ts +4 -0
  8. package/build/abi/cachedABIs.js +8 -0
  9. package/build/abi/convertResults.d.ts +5 -0
  10. package/build/abi/convertResults.js +60 -0
  11. package/build/abi/index.d.ts +31 -0
  12. package/build/abi/index.js +327 -0
  13. package/build/abi/multicall.d.ts +23 -0
  14. package/build/abi/multicall.js +383 -0
  15. package/build/abi/multicall3.d.ts +7 -0
  16. package/build/abi/multicall3.js +405 -0
  17. package/build/abi/rpcCall.d.ts +4 -0
  18. package/build/abi/rpcCall.js +62 -0
  19. package/build/abi/tron.d.ts +33 -0
  20. package/build/abi/tron.js +118 -0
  21. package/build/api.d.ts +10 -0
  22. package/build/api.js +45 -0
  23. package/build/api2.d.ts +5 -0
  24. package/build/api2.js +41 -0
  25. package/build/chains/algorand.d.ts +277 -0
  26. package/build/chains/algorand.js +618 -0
  27. package/build/chains/aptos.d.ts +269 -0
  28. package/build/chains/aptos.js +700 -0
  29. package/build/chains/cardano.d.ts +242 -0
  30. package/build/chains/cardano.js +407 -0
  31. package/build/chains/cosmos.d.ts +252 -0
  32. package/build/chains/cosmos.js +623 -0
  33. package/build/chains/icp.d.ts +235 -0
  34. package/build/chains/icp.js +1040 -0
  35. package/build/chains/index.d.ts +23 -0
  36. package/build/chains/index.js +59 -0
  37. package/build/chains/near.d.ts +192 -0
  38. package/build/chains/near.js +446 -0
  39. package/build/chains/rpc.d.ts +125 -0
  40. package/build/chains/rpc.js +332 -0
  41. package/build/chains/starknet.d.ts +205 -0
  42. package/build/chains/starknet.js +886 -0
  43. package/build/chains/stellar.d.ts +410 -0
  44. package/build/chains/stellar.js +1082 -0
  45. package/build/chains/substrate.d.ts +333 -0
  46. package/build/chains/substrate.js +1042 -0
  47. package/build/chains/sui.d.ts +392 -0
  48. package/build/chains/sui.js +1213 -0
  49. package/build/chains/svm.d.ts +340 -0
  50. package/build/chains/svm.js +764 -0
  51. package/build/chains/tezos.d.ts +225 -0
  52. package/build/chains/tezos.js +412 -0
  53. package/build/chains/ton.d.ts +353 -0
  54. package/build/chains/ton.js +788 -0
  55. package/build/chains/tron.d.ts +45 -0
  56. package/build/chains/tron.js +110 -0
  57. package/build/chains/utxo.d.ts +210 -0
  58. package/build/chains/utxo.js +678 -0
  59. package/build/chains/xrpl.d.ts +179 -0
  60. package/build/chains/xrpl.js +467 -0
  61. package/build/computeTVL/blocks.d.ts +1 -0
  62. package/build/computeTVL/blocks.js +12 -0
  63. package/build/computeTVL/humanizeNumber.d.ts +1 -0
  64. package/build/computeTVL/humanizeNumber.js +19 -0
  65. package/build/erc20/index.d.ts +31 -0
  66. package/build/erc20/index.js +56 -0
  67. package/build/eth/index.d.ts +22 -0
  68. package/build/eth/index.js +118 -0
  69. package/build/general.d.ts +5 -0
  70. package/build/general.js +20 -0
  71. package/build/generalUtil.d.ts +8 -0
  72. package/build/generalUtil.js +73 -0
  73. package/build/index.d.ts +33 -0
  74. package/build/index.js +75 -0
  75. package/build/providers.json +1 -0
  76. package/build/types.d.ts +76 -0
  77. package/build/types.js +2 -0
  78. package/build/util/LlamaProvider.d.ts +46 -0
  79. package/build/util/LlamaProvider.js +343 -0
  80. package/build/util/blocks.d.ts +36 -0
  81. package/build/util/blocks.js +500 -0
  82. package/build/util/cache.d.ts +45 -0
  83. package/build/util/cache.js +309 -0
  84. package/build/util/callStats.d.ts +74 -0
  85. package/build/util/callStats.js +385 -0
  86. package/build/util/chainUtils/data.json +1459 -0
  87. package/build/util/chainUtils/index.d.ts +11 -0
  88. package/build/util/chainUtils/index.js +136 -0
  89. package/build/util/coins.d.ts +19 -0
  90. package/build/util/coins.js +124 -0
  91. package/build/util/common.d.ts +34 -0
  92. package/build/util/common.js +376 -0
  93. package/build/util/computeTVL.d.ts +19 -0
  94. package/build/util/computeTVL.js +102 -0
  95. package/build/util/cosmos.d.ts +1 -0
  96. package/build/util/cosmos.js +8 -0
  97. package/build/util/debugLog.d.ts +4 -0
  98. package/build/util/debugLog.js +18 -0
  99. package/build/util/discord.d.ts +1 -0
  100. package/build/util/discord.js +33 -0
  101. package/build/util/elastic.d.ts +43 -0
  102. package/build/util/elastic.js +113 -0
  103. package/build/util/env.d.ts +20 -0
  104. package/build/util/env.js +176 -0
  105. package/build/util/graph.d.ts +8 -0
  106. package/build/util/graph.js +50 -0
  107. package/build/util/index.d.ts +32 -0
  108. package/build/util/index.js +227 -0
  109. package/build/util/indexer.compatibility.d.ts +6 -0
  110. package/build/util/indexer.compatibility.js +64 -0
  111. package/build/util/indexer.d.ts +92 -0
  112. package/build/util/indexer.js +854 -0
  113. package/build/util/indexerSql.d.ts +9 -0
  114. package/build/util/indexerSql.js +102 -0
  115. package/build/util/internal-cache.d.ts +11 -0
  116. package/build/util/internal-cache.js +77 -0
  117. package/build/util/logs.d.ts +58 -0
  118. package/build/util/logs.decode.shared.d.ts +8 -0
  119. package/build/util/logs.decode.shared.js +289 -0
  120. package/build/util/logs.js +432 -0
  121. package/build/util/promisePool.d.ts +8 -0
  122. package/build/util/promisePool.js +31 -0
  123. package/build/util/r2.d.ts +4 -0
  124. package/build/util/r2.js +52 -0
  125. package/build/util/removeRedundantRPCs.d.ts +1 -0
  126. package/build/util/removeRedundantRPCs.js +49 -0
  127. package/build/util/transactions.d.ts +35 -0
  128. package/build/util/transactions.js +22 -0
  129. package/build/util/updateChainLabels.d.ts +1 -0
  130. package/build/util/updateChainLabels.js +5 -0
  131. package/build/util/updateProviderList.d.ts +1 -0
  132. package/build/util/updateProviderList.js +275 -0
  133. package/package.json +3 -2
@@ -0,0 +1,410 @@
1
+ export declare const DEFAULT_HORIZON = "https://horizon.stellar.org";
2
+ export declare const DEFAULT_SOROBAN_ENDPOINTS: string[];
3
+ export declare const PUBLIC_NETWORK_PASSPHRASE = "Public Global Stellar Network ; September 2015";
4
+ /** Classic assets and Stellar Asset Contracts always have 7 decimals. */
5
+ export declare const STELLAR_DECIMALS = 7;
6
+ export declare function getHorizonEndpoints(): string[];
7
+ export declare function getHorizonEndpoint(): string;
8
+ export declare function getSorobanEndpoints(): string[];
9
+ /** SCValType discriminants: https://github.com/stellar/stellar-xdr/blob/main/Stellar-contract.x */
10
+ export declare const SC_VAL: {
11
+ readonly BOOL: 0;
12
+ readonly VOID: 1;
13
+ readonly ERROR: 2;
14
+ readonly U32: 3;
15
+ readonly I32: 4;
16
+ readonly U64: 5;
17
+ readonly I64: 6;
18
+ readonly TIMEPOINT: 7;
19
+ readonly DURATION: 8;
20
+ readonly U128: 9;
21
+ readonly I128: 10;
22
+ readonly U256: 11;
23
+ readonly I256: 12;
24
+ readonly BYTES: 13;
25
+ readonly STRING: 14;
26
+ readonly SYMBOL: 15;
27
+ readonly VEC: 16;
28
+ readonly MAP: 17;
29
+ readonly ADDRESS: 18;
30
+ readonly CONTRACT_INSTANCE: 19;
31
+ readonly LEDGER_KEY_CONTRACT_INSTANCE: 20;
32
+ readonly LEDGER_KEY_NONCE: 21;
33
+ };
34
+ /** SCAddressType discriminants (inside ScVal::Address / InvokeContractArgs). */
35
+ export declare const SC_ADDR: {
36
+ readonly ACCOUNT: 0;
37
+ readonly CONTRACT: 1;
38
+ readonly MUXED_ACCOUNT: 2;
39
+ readonly CLAIMABLE_BALANCE: 3;
40
+ readonly LIQUIDITY_POOL: 4;
41
+ };
42
+ /** StrKey version bytes (SEP-23): the first base32 char of the encoded key. */
43
+ export declare const STRKEY_VERSION: {
44
+ readonly ACCOUNT: number;
45
+ readonly MUXED_ACCOUNT: number;
46
+ readonly SEED: number;
47
+ readonly PRE_AUTH_TX: number;
48
+ readonly SHA256_HASH: number;
49
+ readonly SIGNED_PAYLOAD: number;
50
+ readonly CONTRACT: number;
51
+ readonly CLAIMABLE_BALANCE: number;
52
+ readonly LIQUIDITY_POOL: number;
53
+ };
54
+ export declare function base32Encode(data: Uint8Array, { padding }?: {
55
+ padding?: boolean;
56
+ }): string;
57
+ export declare function base32Decode(str: string): Buffer;
58
+ export declare function crc16xmodem(data: Uint8Array): number;
59
+ export declare function encodeStrKey(version: number, payload: Uint8Array): string;
60
+ /** Decode a StrKey; validates the checksum and that the encoding is canonical. */
61
+ export declare function decodeStrKey(str: string): {
62
+ version: number;
63
+ payload: Buffer;
64
+ };
65
+ /** Payload bytes of a StrKey, optionally asserting the version byte. */
66
+ export declare function strKeyToBytes(str: string, expectedVersion?: number): Buffer;
67
+ export declare function isValidStrKey(str: string, version?: number): boolean;
68
+ /** Soroban contract id (`C...`, 56 chars). Format check only; use `isValidStrKey` for checksum validation. */
69
+ export declare function isContractId(str: any): boolean;
70
+ /** Classic account id (`G...`, 56 chars). Format check only. */
71
+ export declare function isAccountId(str: any): boolean;
72
+ export interface ClassicAsset {
73
+ /** asset code, `XLM` for the native asset */
74
+ code: string;
75
+ /** issuer account, undefined for the native asset */
76
+ issuer?: string;
77
+ }
78
+ export declare const NATIVE_ASSET: ClassicAsset;
79
+ export declare function isNativeAsset(asset: ClassicAsset): boolean;
80
+ /**
81
+ * Parse `native` / `XLM`, `CODE-ISSUER` (DefiLlama convention), `CODE:ISSUER`
82
+ * (Horizon / stellar.expert convention) or an already parsed `{ code, issuer }`.
83
+ */
84
+ export declare function parseAsset(asset: string | ClassicAsset): ClassicAsset;
85
+ /** `native` or `CODE-ISSUER` (or `CODE:ISSUER` with `separator: ':'`). */
86
+ export declare function assetToString(asset: string | ClassicAsset, { separator }?: {
87
+ separator?: '-' | ':';
88
+ }): string;
89
+ /** Horizon 7-decimal display string -> stroops as a decimal string, using string math (no float rounding). */
90
+ export declare function toRaw(amount: string | number, decimals?: number): string;
91
+ /** Stroops -> display string (`"12.3456789"`), trailing zeros trimmed. */
92
+ export declare function fromRaw(raw: string | number | bigint, decimals?: number): string;
93
+ export declare class XdrWriter {
94
+ private chunks;
95
+ u32(value: number): this;
96
+ i32(value: number): this;
97
+ /** unsigned 64-bit, value must already be in range */
98
+ u64(value: bigint | number | string): this;
99
+ i64(value: bigint | number | string): this;
100
+ /** fixed length opaque, no length prefix, padded to 4 bytes */
101
+ bytes(data: Uint8Array): this;
102
+ /** variable length opaque: u32 length + data + padding */
103
+ opaque(data: Uint8Array): this;
104
+ string(value: string): this;
105
+ toBuffer(): Buffer;
106
+ toBase64(): string;
107
+ }
108
+ export declare class XdrReader {
109
+ offset: number;
110
+ readonly buf: Buffer;
111
+ constructor(input: Buffer | Uint8Array | string, offset?: number);
112
+ private need;
113
+ u32(): number;
114
+ i32(): number;
115
+ u64(): bigint;
116
+ i64(): bigint;
117
+ /** `words` big-endian u64 limbs -> unsigned bigint */
118
+ uintN(words: number): bigint;
119
+ intN(words: number): bigint;
120
+ bytes(n: number): Buffer;
121
+ opaque(): Buffer;
122
+ string(): string;
123
+ get remaining(): number;
124
+ }
125
+ export type ScValue = boolean | null | number | bigint | string | ScValue[] | {
126
+ [key: string]: ScValue;
127
+ } | ScContractInstance | ScError;
128
+ export interface ScError {
129
+ error: number;
130
+ code: number;
131
+ }
132
+ export interface ScContractInstance {
133
+ executable: {
134
+ type: 'wasm';
135
+ hash: string;
136
+ } | {
137
+ type: 'stellar_asset';
138
+ };
139
+ storage: {
140
+ [key: string]: ScValue;
141
+ };
142
+ }
143
+ /** Read one ScVal from the reader's current position. */
144
+ export declare function readScVal(r: XdrReader): ScValue;
145
+ /**
146
+ * Decode an ScVal from raw XDR bytes or a base64 string.
147
+ * u64/i64/u128/i128/u256/i256 -> bigint, bytes -> `0x` hex, addresses -> StrKey,
148
+ * vec -> array, map -> object keyed by the (stringified) key, void -> null.
149
+ */
150
+ export declare function parseScVal(input: Buffer | Uint8Array | string, offset?: number): ScValue;
151
+ export type ScArgType = 'bool' | 'void' | 'u32' | 'i32' | 'u64' | 'i64' | 'timepoint' | 'duration' | 'u128' | 'i128' | 'u256' | 'i256' | 'bytes' | 'string' | 'symbol' | 'address' | 'account' | 'vec' | 'map';
152
+ /** Explicitly typed contract argument, e.g. `{ type: 'i128', value: '1000' }`. */
153
+ export interface ScArg {
154
+ type: ScArgType;
155
+ value?: any;
156
+ }
157
+ /**
158
+ * Anything `callSoroban` accepts as an argument. Untyped values are mapped as:
159
+ * `G...` string -> address (account), `C...` string -> address (contract), number -> u32,
160
+ * bigint -> i128, boolean -> bool, null/undefined -> void, array -> vec of the same rules.
161
+ * Other strings must be tagged (`{ type: 'symbol' | 'string' | 'bytes', value }`).
162
+ */
163
+ export type ScArgInput = ScArg | string | number | bigint | boolean | null | undefined | ScArgInput[];
164
+ export declare function normalizeScArg(arg: ScArgInput): ScArg;
165
+ /** ScVal::Symbol */
166
+ export declare function writeSymbol(w: XdrWriter, name: string): XdrWriter;
167
+ /** Tagged integer ScVal (u32/i32/u64/i64/u128/i128/u256/i256, timepoint/duration) with range check. */
168
+ export declare function writeInt(w: XdrWriter, tag: number, value: bigint | number | string, bits: number, signed: boolean): XdrWriter;
169
+ /** SCAddress (no ScVal tag) for a `G...` / `C...` StrKey. */
170
+ export declare function writeScAddress(w: XdrWriter, address: string): XdrWriter;
171
+ /** ScVal::Address */
172
+ export declare function writeAddress(w: XdrWriter, address: string): XdrWriter;
173
+ /** Append one ScVal for a (typed or untyped) argument. */
174
+ export declare function writeScVal(w: XdrWriter, arg: ScArgInput): XdrWriter;
175
+ /** Encode a single ScVal to bytes. */
176
+ export declare function encodeScVal(arg: ScArgInput): Buffer;
177
+ /** Classic `Asset` XDR (native / alphanum4 / alphanum12). */
178
+ export declare function writeAsset(w: XdrWriter, asset: string | ClassicAsset): XdrWriter;
179
+ export declare function getNetworkId(passphrase?: string): Buffer;
180
+ /**
181
+ * Stellar Asset Contract id of a classic asset (or `native`):
182
+ * sha256(HashIDPreimage::ENVELOPE_TYPE_CONTRACT_ID { networkId, ContractIDPreimage::FROM_ASSET(asset) }).
183
+ */
184
+ export declare function getSacContractId({ asset, networkPassphrase }: {
185
+ asset: string | ClassicAsset;
186
+ networkPassphrase?: string;
187
+ }): string;
188
+ /**
189
+ * Unsigned TransactionV1Envelope with a single InvokeHostFunction(InvokeContract)
190
+ * operation, as accepted by `simulateTransaction`. `source` defaults to the zero key.
191
+ */
192
+ export declare function buildInvokeContractEnvelope({ contractId, method, args, source, fee }: {
193
+ contractId: string;
194
+ method: string;
195
+ args?: ScArgInput[];
196
+ source?: string;
197
+ fee?: number;
198
+ }): Buffer;
199
+ /** LedgerKey::ContractData { contract, key: LedgerKeyContractInstance, durability: PERSISTENT } */
200
+ export declare function buildContractInstanceLedgerKey({ contractId }: {
201
+ contractId: string;
202
+ }): Buffer;
203
+ export interface HorizonBalanceRecord {
204
+ balance: string;
205
+ asset_type: 'native' | 'credit_alphanum4' | 'credit_alphanum12' | 'liquidity_pool_shares' | string;
206
+ asset_code?: string;
207
+ asset_issuer?: string;
208
+ liquidity_pool_id?: string;
209
+ limit?: string;
210
+ buying_liabilities?: string;
211
+ selling_liabilities?: string;
212
+ is_authorized?: boolean;
213
+ is_authorized_to_maintain_liabilities?: boolean;
214
+ is_clawback_enabled?: boolean;
215
+ last_modified_ledger?: number;
216
+ }
217
+ export interface AccountBalance {
218
+ /** `native`, `CODE-ISSUER` or `pool:<liquidity_pool_id>` */
219
+ asset: string;
220
+ assetType: string;
221
+ code?: string;
222
+ issuer?: string;
223
+ liquidityPoolId?: string;
224
+ /** Horizon display string (7 decimals) */
225
+ balance: string;
226
+ /** stroops (balance x 1e7) as decimal string */
227
+ raw: string;
228
+ limit?: string;
229
+ isAuthorized?: boolean;
230
+ }
231
+ export interface AssetSupply {
232
+ asset: string;
233
+ /** authorized + contracts + liquidity pools + claimable balances, stroops */
234
+ supply: string;
235
+ decimals: number;
236
+ authorized: string;
237
+ authorizedToMaintainLiabilities: string;
238
+ unauthorized: string;
239
+ contracts: string;
240
+ liquidityPools: string;
241
+ claimableBalances: string;
242
+ /** Horizon's own (deprecated) `amount` field, stroops; not part of `supply` */
243
+ amount: string;
244
+ numAccounts?: number;
245
+ numContracts?: number;
246
+ numClaimableBalances?: number;
247
+ numLiquidityPools?: number;
248
+ }
249
+ export interface LedgerInfo {
250
+ number: number;
251
+ /** unix seconds of `closed_at` */
252
+ timestamp: number;
253
+ closedAt: string;
254
+ hash: string;
255
+ protocolVersion?: number;
256
+ /** stroops */
257
+ totalCoins?: string;
258
+ successfulTransactionCount?: number;
259
+ failedTransactionCount?: number;
260
+ operationCount?: number;
261
+ }
262
+ /** GET `path` on Horizon with query `params`; rotates configured endpoints and retries transient failures. */
263
+ export declare function horizonGet({ path, params }: {
264
+ path: string;
265
+ params?: Record<string, any>;
266
+ }): Promise<any>;
267
+ /** Raw Horizon account record (`/accounts/{id}`). Throws on unknown account. */
268
+ export declare function getAccount({ address }: {
269
+ address: string;
270
+ }): Promise<any>;
271
+ /**
272
+ * All balances (native, trustlines, pool shares) of a classic account.
273
+ * A non-existent (never funded) account resolves to `[]`.
274
+ */
275
+ export declare function getAccountBalances({ address }: {
276
+ address: string;
277
+ }): Promise<AccountBalance[]>;
278
+ /** XLM balance of an account in stroops. */
279
+ export declare function getNativeBalance({ address }: {
280
+ address: string;
281
+ }): Promise<string>;
282
+ /**
283
+ * Balance of `asset` held by `address`, in stroops (7 decimals for classic assets and SACs,
284
+ * the token's own decimals for other Soroban tokens).
285
+ * - `asset` is a `C...` contract id -> Soroban `balance(address)`
286
+ * - `address` is a `C...` contract holding a classic asset -> `balance` on the asset's SAC
287
+ * - otherwise the Horizon trustline balance (`0` when there is no trustline / account)
288
+ */
289
+ export declare function getTokenBalance({ asset, address }: {
290
+ asset: string | ClassicAsset;
291
+ address: string;
292
+ }): Promise<string>;
293
+ /** Horizon `/assets` record for a classic asset, or `undefined` when Horizon does not know it. */
294
+ export declare function getAsset({ code, issuer, asset }: {
295
+ code?: string;
296
+ issuer?: string;
297
+ asset?: string | ClassicAsset;
298
+ }): Promise<any>;
299
+ /**
300
+ * Circulating supply of a classic asset in stroops: authorized trustline balances plus
301
+ * amounts held by Soroban contracts (SAC), liquidity pools and claimable balances.
302
+ * `native` returns the ledger's `total_coins`.
303
+ */
304
+ export declare function getAssetSupply({ asset, code, issuer }: {
305
+ asset?: string | ClassicAsset;
306
+ code?: string;
307
+ issuer?: string;
308
+ }): Promise<AssetSupply>;
309
+ /** Horizon ledger by sequence number, or the latest closed ledger. */
310
+ export declare function getLedger({ sequence }?: {
311
+ sequence?: number | 'latest';
312
+ }): Promise<LedgerInfo>;
313
+ export declare function getLatestLedger(): Promise<LedgerInfo>;
314
+ /**
315
+ * Last ledger closed at or before `timestamp` (unix seconds, ms accepted). Horizon has no
316
+ * time filter, so this is an interpolation search over `/ledgers/{seq}` (typically 4-8 requests).
317
+ */
318
+ export declare function getLedgerAtTimestamp({ timestamp }: {
319
+ timestamp: number;
320
+ }): Promise<LedgerInfo>;
321
+ /** Raw Soroban JSON-RPC call; rotates configured endpoints and retries transport / rate-limit errors. */
322
+ export declare function sorobanRpc(method: string, params?: any): Promise<any>;
323
+ export declare function getLatestSorobanLedger(): Promise<{
324
+ number: number;
325
+ hash: string;
326
+ protocolVersion: number;
327
+ }>;
328
+ /**
329
+ * `simulateTransaction` on a base64 (or raw) TransactionEnvelope. Returns the RPC result;
330
+ * throws when the simulation itself failed (`result.error`).
331
+ */
332
+ export declare function simulateTransaction({ transaction, resourceConfig }: {
333
+ transaction: string | Buffer;
334
+ resourceConfig?: {
335
+ instructionLeeway?: number;
336
+ };
337
+ }): Promise<any>;
338
+ /**
339
+ * Read-only contract call via `simulateTransaction`. Returns the decoded ScVal result
340
+ * (see `parseScVal` for the mapping). See `ScArgInput` for how untyped args are encoded.
341
+ */
342
+ export declare function callSoroban({ contractId, method, args, source }: {
343
+ contractId: string;
344
+ method: string;
345
+ args?: ScArgInput[];
346
+ source?: string;
347
+ }): Promise<ScValue>;
348
+ export interface LedgerEntryResult {
349
+ key: string;
350
+ xdr: string;
351
+ lastModifiedLedgerSeq: number;
352
+ liveUntilLedgerSeq?: number;
353
+ }
354
+ /** `getLedgerEntries` for base64 (or raw) LedgerKey XDRs. Missing entries are simply absent from `entries`. */
355
+ export declare function getLedgerEntries({ keys }: {
356
+ keys: (string | Buffer)[];
357
+ }): Promise<{
358
+ entries: LedgerEntryResult[];
359
+ latestLedger: number;
360
+ }>;
361
+ /** Decoded SCContractInstance (executable + instance storage) of a contract. */
362
+ export declare function getContractInstance({ contractId }: {
363
+ contractId: string;
364
+ }): Promise<ScContractInstance>;
365
+ /**
366
+ * Instance storage of a contract keyed by storage key (enum keys collapse to the variant
367
+ * name). Reads data not reachable through contract functions.
368
+ */
369
+ export declare function getContractInstanceStorage({ contractId }: {
370
+ contractId: string;
371
+ }): Promise<{
372
+ [key: string]: ScValue;
373
+ }>;
374
+ /** `balance(address)` as a decimal string in the token's smallest unit. */
375
+ export declare function getSorobanTokenBalance({ contractId, address }: {
376
+ contractId: string;
377
+ address: string;
378
+ }): Promise<string>;
379
+ export declare function getSorobanTokenDecimals({ contractId }: {
380
+ contractId: string;
381
+ }): Promise<number>;
382
+ export declare function getSorobanTokenSymbol({ contractId }: {
383
+ contractId: string;
384
+ }): Promise<string>;
385
+ /** `name()`; a SAC returns `CODE:ISSUER` (or `native`), which is how `getSacClassicAsset` resolves it. */
386
+ export declare function getSorobanTokenName({ contractId }: {
387
+ contractId: string;
388
+ }): Promise<string>;
389
+ /**
390
+ * `total_supply()` of a Soroban token as a decimal string, or `undefined` when the contract
391
+ * does not implement it (SACs do not; use `getAssetSupply` on the classic asset instead).
392
+ */
393
+ export declare function getSorobanTokenTotalSupply({ contractId }: {
394
+ contractId: string;
395
+ }): Promise<string | undefined>;
396
+ /** Classic asset wrapped by a Stellar Asset Contract, or `undefined` for a non-SAC token. */
397
+ export declare function getSacClassicAsset({ contractId }: {
398
+ contractId: string;
399
+ }): Promise<ClassicAsset | undefined>;
400
+ /**
401
+ * Total supply of any Stellar token id used by DefiLlama: `native`, `CODE-ISSUER`, or a
402
+ * `C...` contract (SAC -> Horizon supply of the wrapped asset, other tokens -> `total_supply()`).
403
+ * Resolves to `undefined` when a Soroban token exposes no `total_supply`.
404
+ */
405
+ export declare function getTokenSupply({ token }: {
406
+ token: string | ClassicAsset;
407
+ }): Promise<{
408
+ supply: string;
409
+ decimals: number;
410
+ } | undefined>;