@rpp402/protocol 0.1.3
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 +33 -0
- package/dist/index.cjs +315 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +727 -0
- package/dist/index.d.ts +727 -0
- package/dist/index.js +312 -0
- package/dist/index.js.map +1 -0
- package/package.json +55 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
// src/schemas/asset-ref.schema.json
|
|
2
|
+
var asset_ref_schema_default = {
|
|
3
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
$id: "https://rpp402.com/schemas/v1/asset-ref.json",
|
|
5
|
+
title: "RPP402 Asset Reference",
|
|
6
|
+
type: "object",
|
|
7
|
+
required: ["type", "symbol", "chain_id", "contract"],
|
|
8
|
+
properties: {
|
|
9
|
+
type: { type: "string", enum: ["stablecoin", "tokenized_security"] },
|
|
10
|
+
symbol: { type: "string" },
|
|
11
|
+
chain_id: { type: "string" },
|
|
12
|
+
contract: { type: "string", pattern: "^0x[a-fA-F0-9]{40}$" },
|
|
13
|
+
issuer: { type: "string" }
|
|
14
|
+
},
|
|
15
|
+
if: { properties: { type: { const: "tokenized_security" } } },
|
|
16
|
+
then: { required: ["issuer"] }
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// src/schemas/commerce-session.schema.json
|
|
20
|
+
var commerce_session_schema_default = {
|
|
21
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
22
|
+
$id: "https://rpp402.com/schemas/v1/commerce-session.json",
|
|
23
|
+
title: "RPP402 Commerce Session",
|
|
24
|
+
type: "object",
|
|
25
|
+
required: ["rpp402_version", "id", "agent_wallet", "status", "legs", "created_at", "expires_at"],
|
|
26
|
+
properties: {
|
|
27
|
+
rpp402_version: { type: "string", const: "1.0" },
|
|
28
|
+
id: { type: "string", pattern: "^sess_[a-zA-Z0-9]{8,}$" },
|
|
29
|
+
agent_wallet: { type: "string", pattern: "^0x[a-fA-F0-9]{40}$" },
|
|
30
|
+
status: {
|
|
31
|
+
type: "string",
|
|
32
|
+
enum: ["created", "quoting", "intent_authorized", "settling", "settled", "receipt_issued", "expired", "cancelled", "failed"]
|
|
33
|
+
},
|
|
34
|
+
legs: {
|
|
35
|
+
type: "array",
|
|
36
|
+
items: {
|
|
37
|
+
type: "object",
|
|
38
|
+
required: ["quote_id", "service_id", "capability", "price"],
|
|
39
|
+
properties: {
|
|
40
|
+
quote_id: { type: "string", pattern: "^quote_[a-zA-Z0-9]{8,}$" },
|
|
41
|
+
service_id: { type: "string", pattern: "^svc_[a-zA-Z0-9]{8,}$" },
|
|
42
|
+
capability: { type: "string" },
|
|
43
|
+
price: {
|
|
44
|
+
type: "object",
|
|
45
|
+
required: ["asset", "amount"],
|
|
46
|
+
properties: {
|
|
47
|
+
asset: { $ref: "https://rpp402.com/schemas/v1/asset-ref.json" },
|
|
48
|
+
amount: { type: "string", pattern: "^[0-9]+(\\.[0-9]+)?$" }
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
intent_id: { type: ["string", "null"] },
|
|
55
|
+
settlement_id: { type: ["string", "null"] },
|
|
56
|
+
receipt_id: { type: ["string", "null"] },
|
|
57
|
+
created_at: { type: "string", format: "date-time" },
|
|
58
|
+
expires_at: { type: "string", format: "date-time" }
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// src/schemas/discovery.schema.json
|
|
63
|
+
var discovery_schema_default = {
|
|
64
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
65
|
+
$id: "https://rpp402.com/schemas/v1/discovery.json",
|
|
66
|
+
title: "RPP402 Discovery Document",
|
|
67
|
+
type: "object",
|
|
68
|
+
required: ["rpp402_version", "service", "wallet", "capabilities", "supported_assets", "endpoints"],
|
|
69
|
+
properties: {
|
|
70
|
+
rpp402_version: { type: "string", const: "1.0" },
|
|
71
|
+
service: {
|
|
72
|
+
type: "object",
|
|
73
|
+
required: ["id", "name", "description"],
|
|
74
|
+
properties: {
|
|
75
|
+
id: { type: "string", pattern: "^svc_[a-zA-Z0-9]{8,}$" },
|
|
76
|
+
name: { type: "string", minLength: 1 },
|
|
77
|
+
description: { type: "string", minLength: 1 }
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
wallet: {
|
|
81
|
+
type: "object",
|
|
82
|
+
required: ["address", "chain_id"],
|
|
83
|
+
properties: {
|
|
84
|
+
address: { type: "string", pattern: "^0x[a-fA-F0-9]{40}$" },
|
|
85
|
+
chain_id: { type: "string" }
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
capabilities: {
|
|
89
|
+
type: "array",
|
|
90
|
+
minItems: 1,
|
|
91
|
+
items: {
|
|
92
|
+
type: "object",
|
|
93
|
+
required: ["name", "description"],
|
|
94
|
+
properties: {
|
|
95
|
+
name: { type: "string", pattern: "^[a-z0-9-]+\\.[a-z0-9-]+$" },
|
|
96
|
+
description: { type: "string" },
|
|
97
|
+
pricing_summary: { type: "string" }
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
supported_assets: {
|
|
102
|
+
type: "array",
|
|
103
|
+
minItems: 1,
|
|
104
|
+
items: { $ref: "https://rpp402.com/schemas/v1/asset-ref.json" }
|
|
105
|
+
},
|
|
106
|
+
endpoints: {
|
|
107
|
+
type: "object",
|
|
108
|
+
required: ["quote", "session", "receipts"],
|
|
109
|
+
properties: {
|
|
110
|
+
quote: { type: "string", format: "uri" },
|
|
111
|
+
session: { type: "string", format: "uri" },
|
|
112
|
+
receipts: { type: "string", format: "uri" }
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// src/schemas/payment-intent.schema.json
|
|
119
|
+
var payment_intent_schema_default = {
|
|
120
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
121
|
+
$id: "https://rpp402.com/schemas/v1/payment-intent.json",
|
|
122
|
+
title: "RPP402 Payment Intent",
|
|
123
|
+
type: "object",
|
|
124
|
+
required: ["rpp402_version", "id", "session_id", "payer_wallet", "asset", "amount", "status", "authorization", "created_at", "expires_at"],
|
|
125
|
+
properties: {
|
|
126
|
+
rpp402_version: { type: "string", const: "1.0" },
|
|
127
|
+
id: { type: "string", pattern: "^intent_[a-zA-Z0-9]{8,}$" },
|
|
128
|
+
session_id: { type: "string", pattern: "^sess_[a-zA-Z0-9]{8,}$" },
|
|
129
|
+
payer_wallet: { type: "string", pattern: "^0x[a-fA-F0-9]{40}$" },
|
|
130
|
+
asset: { $ref: "https://rpp402.com/schemas/v1/asset-ref.json" },
|
|
131
|
+
amount_mode: { type: ["string", "null"], enum: ["fixed_quantity", "notional_usd", null] },
|
|
132
|
+
amount: { type: "string", pattern: "^[0-9]+(\\.[0-9]+)?$" },
|
|
133
|
+
status: { type: "string", enum: ["pending", "authorized", "revoked", "expired"] },
|
|
134
|
+
authorization: {
|
|
135
|
+
oneOf: [
|
|
136
|
+
{
|
|
137
|
+
type: "object",
|
|
138
|
+
required: ["type", "signer", "signature", "nonce"],
|
|
139
|
+
properties: {
|
|
140
|
+
type: { const: "eip712_signature" },
|
|
141
|
+
signer: { type: "string", pattern: "^0x[a-fA-F0-9]{40}$" },
|
|
142
|
+
signature: { type: "string", pattern: "^0x[a-fA-F0-9]+$" },
|
|
143
|
+
nonce: { type: "string" }
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
type: "object",
|
|
148
|
+
required: ["type", "account_id", "delegation_ref"],
|
|
149
|
+
properties: {
|
|
150
|
+
type: { const: "agentic_account_delegation" },
|
|
151
|
+
account_id: { type: "string", pattern: "^aa_[a-zA-Z0-9]{4,}$" },
|
|
152
|
+
delegation_ref: { type: "string", pattern: "^del_[a-zA-Z0-9]{4,}$" },
|
|
153
|
+
risk_check: { type: "string" }
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
},
|
|
158
|
+
created_at: { type: "string", format: "date-time" },
|
|
159
|
+
expires_at: { type: "string", format: "date-time" }
|
|
160
|
+
},
|
|
161
|
+
if: { properties: { asset: { properties: { type: { const: "tokenized_security" } } } } },
|
|
162
|
+
then: { required: ["amount_mode"] }
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
// src/schemas/quote.schema.json
|
|
166
|
+
var quote_schema_default = {
|
|
167
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
168
|
+
$id: "https://rpp402.com/schemas/v1/quote.json",
|
|
169
|
+
title: "RPP402 Quote",
|
|
170
|
+
type: "object",
|
|
171
|
+
required: ["rpp402_version", "id", "service_id", "capability", "price", "expires_at", "created_at"],
|
|
172
|
+
properties: {
|
|
173
|
+
rpp402_version: { type: "string", const: "1.0" },
|
|
174
|
+
id: { type: "string", pattern: "^quote_[a-zA-Z0-9]{8,}$" },
|
|
175
|
+
service_id: { type: "string", pattern: "^svc_[a-zA-Z0-9]{8,}$" },
|
|
176
|
+
capability: { type: "string", pattern: "^[a-z0-9-]+\\.[a-z0-9-]+$" },
|
|
177
|
+
price: {
|
|
178
|
+
type: "object",
|
|
179
|
+
required: ["asset", "amount"],
|
|
180
|
+
properties: {
|
|
181
|
+
asset: { $ref: "https://rpp402.com/schemas/v1/asset-ref.json" },
|
|
182
|
+
amount: { type: "string", pattern: "^[0-9]+(\\.[0-9]+)?$" }
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
expires_at: { type: "string", format: "date-time" },
|
|
186
|
+
created_at: { type: "string", format: "date-time" }
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
// src/schemas/receipt.schema.json
|
|
191
|
+
var receipt_schema_default = {
|
|
192
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
193
|
+
$id: "https://rpp402.com/schemas/v1/receipt.json",
|
|
194
|
+
title: "RPP402 Receipt",
|
|
195
|
+
type: "object",
|
|
196
|
+
required: ["rpp402_version", "id", "session_id", "settlement_id", "payer_wallet", "line_items", "total", "settlement_ref", "signature", "issued_at"],
|
|
197
|
+
properties: {
|
|
198
|
+
rpp402_version: { type: "string", const: "1.0" },
|
|
199
|
+
id: { type: "string", pattern: "^rcpt_[a-zA-Z0-9]{8,}$" },
|
|
200
|
+
session_id: { type: "string", pattern: "^sess_[a-zA-Z0-9]{8,}$" },
|
|
201
|
+
settlement_id: { type: "string", pattern: "^settle_[a-zA-Z0-9]{8,}$" },
|
|
202
|
+
payer_wallet: { type: "string", pattern: "^0x[a-fA-F0-9]{40}$" },
|
|
203
|
+
line_items: {
|
|
204
|
+
type: "array",
|
|
205
|
+
minItems: 1,
|
|
206
|
+
items: {
|
|
207
|
+
type: "object",
|
|
208
|
+
required: ["service_id", "capability", "quote_id", "amount"],
|
|
209
|
+
properties: {
|
|
210
|
+
service_id: { type: "string" },
|
|
211
|
+
capability: { type: "string" },
|
|
212
|
+
quote_id: { type: "string" },
|
|
213
|
+
amount: {
|
|
214
|
+
type: "object",
|
|
215
|
+
required: ["asset", "amount"],
|
|
216
|
+
properties: {
|
|
217
|
+
asset: { $ref: "https://rpp402.com/schemas/v1/asset-ref.json" },
|
|
218
|
+
amount: { type: "string" }
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
total: {
|
|
225
|
+
type: "object",
|
|
226
|
+
required: ["asset", "amount"],
|
|
227
|
+
properties: {
|
|
228
|
+
asset: { $ref: "https://rpp402.com/schemas/v1/asset-ref.json" },
|
|
229
|
+
amount: { type: "string" }
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
settlement_ref: {
|
|
233
|
+
type: "object",
|
|
234
|
+
required: ["chain_id", "tx_hash", "block_number"],
|
|
235
|
+
properties: {
|
|
236
|
+
chain_id: { type: "string" },
|
|
237
|
+
tx_hash: { type: "string", pattern: "^0x[a-fA-F0-9]{64}$" },
|
|
238
|
+
block_number: { type: "integer" }
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
signature: {
|
|
242
|
+
type: "object",
|
|
243
|
+
required: ["algorithm", "signer", "signature"],
|
|
244
|
+
properties: {
|
|
245
|
+
algorithm: { const: "eip712" },
|
|
246
|
+
signer: { type: "string", pattern: "^0x[a-fA-F0-9]{40}$" },
|
|
247
|
+
signature: { type: "string", pattern: "^0x[a-fA-F0-9]+$" }
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
issued_at: { type: "string", format: "date-time" }
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
// src/schemas/settlement.schema.json
|
|
255
|
+
var settlement_schema_default = {
|
|
256
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
257
|
+
$id: "https://rpp402.com/schemas/v1/settlement.json",
|
|
258
|
+
title: "RPP402 Settlement",
|
|
259
|
+
type: "object",
|
|
260
|
+
required: ["rpp402_version", "id", "intent_id", "session_id", "chain_id", "status", "transfers", "created_at"],
|
|
261
|
+
properties: {
|
|
262
|
+
rpp402_version: { type: "string", const: "1.0" },
|
|
263
|
+
id: { type: "string", pattern: "^settle_[a-zA-Z0-9]{8,}$" },
|
|
264
|
+
intent_id: { type: "string", pattern: "^intent_[a-zA-Z0-9]{8,}$" },
|
|
265
|
+
session_id: { type: "string", pattern: "^sess_[a-zA-Z0-9]{8,}$" },
|
|
266
|
+
chain_id: { type: "string" },
|
|
267
|
+
tx_hash: { type: ["string", "null"], pattern: "^0x[a-fA-F0-9]{64}$" },
|
|
268
|
+
block_number: { type: ["integer", "null"] },
|
|
269
|
+
status: { type: "string", enum: ["pending", "submitted", "confirmed", "failed"] },
|
|
270
|
+
transfers: {
|
|
271
|
+
type: "array",
|
|
272
|
+
minItems: 1,
|
|
273
|
+
items: {
|
|
274
|
+
type: "object",
|
|
275
|
+
required: ["from", "to", "asset", "amount"],
|
|
276
|
+
properties: {
|
|
277
|
+
from: { type: "string", pattern: "^0x[a-fA-F0-9]{40}$" },
|
|
278
|
+
to: { type: "string", pattern: "^0x[a-fA-F0-9]{40}$" },
|
|
279
|
+
asset: { $ref: "https://rpp402.com/schemas/v1/asset-ref.json" },
|
|
280
|
+
amount: { type: "string", pattern: "^[0-9]+(\\.[0-9]+)?$" }
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
reference_price: {
|
|
285
|
+
type: ["object", "null"],
|
|
286
|
+
properties: {
|
|
287
|
+
oracle: { type: "string" },
|
|
288
|
+
symbol: { type: "string" },
|
|
289
|
+
price_usd: { type: "string" },
|
|
290
|
+
sourced_at: { type: "string", format: "date-time" }
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
created_at: { type: "string", format: "date-time" },
|
|
294
|
+
confirmed_at: { type: ["string", "null"], format: "date-time" }
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
// src/index.ts
|
|
299
|
+
var schemas = {
|
|
300
|
+
assetRef: asset_ref_schema_default,
|
|
301
|
+
discovery: discovery_schema_default,
|
|
302
|
+
quote: quote_schema_default,
|
|
303
|
+
commerceSession: commerce_session_schema_default,
|
|
304
|
+
paymentIntent: payment_intent_schema_default,
|
|
305
|
+
settlement: settlement_schema_default,
|
|
306
|
+
receipt: receipt_schema_default
|
|
307
|
+
};
|
|
308
|
+
var RPP_VERSION = "1.0";
|
|
309
|
+
|
|
310
|
+
export { RPP_VERSION, schemas };
|
|
311
|
+
//# sourceMappingURL=index.js.map
|
|
312
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schemas/asset-ref.schema.json","../src/schemas/commerce-session.schema.json","../src/schemas/discovery.schema.json","../src/schemas/payment-intent.schema.json","../src/schemas/quote.schema.json","../src/schemas/receipt.schema.json","../src/schemas/settlement.schema.json","../src/index.ts"],"names":[],"mappings":";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ACrB,QAAA,EAAU,wBAAA;AAAA,EACV,SAAA,EAAW,wBAAA;AAAA,EACX,KAAA,EAAO,oBAAA;AAAA,EACP,eAAA,EAAiB,+BAAA;AAAA,EACjB,aAAA,EAAe,6BAAA;AAAA,EACf,UAAA,EAAY,yBAAA;AAAA,EACZ,OAAA,EAAS;AACX;AAEO,IAAM,WAAA,GAAc","file":"index.js","sourcesContent":["{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://rpp402.com/schemas/v1/asset-ref.json\",\n \"title\": \"RPP402 Asset Reference\",\n \"type\": \"object\",\n \"required\": [\"type\", \"symbol\", \"chain_id\", \"contract\"],\n \"properties\": {\n \"type\": { \"type\": \"string\", \"enum\": [\"stablecoin\", \"tokenized_security\"] },\n \"symbol\": { \"type\": \"string\" },\n \"chain_id\": { \"type\": \"string\" },\n \"contract\": { \"type\": \"string\", \"pattern\": \"^0x[a-fA-F0-9]{40}$\" },\n \"issuer\": { \"type\": \"string\" }\n },\n \"if\": { \"properties\": { \"type\": { \"const\": \"tokenized_security\" } } },\n \"then\": { \"required\": [\"issuer\"] }\n}\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://rpp402.com/schemas/v1/commerce-session.json\",\n \"title\": \"RPP402 Commerce Session\",\n \"type\": \"object\",\n \"required\": [\"rpp402_version\", \"id\", \"agent_wallet\", \"status\", \"legs\", \"created_at\", \"expires_at\"],\n \"properties\": {\n \"rpp402_version\": { \"type\": \"string\", \"const\": \"1.0\" },\n \"id\": { \"type\": \"string\", \"pattern\": \"^sess_[a-zA-Z0-9]{8,}$\" },\n \"agent_wallet\": { \"type\": \"string\", \"pattern\": \"^0x[a-fA-F0-9]{40}$\" },\n \"status\": {\n \"type\": \"string\",\n \"enum\": [\"created\", \"quoting\", \"intent_authorized\", \"settling\", \"settled\", \"receipt_issued\", \"expired\", \"cancelled\", \"failed\"]\n },\n \"legs\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"quote_id\", \"service_id\", \"capability\", \"price\"],\n \"properties\": {\n \"quote_id\": { \"type\": \"string\", \"pattern\": \"^quote_[a-zA-Z0-9]{8,}$\" },\n \"service_id\": { \"type\": \"string\", \"pattern\": \"^svc_[a-zA-Z0-9]{8,}$\" },\n \"capability\": { \"type\": \"string\" },\n \"price\": {\n \"type\": \"object\",\n \"required\": [\"asset\", \"amount\"],\n \"properties\": {\n \"asset\": { \"$ref\": \"https://rpp402.com/schemas/v1/asset-ref.json\" },\n \"amount\": { \"type\": \"string\", \"pattern\": \"^[0-9]+(\\\\.[0-9]+)?$\" }\n }\n }\n }\n }\n },\n \"intent_id\": { \"type\": [\"string\", \"null\"] },\n \"settlement_id\": { \"type\": [\"string\", \"null\"] },\n \"receipt_id\": { \"type\": [\"string\", \"null\"] },\n \"created_at\": { \"type\": \"string\", \"format\": \"date-time\" },\n \"expires_at\": { \"type\": \"string\", \"format\": \"date-time\" }\n }\n}\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://rpp402.com/schemas/v1/discovery.json\",\n \"title\": \"RPP402 Discovery Document\",\n \"type\": \"object\",\n \"required\": [\"rpp402_version\", \"service\", \"wallet\", \"capabilities\", \"supported_assets\", \"endpoints\"],\n \"properties\": {\n \"rpp402_version\": { \"type\": \"string\", \"const\": \"1.0\" },\n \"service\": {\n \"type\": \"object\",\n \"required\": [\"id\", \"name\", \"description\"],\n \"properties\": {\n \"id\": { \"type\": \"string\", \"pattern\": \"^svc_[a-zA-Z0-9]{8,}$\" },\n \"name\": { \"type\": \"string\", \"minLength\": 1 },\n \"description\": { \"type\": \"string\", \"minLength\": 1 }\n }\n },\n \"wallet\": {\n \"type\": \"object\",\n \"required\": [\"address\", \"chain_id\"],\n \"properties\": {\n \"address\": { \"type\": \"string\", \"pattern\": \"^0x[a-fA-F0-9]{40}$\" },\n \"chain_id\": { \"type\": \"string\" }\n }\n },\n \"capabilities\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"name\", \"description\"],\n \"properties\": {\n \"name\": { \"type\": \"string\", \"pattern\": \"^[a-z0-9-]+\\\\.[a-z0-9-]+$\" },\n \"description\": { \"type\": \"string\" },\n \"pricing_summary\": { \"type\": \"string\" }\n }\n }\n },\n \"supported_assets\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": { \"$ref\": \"https://rpp402.com/schemas/v1/asset-ref.json\" }\n },\n \"endpoints\": {\n \"type\": \"object\",\n \"required\": [\"quote\", \"session\", \"receipts\"],\n \"properties\": {\n \"quote\": { \"type\": \"string\", \"format\": \"uri\" },\n \"session\": { \"type\": \"string\", \"format\": \"uri\" },\n \"receipts\": { \"type\": \"string\", \"format\": \"uri\" }\n }\n }\n }\n}\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://rpp402.com/schemas/v1/payment-intent.json\",\n \"title\": \"RPP402 Payment Intent\",\n \"type\": \"object\",\n \"required\": [\"rpp402_version\", \"id\", \"session_id\", \"payer_wallet\", \"asset\", \"amount\", \"status\", \"authorization\", \"created_at\", \"expires_at\"],\n \"properties\": {\n \"rpp402_version\": { \"type\": \"string\", \"const\": \"1.0\" },\n \"id\": { \"type\": \"string\", \"pattern\": \"^intent_[a-zA-Z0-9]{8,}$\" },\n \"session_id\": { \"type\": \"string\", \"pattern\": \"^sess_[a-zA-Z0-9]{8,}$\" },\n \"payer_wallet\": { \"type\": \"string\", \"pattern\": \"^0x[a-fA-F0-9]{40}$\" },\n \"asset\": { \"$ref\": \"https://rpp402.com/schemas/v1/asset-ref.json\" },\n \"amount_mode\": { \"type\": [\"string\", \"null\"], \"enum\": [\"fixed_quantity\", \"notional_usd\", null] },\n \"amount\": { \"type\": \"string\", \"pattern\": \"^[0-9]+(\\\\.[0-9]+)?$\" },\n \"status\": { \"type\": \"string\", \"enum\": [\"pending\", \"authorized\", \"revoked\", \"expired\"] },\n \"authorization\": {\n \"oneOf\": [\n {\n \"type\": \"object\",\n \"required\": [\"type\", \"signer\", \"signature\", \"nonce\"],\n \"properties\": {\n \"type\": { \"const\": \"eip712_signature\" },\n \"signer\": { \"type\": \"string\", \"pattern\": \"^0x[a-fA-F0-9]{40}$\" },\n \"signature\": { \"type\": \"string\", \"pattern\": \"^0x[a-fA-F0-9]+$\" },\n \"nonce\": { \"type\": \"string\" }\n }\n },\n {\n \"type\": \"object\",\n \"required\": [\"type\", \"account_id\", \"delegation_ref\"],\n \"properties\": {\n \"type\": { \"const\": \"agentic_account_delegation\" },\n \"account_id\": { \"type\": \"string\", \"pattern\": \"^aa_[a-zA-Z0-9]{4,}$\" },\n \"delegation_ref\": { \"type\": \"string\", \"pattern\": \"^del_[a-zA-Z0-9]{4,}$\" },\n \"risk_check\": { \"type\": \"string\" }\n }\n }\n ]\n },\n \"created_at\": { \"type\": \"string\", \"format\": \"date-time\" },\n \"expires_at\": { \"type\": \"string\", \"format\": \"date-time\" }\n },\n \"if\": { \"properties\": { \"asset\": { \"properties\": { \"type\": { \"const\": \"tokenized_security\" } } } } },\n \"then\": { \"required\": [\"amount_mode\"] }\n}\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://rpp402.com/schemas/v1/quote.json\",\n \"title\": \"RPP402 Quote\",\n \"type\": \"object\",\n \"required\": [\"rpp402_version\", \"id\", \"service_id\", \"capability\", \"price\", \"expires_at\", \"created_at\"],\n \"properties\": {\n \"rpp402_version\": { \"type\": \"string\", \"const\": \"1.0\" },\n \"id\": { \"type\": \"string\", \"pattern\": \"^quote_[a-zA-Z0-9]{8,}$\" },\n \"service_id\": { \"type\": \"string\", \"pattern\": \"^svc_[a-zA-Z0-9]{8,}$\" },\n \"capability\": { \"type\": \"string\", \"pattern\": \"^[a-z0-9-]+\\\\.[a-z0-9-]+$\" },\n \"price\": {\n \"type\": \"object\",\n \"required\": [\"asset\", \"amount\"],\n \"properties\": {\n \"asset\": { \"$ref\": \"https://rpp402.com/schemas/v1/asset-ref.json\" },\n \"amount\": { \"type\": \"string\", \"pattern\": \"^[0-9]+(\\\\.[0-9]+)?$\" }\n }\n },\n \"expires_at\": { \"type\": \"string\", \"format\": \"date-time\" },\n \"created_at\": { \"type\": \"string\", \"format\": \"date-time\" }\n }\n}\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://rpp402.com/schemas/v1/receipt.json\",\n \"title\": \"RPP402 Receipt\",\n \"type\": \"object\",\n \"required\": [\"rpp402_version\", \"id\", \"session_id\", \"settlement_id\", \"payer_wallet\", \"line_items\", \"total\", \"settlement_ref\", \"signature\", \"issued_at\"],\n \"properties\": {\n \"rpp402_version\": { \"type\": \"string\", \"const\": \"1.0\" },\n \"id\": { \"type\": \"string\", \"pattern\": \"^rcpt_[a-zA-Z0-9]{8,}$\" },\n \"session_id\": { \"type\": \"string\", \"pattern\": \"^sess_[a-zA-Z0-9]{8,}$\" },\n \"settlement_id\": { \"type\": \"string\", \"pattern\": \"^settle_[a-zA-Z0-9]{8,}$\" },\n \"payer_wallet\": { \"type\": \"string\", \"pattern\": \"^0x[a-fA-F0-9]{40}$\" },\n \"line_items\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"service_id\", \"capability\", \"quote_id\", \"amount\"],\n \"properties\": {\n \"service_id\": { \"type\": \"string\" },\n \"capability\": { \"type\": \"string\" },\n \"quote_id\": { \"type\": \"string\" },\n \"amount\": {\n \"type\": \"object\",\n \"required\": [\"asset\", \"amount\"],\n \"properties\": {\n \"asset\": { \"$ref\": \"https://rpp402.com/schemas/v1/asset-ref.json\" },\n \"amount\": { \"type\": \"string\" }\n }\n }\n }\n }\n },\n \"total\": {\n \"type\": \"object\",\n \"required\": [\"asset\", \"amount\"],\n \"properties\": {\n \"asset\": { \"$ref\": \"https://rpp402.com/schemas/v1/asset-ref.json\" },\n \"amount\": { \"type\": \"string\" }\n }\n },\n \"settlement_ref\": {\n \"type\": \"object\",\n \"required\": [\"chain_id\", \"tx_hash\", \"block_number\"],\n \"properties\": {\n \"chain_id\": { \"type\": \"string\" },\n \"tx_hash\": { \"type\": \"string\", \"pattern\": \"^0x[a-fA-F0-9]{64}$\" },\n \"block_number\": { \"type\": \"integer\" }\n }\n },\n \"signature\": {\n \"type\": \"object\",\n \"required\": [\"algorithm\", \"signer\", \"signature\"],\n \"properties\": {\n \"algorithm\": { \"const\": \"eip712\" },\n \"signer\": { \"type\": \"string\", \"pattern\": \"^0x[a-fA-F0-9]{40}$\" },\n \"signature\": { \"type\": \"string\", \"pattern\": \"^0x[a-fA-F0-9]+$\" }\n }\n },\n \"issued_at\": { \"type\": \"string\", \"format\": \"date-time\" }\n }\n}\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://rpp402.com/schemas/v1/settlement.json\",\n \"title\": \"RPP402 Settlement\",\n \"type\": \"object\",\n \"required\": [\"rpp402_version\", \"id\", \"intent_id\", \"session_id\", \"chain_id\", \"status\", \"transfers\", \"created_at\"],\n \"properties\": {\n \"rpp402_version\": { \"type\": \"string\", \"const\": \"1.0\" },\n \"id\": { \"type\": \"string\", \"pattern\": \"^settle_[a-zA-Z0-9]{8,}$\" },\n \"intent_id\": { \"type\": \"string\", \"pattern\": \"^intent_[a-zA-Z0-9]{8,}$\" },\n \"session_id\": { \"type\": \"string\", \"pattern\": \"^sess_[a-zA-Z0-9]{8,}$\" },\n \"chain_id\": { \"type\": \"string\" },\n \"tx_hash\": { \"type\": [\"string\", \"null\"], \"pattern\": \"^0x[a-fA-F0-9]{64}$\" },\n \"block_number\": { \"type\": [\"integer\", \"null\"] },\n \"status\": { \"type\": \"string\", \"enum\": [\"pending\", \"submitted\", \"confirmed\", \"failed\"] },\n \"transfers\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"from\", \"to\", \"asset\", \"amount\"],\n \"properties\": {\n \"from\": { \"type\": \"string\", \"pattern\": \"^0x[a-fA-F0-9]{40}$\" },\n \"to\": { \"type\": \"string\", \"pattern\": \"^0x[a-fA-F0-9]{40}$\" },\n \"asset\": { \"$ref\": \"https://rpp402.com/schemas/v1/asset-ref.json\" },\n \"amount\": { \"type\": \"string\", \"pattern\": \"^[0-9]+(\\\\.[0-9]+)?$\" }\n }\n }\n },\n \"reference_price\": {\n \"type\": [\"object\", \"null\"],\n \"properties\": {\n \"oracle\": { \"type\": \"string\" },\n \"symbol\": { \"type\": \"string\" },\n \"price_usd\": { \"type\": \"string\" },\n \"sourced_at\": { \"type\": \"string\", \"format\": \"date-time\" }\n }\n },\n \"created_at\": { \"type\": \"string\", \"format\": \"date-time\" },\n \"confirmed_at\": { \"type\": [\"string\", \"null\"], \"format\": \"date-time\" }\n }\n}\n","// Source of truth for the six RPP402 v1 primitives -see docs/specs/RPP402-000\n// through RPP402-006. Types are hand-maintained against the JSON Schemas\n// below; @rpp402/sdk (Phase 5) and @rpp402/cli (Phase 10) both build on this\n// package rather than restating the wire format themselves.\n\nimport assetRefSchema from \"./schemas/asset-ref.schema.json\" with { type: \"json\" };\nimport commerceSessionSchema from \"./schemas/commerce-session.schema.json\" with { type: \"json\" };\nimport discoverySchema from \"./schemas/discovery.schema.json\" with { type: \"json\" };\nimport paymentIntentSchema from \"./schemas/payment-intent.schema.json\" with { type: \"json\" };\nimport quoteSchema from \"./schemas/quote.schema.json\" with { type: \"json\" };\nimport receiptSchema from \"./schemas/receipt.schema.json\" with { type: \"json\" };\nimport settlementSchema from \"./schemas/settlement.schema.json\" with { type: \"json\" };\n\nexport * from \"./types\";\n\nexport const schemas = {\n assetRef: assetRefSchema,\n discovery: discoverySchema,\n quote: quoteSchema,\n commerceSession: commerceSessionSchema,\n paymentIntent: paymentIntentSchema,\n settlement: settlementSchema,\n receipt: receiptSchema,\n} as const;\n\nexport const RPP_VERSION = \"1.0\" as const;\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rpp402/protocol",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "RPP402 protocol source of truth: JSON Schemas and TypeScript types for the six v1 primitives (Discovery, Quote, Commerce Session, Payment Intent, Settlement, Receipt).",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "RPP402",
|
|
7
|
+
"homepage": "https://rpp402.com",
|
|
8
|
+
"bugs": "https://rpp402.com",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"rpp402",
|
|
11
|
+
"robinhood payments protocol",
|
|
12
|
+
"json schema",
|
|
13
|
+
"protocol",
|
|
14
|
+
"types"
|
|
15
|
+
],
|
|
16
|
+
"type": "module",
|
|
17
|
+
"sideEffects": false,
|
|
18
|
+
"main": "./dist/index.cjs",
|
|
19
|
+
"module": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"import": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"default": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"require": {
|
|
28
|
+
"types": "./dist/index.d.cts",
|
|
29
|
+
"default": "./dist/index.cjs"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"./package.json": "./package.json"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"README.md",
|
|
37
|
+
"LICENSE"
|
|
38
|
+
],
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=18"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "tsup",
|
|
47
|
+
"prepublishOnly": "tsup",
|
|
48
|
+
"typecheck": "tsc --noEmit"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@rpp402/config": "^0.1.0",
|
|
52
|
+
"tsup": "^8.5.1",
|
|
53
|
+
"typescript": "5.9.3"
|
|
54
|
+
}
|
|
55
|
+
}
|