@routedock/routedock 0.3.0 → 0.4.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/README.md +113 -12
- package/dist/{MppSessionHandler-1EL8QBAn.d.cts → MppSessionHandler-3QfCHI5x.d.ts} +40 -2
- package/dist/{MppSessionHandler-Bq4S-JTE.d.ts → MppSessionHandler-xu4Kxu6N.d.cts} +40 -2
- package/dist/{ProviderRegistry-CA_TdREG.d.ts → ProviderRegistry-D9KqyuH-.d.cts} +16 -36
- package/dist/{ProviderRegistry-D-0rqK0N.d.cts → ProviderRegistry-DVi2uzgk.d.ts} +16 -36
- package/dist/{RouteDockClient-go9aopfF.d.cts → RouteDockClient-6rmgkbYb.d.cts} +124 -142
- package/dist/{RouteDockClient-Bh86bVly.d.ts → RouteDockClient-CnAkxwrW.d.ts} +124 -142
- package/dist/{SessionReconciler-Bw-PoBVl.d.ts → SessionReconciler-Cce9MXO1.d.ts} +10 -3
- package/dist/{SessionReconciler-Cz2nuOlJ.d.cts → SessionReconciler-Dpe9qXdD.d.cts} +10 -3
- package/dist/{SessionStore-BaYiegP0.d.ts → SessionStore-DkLBxFQu.d.cts} +28 -3
- package/dist/{SessionStore-B4-Hi4H8.d.cts → SessionStore-_ZkoBzFY.d.ts} +28 -3
- package/dist/SpendStore-BUclV02i.d.ts +73 -0
- package/dist/SpendStore-s_dfcemj.d.cts +73 -0
- package/dist/client.cjs +767 -487
- package/dist/client.d.cts +80 -10
- package/dist/client.d.ts +80 -10
- package/dist/client.js +733 -468
- package/dist/index.cjs +1295 -590
- package/dist/index.d.cts +13 -10
- package/dist/index.d.ts +13 -10
- package/dist/index.js +1247 -559
- package/dist/logger-DVa7VT4c.d.cts +41 -0
- package/dist/logger-DVa7VT4c.d.ts +41 -0
- package/dist/network.cjs +57 -0
- package/dist/network.d.cts +72 -0
- package/dist/network.d.ts +72 -0
- package/dist/network.js +49 -0
- package/dist/node.cjs +166 -0
- package/dist/node.d.cts +77 -0
- package/dist/node.d.ts +77 -0
- package/dist/node.js +159 -0
- package/dist/provider/fastify.cjs +847 -62
- package/dist/provider/fastify.d.cts +10 -3
- package/dist/provider/fastify.d.ts +10 -3
- package/dist/provider/fastify.js +848 -63
- package/dist/provider/hono.cjs +936 -60
- package/dist/provider/hono.d.cts +23 -8
- package/dist/provider/hono.d.ts +23 -8
- package/dist/provider/hono.js +937 -61
- package/dist/provider.cjs +894 -70
- package/dist/provider.d.cts +9 -8
- package/dist/provider.d.ts +9 -8
- package/dist/provider.js +895 -72
- package/dist/react.cjs +736 -436
- package/dist/react.d.cts +7 -5
- package/dist/react.d.ts +7 -5
- package/dist/react.js +725 -425
- package/dist/{routedockMiddleware-57gUaEMf.d.ts → routedockMiddleware-Cq9HOJEa.d.ts} +9 -2
- package/dist/{routedockMiddleware-DlyLrxp7.d.cts → routedockMiddleware-CxsWkSKa.d.cts} +9 -2
- package/dist/schema.cjs +7 -0
- package/dist/schema.js +7 -0
- package/dist/{sign-AKH67sft.d.cts → sign-Bq08SeFq.d.ts} +2 -2
- package/dist/{sign-BEq-OsSq.d.ts → sign-DqGE0Plv.d.cts} +2 -2
- package/dist/testing.d.cts +4 -3
- package/dist/testing.d.ts +4 -3
- package/dist/{logger-D8_Q2ytp.d.cts → types-DXaS5Wip.d.cts} +85 -47
- package/dist/{logger-D8_Q2ytp.d.ts → types-DXaS5Wip.d.ts} +85 -47
- package/package.json +50 -4
package/dist/client.d.cts
CHANGED
|
@@ -1,15 +1,82 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AssetConfig, D as DEFAULT_MAX_SESSION_DURATION_MS, a as DisputeStatus, E as EndpointDescriptor, b as EstimateCostResult, P as PaymentMode, c as
|
|
3
|
-
export { R as RouteDockChannelStateError, a as RouteDockClientVersionError, b as RouteDockDisputeError, c as RouteDockError, d as RouteDockErrorCode, e as RouteDockErrorOptions, f as RouteDockFacilitatorError, g as RouteDockManifestError, h as RouteDockManifestSunsetError, i as RouteDockManifestTimeoutError, j as RouteDockNetworkError, k as RouteDockNoSupportedModeError, l as
|
|
4
|
-
import { R as RetryPolicy } from './RouteDockClient-
|
|
5
|
-
export { D as DEFAULT_RETRY_POLICY,
|
|
6
|
-
|
|
1
|
+
import { R as RouteDockManifest, n as SessionOptions, m as SessionHandle } from './types-DXaS5Wip.cjs';
|
|
2
|
+
export { A as AssetConfig, D as DEFAULT_MAX_SESSION_DURATION_MS, a as DisputeStatus, E as EndpointDescriptor, b as EstimateCostResult, P as PaymentMode, c as PaymentRequest, d as PaymentResult, e as PreflightComplianceFlags, f as PreflightModeCost, g as PreflightResult, h as PricingConfig, S as SLAConfig, i as SessionCloseFailedPayload, j as SessionCloseResult, k as SessionEvent, l as SessionEventPayloadMap, o as SessionPricingConfig, p as SessionState, q as SessionStats, r as SessionTimeoutPayload, s as StreamOptions, U as UrlPreflightResult, V as VaultMode } from './types-DXaS5Wip.cjs';
|
|
3
|
+
export { R as RouteDockChannelStateError, a as RouteDockClientVersionError, b as RouteDockDisputeError, c as RouteDockError, d as RouteDockErrorCode, e as RouteDockErrorOptions, f as RouteDockFacilitatorError, g as RouteDockManifestError, h as RouteDockManifestSunsetError, i as RouteDockManifestTimeoutError, j as RouteDockNetworkError, k as RouteDockNoSupportedModeError, l as RouteDockPaymentRejectedError, m as RouteDockPolicyRejectError, n as RouteDockPolicyRejectedError, o as RouteDockRefundWindowError, p as RouteDockSessionError, q as RouteDockSignatureError, r as RouteDockTrustlineError, s as RouteDockVoucherMonotonicityError, S as SessionStore, t as SupabaseSessionStore, u as getEligibleAssets, v as httpStatusToError, w as isAssetEligible, x as normalizeManifestAssets, y as parseRetryAfterMs, z as paymentRejectedError, A as resolveAssetContract, B as selectAsset, C as wrapFetchError, D as wrapMppError } from './SessionStore-DkLBxFQu.cjs';
|
|
4
|
+
import { R as RetryPolicy } from './RouteDockClient-6rmgkbYb.cjs';
|
|
5
|
+
export { D as DEFAULT_RETRY_POLICY, M as ModeSelectOptions, N as NulthVaultConfig, a as RouteDockClient, b as RouteDockClientConfig, S as SpendCap, V as VaultConfig, X as X402Client, c as X402PreSignContext, d as X402PreSignDecision, e as X402PreSignHook, f as assertEndpointActive, g as assertNulthVaultManifest, h as backoffDelayMs, i as configureManifestCache, j as createNulthSigner, k as fetchLedgerSequence, l as fetchManifest, m as invalidateManifest, p as prepareNulthSigner, r as rankProvidersByLatency, s as selectMode, u as usdcToMicros, w as withRetry } from './RouteDockClient-6rmgkbYb.cjs';
|
|
6
|
+
import { b as RouteDockLogger } from './logger-DVa7VT4c.cjs';
|
|
7
|
+
export { R as RouteDockLogFields, a as RouteDockLogLevel, c as consoleLogger, d as createConsoleLogger, n as noopLogger, r as resolveLogger } from './logger-DVa7VT4c.cjs';
|
|
8
|
+
export { M as MppChargeClient, O as OnChainProviderInfo, a as OnChainRegistry, P as ProviderRecord, b as ProviderRegistry, c as ProviderRegistryConfig, d as assertManifestValid, u as usdcToUnits } from './ProviderRegistry-D9KqyuH-.cjs';
|
|
9
|
+
import { AssembledTransaction } from '@stellar/stellar-sdk/contract';
|
|
10
|
+
import { handleSimulationResult, ClientStellarSigner } from '@x402/stellar';
|
|
11
|
+
import { Network, SchemeNetworkClient, PaymentRequirements, PaymentPayloadResult } from '@x402/core/types';
|
|
12
|
+
import { NulthStellarSigner } from '@routedock/nulth-sdk';
|
|
13
|
+
export { NulthAuthSignature, NulthClientConfig, NulthPolicyError, NulthPolicyState, NulthProof, NulthSignerConfig, NulthStellarSigner, PaymentAuthContext, USDC_DECIMALS, createPolicyState, decodeAuthSignature, paymentContextFromManifest, setNulthPaymentContext, usdcToStroops } from '@routedock/nulth-sdk';
|
|
7
14
|
import { Keypair } from '@stellar/stellar-sdk';
|
|
8
|
-
export {
|
|
15
|
+
export { D as DailySpend, I as InMemorySpendStore, a as InMemorySpendStoreOptions, S as SpendStore } from './SpendStore-s_dfcemj.cjs';
|
|
9
16
|
import 'mppx';
|
|
10
17
|
import '@supabase/supabase-js';
|
|
11
|
-
|
|
12
|
-
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Nulth-aware x402 scheme for Stellar (#552).
|
|
21
|
+
*
|
|
22
|
+
* `ExactStellarScheme` builds the `transfer` transaction correctly for a Nulth
|
|
23
|
+
* payer but signs it with stellar-sdk's default `authorizeEntry`, which reads the
|
|
24
|
+
* credential address as an ed25519 key and therefore throws
|
|
25
|
+
* `invalid version byte. expected 48, got 16` for the `C...` account contract —
|
|
26
|
+
* the proof could never reach the network. Everything else here mirrors the
|
|
27
|
+
* upstream scheme: the transaction, the expiry window, the signer assertions and
|
|
28
|
+
* the re-simulation that widens the footprint to cover `__check_auth`.
|
|
29
|
+
*/
|
|
30
|
+
/** The transfer the scheme assembles, one field per payment requirement. */
|
|
31
|
+
interface NulthTransfer {
|
|
32
|
+
/** SAC contract holding the funds */
|
|
33
|
+
asset: string;
|
|
34
|
+
/** Nulth account contract paying */
|
|
35
|
+
from: string;
|
|
36
|
+
payTo: string;
|
|
37
|
+
/** Stroops, as the accepted requirement reports them */
|
|
38
|
+
amount: string;
|
|
39
|
+
networkPassphrase: string;
|
|
40
|
+
rpcUrl: string;
|
|
41
|
+
}
|
|
42
|
+
/** The subset of `AssembledTransaction` the scheme drives. */
|
|
43
|
+
interface NulthPaymentTransaction {
|
|
44
|
+
/** The assembled envelope the payload carries. */
|
|
45
|
+
readonly built?: {
|
|
46
|
+
toXDR(): string;
|
|
47
|
+
};
|
|
48
|
+
/** The latest simulation, which the resource footprint is read from. */
|
|
49
|
+
readonly simulation?: Parameters<typeof handleSimulationResult>[0];
|
|
50
|
+
/** Accounts holding an address credential that is still unsigned. */
|
|
51
|
+
needsNonInvokerSigningBy(): string[];
|
|
52
|
+
signAuthEntries(options: NulthSignAuthEntriesOptions): Promise<void>;
|
|
53
|
+
simulate(): Promise<unknown>;
|
|
54
|
+
}
|
|
55
|
+
/** `AssembledTransaction.signAuthEntries`' options, as the scheme uses them. */
|
|
56
|
+
type NulthSignAuthEntriesOptions = NonNullable<Parameters<AssembledTransaction<unknown>['signAuthEntries']>[0]>;
|
|
57
|
+
/**
|
|
58
|
+
* The two steps that need a network. They are injectable because a unit test
|
|
59
|
+
* cannot reach Soroban RPC, and the proof-carrying part of the scheme is the
|
|
60
|
+
* credential write, not the round trip.
|
|
61
|
+
*/
|
|
62
|
+
interface NulthSchemeIo {
|
|
63
|
+
expirationLedger(network: Network, maxTimeoutSeconds: number): Promise<number>;
|
|
64
|
+
assemble(transfer: NulthTransfer): Promise<NulthPaymentTransaction>;
|
|
65
|
+
}
|
|
66
|
+
declare class NulthStellarScheme implements SchemeNetworkClient {
|
|
67
|
+
private readonly signer;
|
|
68
|
+
private readonly io;
|
|
69
|
+
readonly scheme = "exact";
|
|
70
|
+
constructor(signer: NulthStellarSigner, io?: NulthSchemeIo);
|
|
71
|
+
createPaymentPayload(x402Version: number, paymentRequirements: PaymentRequirements): Promise<PaymentPayloadResult>;
|
|
72
|
+
private validateRequirements;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Choose the scheme for a signer. A signer from `createNulthSigner` carries the
|
|
76
|
+
* Nulth marker and pays from a contract account, so it must not be wrapped in the
|
|
77
|
+
* stock ed25519 scheme; every other signer keeps `ExactStellarScheme` unchanged.
|
|
78
|
+
*/
|
|
79
|
+
declare function selectStellarScheme(signer: ClientStellarSigner): SchemeNetworkClient;
|
|
13
80
|
|
|
14
81
|
/**
|
|
15
82
|
* MppSessionClient — uses @stellar/mpp channel/client for off-chain
|
|
@@ -20,6 +87,9 @@ import '@stellar/stellar-sdk/contract';
|
|
|
20
87
|
* @stellar/mpp library handles the 402 challenge-response cycle.
|
|
21
88
|
*/
|
|
22
89
|
|
|
90
|
+
/** Polling parameters for on-chain transaction confirmation. */
|
|
91
|
+
declare const TX_CONFIRM_INTERVAL_MS = 1000;
|
|
92
|
+
declare const TX_CONFIRM_TIMEOUT_MS = 30000;
|
|
23
93
|
/** A WebSocket socket as consumed by the mpp-session-ws stream. */
|
|
24
94
|
interface WebSocketLike {
|
|
25
95
|
readyState: number;
|
|
@@ -65,4 +135,4 @@ declare class MppSessionClient {
|
|
|
65
135
|
private streamWebSocket;
|
|
66
136
|
}
|
|
67
137
|
|
|
68
|
-
export { MppSessionClient, RetryPolicy, RouteDockLogger, RouteDockManifest, SessionHandle, SessionOptions, type WebSocketFactory, type WebSocketHandlers, type WebSocketLike };
|
|
138
|
+
export { MppSessionClient, type NulthPaymentTransaction, type NulthSchemeIo, type NulthSignAuthEntriesOptions, NulthStellarScheme, type NulthTransfer, RetryPolicy, RouteDockLogger, RouteDockManifest, SessionHandle, SessionOptions, TX_CONFIRM_INTERVAL_MS, TX_CONFIRM_TIMEOUT_MS, type WebSocketFactory, type WebSocketHandlers, type WebSocketLike, selectStellarScheme };
|
package/dist/client.d.ts
CHANGED
|
@@ -1,15 +1,82 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AssetConfig, D as DEFAULT_MAX_SESSION_DURATION_MS, a as DisputeStatus, E as EndpointDescriptor, b as EstimateCostResult, P as PaymentMode, c as
|
|
3
|
-
export { R as RouteDockChannelStateError, a as RouteDockClientVersionError, b as RouteDockDisputeError, c as RouteDockError, d as RouteDockErrorCode, e as RouteDockErrorOptions, f as RouteDockFacilitatorError, g as RouteDockManifestError, h as RouteDockManifestSunsetError, i as RouteDockManifestTimeoutError, j as RouteDockNetworkError, k as RouteDockNoSupportedModeError, l as
|
|
4
|
-
import { R as RetryPolicy } from './RouteDockClient-
|
|
5
|
-
export { D as DEFAULT_RETRY_POLICY,
|
|
6
|
-
|
|
1
|
+
import { R as RouteDockManifest, n as SessionOptions, m as SessionHandle } from './types-DXaS5Wip.js';
|
|
2
|
+
export { A as AssetConfig, D as DEFAULT_MAX_SESSION_DURATION_MS, a as DisputeStatus, E as EndpointDescriptor, b as EstimateCostResult, P as PaymentMode, c as PaymentRequest, d as PaymentResult, e as PreflightComplianceFlags, f as PreflightModeCost, g as PreflightResult, h as PricingConfig, S as SLAConfig, i as SessionCloseFailedPayload, j as SessionCloseResult, k as SessionEvent, l as SessionEventPayloadMap, o as SessionPricingConfig, p as SessionState, q as SessionStats, r as SessionTimeoutPayload, s as StreamOptions, U as UrlPreflightResult, V as VaultMode } from './types-DXaS5Wip.js';
|
|
3
|
+
export { R as RouteDockChannelStateError, a as RouteDockClientVersionError, b as RouteDockDisputeError, c as RouteDockError, d as RouteDockErrorCode, e as RouteDockErrorOptions, f as RouteDockFacilitatorError, g as RouteDockManifestError, h as RouteDockManifestSunsetError, i as RouteDockManifestTimeoutError, j as RouteDockNetworkError, k as RouteDockNoSupportedModeError, l as RouteDockPaymentRejectedError, m as RouteDockPolicyRejectError, n as RouteDockPolicyRejectedError, o as RouteDockRefundWindowError, p as RouteDockSessionError, q as RouteDockSignatureError, r as RouteDockTrustlineError, s as RouteDockVoucherMonotonicityError, S as SessionStore, t as SupabaseSessionStore, u as getEligibleAssets, v as httpStatusToError, w as isAssetEligible, x as normalizeManifestAssets, y as parseRetryAfterMs, z as paymentRejectedError, A as resolveAssetContract, B as selectAsset, C as wrapFetchError, D as wrapMppError } from './SessionStore-_ZkoBzFY.js';
|
|
4
|
+
import { R as RetryPolicy } from './RouteDockClient-CnAkxwrW.js';
|
|
5
|
+
export { D as DEFAULT_RETRY_POLICY, M as ModeSelectOptions, N as NulthVaultConfig, a as RouteDockClient, b as RouteDockClientConfig, S as SpendCap, V as VaultConfig, X as X402Client, c as X402PreSignContext, d as X402PreSignDecision, e as X402PreSignHook, f as assertEndpointActive, g as assertNulthVaultManifest, h as backoffDelayMs, i as configureManifestCache, j as createNulthSigner, k as fetchLedgerSequence, l as fetchManifest, m as invalidateManifest, p as prepareNulthSigner, r as rankProvidersByLatency, s as selectMode, u as usdcToMicros, w as withRetry } from './RouteDockClient-CnAkxwrW.js';
|
|
6
|
+
import { b as RouteDockLogger } from './logger-DVa7VT4c.js';
|
|
7
|
+
export { R as RouteDockLogFields, a as RouteDockLogLevel, c as consoleLogger, d as createConsoleLogger, n as noopLogger, r as resolveLogger } from './logger-DVa7VT4c.js';
|
|
8
|
+
export { M as MppChargeClient, O as OnChainProviderInfo, a as OnChainRegistry, P as ProviderRecord, b as ProviderRegistry, c as ProviderRegistryConfig, d as assertManifestValid, u as usdcToUnits } from './ProviderRegistry-DVi2uzgk.js';
|
|
9
|
+
import { AssembledTransaction } from '@stellar/stellar-sdk/contract';
|
|
10
|
+
import { handleSimulationResult, ClientStellarSigner } from '@x402/stellar';
|
|
11
|
+
import { Network, SchemeNetworkClient, PaymentRequirements, PaymentPayloadResult } from '@x402/core/types';
|
|
12
|
+
import { NulthStellarSigner } from '@routedock/nulth-sdk';
|
|
13
|
+
export { NulthAuthSignature, NulthClientConfig, NulthPolicyError, NulthPolicyState, NulthProof, NulthSignerConfig, NulthStellarSigner, PaymentAuthContext, USDC_DECIMALS, createPolicyState, decodeAuthSignature, paymentContextFromManifest, setNulthPaymentContext, usdcToStroops } from '@routedock/nulth-sdk';
|
|
7
14
|
import { Keypair } from '@stellar/stellar-sdk';
|
|
8
|
-
export {
|
|
15
|
+
export { D as DailySpend, I as InMemorySpendStore, a as InMemorySpendStoreOptions, S as SpendStore } from './SpendStore-BUclV02i.js';
|
|
9
16
|
import 'mppx';
|
|
10
17
|
import '@supabase/supabase-js';
|
|
11
|
-
|
|
12
|
-
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Nulth-aware x402 scheme for Stellar (#552).
|
|
21
|
+
*
|
|
22
|
+
* `ExactStellarScheme` builds the `transfer` transaction correctly for a Nulth
|
|
23
|
+
* payer but signs it with stellar-sdk's default `authorizeEntry`, which reads the
|
|
24
|
+
* credential address as an ed25519 key and therefore throws
|
|
25
|
+
* `invalid version byte. expected 48, got 16` for the `C...` account contract —
|
|
26
|
+
* the proof could never reach the network. Everything else here mirrors the
|
|
27
|
+
* upstream scheme: the transaction, the expiry window, the signer assertions and
|
|
28
|
+
* the re-simulation that widens the footprint to cover `__check_auth`.
|
|
29
|
+
*/
|
|
30
|
+
/** The transfer the scheme assembles, one field per payment requirement. */
|
|
31
|
+
interface NulthTransfer {
|
|
32
|
+
/** SAC contract holding the funds */
|
|
33
|
+
asset: string;
|
|
34
|
+
/** Nulth account contract paying */
|
|
35
|
+
from: string;
|
|
36
|
+
payTo: string;
|
|
37
|
+
/** Stroops, as the accepted requirement reports them */
|
|
38
|
+
amount: string;
|
|
39
|
+
networkPassphrase: string;
|
|
40
|
+
rpcUrl: string;
|
|
41
|
+
}
|
|
42
|
+
/** The subset of `AssembledTransaction` the scheme drives. */
|
|
43
|
+
interface NulthPaymentTransaction {
|
|
44
|
+
/** The assembled envelope the payload carries. */
|
|
45
|
+
readonly built?: {
|
|
46
|
+
toXDR(): string;
|
|
47
|
+
};
|
|
48
|
+
/** The latest simulation, which the resource footprint is read from. */
|
|
49
|
+
readonly simulation?: Parameters<typeof handleSimulationResult>[0];
|
|
50
|
+
/** Accounts holding an address credential that is still unsigned. */
|
|
51
|
+
needsNonInvokerSigningBy(): string[];
|
|
52
|
+
signAuthEntries(options: NulthSignAuthEntriesOptions): Promise<void>;
|
|
53
|
+
simulate(): Promise<unknown>;
|
|
54
|
+
}
|
|
55
|
+
/** `AssembledTransaction.signAuthEntries`' options, as the scheme uses them. */
|
|
56
|
+
type NulthSignAuthEntriesOptions = NonNullable<Parameters<AssembledTransaction<unknown>['signAuthEntries']>[0]>;
|
|
57
|
+
/**
|
|
58
|
+
* The two steps that need a network. They are injectable because a unit test
|
|
59
|
+
* cannot reach Soroban RPC, and the proof-carrying part of the scheme is the
|
|
60
|
+
* credential write, not the round trip.
|
|
61
|
+
*/
|
|
62
|
+
interface NulthSchemeIo {
|
|
63
|
+
expirationLedger(network: Network, maxTimeoutSeconds: number): Promise<number>;
|
|
64
|
+
assemble(transfer: NulthTransfer): Promise<NulthPaymentTransaction>;
|
|
65
|
+
}
|
|
66
|
+
declare class NulthStellarScheme implements SchemeNetworkClient {
|
|
67
|
+
private readonly signer;
|
|
68
|
+
private readonly io;
|
|
69
|
+
readonly scheme = "exact";
|
|
70
|
+
constructor(signer: NulthStellarSigner, io?: NulthSchemeIo);
|
|
71
|
+
createPaymentPayload(x402Version: number, paymentRequirements: PaymentRequirements): Promise<PaymentPayloadResult>;
|
|
72
|
+
private validateRequirements;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Choose the scheme for a signer. A signer from `createNulthSigner` carries the
|
|
76
|
+
* Nulth marker and pays from a contract account, so it must not be wrapped in the
|
|
77
|
+
* stock ed25519 scheme; every other signer keeps `ExactStellarScheme` unchanged.
|
|
78
|
+
*/
|
|
79
|
+
declare function selectStellarScheme(signer: ClientStellarSigner): SchemeNetworkClient;
|
|
13
80
|
|
|
14
81
|
/**
|
|
15
82
|
* MppSessionClient — uses @stellar/mpp channel/client for off-chain
|
|
@@ -20,6 +87,9 @@ import '@stellar/stellar-sdk/contract';
|
|
|
20
87
|
* @stellar/mpp library handles the 402 challenge-response cycle.
|
|
21
88
|
*/
|
|
22
89
|
|
|
90
|
+
/** Polling parameters for on-chain transaction confirmation. */
|
|
91
|
+
declare const TX_CONFIRM_INTERVAL_MS = 1000;
|
|
92
|
+
declare const TX_CONFIRM_TIMEOUT_MS = 30000;
|
|
23
93
|
/** A WebSocket socket as consumed by the mpp-session-ws stream. */
|
|
24
94
|
interface WebSocketLike {
|
|
25
95
|
readyState: number;
|
|
@@ -65,4 +135,4 @@ declare class MppSessionClient {
|
|
|
65
135
|
private streamWebSocket;
|
|
66
136
|
}
|
|
67
137
|
|
|
68
|
-
export { MppSessionClient, RetryPolicy, RouteDockLogger, RouteDockManifest, SessionHandle, SessionOptions, type WebSocketFactory, type WebSocketHandlers, type WebSocketLike };
|
|
138
|
+
export { MppSessionClient, type NulthPaymentTransaction, type NulthSchemeIo, type NulthSignAuthEntriesOptions, NulthStellarScheme, type NulthTransfer, RetryPolicy, RouteDockLogger, RouteDockManifest, SessionHandle, SessionOptions, TX_CONFIRM_INTERVAL_MS, TX_CONFIRM_TIMEOUT_MS, type WebSocketFactory, type WebSocketHandlers, type WebSocketLike, selectStellarScheme };
|