@satianurag/hiero-mirror-client 0.1.0
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/LICENSE +21 -0
- package/README.md +172 -0
- package/dist/index.cjs +2231 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1425 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +1425 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.d.ts +1425 -0
- package/dist/index.mjs +2218 -0
- package/dist/index.mjs.map +1 -0
- package/dist/utils.cjs +188 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +105 -0
- package/dist/utils.d.cts.map +1 -0
- package/dist/utils.d.mts +105 -0
- package/dist/utils.d.mts.map +1 -0
- package/dist/utils.d.ts +105 -0
- package/dist/utils.mjs +178 -0
- package/dist/utils.mjs.map +1 -0
- package/package.json +73 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1425 @@
|
|
|
1
|
+
//#region src/http/retry.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Exponential backoff with jitter for retrying failed requests.
|
|
4
|
+
*
|
|
5
|
+
* Retry rules:
|
|
6
|
+
* - Always retry: 5xx, network errors, 429
|
|
7
|
+
* - Never retry: 400, 401, 403, 404 (client errors are not transient)
|
|
8
|
+
* - 429: Always retry, use `Retry-After` header if present
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
interface RetryOptions {
|
|
13
|
+
/** Maximum number of retries. Default: 2. */
|
|
14
|
+
maxRetries: number;
|
|
15
|
+
/** Base delay in milliseconds. Default: 500ms. */
|
|
16
|
+
baseDelay: number;
|
|
17
|
+
/** Maximum delay cap in milliseconds. Default: 10000ms. */
|
|
18
|
+
maxDelay: number;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/http/url-builder.d.ts
|
|
22
|
+
/**
|
|
23
|
+
* Operator types supported by the Mirror Node API query parameters.
|
|
24
|
+
* Used with `.append()` for multi-value/range queries: `timestamp=gt:1234`.
|
|
25
|
+
*/
|
|
26
|
+
type QueryOperator = 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte';
|
|
27
|
+
/**
|
|
28
|
+
* A query parameter value with an optional operator prefix.
|
|
29
|
+
*/
|
|
30
|
+
interface OperatorValue {
|
|
31
|
+
operator: QueryOperator;
|
|
32
|
+
value: string | number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Raw query parameter types accepted by the URL builder.
|
|
36
|
+
*/
|
|
37
|
+
type QueryParamValue = string | number | boolean | OperatorValue | OperatorValue[] | undefined | null;
|
|
38
|
+
interface QueryParams {
|
|
39
|
+
[key: string]: QueryParamValue;
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/http/client.d.ts
|
|
43
|
+
interface HttpClientOptions {
|
|
44
|
+
/** Base URL for the mirror node. */
|
|
45
|
+
baseUrl: string;
|
|
46
|
+
/** Request timeout in milliseconds. Default: 30000. */
|
|
47
|
+
timeout?: number;
|
|
48
|
+
/** Retry options. */
|
|
49
|
+
retry?: Partial<RetryOptions>;
|
|
50
|
+
/** Rate limit in requests per second. Default: 50. */
|
|
51
|
+
rateLimitRps?: number;
|
|
52
|
+
/** Optional logger for debug output. */
|
|
53
|
+
logger?: Logger$1;
|
|
54
|
+
/** Custom fetch implementation (for testing). */
|
|
55
|
+
fetch?: typeof globalThis.fetch;
|
|
56
|
+
}
|
|
57
|
+
interface Logger$1 {
|
|
58
|
+
debug?: (message: string, ...args: unknown[]) => void;
|
|
59
|
+
info?: (message: string, ...args: unknown[]) => void;
|
|
60
|
+
warn?: (message: string, ...args: unknown[]) => void;
|
|
61
|
+
error?: (message: string, ...args: unknown[]) => void;
|
|
62
|
+
}
|
|
63
|
+
interface RequestOptions {
|
|
64
|
+
/** Additional headers to send. */
|
|
65
|
+
headers?: Record<string, string>;
|
|
66
|
+
/** Override the default timeout for this request. */
|
|
67
|
+
timeout?: number;
|
|
68
|
+
/** Abort signal for request cancellation. */
|
|
69
|
+
signal?: AbortSignal;
|
|
70
|
+
}
|
|
71
|
+
interface HttpResponse<T = unknown> {
|
|
72
|
+
/** Parsed response body. */
|
|
73
|
+
data: T;
|
|
74
|
+
/** HTTP status code. */
|
|
75
|
+
status: number;
|
|
76
|
+
/** Response headers. */
|
|
77
|
+
headers: Headers;
|
|
78
|
+
}
|
|
79
|
+
declare class HttpClient {
|
|
80
|
+
private readonly baseUrl;
|
|
81
|
+
private readonly timeout;
|
|
82
|
+
private readonly retryOptions;
|
|
83
|
+
private readonly rateLimiter;
|
|
84
|
+
private readonly inflight;
|
|
85
|
+
private readonly etagCache;
|
|
86
|
+
private readonly logger;
|
|
87
|
+
private readonly fetchFn;
|
|
88
|
+
constructor(options: HttpClientOptions);
|
|
89
|
+
/**
|
|
90
|
+
* Performs a GET request with in-flight deduplication.
|
|
91
|
+
*
|
|
92
|
+
* @param path - API path (e.g., `/api/v1/accounts`)
|
|
93
|
+
* @param params - Optional query parameters
|
|
94
|
+
* @param options - Optional request options
|
|
95
|
+
* @returns Parsed response
|
|
96
|
+
*/
|
|
97
|
+
get<T = unknown>(path: string, params?: QueryParams, options?: RequestOptions): Promise<HttpResponse<T>>;
|
|
98
|
+
/**
|
|
99
|
+
* Performs a POST request.
|
|
100
|
+
*
|
|
101
|
+
* POST requests are NOT deduplicated (they have side effects).
|
|
102
|
+
*
|
|
103
|
+
* @param path - API path
|
|
104
|
+
* @param body - Request body (will be JSON-serialized)
|
|
105
|
+
* @param options - Optional request options
|
|
106
|
+
* @returns Parsed response
|
|
107
|
+
*/
|
|
108
|
+
post<T = unknown>(path: string, body: unknown, options?: RequestOptions): Promise<HttpResponse<T>>;
|
|
109
|
+
/**
|
|
110
|
+
* Core request method with retry, rate limiting, timeout, and error handling.
|
|
111
|
+
*/
|
|
112
|
+
private request;
|
|
113
|
+
/**
|
|
114
|
+
* Handles the HTTP response: checks content type, parses JSON safely,
|
|
115
|
+
* and throws appropriate errors for non-2xx responses.
|
|
116
|
+
*/
|
|
117
|
+
private handleResponse;
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/types/common.d.ts
|
|
121
|
+
/**
|
|
122
|
+
* Shared types used across all Hiero Mirror Client SDK resources.
|
|
123
|
+
*
|
|
124
|
+
* @packageDocumentation
|
|
125
|
+
*/
|
|
126
|
+
/**
|
|
127
|
+
* Pagination link container returned by list endpoints.
|
|
128
|
+
*/
|
|
129
|
+
interface PaginationLinks {
|
|
130
|
+
next: string | null;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* A page of results from a list endpoint.
|
|
134
|
+
*/
|
|
135
|
+
interface Page<T> {
|
|
136
|
+
data: T[];
|
|
137
|
+
links: PaginationLinks;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Sort order for list endpoints.
|
|
141
|
+
*
|
|
142
|
+
* The API accepts case-insensitive values but only `asc` and `desc`
|
|
143
|
+
* are valid enums.
|
|
144
|
+
*/
|
|
145
|
+
type Order = 'asc' | 'desc';
|
|
146
|
+
/**
|
|
147
|
+
* A `0x`-prefixed hexadecimal string.
|
|
148
|
+
*
|
|
149
|
+
* This is a branded type alias — it is still a plain `string` at runtime
|
|
150
|
+
* but provides additional type safety at the TypeScript level.
|
|
151
|
+
*/
|
|
152
|
+
type Hex = string & {
|
|
153
|
+
readonly __brand: 'Hex';
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* A range timestamp used by blocks and network stake endpoints.
|
|
157
|
+
*
|
|
158
|
+
* `to` can be `null` for open-ended ranges (e.g., currently active nodes).
|
|
159
|
+
*
|
|
160
|
+
* EC28: `{ from: string; to: string | null }`
|
|
161
|
+
*/
|
|
162
|
+
interface TimestampRange {
|
|
163
|
+
from: string;
|
|
164
|
+
to: string | null;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Discriminated union for Hedera public key types.
|
|
168
|
+
*
|
|
169
|
+
* EC27: Three variants based on `_type`:
|
|
170
|
+
* - `ED25519` — 32-byte Ed25519 public key (64 hex chars)
|
|
171
|
+
* - `ECDSA_SECP256K1` — 33-byte compressed ECDSA key (66 hex chars)
|
|
172
|
+
* - `ProtobufEncoded` — opaque protobuf-serialized key structure
|
|
173
|
+
*/
|
|
174
|
+
type HieroKey = {
|
|
175
|
+
_type: 'ED25519';
|
|
176
|
+
key: string;
|
|
177
|
+
} | {
|
|
178
|
+
_type: 'ECDSA_SECP256K1';
|
|
179
|
+
key: string;
|
|
180
|
+
} | {
|
|
181
|
+
_type: 'ProtobufEncoded';
|
|
182
|
+
key: string;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* A single token balance entry.
|
|
186
|
+
*/
|
|
187
|
+
interface TokenBalance {
|
|
188
|
+
token_id: string;
|
|
189
|
+
balance: string;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Freeze status for token-account relationships (EC35).
|
|
193
|
+
*/
|
|
194
|
+
type FreezeStatus = 'FROZEN' | 'UNFROZEN' | 'NOT_APPLICABLE';
|
|
195
|
+
/**
|
|
196
|
+
* KYC status for token-account relationships (EC35).
|
|
197
|
+
*/
|
|
198
|
+
type KycStatus = 'GRANTED' | 'REVOKED' | 'NOT_APPLICABLE';
|
|
199
|
+
/**
|
|
200
|
+
* Filter for transaction result status.
|
|
201
|
+
*/
|
|
202
|
+
type TransactionResult = 'success' | 'fail';
|
|
203
|
+
/**
|
|
204
|
+
* Token types supported by the Hedera network.
|
|
205
|
+
*/
|
|
206
|
+
type TokenType = 'FUNGIBLE_COMMON' | 'NON_FUNGIBLE_UNIQUE';
|
|
207
|
+
/**
|
|
208
|
+
* An operator-based query filter.
|
|
209
|
+
*
|
|
210
|
+
* Allows expressing range/equality queries in the Stripe-style object pattern:
|
|
211
|
+
* ```typescript
|
|
212
|
+
* { timestamp: { gt: '1234', lte: '5678' } }
|
|
213
|
+
* ```
|
|
214
|
+
*
|
|
215
|
+
* EC83/EC123: Supports all 6 operators: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`.
|
|
216
|
+
*/
|
|
217
|
+
interface OperatorFilter<T = string> {
|
|
218
|
+
eq?: T;
|
|
219
|
+
ne?: T;
|
|
220
|
+
gt?: T;
|
|
221
|
+
gte?: T;
|
|
222
|
+
lt?: T;
|
|
223
|
+
lte?: T;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* A query parameter value that can be either a direct value or an operator filter.
|
|
227
|
+
*/
|
|
228
|
+
type OperatorQuery<T = string> = T | OperatorFilter<T>;
|
|
229
|
+
/**
|
|
230
|
+
* Optional logger interface.
|
|
231
|
+
*
|
|
232
|
+
* Compatible with `console`, `pino`, `winston`, or any object
|
|
233
|
+
* with `debug/info/warn/error` methods.
|
|
234
|
+
*/
|
|
235
|
+
interface Logger {
|
|
236
|
+
debug?: (message: string, ...args: unknown[]) => void;
|
|
237
|
+
info?: (message: string, ...args: unknown[]) => void;
|
|
238
|
+
warn?: (message: string, ...args: unknown[]) => void;
|
|
239
|
+
error?: (message: string, ...args: unknown[]) => void;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* An HBAR transfer within a transaction.
|
|
243
|
+
*/
|
|
244
|
+
interface Transfer {
|
|
245
|
+
account: string;
|
|
246
|
+
amount: string;
|
|
247
|
+
is_approval: boolean;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* A token transfer within a transaction.
|
|
251
|
+
*/
|
|
252
|
+
interface TokenTransfer {
|
|
253
|
+
account: string;
|
|
254
|
+
amount: string;
|
|
255
|
+
is_approval: boolean;
|
|
256
|
+
token_id: string;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* An NFT transfer within a transaction.
|
|
260
|
+
*/
|
|
261
|
+
interface NftTransfer {
|
|
262
|
+
is_approval: boolean;
|
|
263
|
+
receiver_account_id: string | null;
|
|
264
|
+
sender_account_id: string | null;
|
|
265
|
+
serial_number: string;
|
|
266
|
+
token_id: string;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* A staking reward transfer.
|
|
270
|
+
*
|
|
271
|
+
* EC135: Always an array (never null or missing).
|
|
272
|
+
*/
|
|
273
|
+
interface StakingRewardTransfer {
|
|
274
|
+
account: string;
|
|
275
|
+
amount: string;
|
|
276
|
+
}
|
|
277
|
+
//#endregion
|
|
278
|
+
//#region src/pagination/paginator.d.ts
|
|
279
|
+
/**
|
|
280
|
+
* A function that extracts `/api/v1/...` items from a raw API response
|
|
281
|
+
* and returns a {@link Page} of mapped items.
|
|
282
|
+
*/
|
|
283
|
+
type PageExtractor<T> = (raw: unknown) => Page<T>;
|
|
284
|
+
/**
|
|
285
|
+
* Configuration for creating a Paginator.
|
|
286
|
+
*/
|
|
287
|
+
interface PaginatorOptions<T> {
|
|
288
|
+
/** The HTTP client instance. */
|
|
289
|
+
client: HttpClient;
|
|
290
|
+
/** The initial API path (e.g., `/api/v1/accounts`). */
|
|
291
|
+
path: string;
|
|
292
|
+
/** Query parameters for the first request. */
|
|
293
|
+
params?: Record<string, unknown>;
|
|
294
|
+
/** Mapper function: raw JSON → Page<T>. */
|
|
295
|
+
extract: PageExtractor<T>;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Lazy paginator that fetches pages on demand.
|
|
299
|
+
*
|
|
300
|
+
* Implements `PromiseLike<Page<T>>` so `await` returns the first page.
|
|
301
|
+
* Implements `AsyncIterable<T>` so `for await...of` yields items.
|
|
302
|
+
*
|
|
303
|
+
* EC19: Uses `links.next` as an opaque cursor (never constructs cursors).
|
|
304
|
+
* EC47: Terminates when `links.next` is null.
|
|
305
|
+
* EC8: Resolves relative `links.next` URLs against the base URL.
|
|
306
|
+
*/
|
|
307
|
+
declare class Paginator<T> implements PromiseLike<Page<T>>, AsyncIterable<T> {
|
|
308
|
+
private readonly client;
|
|
309
|
+
private readonly initialPath;
|
|
310
|
+
private readonly params?;
|
|
311
|
+
private readonly extract;
|
|
312
|
+
constructor(options: PaginatorOptions<T>);
|
|
313
|
+
then<TResult1 = Page<T>, TResult2 = never>(onfulfilled?: ((value: Page<T>) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
314
|
+
[Symbol.asyncIterator](): AsyncIterator<T>;
|
|
315
|
+
/**
|
|
316
|
+
* Returns an async iterable of page objects.
|
|
317
|
+
*
|
|
318
|
+
* Follows `links.next` until null (EC47).
|
|
319
|
+
*/
|
|
320
|
+
pages(): AsyncIterable<Page<T>>;
|
|
321
|
+
private fetchFirstPage;
|
|
322
|
+
}
|
|
323
|
+
//#endregion
|
|
324
|
+
//#region src/types/accounts.d.ts
|
|
325
|
+
interface AccountSummary {
|
|
326
|
+
account: string;
|
|
327
|
+
alias: string | null;
|
|
328
|
+
auto_renew_period: string | null;
|
|
329
|
+
balance: AccountBalance;
|
|
330
|
+
created_timestamp: string | null;
|
|
331
|
+
decline_reward: boolean;
|
|
332
|
+
deleted: boolean;
|
|
333
|
+
ethereum_nonce: string;
|
|
334
|
+
evm_address: string | null;
|
|
335
|
+
expiry_timestamp: string | null;
|
|
336
|
+
key: HieroKey | null;
|
|
337
|
+
max_automatic_token_associations: number;
|
|
338
|
+
memo: string;
|
|
339
|
+
pending_reward: string;
|
|
340
|
+
receiver_sig_required: boolean | null;
|
|
341
|
+
staked_account_id: string | null;
|
|
342
|
+
/** EC137: Plain number, not `0.0.X` format (EC32). */
|
|
343
|
+
staked_node_id: number | null;
|
|
344
|
+
stake_period_start: string | null;
|
|
345
|
+
}
|
|
346
|
+
interface AccountDetail extends AccountSummary {
|
|
347
|
+
/** Embedded recent transactions (sub-resource with own pagination). */
|
|
348
|
+
transactions: AccountTransaction[];
|
|
349
|
+
links: {
|
|
350
|
+
next: string | null;
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Nested balance object on account detail.
|
|
355
|
+
*
|
|
356
|
+
* EC40: This is NOT the same shape as `BalanceEntry` from `/balances`.
|
|
357
|
+
*/
|
|
358
|
+
interface AccountBalance {
|
|
359
|
+
balance: string;
|
|
360
|
+
timestamp: string;
|
|
361
|
+
tokens: TokenBalance[];
|
|
362
|
+
}
|
|
363
|
+
interface TokenRelationship {
|
|
364
|
+
automatic_association: boolean;
|
|
365
|
+
balance: string;
|
|
366
|
+
created_timestamp: string;
|
|
367
|
+
decimals: string;
|
|
368
|
+
freeze_status: FreezeStatus;
|
|
369
|
+
kyc_status: KycStatus;
|
|
370
|
+
token_id: string;
|
|
371
|
+
}
|
|
372
|
+
interface StakingReward {
|
|
373
|
+
account_id: string;
|
|
374
|
+
amount: string;
|
|
375
|
+
timestamp: string;
|
|
376
|
+
}
|
|
377
|
+
interface CryptoAllowance {
|
|
378
|
+
amount: string;
|
|
379
|
+
amount_granted: string;
|
|
380
|
+
owner: string;
|
|
381
|
+
spender: string;
|
|
382
|
+
timestamp: {
|
|
383
|
+
from: string;
|
|
384
|
+
to: string | null;
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
interface TokenAllowance {
|
|
388
|
+
amount: string;
|
|
389
|
+
amount_granted: string;
|
|
390
|
+
owner: string;
|
|
391
|
+
spender: string;
|
|
392
|
+
token_id: string;
|
|
393
|
+
timestamp: {
|
|
394
|
+
from: string;
|
|
395
|
+
to: string | null;
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
interface NftAllowance {
|
|
399
|
+
approved_for_all: boolean;
|
|
400
|
+
owner: string;
|
|
401
|
+
spender: string;
|
|
402
|
+
token_id: string;
|
|
403
|
+
timestamp: {
|
|
404
|
+
from: string;
|
|
405
|
+
to: string | null;
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
interface Airdrop {
|
|
409
|
+
amount: string;
|
|
410
|
+
receiver_id: string;
|
|
411
|
+
sender_id: string;
|
|
412
|
+
serial_number: string | null;
|
|
413
|
+
token_id: string;
|
|
414
|
+
timestamp: {
|
|
415
|
+
from: string;
|
|
416
|
+
to: string | null;
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
interface AccountTransaction {
|
|
420
|
+
bytes: string | null;
|
|
421
|
+
charged_tx_fee: string;
|
|
422
|
+
consensus_timestamp: string;
|
|
423
|
+
entity_id: string | null;
|
|
424
|
+
max_fee: string;
|
|
425
|
+
memo_base64: string;
|
|
426
|
+
name: string;
|
|
427
|
+
nft_transfers: NftTransfer[];
|
|
428
|
+
node: string | null;
|
|
429
|
+
nonce: number;
|
|
430
|
+
parent_consensus_timestamp: string | null;
|
|
431
|
+
result: string;
|
|
432
|
+
scheduled: boolean;
|
|
433
|
+
staking_reward_transfers: StakingRewardTransfer[];
|
|
434
|
+
token_transfers: TokenTransfer[];
|
|
435
|
+
transaction_hash: string;
|
|
436
|
+
transaction_id: string;
|
|
437
|
+
transfers: Transfer[];
|
|
438
|
+
valid_duration_seconds: string;
|
|
439
|
+
valid_start_timestamp: string;
|
|
440
|
+
}
|
|
441
|
+
interface AccountListParams {
|
|
442
|
+
'account.id'?: string | OperatorFilter<string>;
|
|
443
|
+
'account.publickey'?: string;
|
|
444
|
+
balance?: boolean;
|
|
445
|
+
limit?: number;
|
|
446
|
+
order?: Order;
|
|
447
|
+
}
|
|
448
|
+
interface AccountTokensParams {
|
|
449
|
+
'token.id'?: string | OperatorFilter<string>;
|
|
450
|
+
limit?: number;
|
|
451
|
+
order?: Order;
|
|
452
|
+
}
|
|
453
|
+
interface AccountNftsParams {
|
|
454
|
+
'token.id'?: string | OperatorFilter<string>;
|
|
455
|
+
serialnumber?: number;
|
|
456
|
+
'spender.id'?: string | OperatorFilter<string>;
|
|
457
|
+
limit?: number;
|
|
458
|
+
order?: Order;
|
|
459
|
+
}
|
|
460
|
+
interface AccountRewardsParams {
|
|
461
|
+
timestamp?: string | OperatorFilter<string>;
|
|
462
|
+
limit?: number;
|
|
463
|
+
order?: Order;
|
|
464
|
+
}
|
|
465
|
+
interface AllowanceCryptoParams {
|
|
466
|
+
'spender.id'?: string | OperatorFilter<string>;
|
|
467
|
+
limit?: number;
|
|
468
|
+
order?: Order;
|
|
469
|
+
}
|
|
470
|
+
interface AllowanceTokenParams {
|
|
471
|
+
'spender.id'?: string | OperatorFilter<string>;
|
|
472
|
+
'token.id'?: string | OperatorFilter<string>;
|
|
473
|
+
limit?: number;
|
|
474
|
+
order?: Order;
|
|
475
|
+
}
|
|
476
|
+
interface AllowanceNftParams {
|
|
477
|
+
'account.id'?: string | OperatorFilter<string>;
|
|
478
|
+
'token.id'?: string | OperatorFilter<string>;
|
|
479
|
+
/** EC69: This is an Account ID string, NOT a boolean. */
|
|
480
|
+
owner?: string;
|
|
481
|
+
limit?: number;
|
|
482
|
+
order?: Order;
|
|
483
|
+
}
|
|
484
|
+
interface AirdropParams {
|
|
485
|
+
'receiver.id'?: string | OperatorFilter<string>;
|
|
486
|
+
'sender.id'?: string | OperatorFilter<string>;
|
|
487
|
+
'token.id'?: string | OperatorFilter<string>;
|
|
488
|
+
serialnumber?: number;
|
|
489
|
+
limit?: number;
|
|
490
|
+
order?: Order;
|
|
491
|
+
}
|
|
492
|
+
//#endregion
|
|
493
|
+
//#region src/types/tokens.d.ts
|
|
494
|
+
interface FractionAmount {
|
|
495
|
+
numerator: number;
|
|
496
|
+
denominator: number;
|
|
497
|
+
}
|
|
498
|
+
interface FixedFee {
|
|
499
|
+
all_collectors_are_exempt: boolean;
|
|
500
|
+
amount: string;
|
|
501
|
+
collector_account_id: string;
|
|
502
|
+
denominating_token_id: string | null;
|
|
503
|
+
}
|
|
504
|
+
interface FractionalFee {
|
|
505
|
+
all_collectors_are_exempt: boolean;
|
|
506
|
+
amount: FractionAmount;
|
|
507
|
+
collector_account_id: string;
|
|
508
|
+
denominating_token_id: string | null;
|
|
509
|
+
maximum: string | null;
|
|
510
|
+
minimum: string;
|
|
511
|
+
net_of_transfers: boolean;
|
|
512
|
+
}
|
|
513
|
+
interface RoyaltyFee {
|
|
514
|
+
all_collectors_are_exempt: boolean;
|
|
515
|
+
amount: FractionAmount;
|
|
516
|
+
collector_account_id: string;
|
|
517
|
+
fallback_fee: FixedFee | null;
|
|
518
|
+
}
|
|
519
|
+
interface CustomFees {
|
|
520
|
+
created_timestamp: string;
|
|
521
|
+
fixed_fees: FixedFee[];
|
|
522
|
+
fractional_fees: FractionalFee[];
|
|
523
|
+
royalty_fees: RoyaltyFee[];
|
|
524
|
+
}
|
|
525
|
+
interface TokenSummary {
|
|
526
|
+
admin_key: HieroKey | null;
|
|
527
|
+
/** EC14/88: Always `string`, even though list returns `number`. */
|
|
528
|
+
decimals: string;
|
|
529
|
+
metadata: string;
|
|
530
|
+
name: string;
|
|
531
|
+
symbol: string;
|
|
532
|
+
token_id: string;
|
|
533
|
+
type: TokenType;
|
|
534
|
+
}
|
|
535
|
+
interface TokenDetail extends TokenSummary {
|
|
536
|
+
auto_renew_account: string | null;
|
|
537
|
+
auto_renew_period: string | null;
|
|
538
|
+
created_timestamp: string;
|
|
539
|
+
custom_fees: CustomFees;
|
|
540
|
+
deleted: boolean;
|
|
541
|
+
expiry_timestamp: string | null;
|
|
542
|
+
fee_schedule_key: HieroKey | null;
|
|
543
|
+
freeze_default: boolean;
|
|
544
|
+
freeze_key: HieroKey | null;
|
|
545
|
+
initial_supply: string;
|
|
546
|
+
kyc_key: HieroKey | null;
|
|
547
|
+
max_supply: string;
|
|
548
|
+
memo: string;
|
|
549
|
+
metadata_key: HieroKey | null;
|
|
550
|
+
modified_timestamp: string;
|
|
551
|
+
pause_key: HieroKey | null;
|
|
552
|
+
pause_status: string;
|
|
553
|
+
supply_key: HieroKey | null;
|
|
554
|
+
supply_type: string;
|
|
555
|
+
total_supply: string;
|
|
556
|
+
treasury_account_id: string;
|
|
557
|
+
wipe_key: HieroKey | null;
|
|
558
|
+
}
|
|
559
|
+
interface TokenNft {
|
|
560
|
+
account_id: string;
|
|
561
|
+
created_timestamp: string;
|
|
562
|
+
delegating_spender: string | null;
|
|
563
|
+
deleted: boolean;
|
|
564
|
+
metadata: string;
|
|
565
|
+
modified_timestamp: string;
|
|
566
|
+
serial_number: string;
|
|
567
|
+
spender: string | null;
|
|
568
|
+
token_id: string;
|
|
569
|
+
}
|
|
570
|
+
interface TokenBalanceEntry {
|
|
571
|
+
account: string;
|
|
572
|
+
balance: string;
|
|
573
|
+
decimals: string;
|
|
574
|
+
}
|
|
575
|
+
interface TokenBalanceResponse {
|
|
576
|
+
/** EC134: Can be null. */
|
|
577
|
+
timestamp: string | null;
|
|
578
|
+
balances: TokenBalanceEntry[];
|
|
579
|
+
links: {
|
|
580
|
+
next: string | null;
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
interface TokenListParams {
|
|
584
|
+
'account.id'?: string;
|
|
585
|
+
limit?: number;
|
|
586
|
+
name?: string;
|
|
587
|
+
order?: Order;
|
|
588
|
+
publickey?: string;
|
|
589
|
+
'token.id'?: string | OperatorFilter<string>;
|
|
590
|
+
/** EC126: Case-insensitive, normalized to UPPERCASE. */
|
|
591
|
+
type?: TokenType;
|
|
592
|
+
}
|
|
593
|
+
interface TokenNftListParams {
|
|
594
|
+
'account.id'?: string | OperatorFilter<string>;
|
|
595
|
+
limit?: number;
|
|
596
|
+
order?: Order;
|
|
597
|
+
/** EC129: No operators allowed on serialnumber for NFTs. */
|
|
598
|
+
serialnumber?: number;
|
|
599
|
+
}
|
|
600
|
+
interface TokenBalanceParams {
|
|
601
|
+
'account.id'?: string | OperatorFilter<string>;
|
|
602
|
+
timestamp?: string | OperatorFilter<string>;
|
|
603
|
+
limit?: number;
|
|
604
|
+
order?: Order;
|
|
605
|
+
}
|
|
606
|
+
//#endregion
|
|
607
|
+
//#region src/resources/accounts.d.ts
|
|
608
|
+
declare class AccountsResource {
|
|
609
|
+
private readonly client;
|
|
610
|
+
constructor(client: HttpClient);
|
|
611
|
+
list(params?: AccountListParams): Paginator<AccountSummary>;
|
|
612
|
+
get(idOrAliasOrEvmAddress: string): Promise<AccountDetail>;
|
|
613
|
+
getNFTs(idOrAliasOrEvmAddress: string, params?: AccountNftsParams): Paginator<TokenNft>;
|
|
614
|
+
getTokens(idOrAliasOrEvmAddress: string, params?: AccountTokensParams): Paginator<TokenRelationship>;
|
|
615
|
+
getRewards(idOrAliasOrEvmAddress: string, params?: AccountRewardsParams): Paginator<StakingReward>;
|
|
616
|
+
getCryptoAllowances(idOrAliasOrEvmAddress: string, params?: AllowanceCryptoParams): Paginator<CryptoAllowance>;
|
|
617
|
+
getTokenAllowances(idOrAliasOrEvmAddress: string, params?: AllowanceTokenParams): Paginator<TokenAllowance>;
|
|
618
|
+
getNftAllowances(idOrAliasOrEvmAddress: string, params?: AllowanceNftParams): Paginator<NftAllowance>;
|
|
619
|
+
getOutstandingAirdrops(idOrAliasOrEvmAddress: string, params?: AirdropParams): Paginator<Airdrop>;
|
|
620
|
+
getPendingAirdrops(idOrAliasOrEvmAddress: string, params?: AirdropParams): Paginator<Airdrop>;
|
|
621
|
+
}
|
|
622
|
+
//#endregion
|
|
623
|
+
//#region src/types/balances.d.ts
|
|
624
|
+
/**
|
|
625
|
+
* A balance entry from the global `/balances` endpoint.
|
|
626
|
+
*
|
|
627
|
+
* EC40: This is NOT the nested `AccountBalance` shape from `/accounts/{id}`.
|
|
628
|
+
*/
|
|
629
|
+
interface BalanceEntry {
|
|
630
|
+
account: string;
|
|
631
|
+
balance: string;
|
|
632
|
+
tokens: TokenBalance[];
|
|
633
|
+
}
|
|
634
|
+
interface BalanceListParams {
|
|
635
|
+
'account.id'?: string | OperatorFilter<string>;
|
|
636
|
+
'account.publickey'?: string;
|
|
637
|
+
'account.balance'?: string | OperatorFilter<string>;
|
|
638
|
+
timestamp?: string | OperatorFilter<string>;
|
|
639
|
+
limit?: number;
|
|
640
|
+
order?: Order;
|
|
641
|
+
}
|
|
642
|
+
//#endregion
|
|
643
|
+
//#region src/resources/balances.d.ts
|
|
644
|
+
declare class BalancesResource {
|
|
645
|
+
private readonly client;
|
|
646
|
+
constructor(client: HttpClient);
|
|
647
|
+
list(params?: BalanceListParams): Paginator<BalanceEntry>;
|
|
648
|
+
}
|
|
649
|
+
//#endregion
|
|
650
|
+
//#region src/types/blocks.d.ts
|
|
651
|
+
/**
|
|
652
|
+
* A block on the Hedera network.
|
|
653
|
+
*
|
|
654
|
+
* EC15/28: `timestamp` is a `TimestampRange` (object), NOT a string.
|
|
655
|
+
* List and detail have the same shape (0 drift).
|
|
656
|
+
*/
|
|
657
|
+
interface Block {
|
|
658
|
+
count: number;
|
|
659
|
+
gas_used: string;
|
|
660
|
+
hapi_version: string;
|
|
661
|
+
hash: string;
|
|
662
|
+
logs_bloom: string;
|
|
663
|
+
name: string;
|
|
664
|
+
number: number;
|
|
665
|
+
previous_hash: string;
|
|
666
|
+
size: number;
|
|
667
|
+
/** EC15/28: Object with `from` and `to` fields, not a string. */
|
|
668
|
+
timestamp: TimestampRange;
|
|
669
|
+
}
|
|
670
|
+
interface BlockListParams {
|
|
671
|
+
/** EC90: Supports hex string block IDs in query. */
|
|
672
|
+
'block.number'?: number | string | OperatorFilter<number | string>;
|
|
673
|
+
limit?: number;
|
|
674
|
+
order?: Order;
|
|
675
|
+
timestamp?: string | OperatorFilter<string>;
|
|
676
|
+
}
|
|
677
|
+
//#endregion
|
|
678
|
+
//#region src/resources/blocks.d.ts
|
|
679
|
+
declare class BlocksResource {
|
|
680
|
+
private readonly client;
|
|
681
|
+
constructor(client: HttpClient);
|
|
682
|
+
list(params?: BlockListParams): Paginator<Block>;
|
|
683
|
+
get(hashOrNumber: string | number): Promise<Block>;
|
|
684
|
+
}
|
|
685
|
+
//#endregion
|
|
686
|
+
//#region src/types/contracts.d.ts
|
|
687
|
+
interface ContractSummary {
|
|
688
|
+
admin_key: HieroKey | null;
|
|
689
|
+
auto_renew_account: string | null;
|
|
690
|
+
auto_renew_period: string | null;
|
|
691
|
+
contract_id: string;
|
|
692
|
+
created_timestamp: string;
|
|
693
|
+
deleted: boolean;
|
|
694
|
+
evm_address: string;
|
|
695
|
+
expiration_timestamp: string | null;
|
|
696
|
+
file_id: string | null;
|
|
697
|
+
max_automatic_token_associations: number;
|
|
698
|
+
memo: string;
|
|
699
|
+
nonce: string;
|
|
700
|
+
obtainer_id: string | null;
|
|
701
|
+
permanent_removal: boolean | null;
|
|
702
|
+
proxy_account_id: string | null;
|
|
703
|
+
timestamp: TimestampRange;
|
|
704
|
+
}
|
|
705
|
+
interface ContractDetail extends ContractSummary {
|
|
706
|
+
bytecode: string;
|
|
707
|
+
runtime_bytecode: string;
|
|
708
|
+
}
|
|
709
|
+
interface ContractResult {
|
|
710
|
+
access_list: string | null;
|
|
711
|
+
address: string;
|
|
712
|
+
amount: string;
|
|
713
|
+
block_gas_used: string;
|
|
714
|
+
block_hash: string;
|
|
715
|
+
block_number: number;
|
|
716
|
+
bloom: string;
|
|
717
|
+
call_result: string | null;
|
|
718
|
+
chain_id: string;
|
|
719
|
+
contract_id: string | null;
|
|
720
|
+
created_contract_ids: string[];
|
|
721
|
+
error_message: string | null;
|
|
722
|
+
/** Hex-decoded human-readable error (EC24). */
|
|
723
|
+
error_message_decoded: string | null;
|
|
724
|
+
failed_initcode: string | null;
|
|
725
|
+
from: string;
|
|
726
|
+
function_parameters: string;
|
|
727
|
+
gas_consumed: string | null;
|
|
728
|
+
gas_limit: string;
|
|
729
|
+
gas_price: string;
|
|
730
|
+
gas_used: string;
|
|
731
|
+
hash: string;
|
|
732
|
+
logs: ContractLog[];
|
|
733
|
+
max_fee_per_gas: string;
|
|
734
|
+
max_priority_fee_per_gas: string;
|
|
735
|
+
nonce: number;
|
|
736
|
+
r: string;
|
|
737
|
+
result: string;
|
|
738
|
+
s: string;
|
|
739
|
+
state_changes: StateChange[];
|
|
740
|
+
status: string;
|
|
741
|
+
timestamp: string;
|
|
742
|
+
to: string | null;
|
|
743
|
+
transaction_index: number;
|
|
744
|
+
type: number;
|
|
745
|
+
v: number;
|
|
746
|
+
}
|
|
747
|
+
interface ContractLog {
|
|
748
|
+
address: string;
|
|
749
|
+
bloom: string;
|
|
750
|
+
contract_id: string;
|
|
751
|
+
data: string;
|
|
752
|
+
index: number;
|
|
753
|
+
/** EC138: 0-4 items, each `0x`-prefixed hex string. */
|
|
754
|
+
topics: string[];
|
|
755
|
+
root_contract_id: string | null;
|
|
756
|
+
timestamp: string;
|
|
757
|
+
block_hash: string;
|
|
758
|
+
block_number: number;
|
|
759
|
+
transaction_hash: string;
|
|
760
|
+
transaction_index: number;
|
|
761
|
+
}
|
|
762
|
+
interface StateChange {
|
|
763
|
+
address: string;
|
|
764
|
+
contract_id: string;
|
|
765
|
+
slot: string;
|
|
766
|
+
value_read: string;
|
|
767
|
+
/** Null for read-only accesses. */
|
|
768
|
+
value_written: string | null;
|
|
769
|
+
}
|
|
770
|
+
interface ContractAction {
|
|
771
|
+
call_depth: number;
|
|
772
|
+
call_operation_type: string;
|
|
773
|
+
call_type: string;
|
|
774
|
+
caller: string;
|
|
775
|
+
caller_type: string;
|
|
776
|
+
from: string;
|
|
777
|
+
gas: string;
|
|
778
|
+
gas_used: string;
|
|
779
|
+
index: number;
|
|
780
|
+
input: string | null;
|
|
781
|
+
recipient: string | null;
|
|
782
|
+
recipient_type: string | null;
|
|
783
|
+
result_data: string | null;
|
|
784
|
+
result_data_type: string;
|
|
785
|
+
timestamp: string;
|
|
786
|
+
to: string | null;
|
|
787
|
+
value: string;
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* Request body for `client.contracts.call()`.
|
|
791
|
+
*
|
|
792
|
+
* EC132: `value` is NOT accepted (read-only simulation).
|
|
793
|
+
*/
|
|
794
|
+
interface ContractCallRequest {
|
|
795
|
+
/** Block tag or number. Default: `"latest"` (EC130). */
|
|
796
|
+
block?: string;
|
|
797
|
+
data: string;
|
|
798
|
+
estimate?: boolean;
|
|
799
|
+
/** EC133: Optional sender address for simulation. */
|
|
800
|
+
from?: string;
|
|
801
|
+
/** EC131: Must be > 0. */
|
|
802
|
+
gas?: number;
|
|
803
|
+
gasPrice?: number;
|
|
804
|
+
to: string;
|
|
805
|
+
}
|
|
806
|
+
interface ContractCallResponse {
|
|
807
|
+
result: string;
|
|
808
|
+
}
|
|
809
|
+
interface ContractListParams {
|
|
810
|
+
'contract.id'?: string | OperatorFilter<string>;
|
|
811
|
+
limit?: number;
|
|
812
|
+
order?: Order;
|
|
813
|
+
}
|
|
814
|
+
interface ContractResultsParams {
|
|
815
|
+
block_hash?: string;
|
|
816
|
+
block_number?: number | OperatorFilter<number>;
|
|
817
|
+
from?: string;
|
|
818
|
+
internal?: boolean;
|
|
819
|
+
limit?: number;
|
|
820
|
+
order?: Order;
|
|
821
|
+
timestamp?: string | OperatorFilter<string>;
|
|
822
|
+
transaction_index?: number;
|
|
823
|
+
}
|
|
824
|
+
interface ContractLogsParams {
|
|
825
|
+
index?: number | OperatorFilter<number>;
|
|
826
|
+
limit?: number;
|
|
827
|
+
order?: Order;
|
|
828
|
+
timestamp?: string | OperatorFilter<string>;
|
|
829
|
+
topic0?: string | OperatorFilter<string>;
|
|
830
|
+
topic1?: string | OperatorFilter<string>;
|
|
831
|
+
topic2?: string | OperatorFilter<string>;
|
|
832
|
+
topic3?: string | OperatorFilter<string>;
|
|
833
|
+
}
|
|
834
|
+
interface ContractStateParams {
|
|
835
|
+
limit?: number;
|
|
836
|
+
order?: Order;
|
|
837
|
+
slot?: string | OperatorFilter<string>;
|
|
838
|
+
timestamp?: string | OperatorFilter<string>;
|
|
839
|
+
}
|
|
840
|
+
//#endregion
|
|
841
|
+
//#region src/resources/contracts.d.ts
|
|
842
|
+
declare class ContractsResource {
|
|
843
|
+
private readonly client;
|
|
844
|
+
constructor(client: HttpClient);
|
|
845
|
+
list(params?: ContractListParams): Paginator<ContractSummary>;
|
|
846
|
+
get(contractIdOrAddress: string): Promise<ContractDetail>;
|
|
847
|
+
/**
|
|
848
|
+
* POST /api/v1/contracts/call — smart contract read-only simulation.
|
|
849
|
+
*
|
|
850
|
+
* EC29/51/130-133.
|
|
851
|
+
*/
|
|
852
|
+
call(request: ContractCallRequest): Promise<ContractCallResponse>;
|
|
853
|
+
getResults(params?: ContractResultsParams): Paginator<ContractResult>;
|
|
854
|
+
getResultsByContract(contractIdOrAddress: string, params?: ContractResultsParams): Paginator<ContractResult>;
|
|
855
|
+
getResultByTimestamp(contractIdOrAddress: string, timestamp: string): Promise<ContractResult>;
|
|
856
|
+
getResultByTransactionIdOrHash(transactionIdOrHash: string): Promise<ContractResult>;
|
|
857
|
+
getActions(transactionIdOrHash: string): Paginator<ContractAction>;
|
|
858
|
+
getLogs(params?: ContractLogsParams): Paginator<ContractLog>;
|
|
859
|
+
getLogsByContract(contractIdOrAddress: string, params?: ContractLogsParams): Paginator<ContractLog>;
|
|
860
|
+
getState(contractIdOrAddress: string, params?: ContractStateParams): Paginator<StateChange>;
|
|
861
|
+
getOpcodes(transactionIdOrHash: string): Promise<unknown>;
|
|
862
|
+
}
|
|
863
|
+
//#endregion
|
|
864
|
+
//#region src/types/network.d.ts
|
|
865
|
+
/**
|
|
866
|
+
* A consensus node in the Hedera network.
|
|
867
|
+
*
|
|
868
|
+
* EC32: `node_id` is a plain number, NOT `0.0.X` format.
|
|
869
|
+
* EC60: `stake` is `string` (int64, may exceed MAX_SAFE_INTEGER).
|
|
870
|
+
* EC28: `timestamp` is a `TimestampRange` (to can be null for active nodes).
|
|
871
|
+
*/
|
|
872
|
+
interface NetworkNode {
|
|
873
|
+
admin_key: unknown | null;
|
|
874
|
+
description: string;
|
|
875
|
+
file_id: string;
|
|
876
|
+
max_stake: string;
|
|
877
|
+
memo: string;
|
|
878
|
+
min_stake: string;
|
|
879
|
+
node_account_id: string;
|
|
880
|
+
/** EC32: Plain number, not entity ID format. */
|
|
881
|
+
node_id: number;
|
|
882
|
+
node_cert_hash: string;
|
|
883
|
+
public_key: string;
|
|
884
|
+
reward_rate_start: string;
|
|
885
|
+
service_endpoints: ServiceEndpoint[];
|
|
886
|
+
/** EC60: String (int64, may exceed MAX_SAFE_INTEGER). */
|
|
887
|
+
stake: string;
|
|
888
|
+
stake_not_rewarded: string;
|
|
889
|
+
stake_rewarded: string;
|
|
890
|
+
staking_period: TimestampRange;
|
|
891
|
+
/** EC28: `to` can be null for currently active nodes. */
|
|
892
|
+
timestamp: TimestampRange;
|
|
893
|
+
}
|
|
894
|
+
interface ServiceEndpoint {
|
|
895
|
+
ip_address_v4: string;
|
|
896
|
+
port: number;
|
|
897
|
+
domain_name: string;
|
|
898
|
+
}
|
|
899
|
+
/**
|
|
900
|
+
* Network staking information.
|
|
901
|
+
*
|
|
902
|
+
* EC36: All staking values as `string` (raw numbers exceed MAX_SAFE_INTEGER).
|
|
903
|
+
*/
|
|
904
|
+
interface NetworkStake {
|
|
905
|
+
max_stake_rewarded: string;
|
|
906
|
+
max_staking_reward_rate_per_hbar: string;
|
|
907
|
+
max_total_reward: string;
|
|
908
|
+
node_reward_fee_fraction: number;
|
|
909
|
+
reserved_staking_rewards: string;
|
|
910
|
+
reward_balance_threshold: string;
|
|
911
|
+
stake_total: string;
|
|
912
|
+
staking_period: TimestampRange;
|
|
913
|
+
staking_period_duration: string;
|
|
914
|
+
staking_periods_stored: string;
|
|
915
|
+
staking_reward_fee_fraction: number;
|
|
916
|
+
staking_reward_rate: string;
|
|
917
|
+
staking_start_threshold: string;
|
|
918
|
+
unreserved_staking_reward_balance: string;
|
|
919
|
+
}
|
|
920
|
+
interface ExchangeRate {
|
|
921
|
+
cent_equivalent: number;
|
|
922
|
+
expiration_time: number;
|
|
923
|
+
hbar_equivalent: number;
|
|
924
|
+
}
|
|
925
|
+
interface ExchangeRateSet {
|
|
926
|
+
current_rate: ExchangeRate;
|
|
927
|
+
next_rate: ExchangeRate;
|
|
928
|
+
timestamp: string;
|
|
929
|
+
}
|
|
930
|
+
interface Supply {
|
|
931
|
+
released_supply: string;
|
|
932
|
+
timestamp: string;
|
|
933
|
+
total_supply: string;
|
|
934
|
+
}
|
|
935
|
+
interface Fee {
|
|
936
|
+
gas: string;
|
|
937
|
+
transaction_type: string;
|
|
938
|
+
}
|
|
939
|
+
interface FeeSchedule {
|
|
940
|
+
current?: Fee[];
|
|
941
|
+
next?: Fee[];
|
|
942
|
+
timestamp: string;
|
|
943
|
+
}
|
|
944
|
+
interface NetworkNodeParams {
|
|
945
|
+
/** EC59: `file_id` is rejected by server. Not included. */
|
|
946
|
+
limit?: number;
|
|
947
|
+
'node.id'?: number | OperatorFilter<number>;
|
|
948
|
+
order?: Order;
|
|
949
|
+
}
|
|
950
|
+
interface NetworkFeeParams {
|
|
951
|
+
order?: Order;
|
|
952
|
+
timestamp?: string | OperatorFilter<string>;
|
|
953
|
+
}
|
|
954
|
+
interface NetworkSupplyParams {
|
|
955
|
+
timestamp?: string | OperatorFilter<string>;
|
|
956
|
+
}
|
|
957
|
+
//#endregion
|
|
958
|
+
//#region src/resources/network.d.ts
|
|
959
|
+
declare class NetworkResource {
|
|
960
|
+
private readonly client;
|
|
961
|
+
constructor(client: HttpClient);
|
|
962
|
+
getExchangeRate(): Promise<ExchangeRateSet>;
|
|
963
|
+
getFees(params?: NetworkFeeParams): Promise<FeeSchedule>;
|
|
964
|
+
/**
|
|
965
|
+
* POST /api/v1/network/fees — estimate fees from protobuf payload.
|
|
966
|
+
*
|
|
967
|
+
* EC52: Accepts raw Uint8Array (user must serialize protobuf externally).
|
|
968
|
+
*/
|
|
969
|
+
estimateFees(body: Uint8Array): Promise<unknown>;
|
|
970
|
+
getNodes(params?: NetworkNodeParams): Paginator<NetworkNode>;
|
|
971
|
+
getStake(): Promise<NetworkStake>;
|
|
972
|
+
getSupply(params?: NetworkSupplyParams): Promise<Supply>;
|
|
973
|
+
}
|
|
974
|
+
//#endregion
|
|
975
|
+
//#region src/types/schedules.d.ts
|
|
976
|
+
interface Schedule {
|
|
977
|
+
admin_key: HieroKey | null;
|
|
978
|
+
consensus_timestamp: string | null;
|
|
979
|
+
creator_account_id: string;
|
|
980
|
+
deleted: boolean;
|
|
981
|
+
executed_timestamp: string | null;
|
|
982
|
+
expiration_time: string | null;
|
|
983
|
+
memo: string;
|
|
984
|
+
payer_account_id: string;
|
|
985
|
+
schedule_id: string;
|
|
986
|
+
signatures: ScheduleSignature[];
|
|
987
|
+
transaction_body: string;
|
|
988
|
+
wait_for_expiry: boolean;
|
|
989
|
+
}
|
|
990
|
+
interface ScheduleSignature {
|
|
991
|
+
consensus_timestamp: string;
|
|
992
|
+
public_key_prefix: string;
|
|
993
|
+
signature: string;
|
|
994
|
+
type: string;
|
|
995
|
+
}
|
|
996
|
+
interface ScheduleListParams {
|
|
997
|
+
'account.id'?: string | OperatorFilter<string>;
|
|
998
|
+
limit?: number;
|
|
999
|
+
order?: Order;
|
|
1000
|
+
'schedule.id'?: string | OperatorFilter<string>;
|
|
1001
|
+
}
|
|
1002
|
+
//#endregion
|
|
1003
|
+
//#region src/resources/schedules.d.ts
|
|
1004
|
+
declare class SchedulesResource {
|
|
1005
|
+
private readonly client;
|
|
1006
|
+
constructor(client: HttpClient);
|
|
1007
|
+
list(params?: ScheduleListParams): Paginator<Schedule>;
|
|
1008
|
+
get(scheduleId: string): Promise<Schedule>;
|
|
1009
|
+
}
|
|
1010
|
+
//#endregion
|
|
1011
|
+
//#region src/types/transactions.d.ts
|
|
1012
|
+
interface Transaction {
|
|
1013
|
+
bytes: string | null;
|
|
1014
|
+
charged_tx_fee: string;
|
|
1015
|
+
consensus_timestamp: string;
|
|
1016
|
+
/** EC39: Null on failed transactions. */
|
|
1017
|
+
entity_id: string | null;
|
|
1018
|
+
max_fee: string;
|
|
1019
|
+
memo_base64: string;
|
|
1020
|
+
name: string;
|
|
1021
|
+
nft_transfers: NftTransfer[];
|
|
1022
|
+
node: string | null;
|
|
1023
|
+
nonce: number;
|
|
1024
|
+
parent_consensus_timestamp: string | null;
|
|
1025
|
+
result: string;
|
|
1026
|
+
scheduled: boolean;
|
|
1027
|
+
/** EC135: Always an array, never null or missing. */
|
|
1028
|
+
staking_reward_transfers: StakingRewardTransfer[];
|
|
1029
|
+
token_transfers: TokenTransfer[];
|
|
1030
|
+
/** Base64-encoded hash. Use `base64ToHex()` for `0x` format. */
|
|
1031
|
+
transaction_hash: string;
|
|
1032
|
+
transaction_id: string;
|
|
1033
|
+
transfers: Transfer[];
|
|
1034
|
+
valid_duration_seconds: string;
|
|
1035
|
+
valid_start_timestamp: string;
|
|
1036
|
+
}
|
|
1037
|
+
/**
|
|
1038
|
+
* NFT-specific transaction from `/tokens/{id}/nfts/{serial}/transactions`.
|
|
1039
|
+
*
|
|
1040
|
+
* EC77: Has top-level `receiver_account_id` and `sender_account_id` fields
|
|
1041
|
+
* instead of nested `transfers`.
|
|
1042
|
+
*/
|
|
1043
|
+
interface NftTransaction {
|
|
1044
|
+
consensus_timestamp: string;
|
|
1045
|
+
is_approval: boolean;
|
|
1046
|
+
nonce: number;
|
|
1047
|
+
receiver_account_id: string | null;
|
|
1048
|
+
sender_account_id: string | null;
|
|
1049
|
+
transaction_id: string;
|
|
1050
|
+
type: string;
|
|
1051
|
+
}
|
|
1052
|
+
interface TransactionListParams {
|
|
1053
|
+
'account.id'?: string | OperatorFilter<string>;
|
|
1054
|
+
limit?: number;
|
|
1055
|
+
order?: Order;
|
|
1056
|
+
result?: TransactionResult;
|
|
1057
|
+
timestamp?: string | OperatorFilter<string>;
|
|
1058
|
+
/** EC127: Case-insensitive, normalized to UPPERCASE. */
|
|
1059
|
+
transactiontype?: string;
|
|
1060
|
+
}
|
|
1061
|
+
/**
|
|
1062
|
+
* Parameters for `transactions.get()`.
|
|
1063
|
+
*
|
|
1064
|
+
* EC124/125: `nonce` and `scheduled` are only valid on detail, NOT on list.
|
|
1065
|
+
*/
|
|
1066
|
+
interface TransactionGetParams {
|
|
1067
|
+
nonce?: number;
|
|
1068
|
+
scheduled?: boolean;
|
|
1069
|
+
}
|
|
1070
|
+
//#endregion
|
|
1071
|
+
//#region src/resources/tokens.d.ts
|
|
1072
|
+
declare class TokensResource {
|
|
1073
|
+
private readonly client;
|
|
1074
|
+
constructor(client: HttpClient);
|
|
1075
|
+
list(params?: TokenListParams): Paginator<TokenSummary>;
|
|
1076
|
+
get(tokenId: string): Promise<TokenDetail>;
|
|
1077
|
+
getBalances(tokenId: string, params?: TokenBalanceParams): Paginator<TokenBalanceEntry>;
|
|
1078
|
+
getNFTs(tokenId: string, params?: TokenNftListParams): Paginator<TokenNft>;
|
|
1079
|
+
getNFTBySerial(tokenId: string, serialNumber: number | string): Promise<TokenNft>;
|
|
1080
|
+
getNFTTransactions(tokenId: string, serialNumber: number | string, params?: TransactionListParams): Paginator<NftTransaction>;
|
|
1081
|
+
}
|
|
1082
|
+
//#endregion
|
|
1083
|
+
//#region src/types/topics.d.ts
|
|
1084
|
+
/**
|
|
1085
|
+
* A message published to a Hedera Consensus Service topic.
|
|
1086
|
+
*
|
|
1087
|
+
* EC3/18: `message` and `running_hash` are auto-decoded from Base64
|
|
1088
|
+
* to `Uint8Array` by the response mapper.
|
|
1089
|
+
*/
|
|
1090
|
+
interface TopicMessage {
|
|
1091
|
+
chunk_info: ChunkInfo | null;
|
|
1092
|
+
consensus_timestamp: string;
|
|
1093
|
+
message: Uint8Array;
|
|
1094
|
+
payer_account_id: string;
|
|
1095
|
+
running_hash: Uint8Array;
|
|
1096
|
+
running_hash_version: number;
|
|
1097
|
+
sequence_number: string;
|
|
1098
|
+
topic_id: string;
|
|
1099
|
+
}
|
|
1100
|
+
interface ChunkInfo {
|
|
1101
|
+
initial_transaction_id: {
|
|
1102
|
+
account_id: string;
|
|
1103
|
+
nonce: number;
|
|
1104
|
+
scheduled: boolean;
|
|
1105
|
+
transaction_valid_start: string;
|
|
1106
|
+
};
|
|
1107
|
+
number: number;
|
|
1108
|
+
total: number;
|
|
1109
|
+
}
|
|
1110
|
+
interface TopicInfo {
|
|
1111
|
+
admin_key: unknown | null;
|
|
1112
|
+
auto_renew_account: string | null;
|
|
1113
|
+
auto_renew_period: string | null;
|
|
1114
|
+
created_timestamp: string;
|
|
1115
|
+
deleted: boolean;
|
|
1116
|
+
memo: string;
|
|
1117
|
+
submit_key: unknown | null;
|
|
1118
|
+
timestamp: {
|
|
1119
|
+
from: string;
|
|
1120
|
+
to: string | null;
|
|
1121
|
+
};
|
|
1122
|
+
topic_id: string;
|
|
1123
|
+
}
|
|
1124
|
+
interface TopicMessageParams {
|
|
1125
|
+
/** EC44/72: `'base64'` (default) or `'utf-8'`. */
|
|
1126
|
+
encoding?: 'base64' | 'utf-8';
|
|
1127
|
+
limit?: number;
|
|
1128
|
+
order?: Order;
|
|
1129
|
+
sequencenumber?: number | OperatorFilter<number>;
|
|
1130
|
+
timestamp?: string | OperatorFilter<string>;
|
|
1131
|
+
}
|
|
1132
|
+
interface TopicStreamOptions$1 {
|
|
1133
|
+
/** Starting timestamp cursor. Default: `'now'`. */
|
|
1134
|
+
startTimestamp?: string;
|
|
1135
|
+
/** Polling interval in ms. Default: adaptive (500–5000ms). */
|
|
1136
|
+
interval?: number;
|
|
1137
|
+
/** Limit per poll request. Default: 100. */
|
|
1138
|
+
limit?: number;
|
|
1139
|
+
/** AbortSignal for cancellation. */
|
|
1140
|
+
signal?: AbortSignal;
|
|
1141
|
+
}
|
|
1142
|
+
//#endregion
|
|
1143
|
+
//#region src/pagination/stream.d.ts
|
|
1144
|
+
interface TopicStreamOptions {
|
|
1145
|
+
/** Starting timestamp cursor. Default: current time. */
|
|
1146
|
+
startTimestamp?: string;
|
|
1147
|
+
/** Base polling interval in ms. Default: 500ms (active), backs off to 5s. */
|
|
1148
|
+
interval?: number;
|
|
1149
|
+
/** Maximum items per poll request. Default: 100. */
|
|
1150
|
+
limit?: number;
|
|
1151
|
+
/** AbortSignal for cancellation. */
|
|
1152
|
+
signal?: AbortSignal;
|
|
1153
|
+
}
|
|
1154
|
+
/**
|
|
1155
|
+
* Adaptive polling stream for topic messages.
|
|
1156
|
+
*
|
|
1157
|
+
* - Polls at high frequency (500ms) when messages are flowing.
|
|
1158
|
+
* - Backs off exponentially (up to 5s) when no messages arrive.
|
|
1159
|
+
* - Cancellable via `AbortController`.
|
|
1160
|
+
* - Rate-limit aware (shares the HttpClient's token bucket).
|
|
1161
|
+
*/
|
|
1162
|
+
declare class TopicStream implements AsyncIterable<TopicMessage> {
|
|
1163
|
+
private readonly client;
|
|
1164
|
+
private readonly topicId;
|
|
1165
|
+
private readonly options;
|
|
1166
|
+
/** Minimum polling interval (ms). */
|
|
1167
|
+
private static readonly MIN_INTERVAL;
|
|
1168
|
+
/** Maximum polling interval (ms). */
|
|
1169
|
+
private static readonly MAX_INTERVAL;
|
|
1170
|
+
/** Factor by which interval increases on empty polls. */
|
|
1171
|
+
private static readonly BACKOFF_FACTOR;
|
|
1172
|
+
constructor(client: HttpClient, topicId: string, options?: TopicStreamOptions);
|
|
1173
|
+
[Symbol.asyncIterator](): AsyncIterator<TopicMessage>;
|
|
1174
|
+
private sleep;
|
|
1175
|
+
}
|
|
1176
|
+
//#endregion
|
|
1177
|
+
//#region src/resources/topics.d.ts
|
|
1178
|
+
declare class TopicsResource {
|
|
1179
|
+
private readonly client;
|
|
1180
|
+
constructor(client: HttpClient);
|
|
1181
|
+
get(topicId: string): Promise<TopicInfo>;
|
|
1182
|
+
getMessages(topicId: string, params?: TopicMessageParams): Paginator<TopicMessage>;
|
|
1183
|
+
getMessageBySequence(topicId: string, sequenceNumber: number | string): Promise<TopicMessage>;
|
|
1184
|
+
getMessageByTimestamp(timestamp: string): Promise<TopicMessage>;
|
|
1185
|
+
stream(topicId: string, options?: TopicStreamOptions$1): TopicStream;
|
|
1186
|
+
}
|
|
1187
|
+
//#endregion
|
|
1188
|
+
//#region src/resources/transactions.d.ts
|
|
1189
|
+
declare class TransactionsResource {
|
|
1190
|
+
private readonly client;
|
|
1191
|
+
constructor(client: HttpClient);
|
|
1192
|
+
list(params?: TransactionListParams): Paginator<Transaction>;
|
|
1193
|
+
/**
|
|
1194
|
+
* Get a transaction by ID.
|
|
1195
|
+
*
|
|
1196
|
+
* EC21/150/151: The API returns `{ transactions: [{ ... }] }`.
|
|
1197
|
+
* This method unwraps to return the single transaction.
|
|
1198
|
+
*/
|
|
1199
|
+
get(transactionId: string, params?: TransactionGetParams): Promise<Transaction>;
|
|
1200
|
+
}
|
|
1201
|
+
//#endregion
|
|
1202
|
+
//#region src/client.d.ts
|
|
1203
|
+
/**
|
|
1204
|
+
* Built-in network presets for the Hedera/Hiero Mirror Node.
|
|
1205
|
+
*/
|
|
1206
|
+
type HieroNetwork = 'mainnet' | 'testnet' | 'previewnet';
|
|
1207
|
+
interface MirrorNodeClientOptions {
|
|
1208
|
+
/**
|
|
1209
|
+
* Network preset. Mutually exclusive with `baseUrl`.
|
|
1210
|
+
*
|
|
1211
|
+
* If neither `network` nor `baseUrl` is provided, defaults to `'mainnet'`.
|
|
1212
|
+
*/
|
|
1213
|
+
network?: HieroNetwork;
|
|
1214
|
+
/**
|
|
1215
|
+
* Custom base URL. Mutually exclusive with `network`.
|
|
1216
|
+
*
|
|
1217
|
+
* Useful for self-hosted mirror nodes or proxies.
|
|
1218
|
+
*/
|
|
1219
|
+
baseUrl?: string;
|
|
1220
|
+
/** Request timeout in ms. Default: `30_000`. */
|
|
1221
|
+
timeout?: number;
|
|
1222
|
+
/** Maximum retry attempts for retryable failures. Default: `2`. */
|
|
1223
|
+
maxRetries?: number;
|
|
1224
|
+
/** Rate limit in requests per second. Default: `50`. */
|
|
1225
|
+
rateLimitRps?: number;
|
|
1226
|
+
/** Optional logger. Compatible with `console`, `pino`, `winston`. */
|
|
1227
|
+
logger?: Logger$1;
|
|
1228
|
+
/** Custom `fetch` implementation (for testing or environments without global fetch). */
|
|
1229
|
+
fetch?: typeof globalThis.fetch;
|
|
1230
|
+
}
|
|
1231
|
+
/**
|
|
1232
|
+
* The main Hiero Mirror Client SDK entry point.
|
|
1233
|
+
*
|
|
1234
|
+
* Provides typed access to all Mirror Node REST API resources with:
|
|
1235
|
+
* - Automatic pagination via `Paginator`
|
|
1236
|
+
* - Safe JSON parsing for int64 precision
|
|
1237
|
+
* - ETag caching, retry/backoff, and rate limiting
|
|
1238
|
+
* - Type-safe responses via response mappers
|
|
1239
|
+
*/
|
|
1240
|
+
declare class MirrorNodeClient {
|
|
1241
|
+
/** Account operations: list, get, NFTs, tokens, rewards, allowances, airdrops. */
|
|
1242
|
+
readonly accounts: AccountsResource;
|
|
1243
|
+
/** Global balance queries. */
|
|
1244
|
+
readonly balances: BalancesResource;
|
|
1245
|
+
/** Block queries. */
|
|
1246
|
+
readonly blocks: BlocksResource;
|
|
1247
|
+
/** Contract queries and smart contract call simulation. */
|
|
1248
|
+
readonly contracts: ContractsResource;
|
|
1249
|
+
/** Network info: exchange rate, fees, nodes, stake, supply. */
|
|
1250
|
+
readonly network: NetworkResource;
|
|
1251
|
+
/** Schedule queries. */
|
|
1252
|
+
readonly schedules: SchedulesResource;
|
|
1253
|
+
/** Token queries: list, get, balances, NFTs, NFT transactions. */
|
|
1254
|
+
readonly tokens: TokensResource;
|
|
1255
|
+
/** Topic queries and HCS message streaming. */
|
|
1256
|
+
readonly topics: TopicsResource;
|
|
1257
|
+
/** Transaction queries. */
|
|
1258
|
+
readonly transactions: TransactionsResource;
|
|
1259
|
+
/** The underlying HTTP client (exposed for advanced usage). */
|
|
1260
|
+
readonly httpClient: HttpClient;
|
|
1261
|
+
constructor(options?: MirrorNodeClientOptions);
|
|
1262
|
+
}
|
|
1263
|
+
//#endregion
|
|
1264
|
+
//#region src/errors/HieroError.d.ts
|
|
1265
|
+
/**
|
|
1266
|
+
* Base error class for all Hiero Mirror Client errors.
|
|
1267
|
+
*
|
|
1268
|
+
* Modeled after Stripe's error hierarchy — every SDK error extends this class,
|
|
1269
|
+
* enabling `instanceof HieroError` to catch all SDK-specific errors.
|
|
1270
|
+
*
|
|
1271
|
+
* @public
|
|
1272
|
+
*/
|
|
1273
|
+
declare class HieroError extends Error {
|
|
1274
|
+
/** HTTP status code, if the error originated from an HTTP response. */
|
|
1275
|
+
readonly statusCode?: number;
|
|
1276
|
+
/** The raw response body, if available. */
|
|
1277
|
+
readonly rawBody?: string;
|
|
1278
|
+
constructor(message: string, options?: {
|
|
1279
|
+
statusCode?: number;
|
|
1280
|
+
rawBody?: string;
|
|
1281
|
+
cause?: unknown;
|
|
1282
|
+
});
|
|
1283
|
+
toJSON(): Record<string, unknown>;
|
|
1284
|
+
}
|
|
1285
|
+
//#endregion
|
|
1286
|
+
//#region src/errors/HieroParseError.d.ts
|
|
1287
|
+
/**
|
|
1288
|
+
* Thrown when the response body cannot be parsed as JSON,
|
|
1289
|
+
* or when the response Content-Type is unexpected (e.g., `text/html`
|
|
1290
|
+
* for Unicode parameter errors — EC153).
|
|
1291
|
+
*
|
|
1292
|
+
* @public
|
|
1293
|
+
*/
|
|
1294
|
+
declare class HieroParseError extends HieroError {
|
|
1295
|
+
/** The raw body text that could not be parsed. */
|
|
1296
|
+
readonly body: string;
|
|
1297
|
+
constructor(message: string, options: {
|
|
1298
|
+
body: string;
|
|
1299
|
+
statusCode?: number;
|
|
1300
|
+
cause?: unknown;
|
|
1301
|
+
});
|
|
1302
|
+
}
|
|
1303
|
+
//#endregion
|
|
1304
|
+
//#region src/errors/HieroCapabilityError.d.ts
|
|
1305
|
+
/**
|
|
1306
|
+
* Thrown when a known feature is disabled on the mirror node
|
|
1307
|
+
* (e.g., `/stateproof` returns 404 on valid transaction IDs — EC62).
|
|
1308
|
+
*
|
|
1309
|
+
* Distinct from {@link HieroNotFoundError} because the entity exists
|
|
1310
|
+
* but the feature is unavailable on this mirror node instance.
|
|
1311
|
+
*
|
|
1312
|
+
* @public
|
|
1313
|
+
*/
|
|
1314
|
+
declare class HieroCapabilityError extends HieroError {
|
|
1315
|
+
/** The feature/endpoint that is disabled. */
|
|
1316
|
+
readonly feature: string;
|
|
1317
|
+
constructor(message: string, options: {
|
|
1318
|
+
feature: string;
|
|
1319
|
+
rawBody?: string;
|
|
1320
|
+
});
|
|
1321
|
+
toJSON(): Record<string, unknown>;
|
|
1322
|
+
}
|
|
1323
|
+
//#endregion
|
|
1324
|
+
//#region src/errors/HieroNetworkError.d.ts
|
|
1325
|
+
/**
|
|
1326
|
+
* Thrown when a network-level error occurs: DNS resolution failure,
|
|
1327
|
+
* connection refused, socket hangup, etc.
|
|
1328
|
+
*
|
|
1329
|
+
* @public
|
|
1330
|
+
*/
|
|
1331
|
+
declare class HieroNetworkError extends HieroError {
|
|
1332
|
+
constructor(message: string, options?: {
|
|
1333
|
+
cause?: unknown;
|
|
1334
|
+
});
|
|
1335
|
+
}
|
|
1336
|
+
//#endregion
|
|
1337
|
+
//#region src/errors/HieroNotFoundError.d.ts
|
|
1338
|
+
/**
|
|
1339
|
+
* Thrown when the server returns HTTP 404 (Not Found) for a specific entity.
|
|
1340
|
+
*
|
|
1341
|
+
* @public
|
|
1342
|
+
*/
|
|
1343
|
+
declare class HieroNotFoundError extends HieroError {
|
|
1344
|
+
/** The entity ID that was not found, if available. */
|
|
1345
|
+
readonly entityId?: string;
|
|
1346
|
+
constructor(message: string, options?: {
|
|
1347
|
+
entityId?: string;
|
|
1348
|
+
rawBody?: string;
|
|
1349
|
+
});
|
|
1350
|
+
toJSON(): Record<string, unknown>;
|
|
1351
|
+
}
|
|
1352
|
+
//#endregion
|
|
1353
|
+
//#region src/errors/HieroRateLimitError.d.ts
|
|
1354
|
+
/**
|
|
1355
|
+
* Thrown when the server returns HTTP 429 (Too Many Requests).
|
|
1356
|
+
*
|
|
1357
|
+
* @public
|
|
1358
|
+
*/
|
|
1359
|
+
declare class HieroRateLimitError extends HieroError {
|
|
1360
|
+
/** Seconds to wait before retrying, parsed from `Retry-After` header. */
|
|
1361
|
+
readonly retryAfter?: number;
|
|
1362
|
+
constructor(message: string, options?: {
|
|
1363
|
+
retryAfter?: number;
|
|
1364
|
+
rawBody?: string;
|
|
1365
|
+
});
|
|
1366
|
+
toJSON(): Record<string, unknown>;
|
|
1367
|
+
}
|
|
1368
|
+
//#endregion
|
|
1369
|
+
//#region src/errors/HieroServerError.d.ts
|
|
1370
|
+
/**
|
|
1371
|
+
* Thrown when the server returns an HTTP 5xx error.
|
|
1372
|
+
*
|
|
1373
|
+
* @public
|
|
1374
|
+
*/
|
|
1375
|
+
declare class HieroServerError extends HieroError {
|
|
1376
|
+
constructor(message: string, options?: {
|
|
1377
|
+
statusCode?: number;
|
|
1378
|
+
rawBody?: string;
|
|
1379
|
+
});
|
|
1380
|
+
}
|
|
1381
|
+
//#endregion
|
|
1382
|
+
//#region src/errors/HieroTimeoutError.d.ts
|
|
1383
|
+
/**
|
|
1384
|
+
* Thrown when a request exceeds the configured timeout (AbortController).
|
|
1385
|
+
*
|
|
1386
|
+
* @public
|
|
1387
|
+
*/
|
|
1388
|
+
declare class HieroTimeoutError extends HieroError {
|
|
1389
|
+
/** The timeout duration in milliseconds that was exceeded. */
|
|
1390
|
+
readonly timeoutMs: number;
|
|
1391
|
+
constructor(timeoutMs: number, options?: {
|
|
1392
|
+
cause?: unknown;
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
//#endregion
|
|
1396
|
+
//#region src/errors/HieroValidationError.d.ts
|
|
1397
|
+
/**
|
|
1398
|
+
* Thrown when the server returns HTTP 400 or 415, or when client-side
|
|
1399
|
+
* input validation fails before the request is sent.
|
|
1400
|
+
*
|
|
1401
|
+
* @public
|
|
1402
|
+
*/
|
|
1403
|
+
declare class HieroValidationError extends HieroError {
|
|
1404
|
+
/** The specific parameter that caused the validation error, if known. */
|
|
1405
|
+
readonly parameter?: string;
|
|
1406
|
+
constructor(message: string, options?: {
|
|
1407
|
+
statusCode?: number;
|
|
1408
|
+
parameter?: string;
|
|
1409
|
+
rawBody?: string;
|
|
1410
|
+
});
|
|
1411
|
+
toJSON(): Record<string, unknown>;
|
|
1412
|
+
}
|
|
1413
|
+
//#endregion
|
|
1414
|
+
//#region src/index.d.ts
|
|
1415
|
+
/**
|
|
1416
|
+
* @satianurag/hiero-mirror-client
|
|
1417
|
+
*
|
|
1418
|
+
* Standalone TypeScript client for the Hedera/Hiero Mirror Node REST API.
|
|
1419
|
+
*
|
|
1420
|
+
* @packageDocumentation
|
|
1421
|
+
*/
|
|
1422
|
+
declare const VERSION = "0.0.0";
|
|
1423
|
+
//#endregion
|
|
1424
|
+
export { AccountBalance, AccountDetail, AccountListParams, AccountNftsParams, AccountRewardsParams, AccountSummary, AccountTokensParams, AccountTransaction, Airdrop, AirdropParams, AllowanceCryptoParams, AllowanceNftParams, AllowanceTokenParams, BalanceEntry, BalanceListParams, Block, BlockListParams, ChunkInfo, ContractAction, ContractCallRequest, ContractCallResponse, ContractDetail, ContractListParams, ContractLog, ContractLogsParams, ContractResult, ContractResultsParams, ContractStateParams, ContractSummary, CryptoAllowance, CustomFees, ExchangeRate, ExchangeRateSet, Fee, FeeSchedule, FixedFee, FractionAmount, FractionalFee, FreezeStatus, Hex, HieroCapabilityError, HieroError, HieroKey, type HieroNetwork, HieroNetworkError, HieroNotFoundError, HieroParseError, HieroRateLimitError, HieroServerError, HieroTimeoutError, HieroValidationError, KycStatus, Logger, MirrorNodeClient, type MirrorNodeClientOptions, NetworkFeeParams, NetworkNode, NetworkNodeParams, NetworkStake, NetworkSupplyParams, NftAllowance, NftTransaction, NftTransfer, OperatorFilter, OperatorQuery, Order, Page, type PageExtractor, PaginationLinks, Paginator, type PaginatorOptions, RoyaltyFee, Schedule, ScheduleListParams, ScheduleSignature, ServiceEndpoint, StakingReward, StakingRewardTransfer, StateChange, Supply, TimestampRange, TokenAllowance, TokenBalance, TokenBalanceEntry, TokenBalanceParams, TokenBalanceResponse, TokenDetail, TokenListParams, TokenNft, TokenNftListParams, TokenRelationship, TokenSummary, TokenTransfer, TokenType, TopicInfo, TopicMessage, TopicMessageParams, TopicStream, type TopicStreamOptions, Transaction, TransactionGetParams, TransactionListParams, TransactionResult, Transfer, VERSION };
|
|
1425
|
+
//# sourceMappingURL=index.d.mts.map
|