@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/provider/hono.d.cts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { MiddlewareHandler } from 'hono';
|
|
2
2
|
import { Store } from '@stellar/mpp/channel/server';
|
|
3
|
-
import { P as PaymentMode,
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
3
|
+
import { P as PaymentMode, R as RouteDockManifest } from '../types-DXaS5Wip.cjs';
|
|
4
|
+
import { b as RouteDockLogger } from '../logger-DVa7VT4c.cjs';
|
|
5
|
+
import { O as OrphanedSessionInfo, S as SeenTxStore, V as VaultSettlementConfig } from '../MppSessionHandler-xu4Kxu6N.cjs';
|
|
6
|
+
export { I as InMemorySeenTxStore, a as SettlementRecord } from '../MppSessionHandler-xu4Kxu6N.cjs';
|
|
7
|
+
export { R as ReconciliationStats, a as RegisterProviderOptions, S as SessionReconcilerOptions, b as SupabaseSeenTxStore, r as reconcileAbandonedSessions, c as registerProvider, e as runStartupReconciliation } from '../SessionReconciler-Dpe9qXdD.cjs';
|
|
8
|
+
export { s as signManifest } from '../sign-DqGE0Plv.cjs';
|
|
8
9
|
import 'mppx';
|
|
9
10
|
import 'express';
|
|
10
11
|
import '@supabase/supabase-js';
|
|
@@ -55,9 +56,23 @@ interface RouteDockHonoOptions {
|
|
|
55
56
|
* Defaults to an in-memory store per handler; supply a durable store (e.g.
|
|
56
57
|
* Durable Object storage) so voucher tracking survives isolate eviction.
|
|
57
58
|
*/
|
|
58
|
-
sessionStore?: Store.Store;
|
|
59
|
+
sessionStore?: Store.Store | undefined;
|
|
59
60
|
/** Log sink for internal error paths. Defaults to a console-backed logger. */
|
|
60
61
|
logger?: RouteDockLogger;
|
|
62
|
+
/**
|
|
63
|
+
* Record `session_settled` on the agent vault after each clean mpp-session
|
|
64
|
+
* close. `contract` is the vault's C... id; `rpcUrl` overrides the default
|
|
65
|
+
* Soroban RPC endpoint for the configured network. The vault authorizes
|
|
66
|
+
* the record with the payee's own key, so no admin secret is ever held.
|
|
67
|
+
*/
|
|
68
|
+
vaultSettlement?: VaultSettlementConfig;
|
|
69
|
+
/**
|
|
70
|
+
* Receives background promises (currently the vault settlement record) so
|
|
71
|
+
* the runtime keeps the request alive until they finish — pass
|
|
72
|
+
* `ctx.waitUntil` on Cloudflare Workers. Without it, settlement still runs
|
|
73
|
+
* but the runtime may evict the isolate before it completes.
|
|
74
|
+
*/
|
|
75
|
+
waitUntil?: (promise: Promise<unknown>) => void;
|
|
61
76
|
}
|
|
62
77
|
/**
|
|
63
78
|
* Context key set by the mpp-session-ws middleware after a request's payment
|
|
@@ -87,7 +102,7 @@ declare function mppSessionWsVerified(c: {
|
|
|
87
102
|
*
|
|
88
103
|
* @example
|
|
89
104
|
* ```ts
|
|
90
|
-
* import { routedockHono } from '@routedock/
|
|
105
|
+
* import { routedockHono } from '@routedock/routedock/provider/hono'
|
|
91
106
|
*
|
|
92
107
|
* app.use('/price', routedockHono({
|
|
93
108
|
* modes: ['x402', 'mpp-charge'],
|
|
@@ -98,4 +113,4 @@ declare function mppSessionWsVerified(c: {
|
|
|
98
113
|
*/
|
|
99
114
|
declare function routedockHono(opts: RouteDockHonoOptions): MiddlewareHandler;
|
|
100
115
|
|
|
101
|
-
export { MPP_SESSION_WS_VERIFIED, type RouteDockHonoOptions, SeenTxStore, mppSessionWsVerified, routedockHono };
|
|
116
|
+
export { MPP_SESSION_WS_VERIFIED, type RouteDockHonoOptions, SeenTxStore, VaultSettlementConfig, mppSessionWsVerified, routedockHono };
|
package/dist/provider/hono.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { MiddlewareHandler } from 'hono';
|
|
2
2
|
import { Store } from '@stellar/mpp/channel/server';
|
|
3
|
-
import { P as PaymentMode,
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
3
|
+
import { P as PaymentMode, R as RouteDockManifest } from '../types-DXaS5Wip.js';
|
|
4
|
+
import { b as RouteDockLogger } from '../logger-DVa7VT4c.js';
|
|
5
|
+
import { O as OrphanedSessionInfo, S as SeenTxStore, V as VaultSettlementConfig } from '../MppSessionHandler-3QfCHI5x.js';
|
|
6
|
+
export { I as InMemorySeenTxStore, a as SettlementRecord } from '../MppSessionHandler-3QfCHI5x.js';
|
|
7
|
+
export { R as ReconciliationStats, a as RegisterProviderOptions, S as SessionReconcilerOptions, b as SupabaseSeenTxStore, r as reconcileAbandonedSessions, c as registerProvider, e as runStartupReconciliation } from '../SessionReconciler-Cce9MXO1.js';
|
|
8
|
+
export { s as signManifest } from '../sign-Bq08SeFq.js';
|
|
8
9
|
import 'mppx';
|
|
9
10
|
import 'express';
|
|
10
11
|
import '@supabase/supabase-js';
|
|
@@ -55,9 +56,23 @@ interface RouteDockHonoOptions {
|
|
|
55
56
|
* Defaults to an in-memory store per handler; supply a durable store (e.g.
|
|
56
57
|
* Durable Object storage) so voucher tracking survives isolate eviction.
|
|
57
58
|
*/
|
|
58
|
-
sessionStore?: Store.Store;
|
|
59
|
+
sessionStore?: Store.Store | undefined;
|
|
59
60
|
/** Log sink for internal error paths. Defaults to a console-backed logger. */
|
|
60
61
|
logger?: RouteDockLogger;
|
|
62
|
+
/**
|
|
63
|
+
* Record `session_settled` on the agent vault after each clean mpp-session
|
|
64
|
+
* close. `contract` is the vault's C... id; `rpcUrl` overrides the default
|
|
65
|
+
* Soroban RPC endpoint for the configured network. The vault authorizes
|
|
66
|
+
* the record with the payee's own key, so no admin secret is ever held.
|
|
67
|
+
*/
|
|
68
|
+
vaultSettlement?: VaultSettlementConfig;
|
|
69
|
+
/**
|
|
70
|
+
* Receives background promises (currently the vault settlement record) so
|
|
71
|
+
* the runtime keeps the request alive until they finish — pass
|
|
72
|
+
* `ctx.waitUntil` on Cloudflare Workers. Without it, settlement still runs
|
|
73
|
+
* but the runtime may evict the isolate before it completes.
|
|
74
|
+
*/
|
|
75
|
+
waitUntil?: (promise: Promise<unknown>) => void;
|
|
61
76
|
}
|
|
62
77
|
/**
|
|
63
78
|
* Context key set by the mpp-session-ws middleware after a request's payment
|
|
@@ -87,7 +102,7 @@ declare function mppSessionWsVerified(c: {
|
|
|
87
102
|
*
|
|
88
103
|
* @example
|
|
89
104
|
* ```ts
|
|
90
|
-
* import { routedockHono } from '@routedock/
|
|
105
|
+
* import { routedockHono } from '@routedock/routedock/provider/hono'
|
|
91
106
|
*
|
|
92
107
|
* app.use('/price', routedockHono({
|
|
93
108
|
* modes: ['x402', 'mpp-charge'],
|
|
@@ -98,4 +113,4 @@ declare function mppSessionWsVerified(c: {
|
|
|
98
113
|
*/
|
|
99
114
|
declare function routedockHono(opts: RouteDockHonoOptions): MiddlewareHandler;
|
|
100
115
|
|
|
101
|
-
export { MPP_SESSION_WS_VERIFIED, type RouteDockHonoOptions, SeenTxStore, mppSessionWsVerified, routedockHono };
|
|
116
|
+
export { MPP_SESSION_WS_VERIFIED, type RouteDockHonoOptions, SeenTxStore, VaultSettlementConfig, mppSessionWsVerified, routedockHono };
|