@toon-protocol/client 5.1.1 → 5.2.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.
@@ -1,24 +1,32 @@
1
+ import {
2
+ ClientChannelFacade,
3
+ ClientWalletFacade,
4
+ DEFAULT_DEPOSIT,
5
+ DEFAULT_TIMEOUT_MS,
6
+ ToonClient,
7
+ addressFor,
8
+ resolveConfig,
9
+ send,
10
+ toEnvelopeRequest
11
+ } from "./chunk-KGT4XOBZ.js";
12
+ import "./chunk-6O5OXJVR.js";
1
13
  import {
2
14
  BeforePayRefusedError,
3
15
  ChainUnavailableError,
4
16
  ChannelFundingError,
5
17
  ChannelNotOpenError,
6
18
  ChannelResumeError,
7
- ClientChannelFacade,
8
- ClientWalletFacade,
9
19
  ConfigError,
10
20
  ConnectorError,
11
- DEFAULT_DEPOSIT,
12
- DEFAULT_TIMEOUT_MS,
13
21
  FacilitatorError,
14
22
  InsufficientBalanceError,
15
23
  InvalidAddressError,
16
24
  NetworkError,
17
25
  PaymentRequiredError,
26
+ ProxyBypassError,
18
27
  RouteNotPricedError,
19
28
  SponsorRefusedError,
20
29
  StaleRpcReadError,
21
- ToonClient,
22
30
  ToonClientError,
23
31
  TransactionOutcomeError,
24
32
  TransferNotDeliveredError,
@@ -26,15 +34,10 @@ import {
26
34
  TransportRequiredError,
27
35
  UnknownChainError,
28
36
  ValidationError,
29
- addressFor,
30
37
  chainUnavailableMessage,
31
38
  describeEndpoint,
32
- isInsufficientGasError,
33
- resolveConfig,
34
- send,
35
- toEnvelopeRequest
36
- } from "./chunk-GNPJRJ6U.js";
37
- import "./chunk-6O5OXJVR.js";
39
+ isInsufficientGasError
40
+ } from "./chunk-ABOW5ZCE.js";
38
41
  import "./chunk-32MD3CXE.js";
39
42
  export {
40
43
  BeforePayRefusedError,
@@ -53,6 +56,7 @@ export {
53
56
  InvalidAddressError,
54
57
  NetworkError,
55
58
  PaymentRequiredError,
59
+ ProxyBypassError,
56
60
  RouteNotPricedError,
57
61
  SponsorRefusedError,
58
62
  StaleRpcReadError,
@@ -72,4 +76,4 @@ export {
72
76
  send,
73
77
  toEnvelopeRequest
74
78
  };
75
- //# sourceMappingURL=client-RO3VITXU.js.map
79
+ //# sourceMappingURL=client-3KOPQDZG.js.map
@@ -33,9 +33,9 @@ declare function validateSocks5hUrl(socksProxy: string): {
33
33
  * Node is undici and takes a **dispatcher**. It does not take an `http.Agent`,
34
34
  * which is why the `socks-proxy-agent` this package used to depend on cannot
35
35
  * serve this path at all.
36
- * - **Chain RPC** goes through viem, which calls the *global* `fetch` and accepts
37
- * no injected one. Its only opening is `http(url, { fetchOptions })`, so it
38
- * needs the same dispatcher handed to it as a fetch option (ADR 0002).
36
+ * - **Chain RPC** goes through viem, which takes an injected `fetchFn`
37
+ * (`http(url, { fetchFn })`), so it is handed this transport's proxied `fetch`
38
+ * (ADR 0002, ADR 0005).
39
39
  * - **The BTP carriage** goes through `ws`, which is `node:http` underneath and
40
40
  * therefore takes an `http.Agent` and nothing else.
41
41
  *
@@ -145,10 +145,15 @@ interface HiddenServiceTransport {
145
145
  createWebSocket: (url: string) => unknown;
146
146
  /**
147
147
  * The undici dispatcher behind `fetch`, for handing to something that insists
148
- * on calling the global `fetch` itself — viem's HTTP transport, in practice
149
- * (`http(url, { fetchOptions: { dispatcher } })`).
148
+ * on calling the global `fetch` itself. The client's own paths, viem's
149
+ * included (`http(url, { fetchFn })`), use `fetch` instead.
150
150
  */
151
151
  dispatcher: unknown;
152
+ /**
153
+ * How many canary dials this transport's proxy hooks (the dispatcher's
154
+ * `connect`, the websocket agents' `createConnection`) have seen and refused.
155
+ */
156
+ canaryHits(): number;
152
157
  /** Close the dispatcher's pool and the websocket agents' sockets. */
153
158
  close(): Promise<void>;
154
159
  }
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { Hex, LocalAccount, TransactionReceipt, http } from 'viem';
2
- import { C as ChainKind } from './hidden-service-BtIv3u0L.js';
3
- export { H as HiddenServiceTransport, a as HiddenServiceTransportOptions, v as validateSocks5hUrl } from './hidden-service-BtIv3u0L.js';
1
+ import { Hex, http, LocalAccount, TransactionReceipt } from 'viem';
2
+ import { C as ChainKind } from './hidden-service-D58bCgdN.js';
3
+ export { H as HiddenServiceTransport, a as HiddenServiceTransportOptions, v as validateSocks5hUrl } from './hidden-service-D58bCgdN.js';
4
4
  import { PrivateKeyAccount } from 'viem/accounts';
5
5
 
6
6
  /**
@@ -316,8 +316,14 @@ declare class NetworkError extends ToonClientError {
316
316
  constructor(message: string, cause?: Error, endpoint?: string);
317
317
  }
318
318
  /** Where a packet-path URL came from: the caller's config, or the node's self-description. */
319
- type EndpointSource = 'configured' | 'published';
320
- /** `url`, plus a note when the node (not the caller) chose it. */
319
+ type EndpointSource = 'configured' | 'published'
320
+ /** The caller's `carriageEndpoints` replaced what the connector published (`published`, when it did). */
321
+ | {
322
+ override: {
323
+ published?: string;
324
+ };
325
+ };
326
+ /** `url`, plus a note when the node (not the caller) chose it, or when the caller replaced the node's. */
321
327
  declare function describeEndpoint(url: string, source?: EndpointSource): string;
322
328
  /**
323
329
  * Connector error for a transport-level failure at the client edge: a `4xx`
@@ -464,6 +470,20 @@ declare class TransportRequiredError extends ToonClientError {
464
470
  cause?: Error;
465
471
  });
466
472
  }
473
+ /** The four paths a hidden payer hands its proxy to. */
474
+ type ProxiedPath = 'client-edge' | 'evm-rpc' | 'solana-rpc' | 'btp';
475
+ /**
476
+ * Thrown by `ToonClient.create` when a hidden payer's canary shows that one path
477
+ * ignores its proxy hook, so that path would dial clearnet and name the payer
478
+ * (ADR 0005). Nothing has been sent: the canary targets a closed loopback port.
479
+ * {@link path} says which path, and the message says how to fix it.
480
+ */
481
+ declare class ProxyBypassError extends ToonClientError {
482
+ /** The path whose proxy hook was never reached. */
483
+ readonly path: ProxiedPath;
484
+ constructor(path: ProxiedPath);
485
+ private static messageFor;
486
+ }
467
487
  /**
468
488
  * Thrown when the one-time on-chain payment-channel OPEN reverts because the
469
489
  * local settlement wallet has no native gas to pay for its own
@@ -617,6 +637,80 @@ declare class TransactionOutcomeError extends ToonClientError {
617
637
  constructor(message: string, chain: ChainKind, txHash: string, outcome: 'failed' | 'expired' | 'unknown', cause?: Error);
618
638
  }
619
639
 
640
+ /**
641
+ * The one place viem is told to send chain RPC through the hidden-service proxy.
642
+ *
643
+ * viem's HTTP transport takes an injected `fetchFn` (viem `^2.37.2`). Handing it
644
+ * the proxied fetch means chain traffic joins the packet traffic inside the
645
+ * overlay (ADR 0002) through the same fetch the canary tests (ADR 0005).
646
+ *
647
+ * Browser-safe: this module imports nothing but viem. The proxied fetch itself is
648
+ * built in `./socks.js`, which is Node-only and dynamically imported.
649
+ */
650
+
651
+ /** Options a caller already wanted, independent of any proxy. */
652
+ interface RpcTransportOptions {
653
+ timeout?: number;
654
+ retryCount?: number;
655
+ retryDelay?: number;
656
+ }
657
+ /**
658
+ * What a proxied RPC request gets when its caller names nothing else, sized
659
+ * from connector ADR 0073's measurements through `anon` (decisions 4 and 5).
660
+ *
661
+ * - `timeout` 30s, not viem's 10s. The worst call measured that needed a new
662
+ * circuit took 13s. Under 10s that one would have been reported as a failure,
663
+ * and retried on another new circuit.
664
+ * - `retryDelay` 500ms, not viem's 150ms. viem already retries 403, 408, 429,
665
+ * 5xx and dropped connections. Exit IPs are shared, so a 429 is the error to
666
+ * expect, and retrying it at 150ms mostly earns another one.
667
+ * - `retryCount` 3, viem's own.
668
+ */
669
+ declare const PROXIED_RPC_DEFAULTS: {
670
+ readonly timeout: 30000;
671
+ readonly retryCount: 3;
672
+ readonly retryDelay: 500;
673
+ };
674
+ /**
675
+ * Where one chain's JSON-RPC goes and what it goes through: the URL, and the
676
+ * `fetch` that dials it. Both are required. A chain RPC call site cannot compile
677
+ * without the fetch it should use, so a hidden payer cannot reach clearnet by
678
+ * leaving one out (ADR 0005).
679
+ *
680
+ * The client decides it once, in its chain-access layer, and every internal
681
+ * layer below takes it whole. The only defaults to the global `fetch` left are
682
+ * at public helpers, for a direct caller on clearnet; the client always passes
683
+ * its own route to them.
684
+ */
685
+ interface ChainRpcRoute {
686
+ url: string;
687
+ fetch: typeof fetch;
688
+ /**
689
+ * The `fetch` rides the hidden-service proxy, so a request gets
690
+ * {@link PROXIED_RPC_DEFAULTS} under anything the caller set explicitly.
691
+ */
692
+ proxied?: boolean;
693
+ }
694
+ /**
695
+ * The global `fetch`, looked up per call. This is the deliberately direct
696
+ * route: a clearnet client's, a public helper's default, and a hidden payer's
697
+ * with `proxyRpc: false` (ADR 0002). Choose it by name, at the one place that
698
+ * decides.
699
+ */
700
+ declare const directFetch: typeof fetch;
701
+ /**
702
+ * A viem HTTP transport over `route`.
703
+ *
704
+ * A proxied route also brings {@link PROXIED_RPC_DEFAULTS}, under anything the
705
+ * caller set explicitly.
706
+ */
707
+ declare function rpcTransport(route: ChainRpcRoute, options?: RpcTransportOptions): ReturnType<typeof http>;
708
+ /**
709
+ * `fetch` bound to `dispatcher`, for a JSON-RPC path that calls `fetch` itself
710
+ * rather than going through viem — Solana's, in practice.
711
+ */
712
+ declare function rpcFetch(dispatcher: unknown | undefined, fetchImpl?: typeof fetch): typeof fetch;
713
+
620
714
  /**
621
715
  * Solana over raw JSON-RPC: the program-derived-address search, associated
622
716
  * token accounts, a legacy transaction compiler and sender, and the reads a
@@ -665,17 +759,13 @@ interface Signer {
665
759
  /**
666
760
  * Where Solana JSON-RPC goes, and how it gets there.
667
761
  *
668
- * A bare URL is the ordinary case and dials the global `fetch`. The object form
669
- * carries a `fetch` to use instead — on a hidden-service client that is the
670
- * proxied one, so chain reads ride the overlay with the packets rather than
671
- * announcing this wallet on clearnet (ADR 0002). Every function in this module
672
- * that takes an RPC target passes it straight through to {@link solanaRpc}; only
673
- * that function ever looks inside.
762
+ * A {@link ChainRpcRoute}: it carries the `fetch` to dial with, and there is no
763
+ * default. On a hidden-service client that is the proxied one, so chain reads
764
+ * ride the overlay with the packets rather than announcing this wallet on
765
+ * clearnet (ADR 0002). Every function in this module that takes a route passes
766
+ * it straight through to {@link solanaRpc}; only that function ever looks inside.
674
767
  */
675
- type SolanaRpcTarget = string | {
676
- url: string;
677
- fetchImpl?: typeof fetch;
678
- };
768
+ type SolanaRpcTarget = ChainRpcRoute;
679
769
  /**
680
770
  * A Solana JSON-RPC call that got no answer from the node: every try was lost in
681
771
  * transit, timed out, or was turned away at the HTTP layer.
@@ -1729,10 +1819,9 @@ interface EvmWalletAccess {
1729
1819
  * RPC reports. Nothing connects until it is first used.
1730
1820
  */
1731
1821
  declare function evmWalletAccess(params: {
1732
- rpcUrl: string;
1822
+ /** The route chain RPC takes, with the fetch it dials through. */
1823
+ rpc: ChainRpcRoute;
1733
1824
  account: LocalAccount;
1734
- /** The proxy-bound dispatcher a hidden payer's RPC rides, if any. */
1735
- dispatcher?: unknown;
1736
1825
  }): EvmWalletAccess;
1737
1826
  /** How much of `token` Permit2 may move for `owner`. */
1738
1827
  declare function permit2Allowance(reader: ContractReader, token: string, owner: string): Promise<bigint>;
@@ -1741,7 +1830,11 @@ declare function permit2Allowance(reader: ContractReader, token: string, owner:
1741
1830
  * `nonces(address)` — and so, for this purpose, no permit.
1742
1831
  */
1743
1832
  declare function eip2612Nonce(reader: ContractReader, token: string, owner: string): Promise<bigint | undefined>;
1744
- /** The extensions a facilitator's `GET /supported` advertises. */
1833
+ /**
1834
+ * The extensions a facilitator's `GET /supported` advertises. `fetchImpl` defaults
1835
+ * to the global `fetch`, the clearnet behaviour for a direct caller; the client
1836
+ * always passes its own.
1837
+ */
1745
1838
  declare function facilitatorExtensions(facilitatorUrl: string, fetchImpl?: typeof fetch): Promise<string[]>;
1746
1839
  /** `paymentPayload.extensions`, as a facilitator reads them. */
1747
1840
  type DepositExtensions = Record<string, {
@@ -1909,7 +2002,7 @@ interface BatchSettlementPayerConfig {
1909
2002
  rpc: SolanaRpcTarget;
1910
2003
  };
1911
2004
  /** How the connector's sponsor endpoint and the facilitator are reached. */
1912
- fetch?: typeof fetch;
2005
+ fetch: typeof fetch;
1913
2006
  /**
1914
2007
  * The connector's own watermark for a channel (`POST /ilp/claim-state`),
1915
2008
  * asked with the voucher challenge this payer signs. It recovers a lost
@@ -2111,8 +2204,7 @@ interface ChannelFacadeDeps {
2111
2204
  describe(): Promise<NodeSelfDescription>;
2112
2205
  evm?: {
2113
2206
  privateKey: Uint8Array;
2114
- rpcUrl: string;
2115
- rpcDispatcher: unknown;
2207
+ rpc: ChainRpcRoute;
2116
2208
  };
2117
2209
  solana?: {
2118
2210
  signer: Signer;
@@ -3079,21 +3171,34 @@ declare function readEvmTokenBalance(opts: {
3079
3171
  chainKey: string;
3080
3172
  tokenAddress: string;
3081
3173
  owner: string;
3082
- /** Send this read through the hidden-service proxy, when there is one (ADR 0002). */
3083
- rpcDispatcher?: unknown;
3174
+ /**
3175
+ * The `fetch` this read dials through; the hidden-service proxy's on a hidden
3176
+ * payer (ADR 0002). Defaults to the global `fetch`: the clearnet behaviour for
3177
+ * a direct caller. The client always passes its own.
3178
+ */
3179
+ evmRpcFetch?: typeof fetch;
3180
+ /** `evmRpcFetch` rides the proxy: allow a circuit's latency. Defaults to whether one was passed. */
3181
+ proxied?: boolean;
3084
3182
  }): Promise<WalletBalance>;
3085
3183
  /** Read the native ETH balance (wei) for `owner` via `eth_getBalance`. */
3086
3184
  declare function readEvmNativeBalance(opts: {
3087
3185
  rpcUrl: string;
3088
3186
  chainKey: string;
3089
3187
  owner: string;
3090
- /** Send this read through the hidden-service proxy, when there is one (ADR 0002). */
3091
- rpcDispatcher?: unknown;
3188
+ /**
3189
+ * The `fetch` this read dials through; the hidden-service proxy's on a hidden
3190
+ * payer (ADR 0002). Defaults to the global `fetch`: the clearnet behaviour for
3191
+ * a direct caller. The client always passes its own.
3192
+ */
3193
+ evmRpcFetch?: typeof fetch;
3194
+ /** `evmRpcFetch` rides the proxy: allow a circuit's latency. Defaults to whether one was passed. */
3195
+ proxied?: boolean;
3092
3196
  }): Promise<WalletTokenAmount>;
3093
3197
  /** Read the native SOL balance (lamports) for `owner` via the `getBalance` RPC. */
3094
3198
  declare function readSolanaNativeBalance(opts: {
3095
3199
  rpcUrl: string;
3096
3200
  owner: string;
3201
+ /** Defaults to the global `fetch`: the clearnet behaviour for a direct caller. */
3097
3202
  fetchImpl?: typeof fetch;
3098
3203
  /** The fetch rides the SOCKS5h proxy: allow a circuit's latency. */
3099
3204
  proxied?: boolean;
@@ -3103,6 +3208,7 @@ declare function readSolanaTokenBalance(opts: {
3103
3208
  rpcUrl: string;
3104
3209
  mint: string;
3105
3210
  owner: string;
3211
+ /** Defaults to the global `fetch`: the clearnet behaviour for a direct caller. */
3106
3212
  fetchImpl?: typeof fetch;
3107
3213
  /** The fetch rides the SOCKS5h proxy: allow a circuit's latency. */
3108
3214
  proxied?: boolean;
@@ -3124,7 +3230,9 @@ interface WalletBalanceSources {
3124
3230
  * reads need no equivalent: they go through {@link WalletBalanceSources.fetchImpl},
3125
3231
  * which is already the proxied `fetch` on a hidden-service client.
3126
3232
  */
3127
- rpcDispatcher?: unknown;
3233
+ evmRpcFetch?: typeof fetch;
3234
+ /** `evmRpcFetch` rides the proxy. Defaults to whether one was passed. */
3235
+ proxied?: boolean;
3128
3236
  };
3129
3237
  solana?: {
3130
3238
  chainKey?: string;
@@ -3229,12 +3337,22 @@ interface EvmTransferConfig {
3229
3337
  signer: EvmSigner;
3230
3338
  /** ERC-20 settlement-token address. Required only for `asset: 'token'`. */
3231
3339
  tokenAddress?: string;
3232
- /** Send this transfer's RPC through the hidden-service proxy (ADR 0002). */
3233
- rpcDispatcher?: unknown;
3340
+ /**
3341
+ * The `fetch` this transfer's RPC dials through; the hidden-service proxy's
3342
+ * on a hidden payer (ADR 0002). Defaults to the global `fetch`: the clearnet
3343
+ * behaviour for a direct caller. The client always passes its own.
3344
+ */
3345
+ evmRpcFetch?: typeof fetch;
3346
+ /** `evmRpcFetch` rides the proxy. Defaults to whether one was passed. */
3347
+ proxied?: boolean;
3234
3348
  }
3235
3349
  interface SolanaTransferConfig {
3236
3350
  rpcUrl: string;
3237
- /** `fetch` for Solana JSON-RPC — the proxied one on a hidden-service client (ADR 0002). */
3351
+ /**
3352
+ * `fetch` for Solana JSON-RPC — the proxied one on a hidden-service client
3353
+ * (ADR 0002). Defaults to the global `fetch`: the clearnet behaviour for a
3354
+ * direct caller. The client always passes its own.
3355
+ */
3238
3356
  rpcFetch?: typeof fetch;
3239
3357
  /** Ed25519 signing seed (32 bytes) or a 64-byte seed||pubkey keypair. */
3240
3358
  keypair: Uint8Array;
@@ -3265,6 +3383,20 @@ interface TransferConfig {
3265
3383
  */
3266
3384
  declare function sendTransfer(config: TransferConfig, params: SendTransferParams): Promise<SendTransferResult>;
3267
3385
 
3386
+ /**
3387
+ * Path objects to test in place of the transports' own. For tests that need a
3388
+ * deliberately broken path (a fetch that drops its dispatcher, a viem transport
3389
+ * without `fetchFn`, a websocket without its agent). Never set in production.
3390
+ *
3391
+ * @internal
3392
+ */
3393
+ interface CanaryPathOverrides {
3394
+ clientEdgeFetch?: typeof fetch;
3395
+ evmRpcTransport?: typeof rpcTransport;
3396
+ solanaRpcFetch?: typeof fetch;
3397
+ createWebSocket?: (url: string) => unknown;
3398
+ }
3399
+
3268
3400
  /**
3269
3401
  * Devnet faucet helper.
3270
3402
  *
@@ -3345,6 +3477,16 @@ type ChannelState = BatchChannelSummary;
3345
3477
  /** Which carriage to pay over. */
3346
3478
  type TransportPreference = 'auto' | 'http' | 'btp';
3347
3479
 
3480
+ /**
3481
+ * A payer's per-carriage replacements for the carriage endpoints a connector
3482
+ * publishes (ADR 0006).
3483
+ */
3484
+ interface CarriageEndpoints {
3485
+ /** Replaces the published `httpEndpoint`. */
3486
+ http?: string;
3487
+ /** Replaces the published `btpEndpoint`. */
3488
+ btp?: string;
3489
+ }
3348
3490
  interface ToonClientConfig {
3349
3491
  /**
3350
3492
  * The connector's client-edge base URL. A trailing `/ilp` is normalized away,
@@ -3458,6 +3600,16 @@ interface ToonClientConfig {
3458
3600
  * Node only: a browser cannot dial a hidden service by any route.
3459
3601
  */
3460
3602
  socksProxy?: string;
3603
+ /**
3604
+ * Replace the carriage endpoint the connector publishes, per carriage. Each
3605
+ * value must be an absolute URL: `http` an `http:`/`https:` one, `btp` a
3606
+ * `ws:`/`wss:` one. A carriage with no override uses the published endpoint.
3607
+ * Everything else (self-description, prices, claim state, seal key) is still
3608
+ * read from `connector`. Nothing falls back to the client edge (ADR 0006).
3609
+ *
3610
+ * The `http` override also serves the HTTP fallback beneath a BTP session.
3611
+ */
3612
+ carriageEndpoints?: CarriageEndpoints;
3461
3613
  /**
3462
3614
  * Send chain RPC through `socksProxy` as well as the packets. Default `true`.
3463
3615
  *
@@ -3470,6 +3622,14 @@ interface ToonClientConfig {
3470
3622
  fetch?: typeof fetch;
3471
3623
  /** Injected websocket factory, for tests and runtimes without a global `WebSocket`. */
3472
3624
  createWebSocket?: (url: string) => unknown;
3625
+ /**
3626
+ * Path objects the hidden-payer canary tests in place of the proxy's own, so a
3627
+ * test can prove a deliberately broken path is caught (ADR 0005). Not for
3628
+ * production use.
3629
+ *
3630
+ * @internal
3631
+ */
3632
+ canaryPaths?: CanaryPathOverrides;
3473
3633
  }
3474
3634
  /**
3475
3635
  * The HTTP request to make of the app behind a route.
@@ -3942,13 +4102,12 @@ declare const DEFAULT_TIMEOUT_MS = 30000;
3942
4102
  /** What a channel is opened with, and topped up by, base units — 0.1 USDC at 6 decimals. */
3943
4103
  declare const DEFAULT_DEPOSIT = 100000n;
3944
4104
  /**
3945
- * How one chain's RPC leaves this process when it rides the proxy: two shapes of
3946
- * one pinned circuit, because the two chains' clients take different objects.
4105
+ * How one chain's RPC leaves this process when it rides the proxy: a `fetch`
4106
+ * bound to the chain's pinned circuit, handed to viem's `fetchFn` (EVM) or to
4107
+ * Solana's JSON-RPC client.
3947
4108
  */
3948
4109
  interface ProxiedChainRpc {
3949
- /** The undici dispatcher, for viem, which calls the global `fetch` itself (EVM). */
3950
- dispatcher: unknown;
3951
- /** `fetch` bound to that dispatcher, for Solana's JSON-RPC. */
4110
+ /** `fetch` bound to that circuit. */
3952
4111
  fetch: typeof fetch;
3953
4112
  }
3954
4113
  /** The keys this client holds, per chain. Absent means "no key for that chain". */
@@ -3974,6 +4133,8 @@ interface ResolvedConfig {
3974
4133
  connectorIsHiddenService: boolean;
3975
4134
  /** The `socks5h://` proxy to reach it through, when there is one. */
3976
4135
  socksProxy: string | undefined;
4136
+ /** Validated per-carriage replacements for the published endpoints. */
4137
+ carriageEndpoints: CarriageEndpoints;
3977
4138
  /** Whether chain RPC rides that proxy too (ADR 0002). */
3978
4139
  proxyRpc: boolean;
3979
4140
  /**
@@ -5175,10 +5336,12 @@ interface TransportChoice {
5175
5336
  * `ConnectorEdgeClient.describe` records; an absolute endpoint needs neither.
5176
5337
  * @param destination the ILP address this carriage will carry packets to, so
5177
5338
  * the route that governs it answers rather than the node-wide summary.
5339
+ * @param overrides the payer's `carriageEndpoints`, absolute, replacing the
5340
+ * published endpoint of that carriage only.
5178
5341
  * @throws {TransportRequiredError} the requested carriage is unavailable, or
5179
5342
  * the node publishes no usable endpoint at all.
5180
5343
  */
5181
- declare function selectTransport(description: NodeSelfDescription, preference?: TransportPreference, baseUrl?: string | undefined, destination?: string): TransportChoice;
5344
+ declare function selectTransport(description: NodeSelfDescription, preference?: TransportPreference, baseUrl?: string | undefined, destination?: string, overrides?: CarriageEndpoints): TransportChoice;
5182
5345
 
5183
5346
  /**
5184
5347
  * Canonical OER length primitives (RFC-0030), ported byte-for-byte from
@@ -5838,6 +6001,7 @@ declare function settleDeposit(params: {
5838
6001
  extensions?: Record<string, {
5839
6002
  info: Record<string, unknown>;
5840
6003
  }>;
6004
+ /** Defaults to the global `fetch`: the clearnet behaviour for a direct caller. The client always passes its own. */
5841
6005
  fetchImpl?: typeof fetch;
5842
6006
  }): Promise<SettledDeposit>;
5843
6007
 
@@ -5928,6 +6092,7 @@ declare function requestSponsoredOpen(params: {
5928
6092
  connector: string;
5929
6093
  sponsorEndpoint: string;
5930
6094
  transaction: string;
6095
+ /** Defaults to the global `fetch`: the clearnet behaviour for a direct caller. The client always passes its own. */
5931
6096
  fetchImpl?: typeof fetch;
5932
6097
  }): Promise<SponsoredOpen>;
5933
6098
 
@@ -6788,56 +6953,6 @@ declare function isHiddenServiceUrl(url: unknown): boolean;
6788
6953
  */
6789
6954
  declare function assertRoutableHsHostname(hostname: unknown): string;
6790
6955
 
6791
- /**
6792
- * The one place viem is told to send chain RPC through the hidden-service proxy.
6793
- *
6794
- * viem's HTTP transport calls the **global** `fetch` and accepts no injected one.
6795
- * Its only opening is `fetchOptions`, which it merges into the `fetch` init — and
6796
- * Node's `fetch` reads a `dispatcher` from there. So a dispatcher is how, and the
6797
- * only how, chain traffic joins the packet traffic inside the overlay (ADR 0002).
6798
- *
6799
- * Browser-safe: this module imports nothing but viem. The dispatcher itself is
6800
- * built in `./socks.js`, which is Node-only and dynamically imported; here it is
6801
- * an opaque `unknown` that is either present or not.
6802
- */
6803
-
6804
- /** Options a caller already wanted, independent of any proxy. */
6805
- interface RpcTransportOptions {
6806
- timeout?: number;
6807
- retryCount?: number;
6808
- retryDelay?: number;
6809
- }
6810
- /**
6811
- * What a proxied RPC request gets when its caller names nothing else, sized
6812
- * from connector ADR 0073's measurements through `anon` (decisions 4 and 5).
6813
- *
6814
- * - `timeout` 30s, not viem's 10s. The worst call measured that needed a new
6815
- * circuit took 13s. Under 10s that one would have been reported as a failure,
6816
- * and retried on another new circuit.
6817
- * - `retryDelay` 500ms, not viem's 150ms. viem already retries 403, 408, 429,
6818
- * 5xx and dropped connections. Exit IPs are shared, so a 429 is the error to
6819
- * expect, and retrying it at 150ms mostly earns another one.
6820
- * - `retryCount` 3, viem's own.
6821
- */
6822
- declare const PROXIED_RPC_DEFAULTS: {
6823
- readonly timeout: 30000;
6824
- readonly retryCount: 3;
6825
- readonly retryDelay: 500;
6826
- };
6827
- /**
6828
- * A viem HTTP transport for `url`, bound to `dispatcher` when there is one.
6829
- *
6830
- * `undefined` dispatcher means clearnet, and produces exactly the transport this
6831
- * package built before hidden services existed. A dispatcher also brings
6832
- * {@link PROXIED_RPC_DEFAULTS}, under anything the caller set explicitly.
6833
- */
6834
- declare function rpcTransport(url: string, dispatcher: unknown | undefined, options?: RpcTransportOptions): ReturnType<typeof http>;
6835
- /**
6836
- * `fetch` bound to `dispatcher`, for a JSON-RPC path that calls `fetch` itself
6837
- * rather than going through viem — Solana's, in practice.
6838
- */
6839
- declare function rpcFetch(dispatcher: unknown | undefined, fetchImpl?: typeof fetch): typeof fetch;
6840
-
6841
6956
  /**
6842
6957
  * Well-known values for the public TOON devnet.
6843
6958
  *
@@ -7008,4 +7123,4 @@ interface RetryOptions {
7008
7123
  */
7009
7124
  declare function withRetry<T>(operation: () => Promise<T>, options: RetryOptions): Promise<T>;
7010
7125
 
7011
- 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 BatchChannel, type BatchChannelConfig, BatchChannelManager, type BatchChannelSummary, type BatchDepositPayload, type BatchExitResult, type BatchSettlementBinding, type BatchSettlementEvmOffer, type BatchSettlementOffer, BatchSettlementPayer, type BatchSettlementPayerConfig, type BatchSettlementSvmOffer, type BatchSettlementTerms, type BatchVoucher, BeforePayRefusedError, BtpAuthError, type BtpChannelDeclaration, BtpConnectionError, type BtpPacketResponse, BtpPaidWriteTransport, type BtpPaidWriteTransportConfig, BtpRuntimeClient, type BtpRuntimeClientConfig, CHANNEL_CHALLENGE_MAX_LIFETIME_SECONDS, CLAIM_ACK_HEADER, CLAIM_ACK_PROTOCOL, CLAIM_REJECT_REASONS, CONNECTOR_MAX_TIMEOUT_SECONDS, ChainKind, ChainUnavailableError, type ChannelBinding, type ChannelBindingContext, type ChannelFacade, type ChannelFacadeDeps, ChannelFundingError, ChannelNotOpenError, ChannelResumeError, type ChannelState, type ChannelStore, type ChannelStoreEntry, type ClaimAck, type ClaimSendingTransport$1 as ClaimSendingTransport, type ClaimStateFailed, type ClaimStateOk, type ClaimStateRequestEntry, type ClaimStateResult, type ClaimSummary, ClientChannelFacade, ClientWalletFacade, ConfigError, ConnectorEdgeClient, type ConnectorEdgeClientConfig, ConnectorEdgeError, type ConnectorEdgeErrorCode, ConnectorError, type ConnectorIdentity, type ConnectorRoutePrice, type ConnectorRouteTerms, type ContractReader, DEFAULT_DEPOSIT, DEFAULT_TIMEOUT_MS, DEVNET, type Decoded, type DepositExtensions, type DeriveIdentityOptions, type DerivedIdentity, type DevnetNode, EIP2612_GAS_SPONSORING, ERC20_APPROVAL_GAS_SPONSORING, ERC3009_DEPOSIT_COLLECTOR_ADDRESS, type EdgeIdentity, type Eip3009DepositPayload, type EncryptedKeystore, type EndpointSource, type Envelope, EnvelopeError, EnvelopeErrorKind, type EnvelopeHeader, type EnvelopeRequest, type EnvelopeResponse, type EvmBatchChannelState, type EvmExitClients, EvmSigner, type EvmWalletAccess, type ExchangeOutcome, FULFILLMENT_MISMATCH_CODE, FULFILLMENT_MISMATCH_MESSAGE, FacilitatorError, 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, MAX_GRACE_PERIOD_SECONDS, MAX_WITHDRAW_DELAY_SECONDS, MIN_GRACE_PERIOD_SECONDS, MIN_WITHDRAW_DELAY_SECONDS, NetworkError, type NodeSelfDescription, OerError, OerErrorKind, type OpenedKeystore, type OpenedRequest, PACKET_EXPIRY_HEADROOM_MS, PAYMENT_CHANNELS_PROGRAM_ID, PAYMENT_REQUIRED_HEADER, PAYMENT_REQUIRED_PROTOCOL, PERMIT2_ADDRESS, PERMIT2_DEPOSIT_COLLECTOR_ADDRESS, PROXIED_RPC_DEFAULTS, type PaidWriteTransport, type ParsedX402Challenge, PaymentRequiredError, type PaymentTerms, type Permit2DepositPayload, type PreparedVoucher, 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 SettledDeposit, type Signer as SolanaKeypair, type SolanaNetwork, SolanaRpcTransportError, type SolanaWireTransaction, SponsorRefusedError, type SponsoredOpen, StaleRpcReadError, type SvmBatchChannelConfig, type SvmBatchChannelState, type SvmBatchVoucher, ToonClient, type ToonClientConfig, ToonClientError, type ToonClientLike, type ToonGreeting, type ToonIdentity, type ToonTermsInfo, TransactionOutcomeError, type TransferConfig, TransferNotDeliveredError, TransferUnsupportedError, type TransportChoice, type TransportPreference, TransportRequiredError, type TypedDataSigner, UnknownChainError, ValidationError, type VoucherClaimEnvelope, type VoucherOutcome, type VoucherSigner, type WalletBalance, type WalletBalanceSources, type WalletChainBalances, type WalletFacade, type WalletFacadeDeps, type WalletTokenAmount, type WriteKeystoreOptions, X402_BATCH_SETTLEMENT_ADDRESS, X402_BATCH_SETTLEMENT_DEPOSIT_ABI, X402_BATCH_SETTLEMENT_EXIT_ABI, X402_BATCH_SETTLEMENT_READ_ABI, addressFor, approvePermit2, assertRoutableHsHostname, batchChannelId, batchVoucherDigest, buildBatchChannelConfig, buildEip3009Deposit, buildJobEvent, buildPermit2Deposit, buildResponseMeta, buildSponsoredOpen, buildSvmBatchChannelConfig, buildSvmRequestCloseInstruction, buildSvmSealInstruction, buildSvmTopUpInstruction, buildSvmVoucherMessage, buildSvmWithdrawPayerInstruction, buyArnsName, buyArnsNameWithNewAnt, chainUnavailableMessage, chargeFor, chooseBatchSettlement, connectorEdgeBaseUrl, decodeAccumulatedCost, decodeBase64Text, decodeClaimAck, decodeEnvelope, decodeEnvelopeRequest, decodeEnvelopeResponse, decodePaymentRequired, decodeSvmBatchChannel, decodeVarOctetString, decodeVarUint, decryptMnemonic, defaultDestinationFor, defaultFacilitatorFor, defaultFaucetTimeout, defaultRpcUrl, depositDirectly, deriveFulfillment, deriveFullIdentity, describeEndpoint, deserializeIlpPacket, deserializeIlpPrepare, eip2612Nonce, eip2612PermitData, encodeEnvelope, encodeEnvelopeRequest, encodeEnvelopeResponse, encodeVarOctetString, encodeVarUint, encryptMnemonic, envelopeHeader, erc3009CollectorData, evmChainIdOf, evmChallengeDigest, evmDerivationPath, evmIdentityFromKey, evmVoucherClaim, evmWalletAccess, facilitatorExtensions, finalizeEvmBatchWithdraw, fundWallet, generateKeystore, generateMnemonic, generateRandomIdentity, generateSolanaKeypair, getSvmBatchChannel, giftWrapPublicKey, httpEndpointToBtpUrl, importKeystore, initiateEvmBatchWithdraw, isGasStationFailure, isHiddenServiceUrl, isInsufficientGasError, isRoutableHsHostname, jobEventParam, keystoreDerivation, loadKeystore, localGiftWrapEcdh, looksLikeSealedResponse, mapIlpResponse, nextVoucherAmount, offerFromTerms, openKeystore, openRequest, openResponse, parseBatchSettlementOffer, parseBatchSettlementTerms, parseBtpMessage, parsePaymentTerms, parseSelfDescription, parseSolanaWireTransaction, parseX402Body, parseX402Challenge, patchSolanaRecentBlockhash, paymentChannelsEventAuthority, permit2Allowance, permit2CollectorData, readBaseUnits, readResponseMeta$1 as readBtpResponseMeta, readEvmBatchChannel, readEvmNativeBalance, readEvmTokenBalance, readExchangeOutcome, readResponseMeta, readSolanaNativeBalance, readSolanaTokenBalance, readVoucherRefusal, readWalletBalances, requestSponsoredOpen, requestSvmBatchClose, resolveConfig, resolveExpectedFulfillment, resolveExpiresAt, routeFor, routePriceFor, rpcFetch, rpcTransport, sealExchange, sealRequest, sealRequestWithRandomness, sealResponse, sealResponseWithRandomness, selectTransport, send, sendJob, sendTransfer, serializeBtpMessage, serializeIlpFulfill, serializeIlpPrepare, serializeIlpReject, settleDeposit, signBatchVoucher, signEip2612GasSponsoring, signErc20ApprovalGasSponsoring, signEvmChallenge, signSolanaChallenge, signSolanaWireTransaction, signSvmVoucher, singleRecipientDistributionHash, solanaChallengeMessage, solanaKeypair, solanaVoucherClaim, spawnAnt, svmBatchChannelAddress, toEnvelopeRequest, trimTrailingSlashes, validateMnemonic, withRetry, withdrawSvmBatchChannel, writeKeystoreFile };
7126
+ 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 BatchChannel, type BatchChannelConfig, BatchChannelManager, type BatchChannelSummary, type BatchDepositPayload, type BatchExitResult, type BatchSettlementBinding, type BatchSettlementEvmOffer, type BatchSettlementOffer, BatchSettlementPayer, type BatchSettlementPayerConfig, type BatchSettlementSvmOffer, type BatchSettlementTerms, type BatchVoucher, BeforePayRefusedError, BtpAuthError, type BtpChannelDeclaration, BtpConnectionError, type BtpPacketResponse, BtpPaidWriteTransport, type BtpPaidWriteTransportConfig, BtpRuntimeClient, type BtpRuntimeClientConfig, CHANNEL_CHALLENGE_MAX_LIFETIME_SECONDS, CLAIM_ACK_HEADER, CLAIM_ACK_PROTOCOL, CLAIM_REJECT_REASONS, CONNECTOR_MAX_TIMEOUT_SECONDS, type CarriageEndpoints, ChainKind, type ChainRpcRoute, ChainUnavailableError, type ChannelBinding, type ChannelBindingContext, type ChannelFacade, type ChannelFacadeDeps, ChannelFundingError, ChannelNotOpenError, ChannelResumeError, type ChannelState, type ChannelStore, type ChannelStoreEntry, type ClaimAck, type ClaimSendingTransport$1 as ClaimSendingTransport, type ClaimStateFailed, type ClaimStateOk, type ClaimStateRequestEntry, type ClaimStateResult, type ClaimSummary, ClientChannelFacade, ClientWalletFacade, ConfigError, ConnectorEdgeClient, type ConnectorEdgeClientConfig, ConnectorEdgeError, type ConnectorEdgeErrorCode, ConnectorError, type ConnectorIdentity, type ConnectorRoutePrice, type ConnectorRouteTerms, type ContractReader, DEFAULT_DEPOSIT, DEFAULT_TIMEOUT_MS, DEVNET, type Decoded, type DepositExtensions, type DeriveIdentityOptions, type DerivedIdentity, type DevnetNode, EIP2612_GAS_SPONSORING, ERC20_APPROVAL_GAS_SPONSORING, ERC3009_DEPOSIT_COLLECTOR_ADDRESS, type EdgeIdentity, type Eip3009DepositPayload, type EncryptedKeystore, type EndpointSource, type Envelope, EnvelopeError, EnvelopeErrorKind, type EnvelopeHeader, type EnvelopeRequest, type EnvelopeResponse, type EvmBatchChannelState, type EvmExitClients, EvmSigner, type EvmWalletAccess, type ExchangeOutcome, FULFILLMENT_MISMATCH_CODE, FULFILLMENT_MISMATCH_MESSAGE, FacilitatorError, 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, MAX_GRACE_PERIOD_SECONDS, MAX_WITHDRAW_DELAY_SECONDS, MIN_GRACE_PERIOD_SECONDS, MIN_WITHDRAW_DELAY_SECONDS, NetworkError, type NodeSelfDescription, OerError, OerErrorKind, type OpenedKeystore, type OpenedRequest, PACKET_EXPIRY_HEADROOM_MS, PAYMENT_CHANNELS_PROGRAM_ID, PAYMENT_REQUIRED_HEADER, PAYMENT_REQUIRED_PROTOCOL, PERMIT2_ADDRESS, PERMIT2_DEPOSIT_COLLECTOR_ADDRESS, PROXIED_RPC_DEFAULTS, type PaidWriteTransport, type ParsedX402Challenge, PaymentRequiredError, type PaymentTerms, type Permit2DepositPayload, type PreparedVoucher, type ProxiedChainRpc, type ProxiedPath, ProxyBypassError, 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 SettledDeposit, type Signer as SolanaKeypair, type SolanaNetwork, SolanaRpcTransportError, type SolanaWireTransaction, SponsorRefusedError, type SponsoredOpen, StaleRpcReadError, type SvmBatchChannelConfig, type SvmBatchChannelState, type SvmBatchVoucher, ToonClient, type ToonClientConfig, ToonClientError, type ToonClientLike, type ToonGreeting, type ToonIdentity, type ToonTermsInfo, TransactionOutcomeError, type TransferConfig, TransferNotDeliveredError, TransferUnsupportedError, type TransportChoice, type TransportPreference, TransportRequiredError, type TypedDataSigner, UnknownChainError, ValidationError, type VoucherClaimEnvelope, type VoucherOutcome, type VoucherSigner, type WalletBalance, type WalletBalanceSources, type WalletChainBalances, type WalletFacade, type WalletFacadeDeps, type WalletTokenAmount, type WriteKeystoreOptions, X402_BATCH_SETTLEMENT_ADDRESS, X402_BATCH_SETTLEMENT_DEPOSIT_ABI, X402_BATCH_SETTLEMENT_EXIT_ABI, X402_BATCH_SETTLEMENT_READ_ABI, addressFor, approvePermit2, assertRoutableHsHostname, batchChannelId, batchVoucherDigest, buildBatchChannelConfig, buildEip3009Deposit, buildJobEvent, buildPermit2Deposit, buildResponseMeta, buildSponsoredOpen, buildSvmBatchChannelConfig, buildSvmRequestCloseInstruction, buildSvmSealInstruction, buildSvmTopUpInstruction, buildSvmVoucherMessage, buildSvmWithdrawPayerInstruction, buyArnsName, buyArnsNameWithNewAnt, chainUnavailableMessage, chargeFor, chooseBatchSettlement, connectorEdgeBaseUrl, decodeAccumulatedCost, decodeBase64Text, decodeClaimAck, decodeEnvelope, decodeEnvelopeRequest, decodeEnvelopeResponse, decodePaymentRequired, decodeSvmBatchChannel, decodeVarOctetString, decodeVarUint, decryptMnemonic, defaultDestinationFor, defaultFacilitatorFor, defaultFaucetTimeout, defaultRpcUrl, depositDirectly, deriveFulfillment, deriveFullIdentity, describeEndpoint, deserializeIlpPacket, deserializeIlpPrepare, directFetch, eip2612Nonce, eip2612PermitData, encodeEnvelope, encodeEnvelopeRequest, encodeEnvelopeResponse, encodeVarOctetString, encodeVarUint, encryptMnemonic, envelopeHeader, erc3009CollectorData, evmChainIdOf, evmChallengeDigest, evmDerivationPath, evmIdentityFromKey, evmVoucherClaim, evmWalletAccess, facilitatorExtensions, finalizeEvmBatchWithdraw, fundWallet, generateKeystore, generateMnemonic, generateRandomIdentity, generateSolanaKeypair, getSvmBatchChannel, giftWrapPublicKey, httpEndpointToBtpUrl, importKeystore, initiateEvmBatchWithdraw, isGasStationFailure, isHiddenServiceUrl, isInsufficientGasError, isRoutableHsHostname, jobEventParam, keystoreDerivation, loadKeystore, localGiftWrapEcdh, looksLikeSealedResponse, mapIlpResponse, nextVoucherAmount, offerFromTerms, openKeystore, openRequest, openResponse, parseBatchSettlementOffer, parseBatchSettlementTerms, parseBtpMessage, parsePaymentTerms, parseSelfDescription, parseSolanaWireTransaction, parseX402Body, parseX402Challenge, patchSolanaRecentBlockhash, paymentChannelsEventAuthority, permit2Allowance, permit2CollectorData, readBaseUnits, readResponseMeta$1 as readBtpResponseMeta, readEvmBatchChannel, readEvmNativeBalance, readEvmTokenBalance, readExchangeOutcome, readResponseMeta, readSolanaNativeBalance, readSolanaTokenBalance, readVoucherRefusal, readWalletBalances, requestSponsoredOpen, requestSvmBatchClose, resolveConfig, resolveExpectedFulfillment, resolveExpiresAt, routeFor, routePriceFor, rpcFetch, rpcTransport, sealExchange, sealRequest, sealRequestWithRandomness, sealResponse, sealResponseWithRandomness, selectTransport, send, sendJob, sendTransfer, serializeBtpMessage, serializeIlpFulfill, serializeIlpPrepare, serializeIlpReject, settleDeposit, signBatchVoucher, signEip2612GasSponsoring, signErc20ApprovalGasSponsoring, signEvmChallenge, signSolanaChallenge, signSolanaWireTransaction, signSvmVoucher, singleRecipientDistributionHash, solanaChallengeMessage, solanaKeypair, solanaVoucherClaim, spawnAnt, svmBatchChannelAddress, toEnvelopeRequest, trimTrailingSlashes, validateMnemonic, withRetry, withdrawSvmBatchChannel, writeKeystoreFile };