@aibtc/tx-schemas 0.2.1 → 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/README.md
CHANGED
|
@@ -70,6 +70,9 @@ const settleRequest = HttpSettleRequestSchema.parse({
|
|
|
70
70
|
- The default protected-resource delivery invariant is `deliver-only-on-confirmed`.
|
|
71
71
|
- Any product that delivers on in-flight states should document that as an application exception, not a canonical package rule.
|
|
72
72
|
- `paymentId` is relay-owned and duplicate submission should reuse the same `paymentId` until terminal resolution.
|
|
73
|
+
- Accepted duplicate submit responses should return the current caller-facing in-flight status for that `paymentId`: `queued`, `broadcasting`, or `mempool` as applicable.
|
|
74
|
+
- `queued_with_warning` remains an RPC-only temporary compatibility shim for warning-aware callers during migration.
|
|
75
|
+
- Polling contracts may surface `checkStatusUrl` as an additive convenience field, and internal/external polling should treat it as another way to reach the same `paymentId` lifecycle.
|
|
73
76
|
- Terminal polling responses should carry a normalized `terminalReason` when one is known, even if transports also emit local error codes.
|
|
74
77
|
|
|
75
78
|
More detail lives in [docs/package-schemas.md](docs/package-schemas.md),
|
package/dist/rpc/schemas.d.ts
CHANGED
|
@@ -71,7 +71,11 @@ export declare const RpcSubmitPaymentRequestSchema: z.ZodObject<{
|
|
|
71
71
|
export declare const RpcSubmitPaymentAcceptedSchema: z.ZodObject<{
|
|
72
72
|
accepted: z.ZodLiteral<true>;
|
|
73
73
|
paymentId: z.ZodString;
|
|
74
|
-
status: z.ZodUnion<readonly [z.
|
|
74
|
+
status: z.ZodUnion<readonly [z.ZodEnum<{
|
|
75
|
+
queued: "queued";
|
|
76
|
+
broadcasting: "broadcasting";
|
|
77
|
+
mempool: "mempool";
|
|
78
|
+
}>, z.ZodLiteral<"queued_with_warning">]>;
|
|
75
79
|
senderNonce: z.ZodOptional<z.ZodObject<{
|
|
76
80
|
provided: z.ZodNumber;
|
|
77
81
|
expected: z.ZodNumber;
|
|
@@ -125,7 +129,11 @@ export declare const RpcSubmitPaymentRejectedSchema: z.ZodObject<{
|
|
|
125
129
|
export declare const RpcSubmitPaymentResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
126
130
|
accepted: z.ZodLiteral<true>;
|
|
127
131
|
paymentId: z.ZodString;
|
|
128
|
-
status: z.ZodUnion<readonly [z.
|
|
132
|
+
status: z.ZodUnion<readonly [z.ZodEnum<{
|
|
133
|
+
queued: "queued";
|
|
134
|
+
broadcasting: "broadcasting";
|
|
135
|
+
mempool: "mempool";
|
|
136
|
+
}>, z.ZodLiteral<"queued_with_warning">]>;
|
|
129
137
|
senderNonce: z.ZodOptional<z.ZodObject<{
|
|
130
138
|
provided: z.ZodNumber;
|
|
131
139
|
expected: z.ZodNumber;
|
|
@@ -235,6 +243,7 @@ export declare const RpcCheckPaymentResultSchema: z.ZodObject<{
|
|
|
235
243
|
healthy: z.ZodBoolean;
|
|
236
244
|
warning: z.ZodOptional<z.ZodString>;
|
|
237
245
|
}, z.core.$strip>>;
|
|
246
|
+
checkStatusUrl: z.ZodOptional<z.ZodString>;
|
|
238
247
|
}, z.core.$strip>;
|
|
239
248
|
export type RpcSubmitPaymentRequest = z.infer<typeof RpcSubmitPaymentRequestSchema>;
|
|
240
249
|
export type RpcSubmitPaymentResult = z.infer<typeof RpcSubmitPaymentResultSchema>;
|
|
@@ -243,7 +252,11 @@ export type RpcCheckPaymentResult = z.infer<typeof RpcCheckPaymentResultSchema>;
|
|
|
243
252
|
export declare const SubmitPaymentRpcResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
244
253
|
accepted: z.ZodLiteral<true>;
|
|
245
254
|
paymentId: z.ZodString;
|
|
246
|
-
status: z.ZodUnion<readonly [z.
|
|
255
|
+
status: z.ZodUnion<readonly [z.ZodEnum<{
|
|
256
|
+
queued: "queued";
|
|
257
|
+
broadcasting: "broadcasting";
|
|
258
|
+
mempool: "mempool";
|
|
259
|
+
}>, z.ZodLiteral<"queued_with_warning">]>;
|
|
247
260
|
senderNonce: z.ZodOptional<z.ZodObject<{
|
|
248
261
|
provided: z.ZodNumber;
|
|
249
262
|
expected: z.ZodNumber;
|
|
@@ -350,5 +363,6 @@ export declare const CheckPaymentRpcResponseSchema: z.ZodObject<{
|
|
|
350
363
|
healthy: z.ZodBoolean;
|
|
351
364
|
warning: z.ZodOptional<z.ZodString>;
|
|
352
365
|
}, z.core.$strip>>;
|
|
366
|
+
checkStatusUrl: z.ZodOptional<z.ZodString>;
|
|
353
367
|
}, z.core.$strip>;
|
|
354
368
|
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/rpc/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,eAAe,oWAiBlB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;EAA0B,CAAC;AAE1D,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;iBAQjC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;iBAKnC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;iBAUxC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;iBAGxC,CAAC;AAEH,eAAO,MAAM,8BAA8B
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/rpc/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,eAAe,oWAiBlB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;EAA0B,CAAC;AAE1D,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;iBAQjC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;iBAKnC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;iBAUxC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;iBAGxC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;iBAOzC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQzC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAGvC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;iBAEvC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAatC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACpF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAA+B,CAAC;AAC3E,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA8B,CAAC"}
|
package/dist/rpc/schemas.js
CHANGED
|
@@ -54,7 +54,7 @@ export const RpcSubmitPaymentRequestSchema = z.object({
|
|
|
54
54
|
export const RpcSubmitPaymentAcceptedSchema = z.object({
|
|
55
55
|
accepted: z.literal(true),
|
|
56
56
|
paymentId: PaymentIdSchema,
|
|
57
|
-
status: z.union([
|
|
57
|
+
status: z.union([InFlightPaymentStateSchema, z.literal("queued_with_warning")]),
|
|
58
58
|
senderNonce: RpcSenderNonceInfoSchema.optional(),
|
|
59
59
|
warning: RpcSubmitPaymentWarningSchema.optional(),
|
|
60
60
|
checkStatusUrl: UrlSchema.optional(),
|
|
@@ -87,6 +87,7 @@ export const RpcCheckPaymentResultSchema = z.object({
|
|
|
87
87
|
errorCode: RpcErrorCodeSchema.optional(),
|
|
88
88
|
retryable: z.boolean().optional(),
|
|
89
89
|
senderNonceInfo: RpcSenderNonceInfoSchema.optional(),
|
|
90
|
+
checkStatusUrl: UrlSchema.optional(),
|
|
90
91
|
});
|
|
91
92
|
export const SubmitPaymentRpcResponseSchema = RpcSubmitPaymentResultSchema;
|
|
92
93
|
export const CheckPaymentRpcResponseSchema = RpcCheckPaymentResultSchema;
|
package/dist/rpc/schemas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/rpc/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,SAAS,GACV,MAAM,uBAAuB,CAAC;AAE/B,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,qBAAqB;IACrB,eAAe;IACf,oBAAoB;IACpB,wBAAwB;IACxB,kBAAkB;IAClB,gBAAgB;IAChB,qBAAqB;IACrB,yBAAyB;IACzB,kBAAkB;IAClB,oBAAoB;IACpB,mBAAmB;IACnB,gBAAgB;IAChB,oBAAoB;IACpB,uBAAuB;IACvB,kBAAkB;IAClB,mBAAmB;CACX,CAAC;AAEX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EAAE;IAC3E,8BAA8B;IAC9B,8BAA8B;CAC/B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,SAAS,EAAE,eAAe;CAC3B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,SAAS,EAAE,eAAe;IAC1B,MAAM,EAAE,yBAAyB;IACjC,IAAI,EAAE,mBAAmB,CAAC,QAAQ,EAAE;IACpC,WAAW,EAAE,wBAAwB,CAAC,QAAQ,EAAE;IAChD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC7D,WAAW,EAAE,SAAS,CAAC,QAAQ,EAAE;IACjC,cAAc,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IAC/C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACnC,SAAS,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IACxC,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACjC,eAAe,EAAE,wBAAwB,CAAC,QAAQ,EAAE;IACpD,cAAc,EAAE,SAAS,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC;AAOH,MAAM,CAAC,MAAM,8BAA8B,GAAG,4BAA4B,CAAC;AAC3E,MAAM,CAAC,MAAM,6BAA6B,GAAG,2BAA2B,CAAC"}
|
|
@@ -24,6 +24,7 @@ Notes:
|
|
|
24
24
|
|
|
25
25
|
- `paymentId` is relay-owned.
|
|
26
26
|
- Duplicate submission of the same already-known payment artifact should reuse the same `paymentId` until that payment reaches a terminal state.
|
|
27
|
+
- Accepted duplicate submit responses should return the current caller-facing in-flight status for that reused `paymentId`: `queued`, `broadcasting`, or `mempool` as applicable.
|
|
27
28
|
- Internal and external polling should both treat `paymentId` as the stable handle for in-flight and terminal lookup.
|
|
28
29
|
|
|
29
30
|
## Terminal Outcome Contract
|
|
@@ -32,6 +33,7 @@ Polling and status responses should expose:
|
|
|
32
33
|
|
|
33
34
|
- canonical `status`
|
|
34
35
|
- relay-owned `paymentId`
|
|
36
|
+
- `checkStatusUrl` when the transport knows the canonical poll endpoint
|
|
35
37
|
- normalized `terminalReason` when the outcome is terminal and known
|
|
36
38
|
- transport-local `errorCode` only as an adapter detail, not as the semantic source of truth
|
|
37
39
|
|
|
@@ -54,8 +56,10 @@ Relay-owned responsibilities:
|
|
|
54
56
|
|
|
55
57
|
## Compatibility Notes
|
|
56
58
|
|
|
57
|
-
- `RpcSubmitPaymentAccepted.status` should return `queued` for
|
|
59
|
+
- `RpcSubmitPaymentAccepted.status` should return canonical caller-facing in-flight states: `queued` for fresh acceptance, and `queued`, `broadcasting`, or `mempool` when duplicate reuse surfaces the active state of the reused `paymentId`.
|
|
60
|
+
- `queued_with_warning` remains allowed only as a temporary compatibility shim while warning-aware callers migrate.
|
|
58
61
|
- `RpcCheckPaymentResult.status` and `HttpPaymentStatusResponse.status` must never return `submitted`.
|
|
62
|
+
- `RpcCheckPaymentResult` and `HttpPaymentStatusResponse` may both surface `checkStatusUrl` as an additive canonical poll hint.
|
|
59
63
|
- `terminalReason` is additive and should be emitted wherever relay adapters already know the normalized terminal classification.
|
|
60
64
|
|
|
61
65
|
## Migration Order
|
|
@@ -70,7 +74,7 @@ Relay-owned responsibilities:
|
|
|
70
74
|
| Scenario | Canonical status | terminalReason | Service delivery default | Client action |
|
|
71
75
|
| --- | --- | --- | --- | --- |
|
|
72
76
|
| Fresh submission accepted | `queued` | | wait or poll by `paymentId` | no rebuild |
|
|
73
|
-
| Duplicate same submission | `queued` or
|
|
77
|
+
| Duplicate same submission | `queued`, `broadcasting`, or `mempool` | | do not create a second receipt | reuse same `paymentId` / same tx |
|
|
74
78
|
| Relay broadcasting | `broadcasting` | | do not deliver by default | poll |
|
|
75
79
|
| Seen in mempool | `mempool` | | do not deliver by default unless route exception is documented | poll |
|
|
76
80
|
| Confirmed on-chain | `confirmed` | | deliver | success |
|
package/docs/package-schemas.md
CHANGED
|
@@ -46,6 +46,9 @@ The approval spec establishes these package-level semantics:
|
|
|
46
46
|
- `failed`, `replaced`, and `not_found` are terminal-failure states.
|
|
47
47
|
- resource delivery during in-flight states is transport/product policy, not a new domain state
|
|
48
48
|
- duplicate submission should reuse the same relay-owned `paymentId` until that payment reaches a terminal state
|
|
49
|
+
- accepted duplicate submit responses should return the current caller-facing in-flight status for that `paymentId`: `queued`, `broadcasting`, or `mempool`
|
|
50
|
+
- `queued_with_warning` remains an RPC-only temporary compatibility shim while warning-aware callers migrate
|
|
51
|
+
- polling/status adapters may expose `checkStatusUrl` as an additive canonical poll hint for that same `paymentId`
|
|
49
52
|
- polling/status adapters should emit canonical `terminalReason` values when they know the terminal outcome
|
|
50
53
|
|
|
51
54
|
## Documented Assumptions
|
package/package.json
CHANGED