@toon-protocol/client 3.1.0 → 3.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/{chunk-M54FLOSJ.js → chunk-ZHWYFPOP.js} +74 -20
- package/dist/chunk-ZHWYFPOP.js.map +1 -0
- package/dist/cli/main.js +9 -2
- package/dist/cli/main.js.map +1 -1
- package/dist/{client-WC6UGT6C.js → client-SCEP67S5.js} +4 -2
- package/dist/index.d.ts +147 -15
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-M54FLOSJ.js.map +0 -1
- /package/dist/{client-WC6UGT6C.js.map → client-SCEP67S5.js.map} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
BeforePayRefusedError,
|
|
2
3
|
ChainUnavailableError,
|
|
3
4
|
ChannelFundingError,
|
|
4
5
|
ChannelNotOpenError,
|
|
@@ -30,10 +31,11 @@ import {
|
|
|
30
31
|
send,
|
|
31
32
|
settlementToTerms,
|
|
32
33
|
toEnvelopeRequest
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-ZHWYFPOP.js";
|
|
34
35
|
import "./chunk-7MPONJW5.js";
|
|
35
36
|
import "./chunk-32MD3CXE.js";
|
|
36
37
|
export {
|
|
38
|
+
BeforePayRefusedError,
|
|
37
39
|
ChainUnavailableError,
|
|
38
40
|
ChannelFundingError,
|
|
39
41
|
ChannelNotOpenError,
|
|
@@ -66,4 +68,4 @@ export {
|
|
|
66
68
|
settlementToTerms,
|
|
67
69
|
toEnvelopeRequest
|
|
68
70
|
};
|
|
69
|
-
//# sourceMappingURL=client-
|
|
71
|
+
//# sourceMappingURL=client-SCEP67S5.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -808,6 +808,34 @@ declare class ChannelNotOpenError extends ToonClientError {
|
|
|
808
808
|
declare class RouteNotPricedError extends ToonClientError {
|
|
809
809
|
constructor(message: string, cause?: Error);
|
|
810
810
|
}
|
|
811
|
+
/**
|
|
812
|
+
* The caller's own {@link ../client/types.js!SendOptions.beforePay} refused this
|
|
813
|
+
* send, and nothing was paid.
|
|
814
|
+
*
|
|
815
|
+
* Thrown rather than returned, and that is consistent with this file's rule
|
|
816
|
+
* rather than an exception to it: a {@link ../client/types.js!SendRefused} is
|
|
817
|
+
* the *connector's* verdict on a packet that travelled, and here no packet
|
|
818
|
+
* exists. The price was resolved, the hook said no, and the pipeline stopped
|
|
819
|
+
* before a channel was ensured or a balance proof was signed — which is the
|
|
820
|
+
* whole point of the hook, since a signed claim is a bearer instrument that
|
|
821
|
+
* cannot be recalled (see
|
|
822
|
+
* {@link ../channel/ChannelManager.js!ChannelManager.signBalanceProof}).
|
|
823
|
+
*
|
|
824
|
+
* A distinct class rather than a {@link ValidationError} because the two are
|
|
825
|
+
* acted on differently: a `ValidationError` says this client could not use an
|
|
826
|
+
* argument, while this says the caller's own rule rejected a request this client
|
|
827
|
+
* was perfectly able to send. {@link reason} is the hook's string, unedited, so
|
|
828
|
+
* the caller reads back exactly what its own check said.
|
|
829
|
+
*/
|
|
830
|
+
declare class BeforePayRefusedError extends ToonClientError {
|
|
831
|
+
/** The reason the hook returned, verbatim. */
|
|
832
|
+
readonly reason: string;
|
|
833
|
+
/** The route the refused packet was addressed to. */
|
|
834
|
+
readonly destination: string;
|
|
835
|
+
/** The resolved price the hook was shown, in base units. */
|
|
836
|
+
readonly amount: bigint;
|
|
837
|
+
constructor(reason: string, destination: string, amount: bigint);
|
|
838
|
+
}
|
|
811
839
|
/**
|
|
812
840
|
* The connector answered an unpaid (or insufficiently paid) request with its
|
|
813
841
|
* terms instead of routing it — HTTP `402`, `client-edge-spec.md` §1.4.
|
|
@@ -1601,6 +1629,22 @@ interface RouteCharge {
|
|
|
1601
1629
|
interface RoutePrice extends RouteCharge {
|
|
1602
1630
|
/** The ILP address prefix. Longest matching prefix wins. */
|
|
1603
1631
|
prefix: string;
|
|
1632
|
+
/**
|
|
1633
|
+
* The carriage a request to **this** prefix must arrive on, when the route
|
|
1634
|
+
* pins one (connector ND-05a / ADR 0072, TOON_Network#111).
|
|
1635
|
+
*
|
|
1636
|
+
* Absent — never `'both'` — on a route that accepts either, which is every
|
|
1637
|
+
* route no operator pinned.
|
|
1638
|
+
*
|
|
1639
|
+
* This is what makes `auto` work against a node whose routes disagree, and
|
|
1640
|
+
* the devnet relay is one: `g.toon.relay` is pinned to BTP,
|
|
1641
|
+
* `g.toon.relay.ephemeral` is not, so
|
|
1642
|
+
* {@link NodeSelfDescription.requiredTransport} has no honest answer and says
|
|
1643
|
+
* nothing while the pin is enforced on every packet.
|
|
1644
|
+
* {@link requiredTransportFor} reads this first and that field only as a
|
|
1645
|
+
* fallback.
|
|
1646
|
+
*/
|
|
1647
|
+
requiredTransport?: RequiredTransport;
|
|
1604
1648
|
}
|
|
1605
1649
|
/**
|
|
1606
1650
|
* What one packet actually costs on `terms`, given the size of its **sealed**
|
|
@@ -2329,6 +2373,58 @@ interface SendOptions {
|
|
|
2329
2373
|
*/
|
|
2330
2374
|
sealTo?: Uint8Array | string;
|
|
2331
2375
|
timeoutMs?: number;
|
|
2376
|
+
/**
|
|
2377
|
+
* The caller's last look before money moves. Return a string to refuse this
|
|
2378
|
+
* send — the string is the reason, and it arrives as a
|
|
2379
|
+
* {@link ../client/errors.js!BeforePayRefusedError}; return nothing to let it
|
|
2380
|
+
* proceed.
|
|
2381
|
+
*
|
|
2382
|
+
* It exists because **a paid route bills for an answer, and a refusal is an
|
|
2383
|
+
* answer.** A connector collects a route's price before the app behind it has
|
|
2384
|
+
* seen the request at all, so an app that rejects a body as malformed still
|
|
2385
|
+
* charges for having rejected it, and nothing is refunded (TOON_Network#115).
|
|
2386
|
+
* A caller that already knows a body is wrong wants to stop short of the
|
|
2387
|
+
* claim, not read about it on the bill.
|
|
2388
|
+
*
|
|
2389
|
+
* This client knows nothing about any particular app's bodies and should not:
|
|
2390
|
+
* what it can offer is the one check a caller cannot write for itself, at the
|
|
2391
|
+
* one moment that is too late to reach from outside `send`. Checking before
|
|
2392
|
+
* calling `send` is not the same thing, in two ways:
|
|
2393
|
+
*
|
|
2394
|
+
* - **The price is resolved here and nowhere earlier.** What a route costs is
|
|
2395
|
+
* the connector's to state, and a metered route's price depends on the size
|
|
2396
|
+
* of the *sealed* payload, which does not exist until this client has
|
|
2397
|
+
* sealed it. A caller vetting the cost beforehand is guessing at the figure
|
|
2398
|
+
* it is about to authorise; the hook is handed the real one.
|
|
2399
|
+
* - **The refusal provably precedes the signature.** A signed balance proof
|
|
2400
|
+
* is a bearer instrument, so
|
|
2401
|
+
* {@link ../channel/ChannelManager.js!ChannelManager.signBalanceProof}
|
|
2402
|
+
* advances and persists the channel's watermark *before* the packet leaves,
|
|
2403
|
+
* and its rollback deliberately restores the cumulative amount and **not**
|
|
2404
|
+
* the nonce — a re-signable nonce would put two different claims at one
|
|
2405
|
+
* watermark. So there is no "I changed my mind" once a claim is signed.
|
|
2406
|
+
* When this runs, nothing has been signed, no channel has been ensured and
|
|
2407
|
+
* no packet has left.
|
|
2408
|
+
*
|
|
2409
|
+
* Called exactly once per `send`, even on the bounded stale-channel retry: it
|
|
2410
|
+
* is a decision about a request, not about an attempt. Throwing from it also
|
|
2411
|
+
* refuses the send, and the throw propagates unchanged — a caller's own check
|
|
2412
|
+
* failing is the caller's error to read, not one for this client to re-dress.
|
|
2413
|
+
*
|
|
2414
|
+
* Runs on a free route too. Free is not the only cost a wrong body carries:
|
|
2415
|
+
* it still spends the round trip, the app's work, and the answer.
|
|
2416
|
+
*/
|
|
2417
|
+
beforePay?: (about: {
|
|
2418
|
+
/** The route the packet is addressed to. */
|
|
2419
|
+
destination: string;
|
|
2420
|
+
/** What it will cost: the route's resolved price, or an explicit {@link amount}. */
|
|
2421
|
+
amount: bigint;
|
|
2422
|
+
/**
|
|
2423
|
+
* The request as it was handed to `send`. Already sealed by the time this
|
|
2424
|
+
* runs, so mutating it changes nothing that travels — read it, don't edit it.
|
|
2425
|
+
*/
|
|
2426
|
+
request: SendRequest;
|
|
2427
|
+
}) => string | void;
|
|
2332
2428
|
}
|
|
2333
2429
|
/** What one claim spent. */
|
|
2334
2430
|
interface ClaimSummary {
|
|
@@ -2614,7 +2710,16 @@ declare class ToonClient implements ToonClientLike {
|
|
|
2614
2710
|
private readonly channelFacade;
|
|
2615
2711
|
private description;
|
|
2616
2712
|
private onChain;
|
|
2617
|
-
|
|
2713
|
+
/**
|
|
2714
|
+
* One live carriage per kind, not one per client.
|
|
2715
|
+
*
|
|
2716
|
+
* A node pins carriages **per route** (connector ADR 0072), so one client can
|
|
2717
|
+
* legitimately owe one destination a BTP session and another an HTTP one-shot.
|
|
2718
|
+
* Keying by kind keeps each carriage chosen once and reused — which is the
|
|
2719
|
+
* point of caching at all — without letting the first destination decide for
|
|
2720
|
+
* every later one.
|
|
2721
|
+
*/
|
|
2722
|
+
private carriages;
|
|
2618
2723
|
private btpSession;
|
|
2619
2724
|
private readonly hiddenService;
|
|
2620
2725
|
private closed;
|
|
@@ -2812,12 +2917,18 @@ declare class ToonClient implements ToonClientLike {
|
|
|
2812
2917
|
*/
|
|
2813
2918
|
private requireEvmKey;
|
|
2814
2919
|
/**
|
|
2815
|
-
* The carriage
|
|
2920
|
+
* The carriage for `destination`, chosen once per kind and then reused.
|
|
2816
2921
|
*
|
|
2817
2922
|
* Reuse matters for BTP specifically: the whole reason to prefer it is that one
|
|
2818
2923
|
* ordered socket cannot race its own claim nonces into `F01 NonceNotAdvancing`
|
|
2819
2924
|
* (`client-edge-spec.md` §1.9), and a session rebuilt per request would give
|
|
2820
2925
|
* that up while paying for the handshake.
|
|
2926
|
+
*
|
|
2927
|
+
* `destination` is what lets the node's **per-route** pin decide, rather than
|
|
2928
|
+
* only its node-wide summary — which is silent on any node that pins one of
|
|
2929
|
+
* its own addresses and not another (TOON_Network#111). The choice is made
|
|
2930
|
+
* before the first packet, so a pinned route is dialled correctly on the first
|
|
2931
|
+
* attempt and never learns its carriage from a refusal.
|
|
2821
2932
|
*/
|
|
2822
2933
|
private transportFor;
|
|
2823
2934
|
/**
|
|
@@ -3465,8 +3576,15 @@ interface SendContext {
|
|
|
3465
3576
|
* request.
|
|
3466
3577
|
*/
|
|
3467
3578
|
reconcileWatermark?(channelId: string): Promise<void>;
|
|
3468
|
-
/**
|
|
3469
|
-
|
|
3579
|
+
/**
|
|
3580
|
+
* The carriage for one destination, chosen and connected.
|
|
3581
|
+
*
|
|
3582
|
+
* `destination` is passed because a node pins a carriage **per route**
|
|
3583
|
+
* (connector ADR 0072): the pin covering the prefix this packet is addressed
|
|
3584
|
+
* to is the one that will be enforced, and a node-wide summary is silent on
|
|
3585
|
+
* any node that pins one of its own addresses and not another.
|
|
3586
|
+
*/
|
|
3587
|
+
transport(description: NodeSelfDescription, destination: string): Promise<{
|
|
3470
3588
|
kind: 'http' | 'btp';
|
|
3471
3589
|
transport: PaidWriteTransport;
|
|
3472
3590
|
}>;
|
|
@@ -3484,6 +3602,9 @@ interface SendContext {
|
|
|
3484
3602
|
*
|
|
3485
3603
|
* @throws {RouteNotPricedError} the node prices no route covering `destination`
|
|
3486
3604
|
* and no explicit {@link SendOptions.amount} was given.
|
|
3605
|
+
* @throws {BeforePayRefusedError} the caller's own
|
|
3606
|
+
* {@link SendOptions.beforePay} returned a reason, having seen the resolved
|
|
3607
|
+
* price. Nothing was signed and no packet went out.
|
|
3487
3608
|
* @throws Anything the chain or the network throws while opening a channel.
|
|
3488
3609
|
* A REJECT is never thrown — see {@link SendResult}.
|
|
3489
3610
|
*/
|
|
@@ -4914,9 +5035,10 @@ declare class BtpPaidWriteTransport implements ClaimSendingTransport {
|
|
|
4914
5035
|
* with `extra.requiredTransport` naming the carriage the route does require.
|
|
4915
5036
|
*
|
|
4916
5037
|
* So a 1.0 client asks first. The node's self-description (`GET /ilp`) carries
|
|
4917
|
-
* `httpEndpoint`, `btpEndpoint
|
|
4918
|
-
*
|
|
4919
|
-
*
|
|
5038
|
+
* `httpEndpoint`, `btpEndpoint`, a `requiredTransport` on **each route that
|
|
5039
|
+
* pins one** (connector ND-05a / ADR 0072) and a node-wide one summarising the
|
|
5040
|
+
* routes that cover its own addresses, and this module reads a carriage off
|
|
5041
|
+
* that document. That is the whole of the change from 0.x, which
|
|
4920
5042
|
* had no such document: it keyed this decision on a peer discovered from a
|
|
4921
5043
|
* kind:10032 relay announce, then POSTed over HTTP and treated the resulting
|
|
4922
5044
|
* `402`/`401` as the signal to retry over BTP. Both halves of that are gone —
|
|
@@ -4943,22 +5065,32 @@ interface TransportChoice {
|
|
|
4943
5065
|
* {@link TransportRequiredError} otherwise, naming the node's own
|
|
4944
5066
|
* `requiredTransport` when it stated one so the caller learns what to ask
|
|
4945
5067
|
* for instead.
|
|
4946
|
-
* - `'auto'`:
|
|
4947
|
-
* when it publishes an `httpEndpoint`, else BTP. HTTP is the
|
|
4948
|
-
* it is stateless — one request, no session to keep alive —
|
|
4949
|
-
* that needs ordered claim nonces across many writes is a client
|
|
4950
|
-
* ask for BTP explicitly (§1.9: one socket, one order, no racing
|
|
4951
|
-
* `F01 NonceNotAdvancing`).
|
|
5068
|
+
* - `'auto'`: the carriage the node requires for `destination` when it states
|
|
5069
|
+
* one, else HTTP when it publishes an `httpEndpoint`, else BTP. HTTP is the
|
|
5070
|
+
* default because it is stateless — one request, no session to keep alive —
|
|
5071
|
+
* and a client that needs ordered claim nonces across many writes is a client
|
|
5072
|
+
* that will ask for BTP explicitly (§1.9: one socket, one order, no racing
|
|
5073
|
+
* into `F01 NonceNotAdvancing`).
|
|
5074
|
+
*
|
|
5075
|
+
* **The requirement is read per destination**, through
|
|
5076
|
+
* {@link requiredTransportFor}: the route governing `destination` first, the
|
|
5077
|
+
* node-wide `requiredTransport` only where that route names none. A pin is
|
|
5078
|
+
* enforced by a longest-prefix route lookup, once per packet, so a per-node
|
|
5079
|
+
* answer describes it only on a node whose routes happen to agree — and a node
|
|
5080
|
+
* with a pinned apex and a free sub-lane does not. Naming no `destination` asks
|
|
5081
|
+
* about the node alone, which is all a caller with no packet in hand can mean.
|
|
4952
5082
|
*
|
|
4953
5083
|
* @param description the node's `GET /ilp` answer.
|
|
4954
5084
|
* @param preference what the caller asked for. Default `'auto'`.
|
|
4955
5085
|
* @param baseUrl the client-edge URL the description was read from, for
|
|
4956
5086
|
* resolving a relative endpoint. Defaults to `description.readFrom`, which
|
|
4957
5087
|
* `ConnectorEdgeClient.describe` records; an absolute endpoint needs neither.
|
|
5088
|
+
* @param destination the ILP address this carriage will carry packets to, so
|
|
5089
|
+
* the route that governs it answers rather than the node-wide summary.
|
|
4958
5090
|
* @throws {TransportRequiredError} the requested carriage is unavailable, or
|
|
4959
5091
|
* the node publishes no usable endpoint at all.
|
|
4960
5092
|
*/
|
|
4961
|
-
declare function selectTransport(description: NodeSelfDescription, preference?: TransportPreference, baseUrl?: string | undefined): TransportChoice;
|
|
5093
|
+
declare function selectTransport(description: NodeSelfDescription, preference?: TransportPreference, baseUrl?: string | undefined, destination?: string): TransportChoice;
|
|
4962
5094
|
|
|
4963
5095
|
/**
|
|
4964
5096
|
* Canonical OER length primitives (RFC-0030), ported byte-for-byte from
|
|
@@ -6852,4 +6984,4 @@ interface RetryOptions {
|
|
|
6852
6984
|
*/
|
|
6853
6985
|
declare function withRetry<T>(operation: () => Promise<T>, options: RetryOptions): Promise<T>;
|
|
6854
6986
|
|
|
6855
|
-
export { ACCUMULATED_COST_HEADER, ACCUMULATED_COST_PROTOCOL, ARNS_KIND, type AntSpawnOutcome, type AntSpawnParams, type AntSpawnRefused, type AntSpawnStep, type AntSpawned, type ArnsAntPrepareReceipt, type ArnsBuyOutcome, type ArnsBuyParams, type ArnsBuyReceipt, type ArnsNameType, type ArnsNameWithAntOutcome, type ArnsNetwork, type BTPMessage, BTPMessageType, type BTPProtocolData, type BalanceProofParams, BtpAuthError, type BtpChannelDeclaration, BtpConnectionError, type BtpPacketResponse, BtpPaidWriteTransport, type BtpPaidWriteTransportConfig, BtpRuntimeClient, type BtpRuntimeClientConfig, CLAIM_ACK_HEADER, CLAIM_ACK_PROTOCOL, CLAIM_REJECT_CODE, CLAIM_REJECT_REASONS, type ChainKind, type ChainMetadata, type ChainSigner, ChainUnavailableError, type ChannelBinding, type ChannelBindingContext, type ChannelClient, type ChannelFacade, type ChannelFacadeDeps, ChannelFundingError, ChannelManager, type ChannelManagerConfig, ChannelNotOpenError, ChannelResumeError, type ChannelState, type ChannelStatus, type ChannelStore, type ChannelStoreEntry, type ChannelTerms, type ClaimAck, type ClaimMessage, type ClaimSendingTransport$1 as ClaimSendingTransport, type ClaimStateFailed, type ClaimStateOk, type ClaimStateRequestEntry, type ClaimStateResult, type ClaimSummary, ClientChannelFacade, ClientWalletFacade, ConfigError, type ConnectorChainSettlementTerms, ConnectorEdgeClient, type ConnectorEdgeClientConfig, ConnectorEdgeError, type ConnectorEdgeErrorCode, ConnectorError, type ConnectorIdentity, type ConnectorRoutePrice, type ConnectorRouteTerms, type ConnectorSettlementTerms, type ConnectorSolanaSettlementTerms, type CounterpartyVerdict, DEFAULT_DEPOSIT, DEFAULT_SETTLEMENT_TIMEOUT, DEFAULT_TIMEOUT_MS, DEVNET, type Decoded, type DeriveIdentityOptions, type DerivedIdentity, type DevnetNode, ERC20_ABI, type EVMClaimMessage, type EdgeIdentity, type EncryptedKeystore, type EnsureChannelOptions, type Envelope, EnvelopeError, EnvelopeErrorKind, type EnvelopeHeader, type EnvelopeRequest, type EnvelopeResponse, type EvmChannelRecord, type EvmReadConsistencyConfig, EvmSigner, type ExchangeOutcome, FULFILLMENT_MISMATCH_CODE, FULFILLMENT_MISMATCH_MESSAGE, type FaucetChain, type FundWalletOptions, type FundWalletResult, GIFTWRAP_NONCE_LENGTH, GIFTWRAP_PUBLIC_KEY_LENGTH, GIFTWRAP_SECRET_LENGTH, GIFTWRAP_TYPE_REQUEST, GIFTWRAP_TYPE_RESPONSE, type GasStationExecuteReceipt, type GasStationFailureReason, type GasStationFailureReceipt, type GasStationQuoteReceipt, type GasStationReceipt, type GiftWrapEcdh, GiftWrapError, GiftWrapErrorKind, HS_HOSTNAME_MAX_LENGTH, HS_HOSTNAME_REGEX, HttpIlpClient, type HttpIlpClientConfig, type ILPFulfillPacket, ILPPacketType, type ILPPreparePacket, type ILPRejectPacket, type ILPResponsePacket, ILP_CLAIM_HEADER, ILP_PEER_ID_HEADER, type IlpClient, type IlpResponseMeta, type IlpSendParams, type IlpSendResult, type IlpSendResultWithFulfillment, InMemoryChannelStore, InsufficientBalanceError, InvalidAddressError, IsomorphicBtpClient, type JobAnswer, type JobEndpoint, type JobEvent, type JobEventParams, type JobSender, JsonFileChannelStore, KEYSTORE_VERSION, type KeyDerivationScheme, MIN_SETTLEMENT_TIMEOUT_SECONDS, NetworkError, type NodeSelfDescription, OerError, OerErrorKind, OnChainChannelClient, type OnChainChannelClientConfig, type OnChainChannelStatus, type OpenChannelOptions, type OpenChannelParams, type OpenChannelResult, type OpenOrAdoptParams, type OpenedKeystore, type OpenedRequest, PACKET_EXPIRY_HEADROOM_MS, PAYMENT_REQUIRED_HEADER, PAYMENT_REQUIRED_PROTOCOL, type PaidWriteTransport, type ParsedX402Challenge, PaymentRequiredError, type PaymentTerms, type RequiredTransport, type ResolvedConfig, type ResolvedIdentity, type ResponseHeaderSource, type RetryOptions, type RouteCharge, RouteNotPricedError, type RoutePrice, type RpcTransportOptions, SOLANA_GAS_KIND, type SealedExchange, type SealedRequest, SealedResponseError, type SealedResponseErrorKind, type SendContext, type SendFulfilled, type SendOptions, type SendRefused, type SendRequest, type SendResult, type SendTransferParams, type SendTransferResult, type SignedBalanceProof, type SolanaChannelConfig, type SolanaClaimMessage, type Signer as SolanaKeypair, type SolanaNetwork, SolanaSigner, type SolanaWireTransaction, StaleRpcReadError, TOKEN_NETWORK_ABI, TOKEN_NETWORK_REGISTRY_ABI, TokenNetworkClient, type TokenNetworkClientConfig, type ToonChannelAccept, ToonClient, type ToonClientConfig, ToonClientError, type ToonClientLike, type ToonIdentity, type TransferConfig, TransferNotDeliveredError, TransferUnsupportedError, type TransportChoice, type TransportPreference, TransportRequiredError, type TxRef, UnknownChainError, ValidationError, type WalletBalance, type WalletBalanceSources, type WalletChainBalances, type WalletFacade, type WalletFacadeDeps, type WalletTokenAmount, type WriteKeystoreOptions, type X402ChannelExtra, addressFor, assertRoutableHsHostname, buildJobEvent, buildResponseMeta, buyArnsName, buyArnsNameWithNewAnt, chainUnavailableMessage, chargeFor, connectorEdgeBaseUrl, counterpartyMatch, decodeAccumulatedCost, decodeBase64Text, decodeClaimAck, decodeEnvelope, decodeEnvelopeRequest, decodeEnvelopeResponse, decodePaymentRequired, decodeVarOctetString, decodeVarUint, decryptMnemonic, defaultDestinationFor, defaultFaucetTimeout, defaultRpcUrl, deriveEvmChannelId, deriveFulfillment, deriveFullIdentity, deserializeIlpPacket, deserializeIlpPrepare, encodeEnvelope, encodeEnvelopeRequest, encodeEnvelopeResponse, encodeVarOctetString, encodeVarUint, encryptMnemonic, envelopeHeader, evmDerivationPath, evmIdentityFromKey, fundWallet, generateKeystore, generateMnemonic, generateRandomIdentity, generateSolanaKeypair, giftWrapPublicKey, httpEndpointToBtpUrl, importKeystore, isGasStationFailure, isHiddenServiceUrl, isInsufficientGasError, isRoutableHsHostname, isUnknownChannelReject, jobEventParam, keystoreDerivation, loadKeystore, localGiftWrapEcdh, looksLikeSealedResponse, mapIlpResponse, openKeystore, openRequest, openResponse, parseBtpMessage, parseEvmChainId, parsePaymentTerms, parseSelfDescription, parseSettlementEntry, parseSolanaWireTransaction, parseX402Body, parseX402Challenge, patchSolanaRecentBlockhash, readBaseUnits, readResponseMeta$1 as readBtpResponseMeta, readEvmNativeBalance, readEvmTokenBalance, readExchangeOutcome, readResponseMeta, readSolanaNativeBalance, readSolanaTokenBalance, readWalletBalances, rejectNamesChannel, resolveConfig, resolveExpectedFulfillment, resolveExpiresAt, routeFor, routePriceFor, rpcFetch, rpcTransport, sameSettlementAddress, sealExchange, sealRequest, sealRequestWithRandomness, sealResponse, sealResponseWithRandomness, selectTransport, send, sendJob, sendTransfer, serializeBtpMessage, serializeIlpFulfill, serializeIlpPrepare, serializeIlpReject, settlementToTerms, signSolanaWireTransaction, solanaKeypair, sortParticipants, spawnAnt, toEnvelopeRequest, trimTrailingSlashes, validateMnemonic, withRetry, writeKeystoreFile };
|
|
6987
|
+
export { ACCUMULATED_COST_HEADER, ACCUMULATED_COST_PROTOCOL, ARNS_KIND, type AntSpawnOutcome, type AntSpawnParams, type AntSpawnRefused, type AntSpawnStep, type AntSpawned, type ArnsAntPrepareReceipt, type ArnsBuyOutcome, type ArnsBuyParams, type ArnsBuyReceipt, type ArnsNameType, type ArnsNameWithAntOutcome, type ArnsNetwork, type BTPMessage, BTPMessageType, type BTPProtocolData, type BalanceProofParams, BeforePayRefusedError, BtpAuthError, type BtpChannelDeclaration, BtpConnectionError, type BtpPacketResponse, BtpPaidWriteTransport, type BtpPaidWriteTransportConfig, BtpRuntimeClient, type BtpRuntimeClientConfig, CLAIM_ACK_HEADER, CLAIM_ACK_PROTOCOL, CLAIM_REJECT_CODE, CLAIM_REJECT_REASONS, type ChainKind, type ChainMetadata, type ChainSigner, ChainUnavailableError, type ChannelBinding, type ChannelBindingContext, type ChannelClient, type ChannelFacade, type ChannelFacadeDeps, ChannelFundingError, ChannelManager, type ChannelManagerConfig, ChannelNotOpenError, ChannelResumeError, type ChannelState, type ChannelStatus, type ChannelStore, type ChannelStoreEntry, type ChannelTerms, type ClaimAck, type ClaimMessage, type ClaimSendingTransport$1 as ClaimSendingTransport, type ClaimStateFailed, type ClaimStateOk, type ClaimStateRequestEntry, type ClaimStateResult, type ClaimSummary, ClientChannelFacade, ClientWalletFacade, ConfigError, type ConnectorChainSettlementTerms, ConnectorEdgeClient, type ConnectorEdgeClientConfig, ConnectorEdgeError, type ConnectorEdgeErrorCode, ConnectorError, type ConnectorIdentity, type ConnectorRoutePrice, type ConnectorRouteTerms, type ConnectorSettlementTerms, type ConnectorSolanaSettlementTerms, type CounterpartyVerdict, DEFAULT_DEPOSIT, DEFAULT_SETTLEMENT_TIMEOUT, DEFAULT_TIMEOUT_MS, DEVNET, type Decoded, type DeriveIdentityOptions, type DerivedIdentity, type DevnetNode, ERC20_ABI, type EVMClaimMessage, type EdgeIdentity, type EncryptedKeystore, type EnsureChannelOptions, type Envelope, EnvelopeError, EnvelopeErrorKind, type EnvelopeHeader, type EnvelopeRequest, type EnvelopeResponse, type EvmChannelRecord, type EvmReadConsistencyConfig, EvmSigner, type ExchangeOutcome, FULFILLMENT_MISMATCH_CODE, FULFILLMENT_MISMATCH_MESSAGE, type FaucetChain, type FundWalletOptions, type FundWalletResult, GIFTWRAP_NONCE_LENGTH, GIFTWRAP_PUBLIC_KEY_LENGTH, GIFTWRAP_SECRET_LENGTH, GIFTWRAP_TYPE_REQUEST, GIFTWRAP_TYPE_RESPONSE, type GasStationExecuteReceipt, type GasStationFailureReason, type GasStationFailureReceipt, type GasStationQuoteReceipt, type GasStationReceipt, type GiftWrapEcdh, GiftWrapError, GiftWrapErrorKind, HS_HOSTNAME_MAX_LENGTH, HS_HOSTNAME_REGEX, HttpIlpClient, type HttpIlpClientConfig, type ILPFulfillPacket, ILPPacketType, type ILPPreparePacket, type ILPRejectPacket, type ILPResponsePacket, ILP_CLAIM_HEADER, ILP_PEER_ID_HEADER, type IlpClient, type IlpResponseMeta, type IlpSendParams, type IlpSendResult, type IlpSendResultWithFulfillment, InMemoryChannelStore, InsufficientBalanceError, InvalidAddressError, IsomorphicBtpClient, type JobAnswer, type JobEndpoint, type JobEvent, type JobEventParams, type JobSender, JsonFileChannelStore, KEYSTORE_VERSION, type KeyDerivationScheme, MIN_SETTLEMENT_TIMEOUT_SECONDS, NetworkError, type NodeSelfDescription, OerError, OerErrorKind, OnChainChannelClient, type OnChainChannelClientConfig, type OnChainChannelStatus, type OpenChannelOptions, type OpenChannelParams, type OpenChannelResult, type OpenOrAdoptParams, type OpenedKeystore, type OpenedRequest, PACKET_EXPIRY_HEADROOM_MS, PAYMENT_REQUIRED_HEADER, PAYMENT_REQUIRED_PROTOCOL, type PaidWriteTransport, type ParsedX402Challenge, PaymentRequiredError, type PaymentTerms, type RequiredTransport, type ResolvedConfig, type ResolvedIdentity, type ResponseHeaderSource, type RetryOptions, type RouteCharge, RouteNotPricedError, type RoutePrice, type RpcTransportOptions, SOLANA_GAS_KIND, type SealedExchange, type SealedRequest, SealedResponseError, type SealedResponseErrorKind, type SendContext, type SendFulfilled, type SendOptions, type SendRefused, type SendRequest, type SendResult, type SendTransferParams, type SendTransferResult, type SignedBalanceProof, type SolanaChannelConfig, type SolanaClaimMessage, type Signer as SolanaKeypair, type SolanaNetwork, SolanaSigner, type SolanaWireTransaction, StaleRpcReadError, TOKEN_NETWORK_ABI, TOKEN_NETWORK_REGISTRY_ABI, TokenNetworkClient, type TokenNetworkClientConfig, type ToonChannelAccept, ToonClient, type ToonClientConfig, ToonClientError, type ToonClientLike, type ToonIdentity, type TransferConfig, TransferNotDeliveredError, TransferUnsupportedError, type TransportChoice, type TransportPreference, TransportRequiredError, type TxRef, UnknownChainError, ValidationError, type WalletBalance, type WalletBalanceSources, type WalletChainBalances, type WalletFacade, type WalletFacadeDeps, type WalletTokenAmount, type WriteKeystoreOptions, type X402ChannelExtra, addressFor, assertRoutableHsHostname, buildJobEvent, buildResponseMeta, buyArnsName, buyArnsNameWithNewAnt, chainUnavailableMessage, chargeFor, connectorEdgeBaseUrl, counterpartyMatch, decodeAccumulatedCost, decodeBase64Text, decodeClaimAck, decodeEnvelope, decodeEnvelopeRequest, decodeEnvelopeResponse, decodePaymentRequired, decodeVarOctetString, decodeVarUint, decryptMnemonic, defaultDestinationFor, defaultFaucetTimeout, defaultRpcUrl, deriveEvmChannelId, deriveFulfillment, deriveFullIdentity, deserializeIlpPacket, deserializeIlpPrepare, encodeEnvelope, encodeEnvelopeRequest, encodeEnvelopeResponse, encodeVarOctetString, encodeVarUint, encryptMnemonic, envelopeHeader, evmDerivationPath, evmIdentityFromKey, fundWallet, generateKeystore, generateMnemonic, generateRandomIdentity, generateSolanaKeypair, giftWrapPublicKey, httpEndpointToBtpUrl, importKeystore, isGasStationFailure, isHiddenServiceUrl, isInsufficientGasError, isRoutableHsHostname, isUnknownChannelReject, jobEventParam, keystoreDerivation, loadKeystore, localGiftWrapEcdh, looksLikeSealedResponse, mapIlpResponse, openKeystore, openRequest, openResponse, parseBtpMessage, parseEvmChainId, parsePaymentTerms, parseSelfDescription, parseSettlementEntry, parseSolanaWireTransaction, parseX402Body, parseX402Challenge, patchSolanaRecentBlockhash, readBaseUnits, readResponseMeta$1 as readBtpResponseMeta, readEvmNativeBalance, readEvmTokenBalance, readExchangeOutcome, readResponseMeta, readSolanaNativeBalance, readSolanaTokenBalance, readWalletBalances, rejectNamesChannel, resolveConfig, resolveExpectedFulfillment, resolveExpiresAt, routeFor, routePriceFor, rpcFetch, rpcTransport, sameSettlementAddress, sealExchange, sealRequest, sealRequestWithRandomness, sealResponse, sealResponseWithRandomness, selectTransport, send, sendJob, sendTransfer, serializeBtpMessage, serializeIlpFulfill, serializeIlpPrepare, serializeIlpReject, settlementToTerms, signSolanaWireTransaction, solanaKeypair, sortParticipants, spawnAnt, toEnvelopeRequest, trimTrailingSlashes, validateMnemonic, withRetry, writeKeystoreFile };
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
ACCUMULATED_COST_HEADER,
|
|
14
14
|
ACCUMULATED_COST_PROTOCOL,
|
|
15
15
|
BTPMessageType,
|
|
16
|
+
BeforePayRefusedError,
|
|
16
17
|
BtpAuthError,
|
|
17
18
|
BtpConnectionError,
|
|
18
19
|
BtpPaidWriteTransport,
|
|
@@ -164,7 +165,7 @@ import {
|
|
|
164
165
|
toHex,
|
|
165
166
|
trimTrailingSlashes,
|
|
166
167
|
withRetry
|
|
167
|
-
} from "./chunk-
|
|
168
|
+
} from "./chunk-ZHWYFPOP.js";
|
|
168
169
|
import {
|
|
169
170
|
DEVNET,
|
|
170
171
|
HS_HOSTNAME_MAX_LENGTH,
|
|
@@ -679,6 +680,7 @@ export {
|
|
|
679
680
|
ACCUMULATED_COST_PROTOCOL,
|
|
680
681
|
ARNS_KIND,
|
|
681
682
|
BTPMessageType,
|
|
683
|
+
BeforePayRefusedError,
|
|
682
684
|
BtpAuthError,
|
|
683
685
|
BtpConnectionError,
|
|
684
686
|
BtpPaidWriteTransport,
|