@routedock/routedock 0.1.2 → 0.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/LICENSE +21 -0
- package/README.md +227 -4
- package/dist/MppSessionHandler-B4TyD7Xg.d.cts +121 -0
- package/dist/MppSessionHandler-CLB5SzgN.d.ts +121 -0
- package/dist/ProviderRegistry-BJ9oJLVz.d.cts +142 -0
- package/dist/ProviderRegistry-C50nyhaF.d.ts +142 -0
- package/dist/RouteDockClient-B1roCa8h.d.cts +455 -0
- package/dist/RouteDockClient-BbkqjhMG.d.ts +455 -0
- package/dist/SessionReconciler-Dscw43F3.d.ts +125 -0
- package/dist/SessionReconciler-bi0z2qtN.d.cts +125 -0
- package/dist/SessionStore-BpK8vv0L.d.cts +111 -0
- package/dist/SessionStore-DvkZv8-E.d.ts +111 -0
- package/dist/client.cjs +2419 -202
- package/dist/client.d.cts +50 -81
- package/dist/client.d.ts +50 -81
- package/dist/client.js +2373 -203
- package/dist/index.cjs +3080 -298
- package/dist/index.d.cts +12 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.js +3026 -298
- package/dist/provider/fastify.cjs +882 -0
- package/dist/provider/fastify.d.cts +35 -0
- package/dist/provider/fastify.d.ts +35 -0
- package/dist/provider/fastify.js +880 -0
- package/dist/provider/hono.cjs +948 -0
- package/dist/provider/hono.d.cts +99 -0
- package/dist/provider/hono.d.ts +99 -0
- package/dist/provider/hono.js +938 -0
- package/dist/provider.cjs +827 -97
- package/dist/provider.d.cts +32 -25
- package/dist/provider.d.ts +32 -25
- package/dist/provider.js +810 -99
- package/dist/react.cjs +2641 -0
- package/dist/react.d.cts +107 -0
- package/dist/react.d.ts +107 -0
- package/dist/react.js +2634 -0
- package/dist/routedockMiddleware-BlDsHuPl.d.ts +59 -0
- package/dist/routedockMiddleware-D97A5ptQ.d.cts +59 -0
- package/dist/schema.cjs +364 -0
- package/dist/schema.d.cts +3 -0
- package/dist/schema.d.ts +3 -0
- package/dist/schema.js +359 -0
- package/dist/sign-CUf3rhTx.d.cts +53 -0
- package/dist/sign-Dpj2Mp7k.d.ts +53 -0
- package/dist/testing.cjs +57 -0
- package/dist/testing.d.cts +95 -0
- package/dist/testing.d.ts +95 -0
- package/dist/testing.js +54 -0
- package/dist/types-DmhmfLzP.d.cts +410 -0
- package/dist/types-DmhmfLzP.d.ts +410 -0
- package/package.json +143 -23
- package/PUBLISH_CHECKLIST.md +0 -70
- package/dist/SessionStore-CCVO0PHM.d.cts +0 -152
- package/dist/SessionStore-CCVO0PHM.d.ts +0 -152
- package/dist/routedockMiddleware-B7WTB3LT.d.cts +0 -53
- package/dist/routedockMiddleware-DRgdrycG.d.ts +0 -53
- package/src/client/ModeRouter.ts +0 -104
- package/src/client/MppChargeClient.ts +0 -44
- package/src/client/MppSessionClient.ts +0 -144
- package/src/client/RouteDockClient.ts +0 -124
- package/src/client/index.ts +0 -8
- package/src/client/x402Client.ts +0 -84
- package/src/index.ts +0 -9
- package/src/provider/MppChargeHandler.ts +0 -90
- package/src/provider/MppSessionHandler.ts +0 -157
- package/src/provider/index.ts +0 -7
- package/src/provider/routedockMiddleware.ts +0 -154
- package/src/provider/x402Handler.ts +0 -164
- package/src/schemas/routedock.schema.json +0 -159
- package/src/store/SessionStore.ts +0 -90
- package/src/tests/smoke.test.ts +0 -228
- package/src/types.ts +0 -165
- package/tsconfig.json +0 -14
- package/tsup.config.ts +0 -15
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FastifyPluginAsync } from 'fastify';
|
|
2
|
+
import { P as PaymentMode, R as RouteDockManifest } from '../types-DmhmfLzP.cjs';
|
|
3
|
+
import { O as OrphanedSessionInfo, S as SeenTxStore } from '../MppSessionHandler-B4TyD7Xg.cjs';
|
|
4
|
+
import 'mppx';
|
|
5
|
+
import 'express';
|
|
6
|
+
|
|
7
|
+
interface RouteDockFastifyOptions {
|
|
8
|
+
modes: PaymentMode[];
|
|
9
|
+
pricing: {
|
|
10
|
+
x402?: string;
|
|
11
|
+
'mpp-charge'?: string;
|
|
12
|
+
'mpp-session'?: {
|
|
13
|
+
rate: string;
|
|
14
|
+
channelFactory: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
asset: string;
|
|
18
|
+
assetContract: string;
|
|
19
|
+
payee: string;
|
|
20
|
+
network: 'testnet' | 'mainnet';
|
|
21
|
+
payeeSecretKey: string;
|
|
22
|
+
facilitatorApiKey?: string;
|
|
23
|
+
commitmentPublicKey?: string;
|
|
24
|
+
manifest: RouteDockManifest;
|
|
25
|
+
onSettled?: (txHash: string, amount: string, mode: string, payer: string | null) => Promise<void>;
|
|
26
|
+
onSessionOpen?: (channelId: string, payer: string | null) => Promise<void>;
|
|
27
|
+
onVoucher?: (channelId: string, voucherIndex: number, cumulativeAmount: string, signature: string) => Promise<void>;
|
|
28
|
+
onCallbackError?: (err: unknown, cbName: string) => void;
|
|
29
|
+
onOrphaned?: (channelId: string, info: OrphanedSessionInfo) => Promise<void>;
|
|
30
|
+
idleTimeoutMs?: number;
|
|
31
|
+
seenTxStore?: SeenTxStore;
|
|
32
|
+
}
|
|
33
|
+
declare function routedockFastify(opts: RouteDockFastifyOptions): FastifyPluginAsync;
|
|
34
|
+
|
|
35
|
+
export { type RouteDockFastifyOptions, routedockFastify };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FastifyPluginAsync } from 'fastify';
|
|
2
|
+
import { P as PaymentMode, R as RouteDockManifest } from '../types-DmhmfLzP.js';
|
|
3
|
+
import { O as OrphanedSessionInfo, S as SeenTxStore } from '../MppSessionHandler-CLB5SzgN.js';
|
|
4
|
+
import 'mppx';
|
|
5
|
+
import 'express';
|
|
6
|
+
|
|
7
|
+
interface RouteDockFastifyOptions {
|
|
8
|
+
modes: PaymentMode[];
|
|
9
|
+
pricing: {
|
|
10
|
+
x402?: string;
|
|
11
|
+
'mpp-charge'?: string;
|
|
12
|
+
'mpp-session'?: {
|
|
13
|
+
rate: string;
|
|
14
|
+
channelFactory: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
asset: string;
|
|
18
|
+
assetContract: string;
|
|
19
|
+
payee: string;
|
|
20
|
+
network: 'testnet' | 'mainnet';
|
|
21
|
+
payeeSecretKey: string;
|
|
22
|
+
facilitatorApiKey?: string;
|
|
23
|
+
commitmentPublicKey?: string;
|
|
24
|
+
manifest: RouteDockManifest;
|
|
25
|
+
onSettled?: (txHash: string, amount: string, mode: string, payer: string | null) => Promise<void>;
|
|
26
|
+
onSessionOpen?: (channelId: string, payer: string | null) => Promise<void>;
|
|
27
|
+
onVoucher?: (channelId: string, voucherIndex: number, cumulativeAmount: string, signature: string) => Promise<void>;
|
|
28
|
+
onCallbackError?: (err: unknown, cbName: string) => void;
|
|
29
|
+
onOrphaned?: (channelId: string, info: OrphanedSessionInfo) => Promise<void>;
|
|
30
|
+
idleTimeoutMs?: number;
|
|
31
|
+
seenTxStore?: SeenTxStore;
|
|
32
|
+
}
|
|
33
|
+
declare function routedockFastify(opts: RouteDockFastifyOptions): FastifyPluginAsync;
|
|
34
|
+
|
|
35
|
+
export { type RouteDockFastifyOptions, routedockFastify };
|