@hergmes/sdk 0.0.0-stage → 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.
@@ -0,0 +1,536 @@
1
+ import { BlockHeader, Box, SignedTransaction, TokenAmount } from "@fleet-sdk/common";
2
+ /** The codes a REST error carries. A relay newer than this SDK may send others. */
3
+ type ErrorCode = "invalid_address" | "invalid_token_id" | "invalid_template" | "invalid_ids" | "invalid_box_id" | "invalid_broadcast" | "transaction_rejected" | "invalid_cursor" | "invalid_limit" | "key_not_allowed" | "unknown_token" | "box_not_found" | "cursor_expired" | "supply_too_large" | "too_many_boxes" | "unsupported_template" | "capacity_exceeded" | "not_ready" | "node_unavailable" | "box_unavailable" | "node_error" | "internal_error";
4
+ /** Why the node refused a tx, on `transaction_rejected`. */
5
+ type RejectReason = "unparseable" | "too_large" | "invalid" | "double_spend" | "fee_too_low" | "already_in_pool" | "pool_full" | "policy";
6
+ /**
7
+ * A response other than 2xx. `code` and `reason` are absent when the body is not the relay's
8
+ * error, as with an unknown route or a proxy's own page. `retryAfter` is in seconds, from the
9
+ * `Retry-After` header, and is set on every 503 the relay sends.
10
+ */
11
+ export declare class RelayError extends Error {
12
+ readonly name = "RelayError";
13
+ readonly status: number;
14
+ readonly code: ErrorCode | (string & {}) | undefined;
15
+ readonly reason: RejectReason | (string & {}) | undefined;
16
+ readonly retryAfter: number | undefined;
17
+ constructor(status: number, message: string, fields?: {
18
+ code?: string;
19
+ reason?: string;
20
+ retryAfter?: number;
21
+ });
22
+ /** Reads a failed response: the relay's `{ error, reason?, message }`, or anything else. */
23
+ static from(response: Response): Promise<RelayError>;
24
+ }
25
+ /**
26
+ * A key the relay tracks: an address (any encoding of its ErgoTree), a token id, or a template
27
+ * in hex: a constant-segregated ErgoTree's bytes after its constants, naming every instance of
28
+ * a contract whatever its constants.
29
+ */
30
+ type Key = {
31
+ address: string;
32
+ } | {
33
+ tokenId: string;
34
+ } | {
35
+ template: string;
36
+ };
37
+ /** A block: what a page is pinned to, and what a subscription resumes from. */
38
+ interface BlockRef {
39
+ height: number;
40
+ headerId: string;
41
+ }
42
+ /**
43
+ * The height a one-off read is as of. It has no `headerId`, so it can't be mistaken for a
44
+ * point to stream from: a balance or a spendable view has the mempool applied.
45
+ */
46
+ interface AsOfHeight {
47
+ height: number;
48
+ }
49
+ /** A box in a block, with the height of the block that included it. */
50
+ type ConfirmedBox$1 = Box<string> & {
51
+ inclusionHeight: number;
52
+ };
53
+ /** A box with the pool applied: a mempool output has no `inclusionHeight`. */
54
+ type PoolBox = Box<string> & {
55
+ inclusionHeight?: number;
56
+ };
57
+ /** A page of a key's unspent boxes, pinned to `asOf`; `nextCursor` is `null` on the last. */
58
+ interface BoxPage {
59
+ asOf: BlockRef;
60
+ items: ConfirmedBox$1[];
61
+ nextCursor: string | null;
62
+ }
63
+ /**
64
+ * A key's boxes with the mempool applied, confirmed ones first. `truncated` says the confirmed
65
+ * part was cut to the route's limit; `total` is the whole view's size either way.
66
+ */
67
+ interface Spendable {
68
+ asOf: AsOfHeight;
69
+ items: PoolBox[];
70
+ truncated: boolean;
71
+ total: number;
72
+ }
73
+ /** ERG and tokens, tokens in id order. Signed when it is a change. */
74
+ interface Assets$1 {
75
+ nanoErgs: string;
76
+ tokens: TokenAmount<string>[];
77
+ }
78
+ /**
79
+ * An address's balance: `confirmed` at the tip, and `pending`, the signed change the mempool
80
+ * makes to it. `used` is whether the address ever held a box.
81
+ */
82
+ interface Balance$1 {
83
+ asOf: AsOfHeight;
84
+ confirmed: Assets$1;
85
+ pending: Assets$1;
86
+ used: boolean;
87
+ }
88
+ /**
89
+ * A tx in an address's history, with its signed net change to the address. A pending tx has
90
+ * no `height` and no `timestamp`.
91
+ */
92
+ interface HistoryItem$1 {
93
+ txId: string;
94
+ height?: number;
95
+ timestamp?: number;
96
+ delta: Assets$1;
97
+ }
98
+ /** A page of an address's txs, newest first, pending on top; `nextCursor` `null` on the last. */
99
+ interface HistoryPage {
100
+ items: HistoryItem$1[];
101
+ nextCursor: string | null;
102
+ }
103
+ /** The last headers up to the tip, newest first, each the node's JSON; `asOf` is the tip. */
104
+ interface HeadersPage {
105
+ asOf: BlockRef;
106
+ items: BlockHeader[];
107
+ }
108
+ /**
109
+ * A token's metadata: `name`, `description` and `decimals` are what its minter wrote in the
110
+ * minting box (EIP-4), so they say nothing about who issued it.
111
+ */
112
+ interface TokenMetadata {
113
+ tokenId: string;
114
+ /** The first output of the minting tx holding the token; not the token id. */
115
+ mintingBoxId: string;
116
+ name: string;
117
+ description: string;
118
+ decimals: number;
119
+ /** Every unit minted. */
120
+ emission: string;
121
+ /**
122
+ * The minting box's EIP-4 asset type (R7). `nft` is an NFT of no registered subcategory.
123
+ * Absent if R7 names no registered type.
124
+ */
125
+ type?: AssetType;
126
+ /** The SHA-256 of its artwork (R8), in hex: only for a picture, audio, video or plain `nft`. */
127
+ artworkHash?: string;
128
+ /** A link to its artwork (R9), for the same types. */
129
+ artworkUrl?: string;
130
+ /** A link to a cover image, the second link of R9, as for audio. */
131
+ artworkCover?: string;
132
+ }
133
+ /** The EIP-4 asset types, by R7: `0101`, `0102`, `0103`, `0104`, `010f`, other `01`, `0201`. */
134
+ type AssetType = "nft-picture" | "nft-audio" | "nft-video" | "nft-artwork-collection" | "nft-file-attachments" | "nft" | "membership-threshold-signature";
135
+ /** The known tokens among those asked for, in their order; unknown ids are left out. */
136
+ interface TokenList {
137
+ items: TokenMetadata[];
138
+ }
139
+ /** The id of a tx the node took, sent or only checked. */
140
+ interface Submitted {
141
+ transactionId: string;
142
+ }
143
+ /**
144
+ * The relay's state. `tip` is `null` until it has applied a block; `ready` is whether it has
145
+ * started: it has reached the node's tip once and its configured keys have loaded. It stays
146
+ * true while the relay is behind, as it is for a moment after each block, so a load can
147
+ * still answer `not_ready` while the relay catches up. Comparing `tip` with the node's tells
148
+ * how far behind it is.
149
+ */
150
+ interface Status {
151
+ version: string;
152
+ network: "mainnet" | "testnet";
153
+ tip: BlockRef | null;
154
+ ready: boolean;
155
+ }
156
+ /** What a client sends. A subscribe with `from` follows the key's boxes; without, its balance. */
157
+ type ClientMessage = {
158
+ op: "subscribe";
159
+ key: Key;
160
+ from?: BlockRef;
161
+ id?: number;
162
+ } | {
163
+ op: "unsubscribe";
164
+ key: Key;
165
+ };
166
+ /** A box leaving a key's set, and the tx that spent it. */
167
+ interface Spend {
168
+ boxId: string;
169
+ txId: string;
170
+ }
171
+ /** A pending tx as it affects one key: its outputs to the key, and the key's boxes it spends. */
172
+ interface WirePendingTx {
173
+ txId: string;
174
+ created: PoolBox[];
175
+ spent: string[];
176
+ }
177
+ /** Why the relay asks a client to take a new snapshot. A relay newer than this SDK may send others. */
178
+ type ResyncReason = "outside_window" | "fork_beyond_window" | "not_tracked" | "slow_consumer" | "balance_mismatch" | (string & {});
179
+ /**
180
+ * A block that changed the key, applied, or orphaned and undone: `created` and `spent` are the
181
+ * key's boxes it adds and removes (for a rollback, the block's own sides swapped). Only blocks
182
+ * that change a key are sent to it, so `prev` is the key's change before this one (its load
183
+ * block before the first): a block chains to the client's last change, and a rollback undoes
184
+ * it, leaving `prev` as the last change.
185
+ */
186
+ interface Delta<T extends "block" | "rollback"> {
187
+ type: T;
188
+ key: Key;
189
+ height: number;
190
+ headerId: string;
191
+ prev: BlockRef;
192
+ created: ConfirmedBox$1[];
193
+ spent: Spend[];
194
+ }
195
+ /** What the relay sends. */
196
+ type ServerMessage = {
197
+ type: "tip";
198
+ height: number;
199
+ headerId: string;
200
+ } | {
201
+ type: "subscribed";
202
+ id?: number;
203
+ key: Key;
204
+ } | Delta<"block"> | Delta<"rollback"> |
205
+ /** `lastChange`, for a key tracked with its boxes, names the key's last change. */
206
+ {
207
+ type: "mempool";
208
+ key: Key;
209
+ lastChange?: BlockRef;
210
+ pending: WirePendingTx[];
211
+ } | {
212
+ type: "balance";
213
+ key: Key;
214
+ asOf: BlockRef;
215
+ lastChange?: BlockRef;
216
+ confirmed: Assets$1;
217
+ pending: Assets$1;
218
+ } | {
219
+ type: "resync_required";
220
+ id?: number;
221
+ key: Key;
222
+ reason: ResyncReason;
223
+ } | {
224
+ type: "rejected";
225
+ id?: number;
226
+ key: Key;
227
+ reason: string;
228
+ retryAfter?: number;
229
+ };
230
+ /** A box in a block, amounts as `bigint`. */
231
+ type ConfirmedBox = Box<bigint> & {
232
+ inclusionHeight: number;
233
+ };
234
+ /** ERG and tokens. Signed when it is a change. */
235
+ interface Assets {
236
+ nanoErgs: bigint;
237
+ tokens: ReadonlyMap<string, bigint>;
238
+ }
239
+ /** A pending tx as it affects the key: its outputs to the key, and the key's boxes it spends. */
240
+ interface PendingTx {
241
+ txId: string;
242
+ created: readonly Box<bigint>[];
243
+ spent: readonly string[];
244
+ }
245
+ /** An address's balance at `asOf`: confirmed, and the signed change the mempool makes to it. */
246
+ interface Balance {
247
+ asOf: BlockRef;
248
+ confirmed: Assets;
249
+ pending: Assets;
250
+ }
251
+ /**
252
+ * A key's boxes, and the mempool's effect on them. The boxes are the key's at every block from
253
+ * `lastChange`, the block of its last change (or of its load, before any), to the relay's tip
254
+ * (`Relay.tip`), which is the height to show.
255
+ */
256
+ interface BoxView {
257
+ lastChange: BlockRef;
258
+ /** In `(inclusionHeight, boxId)` order. */
259
+ confirmed: readonly ConfirmedBox[];
260
+ /** The txs the overlay holds, parents before children. */
261
+ pending: readonly PendingTx[];
262
+ /**
263
+ * What a tx can spend now: the confirmed boxes and pending outputs no pending tx spends,
264
+ * confirmed first. For an address its total is the balance's `confirmed + pending`; for any
265
+ * key, `utxoSum` from `@fleet-sdk/common` totals it.
266
+ */
267
+ spendable: readonly Box<bigint>[];
268
+ }
269
+ /**
270
+ * - `snapshot`: reading the key's boxes; `catching_up`: subscribed, replaying to the tip;
271
+ * `live`: following the chain.
272
+ * - `waiting`: the relay refused the key for now, or the snapshot failed for now (a network
273
+ * error, a 5xx); `error` says why, and its `retryAfter` when it starts again.
274
+ * - `rejected`: the relay refused the key, or the snapshot failed, for good; `error` says why.
275
+ * A later subscribe to the key tries again.
276
+ * - `disconnected`: the socket closed; the subscription resumes once it opens again, unless
277
+ * the hold or the relay was closed.
278
+ */
279
+ type Phase = "snapshot" | "catching_up" | "live" | "waiting" | "rejected" | "disconnected";
280
+ interface SubscriptionError {
281
+ code: string;
282
+ message: string;
283
+ /** The HTTP status, when a snapshot read failed with one. */
284
+ status?: number;
285
+ /** Seconds until the key starts again, when the failure is for now. */
286
+ retryAfter?: number;
287
+ }
288
+ /**
289
+ * A subscription's state, replaced whole on every change. `boxes` and `balance` keep their
290
+ * last live values while the subscription recovers; `phase` says whether they are current.
291
+ */
292
+ interface SubscriptionState {
293
+ key: Key;
294
+ phase: Phase;
295
+ /** A box subscription's boxes, once it was live. */
296
+ boxes: BoxView | undefined;
297
+ /** An address's latest balance. */
298
+ balance: Balance | undefined;
299
+ error: SubscriptionError | undefined;
300
+ }
301
+ /**
302
+ * Why the machine took a new snapshot, for diagnostics: the relay asked (`resync_required`, or
303
+ * an expired cursor), or the SDK found a message its view can't take, which only a lost or
304
+ * corrupted message, or a bug, causes.
305
+ */
306
+ interface Resync {
307
+ key: Key;
308
+ by: "relay" | "sdk";
309
+ reason: string;
310
+ }
311
+ interface RestOptions {
312
+ /**
313
+ * Attempts in all for a request answered `503`, waiting `Retry-After` between them; 3 unless
314
+ * set. `capacity_exceeded` is never retried.
315
+ */
316
+ maxAttempts?: number;
317
+ /** The `fetch` to use; the global one by default. */
318
+ fetch?: typeof fetch;
319
+ }
320
+ interface RequestOptions {
321
+ /** Cancels the request, and any wait before a retry. */
322
+ signal?: AbortSignal;
323
+ }
324
+ interface PageOptions extends RequestOptions {
325
+ /** The previous page's `nextCursor`; the first page without it. */
326
+ cursor?: string;
327
+ /** Items per page; the relay's default without it. */
328
+ limit?: number;
329
+ }
330
+ interface HeadersOptions extends RequestOptions {
331
+ /** How many headers, 1 to 10; 10 without it. */
332
+ limit?: number;
333
+ }
334
+ interface SubmitOptions extends RequestOptions {
335
+ /** `false` only checks the tx, with no broadcast. */
336
+ broadcast?: boolean;
337
+ }
338
+ /**
339
+ * The relay's REST API. Each method answers the route's JSON as it came, and throws a
340
+ * {@link RelayError} for any other status. A `503` is retried after its `Retry-After`, however
341
+ * long, up to `maxAttempts` in all; the last error is thrown. `capacity_exceeded` is not: it
342
+ * frees up only as keys go idle, a minute at the soonest, too long to hold a call.
343
+ */
344
+ export declare class RestClient {
345
+ #private;
346
+ /** `url` is the relay's root, under which `/v1` is served; it may have a path. */
347
+ constructor(url: string | URL, options?: RestOptions);
348
+ /** The root the routes are resolved against, its path ending in `/`. */
349
+ get root(): URL;
350
+ /** The relay's version, network, tip, and whether it is ready. */
351
+ status(options?: RequestOptions): Promise<Status>;
352
+ /** A page of a key's unspent boxes, in `(inclusionHeight, boxId)` order. */
353
+ boxes(key: Key, options?: PageOptions): Promise<BoxPage>;
354
+ /**
355
+ * What a tx can spend now from an address, in one response: its confirmed boxes and the
356
+ * pool's outputs to it, less what pool txs spend. `boxes.spendable` on a subscription keeps
357
+ * it live.
358
+ */
359
+ spendable(address: string, options?: RequestOptions): Promise<Spendable>;
360
+ /** An address's balance, confirmed and pending. */
361
+ balance(address: string, options?: RequestOptions): Promise<Balance$1>;
362
+ /** A page of an address's txs, newest first, pending on top. */
363
+ history(address: string, options?: PageOptions): Promise<HistoryPage>;
364
+ /** The last headers up to the relay's tip, newest first. */
365
+ headers(options?: HeadersOptions): Promise<HeadersPage>;
366
+ /** A box a tx can spend now: confirmed, or a mempool output. */
367
+ box(boxId: string, options?: RequestOptions): Promise<PoolBox>;
368
+ /**
369
+ * The metadata of the tokens among `ids` the relay's node knows, in their order and each
370
+ * once in any case; unknown ids are left out. Over 100 ids are asked 100 per request, one
371
+ * request after another, and answered as one list. No ids make no request.
372
+ */
373
+ tokens(ids: readonly string[], options?: RequestOptions): Promise<TokenList>;
374
+ /**
375
+ * Sends a signed tx, serialized in hex or as Fleet's JSON, or with `broadcast: false` only
376
+ * checks it. The JSON is serialized here, since the relay takes the bytes only.
377
+ */
378
+ submitTransaction(tx: string | SignedTransaction, options?: SubmitOptions): Promise<Submitted>;
379
+ }
380
+ /**
381
+ * A tx in an address's history: its signed net change for the address, and when it was
382
+ * included. A pending tx has no `height` and no `timestamp`.
383
+ */
384
+ interface HistoryItem {
385
+ txId: string;
386
+ height?: number;
387
+ /** The including block's time, in milliseconds. */
388
+ timestamp?: number;
389
+ delta: Assets;
390
+ }
391
+ /** A history's state, replaced whole on every change. */
392
+ interface HistoryState {
393
+ address: string;
394
+ /** Newest first, pending txs on top: the first page and the older pages read since. */
395
+ items: readonly HistoryItem[];
396
+ /** `items` reach the address's first tx: {@link TxHistory.more} has nothing left to read. */
397
+ end: boolean;
398
+ /** A read is in flight. */
399
+ loading: boolean;
400
+ /**
401
+ * Why the last read failed, until one succeeds. A first page that failed for now has a
402
+ * `retryAfter`, when it is read again.
403
+ */
404
+ error: SubscriptionError | undefined;
405
+ /**
406
+ * How many times the list was read again from the first page with its older pages
407
+ * dropped: an older page's cursor expired (a reorg reached it), or a refreshed first page
408
+ * no longer joined the older pages (a page or more of txs arrived since it was last read,
409
+ * or a reorg). An app that keeps a scroll position compares it with the last it saw. A
410
+ * count, not a flag, so it is not lost when changes come together.
411
+ */
412
+ resets: number;
413
+ }
414
+ interface HistoryOptions {
415
+ /**
416
+ * Reads the first page again whenever the address's balance changes, which takes a
417
+ * balance-only hold on the address as {@link Relay.subscribe} does, sharing the key's
418
+ * subscription if the app has one. Older pages are not checked again. A tx that changes
419
+ * neither the confirmed nor the pending balance (one that gives back exactly what it took,
420
+ * its fee paid by another address) shows only at the next change. Defaults to `false`.
421
+ */
422
+ refresh?: boolean;
423
+ /** Txs per page, at most 100; the relay's default, 25, without it. */
424
+ limit?: number;
425
+ }
426
+ /** One app's view of an address's history. */
427
+ interface TxHistory {
428
+ readonly address: string;
429
+ /** The current state, replaced whole on every change. */
430
+ readonly state: HistoryState;
431
+ /**
432
+ * Reads the next older page and appends it, or with no first page yet, reads that. Does
433
+ * nothing at the end, or while a read is in flight: it then answers that read. Answers when
434
+ * the read is done; a failure is in `state.error`, and the next call reads on from the last
435
+ * cursor the failed one reached.
436
+ */
437
+ more(): Promise<void>;
438
+ /**
439
+ * Calls `listener` with the current state at once, then with the latest state after changes,
440
+ * once for all the changes made together (on a `setTimeout(0)`), never twice with the same
441
+ * state. Answers a function that removes the listener. The contract of a Svelte store, so
442
+ * the handle is one (`$history`).
443
+ */
444
+ subscribe(listener: (state: HistoryState) => void): () => void;
445
+ /** Stops reading and releases the address's hold, if `refresh` took one. */
446
+ close(): void;
447
+ }
448
+ interface RelayOptions extends RestOptions {
449
+ /** Boxes per snapshot page, at most 1000, the relay's limit and one node call. */
450
+ pageSize?: number;
451
+ /** The `WebSocket` to use; the global one by default. */
452
+ WebSocket?: typeof WebSocket;
453
+ /** Sees every message the relay sends, as text, and every new snapshot taken. For logging. */
454
+ debug?: (event: {
455
+ frame: string;
456
+ } | {
457
+ resync: Resync;
458
+ }) => void;
459
+ /**
460
+ * The waits before reconnecting the socket and before retrying a key that failed for now
461
+ * with no `retryAfter`: each drawn from 0 to a bound that starts at `firstMs` and doubles,
462
+ * up to `maxMs`, so clients a relay restart cut off together don't come back together, at
463
+ * the first try or any later one. Both start over once a key is live again. Defaults to 1 s
464
+ * and 30 s.
465
+ */
466
+ backoff?: {
467
+ firstMs?: number;
468
+ maxMs?: number;
469
+ };
470
+ }
471
+ /** How to follow an address. Token and template keys have no balance, so they always follow boxes. */
472
+ interface SubscribeOptions {
473
+ /**
474
+ * Follow the key's boxes: its confirmed set, the mempool's overlay and what is spendable
475
+ * now. `false` follows only the balance, which needs no snapshot. Defaults to `true`.
476
+ */
477
+ boxes?: boolean;
478
+ }
479
+ /** One app's hold on a key. Several on one key share its state. */
480
+ interface Subscription {
481
+ readonly key: Key;
482
+ /**
483
+ * The key's current state, replaced whole on every change, as each message arrives.
484
+ *
485
+ * The relay sends a block's effect on a key as separate messages: the `block`, then the
486
+ * `mempool` and the `balance` if they changed, and nothing marks the last. So for a moment a
487
+ * live state can pair a new block with the previous overlay and balance: a pending tx the
488
+ * block replaced with another spender still shows its outputs as spendable, and `spendable`
489
+ * disagrees with `balance`. The messages that follow correct it.
490
+ */
491
+ readonly state: SubscriptionState;
492
+ /**
493
+ * Calls `listener` with the current state at once, then with the latest state after changes,
494
+ * once for all the messages that arrived together (on a `setTimeout(0)`), never twice with
495
+ * the same state. Batching hides most of those moments and spares a render per message in a
496
+ * burst. A browser throttles timers in a hidden tab, so a call can come up to about a second
497
+ * late there; `state` is always current. Answers a function that removes the listener. The
498
+ * contract of a Svelte store, so the handle is one (`$sub`).
499
+ */
500
+ subscribe(listener: (state: SubscriptionState) => void): () => void;
501
+ /** Ends this hold; the key is unsubscribed once no hold is left. */
502
+ close(): void;
503
+ }
504
+ /**
505
+ * A relay: its REST API, its tip, and subscriptions to keys over one WebSocket, opened on the
506
+ * first subscribe. A key is subscribed once however many holds it has. When the socket closes,
507
+ * for whatever reason, it opens again after a backoff while any key is held, and each key
508
+ * resumes from the block it had reached.
509
+ */
510
+ export declare class Relay {
511
+ #private;
512
+ readonly rest: RestClient;
513
+ /** `url` is the relay's root, under which `/v1` is served; it may have a path. */
514
+ constructor(url: string | URL, options?: RelayOptions);
515
+ /** The relay's tip, the block every box and balance it serves is at, once known. */
516
+ get tip(): BlockRef | undefined;
517
+ /** Calls `listener` on every new tip; answers a function that removes it. */
518
+ onTip(listener: (tip: BlockRef) => void): () => void;
519
+ /** Holds `key`. Only an address has a choice in what to follow, so only it takes options. */
520
+ subscribe(key: {
521
+ address: string;
522
+ }, options?: SubscribeOptions): Subscription;
523
+ subscribe(key: Key): Subscription;
524
+ /**
525
+ * An address's tx history, newest first, pending txs on top: its first page is read now,
526
+ * and older pages as the app asks. See {@link HistoryOptions.refresh} to keep the first
527
+ * page current.
528
+ */
529
+ history(address: string, options?: HistoryOptions): TxHistory;
530
+ /**
531
+ * Closes the socket, ends every subscription and stops every history. A later subscribe
532
+ * opens a new socket.
533
+ */
534
+ close(): void;
535
+ }
536
+ export type { AsOfHeight, AssetType, Assets, Balance, BlockRef, BoxPage, BoxView, ClientMessage, ConfirmedBox, Delta, ErrorCode, HeadersOptions, HeadersPage, HistoryItem, HistoryOptions, HistoryPage, HistoryState, Key, PageOptions, PendingTx, Phase, PoolBox, RejectReason, RelayOptions, RequestOptions, RestOptions, Resync, ResyncReason, ServerMessage, Spend, Spendable, Status, SubmitOptions, Submitted, SubscribeOptions, Subscription, SubscriptionError, SubscriptionState, TokenList, TokenMetadata, TxHistory, Assets$1 as WireAssets, Balance$1 as WireBalance, ConfirmedBox$1 as WireConfirmedBox, HistoryItem$1 as WireHistoryItem, WirePendingTx };