@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.
Files changed (58) hide show
  1. package/README.md +113 -12
  2. package/dist/{MppSessionHandler-1EL8QBAn.d.cts → MppSessionHandler-3QfCHI5x.d.ts} +40 -2
  3. package/dist/{MppSessionHandler-Bq4S-JTE.d.ts → MppSessionHandler-xu4Kxu6N.d.cts} +40 -2
  4. package/dist/{ProviderRegistry-CA_TdREG.d.ts → ProviderRegistry-D9KqyuH-.d.cts} +16 -36
  5. package/dist/{ProviderRegistry-D-0rqK0N.d.cts → ProviderRegistry-DVi2uzgk.d.ts} +16 -36
  6. package/dist/{RouteDockClient-go9aopfF.d.cts → RouteDockClient-6rmgkbYb.d.cts} +124 -142
  7. package/dist/{RouteDockClient-Bh86bVly.d.ts → RouteDockClient-CnAkxwrW.d.ts} +124 -142
  8. package/dist/{SessionReconciler-Bw-PoBVl.d.ts → SessionReconciler-Cce9MXO1.d.ts} +10 -3
  9. package/dist/{SessionReconciler-Cz2nuOlJ.d.cts → SessionReconciler-Dpe9qXdD.d.cts} +10 -3
  10. package/dist/{SessionStore-BaYiegP0.d.ts → SessionStore-DkLBxFQu.d.cts} +28 -3
  11. package/dist/{SessionStore-B4-Hi4H8.d.cts → SessionStore-_ZkoBzFY.d.ts} +28 -3
  12. package/dist/SpendStore-BUclV02i.d.ts +73 -0
  13. package/dist/SpendStore-s_dfcemj.d.cts +73 -0
  14. package/dist/client.cjs +767 -487
  15. package/dist/client.d.cts +80 -10
  16. package/dist/client.d.ts +80 -10
  17. package/dist/client.js +733 -468
  18. package/dist/index.cjs +1295 -590
  19. package/dist/index.d.cts +13 -10
  20. package/dist/index.d.ts +13 -10
  21. package/dist/index.js +1247 -559
  22. package/dist/logger-DVa7VT4c.d.cts +41 -0
  23. package/dist/logger-DVa7VT4c.d.ts +41 -0
  24. package/dist/network.cjs +57 -0
  25. package/dist/network.d.cts +72 -0
  26. package/dist/network.d.ts +72 -0
  27. package/dist/network.js +49 -0
  28. package/dist/node.cjs +166 -0
  29. package/dist/node.d.cts +77 -0
  30. package/dist/node.d.ts +77 -0
  31. package/dist/node.js +159 -0
  32. package/dist/provider/fastify.cjs +847 -62
  33. package/dist/provider/fastify.d.cts +10 -3
  34. package/dist/provider/fastify.d.ts +10 -3
  35. package/dist/provider/fastify.js +848 -63
  36. package/dist/provider/hono.cjs +936 -60
  37. package/dist/provider/hono.d.cts +23 -8
  38. package/dist/provider/hono.d.ts +23 -8
  39. package/dist/provider/hono.js +937 -61
  40. package/dist/provider.cjs +894 -70
  41. package/dist/provider.d.cts +9 -8
  42. package/dist/provider.d.ts +9 -8
  43. package/dist/provider.js +895 -72
  44. package/dist/react.cjs +736 -436
  45. package/dist/react.d.cts +7 -5
  46. package/dist/react.d.ts +7 -5
  47. package/dist/react.js +725 -425
  48. package/dist/{routedockMiddleware-57gUaEMf.d.ts → routedockMiddleware-Cq9HOJEa.d.ts} +9 -2
  49. package/dist/{routedockMiddleware-DlyLrxp7.d.cts → routedockMiddleware-CxsWkSKa.d.cts} +9 -2
  50. package/dist/schema.cjs +7 -0
  51. package/dist/schema.js +7 -0
  52. package/dist/{sign-AKH67sft.d.cts → sign-Bq08SeFq.d.ts} +2 -2
  53. package/dist/{sign-BEq-OsSq.d.ts → sign-DqGE0Plv.d.cts} +2 -2
  54. package/dist/testing.d.cts +4 -3
  55. package/dist/testing.d.ts +4 -3
  56. package/dist/{logger-D8_Q2ytp.d.cts → types-DXaS5Wip.d.cts} +85 -47
  57. package/dist/{logger-D8_Q2ytp.d.ts → types-DXaS5Wip.d.ts} +85 -47
  58. package/package.json +50 -4
@@ -1,10 +1,11 @@
1
1
  import { MiddlewareHandler } from 'hono';
2
2
  import { Store } from '@stellar/mpp/channel/server';
3
- import { P as PaymentMode, h as RouteDockManifest, g as RouteDockLogger } from '../logger-D8_Q2ytp.cjs';
4
- import { O as OrphanedSessionInfo, S as SeenTxStore } from '../MppSessionHandler-1EL8QBAn.cjs';
5
- export { I as InMemorySeenTxStore, a as SettlementRecord } from '../MppSessionHandler-1EL8QBAn.cjs';
6
- export { R as ReconciliationStats, a as RegisterProviderOptions, S as SessionReconcilerOptions, b as SupabaseSeenTxStore, r as reconcileAbandonedSessions, c as registerProvider, e as runStartupReconciliation } from '../SessionReconciler-Cz2nuOlJ.cjs';
7
- export { s as signManifest } from '../sign-AKH67sft.cjs';
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/sdk/provider/hono'
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 };
@@ -1,10 +1,11 @@
1
1
  import { MiddlewareHandler } from 'hono';
2
2
  import { Store } from '@stellar/mpp/channel/server';
3
- import { P as PaymentMode, h as RouteDockManifest, g as RouteDockLogger } from '../logger-D8_Q2ytp.js';
4
- import { O as OrphanedSessionInfo, S as SeenTxStore } from '../MppSessionHandler-Bq4S-JTE.js';
5
- export { I as InMemorySeenTxStore, a as SettlementRecord } from '../MppSessionHandler-Bq4S-JTE.js';
6
- export { R as ReconciliationStats, a as RegisterProviderOptions, S as SessionReconcilerOptions, b as SupabaseSeenTxStore, r as reconcileAbandonedSessions, c as registerProvider, e as runStartupReconciliation } from '../SessionReconciler-Bw-PoBVl.js';
7
- export { s as signManifest } from '../sign-BEq-OsSq.js';
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/sdk/provider/hono'
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 };