@routedock/routedock 0.1.2 → 0.3.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 +532 -4
- package/dist/MppSessionHandler-1EL8QBAn.d.cts +215 -0
- package/dist/MppSessionHandler-Bq4S-JTE.d.ts +215 -0
- package/dist/ProviderRegistry-CA_TdREG.d.ts +142 -0
- package/dist/ProviderRegistry-D-0rqK0N.d.cts +142 -0
- package/dist/RouteDockClient-Bh86bVly.d.ts +469 -0
- package/dist/RouteDockClient-go9aopfF.d.cts +469 -0
- package/dist/SessionReconciler-Bw-PoBVl.d.ts +134 -0
- package/dist/SessionReconciler-Cz2nuOlJ.d.cts +134 -0
- package/dist/SessionStore-B4-Hi4H8.d.cts +143 -0
- package/dist/SessionStore-BaYiegP0.d.ts +143 -0
- package/dist/client.cjs +2746 -217
- package/dist/client.d.cts +51 -81
- package/dist/client.d.ts +51 -81
- package/dist/client.js +2690 -218
- package/dist/index.cjs +3634 -420
- package/dist/index.d.cts +12 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.js +3569 -419
- package/dist/logger-D8_Q2ytp.d.cts +467 -0
- package/dist/logger-D8_Q2ytp.d.ts +467 -0
- package/dist/provider/fastify.cjs +1099 -0
- package/dist/provider/fastify.d.cts +40 -0
- package/dist/provider/fastify.d.ts +40 -0
- package/dist/provider/fastify.js +1097 -0
- package/dist/provider/hono.cjs +1152 -0
- package/dist/provider/hono.d.cts +101 -0
- package/dist/provider/hono.d.ts +101 -0
- package/dist/provider/hono.js +1142 -0
- package/dist/provider.cjs +1105 -147
- package/dist/provider.d.cts +38 -27
- package/dist/provider.d.ts +38 -27
- package/dist/provider.js +1079 -148
- package/dist/react.cjs +2931 -0
- package/dist/react.d.cts +107 -0
- package/dist/react.d.ts +107 -0
- package/dist/react.js +2924 -0
- package/dist/routedockMiddleware-57gUaEMf.d.ts +64 -0
- package/dist/routedockMiddleware-DlyLrxp7.d.cts +64 -0
- package/dist/schema.cjs +404 -0
- package/dist/schema.d.cts +3 -0
- package/dist/schema.d.ts +3 -0
- package/dist/schema.js +399 -0
- package/dist/sign-AKH67sft.d.cts +53 -0
- package/dist/sign-BEq-OsSq.d.ts +53 -0
- package/dist/testing.cjs +59 -0
- package/dist/testing.d.cts +114 -0
- package/dist/testing.d.ts +114 -0
- package/dist/testing.js +56 -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,64 @@
|
|
|
1
|
+
import { RequestHandler } from 'express';
|
|
2
|
+
import { P as PaymentMode, h as RouteDockManifest, g as RouteDockLogger } from './logger-D8_Q2ytp.js';
|
|
3
|
+
import { O as OrphanedSessionInfo, S as SeenTxStore } from './MppSessionHandler-Bq4S-JTE.js';
|
|
4
|
+
|
|
5
|
+
interface RouteDockMiddlewareOptions {
|
|
6
|
+
modes: PaymentMode[];
|
|
7
|
+
pricing: {
|
|
8
|
+
x402?: string;
|
|
9
|
+
'mpp-charge'?: string;
|
|
10
|
+
'mpp-session'?: {
|
|
11
|
+
rate: string;
|
|
12
|
+
channelFactory: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
asset?: string;
|
|
16
|
+
/** Stellar Asset Contract address for the payment asset */
|
|
17
|
+
assetContract?: string;
|
|
18
|
+
payee: string;
|
|
19
|
+
network: 'testnet' | 'mainnet';
|
|
20
|
+
/** Private key (S...) of the server/payee account */
|
|
21
|
+
payeeSecretKey: string;
|
|
22
|
+
/** Required for x402 mode */
|
|
23
|
+
facilitatorApiKey?: string;
|
|
24
|
+
/** Required for mpp-session mode — ed25519 public key (G...) for verifying commitments */
|
|
25
|
+
commitmentPublicKey?: string;
|
|
26
|
+
/** Full RouteDock manifest — served at /.well-known/routedock.json */
|
|
27
|
+
manifest: RouteDockManifest;
|
|
28
|
+
/**
|
|
29
|
+
* Called after each successful on-chain settlement.
|
|
30
|
+
* `payer` is the Stellar G... public key of the agent that paid.
|
|
31
|
+
* May be `null` if the payer address could not be extracted from the payment headers.
|
|
32
|
+
*/
|
|
33
|
+
onSettled?: (txHash: string, amount: string, mode: string, payer: string | null) => Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Called when a new mpp-session is opened (first voucher received).
|
|
36
|
+
* `payer` is the Stellar G... public key of the agent that opened the channel.
|
|
37
|
+
* May be `null` if the payer address could not be extracted.
|
|
38
|
+
*/
|
|
39
|
+
onSessionOpen?: (channelId: string, payer: string | null) => Promise<void>;
|
|
40
|
+
/** Called after each verified voucher in an mpp-session */
|
|
41
|
+
onVoucher?: (channelId: string, voucherIndex: number, cumulativeAmount: string, signature: string) => Promise<void>;
|
|
42
|
+
/** Called if any of the above callbacks throw an error */
|
|
43
|
+
onCallbackError?: (err: unknown, cbName: string) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Called when an mpp-session connection drops or goes idle before a clean
|
|
46
|
+
* close. Persist the session as `closing` for the SessionReconciler.
|
|
47
|
+
*/
|
|
48
|
+
onOrphaned?: (channelId: string, info: OrphanedSessionInfo) => Promise<void>;
|
|
49
|
+
/** Idle timeout (ms) after which an mpp-session is flagged orphaned. */
|
|
50
|
+
idleTimeoutMs?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Idempotency store shared by the x402 and mpp-charge handlers to dedupe
|
|
53
|
+
* duplicate settlement on agent retries. Defaults to per-handler in-memory.
|
|
54
|
+
*/
|
|
55
|
+
seenTxStore?: SeenTxStore;
|
|
56
|
+
/**
|
|
57
|
+
* Structured log sink for every adapter diagnostic (settlement errors,
|
|
58
|
+
* callback failures, orphaned sessions). Defaults to a console-backed logger.
|
|
59
|
+
*/
|
|
60
|
+
logger?: RouteDockLogger;
|
|
61
|
+
}
|
|
62
|
+
declare function routedock(opts: RouteDockMiddlewareOptions): RequestHandler;
|
|
63
|
+
|
|
64
|
+
export { type RouteDockMiddlewareOptions as R, routedock as r };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { RequestHandler } from 'express';
|
|
2
|
+
import { P as PaymentMode, h as RouteDockManifest, g as RouteDockLogger } from './logger-D8_Q2ytp.cjs';
|
|
3
|
+
import { O as OrphanedSessionInfo, S as SeenTxStore } from './MppSessionHandler-1EL8QBAn.cjs';
|
|
4
|
+
|
|
5
|
+
interface RouteDockMiddlewareOptions {
|
|
6
|
+
modes: PaymentMode[];
|
|
7
|
+
pricing: {
|
|
8
|
+
x402?: string;
|
|
9
|
+
'mpp-charge'?: string;
|
|
10
|
+
'mpp-session'?: {
|
|
11
|
+
rate: string;
|
|
12
|
+
channelFactory: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
asset?: string;
|
|
16
|
+
/** Stellar Asset Contract address for the payment asset */
|
|
17
|
+
assetContract?: string;
|
|
18
|
+
payee: string;
|
|
19
|
+
network: 'testnet' | 'mainnet';
|
|
20
|
+
/** Private key (S...) of the server/payee account */
|
|
21
|
+
payeeSecretKey: string;
|
|
22
|
+
/** Required for x402 mode */
|
|
23
|
+
facilitatorApiKey?: string;
|
|
24
|
+
/** Required for mpp-session mode — ed25519 public key (G...) for verifying commitments */
|
|
25
|
+
commitmentPublicKey?: string;
|
|
26
|
+
/** Full RouteDock manifest — served at /.well-known/routedock.json */
|
|
27
|
+
manifest: RouteDockManifest;
|
|
28
|
+
/**
|
|
29
|
+
* Called after each successful on-chain settlement.
|
|
30
|
+
* `payer` is the Stellar G... public key of the agent that paid.
|
|
31
|
+
* May be `null` if the payer address could not be extracted from the payment headers.
|
|
32
|
+
*/
|
|
33
|
+
onSettled?: (txHash: string, amount: string, mode: string, payer: string | null) => Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Called when a new mpp-session is opened (first voucher received).
|
|
36
|
+
* `payer` is the Stellar G... public key of the agent that opened the channel.
|
|
37
|
+
* May be `null` if the payer address could not be extracted.
|
|
38
|
+
*/
|
|
39
|
+
onSessionOpen?: (channelId: string, payer: string | null) => Promise<void>;
|
|
40
|
+
/** Called after each verified voucher in an mpp-session */
|
|
41
|
+
onVoucher?: (channelId: string, voucherIndex: number, cumulativeAmount: string, signature: string) => Promise<void>;
|
|
42
|
+
/** Called if any of the above callbacks throw an error */
|
|
43
|
+
onCallbackError?: (err: unknown, cbName: string) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Called when an mpp-session connection drops or goes idle before a clean
|
|
46
|
+
* close. Persist the session as `closing` for the SessionReconciler.
|
|
47
|
+
*/
|
|
48
|
+
onOrphaned?: (channelId: string, info: OrphanedSessionInfo) => Promise<void>;
|
|
49
|
+
/** Idle timeout (ms) after which an mpp-session is flagged orphaned. */
|
|
50
|
+
idleTimeoutMs?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Idempotency store shared by the x402 and mpp-charge handlers to dedupe
|
|
53
|
+
* duplicate settlement on agent retries. Defaults to per-handler in-memory.
|
|
54
|
+
*/
|
|
55
|
+
seenTxStore?: SeenTxStore;
|
|
56
|
+
/**
|
|
57
|
+
* Structured log sink for every adapter diagnostic (settlement errors,
|
|
58
|
+
* callback failures, orphaned sessions). Defaults to a console-backed logger.
|
|
59
|
+
*/
|
|
60
|
+
logger?: RouteDockLogger;
|
|
61
|
+
}
|
|
62
|
+
declare function routedock(opts: RouteDockMiddlewareOptions): RequestHandler;
|
|
63
|
+
|
|
64
|
+
export { type RouteDockMiddlewareOptions as R, routedock as r };
|
package/dist/schema.cjs
ADDED
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
// src/schemas/routedock.schema.json
|
|
6
|
+
var routedock_schema_default = {
|
|
7
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
8
|
+
$id: "https://routedock.xyz/schemas/routedock.schema.json",
|
|
9
|
+
title: "RouteDock Manifest",
|
|
10
|
+
description: "Discovery manifest served at /.well-known/routedock.json on every RouteDock provider endpoint",
|
|
11
|
+
type: "object",
|
|
12
|
+
required: [
|
|
13
|
+
"routedock",
|
|
14
|
+
"name",
|
|
15
|
+
"description",
|
|
16
|
+
"modes",
|
|
17
|
+
"network",
|
|
18
|
+
"asset",
|
|
19
|
+
"asset_contract",
|
|
20
|
+
"payee",
|
|
21
|
+
"pricing",
|
|
22
|
+
"endpoints",
|
|
23
|
+
"tags"
|
|
24
|
+
],
|
|
25
|
+
additionalProperties: false,
|
|
26
|
+
properties: {
|
|
27
|
+
routedock: {
|
|
28
|
+
type: "string",
|
|
29
|
+
pattern: "^[0-9]+\\.[0-9]+$",
|
|
30
|
+
description: "Manifest schema version, e.g. '1.0', '1.1', '2.0'."
|
|
31
|
+
},
|
|
32
|
+
min_client_version: {
|
|
33
|
+
type: "string",
|
|
34
|
+
pattern: "^[0-9]+\\.[0-9]+$",
|
|
35
|
+
description: "Minimum SDK client version (major.minor) required to use this manifest. Clients below this version must refuse to pay."
|
|
36
|
+
},
|
|
37
|
+
deprecated_modes: {
|
|
38
|
+
type: "array",
|
|
39
|
+
items: {
|
|
40
|
+
$ref: "#/definitions/PaymentMode"
|
|
41
|
+
},
|
|
42
|
+
uniqueItems: true,
|
|
43
|
+
description: "Payment modes still listed in 'modes' for backwards compatibility but deprecated for new integrations."
|
|
44
|
+
},
|
|
45
|
+
sunset_at: {
|
|
46
|
+
type: "string",
|
|
47
|
+
format: "date-time",
|
|
48
|
+
description: "ISO 8601 timestamp after which this manifest version is no longer supported by the provider."
|
|
49
|
+
},
|
|
50
|
+
name: {
|
|
51
|
+
type: "string",
|
|
52
|
+
minLength: 1,
|
|
53
|
+
maxLength: 120,
|
|
54
|
+
description: "Human-readable provider name"
|
|
55
|
+
},
|
|
56
|
+
description: {
|
|
57
|
+
type: "string",
|
|
58
|
+
minLength: 1,
|
|
59
|
+
maxLength: 500,
|
|
60
|
+
description: "Human-readable description of the provider's data or service"
|
|
61
|
+
},
|
|
62
|
+
modes: {
|
|
63
|
+
type: "array",
|
|
64
|
+
minItems: 1,
|
|
65
|
+
uniqueItems: true,
|
|
66
|
+
items: {
|
|
67
|
+
$ref: "#/definitions/PaymentMode"
|
|
68
|
+
},
|
|
69
|
+
description: "Payment modes supported by this provider"
|
|
70
|
+
},
|
|
71
|
+
network: {
|
|
72
|
+
type: "string",
|
|
73
|
+
enum: ["testnet", "mainnet"],
|
|
74
|
+
description: "Stellar network this provider operates on"
|
|
75
|
+
},
|
|
76
|
+
asset: {
|
|
77
|
+
type: "string",
|
|
78
|
+
description: "Asset ticker symbol (e.g. 'USDC')"
|
|
79
|
+
},
|
|
80
|
+
asset_contract: {
|
|
81
|
+
type: "string",
|
|
82
|
+
description: "Stellar Asset Contract (SAC) address for the payment asset"
|
|
83
|
+
},
|
|
84
|
+
assets: {
|
|
85
|
+
type: "array",
|
|
86
|
+
minItems: 1,
|
|
87
|
+
items: {
|
|
88
|
+
$ref: "#/definitions/AssetConfig"
|
|
89
|
+
},
|
|
90
|
+
description: "Payment assets accepted by this provider. Each asset can be scoped to specific modes and endpoints. When present, assets[0] must match the root-level asset and asset_contract."
|
|
91
|
+
},
|
|
92
|
+
payee: {
|
|
93
|
+
type: "string",
|
|
94
|
+
description: "Stellar address (G...) that receives payments"
|
|
95
|
+
},
|
|
96
|
+
pricing: {
|
|
97
|
+
type: "object",
|
|
98
|
+
description: "Pricing configuration per supported payment mode",
|
|
99
|
+
additionalProperties: false,
|
|
100
|
+
properties: {
|
|
101
|
+
x402: {
|
|
102
|
+
$ref: "#/definitions/PricingConfig"
|
|
103
|
+
},
|
|
104
|
+
"mpp-charge": {
|
|
105
|
+
$ref: "#/definitions/PricingConfig"
|
|
106
|
+
},
|
|
107
|
+
"mpp-session": {
|
|
108
|
+
$ref: "#/definitions/SessionPricingConfig"
|
|
109
|
+
},
|
|
110
|
+
"mpp-session-ws": {
|
|
111
|
+
$ref: "#/definitions/SessionPricingConfig",
|
|
112
|
+
description: "WebSocket transport variant of mpp-session: channel opened and first voucher negotiated over HTTP, then the connection upgrades to WebSocket for push-based streaming."
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
minProperties: 1
|
|
116
|
+
},
|
|
117
|
+
endpoints: {
|
|
118
|
+
type: "object",
|
|
119
|
+
description: "Map of endpoint name to endpoint descriptors",
|
|
120
|
+
additionalProperties: {
|
|
121
|
+
$ref: "#/definitions/EndpointDescriptor"
|
|
122
|
+
},
|
|
123
|
+
minProperties: 1
|
|
124
|
+
},
|
|
125
|
+
sla: {
|
|
126
|
+
$ref: "#/definitions/SLAConfig"
|
|
127
|
+
},
|
|
128
|
+
tags: {
|
|
129
|
+
type: "array",
|
|
130
|
+
items: {
|
|
131
|
+
type: "string",
|
|
132
|
+
minLength: 1,
|
|
133
|
+
maxLength: 64
|
|
134
|
+
},
|
|
135
|
+
uniqueItems: true,
|
|
136
|
+
description: "Capability tags indexed with trigram search in the provider registry"
|
|
137
|
+
},
|
|
138
|
+
vault: {
|
|
139
|
+
$ref: "#/definitions/VaultMode"
|
|
140
|
+
},
|
|
141
|
+
nulth_account: {
|
|
142
|
+
type: "string",
|
|
143
|
+
description: "Optional Nulth smart account address associated with this provider"
|
|
144
|
+
},
|
|
145
|
+
capabilities: {
|
|
146
|
+
type: "object",
|
|
147
|
+
description: "Optional protocol features this provider supports",
|
|
148
|
+
properties: {
|
|
149
|
+
streaming: {
|
|
150
|
+
type: "array",
|
|
151
|
+
items: {
|
|
152
|
+
type: "string",
|
|
153
|
+
enum: ["sse", "websocket"]
|
|
154
|
+
},
|
|
155
|
+
description: "Supported streaming transports"
|
|
156
|
+
},
|
|
157
|
+
webhooks: {
|
|
158
|
+
type: "boolean",
|
|
159
|
+
description: "Whether webhook callbacks are supported"
|
|
160
|
+
},
|
|
161
|
+
idempotency_keys: {
|
|
162
|
+
type: "boolean",
|
|
163
|
+
description: "Whether idempotency keys are supported"
|
|
164
|
+
},
|
|
165
|
+
content_types: {
|
|
166
|
+
type: "array",
|
|
167
|
+
items: {
|
|
168
|
+
type: "string"
|
|
169
|
+
},
|
|
170
|
+
description: "Supported content types for request/response"
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
additionalProperties: false
|
|
174
|
+
},
|
|
175
|
+
regions: {
|
|
176
|
+
type: "array",
|
|
177
|
+
items: {
|
|
178
|
+
type: "string",
|
|
179
|
+
minLength: 2,
|
|
180
|
+
maxLength: 10
|
|
181
|
+
},
|
|
182
|
+
uniqueItems: true,
|
|
183
|
+
description: "IATA airport codes or UN/LOCODE identifiers for regions where this provider has infrastructure (e.g. ['IAD', 'AMS']). Used by agents to select the nearest provider."
|
|
184
|
+
},
|
|
185
|
+
latency_hints: {
|
|
186
|
+
type: "object",
|
|
187
|
+
additionalProperties: {
|
|
188
|
+
type: "number",
|
|
189
|
+
minimum: 0
|
|
190
|
+
},
|
|
191
|
+
description: "Provider-declared p50 latency in milliseconds per region code. Keys must be a subset of 'regions'. Example: { 'IAD': 14, 'AMS': 22 }."
|
|
192
|
+
},
|
|
193
|
+
signature: {
|
|
194
|
+
type: "string",
|
|
195
|
+
description: "Base64 Ed25519 signature (payee keypair) over the SHA-256 hash of this manifest with the signature field omitted. Clients must verify before trusting any routing field."
|
|
196
|
+
},
|
|
197
|
+
signature_version: {
|
|
198
|
+
type: "string",
|
|
199
|
+
const: "2",
|
|
200
|
+
description: "Manifest signature format. Version 2 recursively includes every nested manifest field in the signed digest."
|
|
201
|
+
},
|
|
202
|
+
categories: {
|
|
203
|
+
type: "array",
|
|
204
|
+
items: {
|
|
205
|
+
type: "string",
|
|
206
|
+
minLength: 1,
|
|
207
|
+
maxLength: 128
|
|
208
|
+
},
|
|
209
|
+
uniqueItems: true,
|
|
210
|
+
description: "Optional hierarchical categories from a published taxonomy (e.g. data/price/crypto)"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
definitions: {
|
|
214
|
+
VaultMode: {
|
|
215
|
+
type: "string",
|
|
216
|
+
enum: ["local-key", "agent-vault", "nulth"],
|
|
217
|
+
description: "Agent vault / custody mode for payments from this provider"
|
|
218
|
+
},
|
|
219
|
+
PaymentMode: {
|
|
220
|
+
type: "string",
|
|
221
|
+
enum: ["x402", "mpp-charge", "mpp-session", "mpp-session-ws"],
|
|
222
|
+
description: "A supported RouteDock payment mode"
|
|
223
|
+
},
|
|
224
|
+
AssetConfig: {
|
|
225
|
+
type: "object",
|
|
226
|
+
description: "Payment asset configuration with optional mode and endpoint scoping",
|
|
227
|
+
required: ["asset", "asset_contract"],
|
|
228
|
+
additionalProperties: false,
|
|
229
|
+
properties: {
|
|
230
|
+
asset: {
|
|
231
|
+
type: "string",
|
|
232
|
+
description: "Asset ticker symbol (e.g. 'USDC' or 'XLM')"
|
|
233
|
+
},
|
|
234
|
+
asset_contract: {
|
|
235
|
+
type: "string",
|
|
236
|
+
description: "Stellar Asset Contract (SAC) address for the payment asset"
|
|
237
|
+
},
|
|
238
|
+
modes: {
|
|
239
|
+
type: "array",
|
|
240
|
+
items: {
|
|
241
|
+
$ref: "#/definitions/PaymentMode"
|
|
242
|
+
},
|
|
243
|
+
uniqueItems: true,
|
|
244
|
+
description: "Optional: restrict this asset to specific payment modes. If omitted, available for all modes."
|
|
245
|
+
},
|
|
246
|
+
endpoints: {
|
|
247
|
+
type: "array",
|
|
248
|
+
items: {
|
|
249
|
+
type: "string"
|
|
250
|
+
},
|
|
251
|
+
uniqueItems: true,
|
|
252
|
+
description: "Optional: restrict this asset to specific endpoints (by name). If omitted, available for all endpoints."
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
PricingConfig: {
|
|
257
|
+
type: "object",
|
|
258
|
+
description: "Per-request pricing for x402 or mpp-charge modes",
|
|
259
|
+
required: ["amount", "per"],
|
|
260
|
+
additionalProperties: false,
|
|
261
|
+
properties: {
|
|
262
|
+
amount: {
|
|
263
|
+
type: "string",
|
|
264
|
+
description: "Cost per request in the payment asset (decimal string, e.g. '0.001')"
|
|
265
|
+
},
|
|
266
|
+
per: {
|
|
267
|
+
type: "string",
|
|
268
|
+
const: "request",
|
|
269
|
+
description: "Billing unit \u2014 always 'request' for non-session modes"
|
|
270
|
+
},
|
|
271
|
+
facilitator: {
|
|
272
|
+
type: "string",
|
|
273
|
+
description: "x402 facilitator URL (required for x402 mode). OpenZeppelin Channels endpoint."
|
|
274
|
+
},
|
|
275
|
+
payee: {
|
|
276
|
+
type: "string",
|
|
277
|
+
description: "Optional per-mode payee override (Stellar G... address). Directs settlements for this mode to a separate account for treasury separation. Falls back to the top-level 'payee' when omitted."
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
SessionPricingConfig: {
|
|
282
|
+
type: "object",
|
|
283
|
+
description: "Per-voucher pricing for mpp-session (one-way-channel) mode",
|
|
284
|
+
required: ["rate", "per", "channel_factory", "min_deposit", "refund_waiting_period_ledgers"],
|
|
285
|
+
additionalProperties: false,
|
|
286
|
+
properties: {
|
|
287
|
+
rate: {
|
|
288
|
+
type: "string",
|
|
289
|
+
description: "Cost per voucher in the payment asset (decimal string, e.g. '0.0001')"
|
|
290
|
+
},
|
|
291
|
+
per: {
|
|
292
|
+
type: "string",
|
|
293
|
+
const: "voucher",
|
|
294
|
+
description: "Billing unit \u2014 always 'voucher' for session mode"
|
|
295
|
+
},
|
|
296
|
+
channel_factory: {
|
|
297
|
+
type: "string",
|
|
298
|
+
description: "Stable Soroban factory address (C...) used to deploy a per-session channel"
|
|
299
|
+
},
|
|
300
|
+
min_deposit: {
|
|
301
|
+
type: "string",
|
|
302
|
+
description: "Minimum initial deposit to open a channel (decimal string)"
|
|
303
|
+
},
|
|
304
|
+
refund_waiting_period_ledgers: {
|
|
305
|
+
type: "integer",
|
|
306
|
+
minimum: 1,
|
|
307
|
+
description: "Ledgers the server has to settle before the funder can reclaim. Default: 17280 (~24h). Do not reduce in production."
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
SLAConfig: {
|
|
312
|
+
type: "object",
|
|
313
|
+
description: "Service Level Agreement for the provider",
|
|
314
|
+
required: ["uptime_30d_percent", "p95_latency_ms"],
|
|
315
|
+
additionalProperties: false,
|
|
316
|
+
properties: {
|
|
317
|
+
uptime_30d_percent: {
|
|
318
|
+
type: "number",
|
|
319
|
+
description: "Uptime percentage over the last 30 days"
|
|
320
|
+
},
|
|
321
|
+
p95_latency_ms: {
|
|
322
|
+
type: "number",
|
|
323
|
+
description: "P95 latency in milliseconds"
|
|
324
|
+
},
|
|
325
|
+
maintenance_windows: {
|
|
326
|
+
type: "array",
|
|
327
|
+
items: {
|
|
328
|
+
type: "object",
|
|
329
|
+
required: ["cron", "duration_minutes"],
|
|
330
|
+
additionalProperties: false,
|
|
331
|
+
properties: {
|
|
332
|
+
cron: {
|
|
333
|
+
type: "string",
|
|
334
|
+
description: "Cron expression for the maintenance window"
|
|
335
|
+
},
|
|
336
|
+
duration_minutes: {
|
|
337
|
+
type: "number",
|
|
338
|
+
description: "Duration of the maintenance window in minutes"
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
EndpointDescriptor: {
|
|
346
|
+
type: "object",
|
|
347
|
+
description: "Descriptor for a provider endpoint",
|
|
348
|
+
required: ["method", "path"],
|
|
349
|
+
additionalProperties: false,
|
|
350
|
+
properties: {
|
|
351
|
+
method: {
|
|
352
|
+
type: "string",
|
|
353
|
+
description: "HTTP method for the endpoint"
|
|
354
|
+
},
|
|
355
|
+
path: {
|
|
356
|
+
type: "string",
|
|
357
|
+
description: "Path for the endpoint"
|
|
358
|
+
},
|
|
359
|
+
deprecated: {
|
|
360
|
+
type: "boolean",
|
|
361
|
+
description: "Whether this endpoint is retained only for backwards compatibility"
|
|
362
|
+
},
|
|
363
|
+
sunset_at: {
|
|
364
|
+
type: "string",
|
|
365
|
+
format: "date-time",
|
|
366
|
+
description: "ISO 8601 timestamp after which callers should stop using this endpoint"
|
|
367
|
+
},
|
|
368
|
+
headers: {
|
|
369
|
+
type: "object",
|
|
370
|
+
additionalProperties: {
|
|
371
|
+
type: "string"
|
|
372
|
+
},
|
|
373
|
+
description: "Expected request headers"
|
|
374
|
+
},
|
|
375
|
+
request_schema: {
|
|
376
|
+
description: "JSON schema for the request body"
|
|
377
|
+
},
|
|
378
|
+
response_schema: {
|
|
379
|
+
description: "JSON schema for the response body"
|
|
380
|
+
},
|
|
381
|
+
rate_limit: {
|
|
382
|
+
type: "object",
|
|
383
|
+
required: ["requests", "window_seconds"],
|
|
384
|
+
additionalProperties: false,
|
|
385
|
+
properties: {
|
|
386
|
+
requests: {
|
|
387
|
+
type: "number"
|
|
388
|
+
},
|
|
389
|
+
window_seconds: {
|
|
390
|
+
type: "number"
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
// src/schema.ts
|
|
400
|
+
var schema = routedock_schema_default;
|
|
401
|
+
var schema_default = schema;
|
|
402
|
+
|
|
403
|
+
exports.default = schema_default;
|
|
404
|
+
exports.schema = schema;
|
package/dist/schema.d.ts
ADDED