@routedock/routedock 0.2.0 → 0.3.1
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 +305 -0
- package/dist/MppSessionHandler-1EL8QBAn.d.cts +215 -0
- package/dist/MppSessionHandler-Bq4S-JTE.d.ts +215 -0
- package/dist/{ProviderRegistry-BJ9oJLVz.d.cts → ProviderRegistry-CyZ5eryO.d.cts} +2 -2
- package/dist/{ProviderRegistry-C50nyhaF.d.ts → ProviderRegistry-w4_hkI_1.d.ts} +2 -2
- package/dist/{RouteDockClient-BbkqjhMG.d.ts → RouteDockClient-CXvWXix5.d.cts} +25 -9
- package/dist/{RouteDockClient-B1roCa8h.d.cts → RouteDockClient-CjM2VyOd.d.ts} +25 -9
- package/dist/{SessionReconciler-Dscw43F3.d.ts → SessionReconciler-Bw-PoBVl.d.ts} +14 -5
- package/dist/{SessionReconciler-bi0z2qtN.d.cts → SessionReconciler-Cz2nuOlJ.d.cts} +14 -5
- package/dist/{SessionStore-DvkZv8-E.d.ts → SessionStore-B4-Hi4H8.d.cts} +34 -2
- package/dist/{SessionStore-BpK8vv0L.d.cts → SessionStore-BaYiegP0.d.ts} +34 -2
- package/dist/client.cjs +432 -125
- package/dist/client.d.cts +9 -8
- package/dist/client.d.ts +9 -8
- package/dist/client.js +424 -127
- package/dist/index.cjs +655 -228
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +646 -229
- package/dist/{types-DmhmfLzP.d.cts → logger-D8_Q2ytp.d.cts} +58 -1
- package/dist/{types-DmhmfLzP.d.ts → logger-D8_Q2ytp.d.ts} +58 -1
- package/dist/provider/fastify.cjs +306 -89
- package/dist/provider/fastify.d.cts +9 -4
- package/dist/provider/fastify.d.ts +9 -4
- package/dist/provider/fastify.js +305 -88
- package/dist/provider/hono.cjs +286 -82
- package/dist/provider/hono.d.cts +9 -7
- package/dist/provider/hono.d.ts +9 -7
- package/dist/provider/hono.js +282 -78
- package/dist/provider.cjs +326 -98
- package/dist/provider.d.cts +14 -10
- package/dist/provider.d.ts +14 -10
- package/dist/provider.js +318 -98
- package/dist/react.cjs +410 -125
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +411 -126
- package/dist/{routedockMiddleware-BlDsHuPl.d.ts → routedockMiddleware-57gUaEMf.d.ts} +9 -4
- package/dist/{routedockMiddleware-D97A5ptQ.d.cts → routedockMiddleware-DlyLrxp7.d.cts} +9 -4
- package/dist/schema.cjs +40 -0
- package/dist/schema.js +40 -0
- package/dist/{sign-Dpj2Mp7k.d.ts → sign-AKH67sft.d.cts} +1 -1
- package/dist/{sign-CUf3rhTx.d.cts → sign-BEq-OsSq.d.ts} +1 -1
- package/dist/testing.cjs +6 -4
- package/dist/testing.d.cts +32 -13
- package/dist/testing.d.ts +32 -13
- package/dist/testing.js +6 -4
- package/package.json +2 -2
- package/dist/MppSessionHandler-B4TyD7Xg.d.cts +0 -121
- package/dist/MppSessionHandler-CLB5SzgN.d.ts +0 -121
package/dist/provider.d.cts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { D as DEFAULT_MAX_SESSION_DURATION_MS, a as DisputeStatus, E as EndpointDescriptor, b as EstimateCostResult, P as PaymentMode, c as PaymentResult, d as PreflightResult, e as PricingConfig, S as SLAConfig,
|
|
3
|
-
|
|
1
|
+
import { h as RouteDockManifest, g as RouteDockLogger } from './logger-D8_Q2ytp.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 PaymentResult, d as PreflightResult, e as PricingConfig, S as SLAConfig, i as SessionCloseFailedPayload, j as SessionCloseResult, k as SessionEvent, l as SessionEventPayloadMap, m as SessionHandle, n as SessionOptions, o as SessionPricingConfig, p as SessionState, q as SessionStats, r as SessionTimeoutPayload, s as StreamOptions, V as VaultMode } from './logger-D8_Q2ytp.cjs';
|
|
3
|
+
import { S as SessionStore } from './SessionStore-B4-Hi4H8.cjs';
|
|
4
|
+
export { R as RouteDockChannelStateError, a as RouteDockClientVersionError, b as RouteDockDisputeError, c as RouteDockError, f as RouteDockFacilitatorError, g as RouteDockManifestError, j as RouteDockNetworkError, k as RouteDockNoSupportedModeError, l as RouteDockPolicyRejectError, m as RouteDockPolicyRejectedError, n as RouteDockRefundWindowError, o as RouteDockSessionError, p as RouteDockSignatureError, q as RouteDockTrustlineError, r as RouteDockVoucherMonotonicityError, s as SupabaseSessionStore, t as getEligibleAssets, v as isAssetEligible, w as normalizeManifestAssets, y as resolveAssetContract, z as selectAsset } from './SessionStore-B4-Hi4H8.cjs';
|
|
5
|
+
export { R as RouteDockMiddlewareOptions, r as routedock } from './routedockMiddleware-DlyLrxp7.cjs';
|
|
4
6
|
import { RequestHandler } from 'express';
|
|
5
|
-
import { S as SeenTxStore } from './MppSessionHandler-
|
|
6
|
-
export { C as ChannelStore, I as InMemorySeenTxStore, b as InMemorySeenTxStoreOptions, M as
|
|
7
|
-
|
|
8
|
-
export { R as RouteDockChannelStateError, a as RouteDockClientVersionError, b as RouteDockDisputeError, c as RouteDockError, f as RouteDockFacilitatorError, g as RouteDockManifestError, j as RouteDockNetworkError, k as RouteDockNoSupportedModeError, l as RouteDockPolicyRejectError, m as RouteDockPolicyRejectedError, n as RouteDockRefundWindowError, o as RouteDockSessionError, p as RouteDockSignatureError, q as RouteDockTrustlineError, r as RouteDockVoucherMonotonicityError, s as SupabaseSessionStore } from './SessionStore-BpK8vv0L.cjs';
|
|
9
|
-
export { R as ReconciliationStats, a as RegisterProviderOptions, S as SessionReconcilerOptions, b as SupabaseSeenTxStore, d as decimalToStroops, r as reconcileAbandonedSessions, c as registerProvider, e as runStartupReconciliation } from './SessionReconciler-bi0z2qtN.cjs';
|
|
7
|
+
import { S as SeenTxStore } from './MppSessionHandler-1EL8QBAn.cjs';
|
|
8
|
+
export { C as ChannelStore, I as InMemorySeenTxStore, b as InMemorySeenTxStoreOptions, M as MAX_SETTLEMENT_REPLAYS, c as MppSessionHandlerOptions, d as OrphanReason, O as OrphanedSessionInfo, e as SETTLEMENT_REPLAY_WINDOW_MS, a as SettlementRecord, f as SettlementReplayCheck, g as SettlementScope, V as VoucherStoreValue, h as checkSettlementReplay, i as createMppSessionHandler, j as isVoucherStoreValue, p as paymentIdempotencyKey } from './MppSessionHandler-1EL8QBAn.cjs';
|
|
9
|
+
export { R as ReconciliationStats, a as RegisterProviderOptions, S as SessionReconcilerOptions, b as SupabaseSeenTxStore, d as decimalToStroops, r as reconcileAbandonedSessions, c as registerProvider, e as runStartupReconciliation } from './SessionReconciler-Cz2nuOlJ.cjs';
|
|
10
10
|
import 'mppx';
|
|
11
11
|
import '@supabase/supabase-js';
|
|
12
12
|
import '@stellar/stellar-sdk';
|
|
@@ -16,7 +16,7 @@ interface X402HandlerOptions {
|
|
|
16
16
|
payeeSecretKey: string;
|
|
17
17
|
network: Network$1;
|
|
18
18
|
amount: string;
|
|
19
|
-
assetContract
|
|
19
|
+
assetContract?: string;
|
|
20
20
|
facilitatorApiKey?: string;
|
|
21
21
|
manifest: RouteDockManifest;
|
|
22
22
|
onSettled?: (txHash: string, amount: string, mode: string, payer: string | null) => Promise<void>;
|
|
@@ -26,6 +26,8 @@ interface X402HandlerOptions {
|
|
|
26
26
|
* retries the same signed payment. Defaults to a per-handler in-memory store.
|
|
27
27
|
*/
|
|
28
28
|
seenTxStore?: SeenTxStore;
|
|
29
|
+
/** Log sink for internal error paths. Defaults to a console-backed logger. */
|
|
30
|
+
logger?: RouteDockLogger;
|
|
29
31
|
}
|
|
30
32
|
declare function createX402Handler(opts: X402HandlerOptions): RequestHandler;
|
|
31
33
|
|
|
@@ -34,7 +36,7 @@ interface MppChargeHandlerOptions {
|
|
|
34
36
|
payeeSecretKey: string;
|
|
35
37
|
network: Network;
|
|
36
38
|
amount: string;
|
|
37
|
-
assetContract
|
|
39
|
+
assetContract?: string;
|
|
38
40
|
manifest: RouteDockManifest;
|
|
39
41
|
/**
|
|
40
42
|
* @deprecated Ignored. Charge mode opens no channel, so there is nothing for a session store to hold.
|
|
@@ -47,6 +49,8 @@ interface MppChargeHandlerOptions {
|
|
|
47
49
|
* retries the same signed charge. Defaults to a per-handler in-memory store.
|
|
48
50
|
*/
|
|
49
51
|
seenTxStore?: SeenTxStore;
|
|
52
|
+
/** Log sink for internal error paths. Defaults to a console-backed logger. */
|
|
53
|
+
logger?: RouteDockLogger;
|
|
50
54
|
}
|
|
51
55
|
declare function createMppChargeHandler(opts: MppChargeHandlerOptions): RequestHandler;
|
|
52
56
|
|
package/dist/provider.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { D as DEFAULT_MAX_SESSION_DURATION_MS, a as DisputeStatus, E as EndpointDescriptor, b as EstimateCostResult, P as PaymentMode, c as PaymentResult, d as PreflightResult, e as PricingConfig, S as SLAConfig,
|
|
3
|
-
|
|
1
|
+
import { h as RouteDockManifest, g as RouteDockLogger } from './logger-D8_Q2ytp.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 PaymentResult, d as PreflightResult, e as PricingConfig, S as SLAConfig, i as SessionCloseFailedPayload, j as SessionCloseResult, k as SessionEvent, l as SessionEventPayloadMap, m as SessionHandle, n as SessionOptions, o as SessionPricingConfig, p as SessionState, q as SessionStats, r as SessionTimeoutPayload, s as StreamOptions, V as VaultMode } from './logger-D8_Q2ytp.js';
|
|
3
|
+
import { S as SessionStore } from './SessionStore-BaYiegP0.js';
|
|
4
|
+
export { R as RouteDockChannelStateError, a as RouteDockClientVersionError, b as RouteDockDisputeError, c as RouteDockError, f as RouteDockFacilitatorError, g as RouteDockManifestError, j as RouteDockNetworkError, k as RouteDockNoSupportedModeError, l as RouteDockPolicyRejectError, m as RouteDockPolicyRejectedError, n as RouteDockRefundWindowError, o as RouteDockSessionError, p as RouteDockSignatureError, q as RouteDockTrustlineError, r as RouteDockVoucherMonotonicityError, s as SupabaseSessionStore, t as getEligibleAssets, v as isAssetEligible, w as normalizeManifestAssets, y as resolveAssetContract, z as selectAsset } from './SessionStore-BaYiegP0.js';
|
|
5
|
+
export { R as RouteDockMiddlewareOptions, r as routedock } from './routedockMiddleware-57gUaEMf.js';
|
|
4
6
|
import { RequestHandler } from 'express';
|
|
5
|
-
import { S as SeenTxStore } from './MppSessionHandler-
|
|
6
|
-
export { C as ChannelStore, I as InMemorySeenTxStore, b as InMemorySeenTxStoreOptions, M as
|
|
7
|
-
|
|
8
|
-
export { R as RouteDockChannelStateError, a as RouteDockClientVersionError, b as RouteDockDisputeError, c as RouteDockError, f as RouteDockFacilitatorError, g as RouteDockManifestError, j as RouteDockNetworkError, k as RouteDockNoSupportedModeError, l as RouteDockPolicyRejectError, m as RouteDockPolicyRejectedError, n as RouteDockRefundWindowError, o as RouteDockSessionError, p as RouteDockSignatureError, q as RouteDockTrustlineError, r as RouteDockVoucherMonotonicityError, s as SupabaseSessionStore } from './SessionStore-DvkZv8-E.js';
|
|
9
|
-
export { R as ReconciliationStats, a as RegisterProviderOptions, S as SessionReconcilerOptions, b as SupabaseSeenTxStore, d as decimalToStroops, r as reconcileAbandonedSessions, c as registerProvider, e as runStartupReconciliation } from './SessionReconciler-Dscw43F3.js';
|
|
7
|
+
import { S as SeenTxStore } from './MppSessionHandler-Bq4S-JTE.js';
|
|
8
|
+
export { C as ChannelStore, I as InMemorySeenTxStore, b as InMemorySeenTxStoreOptions, M as MAX_SETTLEMENT_REPLAYS, c as MppSessionHandlerOptions, d as OrphanReason, O as OrphanedSessionInfo, e as SETTLEMENT_REPLAY_WINDOW_MS, a as SettlementRecord, f as SettlementReplayCheck, g as SettlementScope, V as VoucherStoreValue, h as checkSettlementReplay, i as createMppSessionHandler, j as isVoucherStoreValue, p as paymentIdempotencyKey } from './MppSessionHandler-Bq4S-JTE.js';
|
|
9
|
+
export { R as ReconciliationStats, a as RegisterProviderOptions, S as SessionReconcilerOptions, b as SupabaseSeenTxStore, d as decimalToStroops, r as reconcileAbandonedSessions, c as registerProvider, e as runStartupReconciliation } from './SessionReconciler-Bw-PoBVl.js';
|
|
10
10
|
import 'mppx';
|
|
11
11
|
import '@supabase/supabase-js';
|
|
12
12
|
import '@stellar/stellar-sdk';
|
|
@@ -16,7 +16,7 @@ interface X402HandlerOptions {
|
|
|
16
16
|
payeeSecretKey: string;
|
|
17
17
|
network: Network$1;
|
|
18
18
|
amount: string;
|
|
19
|
-
assetContract
|
|
19
|
+
assetContract?: string;
|
|
20
20
|
facilitatorApiKey?: string;
|
|
21
21
|
manifest: RouteDockManifest;
|
|
22
22
|
onSettled?: (txHash: string, amount: string, mode: string, payer: string | null) => Promise<void>;
|
|
@@ -26,6 +26,8 @@ interface X402HandlerOptions {
|
|
|
26
26
|
* retries the same signed payment. Defaults to a per-handler in-memory store.
|
|
27
27
|
*/
|
|
28
28
|
seenTxStore?: SeenTxStore;
|
|
29
|
+
/** Log sink for internal error paths. Defaults to a console-backed logger. */
|
|
30
|
+
logger?: RouteDockLogger;
|
|
29
31
|
}
|
|
30
32
|
declare function createX402Handler(opts: X402HandlerOptions): RequestHandler;
|
|
31
33
|
|
|
@@ -34,7 +36,7 @@ interface MppChargeHandlerOptions {
|
|
|
34
36
|
payeeSecretKey: string;
|
|
35
37
|
network: Network;
|
|
36
38
|
amount: string;
|
|
37
|
-
assetContract
|
|
39
|
+
assetContract?: string;
|
|
38
40
|
manifest: RouteDockManifest;
|
|
39
41
|
/**
|
|
40
42
|
* @deprecated Ignored. Charge mode opens no channel, so there is nothing for a session store to hold.
|
|
@@ -47,6 +49,8 @@ interface MppChargeHandlerOptions {
|
|
|
47
49
|
* retries the same signed charge. Defaults to a per-handler in-memory store.
|
|
48
50
|
*/
|
|
49
51
|
seenTxStore?: SeenTxStore;
|
|
52
|
+
/** Log sink for internal error paths. Defaults to a console-backed logger. */
|
|
53
|
+
logger?: RouteDockLogger;
|
|
50
54
|
}
|
|
51
55
|
declare function createMppChargeHandler(opts: MppChargeHandlerOptions): RequestHandler;
|
|
52
56
|
|