@toon-protocol/client 2.2.0 → 3.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/dist/{chunk-A3JKQOWQ.js → chunk-M54FLOSJ.js} +248 -102
- package/dist/chunk-M54FLOSJ.js.map +1 -0
- package/dist/cli/main.js +1 -1
- package/dist/{client-VA4727SQ.js → client-WC6UGT6C.js} +2 -2
- package/dist/index.d.ts +299 -131
- package/dist/index.js +3 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-A3JKQOWQ.js.map +0 -1
- /package/dist/{client-VA4727SQ.js.map → client-WC6UGT6C.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -237,16 +237,30 @@ interface ILPPreparePacket {
|
|
|
237
237
|
type: typeof ILPPacketType.PREPARE;
|
|
238
238
|
amount: bigint;
|
|
239
239
|
destination: string;
|
|
240
|
-
|
|
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;
|
|
241
252
|
expiresAt: Date;
|
|
242
253
|
data: Uint8Array;
|
|
243
254
|
}
|
|
244
255
|
interface ILPFulfillPacket {
|
|
245
256
|
type: typeof ILPPacketType.FULFILL;
|
|
246
257
|
/**
|
|
247
|
-
* The 32-byte fulfillment preimage from the wire
|
|
248
|
-
*
|
|
249
|
-
* 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.
|
|
250
264
|
*/
|
|
251
265
|
fulfillment: Uint8Array;
|
|
252
266
|
data: Uint8Array;
|
|
@@ -260,6 +274,12 @@ interface ILPRejectPacket {
|
|
|
260
274
|
data: Uint8Array;
|
|
261
275
|
}
|
|
262
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
|
+
*/
|
|
263
283
|
declare function serializeIlpPrepare(packet: ILPPreparePacket): Uint8Array;
|
|
264
284
|
/**
|
|
265
285
|
* Decode an inbound PREPARE — the server-role mirror of {@link serializeIlpPrepare}
|
|
@@ -300,27 +320,28 @@ declare function serializeBtpMessage(message: BTPMessage): Uint8Array;
|
|
|
300
320
|
declare function parseBtpMessage(buf: Uint8Array): BTPMessage;
|
|
301
321
|
|
|
302
322
|
/**
|
|
303
|
-
* Shared sender-side plumbing for
|
|
304
|
-
*
|
|
305
|
-
*
|
|
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.
|
|
325
|
+
*
|
|
326
|
+
* Connector ADR 0069 (issue #1269) removed the execution condition from the
|
|
327
|
+
* wire. Two things changed here and nothing else did:
|
|
306
328
|
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
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.
|
|
310
335
|
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
* FAILED result (never a silent accept, never retried).
|
|
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.
|
|
317
341
|
*/
|
|
318
342
|
|
|
319
343
|
/**
|
|
320
|
-
* Send parameters accepted by both ILP transports.
|
|
321
|
-
* `@toon-protocol/core` `IlpClient` param shape with the sender-chosen
|
|
322
|
-
* condition and an explicit expiry — plain `IlpClient` callers keep working
|
|
323
|
-
* unchanged (both extras are optional; omitting them is the legacy path).
|
|
344
|
+
* Send parameters accepted by both ILP transports.
|
|
324
345
|
*/
|
|
325
346
|
interface IlpSendParams {
|
|
326
347
|
destination: string;
|
|
@@ -330,40 +351,48 @@ interface IlpSendParams {
|
|
|
330
351
|
/** Transport timeout in ms; also the default expiry window. */
|
|
331
352
|
timeout?: number;
|
|
332
353
|
/**
|
|
333
|
-
*
|
|
334
|
-
* Absent or all-zero = legacy unverified packet (default — ordinary
|
|
335
|
-
* publish/upload writes MUST keep this default).
|
|
354
|
+
* Declare this PREPARE a bootstrap/greeting probe (connector ADR 0069).
|
|
336
355
|
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
*
|
|
343
|
-
|
|
344
|
-
|
|
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`.
|
|
368
|
+
*
|
|
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.
|
|
345
376
|
*/
|
|
346
|
-
|
|
377
|
+
expectedFulfillment?: Uint8Array | string;
|
|
347
378
|
/**
|
|
348
|
-
* Explicit PREPARE `expiresAt
|
|
349
|
-
*
|
|
350
|
-
* `@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.
|
|
351
381
|
*/
|
|
352
382
|
expiresAt?: Date | string;
|
|
353
383
|
}
|
|
354
384
|
/**
|
|
355
|
-
* Normalize an `IlpSendParams.
|
|
385
|
+
* Normalize an `IlpSendParams.expectedFulfillment` to raw bytes.
|
|
356
386
|
*
|
|
357
387
|
* The two representations are the two callers: this package's own senders
|
|
358
|
-
* pass the bytes
|
|
359
|
-
*
|
|
360
|
-
* 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.
|
|
361
390
|
*
|
|
362
|
-
* Length is NOT validated here — that stays with `
|
|
363
|
-
* the transports, so a malformed
|
|
364
|
-
*
|
|
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.
|
|
365
394
|
*/
|
|
366
|
-
declare function
|
|
395
|
+
declare function resolveExpectedFulfillment(fulfillment: Uint8Array | string | undefined): Uint8Array | undefined;
|
|
367
396
|
/**
|
|
368
397
|
* How much longer a packet lives on the wire than the sender is prepared to wait.
|
|
369
398
|
*
|
|
@@ -392,12 +421,11 @@ declare const PACKET_EXPIRY_HEADROOM_MS = 15000;
|
|
|
392
421
|
*/
|
|
393
422
|
declare function resolveExpiresAt(expiresAt: Date | string | undefined, timeoutMs: number): Date;
|
|
394
423
|
/**
|
|
395
|
-
* `IlpSendResult` plus the FULFILL preimage when
|
|
396
|
-
*
|
|
397
|
-
* objects stay byte-identical.
|
|
424
|
+
* `IlpSendResult` plus the FULFILL preimage, populated only when the sender
|
|
425
|
+
* knew what to expect and the bytes matched.
|
|
398
426
|
*/
|
|
399
427
|
interface IlpSendResultWithFulfillment extends IlpSendResult {
|
|
400
|
-
/** Base64 32-byte fulfillment preimage (verified
|
|
428
|
+
/** Base64 32-byte fulfillment preimage (verified against the expected one). */
|
|
401
429
|
fulfillment?: string;
|
|
402
430
|
}
|
|
403
431
|
/** ILP code used for a client-side fulfillment-verification failure. */
|
|
@@ -406,16 +434,20 @@ declare const FULFILLMENT_MISMATCH_CODE = "F99";
|
|
|
406
434
|
declare const FULFILLMENT_MISMATCH_MESSAGE: string;
|
|
407
435
|
/**
|
|
408
436
|
* Map a parsed ILP response packet to an `IlpSendResult`, enforcing the
|
|
409
|
-
* sender-
|
|
437
|
+
* sender's end-to-end delivery check when it knows what to expect.
|
|
438
|
+
*
|
|
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.
|
|
410
445
|
*
|
|
411
|
-
*
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
* not a thrown error — is deliberate: transports only retry thrown
|
|
415
|
-
* `NetworkError`s, so a forged/wrong FULFILL is never retried — re-sending
|
|
416
|
-
* would re-spend the attached claim.
|
|
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.
|
|
417
449
|
*/
|
|
418
|
-
declare function mapIlpResponse(packet: ILPResponsePacket,
|
|
450
|
+
declare function mapIlpResponse(packet: ILPResponsePacket, expectedFulfillment?: Uint8Array): IlpSendResultWithFulfillment;
|
|
419
451
|
|
|
420
452
|
/**
|
|
421
453
|
* The ILP transport port: what a carriage must be able to do, and what it
|
|
@@ -503,6 +535,23 @@ interface ClaimSendingTransport$1 extends IlpClient {
|
|
|
503
535
|
interface ChannelStoreEntry {
|
|
504
536
|
nonce: number;
|
|
505
537
|
cumulativeAmount: bigint;
|
|
538
|
+
/**
|
|
539
|
+
* The highest cumulative this client has ever SIGNED on the channel, which a
|
|
540
|
+
* rollback deliberately does not lower. It is the ceiling on what the
|
|
541
|
+
* connector can possibly have banked — nothing it never received a signature
|
|
542
|
+
* for is claimable — and so the clamp on adopting the connector's own figure
|
|
543
|
+
* (see {@link ChannelManager.adoptConnectorWatermark}).
|
|
544
|
+
*/
|
|
545
|
+
signedCeiling?: bigint;
|
|
546
|
+
/**
|
|
547
|
+
* Set when a signed claim's fate is unknown (a transport error or a timeout,
|
|
548
|
+
* where the packet may have been delivered and banked anyway) or when the
|
|
549
|
+
* connector refused one. It means "our watermark and the connector's may
|
|
550
|
+
* disagree", and the next claim on this channel reconciles against
|
|
551
|
+
* `POST /ilp/claim-state` before it is signed. Persisted because a timeout in
|
|
552
|
+
* one `toon` invocation desyncs the next one.
|
|
553
|
+
*/
|
|
554
|
+
watermarkUncertain?: boolean;
|
|
506
555
|
/** Unix SECONDS when close was initiated (withdraw flow). */
|
|
507
556
|
closedAt?: bigint;
|
|
508
557
|
/** Unix SECONDS the channel becomes settleable (= closedAt + settlementTimeout). */
|
|
@@ -1561,12 +1610,28 @@ interface RoutePrice extends RouteCharge {
|
|
|
1561
1610
|
* bytes of `SealedExchange.data`, not the caller's request body, which is
|
|
1562
1611
|
* smaller by the envelope and the wrap. So a charge can only be computed after
|
|
1563
1612
|
* sealing, which is why {@link ../client/send.js!send} seals before it prices.
|
|
1564
|
-
*
|
|
1565
|
-
*
|
|
1566
|
-
* `
|
|
1567
|
-
*
|
|
1568
|
-
*
|
|
1569
|
-
*
|
|
1613
|
+
* Those bytes are the PREPARE's `data` field verbatim on both carriages
|
|
1614
|
+
* (`HttpIlpClient.postPrepare`, `BtpRuntimeClient`), so `sealedBytes` is exactly
|
|
1615
|
+
* the `prepare.data.len()` the connector prices — no envelope, header or framing
|
|
1616
|
+
* sits between the two counts.
|
|
1617
|
+
*
|
|
1618
|
+
* The unit count is `ceil(bytes / 1024)`: whole kibibytes plus one for any
|
|
1619
|
+
* remainder, and **zero** for an empty payload, which pays the base alone. That
|
|
1620
|
+
* is the connector's own `Price::charge`
|
|
1621
|
+
* (`connector-domain/src/price.rs`, `bytes.div_ceil(1024)`, connector ADR 0065),
|
|
1622
|
+
* evaluated there against the same `prepare.data.len()` at every gate that
|
|
1623
|
+
* charges — the client edge, the peer price gate, and the termination.
|
|
1624
|
+
*
|
|
1625
|
+
* Measured against the deployed store node at `1000 + 10/KiB`, whose x402
|
|
1626
|
+
* greeting quotes the charge for the packet it was handed:
|
|
1627
|
+
* 0 bytes → 1000, 1 → 1010, 1023 → 1010, **1024 → 1010**, 1025 → 1020,
|
|
1628
|
+
* **2048 → 1020**, 2049 → 1030, 5161 → 1060.
|
|
1629
|
+
*
|
|
1630
|
+
* This used to compute `floor(bytes / 1024) + 1` (toon-client#629), which agrees
|
|
1631
|
+
* with `ceil` everywhere except an exact multiple of 1024 and an empty payload,
|
|
1632
|
+
* where it charged one kibibyte too many. Every size that had actually been
|
|
1633
|
+
* measured was a non-multiple, so the fit held and the overpay — silent, since a
|
|
1634
|
+
* claim that advances more than the price is simply accepted — went unnoticed.
|
|
1570
1635
|
*/
|
|
1571
1636
|
declare function chargeFor(terms: RouteCharge, sealedBytes: number): bigint;
|
|
1572
1637
|
/** Which carriage a route insists on, when its routes agree on one. */
|
|
@@ -2707,6 +2772,23 @@ declare class ToonClient implements ToonClientLike {
|
|
|
2707
2772
|
private sealKey;
|
|
2708
2773
|
/** The sealing key of a node named by its client-edge URL. */
|
|
2709
2774
|
private sealKeyAt;
|
|
2775
|
+
/**
|
|
2776
|
+
* Re-read the connector's own watermark for one channel and adopt it
|
|
2777
|
+
* (toon-client#671).
|
|
2778
|
+
*
|
|
2779
|
+
* Called by {@link send} before signing a claim on a channel whose last claim
|
|
2780
|
+
* was signed and never confirmed — a transport error, a timeout, or a refusal.
|
|
2781
|
+
* A packet that timed out on a long path may have been delivered and banked
|
|
2782
|
+
* anyway, and the local figure would then be one claim behind for good: every
|
|
2783
|
+
* later claim under-advances and is refused. The connector's figure is the one
|
|
2784
|
+
* that decides, so it is asked, and {@link ChannelManager.adoptConnectorWatermark}
|
|
2785
|
+
* takes it (clamped to what this client has actually signed).
|
|
2786
|
+
*
|
|
2787
|
+
* A channel the connector cannot verify (`ok: false`) leaves the doubt in
|
|
2788
|
+
* place rather than resolving it wrongly — `"unverified"` covers "no such
|
|
2789
|
+
* channel" and "bad signature" identically, and neither is a watermark.
|
|
2790
|
+
*/
|
|
2791
|
+
private reconcileWatermark;
|
|
2710
2792
|
/**
|
|
2711
2793
|
* Retire the binding a refused claim was drawn on. `false` when there is
|
|
2712
2794
|
* nothing to retire, which is {@link send}'s signal not to retry.
|
|
@@ -2968,6 +3050,18 @@ declare function decodeEnvelope(buf: Uint8Array, direction: 'request' | 'respons
|
|
|
2968
3050
|
* {@link ../client/send.js} calls it on every refusal path — including a thrown
|
|
2969
3051
|
* transport error, where nothing is known to have arrived at all.
|
|
2970
3052
|
*
|
|
3053
|
+
* ## And a refusal that never arrives
|
|
3054
|
+
*
|
|
3055
|
+
* Rolling back on a thrown transport error assumes nothing arrived, which is
|
|
3056
|
+
* the safer guess but is sometimes simply wrong: a request that times out on a
|
|
3057
|
+
* long path can have been delivered and banked anyway, and then our figure is
|
|
3058
|
+
* one claim BEHIND the connector's rather than level with it. Every later claim
|
|
3059
|
+
* under-advances and is refused (toon-client#671). So the assumption is no
|
|
3060
|
+
* longer left standing: {@link ChannelManager.markWatermarkUncertain} records
|
|
3061
|
+
* the doubt, and the next claim on that channel resolves it against the
|
|
3062
|
+
* connector's own watermark through
|
|
3063
|
+
* {@link ChannelManager.adoptConnectorWatermark} before it is signed.
|
|
3064
|
+
*
|
|
2971
3065
|
* ## The binding
|
|
2972
3066
|
*
|
|
2973
3067
|
* A binding says "this is the channel I hold with THAT connector, on THAT chain,
|
|
@@ -2977,6 +3071,25 @@ declare function decodeEnvelope(buf: Uint8Array, direction: 'request' | 'respons
|
|
|
2977
3071
|
* a second lot of collateral.
|
|
2978
3072
|
*/
|
|
2979
3073
|
|
|
3074
|
+
/**
|
|
3075
|
+
* What {@link ChannelManager.adoptConnectorWatermark} did.
|
|
3076
|
+
*
|
|
3077
|
+
* `moved` is signed: positive when the connector had banked MORE than we had
|
|
3078
|
+
* recorded (the timed-out packet was delivered after all), negative when it had
|
|
3079
|
+
* banked less (a claim we signed never reached it). `clampedTo` is present only
|
|
3080
|
+
* when the connector reported a figure above anything we ever signed — which it
|
|
3081
|
+
* cannot have a claim for, and which was therefore not adopted.
|
|
3082
|
+
*/
|
|
3083
|
+
type WatermarkAdoption = {
|
|
3084
|
+
adopted: false;
|
|
3085
|
+
moved: bigint;
|
|
3086
|
+
} | {
|
|
3087
|
+
adopted: true;
|
|
3088
|
+
moved: bigint;
|
|
3089
|
+
cumulative: bigint;
|
|
3090
|
+
nonce: number;
|
|
3091
|
+
clampedTo?: bigint;
|
|
3092
|
+
};
|
|
2980
3093
|
interface ChannelManagerConfig {
|
|
2981
3094
|
/**
|
|
2982
3095
|
* Collateral (base units) {@link ChannelManager.ensureChannel} locks when it
|
|
@@ -3165,10 +3278,75 @@ declare class ChannelManager {
|
|
|
3165
3278
|
* Re-signing at the next nonce with the restored cumulative is exactly what the
|
|
3166
3279
|
* spec's own remedy for an over-deposit refusal describes.
|
|
3167
3280
|
*
|
|
3281
|
+
* **The signed ceiling is not rolled back either.** What was signed was
|
|
3282
|
+
* signed, and the ceiling exists to remember exactly that — it bounds what
|
|
3283
|
+
* {@link ChannelManager.adoptConnectorWatermark} will believe the connector
|
|
3284
|
+
* when it reports having banked.
|
|
3285
|
+
*
|
|
3168
3286
|
* Clamped at zero, and a no-op for an untracked channel: this runs on error
|
|
3169
3287
|
* paths, and an error path that throws its own error hides the original.
|
|
3170
3288
|
*/
|
|
3171
3289
|
rollbackAmount(channelId: string, amount: bigint): void;
|
|
3290
|
+
/**
|
|
3291
|
+
* Record that this channel's watermark is in DOUBT: the last claim signed on
|
|
3292
|
+
* it was either sent into a transport error or a timeout — where the packet
|
|
3293
|
+
* may have been delivered and banked regardless of what this end saw — or was
|
|
3294
|
+
* refused by the connector. Either way our figure and the connector's may no
|
|
3295
|
+
* longer agree, and guessing which way costs a refused claim per request
|
|
3296
|
+
* (toon-client#671).
|
|
3297
|
+
*
|
|
3298
|
+
* The doubt is recorded rather than resolved, because resolving it here would
|
|
3299
|
+
* mean a second network round trip bolted onto a request that has already
|
|
3300
|
+
* failed, to a connector that may be exactly what is unreachable. It is
|
|
3301
|
+
* resolved instead at the one moment the answer is actually needed — before
|
|
3302
|
+
* the NEXT claim is signed — by {@link ChannelManager.adoptConnectorWatermark}
|
|
3303
|
+
* with what `POST /ilp/claim-state` reports.
|
|
3304
|
+
*
|
|
3305
|
+
* Persisted, and a no-op for an untracked channel: this runs on error paths.
|
|
3306
|
+
*/
|
|
3307
|
+
markWatermarkUncertain(channelId: string): void;
|
|
3308
|
+
/**
|
|
3309
|
+
* Record that this channel's watermark is known good again: the connector
|
|
3310
|
+
* banked the claim we signed, at the figure we signed it at, so the two agree
|
|
3311
|
+
* by construction.
|
|
3312
|
+
*
|
|
3313
|
+
* The cheap half of the reconciliation — a banked claim is proof, and proof
|
|
3314
|
+
* costs nothing, where {@link ChannelManager.adoptConnectorWatermark} costs a
|
|
3315
|
+
* round trip. Without it a channel that once timed out would re-read the
|
|
3316
|
+
* connector's watermark before every later claim.
|
|
3317
|
+
*/
|
|
3318
|
+
markWatermarkCertain(channelId: string): void;
|
|
3319
|
+
/** Whether the next claim on `channelId` must reconcile before it is signed. */
|
|
3320
|
+
isWatermarkUncertain(channelId: string): boolean;
|
|
3321
|
+
/**
|
|
3322
|
+
* Adopt the connector's OWN watermark for a channel, and clear the doubt
|
|
3323
|
+
* {@link ChannelManager.markWatermarkUncertain} recorded.
|
|
3324
|
+
*
|
|
3325
|
+
* The connector's figure is the one that decides — a claim is validated
|
|
3326
|
+
* against what IT has banked (`client-edge-spec.md` §1.3) — so on a
|
|
3327
|
+
* disagreement it is adopted rather than argued with. Two guards make that
|
|
3328
|
+
* safe to do with a number that arrived over the network:
|
|
3329
|
+
*
|
|
3330
|
+
* - **The cumulative is clamped to {@link ChannelTracking.signedCeiling}**,
|
|
3331
|
+
* the highest figure this client has ever signed. A connector can only bank
|
|
3332
|
+
* a claim it holds our signature for, so a report above that ceiling is not
|
|
3333
|
+
* a fact about this channel and must not become one: adopting it would sign
|
|
3334
|
+
* away value that was never spent. The clamp is the whole reason the ceiling
|
|
3335
|
+
* is tracked.
|
|
3336
|
+
* - **The nonce only ever rises.** A claim is a bearer instrument and a nonce
|
|
3337
|
+
* is the only thing that stops one being re-issued, so the local nonce moves
|
|
3338
|
+
* to whichever of the two figures is higher — never down to the connector's,
|
|
3339
|
+
* even when the connector's is lower because a claim we signed never reached
|
|
3340
|
+
* it.
|
|
3341
|
+
*
|
|
3342
|
+
* @returns what was adopted, and how far the cumulative moved (negative when
|
|
3343
|
+
* the connector had banked LESS than we had recorded), so a caller can say
|
|
3344
|
+
* so out loud.
|
|
3345
|
+
*/
|
|
3346
|
+
adoptConnectorWatermark(channelId: string, connector: {
|
|
3347
|
+
nonce: number;
|
|
3348
|
+
cumulativeClaimed: bigint;
|
|
3349
|
+
}): WatermarkAdoption;
|
|
3172
3350
|
private buildMetadata;
|
|
3173
3351
|
/** The last nonce signed on a tracked channel. */
|
|
3174
3352
|
getNonce(channelId: string): number;
|
|
@@ -3275,6 +3453,18 @@ interface SendContext {
|
|
|
3275
3453
|
evictChannel(channelId: string): boolean;
|
|
3276
3454
|
/** The watermark and the signers. */
|
|
3277
3455
|
channels: ChannelManager;
|
|
3456
|
+
/**
|
|
3457
|
+
* Re-read the connector's own watermark for `channelId`
|
|
3458
|
+
* (`POST /ilp/claim-state`) and adopt it, settling a doubt
|
|
3459
|
+
* {@link ChannelManager.markWatermarkUncertain} recorded.
|
|
3460
|
+
*
|
|
3461
|
+
* Optional: a context with no client edge to ask simply keeps the older
|
|
3462
|
+
* behaviour of discovering the disagreement through a refusal. It may throw —
|
|
3463
|
+
* it is a network call, and the connector may be exactly what is unreachable —
|
|
3464
|
+
* and {@link send} treats that as "still in doubt" rather than as a failed
|
|
3465
|
+
* request.
|
|
3466
|
+
*/
|
|
3467
|
+
reconcileWatermark?(channelId: string): Promise<void>;
|
|
3278
3468
|
/** The carriage, chosen and connected. */
|
|
3279
3469
|
transport(description: NodeSelfDescription): Promise<{
|
|
3280
3470
|
kind: 'http' | 'btp';
|
|
@@ -4304,19 +4494,18 @@ declare class BtpRuntimeClient implements IlpClient {
|
|
|
4304
4494
|
* Sends an ILP packet via BTP with auto-reconnect on connection errors.
|
|
4305
4495
|
* Satisfies IlpClient interface.
|
|
4306
4496
|
*
|
|
4307
|
-
* `params` may carry
|
|
4308
|
-
* `
|
|
4309
|
-
*
|
|
4310
|
-
*
|
|
4311
|
-
* as a failed result — see `mapIlpResponse`.
|
|
4497
|
+
* `params` may carry an `expectedFulfillment` (the sender's end-to-end
|
|
4498
|
+
* check, ADR 0069), a `greeting` flag and an explicit `expiresAt`. With an
|
|
4499
|
+
* expected fulfilment the FULFILL preimage is compared against it and a
|
|
4500
|
+
* mismatch is surfaced as a failed result — see `mapIlpResponse`.
|
|
4312
4501
|
*/
|
|
4313
4502
|
sendIlpPacket(params: IlpSendParams): Promise<IlpSendResult>;
|
|
4314
4503
|
/**
|
|
4315
4504
|
* Sends a balance proof claim via BTP protocol data, then sends an ILP packet.
|
|
4316
4505
|
* Auto-reconnects on connection errors.
|
|
4317
4506
|
*
|
|
4318
|
-
*
|
|
4319
|
-
*
|
|
4507
|
+
* `expectedFulfillment` / `greeting` / `expiresAt` semantics are identical
|
|
4508
|
+
* to {@link sendIlpPacket}.
|
|
4320
4509
|
*/
|
|
4321
4510
|
sendIlpPacketWithClaim(params: IlpSendParams, claim: Record<string, unknown>): Promise<IlpSendResult>;
|
|
4322
4511
|
/**
|
|
@@ -4328,11 +4517,11 @@ declare class BtpRuntimeClient implements IlpClient {
|
|
|
4328
4517
|
sendClaimMessage(claim: Record<string, unknown>): Promise<void>;
|
|
4329
4518
|
private _sendClaimMessageOnce;
|
|
4330
4519
|
/**
|
|
4331
|
-
* Build the ILP PREPARE for a send, applying the
|
|
4332
|
-
* explicit expiry when provided
|
|
4333
|
-
*
|
|
4334
|
-
*
|
|
4335
|
-
*
|
|
4520
|
+
* Build the ILP PREPARE for a send, applying the
|
|
4521
|
+
* explicit expiry when provided, carrying the `greeting` flag ADR 0069 put
|
|
4522
|
+
* where the execution condition used to be, and validating that an expected
|
|
4523
|
+
* fulfilment is exactly 32 bytes (a wrong-length one could never match a
|
|
4524
|
+
* real FULFILL, so every delivery would be counted failed).
|
|
4336
4525
|
*/
|
|
4337
4526
|
private buildPrepare;
|
|
4338
4527
|
/**
|
|
@@ -4477,11 +4666,10 @@ declare class HttpIlpClient implements IlpClient {
|
|
|
4477
4666
|
* this only on free/zero-amount routes; paid writes must use
|
|
4478
4667
|
* {@link sendIlpPacketWithClaim}. Satisfies the IlpClient interface.
|
|
4479
4668
|
*
|
|
4480
|
-
* `params` may carry
|
|
4481
|
-
* `
|
|
4482
|
-
*
|
|
4483
|
-
*
|
|
4484
|
-
* as a failed result — see {@link mapIlpResponse}.
|
|
4669
|
+
* `params` may carry an `expectedFulfillment` (the sender's end-to-end
|
|
4670
|
+
* check, ADR 0069), a `greeting` flag and an explicit `expiresAt`. With an
|
|
4671
|
+
* expected fulfilment the FULFILL preimage is compared against it and a
|
|
4672
|
+
* mismatch is surfaced as a failed result — see {@link mapIlpResponse}.
|
|
4485
4673
|
*/
|
|
4486
4674
|
sendIlpPacket(params: IlpSendParams): Promise<IlpSendResult>;
|
|
4487
4675
|
/**
|
|
@@ -4490,8 +4678,8 @@ declare class HttpIlpClient implements IlpClient {
|
|
|
4490
4678
|
* the BTP path attaches as the `payment-channel-claim` protocolData entry —
|
|
4491
4679
|
* we base64(JSON.stringify(claim)) it, byte-for-byte identical to BTP.
|
|
4492
4680
|
*
|
|
4493
|
-
*
|
|
4494
|
-
*
|
|
4681
|
+
* `expectedFulfillment` / `greeting` / `expiresAt` semantics are identical
|
|
4682
|
+
* to {@link sendIlpPacket}.
|
|
4495
4683
|
*/
|
|
4496
4684
|
sendIlpPacketWithClaim(params: IlpSendParams, claim: unknown): Promise<IlpSendResult>;
|
|
4497
4685
|
/**
|
|
@@ -4546,9 +4734,9 @@ declare class HttpIlpClient implements IlpClient {
|
|
|
4546
4734
|
* to a transport error. Per the wire contract, ILP-level rejects arrive as a
|
|
4547
4735
|
* 200 + REJECT body — only HTTP non-2xx means a transport-layer failure.
|
|
4548
4736
|
*
|
|
4549
|
-
* When `
|
|
4550
|
-
* it; a mismatch yields `accepted: false` (shared `mapIlpResponse`
|
|
4551
|
-
* identical to the BTP path).
|
|
4737
|
+
* When `expectedFulfillment` is given the FULFILL preimage is compared
|
|
4738
|
+
* against it; a mismatch yields `accepted: false` (shared `mapIlpResponse`
|
|
4739
|
+
* logic, identical to the BTP path).
|
|
4552
4740
|
*/
|
|
4553
4741
|
private mapResponse;
|
|
4554
4742
|
private mapTransportError;
|
|
@@ -4880,12 +5068,13 @@ declare function decodeVarOctetString(buf: Uint8Array, offset: number): Decoded<
|
|
|
4880
5068
|
* - **Response framing.** `0x02 ‖ nonce(12) ‖ ciphertext`, the plaintext being
|
|
4881
5069
|
* just the encoded envelope. Sealed directly with the request's shared
|
|
4882
5070
|
* secret.
|
|
4883
|
-
* - **Fulfilment
|
|
4884
|
-
* "toon-giftwrap-fulfillment")
|
|
4885
|
-
*
|
|
4886
|
-
*
|
|
4887
|
-
*
|
|
4888
|
-
*
|
|
5071
|
+
* - **Fulfilment.** `fulfilment = HKDF-SHA256(shared_secret,
|
|
5072
|
+
* "toon-giftwrap-fulfillment")`. The terminating connector recovers the
|
|
5073
|
+
* secret by opening the wrap and derives the preimage without asking the
|
|
5074
|
+
* app anything; the sender, which drew that secret, derives the same bytes
|
|
5075
|
+
* and so can check a delivery end to end. Nothing is minted onto the
|
|
5076
|
+
* PREPARE from it — connector ADR 0069 took the execution condition off the
|
|
5077
|
+
* wire entirely.
|
|
4889
5078
|
* - **Telling a sealed reject from a plaintext one.** The leading type byte,
|
|
4890
5079
|
* and only that (`looks_like_sealed_response`). A reject raised short of the
|
|
4891
5080
|
* termination shares no secret with the sender and carries empty `data`; an
|
|
@@ -5019,11 +5208,11 @@ declare function sealRequestWithRandomness(plaintext: Uint8Array, receiverPublic
|
|
|
5019
5208
|
* so no two sealed requests — even to the same receiver, even with the same
|
|
5020
5209
|
* plaintext — share any of the three.
|
|
5021
5210
|
*
|
|
5022
|
-
* Returns the wire bytes and the shared secret.
|
|
5023
|
-
*
|
|
5024
|
-
*
|
|
5025
|
-
*
|
|
5026
|
-
*
|
|
5211
|
+
* Returns the wire bytes and the shared secret. Keep that secret: the
|
|
5212
|
+
* terminating connector recovers the same one by opening this wrap, so
|
|
5213
|
+
* {@link deriveFulfillment} of it is the preimage an honest FULFILL will
|
|
5214
|
+
* carry — the sender's only way to check a delivery end to end now that no
|
|
5215
|
+
* condition rides on the wire (connector ADR 0069).
|
|
5027
5216
|
*/
|
|
5028
5217
|
declare function sealRequest(plaintext: Uint8Array, receiverPublicKey: Uint8Array): SealedRequest;
|
|
5029
5218
|
/**
|
|
@@ -5074,22 +5263,6 @@ declare function looksLikeSealedResponse(bytes: Uint8Array): boolean;
|
|
|
5074
5263
|
* secret also derives, so it can never collide with either.
|
|
5075
5264
|
*/
|
|
5076
5265
|
declare function deriveFulfillment(sharedSecret: Uint8Array): Uint8Array;
|
|
5077
|
-
/**
|
|
5078
|
-
* The condition a `fulfillment` satisfies: `sha256(fulfillment)` —
|
|
5079
|
-
* `connector_domain::condition::derive_condition`. Hashing only ever runs in
|
|
5080
|
-
* this direction; there is deliberately no function here that goes from a
|
|
5081
|
-
* condition back to a fulfilment.
|
|
5082
|
-
*
|
|
5083
|
-
* The hash is the same one `utils/condition.ts` already uses; what ADR 0019
|
|
5084
|
-
* changes is where the preimage comes from. `mintExecutionCondition` there
|
|
5085
|
-
* draws a random preimage the sender must then carry to the FULFILL itself;
|
|
5086
|
-
* here the preimage is DERIVED from the secret sealed inside the packet, so
|
|
5087
|
-
* the terminating connector can produce it without the sender or the app
|
|
5088
|
-
* handing it over. Checking a returned fulfilment against a condition is
|
|
5089
|
-
* unchanged either way — use `fulfillmentMatchesCondition` from
|
|
5090
|
-
* `utils/condition.ts` for that rather than a second copy of it here.
|
|
5091
|
-
*/
|
|
5092
|
-
declare function deriveCondition(fulfillment: Uint8Array): Uint8Array;
|
|
5093
5266
|
|
|
5094
5267
|
/**
|
|
5095
5268
|
* One sealed request/answer exchange with a terminating connector (ADR 0018,
|
|
@@ -5101,11 +5274,11 @@ declare function deriveCondition(fulfillment: Uint8Array): Uint8Array;
|
|
|
5101
5274
|
*
|
|
5102
5275
|
* - The `data` is a gift wrap addressed to the connector that TERMINATES the
|
|
5103
5276
|
* route, around an OER envelope — never HTTP text, never a bare payload.
|
|
5104
|
-
* - The
|
|
5105
|
-
*
|
|
5106
|
-
*
|
|
5107
|
-
*
|
|
5108
|
-
* path
|
|
5277
|
+
* - The fulfilment an honest answer carries is DERIVED from the very secret
|
|
5278
|
+
* that wrap carries (ADR 0019). Since ADR 0069 took the execution condition
|
|
5279
|
+
* off the wire, comparing a returned preimage against that derivation is
|
|
5280
|
+
* the sender's only delivery check — and the only one made anywhere on the
|
|
5281
|
+
* path, since no hop verifies a FULFILL any more.
|
|
5109
5282
|
* - The answer is sealed with that same secret, so opening it requires having
|
|
5110
5283
|
* kept it from the seal.
|
|
5111
5284
|
*
|
|
@@ -5133,23 +5306,16 @@ declare function deriveCondition(fulfillment: Uint8Array): Uint8Array;
|
|
|
5133
5306
|
*/
|
|
5134
5307
|
|
|
5135
5308
|
/**
|
|
5136
|
-
* A sealed request, ready to become a PREPARE: what goes in `data`,
|
|
5137
|
-
*
|
|
5309
|
+
* A sealed request, ready to become a PREPARE: what goes in `data`, the secret
|
|
5310
|
+
* needed to read the answer, and the fulfilment that answer must carry.
|
|
5138
5311
|
*
|
|
5139
|
-
* The three are produced together and belong together
|
|
5140
|
-
*
|
|
5141
|
-
*
|
|
5312
|
+
* The three are produced together and belong together: opening the answer with
|
|
5313
|
+
* any other secret fails, and checking a FULFILL against any other fulfilment
|
|
5314
|
+
* rejects a delivery that was genuine.
|
|
5142
5315
|
*/
|
|
5143
5316
|
interface SealedExchange {
|
|
5144
5317
|
/** The gift wrap to carry as the PREPARE's `data`. */
|
|
5145
5318
|
readonly data: Uint8Array;
|
|
5146
|
-
/**
|
|
5147
|
-
* The PREPARE's `executionCondition`: `sha256(deriveFulfillment(secret))`.
|
|
5148
|
-
* Derived, never random and never caller-supplied — the terminating
|
|
5149
|
-
* connector recovers the same secret and derives the same fulfilment
|
|
5150
|
-
* without the app participating (ADR 0019).
|
|
5151
|
-
*/
|
|
5152
|
-
readonly condition: Uint8Array;
|
|
5153
5319
|
/**
|
|
5154
5320
|
* The 32-byte secret sealed inside the wrap. Keep it until the answer is
|
|
5155
5321
|
* read; it is the only thing that opens the response. Never send it
|
|
@@ -5157,9 +5323,11 @@ interface SealedExchange {
|
|
|
5157
5323
|
*/
|
|
5158
5324
|
readonly sharedSecret: Uint8Array;
|
|
5159
5325
|
/**
|
|
5160
|
-
* The fulfilment the terminating connector will return
|
|
5161
|
-
*
|
|
5162
|
-
*
|
|
5326
|
+
* The fulfilment the terminating connector will return —
|
|
5327
|
+
* `deriveFulfillment(sharedSecret)`. Pass it to a transport as
|
|
5328
|
+
* `expectedFulfillment`: comparing a FULFILL's preimage against this is the
|
|
5329
|
+
* sender's end-to-end check, and since ADR 0069 the only fulfilment check
|
|
5330
|
+
* made anywhere on the path.
|
|
5163
5331
|
*/
|
|
5164
5332
|
readonly fulfillment: Uint8Array;
|
|
5165
5333
|
}
|
|
@@ -6684,4 +6852,4 @@ interface RetryOptions {
|
|
|
6684
6852
|
*/
|
|
6685
6853
|
declare function withRetry<T>(operation: () => Promise<T>, options: RetryOptions): Promise<T>;
|
|
6686
6854
|
|
|
6687
|
-
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,
|
|
6855
|
+
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 };
|