@toon-protocol/client 3.1.1 → 3.3.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/index.d.ts CHANGED
@@ -1,131 +1,8 @@
1
+ import { C as ChainKind, a as ChannelStatus, b as ChannelTerms, c as ChannelClient, O as OnChainChannelStatus, d as OpenChannelResult, e as OpenChannelParams } from './hidden-service-BsBH2HNi.js';
2
+ export { H as HiddenServiceTransport, f as HiddenServiceTransportOptions, v as validateSocks5hUrl } from './hidden-service-BsBH2HNi.js';
1
3
  import { PrivateKeyAccount } from 'viem/accounts';
2
- export { HiddenServiceTransport, HiddenServiceTransportOptions, validateSocks5hUrl } from './transport/hidden-service.js';
3
4
  import { http } from 'viem';
4
5
 
5
- /**
6
- * The on-chain channel port: what the client needs a chain to be able to do,
7
- * independent of which chain it is.
8
- *
9
- * These types were `@toon-protocol/core`'s `ConnectorChannelClient` family,
10
- * whose names still carried the retired admin-API model — a channel opened by
11
- * `POST /admin/channels` on the connector. That is not how a channel comes into
12
- * existence any more, and the naming mattered: **a connector has no endpoint
13
- * that opens a channel** (`self-description-spec.md` ND-03). The client opens,
14
- * funds, closes and settles the channel itself, directly on chain, and the
15
- * connector discovers it by reading the chain
16
- * ([ADR 0052](https://github.com/toon-protocol/connector/blob/main/docs/adr/0052-permissionless-payment-is-guaranteed-and-a-claim-is-what-authorises.md)).
17
- * So this is a port over *chains*, not over the connector.
18
- */
19
- /** Which settlement family a channel lives in. Mina is gone (connector ADR 0002). */
20
- type ChainKind = 'evm' | 'solana';
21
- /**
22
- * Everything needed to open one channel, as read off the connector's own
23
- * self-description (`GET /ilp` → `settlements[]`) rather than configured.
24
- *
25
- * The connector proved each of these against a live chain at startup
26
- * (`self-description-spec.md` ND-07), which is why they are taken from the
27
- * document instead of from a preset: two declarations of one fact is how a
28
- * mainnet node comes to describe itself as devnet.
29
- */
30
- interface ChannelTerms {
31
- kind: ChainKind;
32
- /** The chain key exactly as published: `evm:84532`, or `solana`. */
33
- chain: string;
34
- /** EVM only: the numeric chain id parsed out of `chain`. The EIP-712 domain's `chainId`. */
35
- chainId?: number;
36
- /**
37
- * The connector's own settlement address — the counterparty this channel is
38
- * opened *with*. `0x…` on EVM, base58 on Solana.
39
- */
40
- counterparty: string;
41
- /** ERC-20 address, or the SPL mint. */
42
- token: string;
43
- /** Base units per whole token, as the connector reports it. */
44
- decimals: number;
45
- /** EVM: the `TokenNetwork` — the EIP-712 `verifyingContract` a claim is signed under. */
46
- tokenNetwork?: string;
47
- /** EVM: the `TokenNetworkRegistry` that minted the `TokenNetwork`; the stable address. */
48
- tokenNetworkRegistry?: string;
49
- /** Solana: the settlement program the channel account lives under, bound into every claim (ADR 0053). */
50
- programId?: string;
51
- }
52
- /** Parameters for opening a channel on chain. */
53
- interface OpenChannelParams {
54
- terms: ChannelTerms;
55
- /** Initial collateral, in the token's base units. */
56
- initialDeposit?: bigint;
57
- /**
58
- * Challenge period in seconds. The EVM `TokenNetwork` enforces a one-hour
59
- * floor; the Solana program takes it as the channel's `challenge_duration`.
60
- */
61
- settlementTimeout?: number;
62
- }
63
- /** What opening produced. */
64
- interface OpenChannelResult {
65
- /** `0x…` 32 bytes on EVM; the channel account's base58 pubkey on Solana. */
66
- channelId: string;
67
- status: ChannelStatus;
68
- /** The transaction that opened it. Absent when an existing channel was adopted. */
69
- txHash?: string;
70
- /** On-chain collateral after opening, when the opener read it back. */
71
- depositTotal?: bigint;
72
- }
73
- /**
74
- * Where a channel is in its lifecycle.
75
- *
76
- * `opening` is real and worth distinguishing: the opening transaction is
77
- * submitted but not yet confirmed, so the channel does not exist for anyone
78
- * reading the chain — including the connector, which resolves a claim's channel
79
- * by reading it. A claim signed in that window is refused as naming an unknown
80
- * channel, and the remedy is to wait rather than to re-sign.
81
- */
82
- type ChannelStatus = 'opening' | 'open' | 'closed' | 'settled' | 'missing';
83
- /** A channel as the chain currently reports it. */
84
- interface OnChainChannelStatus {
85
- channelId: string;
86
- status: ChannelStatus;
87
- /** The chain key this channel lives on, when the reader knows it. */
88
- chain?: string;
89
- /** This participant's collateral, in base units. */
90
- deposit?: bigint;
91
- /** Unix seconds the channel was closed, when it is closed. */
92
- closedAt?: bigint;
93
- /** Unix seconds after which `settle` is permitted. */
94
- settleableAt?: bigint;
95
- }
96
- /**
97
- * One chain's implementation of the lifecycle.
98
- *
99
- * Every method here is a transaction the *client* signs and pays gas for. None
100
- * of them talks to a connector.
101
- */
102
- interface ChannelClient {
103
- openChannel(params: OpenChannelParams): Promise<OpenChannelResult>;
104
- /**
105
- * Add collateral. `currentDeposit` is the channel's present total, which EVM
106
- * needs because `setTotalDeposit` takes the new cumulative figure rather than
107
- * a delta — a contract shape that makes a lost or duplicated call harmless.
108
- */
109
- depositToChannel(channelId: string, amount: bigint, opts: {
110
- currentDeposit: bigint;
111
- }): Promise<{
112
- txHash?: string;
113
- depositTotal: bigint;
114
- }>;
115
- /** Start the challenge period. */
116
- closeChannel(channelId: string): Promise<{
117
- txHash?: string;
118
- closedAt: bigint;
119
- settlementTimeout: bigint;
120
- settleableAt: bigint;
121
- }>;
122
- /** Pay out and finish. Only permitted once the challenge period has elapsed. */
123
- settleChannel(channelId: string): Promise<{
124
- txHash?: string;
125
- }>;
126
- getChannelState(channelId: string): Promise<OnChainChannelStatus>;
127
- }
128
-
129
6
  /**
130
7
  * What a mnemonic derives to.
131
8
  *
@@ -808,6 +685,34 @@ declare class ChannelNotOpenError extends ToonClientError {
808
685
  declare class RouteNotPricedError extends ToonClientError {
809
686
  constructor(message: string, cause?: Error);
810
687
  }
688
+ /**
689
+ * The caller's own {@link ../client/types.js!SendOptions.beforePay} refused this
690
+ * send, and nothing was paid.
691
+ *
692
+ * Thrown rather than returned, and that is consistent with this file's rule
693
+ * rather than an exception to it: a {@link ../client/types.js!SendRefused} is
694
+ * the *connector's* verdict on a packet that travelled, and here no packet
695
+ * exists. The price was resolved, the hook said no, and the pipeline stopped
696
+ * before a channel was ensured or a balance proof was signed — which is the
697
+ * whole point of the hook, since a signed claim is a bearer instrument that
698
+ * cannot be recalled (see
699
+ * {@link ../channel/ChannelManager.js!ChannelManager.signBalanceProof}).
700
+ *
701
+ * A distinct class rather than a {@link ValidationError} because the two are
702
+ * acted on differently: a `ValidationError` says this client could not use an
703
+ * argument, while this says the caller's own rule rejected a request this client
704
+ * was perfectly able to send. {@link reason} is the hook's string, unedited, so
705
+ * the caller reads back exactly what its own check said.
706
+ */
707
+ declare class BeforePayRefusedError extends ToonClientError {
708
+ /** The reason the hook returned, verbatim. */
709
+ readonly reason: string;
710
+ /** The route the refused packet was addressed to. */
711
+ readonly destination: string;
712
+ /** The resolved price the hook was shown, in base units. */
713
+ readonly amount: bigint;
714
+ constructor(reason: string, destination: string, amount: bigint);
715
+ }
811
716
  /**
812
717
  * The connector answered an unpaid (or insufficiently paid) request with its
813
718
  * terms instead of routing it — HTTP `402`, `client-edge-spec.md` §1.4.
@@ -950,6 +855,27 @@ declare function isInsufficientGasError(err: unknown): boolean;
950
855
  * offered so the remedy is in the error rather than in the docs.
951
856
  */
952
857
  declare function chainUnavailableMessage(wanted: ChainKind | undefined, offered: string[], reason: 'no-key' | 'not-offered' | 'none'): string;
858
+ /**
859
+ * A chain write that was sent and did not end confirmed and clean. It names the
860
+ * transaction, so whoever handles it can look the transaction up before doing
861
+ * anything that would repeat it (connector ADR 0073, decision 5).
862
+ *
863
+ * - `failed`: it landed and its execution failed. Nothing to reconcile.
864
+ * - `expired`: Solana only. Its blockhash is past `lastValidBlockHeight` and it
865
+ * never appeared, so it cannot land. Safe to send again.
866
+ * - `unknown`: no answer settled it before the deadline, usually because the RPC
867
+ * stopped answering. It may still land. Repeating it blindly can do the thing
868
+ * twice. A Solana deposit is incremental, so a repeated one deposits twice.
869
+ *
870
+ * Distinct from a {@link NetworkError}: that one means the request may never
871
+ * have reached the chain. This one means it did, or may have.
872
+ */
873
+ declare class TransactionOutcomeError extends ToonClientError {
874
+ readonly chain: ChainKind;
875
+ readonly txHash: string;
876
+ readonly outcome: 'failed' | 'expired' | 'unknown';
877
+ constructor(message: string, chain: ChainKind, txHash: string, outcome: 'failed' | 'expired' | 'unknown', cause?: Error);
878
+ }
953
879
 
954
880
  /**
955
881
  * The x402 "payment required" greeting a connector answers an unpaid request
@@ -1601,6 +1527,22 @@ interface RouteCharge {
1601
1527
  interface RoutePrice extends RouteCharge {
1602
1528
  /** The ILP address prefix. Longest matching prefix wins. */
1603
1529
  prefix: string;
1530
+ /**
1531
+ * The carriage a request to **this** prefix must arrive on, when the route
1532
+ * pins one (connector ND-05a / ADR 0072, TOON_Network#111).
1533
+ *
1534
+ * Absent — never `'both'` — on a route that accepts either, which is every
1535
+ * route no operator pinned.
1536
+ *
1537
+ * This is what makes `auto` work against a node whose routes disagree, and
1538
+ * the devnet relay is one: `g.toon.relay` is pinned to BTP,
1539
+ * `g.toon.relay.ephemeral` is not, so
1540
+ * {@link NodeSelfDescription.requiredTransport} has no honest answer and says
1541
+ * nothing while the pin is enforced on every packet.
1542
+ * {@link requiredTransportFor} reads this first and that field only as a
1543
+ * fallback.
1544
+ */
1545
+ requiredTransport?: RequiredTransport;
1604
1546
  }
1605
1547
  /**
1606
1548
  * What one packet actually costs on `terms`, given the size of its **sealed**
@@ -1805,6 +1747,8 @@ declare function readSolanaNativeBalance(opts: {
1805
1747
  rpcUrl: string;
1806
1748
  owner: string;
1807
1749
  fetchImpl?: typeof fetch;
1750
+ /** The fetch rides the SOCKS5h proxy: allow a circuit's latency. */
1751
+ proxied?: boolean;
1808
1752
  }): Promise<WalletTokenAmount>;
1809
1753
  /** Read the SPL-token balance for `owner`'s token account(s) of `mint`. */
1810
1754
  declare function readSolanaTokenBalance(opts: {
@@ -1812,6 +1756,8 @@ declare function readSolanaTokenBalance(opts: {
1812
1756
  mint: string;
1813
1757
  owner: string;
1814
1758
  fetchImpl?: typeof fetch;
1759
+ /** The fetch rides the SOCKS5h proxy: allow a circuit's latency. */
1760
+ proxied?: boolean;
1815
1761
  }): Promise<WalletBalance>;
1816
1762
  /**
1817
1763
  * Per-chain inputs for {@link readWalletBalances}: the resolved RPC URL, the
@@ -1840,6 +1786,8 @@ interface WalletBalanceSources {
1840
1786
  };
1841
1787
  /** Injectable fetch (the Solana JSON-RPC calls) for tests. */
1842
1788
  fetchImpl?: typeof fetch;
1789
+ /** `fetchImpl` rides the SOCKS5h proxy, so the Solana reads allow a circuit's latency. */
1790
+ solanaProxied?: boolean;
1843
1791
  }
1844
1792
  /**
1845
1793
  * Read the full wallet view — native coin + configured tokens — for every chain
@@ -2137,7 +2085,8 @@ declare function sendTransfer(config: TransferConfig, params: SendTransferParams
2137
2085
  * Solana `POST {faucetUrl}/api/solana/usdc-request` body `{ address }`
2138
2086
  *
2139
2087
  * The request shape is identical on both; only the path differs. The EVM leg
2140
- * mints the ungated mock USDC on Base Sepolia and best-effort tops up gas; the
2088
+ * mints devnet USDC (Circle FiatToken v2.2; the faucet key is its minter) on
2089
+ * Base Sepolia and best-effort tops up gas; the
2141
2090
  * **Solana leg drips USDC and no SOL**, so a Solana wallet needs devnet SOL
2142
2091
  * from somewhere else (`solana airdrop`) before it can pay for a transaction.
2143
2092
  *
@@ -2273,13 +2222,15 @@ interface ToonClientConfig {
2273
2222
  /** Faucet base URL for {@link WalletFacade.faucet}. Devnet only. */
2274
2223
  faucetUrl?: string;
2275
2224
  /**
2276
- * The `socks5h://` proxy through which a hidden-service connector is reached —
2277
- * a running Anyone Protocol `anon` daemon's SOCKS port, e.g.
2278
- * `socks5h://127.0.0.1:9050`.
2225
+ * The `socks5h://` proxy every byte this client sends goes through: a running
2226
+ * Anyone Protocol `anon` daemon's SOCKS port, e.g. `socks5h://127.0.0.1:9050`.
2279
2227
  *
2280
- * Required when `connector` is a `.anyone` address, and rejected as pointless
2281
- * misdirection when it is not. This library never starts a daemon itself; the
2282
- * `toon` CLI will start one for you (ADR 0001).
2228
+ * Required when `connector` is a `.anyone` address. Beside a clearnet
2229
+ * connector it makes this client a hidden payer (TOON_Network#167): the
2230
+ * client edge, the BTP socket and each chain's RPC, on a pinned circuit per
2231
+ * chain, all ride it. Nothing falls back to a direct dial. `socks5://` is
2232
+ * refused either way. This library never starts a daemon itself; the `toon`
2233
+ * CLI will start one for you (ADR 0001).
2283
2234
  *
2284
2235
  * Node only: a browser cannot dial a hidden service by any route.
2285
2236
  */
@@ -2288,8 +2239,8 @@ interface ToonClientConfig {
2288
2239
  * Send chain RPC through `socksProxy` as well as the packets. Default `true`.
2289
2240
  *
2290
2241
  * Set `false` only when the RPC endpoint is already private — your own node on
2291
- * loopback — where the extra hop buys nothing and costs latency. Leaving it on
2292
- * for a public provider is the point: see ADR 0002.
2242
+ * loopback or a private address, which no exit could reach anyway. Leaving it
2243
+ * on for a public provider is the point: see ADR 0002.
2293
2244
  */
2294
2245
  proxyRpc?: boolean;
2295
2246
  /** Injected `fetch`, for tests and non-standard runtimes. */
@@ -2329,6 +2280,58 @@ interface SendOptions {
2329
2280
  */
2330
2281
  sealTo?: Uint8Array | string;
2331
2282
  timeoutMs?: number;
2283
+ /**
2284
+ * The caller's last look before money moves. Return a string to refuse this
2285
+ * send — the string is the reason, and it arrives as a
2286
+ * {@link ../client/errors.js!BeforePayRefusedError}; return nothing to let it
2287
+ * proceed.
2288
+ *
2289
+ * It exists because **a paid route bills for an answer, and a refusal is an
2290
+ * answer.** A connector collects a route's price before the app behind it has
2291
+ * seen the request at all, so an app that rejects a body as malformed still
2292
+ * charges for having rejected it, and nothing is refunded (TOON_Network#115).
2293
+ * A caller that already knows a body is wrong wants to stop short of the
2294
+ * claim, not read about it on the bill.
2295
+ *
2296
+ * This client knows nothing about any particular app's bodies and should not:
2297
+ * what it can offer is the one check a caller cannot write for itself, at the
2298
+ * one moment that is too late to reach from outside `send`. Checking before
2299
+ * calling `send` is not the same thing, in two ways:
2300
+ *
2301
+ * - **The price is resolved here and nowhere earlier.** What a route costs is
2302
+ * the connector's to state, and a metered route's price depends on the size
2303
+ * of the *sealed* payload, which does not exist until this client has
2304
+ * sealed it. A caller vetting the cost beforehand is guessing at the figure
2305
+ * it is about to authorise; the hook is handed the real one.
2306
+ * - **The refusal provably precedes the signature.** A signed balance proof
2307
+ * is a bearer instrument, so
2308
+ * {@link ../channel/ChannelManager.js!ChannelManager.signBalanceProof}
2309
+ * advances and persists the channel's watermark *before* the packet leaves,
2310
+ * and its rollback deliberately restores the cumulative amount and **not**
2311
+ * the nonce — a re-signable nonce would put two different claims at one
2312
+ * watermark. So there is no "I changed my mind" once a claim is signed.
2313
+ * When this runs, nothing has been signed, no channel has been ensured and
2314
+ * no packet has left.
2315
+ *
2316
+ * Called exactly once per `send`, even on the bounded stale-channel retry: it
2317
+ * is a decision about a request, not about an attempt. Throwing from it also
2318
+ * refuses the send, and the throw propagates unchanged — a caller's own check
2319
+ * failing is the caller's error to read, not one for this client to re-dress.
2320
+ *
2321
+ * Runs on a free route too. Free is not the only cost a wrong body carries:
2322
+ * it still spends the round trip, the app's work, and the answer.
2323
+ */
2324
+ beforePay?: (about: {
2325
+ /** The route the packet is addressed to. */
2326
+ destination: string;
2327
+ /** What it will cost: the route's resolved price, or an explicit {@link amount}. */
2328
+ amount: bigint;
2329
+ /**
2330
+ * The request as it was handed to `send`. Already sealed by the time this
2331
+ * runs, so mutating it changes nothing that travels — read it, don't edit it.
2332
+ */
2333
+ request: SendRequest;
2334
+ }) => string | void;
2332
2335
  }
2333
2336
  /** What one claim spent. */
2334
2337
  interface ClaimSummary {
@@ -2614,7 +2617,16 @@ declare class ToonClient implements ToonClientLike {
2614
2617
  private readonly channelFacade;
2615
2618
  private description;
2616
2619
  private onChain;
2617
- private carriage;
2620
+ /**
2621
+ * One live carriage per kind, not one per client.
2622
+ *
2623
+ * A node pins carriages **per route** (connector ADR 0072), so one client can
2624
+ * legitimately owe one destination a BTP session and another an HTTP one-shot.
2625
+ * Keying by kind keeps each carriage chosen once and reused — which is the
2626
+ * point of caching at all — without letting the first destination decide for
2627
+ * every later one.
2628
+ */
2629
+ private carriages;
2618
2630
  private btpSession;
2619
2631
  private readonly hiddenService;
2620
2632
  private closed;
@@ -2812,12 +2824,18 @@ declare class ToonClient implements ToonClientLike {
2812
2824
  */
2813
2825
  private requireEvmKey;
2814
2826
  /**
2815
- * The carriage, chosen once and then reused.
2827
+ * The carriage for `destination`, chosen once per kind and then reused.
2816
2828
  *
2817
2829
  * Reuse matters for BTP specifically: the whole reason to prefer it is that one
2818
2830
  * ordered socket cannot race its own claim nonces into `F01 NonceNotAdvancing`
2819
2831
  * (`client-edge-spec.md` §1.9), and a session rebuilt per request would give
2820
2832
  * that up while paying for the handshake.
2833
+ *
2834
+ * `destination` is what lets the node's **per-route** pin decide, rather than
2835
+ * only its node-wide summary — which is silent on any node that pins one of
2836
+ * its own addresses and not another (TOON_Network#111). The choice is made
2837
+ * before the first packet, so a pinned route is dialled correctly on the first
2838
+ * attempt and never learns its carriage from a refusal.
2821
2839
  */
2822
2840
  private transportFor;
2823
2841
  /**
@@ -2841,6 +2859,16 @@ declare const DEFAULT_TIMEOUT_MS = 30000;
2841
2859
  declare const DEFAULT_DEPOSIT = 100000n;
2842
2860
  /** Challenge period in seconds when the caller sets none. */
2843
2861
  declare const DEFAULT_SETTLEMENT_TIMEOUT = 86400;
2862
+ /**
2863
+ * How one chain's RPC leaves this process when it rides the proxy: two shapes of
2864
+ * one pinned circuit, because the two chains' clients take different objects.
2865
+ */
2866
+ interface ProxiedChainRpc {
2867
+ /** The undici dispatcher, for viem, which calls the global `fetch` itself (EVM). */
2868
+ dispatcher: unknown;
2869
+ /** `fetch` bound to that dispatcher, for Solana's JSON-RPC. */
2870
+ fetch: typeof fetch;
2871
+ }
2844
2872
  /** The keys this client holds, per chain. Absent means "no key for that chain". */
2845
2873
  interface ResolvedIdentity {
2846
2874
  evm?: {
@@ -2867,13 +2895,15 @@ interface ResolvedConfig {
2867
2895
  /** Whether chain RPC rides that proxy too (ADR 0002). */
2868
2896
  proxyRpc: boolean;
2869
2897
  /**
2870
- * The undici dispatcher built from {@link socksProxy}, for chain RPC.
2898
+ * Per chain, the proxy-bound route its RPC takes, each on its own pinned
2899
+ * circuit; `undefined` when chain RPC dials directly.
2900
+ *
2871
2901
  * Deliberately not filled in here: building it means loading a Node-only
2872
2902
  * module, and resolving a config must stay synchronous and browser-safe. It is
2873
- * the client's job to construct one, so {@link resolveConfig} only reserves
2874
- * the slot and leaves it `undefined`.
2903
+ * the client's job to construct the routes, so {@link resolveConfig} only
2904
+ * reserves the slot and leaves it `undefined`.
2875
2905
  */
2876
- rpcDispatcher: unknown;
2906
+ chainRpc: Record<ChainKind, ProxiedChainRpc> | undefined;
2877
2907
  identity: ResolvedIdentity;
2878
2908
  /** The caller's chain preference, or `undefined` to take the node's first. */
2879
2909
  chain: ChainKind | undefined;
@@ -3465,8 +3495,15 @@ interface SendContext {
3465
3495
  * request.
3466
3496
  */
3467
3497
  reconcileWatermark?(channelId: string): Promise<void>;
3468
- /** The carriage, chosen and connected. */
3469
- transport(description: NodeSelfDescription): Promise<{
3498
+ /**
3499
+ * The carriage for one destination, chosen and connected.
3500
+ *
3501
+ * `destination` is passed because a node pins a carriage **per route**
3502
+ * (connector ADR 0072): the pin covering the prefix this packet is addressed
3503
+ * to is the one that will be enforced, and a node-wide summary is silent on
3504
+ * any node that pins one of its own addresses and not another.
3505
+ */
3506
+ transport(description: NodeSelfDescription, destination: string): Promise<{
3470
3507
  kind: 'http' | 'btp';
3471
3508
  transport: PaidWriteTransport;
3472
3509
  }>;
@@ -3484,6 +3521,9 @@ interface SendContext {
3484
3521
  *
3485
3522
  * @throws {RouteNotPricedError} the node prices no route covering `destination`
3486
3523
  * and no explicit {@link SendOptions.amount} was given.
3524
+ * @throws {BeforePayRefusedError} the caller's own
3525
+ * {@link SendOptions.beforePay} returned a reason, having seen the resolved
3526
+ * price. Nothing was signed and no packet went out.
3487
3527
  * @throws Anything the chain or the network throws while opening a channel.
3488
3528
  * A REJECT is never thrown — see {@link SendResult}.
3489
3529
  */
@@ -4914,9 +4954,10 @@ declare class BtpPaidWriteTransport implements ClaimSendingTransport {
4914
4954
  * with `extra.requiredTransport` naming the carriage the route does require.
4915
4955
  *
4916
4956
  * So a 1.0 client asks first. The node's self-description (`GET /ilp`) carries
4917
- * `httpEndpoint`, `btpEndpoint` and — when every route covering the node's own
4918
- * addresses agrees on one — `requiredTransport`, and this module reads a
4919
- * carriage off that document. That is the whole of the change from 0.x, which
4957
+ * `httpEndpoint`, `btpEndpoint`, a `requiredTransport` on **each route that
4958
+ * pins one** (connector ND-05a / ADR 0072) and a node-wide one summarising the
4959
+ * routes that cover its own addresses, and this module reads a carriage off
4960
+ * that document. That is the whole of the change from 0.x, which
4920
4961
  * had no such document: it keyed this decision on a peer discovered from a
4921
4962
  * kind:10032 relay announce, then POSTed over HTTP and treated the resulting
4922
4963
  * `402`/`401` as the signal to retry over BTP. Both halves of that are gone —
@@ -4943,22 +4984,32 @@ interface TransportChoice {
4943
4984
  * {@link TransportRequiredError} otherwise, naming the node's own
4944
4985
  * `requiredTransport` when it stated one so the caller learns what to ask
4945
4986
  * for instead.
4946
- * - `'auto'`: `description.requiredTransport` when the node set it, else HTTP
4947
- * when it publishes an `httpEndpoint`, else BTP. HTTP is the default because
4948
- * it is stateless — one request, no session to keep alive — and a client
4949
- * that needs ordered claim nonces across many writes is a client that will
4950
- * ask for BTP explicitly (§1.9: one socket, one order, no racing into
4951
- * `F01 NonceNotAdvancing`).
4987
+ * - `'auto'`: the carriage the node requires for `destination` when it states
4988
+ * one, else HTTP when it publishes an `httpEndpoint`, else BTP. HTTP is the
4989
+ * default because it is stateless — one request, no session to keep alive —
4990
+ * and a client that needs ordered claim nonces across many writes is a client
4991
+ * that will ask for BTP explicitly (§1.9: one socket, one order, no racing
4992
+ * into `F01 NonceNotAdvancing`).
4993
+ *
4994
+ * **The requirement is read per destination**, through
4995
+ * {@link requiredTransportFor}: the route governing `destination` first, the
4996
+ * node-wide `requiredTransport` only where that route names none. A pin is
4997
+ * enforced by a longest-prefix route lookup, once per packet, so a per-node
4998
+ * answer describes it only on a node whose routes happen to agree — and a node
4999
+ * with a pinned apex and a free sub-lane does not. Naming no `destination` asks
5000
+ * about the node alone, which is all a caller with no packet in hand can mean.
4952
5001
  *
4953
5002
  * @param description the node's `GET /ilp` answer.
4954
5003
  * @param preference what the caller asked for. Default `'auto'`.
4955
5004
  * @param baseUrl the client-edge URL the description was read from, for
4956
5005
  * resolving a relative endpoint. Defaults to `description.readFrom`, which
4957
5006
  * `ConnectorEdgeClient.describe` records; an absolute endpoint needs neither.
5007
+ * @param destination the ILP address this carriage will carry packets to, so
5008
+ * the route that governs it answers rather than the node-wide summary.
4958
5009
  * @throws {TransportRequiredError} the requested carriage is unavailable, or
4959
5010
  * the node publishes no usable endpoint at all.
4960
5011
  */
4961
- declare function selectTransport(description: NodeSelfDescription, preference?: TransportPreference, baseUrl?: string | undefined): TransportChoice;
5012
+ declare function selectTransport(description: NodeSelfDescription, preference?: TransportPreference, baseUrl?: string | undefined, destination?: string): TransportChoice;
4962
5013
 
4963
5014
  /**
4964
5015
  * Canonical OER length primitives (RFC-0030), ported byte-for-byte from
@@ -5774,10 +5825,53 @@ declare const ERC20_ABI: readonly [{
5774
5825
  }];
5775
5826
  }];
5776
5827
 
5828
+ /**
5829
+ * Solana payment-channel primitives — parity with the deployed program.
5830
+ *
5831
+ * Pure, dependency-light helpers that reproduce the EXACT on-chain contract of
5832
+ * the connector's `payment-channel` program
5833
+ * (`toon-protocol/connector` `packages/solana-program/src/{instruction,state,processor}.rs`),
5834
+ * mirrored the same way the connector's own client half is
5835
+ * (`crates/connector-settlement-solana/src/wire.rs`). A mismatch anywhere below
5836
+ * makes the connector refuse the claim, or makes the chain refuse the
5837
+ * transaction — so every discriminator, account order and byte offset here is
5838
+ * cited to the Rust it was read from, and must move in lock-step with it.
5839
+ *
5840
+ * 1. PDA derivation — `[b"channel", min_pubkey, max_pubkey, token_mint]`,
5841
+ * participants sorted lexicographically by raw 32-byte pubkey, derived
5842
+ * against the program id (`processor.rs::derive_channel_pda`). This base58
5843
+ * PDA is the claim's `channelAccount` and the channel-state account both
5844
+ * the connector and the program read.
5845
+ * 2. The **96-byte** balance-proof message a claim's Ed25519 signature covers
5846
+ * — see {@link buildBalanceProofMessage} for the layout and for why it
5847
+ * grew from 48 bytes (connector ADR 0053).
5848
+ * 3. The six instructions the program implements: `01` initialize, `02`
5849
+ * deposit, `03` close, `04` settle, `05` force-close-expired and `06`
5850
+ * claim-from-channel — built and submitted over raw Solana JSON-RPC (no
5851
+ * `@solana/web3.js` / `@solana/kit` runtime dependency: only
5852
+ * `@noble/curves` + `@noble/hashes`, already client deps).
5853
+ * 4. The 178-byte `ChannelState` account (`state.rs`), decoded in full.
5854
+ */
5855
+
5777
5856
  interface Signer {
5778
5857
  publicKey: Uint8Array;
5779
5858
  privateKey: Uint8Array;
5780
5859
  }
5860
+ /**
5861
+ * A Solana JSON-RPC call that got no answer from the node: every try was lost in
5862
+ * transit, timed out, or was turned away at the HTTP layer.
5863
+ *
5864
+ * `mayHaveArrived` is `false` only when every try failed before a byte of the
5865
+ * request could have been written, because the connection or the proxy refused
5866
+ * it. That is the one case in which a failed `sendTransaction` is known not to
5867
+ * have been sent.
5868
+ */
5869
+ declare class SolanaRpcTransportError extends NetworkError {
5870
+ readonly method: string;
5871
+ readonly attempts: number;
5872
+ readonly mayHaveArrived: boolean;
5873
+ constructor(method: string, attempts: number, mayHaveArrived: boolean, cause: unknown);
5874
+ }
5781
5875
 
5782
5876
  /**
5783
5877
  * Solana wire transactions this client did NOT build.
@@ -6682,12 +6776,31 @@ declare function assertRoutableHsHostname(hostname: unknown): string;
6682
6776
  interface RpcTransportOptions {
6683
6777
  timeout?: number;
6684
6778
  retryCount?: number;
6779
+ retryDelay?: number;
6685
6780
  }
6781
+ /**
6782
+ * What a proxied RPC request gets when its caller names nothing else, sized
6783
+ * from connector ADR 0073's measurements through `anon` (decisions 4 and 5).
6784
+ *
6785
+ * - `timeout` 30s, not viem's 10s. The worst call measured that needed a new
6786
+ * circuit took 13s. Under 10s that one would have been reported as a failure,
6787
+ * and retried on another new circuit.
6788
+ * - `retryDelay` 500ms, not viem's 150ms. viem already retries 403, 408, 429,
6789
+ * 5xx and dropped connections. Exit IPs are shared, so a 429 is the error to
6790
+ * expect, and retrying it at 150ms mostly earns another one.
6791
+ * - `retryCount` 3, viem's own.
6792
+ */
6793
+ declare const PROXIED_RPC_DEFAULTS: {
6794
+ readonly timeout: 30000;
6795
+ readonly retryCount: 3;
6796
+ readonly retryDelay: 500;
6797
+ };
6686
6798
  /**
6687
6799
  * A viem HTTP transport for `url`, bound to `dispatcher` when there is one.
6688
6800
  *
6689
6801
  * `undefined` dispatcher means clearnet, and produces exactly the transport this
6690
- * package built before hidden services existed.
6802
+ * package built before hidden services existed. A dispatcher also brings
6803
+ * {@link PROXIED_RPC_DEFAULTS}, under anything the caller set explicitly.
6691
6804
  */
6692
6805
  declare function rpcTransport(url: string, dispatcher: unknown | undefined, options?: RpcTransportOptions): ReturnType<typeof http>;
6693
6806
  /**
@@ -6778,9 +6891,9 @@ declare const DEVNET: {
6778
6891
  readonly chainId: 84532;
6779
6892
  readonly rpcUrl: "https://sepolia.base.org";
6780
6893
  readonly tokenNetworkRegistry: "0x0c41D9D424d6B075A3cEa1068a694f7847a8CCa5";
6781
- readonly tokenNetwork: "0xe9E05dfecfe165266C88d73e61D483612651952a";
6782
- /** Mock USDC, 6 decimals, ungated `mint()`. */
6783
- readonly tokenAddress: "0x49beE1Bca5d15Fb0963117923403F9498119a9Ce";
6894
+ readonly tokenNetwork: "0x1B4606218ceE5Bf02B546e416905F4D3FC8a0249";
6895
+ /** Devnet USDC: Circle FiatToken v2.2 (ERC-3009, EIP-2612), 6 decimals, minter-gated — fund via the faucet (connector#1337). */
6896
+ readonly tokenAddress: "0x0C996d7c934c79a6255254875607Fe69df25C0E1";
6784
6897
  readonly decimals: 6;
6785
6898
  };
6786
6899
  /** Solana devnet — the public cluster, not a local validator. */
@@ -6852,4 +6965,4 @@ interface RetryOptions {
6852
6965
  */
6853
6966
  declare function withRetry<T>(operation: () => Promise<T>, options: RetryOptions): Promise<T>;
6854
6967
 
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 };
6968
+ 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, BeforePayRefusedError, BtpAuthError, type BtpChannelDeclaration, BtpConnectionError, type BtpPacketResponse, BtpPaidWriteTransport, type BtpPaidWriteTransportConfig, BtpRuntimeClient, type BtpRuntimeClientConfig, CLAIM_ACK_HEADER, CLAIM_ACK_PROTOCOL, CLAIM_REJECT_CODE, CLAIM_REJECT_REASONS, ChainKind, type ChainMetadata, type ChainSigner, ChainUnavailableError, type ChannelBinding, type ChannelBindingContext, ChannelClient, type ChannelFacade, type ChannelFacadeDeps, ChannelFundingError, ChannelManager, type ChannelManagerConfig, ChannelNotOpenError, ChannelResumeError, type ChannelState, ChannelStatus, type ChannelStore, type ChannelStoreEntry, 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, OnChainChannelStatus, type OpenChannelOptions, OpenChannelParams, OpenChannelResult, type OpenOrAdoptParams, type OpenedKeystore, type OpenedRequest, PACKET_EXPIRY_HEADROOM_MS, PAYMENT_REQUIRED_HEADER, PAYMENT_REQUIRED_PROTOCOL, PROXIED_RPC_DEFAULTS, type PaidWriteTransport, type ParsedX402Challenge, PaymentRequiredError, type PaymentTerms, type ProxiedChainRpc, 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, SolanaRpcTransportError, SolanaSigner, type SolanaWireTransaction, StaleRpcReadError, TOKEN_NETWORK_ABI, TOKEN_NETWORK_REGISTRY_ABI, TokenNetworkClient, type TokenNetworkClientConfig, type ToonChannelAccept, ToonClient, type ToonClientConfig, ToonClientError, type ToonClientLike, type ToonIdentity, TransactionOutcomeError, 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 };