@toon-protocol/client 5.1.0 → 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.
- package/dist/canary-FYKD66CX.js +67 -0
- package/dist/canary-FYKD66CX.js.map +1 -0
- package/dist/chunk-ABOW5ZCE.js +299 -0
- package/dist/chunk-ABOW5ZCE.js.map +1 -0
- package/dist/{chunk-BHGJXLS7.js → chunk-KGT4XOBZ.js} +245 -359
- package/dist/chunk-KGT4XOBZ.js.map +1 -0
- package/dist/{chunk-SIDK54Y5.js → chunk-KWUYZQBN.js} +30 -5
- package/dist/chunk-KWUYZQBN.js.map +1 -0
- package/dist/cli/main.js +68 -12
- package/dist/cli/main.js.map +1 -1
- package/dist/{client-DF3LZVLC.js → client-3KOPQDZG.js} +19 -13
- package/dist/{hidden-service-BtIv3u0L.d.ts → hidden-service-D58bCgdN.d.ts} +10 -5
- package/dist/index.d.ts +237 -94
- package/dist/index.js +36 -28
- package/dist/index.js.map +1 -1
- package/dist/{socks-KNSFCLBG.js → socks-OGGKES7C.js} +6 -2
- package/dist/transport/hidden-service.d.ts +1 -1
- package/dist/transport/hidden-service.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-BHGJXLS7.js.map +0 -1
- package/dist/chunk-SIDK54Y5.js.map +0 -1
- /package/dist/{client-DF3LZVLC.js.map → client-3KOPQDZG.js.map} +0 -0
- /package/dist/{socks-KNSFCLBG.js.map → socks-OGGKES7C.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Hex, LocalAccount, TransactionReceipt
|
|
2
|
-
import { C as ChainKind } from './hidden-service-
|
|
3
|
-
export { H as HiddenServiceTransport, a as HiddenServiceTransportOptions, v as validateSocks5hUrl } from './hidden-service-
|
|
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
|
/**
|
|
@@ -311,8 +311,20 @@ declare class ToonClientError extends Error {
|
|
|
311
311
|
* These errors trigger retry logic with exponential backoff.
|
|
312
312
|
*/
|
|
313
313
|
declare class NetworkError extends ToonClientError {
|
|
314
|
-
|
|
314
|
+
/** The URL that could not be reached, when the failure was reaching one. */
|
|
315
|
+
readonly endpoint?: string;
|
|
316
|
+
constructor(message: string, cause?: Error, endpoint?: string);
|
|
315
317
|
}
|
|
318
|
+
/** Where a packet-path URL came from: the caller's config, or the node's self-description. */
|
|
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. */
|
|
327
|
+
declare function describeEndpoint(url: string, source?: EndpointSource): string;
|
|
316
328
|
/**
|
|
317
329
|
* Connector error for a transport-level failure at the client edge: a `4xx`
|
|
318
330
|
* that is not a greeting, or a `5xx`.
|
|
@@ -458,6 +470,20 @@ declare class TransportRequiredError extends ToonClientError {
|
|
|
458
470
|
cause?: Error;
|
|
459
471
|
});
|
|
460
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
|
+
}
|
|
461
487
|
/**
|
|
462
488
|
* Thrown when the one-time on-chain payment-channel OPEN reverts because the
|
|
463
489
|
* local settlement wallet has no native gas to pay for its own
|
|
@@ -611,6 +637,80 @@ declare class TransactionOutcomeError extends ToonClientError {
|
|
|
611
637
|
constructor(message: string, chain: ChainKind, txHash: string, outcome: 'failed' | 'expired' | 'unknown', cause?: Error);
|
|
612
638
|
}
|
|
613
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
|
+
|
|
614
714
|
/**
|
|
615
715
|
* Solana over raw JSON-RPC: the program-derived-address search, associated
|
|
616
716
|
* token accounts, a legacy transaction compiler and sender, and the reads a
|
|
@@ -659,17 +759,13 @@ interface Signer {
|
|
|
659
759
|
/**
|
|
660
760
|
* Where Solana JSON-RPC goes, and how it gets there.
|
|
661
761
|
*
|
|
662
|
-
* A
|
|
663
|
-
*
|
|
664
|
-
*
|
|
665
|
-
*
|
|
666
|
-
*
|
|
667
|
-
* 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.
|
|
668
767
|
*/
|
|
669
|
-
type SolanaRpcTarget =
|
|
670
|
-
url: string;
|
|
671
|
-
fetchImpl?: typeof fetch;
|
|
672
|
-
};
|
|
768
|
+
type SolanaRpcTarget = ChainRpcRoute;
|
|
673
769
|
/**
|
|
674
770
|
* A Solana JSON-RPC call that got no answer from the node: every try was lost in
|
|
675
771
|
* transit, timed out, or was turned away at the HTTP layer.
|
|
@@ -1723,10 +1819,9 @@ interface EvmWalletAccess {
|
|
|
1723
1819
|
* RPC reports. Nothing connects until it is first used.
|
|
1724
1820
|
*/
|
|
1725
1821
|
declare function evmWalletAccess(params: {
|
|
1726
|
-
|
|
1822
|
+
/** The route chain RPC takes, with the fetch it dials through. */
|
|
1823
|
+
rpc: ChainRpcRoute;
|
|
1727
1824
|
account: LocalAccount;
|
|
1728
|
-
/** The proxy-bound dispatcher a hidden payer's RPC rides, if any. */
|
|
1729
|
-
dispatcher?: unknown;
|
|
1730
1825
|
}): EvmWalletAccess;
|
|
1731
1826
|
/** How much of `token` Permit2 may move for `owner`. */
|
|
1732
1827
|
declare function permit2Allowance(reader: ContractReader, token: string, owner: string): Promise<bigint>;
|
|
@@ -1735,7 +1830,11 @@ declare function permit2Allowance(reader: ContractReader, token: string, owner:
|
|
|
1735
1830
|
* `nonces(address)` — and so, for this purpose, no permit.
|
|
1736
1831
|
*/
|
|
1737
1832
|
declare function eip2612Nonce(reader: ContractReader, token: string, owner: string): Promise<bigint | undefined>;
|
|
1738
|
-
/**
|
|
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
|
+
*/
|
|
1739
1838
|
declare function facilitatorExtensions(facilitatorUrl: string, fetchImpl?: typeof fetch): Promise<string[]>;
|
|
1740
1839
|
/** `paymentPayload.extensions`, as a facilitator reads them. */
|
|
1741
1840
|
type DepositExtensions = Record<string, {
|
|
@@ -1903,7 +2002,7 @@ interface BatchSettlementPayerConfig {
|
|
|
1903
2002
|
rpc: SolanaRpcTarget;
|
|
1904
2003
|
};
|
|
1905
2004
|
/** How the connector's sponsor endpoint and the facilitator are reached. */
|
|
1906
|
-
fetch
|
|
2005
|
+
fetch: typeof fetch;
|
|
1907
2006
|
/**
|
|
1908
2007
|
* The connector's own watermark for a channel (`POST /ilp/claim-state`),
|
|
1909
2008
|
* asked with the voucher challenge this payer signs. It recovers a lost
|
|
@@ -2105,8 +2204,7 @@ interface ChannelFacadeDeps {
|
|
|
2105
2204
|
describe(): Promise<NodeSelfDescription>;
|
|
2106
2205
|
evm?: {
|
|
2107
2206
|
privateKey: Uint8Array;
|
|
2108
|
-
|
|
2109
|
-
rpcDispatcher: unknown;
|
|
2207
|
+
rpc: ChainRpcRoute;
|
|
2110
2208
|
};
|
|
2111
2209
|
solana?: {
|
|
2112
2210
|
signer: Signer;
|
|
@@ -2849,9 +2947,10 @@ interface ConnectorEdgeClientConfig {
|
|
|
2849
2947
|
* are how a stale answer is dropped.
|
|
2850
2948
|
*
|
|
2851
2949
|
* A price is cached the same way and for the same reason (toon-client#452):
|
|
2852
|
-
* under ADR 0020 a route
|
|
2853
|
-
* not vary with what is being sent
|
|
2854
|
-
*
|
|
2950
|
+
* under ADR 0020 a route has one set of terms — one handler, one base price and
|
|
2951
|
+
* an optional per-KiB rate — and the terms do not vary with what is being sent
|
|
2952
|
+
* (only the arithmetic over the sealed size does), so asking again per packet
|
|
2953
|
+
* would buy nothing but latency.
|
|
2855
2954
|
*/
|
|
2856
2955
|
declare class ConnectorEdgeClient {
|
|
2857
2956
|
private readonly fetchImpl;
|
|
@@ -2963,8 +3062,8 @@ declare class ConnectorEdgeClient {
|
|
|
2963
3062
|
* a transport failure throws {@link NetworkError} instead, so a caller can
|
|
2964
3063
|
* always tell "not mine" from "could not ask".
|
|
2965
3064
|
*
|
|
2966
|
-
* Fetched once per (endpoint, destination) and reused. ADR 0020
|
|
2967
|
-
*
|
|
3065
|
+
* Fetched once per (endpoint, destination) and reused. ADR 0020 gives a
|
|
3066
|
+
* handler one set of terms, which do not vary with the packet — a route
|
|
2968
3067
|
* being repriced is an operator event, and {@link invalidateRoutePrice} is
|
|
2969
3068
|
* how a caller reacts to one.
|
|
2970
3069
|
*
|
|
@@ -3072,21 +3171,34 @@ declare function readEvmTokenBalance(opts: {
|
|
|
3072
3171
|
chainKey: string;
|
|
3073
3172
|
tokenAddress: string;
|
|
3074
3173
|
owner: string;
|
|
3075
|
-
/**
|
|
3076
|
-
|
|
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;
|
|
3077
3182
|
}): Promise<WalletBalance>;
|
|
3078
3183
|
/** Read the native ETH balance (wei) for `owner` via `eth_getBalance`. */
|
|
3079
3184
|
declare function readEvmNativeBalance(opts: {
|
|
3080
3185
|
rpcUrl: string;
|
|
3081
3186
|
chainKey: string;
|
|
3082
3187
|
owner: string;
|
|
3083
|
-
/**
|
|
3084
|
-
|
|
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;
|
|
3085
3196
|
}): Promise<WalletTokenAmount>;
|
|
3086
3197
|
/** Read the native SOL balance (lamports) for `owner` via the `getBalance` RPC. */
|
|
3087
3198
|
declare function readSolanaNativeBalance(opts: {
|
|
3088
3199
|
rpcUrl: string;
|
|
3089
3200
|
owner: string;
|
|
3201
|
+
/** Defaults to the global `fetch`: the clearnet behaviour for a direct caller. */
|
|
3090
3202
|
fetchImpl?: typeof fetch;
|
|
3091
3203
|
/** The fetch rides the SOCKS5h proxy: allow a circuit's latency. */
|
|
3092
3204
|
proxied?: boolean;
|
|
@@ -3096,6 +3208,7 @@ declare function readSolanaTokenBalance(opts: {
|
|
|
3096
3208
|
rpcUrl: string;
|
|
3097
3209
|
mint: string;
|
|
3098
3210
|
owner: string;
|
|
3211
|
+
/** Defaults to the global `fetch`: the clearnet behaviour for a direct caller. */
|
|
3099
3212
|
fetchImpl?: typeof fetch;
|
|
3100
3213
|
/** The fetch rides the SOCKS5h proxy: allow a circuit's latency. */
|
|
3101
3214
|
proxied?: boolean;
|
|
@@ -3117,7 +3230,9 @@ interface WalletBalanceSources {
|
|
|
3117
3230
|
* reads need no equivalent: they go through {@link WalletBalanceSources.fetchImpl},
|
|
3118
3231
|
* which is already the proxied `fetch` on a hidden-service client.
|
|
3119
3232
|
*/
|
|
3120
|
-
|
|
3233
|
+
evmRpcFetch?: typeof fetch;
|
|
3234
|
+
/** `evmRpcFetch` rides the proxy. Defaults to whether one was passed. */
|
|
3235
|
+
proxied?: boolean;
|
|
3121
3236
|
};
|
|
3122
3237
|
solana?: {
|
|
3123
3238
|
chainKey?: string;
|
|
@@ -3222,12 +3337,22 @@ interface EvmTransferConfig {
|
|
|
3222
3337
|
signer: EvmSigner;
|
|
3223
3338
|
/** ERC-20 settlement-token address. Required only for `asset: 'token'`. */
|
|
3224
3339
|
tokenAddress?: string;
|
|
3225
|
-
/**
|
|
3226
|
-
|
|
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;
|
|
3227
3348
|
}
|
|
3228
3349
|
interface SolanaTransferConfig {
|
|
3229
3350
|
rpcUrl: string;
|
|
3230
|
-
/**
|
|
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
|
+
*/
|
|
3231
3356
|
rpcFetch?: typeof fetch;
|
|
3232
3357
|
/** Ed25519 signing seed (32 bytes) or a 64-byte seed||pubkey keypair. */
|
|
3233
3358
|
keypair: Uint8Array;
|
|
@@ -3258,6 +3383,20 @@ interface TransferConfig {
|
|
|
3258
3383
|
*/
|
|
3259
3384
|
declare function sendTransfer(config: TransferConfig, params: SendTransferParams): Promise<SendTransferResult>;
|
|
3260
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
|
+
|
|
3261
3400
|
/**
|
|
3262
3401
|
* Devnet faucet helper.
|
|
3263
3402
|
*
|
|
@@ -3323,9 +3462,10 @@ declare function fundWallet(faucetUrl: string, address: string, chain: FaucetCha
|
|
|
3323
3462
|
* send, and what comes back.
|
|
3324
3463
|
*
|
|
3325
3464
|
* One idea underlies all of it. A **connector** is a paid reverse proxy: it
|
|
3326
|
-
* fronts an ordinary HTTP app, charges a
|
|
3327
|
-
*
|
|
3328
|
-
* "publish" or "post" — it
|
|
3465
|
+
* fronts an ordinary HTTP app, charges a base price plus an optional
|
|
3466
|
+
* per-kibibyte rate per route, and hands the app a request that was already
|
|
3467
|
+
* paid for. So the client's central operation is not "publish" or "post" — it
|
|
3468
|
+
* is {@link ToonClientLike.send}, which puts one HTTP
|
|
3329
3469
|
* request through a connector and gives you back the app's HTTP response, having
|
|
3330
3470
|
* paid for it with a voucher — a signed, cumulative claim on an x402
|
|
3331
3471
|
* `batch-settlement` channel — that travels *with* the packet (connector ADRs
|
|
@@ -3337,6 +3477,16 @@ type ChannelState = BatchChannelSummary;
|
|
|
3337
3477
|
/** Which carriage to pay over. */
|
|
3338
3478
|
type TransportPreference = 'auto' | 'http' | 'btp';
|
|
3339
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
|
+
}
|
|
3340
3490
|
interface ToonClientConfig {
|
|
3341
3491
|
/**
|
|
3342
3492
|
* The connector's client-edge base URL. A trailing `/ilp` is normalized away,
|
|
@@ -3450,6 +3600,16 @@ interface ToonClientConfig {
|
|
|
3450
3600
|
* Node only: a browser cannot dial a hidden service by any route.
|
|
3451
3601
|
*/
|
|
3452
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;
|
|
3453
3613
|
/**
|
|
3454
3614
|
* Send chain RPC through `socksProxy` as well as the packets. Default `true`.
|
|
3455
3615
|
*
|
|
@@ -3462,6 +3622,14 @@ interface ToonClientConfig {
|
|
|
3462
3622
|
fetch?: typeof fetch;
|
|
3463
3623
|
/** Injected websocket factory, for tests and runtimes without a global `WebSocket`. */
|
|
3464
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;
|
|
3465
3633
|
}
|
|
3466
3634
|
/**
|
|
3467
3635
|
* The HTTP request to make of the app behind a route.
|
|
@@ -3934,13 +4102,12 @@ declare const DEFAULT_TIMEOUT_MS = 30000;
|
|
|
3934
4102
|
/** What a channel is opened with, and topped up by, base units — 0.1 USDC at 6 decimals. */
|
|
3935
4103
|
declare const DEFAULT_DEPOSIT = 100000n;
|
|
3936
4104
|
/**
|
|
3937
|
-
* How one chain's RPC leaves this process when it rides the proxy:
|
|
3938
|
-
*
|
|
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.
|
|
3939
4108
|
*/
|
|
3940
4109
|
interface ProxiedChainRpc {
|
|
3941
|
-
/**
|
|
3942
|
-
dispatcher: unknown;
|
|
3943
|
-
/** `fetch` bound to that dispatcher, for Solana's JSON-RPC. */
|
|
4110
|
+
/** `fetch` bound to that circuit. */
|
|
3944
4111
|
fetch: typeof fetch;
|
|
3945
4112
|
}
|
|
3946
4113
|
/** The keys this client holds, per chain. Absent means "no key for that chain". */
|
|
@@ -3966,6 +4133,8 @@ interface ResolvedConfig {
|
|
|
3966
4133
|
connectorIsHiddenService: boolean;
|
|
3967
4134
|
/** The `socks5h://` proxy to reach it through, when there is one. */
|
|
3968
4135
|
socksProxy: string | undefined;
|
|
4136
|
+
/** Validated per-carriage replacements for the published endpoints. */
|
|
4137
|
+
carriageEndpoints: CarriageEndpoints;
|
|
3969
4138
|
/** Whether chain RPC rides that proxy too (ADR 0002). */
|
|
3970
4139
|
proxyRpc: boolean;
|
|
3971
4140
|
/**
|
|
@@ -4792,6 +4961,11 @@ declare function readResponseMeta(headers: ResponseHeaderSource): IlpResponseMet
|
|
|
4792
4961
|
interface HttpIlpClientConfig {
|
|
4793
4962
|
/** The peer's `POST /ilp` URL (the `httpEndpoint` from discovery). */
|
|
4794
4963
|
httpEndpoint: string;
|
|
4964
|
+
/**
|
|
4965
|
+
* Where `httpEndpoint` came from, so a network failure can say so. Omit when
|
|
4966
|
+
* the caller supplied it.
|
|
4967
|
+
*/
|
|
4968
|
+
endpointSource?: EndpointSource;
|
|
4795
4969
|
/**
|
|
4796
4970
|
* Optional peer identity. With no `peerId`/`authToken` the connector treats
|
|
4797
4971
|
* the request as an anonymous no-auth peer (permissionless default) and
|
|
@@ -4828,6 +5002,7 @@ interface HttpIlpClientConfig {
|
|
|
4828
5002
|
*/
|
|
4829
5003
|
declare class HttpIlpClient implements IlpClient {
|
|
4830
5004
|
private readonly httpEndpoint;
|
|
5005
|
+
private readonly endpointSource;
|
|
4831
5006
|
private readonly peerId;
|
|
4832
5007
|
private readonly authToken;
|
|
4833
5008
|
private readonly timeout;
|
|
@@ -5020,6 +5195,13 @@ interface BtpPaidWriteTransportConfig {
|
|
|
5020
5195
|
* lazily on first use and never disconnected between writes.
|
|
5021
5196
|
*/
|
|
5022
5197
|
session: OrderedBtpSession;
|
|
5198
|
+
/**
|
|
5199
|
+
* The `ws(s)://` URL the session dials, so a connection failure can name it.
|
|
5200
|
+
* Omit and a failure carries the session's own message alone.
|
|
5201
|
+
*/
|
|
5202
|
+
url?: string;
|
|
5203
|
+
/** Where `url` came from, so a failure can say the node chose it. */
|
|
5204
|
+
endpointSource?: EndpointSource;
|
|
5023
5205
|
/**
|
|
5024
5206
|
* Stateless fallback used once a write's reconnect budget is exhausted.
|
|
5025
5207
|
* Typically an `HttpIlpClient` pointed at the same connector's `POST /ilp`.
|
|
@@ -5043,6 +5225,8 @@ interface BtpPaidWriteTransportConfig {
|
|
|
5043
5225
|
declare class BtpPaidWriteTransport implements ClaimSendingTransport {
|
|
5044
5226
|
private readonly session;
|
|
5045
5227
|
private readonly fallback;
|
|
5228
|
+
private readonly url;
|
|
5229
|
+
private readonly endpointSource;
|
|
5046
5230
|
private readonly maxReconnectAttempts;
|
|
5047
5231
|
private readonly reconnectDelay;
|
|
5048
5232
|
/**
|
|
@@ -5076,6 +5260,11 @@ declare class BtpPaidWriteTransport implements ClaimSendingTransport {
|
|
|
5076
5260
|
sendIlpPacket(params: IlpSendParams): Promise<IlpSendResult>;
|
|
5077
5261
|
/** Connect if need be, then send once. No claim, so nothing to re-spend. */
|
|
5078
5262
|
private dispatchUnpaid;
|
|
5263
|
+
/**
|
|
5264
|
+
* A connection-level failure becomes a {@link NetworkError} naming the BTP
|
|
5265
|
+
* URL, with the original kept as `cause`. Anything else passes through.
|
|
5266
|
+
*/
|
|
5267
|
+
private nameEndpoint;
|
|
5079
5268
|
/**
|
|
5080
5269
|
* One write's worth of connect/send/reconnect/fallback policy. Runs
|
|
5081
5270
|
* strictly after every write enqueued ahead of it has settled.
|
|
@@ -5147,10 +5336,12 @@ interface TransportChoice {
|
|
|
5147
5336
|
* `ConnectorEdgeClient.describe` records; an absolute endpoint needs neither.
|
|
5148
5337
|
* @param destination the ILP address this carriage will carry packets to, so
|
|
5149
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.
|
|
5150
5341
|
* @throws {TransportRequiredError} the requested carriage is unavailable, or
|
|
5151
5342
|
* the node publishes no usable endpoint at all.
|
|
5152
5343
|
*/
|
|
5153
|
-
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;
|
|
5154
5345
|
|
|
5155
5346
|
/**
|
|
5156
5347
|
* Canonical OER length primitives (RFC-0030), ported byte-for-byte from
|
|
@@ -5810,6 +6001,7 @@ declare function settleDeposit(params: {
|
|
|
5810
6001
|
extensions?: Record<string, {
|
|
5811
6002
|
info: Record<string, unknown>;
|
|
5812
6003
|
}>;
|
|
6004
|
+
/** Defaults to the global `fetch`: the clearnet behaviour for a direct caller. The client always passes its own. */
|
|
5813
6005
|
fetchImpl?: typeof fetch;
|
|
5814
6006
|
}): Promise<SettledDeposit>;
|
|
5815
6007
|
|
|
@@ -5900,6 +6092,7 @@ declare function requestSponsoredOpen(params: {
|
|
|
5900
6092
|
connector: string;
|
|
5901
6093
|
sponsorEndpoint: string;
|
|
5902
6094
|
transaction: string;
|
|
6095
|
+
/** Defaults to the global `fetch`: the clearnet behaviour for a direct caller. The client always passes its own. */
|
|
5903
6096
|
fetchImpl?: typeof fetch;
|
|
5904
6097
|
}): Promise<SponsoredOpen>;
|
|
5905
6098
|
|
|
@@ -6760,56 +6953,6 @@ declare function isHiddenServiceUrl(url: unknown): boolean;
|
|
|
6760
6953
|
*/
|
|
6761
6954
|
declare function assertRoutableHsHostname(hostname: unknown): string;
|
|
6762
6955
|
|
|
6763
|
-
/**
|
|
6764
|
-
* The one place viem is told to send chain RPC through the hidden-service proxy.
|
|
6765
|
-
*
|
|
6766
|
-
* viem's HTTP transport calls the **global** `fetch` and accepts no injected one.
|
|
6767
|
-
* Its only opening is `fetchOptions`, which it merges into the `fetch` init — and
|
|
6768
|
-
* Node's `fetch` reads a `dispatcher` from there. So a dispatcher is how, and the
|
|
6769
|
-
* only how, chain traffic joins the packet traffic inside the overlay (ADR 0002).
|
|
6770
|
-
*
|
|
6771
|
-
* Browser-safe: this module imports nothing but viem. The dispatcher itself is
|
|
6772
|
-
* built in `./socks.js`, which is Node-only and dynamically imported; here it is
|
|
6773
|
-
* an opaque `unknown` that is either present or not.
|
|
6774
|
-
*/
|
|
6775
|
-
|
|
6776
|
-
/** Options a caller already wanted, independent of any proxy. */
|
|
6777
|
-
interface RpcTransportOptions {
|
|
6778
|
-
timeout?: number;
|
|
6779
|
-
retryCount?: number;
|
|
6780
|
-
retryDelay?: number;
|
|
6781
|
-
}
|
|
6782
|
-
/**
|
|
6783
|
-
* What a proxied RPC request gets when its caller names nothing else, sized
|
|
6784
|
-
* from connector ADR 0073's measurements through `anon` (decisions 4 and 5).
|
|
6785
|
-
*
|
|
6786
|
-
* - `timeout` 30s, not viem's 10s. The worst call measured that needed a new
|
|
6787
|
-
* circuit took 13s. Under 10s that one would have been reported as a failure,
|
|
6788
|
-
* and retried on another new circuit.
|
|
6789
|
-
* - `retryDelay` 500ms, not viem's 150ms. viem already retries 403, 408, 429,
|
|
6790
|
-
* 5xx and dropped connections. Exit IPs are shared, so a 429 is the error to
|
|
6791
|
-
* expect, and retrying it at 150ms mostly earns another one.
|
|
6792
|
-
* - `retryCount` 3, viem's own.
|
|
6793
|
-
*/
|
|
6794
|
-
declare const PROXIED_RPC_DEFAULTS: {
|
|
6795
|
-
readonly timeout: 30000;
|
|
6796
|
-
readonly retryCount: 3;
|
|
6797
|
-
readonly retryDelay: 500;
|
|
6798
|
-
};
|
|
6799
|
-
/**
|
|
6800
|
-
* A viem HTTP transport for `url`, bound to `dispatcher` when there is one.
|
|
6801
|
-
*
|
|
6802
|
-
* `undefined` dispatcher means clearnet, and produces exactly the transport this
|
|
6803
|
-
* package built before hidden services existed. A dispatcher also brings
|
|
6804
|
-
* {@link PROXIED_RPC_DEFAULTS}, under anything the caller set explicitly.
|
|
6805
|
-
*/
|
|
6806
|
-
declare function rpcTransport(url: string, dispatcher: unknown | undefined, options?: RpcTransportOptions): ReturnType<typeof http>;
|
|
6807
|
-
/**
|
|
6808
|
-
* `fetch` bound to `dispatcher`, for a JSON-RPC path that calls `fetch` itself
|
|
6809
|
-
* rather than going through viem — Solana's, in practice.
|
|
6810
|
-
*/
|
|
6811
|
-
declare function rpcFetch(dispatcher: unknown | undefined, fetchImpl?: typeof fetch): typeof fetch;
|
|
6812
|
-
|
|
6813
6956
|
/**
|
|
6814
6957
|
* Well-known values for the public TOON devnet.
|
|
6815
6958
|
*
|
|
@@ -6980,4 +7123,4 @@ interface RetryOptions {
|
|
|
6980
7123
|
*/
|
|
6981
7124
|
declare function withRetry<T>(operation: () => Promise<T>, options: RetryOptions): Promise<T>;
|
|
6982
7125
|
|
|
6983
|
-
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 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, 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 };
|