@toon-protocol/client 2.1.1 → 3.0.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/dist/anon-daemon-ZFBL6EYA.js +230 -0
- package/dist/anon-daemon-ZFBL6EYA.js.map +1 -0
- package/dist/chunk-32MD3CXE.js +27 -0
- package/dist/chunk-32MD3CXE.js.map +1 -0
- package/dist/{chunk-DD7TJKP6.js → chunk-4I3JQ7KA.js} +2 -2
- package/dist/{chunk-J6JVCKNV.js → chunk-7MPONJW5.js} +39 -1
- package/dist/chunk-7MPONJW5.js.map +1 -0
- package/dist/{chunk-ENNSPYP4.js → chunk-GDWZ736I.js} +289 -143
- package/dist/chunk-GDWZ736I.js.map +1 -0
- package/dist/chunk-GOLBDUNV.js +143 -0
- package/dist/chunk-GOLBDUNV.js.map +1 -0
- package/dist/cli/main.js +63 -11
- package/dist/cli/main.js.map +1 -1
- package/dist/{client-ACUZCR5A.js → client-TEP26FMO.js} +4 -3
- package/dist/index.d.ts +328 -126
- package/dist/index.js +25 -7
- package/dist/index.js.map +1 -1
- package/dist/socks-CCMHMB35.js +15 -0
- package/dist/socks-CCMHMB35.js.map +1 -0
- package/dist/transport/hidden-service.d.ts +116 -0
- package/dist/transport/hidden-service.js +15 -0
- package/dist/transport/hidden-service.js.map +1 -0
- package/package.json +7 -1
- package/dist/chunk-ENNSPYP4.js.map +0 -1
- package/dist/chunk-J6JVCKNV.js.map +0 -1
- /package/dist/{chunk-DD7TJKP6.js.map → chunk-4I3JQ7KA.js.map} +0 -0
- /package/dist/{client-ACUZCR5A.js.map → client-TEP26FMO.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { PrivateKeyAccount } from 'viem/accounts';
|
|
2
|
+
export { HiddenServiceTransport, HiddenServiceTransportOptions, validateSocks5hUrl } from './transport/hidden-service.js';
|
|
3
|
+
import { http } from 'viem';
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* The on-chain channel port: what the client needs a chain to be able to do,
|
|
@@ -235,16 +237,30 @@ interface ILPPreparePacket {
|
|
|
235
237
|
type: typeof ILPPacketType.PREPARE;
|
|
236
238
|
amount: bigint;
|
|
237
239
|
destination: string;
|
|
238
|
-
|
|
240
|
+
/**
|
|
241
|
+
* Whether this PREPARE declares itself a bootstrap/greeting probe rather
|
|
242
|
+
* than a real payment attempt (connector ADR 0069, issue #1269). One byte
|
|
243
|
+
* on the wire, where a 32-byte `executionCondition` used to sit.
|
|
244
|
+
*
|
|
245
|
+
* The connector's client edge consults it only when no claim rides with
|
|
246
|
+
* the packet: an unclaimed `greeting` PREPARE is never routed, never
|
|
247
|
+
* priced and never fulfilled — it is answered with the x402 terms instead
|
|
248
|
+
* (`client-edge-spec.md` §1.4). A claim header suppresses the greeting
|
|
249
|
+
* unconditionally, so setting this on a paid packet cannot make it free.
|
|
250
|
+
*/
|
|
251
|
+
greeting: boolean;
|
|
239
252
|
expiresAt: Date;
|
|
240
253
|
data: Uint8Array;
|
|
241
254
|
}
|
|
242
255
|
interface ILPFulfillPacket {
|
|
243
256
|
type: typeof ILPPacketType.FULFILL;
|
|
244
257
|
/**
|
|
245
|
-
* The 32-byte fulfillment preimage from the wire
|
|
246
|
-
*
|
|
247
|
-
* the
|
|
258
|
+
* The 32-byte fulfillment preimage from the wire — the one thing ADR 0069
|
|
259
|
+
* left in the return direction untouched. A termination derives it from
|
|
260
|
+
* the shared secret sealed inside the request (ADR 0019), so a sender that
|
|
261
|
+
* kept that secret checks a delivery end to end by comparing these bytes
|
|
262
|
+
* against its own `deriveFulfillment(sharedSecret)`. There is no condition
|
|
263
|
+
* on the wire to check it against any more.
|
|
248
264
|
*/
|
|
249
265
|
fulfillment: Uint8Array;
|
|
250
266
|
data: Uint8Array;
|
|
@@ -258,6 +274,12 @@ interface ILPRejectPacket {
|
|
|
258
274
|
data: Uint8Array;
|
|
259
275
|
}
|
|
260
276
|
type ILPResponsePacket = ILPFulfillPacket | ILPRejectPacket;
|
|
277
|
+
/**
|
|
278
|
+
* Encode a PREPARE. The `greeting` flag is a single `0x00`/`0x01` octet
|
|
279
|
+
* between `expiresAt` and `destination` — `connector-domain::Prepare::encode`
|
|
280
|
+
* writes `u8::from(self.greeting)` there, and writes nothing else in its
|
|
281
|
+
* place (connector ADR 0069).
|
|
282
|
+
*/
|
|
261
283
|
declare function serializeIlpPrepare(packet: ILPPreparePacket): Uint8Array;
|
|
262
284
|
/**
|
|
263
285
|
* Decode an inbound PREPARE — the server-role mirror of {@link serializeIlpPrepare}
|
|
@@ -298,27 +320,28 @@ declare function serializeBtpMessage(message: BTPMessage): Uint8Array;
|
|
|
298
320
|
declare function parseBtpMessage(buf: Uint8Array): BTPMessage;
|
|
299
321
|
|
|
300
322
|
/**
|
|
301
|
-
* Shared sender-side plumbing for
|
|
302
|
-
*
|
|
303
|
-
* connector#309; spec: toon-meta `docs/rolling-swap.md` §3).
|
|
323
|
+
* Shared sender-side plumbing for both ILP carriages: how a PREPARE's
|
|
324
|
+
* non-routing fields are resolved, and how the answer is read.
|
|
304
325
|
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
* two paths cannot drift:
|
|
326
|
+
* Connector ADR 0069 (issue #1269) removed the execution condition from the
|
|
327
|
+
* wire. Two things changed here and nothing else did:
|
|
308
328
|
*
|
|
309
|
-
* -
|
|
310
|
-
*
|
|
311
|
-
* -
|
|
312
|
-
* the
|
|
313
|
-
*
|
|
314
|
-
*
|
|
329
|
+
* - the PREPARE carries a one-byte `greeting` flag where a 32-byte
|
|
330
|
+
* condition used to sit — see {@link IlpSendParams.greeting};
|
|
331
|
+
* - the sender's delivery check compares a FULFILL's preimage directly
|
|
332
|
+
* against the fulfilment its own sealed secret derives
|
|
333
|
+
* ({@link IlpSendParams.expectedFulfillment}), rather than hashing it back
|
|
334
|
+
* to a condition that no longer exists.
|
|
335
|
+
*
|
|
336
|
+
* Both transports (HTTP `POST /ilp` and BTP) take the SAME params and map
|
|
337
|
+
* FULFILL/REJECT through the SAME verifier, so the two paths cannot drift.
|
|
338
|
+
* Omitting `expectedFulfillment` keeps a FULFILL unverified — the right shape
|
|
339
|
+
* for a caller that never sealed anything and so has nothing to compare
|
|
340
|
+
* against.
|
|
315
341
|
*/
|
|
316
342
|
|
|
317
343
|
/**
|
|
318
|
-
* Send parameters accepted by both ILP transports.
|
|
319
|
-
* `@toon-protocol/core` `IlpClient` param shape with the sender-chosen
|
|
320
|
-
* condition and an explicit expiry — plain `IlpClient` callers keep working
|
|
321
|
-
* unchanged (both extras are optional; omitting them is the legacy path).
|
|
344
|
+
* Send parameters accepted by both ILP transports.
|
|
322
345
|
*/
|
|
323
346
|
interface IlpSendParams {
|
|
324
347
|
destination: string;
|
|
@@ -328,49 +351,81 @@ interface IlpSendParams {
|
|
|
328
351
|
/** Transport timeout in ms; also the default expiry window. */
|
|
329
352
|
timeout?: number;
|
|
330
353
|
/**
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
354
|
+
* Declare this PREPARE a bootstrap/greeting probe (connector ADR 0069).
|
|
355
|
+
*
|
|
356
|
+
* Defaults to `false`, which is what every real send wants: a greeting is
|
|
357
|
+
* never routed, never priced and never fulfilled — the connector answers
|
|
358
|
+
* the x402 terms instead. Set it only to ASK for those terms without a
|
|
359
|
+
* route match, the shape `ConnectorEdgeClient` uses for bootstrap. A claim
|
|
360
|
+
* riding with the packet suppresses the greeting either way, so this can
|
|
361
|
+
* never turn a paid packet into a free one.
|
|
362
|
+
*/
|
|
363
|
+
greeting?: boolean;
|
|
364
|
+
/**
|
|
365
|
+
* The 32 bytes an honest FULFILL must carry: `deriveFulfillment(sharedSecret)`
|
|
366
|
+
* for the secret sealed inside this packet's gift wrap (ADR 0019), which
|
|
367
|
+
* `sealExchange` returns as `SealedExchange.fulfillment`.
|
|
334
368
|
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
* {@link resolveExecutionCondition} before touching the bytes.
|
|
369
|
+
* Present = verify; absent = accept a FULFILL unchecked, which is the only
|
|
370
|
+
* honest option for a caller that sealed nothing and therefore knows no
|
|
371
|
+
* secret. This is the sender's own end-to-end check and the ONLY fulfilment
|
|
372
|
+
* check left anywhere on the path (ADR 0069) — no hop performs one.
|
|
373
|
+
*
|
|
374
|
+
* Accepts the raw 32 bytes or their base64 encoding; normalize with
|
|
375
|
+
* {@link resolveExpectedFulfillment} before touching the bytes.
|
|
343
376
|
*/
|
|
344
|
-
|
|
377
|
+
expectedFulfillment?: Uint8Array | string;
|
|
345
378
|
/**
|
|
346
|
-
* Explicit PREPARE `expiresAt
|
|
347
|
-
*
|
|
348
|
-
* `@toon-protocol/core` ≥2.1.0's `IlpClient` passes the string form.
|
|
379
|
+
* Explicit PREPARE `expiresAt`. Defaults to `now + timeout` plus
|
|
380
|
+
* {@link PACKET_EXPIRY_HEADROOM_MS}. Accepts a `Date` or an ISO 8601 string.
|
|
349
381
|
*/
|
|
350
382
|
expiresAt?: Date | string;
|
|
351
383
|
}
|
|
352
384
|
/**
|
|
353
|
-
* Normalize an `IlpSendParams.
|
|
385
|
+
* Normalize an `IlpSendParams.expectedFulfillment` to raw bytes.
|
|
354
386
|
*
|
|
355
387
|
* The two representations are the two callers: this package's own senders
|
|
356
|
-
* pass the bytes
|
|
357
|
-
*
|
|
358
|
-
* string that port declares. Both mean the same 32 bytes.
|
|
388
|
+
* pass the bytes `sealExchange` derived, while a caller typed against the
|
|
389
|
+
* JSON-shaped port passes their base64 spelling. Both mean the same 32 bytes.
|
|
359
390
|
*
|
|
360
|
-
* Length is NOT validated here — that stays with `
|
|
361
|
-
* the transports, so a malformed
|
|
362
|
-
*
|
|
391
|
+
* Length is NOT validated here — that stays with `assertValidFulfillment` at
|
|
392
|
+
* the transports, so a malformed value fails with the same message on both
|
|
393
|
+
* paths regardless of which representation it arrived in.
|
|
394
|
+
*/
|
|
395
|
+
declare function resolveExpectedFulfillment(fulfillment: Uint8Array | string | undefined): Uint8Array | undefined;
|
|
396
|
+
/**
|
|
397
|
+
* How much longer a packet lives on the wire than the sender is prepared to wait.
|
|
398
|
+
*
|
|
399
|
+
* The packet's expiry and the sender's own abort used to be the same number, and
|
|
400
|
+
* on clearnet nothing showed: both are far longer than a round trip. They are not
|
|
401
|
+
* the same thing, though, and over a slow carriage the difference is money. If a
|
|
402
|
+
* PREPARE expires at the instant the client gives up, then a late answer arrives
|
|
403
|
+
* to a client that has already stopped listening, having *already presented a
|
|
404
|
+
* signed claim* — the packet is paid for and the verdict is lost. Worse, the
|
|
405
|
+
* expiry is stamped when the packet is built, which over a hidden service is
|
|
406
|
+
* before the circuit even exists, so seconds of it are spent before the connector
|
|
407
|
+
* has seen a byte.
|
|
408
|
+
*
|
|
409
|
+
* Giving the wire the longer deadline means the client is always the first of the
|
|
410
|
+
* two to give up: whatever the client stops waiting for is still, briefly, a live
|
|
411
|
+
* packet the connector can answer and this client can reconcile — never one that
|
|
412
|
+
* expired underneath a claim.
|
|
413
|
+
*/
|
|
414
|
+
declare const PACKET_EXPIRY_HEADROOM_MS = 15000;
|
|
415
|
+
/**
|
|
416
|
+
* Normalize an `IlpSendParams.expiresAt` to a `Date`.
|
|
417
|
+
*
|
|
418
|
+
* Default: now + timeout + {@link PACKET_EXPIRY_HEADROOM_MS}. An explicit
|
|
419
|
+
* `expiresAt` is honoured exactly as given — a caller who names a deadline has
|
|
420
|
+
* one, and it is not this function's business to extend it.
|
|
363
421
|
*/
|
|
364
|
-
declare function resolveExecutionCondition(condition: Uint8Array | string | undefined): Uint8Array | undefined;
|
|
365
|
-
/** Normalize an `IlpSendParams.expiresAt` to a `Date` (default: now + timeout). */
|
|
366
422
|
declare function resolveExpiresAt(expiresAt: Date | string | undefined, timeoutMs: number): Date;
|
|
367
423
|
/**
|
|
368
|
-
* `IlpSendResult` plus the FULFILL preimage when
|
|
369
|
-
*
|
|
370
|
-
* objects stay byte-identical.
|
|
424
|
+
* `IlpSendResult` plus the FULFILL preimage, populated only when the sender
|
|
425
|
+
* knew what to expect and the bytes matched.
|
|
371
426
|
*/
|
|
372
427
|
interface IlpSendResultWithFulfillment extends IlpSendResult {
|
|
373
|
-
/** Base64 32-byte fulfillment preimage (verified
|
|
428
|
+
/** Base64 32-byte fulfillment preimage (verified against the expected one). */
|
|
374
429
|
fulfillment?: string;
|
|
375
430
|
}
|
|
376
431
|
/** ILP code used for a client-side fulfillment-verification failure. */
|
|
@@ -379,16 +434,20 @@ declare const FULFILLMENT_MISMATCH_CODE = "F99";
|
|
|
379
434
|
declare const FULFILLMENT_MISMATCH_MESSAGE: string;
|
|
380
435
|
/**
|
|
381
436
|
* Map a parsed ILP response packet to an `IlpSendResult`, enforcing the
|
|
382
|
-
* sender-
|
|
437
|
+
* sender's end-to-end delivery check when it knows what to expect.
|
|
383
438
|
*
|
|
384
|
-
* Verification is fail-closed: when `
|
|
385
|
-
* whose
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
*
|
|
439
|
+
* Verification is fail-closed: when `expectedFulfillment` is given, a FULFILL
|
|
440
|
+
* whose preimage is absent, not exactly 32 bytes, or simply different yields
|
|
441
|
+
* `accepted: false` (code F99). The result shape — not a thrown error — is
|
|
442
|
+
* deliberate: transports only retry thrown `NetworkError`s, so a forged or
|
|
443
|
+
* wrong FULFILL is never retried, because re-sending would re-spend the
|
|
444
|
+
* attached claim.
|
|
445
|
+
*
|
|
446
|
+
* Since ADR 0069 this is the only fulfilment check anywhere on the path. A
|
|
447
|
+
* candidate FULFILL rides home through every hop unexamined, which is exactly
|
|
448
|
+
* why the sender must still make it.
|
|
390
449
|
*/
|
|
391
|
-
declare function mapIlpResponse(packet: ILPResponsePacket,
|
|
450
|
+
declare function mapIlpResponse(packet: ILPResponsePacket, expectedFulfillment?: Uint8Array): IlpSendResultWithFulfillment;
|
|
392
451
|
|
|
393
452
|
/**
|
|
394
453
|
* The ILP transport port: what a carriage must be able to do, and what it
|
|
@@ -1697,12 +1756,16 @@ declare function readEvmTokenBalance(opts: {
|
|
|
1697
1756
|
chainKey: string;
|
|
1698
1757
|
tokenAddress: string;
|
|
1699
1758
|
owner: string;
|
|
1759
|
+
/** Send this read through the hidden-service proxy, when there is one (ADR 0002). */
|
|
1760
|
+
rpcDispatcher?: unknown;
|
|
1700
1761
|
}): Promise<WalletBalance>;
|
|
1701
1762
|
/** Read the native ETH balance (wei) for `owner` via `eth_getBalance`. */
|
|
1702
1763
|
declare function readEvmNativeBalance(opts: {
|
|
1703
1764
|
rpcUrl: string;
|
|
1704
1765
|
chainKey: string;
|
|
1705
1766
|
owner: string;
|
|
1767
|
+
/** Send this read through the hidden-service proxy, when there is one (ADR 0002). */
|
|
1768
|
+
rpcDispatcher?: unknown;
|
|
1706
1769
|
}): Promise<WalletTokenAmount>;
|
|
1707
1770
|
/** Read the native SOL balance (lamports) for `owner` via the `getBalance` RPC. */
|
|
1708
1771
|
declare function readSolanaNativeBalance(opts: {
|
|
@@ -1729,6 +1792,12 @@ interface WalletBalanceSources {
|
|
|
1729
1792
|
rpcUrl: string;
|
|
1730
1793
|
owner: string;
|
|
1731
1794
|
tokenAddress?: string;
|
|
1795
|
+
/**
|
|
1796
|
+
* Send the EVM reads through the hidden-service proxy (ADR 0002). The Solana
|
|
1797
|
+
* reads need no equivalent: they go through {@link WalletBalanceSources.fetchImpl},
|
|
1798
|
+
* which is already the proxied `fetch` on a hidden-service client.
|
|
1799
|
+
*/
|
|
1800
|
+
rpcDispatcher?: unknown;
|
|
1732
1801
|
};
|
|
1733
1802
|
solana?: {
|
|
1734
1803
|
chainKey?: string;
|
|
@@ -1987,9 +2056,13 @@ interface EvmTransferConfig {
|
|
|
1987
2056
|
signer: EvmSigner;
|
|
1988
2057
|
/** ERC-20 settlement-token address. Required only for `asset: 'token'`. */
|
|
1989
2058
|
tokenAddress?: string;
|
|
2059
|
+
/** Send this transfer's RPC through the hidden-service proxy (ADR 0002). */
|
|
2060
|
+
rpcDispatcher?: unknown;
|
|
1990
2061
|
}
|
|
1991
2062
|
interface SolanaTransferConfig {
|
|
1992
2063
|
rpcUrl: string;
|
|
2064
|
+
/** `fetch` for Solana JSON-RPC — the proxied one on a hidden-service client (ADR 0002). */
|
|
2065
|
+
rpcFetch?: typeof fetch;
|
|
1993
2066
|
/** Ed25519 signing seed (32 bytes) or a 64-byte seed||pubkey keypair. */
|
|
1994
2067
|
keypair: Uint8Array;
|
|
1995
2068
|
/** SPL settlement-token mint. Required only for `asset: 'token'`. */
|
|
@@ -2166,6 +2239,26 @@ interface ToonClientConfig {
|
|
|
2166
2239
|
};
|
|
2167
2240
|
/** Faucet base URL for {@link WalletFacade.faucet}. Devnet only. */
|
|
2168
2241
|
faucetUrl?: string;
|
|
2242
|
+
/**
|
|
2243
|
+
* The `socks5h://` proxy through which a hidden-service connector is reached —
|
|
2244
|
+
* a running Anyone Protocol `anon` daemon's SOCKS port, e.g.
|
|
2245
|
+
* `socks5h://127.0.0.1:9050`.
|
|
2246
|
+
*
|
|
2247
|
+
* Required when `connector` is a `.anyone` address, and rejected as pointless
|
|
2248
|
+
* misdirection when it is not. This library never starts a daemon itself; the
|
|
2249
|
+
* `toon` CLI will start one for you (ADR 0001).
|
|
2250
|
+
*
|
|
2251
|
+
* Node only: a browser cannot dial a hidden service by any route.
|
|
2252
|
+
*/
|
|
2253
|
+
socksProxy?: string;
|
|
2254
|
+
/**
|
|
2255
|
+
* Send chain RPC through `socksProxy` as well as the packets. Default `true`.
|
|
2256
|
+
*
|
|
2257
|
+
* Set `false` only when the RPC endpoint is already private — your own node on
|
|
2258
|
+
* loopback — where the extra hop buys nothing and costs latency. Leaving it on
|
|
2259
|
+
* for a public provider is the point: see ADR 0002.
|
|
2260
|
+
*/
|
|
2261
|
+
proxyRpc?: boolean;
|
|
2169
2262
|
/** Injected `fetch`, for tests and non-standard runtimes. */
|
|
2170
2263
|
fetch?: typeof fetch;
|
|
2171
2264
|
/** Injected websocket factory, for tests and runtimes without a global `WebSocket`. */
|
|
@@ -2490,6 +2583,7 @@ declare class ToonClient implements ToonClientLike {
|
|
|
2490
2583
|
private onChain;
|
|
2491
2584
|
private carriage;
|
|
2492
2585
|
private btpSession;
|
|
2586
|
+
private readonly hiddenService;
|
|
2493
2587
|
private closed;
|
|
2494
2588
|
private constructor();
|
|
2495
2589
|
/**
|
|
@@ -2619,6 +2713,18 @@ declare class ToonClient implements ToonClientLike {
|
|
|
2619
2713
|
* perform here — the watermark is already durable when this is called.
|
|
2620
2714
|
*/
|
|
2621
2715
|
close(): Promise<void>;
|
|
2716
|
+
/**
|
|
2717
|
+
* Refuse an endpoint this client has no way to dial.
|
|
2718
|
+
*
|
|
2719
|
+
* A node's endpoints are its own strings, and a hidden-service node may publish
|
|
2720
|
+
* absolute `.anyone` ones. The configured client edge always wins on *whether*
|
|
2721
|
+
* we can reach the node — but a carriage resolved from the description can
|
|
2722
|
+
* still point somewhere the configured transport cannot go. Without a proxy
|
|
2723
|
+
* that address does not merely fail: the hostname goes out in a plaintext DNS
|
|
2724
|
+
* query first, which is precisely what a hidden service exists to prevent. So
|
|
2725
|
+
* this fails loudly, naming the proxy, before anything dials.
|
|
2726
|
+
*/
|
|
2727
|
+
private assertEndpointReachable;
|
|
2622
2728
|
/** The port {@link send} runs against. */
|
|
2623
2729
|
private sendContext;
|
|
2624
2730
|
/**
|
|
@@ -2704,6 +2810,20 @@ interface ResolvedIdentity {
|
|
|
2704
2810
|
interface ResolvedConfig {
|
|
2705
2811
|
/** The client-edge base URL, with any trailing `/ilp` normalised away. */
|
|
2706
2812
|
connector: string;
|
|
2813
|
+
/** True when {@link connector} is a `.anyone` hidden service. */
|
|
2814
|
+
connectorIsHiddenService: boolean;
|
|
2815
|
+
/** The `socks5h://` proxy to reach it through, when there is one. */
|
|
2816
|
+
socksProxy: string | undefined;
|
|
2817
|
+
/** Whether chain RPC rides that proxy too (ADR 0002). */
|
|
2818
|
+
proxyRpc: boolean;
|
|
2819
|
+
/**
|
|
2820
|
+
* The undici dispatcher built from {@link socksProxy}, for chain RPC.
|
|
2821
|
+
* Deliberately not filled in here: building it means loading a Node-only
|
|
2822
|
+
* module, and resolving a config must stay synchronous and browser-safe. It is
|
|
2823
|
+
* the client's job to construct one, so {@link resolveConfig} only reserves
|
|
2824
|
+
* the slot and leaves it `undefined`.
|
|
2825
|
+
*/
|
|
2826
|
+
rpcDispatcher: unknown;
|
|
2707
2827
|
identity: ResolvedIdentity;
|
|
2708
2828
|
/** The caller's chain preference, or `undefined` to take the node's first. */
|
|
2709
2829
|
chain: ChainKind | undefined;
|
|
@@ -3247,6 +3367,12 @@ interface TokenNetworkClientConfig {
|
|
|
3247
3367
|
rpcUrl: string;
|
|
3248
3368
|
signer: EvmSigner;
|
|
3249
3369
|
readConsistency?: EvmReadConsistencyConfig;
|
|
3370
|
+
/**
|
|
3371
|
+
* An undici dispatcher to send RPC through — present when the client is
|
|
3372
|
+
* talking to a hidden service, so chain traffic rides the same overlay as the
|
|
3373
|
+
* packets rather than announcing this address on clearnet (ADR 0002).
|
|
3374
|
+
*/
|
|
3375
|
+
rpcDispatcher?: unknown;
|
|
3250
3376
|
}
|
|
3251
3377
|
/** What one channel's `channels(id)` view says. */
|
|
3252
3378
|
interface EvmChannelRecord {
|
|
@@ -3431,6 +3557,8 @@ declare function parseEvmChainId(chain: string): number;
|
|
|
3431
3557
|
|
|
3432
3558
|
interface SolanaChannelConfig {
|
|
3433
3559
|
rpcUrl: string;
|
|
3560
|
+
/** `fetch` for Solana JSON-RPC — the proxied one on a hidden-service client. */
|
|
3561
|
+
rpcFetch?: typeof fetch;
|
|
3434
3562
|
/**
|
|
3435
3563
|
* Ed25519 keypair material. Accepts either a 32-byte seed or a 64-byte
|
|
3436
3564
|
* `secretKey` (seed ‖ pubkey, as produced by `deriveFullIdentity`). The first
|
|
@@ -3467,6 +3595,13 @@ interface OnChainChannelClientConfig {
|
|
|
3467
3595
|
solanaConfig?: SolanaChannelConfig;
|
|
3468
3596
|
/** How hard the EVM opener works to survive a stale-read RPC (#489). */
|
|
3469
3597
|
readConsistency?: EvmReadConsistencyConfig;
|
|
3598
|
+
/**
|
|
3599
|
+
* An undici dispatcher to send chain RPC through, when this client is talking
|
|
3600
|
+
* to a hidden service. Reaching the connector inside the overlay while reading
|
|
3601
|
+
* chain state on clearnet would announce, from this IP and beside every paid
|
|
3602
|
+
* request, the settlement address the overlay exists to keep unlinked (ADR 0002).
|
|
3603
|
+
*/
|
|
3604
|
+
rpcDispatcher?: unknown;
|
|
3470
3605
|
}
|
|
3471
3606
|
/** What this class remembers about a channel it opened or adopted. */
|
|
3472
3607
|
interface ChannelContext {
|
|
@@ -3480,6 +3615,7 @@ declare class OnChainChannelClient implements ChannelClient {
|
|
|
3480
3615
|
private readonly chainRpcUrls;
|
|
3481
3616
|
private solanaConfig?;
|
|
3482
3617
|
private readonly readConsistency;
|
|
3618
|
+
private readonly rpcDispatcher;
|
|
3483
3619
|
private readonly channelContext;
|
|
3484
3620
|
private readonly evmClients;
|
|
3485
3621
|
private readonly solanaClients;
|
|
@@ -4200,19 +4336,18 @@ declare class BtpRuntimeClient implements IlpClient {
|
|
|
4200
4336
|
* Sends an ILP packet via BTP with auto-reconnect on connection errors.
|
|
4201
4337
|
* Satisfies IlpClient interface.
|
|
4202
4338
|
*
|
|
4203
|
-
* `params` may carry
|
|
4204
|
-
* `
|
|
4205
|
-
*
|
|
4206
|
-
*
|
|
4207
|
-
* as a failed result — see `mapIlpResponse`.
|
|
4339
|
+
* `params` may carry an `expectedFulfillment` (the sender's end-to-end
|
|
4340
|
+
* check, ADR 0069), a `greeting` flag and an explicit `expiresAt`. With an
|
|
4341
|
+
* expected fulfilment the FULFILL preimage is compared against it and a
|
|
4342
|
+
* mismatch is surfaced as a failed result — see `mapIlpResponse`.
|
|
4208
4343
|
*/
|
|
4209
4344
|
sendIlpPacket(params: IlpSendParams): Promise<IlpSendResult>;
|
|
4210
4345
|
/**
|
|
4211
4346
|
* Sends a balance proof claim via BTP protocol data, then sends an ILP packet.
|
|
4212
4347
|
* Auto-reconnects on connection errors.
|
|
4213
4348
|
*
|
|
4214
|
-
*
|
|
4215
|
-
*
|
|
4349
|
+
* `expectedFulfillment` / `greeting` / `expiresAt` semantics are identical
|
|
4350
|
+
* to {@link sendIlpPacket}.
|
|
4216
4351
|
*/
|
|
4217
4352
|
sendIlpPacketWithClaim(params: IlpSendParams, claim: Record<string, unknown>): Promise<IlpSendResult>;
|
|
4218
4353
|
/**
|
|
@@ -4224,11 +4359,11 @@ declare class BtpRuntimeClient implements IlpClient {
|
|
|
4224
4359
|
sendClaimMessage(claim: Record<string, unknown>): Promise<void>;
|
|
4225
4360
|
private _sendClaimMessageOnce;
|
|
4226
4361
|
/**
|
|
4227
|
-
* Build the ILP PREPARE for a send, applying the
|
|
4228
|
-
* explicit expiry when provided
|
|
4229
|
-
*
|
|
4230
|
-
*
|
|
4231
|
-
*
|
|
4362
|
+
* Build the ILP PREPARE for a send, applying the
|
|
4363
|
+
* explicit expiry when provided, carrying the `greeting` flag ADR 0069 put
|
|
4364
|
+
* where the execution condition used to be, and validating that an expected
|
|
4365
|
+
* fulfilment is exactly 32 bytes (a wrong-length one could never match a
|
|
4366
|
+
* real FULFILL, so every delivery would be counted failed).
|
|
4232
4367
|
*/
|
|
4233
4368
|
private buildPrepare;
|
|
4234
4369
|
/**
|
|
@@ -4373,11 +4508,10 @@ declare class HttpIlpClient implements IlpClient {
|
|
|
4373
4508
|
* this only on free/zero-amount routes; paid writes must use
|
|
4374
4509
|
* {@link sendIlpPacketWithClaim}. Satisfies the IlpClient interface.
|
|
4375
4510
|
*
|
|
4376
|
-
* `params` may carry
|
|
4377
|
-
* `
|
|
4378
|
-
*
|
|
4379
|
-
*
|
|
4380
|
-
* as a failed result — see {@link mapIlpResponse}.
|
|
4511
|
+
* `params` may carry an `expectedFulfillment` (the sender's end-to-end
|
|
4512
|
+
* check, ADR 0069), a `greeting` flag and an explicit `expiresAt`. With an
|
|
4513
|
+
* expected fulfilment the FULFILL preimage is compared against it and a
|
|
4514
|
+
* mismatch is surfaced as a failed result — see {@link mapIlpResponse}.
|
|
4381
4515
|
*/
|
|
4382
4516
|
sendIlpPacket(params: IlpSendParams): Promise<IlpSendResult>;
|
|
4383
4517
|
/**
|
|
@@ -4386,8 +4520,8 @@ declare class HttpIlpClient implements IlpClient {
|
|
|
4386
4520
|
* the BTP path attaches as the `payment-channel-claim` protocolData entry —
|
|
4387
4521
|
* we base64(JSON.stringify(claim)) it, byte-for-byte identical to BTP.
|
|
4388
4522
|
*
|
|
4389
|
-
*
|
|
4390
|
-
*
|
|
4523
|
+
* `expectedFulfillment` / `greeting` / `expiresAt` semantics are identical
|
|
4524
|
+
* to {@link sendIlpPacket}.
|
|
4391
4525
|
*/
|
|
4392
4526
|
sendIlpPacketWithClaim(params: IlpSendParams, claim: unknown): Promise<IlpSendResult>;
|
|
4393
4527
|
/**
|
|
@@ -4442,9 +4576,9 @@ declare class HttpIlpClient implements IlpClient {
|
|
|
4442
4576
|
* to a transport error. Per the wire contract, ILP-level rejects arrive as a
|
|
4443
4577
|
* 200 + REJECT body — only HTTP non-2xx means a transport-layer failure.
|
|
4444
4578
|
*
|
|
4445
|
-
* When `
|
|
4446
|
-
* it; a mismatch yields `accepted: false` (shared `mapIlpResponse`
|
|
4447
|
-
* identical to the BTP path).
|
|
4579
|
+
* When `expectedFulfillment` is given the FULFILL preimage is compared
|
|
4580
|
+
* against it; a mismatch yields `accepted: false` (shared `mapIlpResponse`
|
|
4581
|
+
* logic, identical to the BTP path).
|
|
4448
4582
|
*/
|
|
4449
4583
|
private mapResponse;
|
|
4450
4584
|
private mapTransportError;
|
|
@@ -4776,12 +4910,13 @@ declare function decodeVarOctetString(buf: Uint8Array, offset: number): Decoded<
|
|
|
4776
4910
|
* - **Response framing.** `0x02 ‖ nonce(12) ‖ ciphertext`, the plaintext being
|
|
4777
4911
|
* just the encoded envelope. Sealed directly with the request's shared
|
|
4778
4912
|
* secret.
|
|
4779
|
-
* - **Fulfilment
|
|
4780
|
-
* "toon-giftwrap-fulfillment")
|
|
4781
|
-
*
|
|
4782
|
-
*
|
|
4783
|
-
*
|
|
4784
|
-
*
|
|
4913
|
+
* - **Fulfilment.** `fulfilment = HKDF-SHA256(shared_secret,
|
|
4914
|
+
* "toon-giftwrap-fulfillment")`. The terminating connector recovers the
|
|
4915
|
+
* secret by opening the wrap and derives the preimage without asking the
|
|
4916
|
+
* app anything; the sender, which drew that secret, derives the same bytes
|
|
4917
|
+
* and so can check a delivery end to end. Nothing is minted onto the
|
|
4918
|
+
* PREPARE from it — connector ADR 0069 took the execution condition off the
|
|
4919
|
+
* wire entirely.
|
|
4785
4920
|
* - **Telling a sealed reject from a plaintext one.** The leading type byte,
|
|
4786
4921
|
* and only that (`looks_like_sealed_response`). A reject raised short of the
|
|
4787
4922
|
* termination shares no secret with the sender and carries empty `data`; an
|
|
@@ -4915,11 +5050,11 @@ declare function sealRequestWithRandomness(plaintext: Uint8Array, receiverPublic
|
|
|
4915
5050
|
* so no two sealed requests — even to the same receiver, even with the same
|
|
4916
5051
|
* plaintext — share any of the three.
|
|
4917
5052
|
*
|
|
4918
|
-
* Returns the wire bytes and the shared secret.
|
|
4919
|
-
*
|
|
4920
|
-
*
|
|
4921
|
-
*
|
|
4922
|
-
*
|
|
5053
|
+
* Returns the wire bytes and the shared secret. Keep that secret: the
|
|
5054
|
+
* terminating connector recovers the same one by opening this wrap, so
|
|
5055
|
+
* {@link deriveFulfillment} of it is the preimage an honest FULFILL will
|
|
5056
|
+
* carry — the sender's only way to check a delivery end to end now that no
|
|
5057
|
+
* condition rides on the wire (connector ADR 0069).
|
|
4923
5058
|
*/
|
|
4924
5059
|
declare function sealRequest(plaintext: Uint8Array, receiverPublicKey: Uint8Array): SealedRequest;
|
|
4925
5060
|
/**
|
|
@@ -4970,22 +5105,6 @@ declare function looksLikeSealedResponse(bytes: Uint8Array): boolean;
|
|
|
4970
5105
|
* secret also derives, so it can never collide with either.
|
|
4971
5106
|
*/
|
|
4972
5107
|
declare function deriveFulfillment(sharedSecret: Uint8Array): Uint8Array;
|
|
4973
|
-
/**
|
|
4974
|
-
* The condition a `fulfillment` satisfies: `sha256(fulfillment)` —
|
|
4975
|
-
* `connector_domain::condition::derive_condition`. Hashing only ever runs in
|
|
4976
|
-
* this direction; there is deliberately no function here that goes from a
|
|
4977
|
-
* condition back to a fulfilment.
|
|
4978
|
-
*
|
|
4979
|
-
* The hash is the same one `utils/condition.ts` already uses; what ADR 0019
|
|
4980
|
-
* changes is where the preimage comes from. `mintExecutionCondition` there
|
|
4981
|
-
* draws a random preimage the sender must then carry to the FULFILL itself;
|
|
4982
|
-
* here the preimage is DERIVED from the secret sealed inside the packet, so
|
|
4983
|
-
* the terminating connector can produce it without the sender or the app
|
|
4984
|
-
* handing it over. Checking a returned fulfilment against a condition is
|
|
4985
|
-
* unchanged either way — use `fulfillmentMatchesCondition` from
|
|
4986
|
-
* `utils/condition.ts` for that rather than a second copy of it here.
|
|
4987
|
-
*/
|
|
4988
|
-
declare function deriveCondition(fulfillment: Uint8Array): Uint8Array;
|
|
4989
5108
|
|
|
4990
5109
|
/**
|
|
4991
5110
|
* One sealed request/answer exchange with a terminating connector (ADR 0018,
|
|
@@ -4997,11 +5116,11 @@ declare function deriveCondition(fulfillment: Uint8Array): Uint8Array;
|
|
|
4997
5116
|
*
|
|
4998
5117
|
* - The `data` is a gift wrap addressed to the connector that TERMINATES the
|
|
4999
5118
|
* route, around an OER envelope — never HTTP text, never a bare payload.
|
|
5000
|
-
* - The
|
|
5001
|
-
*
|
|
5002
|
-
*
|
|
5003
|
-
*
|
|
5004
|
-
* path
|
|
5119
|
+
* - The fulfilment an honest answer carries is DERIVED from the very secret
|
|
5120
|
+
* that wrap carries (ADR 0019). Since ADR 0069 took the execution condition
|
|
5121
|
+
* off the wire, comparing a returned preimage against that derivation is
|
|
5122
|
+
* the sender's only delivery check — and the only one made anywhere on the
|
|
5123
|
+
* path, since no hop verifies a FULFILL any more.
|
|
5005
5124
|
* - The answer is sealed with that same secret, so opening it requires having
|
|
5006
5125
|
* kept it from the seal.
|
|
5007
5126
|
*
|
|
@@ -5029,23 +5148,16 @@ declare function deriveCondition(fulfillment: Uint8Array): Uint8Array;
|
|
|
5029
5148
|
*/
|
|
5030
5149
|
|
|
5031
5150
|
/**
|
|
5032
|
-
* A sealed request, ready to become a PREPARE: what goes in `data`,
|
|
5033
|
-
*
|
|
5151
|
+
* A sealed request, ready to become a PREPARE: what goes in `data`, the secret
|
|
5152
|
+
* needed to read the answer, and the fulfilment that answer must carry.
|
|
5034
5153
|
*
|
|
5035
|
-
* The three are produced together and belong together
|
|
5036
|
-
*
|
|
5037
|
-
*
|
|
5154
|
+
* The three are produced together and belong together: opening the answer with
|
|
5155
|
+
* any other secret fails, and checking a FULFILL against any other fulfilment
|
|
5156
|
+
* rejects a delivery that was genuine.
|
|
5038
5157
|
*/
|
|
5039
5158
|
interface SealedExchange {
|
|
5040
5159
|
/** The gift wrap to carry as the PREPARE's `data`. */
|
|
5041
5160
|
readonly data: Uint8Array;
|
|
5042
|
-
/**
|
|
5043
|
-
* The PREPARE's `executionCondition`: `sha256(deriveFulfillment(secret))`.
|
|
5044
|
-
* Derived, never random and never caller-supplied — the terminating
|
|
5045
|
-
* connector recovers the same secret and derives the same fulfilment
|
|
5046
|
-
* without the app participating (ADR 0019).
|
|
5047
|
-
*/
|
|
5048
|
-
readonly condition: Uint8Array;
|
|
5049
5161
|
/**
|
|
5050
5162
|
* The 32-byte secret sealed inside the wrap. Keep it until the answer is
|
|
5051
5163
|
* read; it is the only thing that opens the response. Never send it
|
|
@@ -5053,9 +5165,11 @@ interface SealedExchange {
|
|
|
5053
5165
|
*/
|
|
5054
5166
|
readonly sharedSecret: Uint8Array;
|
|
5055
5167
|
/**
|
|
5056
|
-
* The fulfilment the terminating connector will return
|
|
5057
|
-
*
|
|
5058
|
-
*
|
|
5168
|
+
* The fulfilment the terminating connector will return —
|
|
5169
|
+
* `deriveFulfillment(sharedSecret)`. Pass it to a transport as
|
|
5170
|
+
* `expectedFulfillment`: comparing a FULFILL's preimage against this is the
|
|
5171
|
+
* sender's end-to-end check, and since ADR 0069 the only fulfilment check
|
|
5172
|
+
* made anywhere on the path.
|
|
5059
5173
|
*/
|
|
5060
5174
|
readonly fulfillment: Uint8Array;
|
|
5061
5175
|
}
|
|
@@ -6336,6 +6450,94 @@ type ArnsNameWithAntOutcome = {
|
|
|
6336
6450
|
*/
|
|
6337
6451
|
declare function buyArnsNameWithNewAnt(params: AntSpawnParams & Pick<ArnsBuyParams, 'type' | 'years'>): Promise<ArnsNameWithAntOutcome>;
|
|
6338
6452
|
|
|
6453
|
+
/**
|
|
6454
|
+
* Hidden-service hostname validation for the Anyone Protocol network.
|
|
6455
|
+
*
|
|
6456
|
+
* The `anon` binary routes hidden-service hostnames under the **`.anyone`** TLD
|
|
6457
|
+
* ONLY. A `<host>.anon` name is NOT recognized as a hidden service — anon treats
|
|
6458
|
+
* it as a clearnet name and tries to exit-resolve it, which fails
|
|
6459
|
+
* (`resolve failed` / `HostUnreachable`). Only `<host>.anyone` triggers anon's
|
|
6460
|
+
* `parse_extended_hostname: Anyone dns address lookup` and is validated.
|
|
6461
|
+
*
|
|
6462
|
+
* Historically this client accepted BOTH `.anon` and `.anyone`, so a `.anon`
|
|
6463
|
+
* address was silently accepted and then failed deep in the transport with an
|
|
6464
|
+
* opaque error. This module makes `.anyone` the single accepted HS TLD and
|
|
6465
|
+
* rejects the near-misses up front with an actionable message.
|
|
6466
|
+
*
|
|
6467
|
+
* `.onion` is a near-miss too, and a more tempting one: it is a real hidden
|
|
6468
|
+
* service, just on a network this client does not dial. We route through `anon`,
|
|
6469
|
+
* not `tor`, so accepting a `.onion` address would repeat the exact mistake
|
|
6470
|
+
* `.anon` taught us — an address we cannot reach, failing late and cryptically.
|
|
6471
|
+
*
|
|
6472
|
+
* This is a pure, browser-safe helper (no Node built-ins) so it can be imported
|
|
6473
|
+
* from any path, including config validation.
|
|
6474
|
+
*/
|
|
6475
|
+
/**
|
|
6476
|
+
* A `<host>.anyone` hidden-service hostname. The label is base32 (`a-z2-7`),
|
|
6477
|
+
* matching the on-wire onion-style address alphabet anon uses.
|
|
6478
|
+
*/
|
|
6479
|
+
declare const HS_HOSTNAME_REGEX: RegExp;
|
|
6480
|
+
/** Max length of an HS hostname (defensive bound against pathological input). */
|
|
6481
|
+
declare const HS_HOSTNAME_MAX_LENGTH = 80;
|
|
6482
|
+
/**
|
|
6483
|
+
* Returns true iff `s` is a routable `.anyone` hidden-service hostname.
|
|
6484
|
+
* Does NOT accept `.anon` or `.onion` (see {@link assertRoutableHsHostname}).
|
|
6485
|
+
*/
|
|
6486
|
+
declare function isRoutableHsHostname(s: unknown): s is string;
|
|
6487
|
+
/**
|
|
6488
|
+
* Returns true iff `url` addresses a hidden service — i.e. its host is a
|
|
6489
|
+
* routable `.anyone` address.
|
|
6490
|
+
*
|
|
6491
|
+
* Takes a URL string rather than a hostname because that is what a caller
|
|
6492
|
+
* actually holds: a `connector` config value, an `httpEndpoint` off a
|
|
6493
|
+
* self-description. A string that is not a URL at all is not a hidden service.
|
|
6494
|
+
*/
|
|
6495
|
+
declare function isHiddenServiceUrl(url: unknown): boolean;
|
|
6496
|
+
/**
|
|
6497
|
+
* Validates that `hostname` is a routable `.anyone` hidden-service address.
|
|
6498
|
+
*
|
|
6499
|
+
* - `<host>.anyone` → returns the hostname unchanged.
|
|
6500
|
+
* - `<host>.anon` → throws, pointing at `.anyone` (anon does NOT route
|
|
6501
|
+
* `.anon`; it is treated as a clearnet address and fails `HostUnreachable`).
|
|
6502
|
+
* - `<host>.onion` → throws, naming the network mismatch: that is Tor, and
|
|
6503
|
+
* this client dials the Anyone Protocol.
|
|
6504
|
+
* - anything else → throws a generic format error.
|
|
6505
|
+
*
|
|
6506
|
+
* @throws {Error} if the hostname is not a routable `.anyone` HS address.
|
|
6507
|
+
*/
|
|
6508
|
+
declare function assertRoutableHsHostname(hostname: unknown): string;
|
|
6509
|
+
|
|
6510
|
+
/**
|
|
6511
|
+
* The one place viem is told to send chain RPC through the hidden-service proxy.
|
|
6512
|
+
*
|
|
6513
|
+
* viem's HTTP transport calls the **global** `fetch` and accepts no injected one.
|
|
6514
|
+
* Its only opening is `fetchOptions`, which it merges into the `fetch` init — and
|
|
6515
|
+
* Node's `fetch` reads a `dispatcher` from there. So a dispatcher is how, and the
|
|
6516
|
+
* only how, chain traffic joins the packet traffic inside the overlay (ADR 0002).
|
|
6517
|
+
*
|
|
6518
|
+
* Browser-safe: this module imports nothing but viem. The dispatcher itself is
|
|
6519
|
+
* built in `./socks.js`, which is Node-only and dynamically imported; here it is
|
|
6520
|
+
* an opaque `unknown` that is either present or not.
|
|
6521
|
+
*/
|
|
6522
|
+
|
|
6523
|
+
/** Options a caller already wanted, independent of any proxy. */
|
|
6524
|
+
interface RpcTransportOptions {
|
|
6525
|
+
timeout?: number;
|
|
6526
|
+
retryCount?: number;
|
|
6527
|
+
}
|
|
6528
|
+
/**
|
|
6529
|
+
* A viem HTTP transport for `url`, bound to `dispatcher` when there is one.
|
|
6530
|
+
*
|
|
6531
|
+
* `undefined` dispatcher means clearnet, and produces exactly the transport this
|
|
6532
|
+
* package built before hidden services existed.
|
|
6533
|
+
*/
|
|
6534
|
+
declare function rpcTransport(url: string, dispatcher: unknown | undefined, options?: RpcTransportOptions): ReturnType<typeof http>;
|
|
6535
|
+
/**
|
|
6536
|
+
* `fetch` bound to `dispatcher`, for a JSON-RPC path that calls `fetch` itself
|
|
6537
|
+
* rather than going through viem — Solana's, in practice.
|
|
6538
|
+
*/
|
|
6539
|
+
declare function rpcFetch(dispatcher: unknown | undefined, fetchImpl?: typeof fetch): typeof fetch;
|
|
6540
|
+
|
|
6339
6541
|
/**
|
|
6340
6542
|
* Well-known values for the public TOON devnet.
|
|
6341
6543
|
*
|
|
@@ -6492,4 +6694,4 @@ interface RetryOptions {
|
|
|
6492
6694
|
*/
|
|
6493
6695
|
declare function withRetry<T>(operation: () => Promise<T>, options: RetryOptions): Promise<T>;
|
|
6494
6696
|
|
|
6495
|
-
export { ACCUMULATED_COST_HEADER, ACCUMULATED_COST_PROTOCOL, ARNS_KIND, type AntSpawnOutcome, type AntSpawnParams, type AntSpawnRefused, type AntSpawnStep, type AntSpawned, type ArnsAntPrepareReceipt, type ArnsBuyOutcome, type ArnsBuyParams, type ArnsBuyReceipt, type ArnsNameType, type ArnsNameWithAntOutcome, type ArnsNetwork, type BTPMessage, BTPMessageType, type BTPProtocolData, type BalanceProofParams, BtpAuthError, type BtpChannelDeclaration, BtpConnectionError, type BtpPacketResponse, BtpPaidWriteTransport, type BtpPaidWriteTransportConfig, BtpRuntimeClient, type BtpRuntimeClientConfig, CLAIM_ACK_HEADER, CLAIM_ACK_PROTOCOL, CLAIM_REJECT_CODE, CLAIM_REJECT_REASONS, type ChainKind, type ChainMetadata, type ChainSigner, ChainUnavailableError, type ChannelBinding, type ChannelBindingContext, type ChannelClient, type ChannelFacade, type ChannelFacadeDeps, ChannelFundingError, ChannelManager, type ChannelManagerConfig, ChannelNotOpenError, ChannelResumeError, type ChannelState, type ChannelStatus, type ChannelStore, type ChannelStoreEntry, type ChannelTerms, type ClaimAck, type ClaimMessage, type ClaimSendingTransport$1 as ClaimSendingTransport, type ClaimStateFailed, type ClaimStateOk, type ClaimStateRequestEntry, type ClaimStateResult, type ClaimSummary, ClientChannelFacade, ClientWalletFacade, ConfigError, type ConnectorChainSettlementTerms, ConnectorEdgeClient, type ConnectorEdgeClientConfig, ConnectorEdgeError, type ConnectorEdgeErrorCode, ConnectorError, type ConnectorIdentity, type ConnectorRoutePrice, type ConnectorRouteTerms, type ConnectorSettlementTerms, type ConnectorSolanaSettlementTerms, type CounterpartyVerdict, DEFAULT_DEPOSIT, DEFAULT_SETTLEMENT_TIMEOUT, DEFAULT_TIMEOUT_MS, DEVNET, type Decoded, type DeriveIdentityOptions, type DerivedIdentity, type DevnetNode, ERC20_ABI, type EVMClaimMessage, type EdgeIdentity, type EncryptedKeystore, type EnsureChannelOptions, type Envelope, EnvelopeError, EnvelopeErrorKind, type EnvelopeHeader, type EnvelopeRequest, type EnvelopeResponse, type EvmChannelRecord, type EvmReadConsistencyConfig, EvmSigner, type ExchangeOutcome, FULFILLMENT_MISMATCH_CODE, FULFILLMENT_MISMATCH_MESSAGE, type FaucetChain, type FundWalletOptions, type FundWalletResult, GIFTWRAP_NONCE_LENGTH, GIFTWRAP_PUBLIC_KEY_LENGTH, GIFTWRAP_SECRET_LENGTH, GIFTWRAP_TYPE_REQUEST, GIFTWRAP_TYPE_RESPONSE, type GasStationExecuteReceipt, type GasStationFailureReason, type GasStationFailureReceipt, type GasStationQuoteReceipt, type GasStationReceipt, type GiftWrapEcdh, GiftWrapError, GiftWrapErrorKind, HttpIlpClient, type HttpIlpClientConfig, type ILPFulfillPacket, ILPPacketType, type ILPPreparePacket, type ILPRejectPacket, type ILPResponsePacket, ILP_CLAIM_HEADER, ILP_PEER_ID_HEADER, type IlpClient, type IlpResponseMeta, type IlpSendParams, type IlpSendResult, type IlpSendResultWithFulfillment, InMemoryChannelStore, InsufficientBalanceError, InvalidAddressError, IsomorphicBtpClient, type JobAnswer, type JobEndpoint, type JobEvent, type JobEventParams, type JobSender, JsonFileChannelStore, KEYSTORE_VERSION, type KeyDerivationScheme, MIN_SETTLEMENT_TIMEOUT_SECONDS, NetworkError, type NodeSelfDescription, OerError, OerErrorKind, OnChainChannelClient, type OnChainChannelClientConfig, type OnChainChannelStatus, type OpenChannelOptions, type OpenChannelParams, type OpenChannelResult, type OpenOrAdoptParams, type OpenedKeystore, type OpenedRequest, PAYMENT_REQUIRED_HEADER, PAYMENT_REQUIRED_PROTOCOL, type PaidWriteTransport, type ParsedX402Challenge, PaymentRequiredError, type PaymentTerms, type RequiredTransport, type ResolvedConfig, type ResolvedIdentity, type ResponseHeaderSource, type RetryOptions, type RouteCharge, RouteNotPricedError, type RoutePrice, SOLANA_GAS_KIND, type SealedExchange, type SealedRequest, SealedResponseError, type SealedResponseErrorKind, type SendContext, type SendFulfilled, type SendOptions, type SendRefused, type SendRequest, type SendResult, type SendTransferParams, type SendTransferResult, type SignedBalanceProof, type SolanaChannelConfig, type SolanaClaimMessage, type Signer as SolanaKeypair, type SolanaNetwork, SolanaSigner, type SolanaWireTransaction, StaleRpcReadError, TOKEN_NETWORK_ABI, TOKEN_NETWORK_REGISTRY_ABI, TokenNetworkClient, type TokenNetworkClientConfig, type ToonChannelAccept, ToonClient, type ToonClientConfig, ToonClientError, type ToonClientLike, type ToonIdentity, type TransferConfig, TransferNotDeliveredError, TransferUnsupportedError, type TransportChoice, type TransportPreference, TransportRequiredError, type TxRef, UnknownChainError, ValidationError, type WalletBalance, type WalletBalanceSources, type WalletChainBalances, type WalletFacade, type WalletFacadeDeps, type WalletTokenAmount, type WriteKeystoreOptions, type X402ChannelExtra, addressFor, buildJobEvent, buildResponseMeta, buyArnsName, buyArnsNameWithNewAnt, chainUnavailableMessage, chargeFor, connectorEdgeBaseUrl, counterpartyMatch, decodeAccumulatedCost, decodeBase64Text, decodeClaimAck, decodeEnvelope, decodeEnvelopeRequest, decodeEnvelopeResponse, decodePaymentRequired, decodeVarOctetString, decodeVarUint, decryptMnemonic, defaultDestinationFor, defaultFaucetTimeout, defaultRpcUrl,
|
|
6697
|
+
export { ACCUMULATED_COST_HEADER, ACCUMULATED_COST_PROTOCOL, ARNS_KIND, type AntSpawnOutcome, type AntSpawnParams, type AntSpawnRefused, type AntSpawnStep, type AntSpawned, type ArnsAntPrepareReceipt, type ArnsBuyOutcome, type ArnsBuyParams, type ArnsBuyReceipt, type ArnsNameType, type ArnsNameWithAntOutcome, type ArnsNetwork, type BTPMessage, BTPMessageType, type BTPProtocolData, type BalanceProofParams, BtpAuthError, type BtpChannelDeclaration, BtpConnectionError, type BtpPacketResponse, BtpPaidWriteTransport, type BtpPaidWriteTransportConfig, BtpRuntimeClient, type BtpRuntimeClientConfig, CLAIM_ACK_HEADER, CLAIM_ACK_PROTOCOL, CLAIM_REJECT_CODE, CLAIM_REJECT_REASONS, type ChainKind, type ChainMetadata, type ChainSigner, ChainUnavailableError, type ChannelBinding, type ChannelBindingContext, type ChannelClient, type ChannelFacade, type ChannelFacadeDeps, ChannelFundingError, ChannelManager, type ChannelManagerConfig, ChannelNotOpenError, ChannelResumeError, type ChannelState, type ChannelStatus, type ChannelStore, type ChannelStoreEntry, type ChannelTerms, type ClaimAck, type ClaimMessage, type ClaimSendingTransport$1 as ClaimSendingTransport, type ClaimStateFailed, type ClaimStateOk, type ClaimStateRequestEntry, type ClaimStateResult, type ClaimSummary, ClientChannelFacade, ClientWalletFacade, ConfigError, type ConnectorChainSettlementTerms, ConnectorEdgeClient, type ConnectorEdgeClientConfig, ConnectorEdgeError, type ConnectorEdgeErrorCode, ConnectorError, type ConnectorIdentity, type ConnectorRoutePrice, type ConnectorRouteTerms, type ConnectorSettlementTerms, type ConnectorSolanaSettlementTerms, type CounterpartyVerdict, DEFAULT_DEPOSIT, DEFAULT_SETTLEMENT_TIMEOUT, DEFAULT_TIMEOUT_MS, DEVNET, type Decoded, type DeriveIdentityOptions, type DerivedIdentity, type DevnetNode, ERC20_ABI, type EVMClaimMessage, type EdgeIdentity, type EncryptedKeystore, type EnsureChannelOptions, type Envelope, EnvelopeError, EnvelopeErrorKind, type EnvelopeHeader, type EnvelopeRequest, type EnvelopeResponse, type EvmChannelRecord, type EvmReadConsistencyConfig, EvmSigner, type ExchangeOutcome, FULFILLMENT_MISMATCH_CODE, FULFILLMENT_MISMATCH_MESSAGE, type FaucetChain, type FundWalletOptions, type FundWalletResult, GIFTWRAP_NONCE_LENGTH, GIFTWRAP_PUBLIC_KEY_LENGTH, GIFTWRAP_SECRET_LENGTH, GIFTWRAP_TYPE_REQUEST, GIFTWRAP_TYPE_RESPONSE, type GasStationExecuteReceipt, type GasStationFailureReason, type GasStationFailureReceipt, type GasStationQuoteReceipt, type GasStationReceipt, type GiftWrapEcdh, GiftWrapError, GiftWrapErrorKind, HS_HOSTNAME_MAX_LENGTH, HS_HOSTNAME_REGEX, HttpIlpClient, type HttpIlpClientConfig, type ILPFulfillPacket, ILPPacketType, type ILPPreparePacket, type ILPRejectPacket, type ILPResponsePacket, ILP_CLAIM_HEADER, ILP_PEER_ID_HEADER, type IlpClient, type IlpResponseMeta, type IlpSendParams, type IlpSendResult, type IlpSendResultWithFulfillment, InMemoryChannelStore, InsufficientBalanceError, InvalidAddressError, IsomorphicBtpClient, type JobAnswer, type JobEndpoint, type JobEvent, type JobEventParams, type JobSender, JsonFileChannelStore, KEYSTORE_VERSION, type KeyDerivationScheme, MIN_SETTLEMENT_TIMEOUT_SECONDS, NetworkError, type NodeSelfDescription, OerError, OerErrorKind, OnChainChannelClient, type OnChainChannelClientConfig, type OnChainChannelStatus, type OpenChannelOptions, type OpenChannelParams, type OpenChannelResult, type OpenOrAdoptParams, type OpenedKeystore, type OpenedRequest, PACKET_EXPIRY_HEADROOM_MS, PAYMENT_REQUIRED_HEADER, PAYMENT_REQUIRED_PROTOCOL, type PaidWriteTransport, type ParsedX402Challenge, PaymentRequiredError, type PaymentTerms, type RequiredTransport, type ResolvedConfig, type ResolvedIdentity, type ResponseHeaderSource, type RetryOptions, type RouteCharge, RouteNotPricedError, type RoutePrice, type RpcTransportOptions, SOLANA_GAS_KIND, type SealedExchange, type SealedRequest, SealedResponseError, type SealedResponseErrorKind, type SendContext, type SendFulfilled, type SendOptions, type SendRefused, type SendRequest, type SendResult, type SendTransferParams, type SendTransferResult, type SignedBalanceProof, type SolanaChannelConfig, type SolanaClaimMessage, type Signer as SolanaKeypair, type SolanaNetwork, SolanaSigner, type SolanaWireTransaction, StaleRpcReadError, TOKEN_NETWORK_ABI, TOKEN_NETWORK_REGISTRY_ABI, TokenNetworkClient, type TokenNetworkClientConfig, type ToonChannelAccept, ToonClient, type ToonClientConfig, ToonClientError, type ToonClientLike, type ToonIdentity, type TransferConfig, TransferNotDeliveredError, TransferUnsupportedError, type TransportChoice, type TransportPreference, TransportRequiredError, type TxRef, UnknownChainError, ValidationError, type WalletBalance, type WalletBalanceSources, type WalletChainBalances, type WalletFacade, type WalletFacadeDeps, type WalletTokenAmount, type WriteKeystoreOptions, type X402ChannelExtra, addressFor, assertRoutableHsHostname, buildJobEvent, buildResponseMeta, buyArnsName, buyArnsNameWithNewAnt, chainUnavailableMessage, chargeFor, connectorEdgeBaseUrl, counterpartyMatch, decodeAccumulatedCost, decodeBase64Text, decodeClaimAck, decodeEnvelope, decodeEnvelopeRequest, decodeEnvelopeResponse, decodePaymentRequired, decodeVarOctetString, decodeVarUint, decryptMnemonic, defaultDestinationFor, defaultFaucetTimeout, defaultRpcUrl, deriveEvmChannelId, deriveFulfillment, deriveFullIdentity, deserializeIlpPacket, deserializeIlpPrepare, encodeEnvelope, encodeEnvelopeRequest, encodeEnvelopeResponse, encodeVarOctetString, encodeVarUint, encryptMnemonic, envelopeHeader, evmDerivationPath, evmIdentityFromKey, fundWallet, generateKeystore, generateMnemonic, generateRandomIdentity, generateSolanaKeypair, giftWrapPublicKey, httpEndpointToBtpUrl, importKeystore, isGasStationFailure, isHiddenServiceUrl, isInsufficientGasError, isRoutableHsHostname, isUnknownChannelReject, jobEventParam, keystoreDerivation, loadKeystore, localGiftWrapEcdh, looksLikeSealedResponse, mapIlpResponse, openKeystore, openRequest, openResponse, parseBtpMessage, parseEvmChainId, parsePaymentTerms, parseSelfDescription, parseSettlementEntry, parseSolanaWireTransaction, parseX402Body, parseX402Challenge, patchSolanaRecentBlockhash, readBaseUnits, readResponseMeta$1 as readBtpResponseMeta, readEvmNativeBalance, readEvmTokenBalance, readExchangeOutcome, readResponseMeta, readSolanaNativeBalance, readSolanaTokenBalance, readWalletBalances, rejectNamesChannel, resolveConfig, resolveExpectedFulfillment, resolveExpiresAt, routeFor, routePriceFor, rpcFetch, rpcTransport, sameSettlementAddress, sealExchange, sealRequest, sealRequestWithRandomness, sealResponse, sealResponseWithRandomness, selectTransport, send, sendJob, sendTransfer, serializeBtpMessage, serializeIlpFulfill, serializeIlpPrepare, serializeIlpReject, settlementToTerms, signSolanaWireTransaction, solanaKeypair, sortParticipants, spawnAnt, toEnvelopeRequest, trimTrailingSlashes, validateMnemonic, withRetry, writeKeystoreFile };
|