@avow-finance/spec 0.7.0 → 0.8.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 (83) hide show
  1. package/dist/agent-session.d.ts +8 -0
  2. package/dist/agent-session.d.ts.map +1 -1
  3. package/dist/api.d.ts +24 -0
  4. package/dist/api.d.ts.map +1 -1
  5. package/dist/dependencies.d.ts.map +1 -1
  6. package/dist/dependencies.js +8 -2
  7. package/dist/dependencies.js.map +1 -1
  8. package/dist/eip712.d.ts +212 -1
  9. package/dist/eip712.d.ts.map +1 -1
  10. package/dist/eip712.js +34 -0
  11. package/dist/eip712.js.map +1 -1
  12. package/dist/gpu-reservation.d.ts.map +1 -1
  13. package/dist/gpu-reservation.js +1 -1
  14. package/dist/gpu-reservation.js.map +1 -1
  15. package/dist/index.d.ts +4 -0
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +4 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/job-session.d.ts +16 -0
  20. package/dist/job-session.d.ts.map +1 -1
  21. package/dist/job.d.ts.map +1 -1
  22. package/dist/job.js +1 -1
  23. package/dist/job.js.map +1 -1
  24. package/dist/json-fields.d.ts +2 -0
  25. package/dist/json-fields.d.ts.map +1 -1
  26. package/dist/json-fields.js +2 -0
  27. package/dist/json-fields.js.map +1 -1
  28. package/dist/mailbox.d.ts +77 -104
  29. package/dist/mailbox.d.ts.map +1 -1
  30. package/dist/mailbox.js +8 -30
  31. package/dist/mailbox.js.map +1 -1
  32. package/dist/negotiation.d.ts +514 -0
  33. package/dist/negotiation.d.ts.map +1 -0
  34. package/dist/negotiation.js +490 -0
  35. package/dist/negotiation.js.map +1 -0
  36. package/dist/offer-search.d.ts +282 -0
  37. package/dist/offer-search.d.ts.map +1 -0
  38. package/dist/offer-search.js +252 -0
  39. package/dist/offer-search.js.map +1 -0
  40. package/dist/order-wire.d.ts +73 -0
  41. package/dist/order-wire.d.ts.map +1 -0
  42. package/dist/order-wire.js +33 -0
  43. package/dist/order-wire.js.map +1 -0
  44. package/dist/reasons.d.ts +10 -2
  45. package/dist/reasons.d.ts.map +1 -1
  46. package/dist/reasons.js +10 -2
  47. package/dist/reasons.js.map +1 -1
  48. package/dist/sandbox.d.ts +81 -0
  49. package/dist/sandbox.d.ts.map +1 -1
  50. package/dist/sandbox.js +18 -0
  51. package/dist/sandbox.js.map +1 -1
  52. package/dist/service-order.d.ts +747 -0
  53. package/dist/service-order.d.ts.map +1 -0
  54. package/dist/service-order.js +182 -0
  55. package/dist/service-order.js.map +1 -0
  56. package/dist/service.d.ts +248 -0
  57. package/dist/service.d.ts.map +1 -0
  58. package/dist/service.js +379 -0
  59. package/dist/service.js.map +1 -0
  60. package/dist/session-fields.d.ts +8 -0
  61. package/dist/session-fields.d.ts.map +1 -1
  62. package/dist/terms.d.ts.map +1 -1
  63. package/dist/terms.js +4 -0
  64. package/dist/terms.js.map +1 -1
  65. package/dist/test-customer.d.ts +16 -0
  66. package/dist/test-customer.d.ts.map +1 -1
  67. package/dist/text.d.ts +5 -0
  68. package/dist/text.d.ts.map +1 -0
  69. package/dist/text.js +5 -0
  70. package/dist/text.js.map +1 -0
  71. package/dist/types.d.ts +7 -4
  72. package/dist/types.d.ts.map +1 -1
  73. package/dist/types.js +6 -3
  74. package/dist/types.js.map +1 -1
  75. package/dist/version.d.ts +1 -0
  76. package/dist/version.d.ts.map +1 -1
  77. package/dist/version.js +2 -0
  78. package/dist/version.js.map +1 -1
  79. package/dist/wire.d.ts +312 -0
  80. package/dist/wire.d.ts.map +1 -1
  81. package/dist/wire.js +28 -1
  82. package/dist/wire.js.map +1 -1
  83. package/package.json +1 -1
package/dist/mailbox.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { Hex } from 'viem';
2
2
  import { z } from 'zod';
3
3
  import type { JobTerms } from './job.js';
4
+ import { type MailboxReserve, type OrderStage } from './order-wire.js';
4
5
  import { type JobRequirement, type QuoteRequest } from './test-customer.js';
5
6
  /**
6
7
  * Avow's sandbox mailbox, which carries a job between two businesses' agents wherever each one
@@ -46,40 +47,12 @@ export interface MailboxOrderRequest {
46
47
  }
47
48
  export declare const MAILBOX_STATUSES: readonly ['requested', 'quoted', 'expired', 'reserved', 'accepted'];
48
49
  export type MailboxStatus = (typeof MAILBOX_STATUSES)[number];
49
- /**
50
- * The reserve the buyer funded, as Avow read it from the buyer's lock. Avow reads the lock itself,
51
- * so the transaction is there only when the agent saw it land, and null after a restart.
52
- */
53
- export interface MailboxReserve {
54
- fundedIn: Hex | null;
55
- amount: bigint;
56
- /** The lock's deadline for the supplier to accept, after which the reserve goes back. */
57
- acceptBy: bigint;
58
- }
59
50
  interface MailboxOrderBase extends MailboxOrderRequest {
60
51
  buyer: JobBuyer;
61
52
  requestedAt: bigint;
62
53
  }
63
54
  /** An order as the mailbox answers it, to either side or to either business's console. */
64
- export type MailboxOrder = (MailboxOrderBase & {
65
- status: 'requested';
66
- }) | (MailboxOrderBase & {
67
- status: 'expired';
68
- quote: QuoteRequest | null;
69
- }) | (MailboxOrderBase & {
70
- status: 'quoted';
71
- quote: QuoteRequest;
72
- }) | (MailboxOrderBase & {
73
- status: 'reserved';
74
- quote: QuoteRequest;
75
- reserve: MailboxReserve;
76
- }) | (MailboxOrderBase & {
77
- status: 'accepted';
78
- quote: QuoteRequest;
79
- reserve: MailboxReserve;
80
- /** The acceptance's transaction when the supplier's agent saw it land, or null. */
81
- acceptedIn: Hex | null;
82
- });
55
+ export type MailboxOrder = MailboxOrderBase & OrderStage<QuoteRequest>;
83
56
  export declare const jobBuyerJson: z.ZodObject<{
84
57
  businessId: z.ZodString;
85
58
  account: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
@@ -152,78 +125,7 @@ export declare const mailboxOrderRequestJson: z.ZodObject<{
152
125
  expiry: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
153
126
  }, z.core.$strict>;
154
127
  export declare const mailboxOrderJson: z.ZodDiscriminatedUnion<[z.ZodObject<{
155
- orderId: z.ZodString;
156
- commitmentId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
157
- supplierBusinessId: z.ZodString;
158
- terms: z.ZodObject<{
159
- version: z.ZodLiteral<2>;
160
- currency: z.ZodEnum<{
161
- USD: "USD";
162
- }>;
163
- amountDecimals: z.ZodLiteral<6>;
164
- template: z.ZodLiteral<"job/1">;
165
- subject: z.ZodObject<{
166
- work: z.ZodObject<{
167
- kind: z.ZodString;
168
- summary: z.ZodString;
169
- }, z.core.$strict>;
170
- compute: z.ZodObject<{
171
- gpu: z.ZodString;
172
- count: z.ZodNumber;
173
- region: z.ZodString;
174
- }, z.core.$strict>;
175
- startsAt: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
176
- deliverBy: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
177
- }, z.core.$strict>;
178
- consideration: z.ZodDiscriminatedUnion<[z.ZodObject<{
179
- kind: z.ZodLiteral<"rate">;
180
- amount: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
181
- unit: z.ZodString;
182
- }, z.core.$strict>, z.ZodObject<{
183
- kind: z.ZodLiteral<"fixed">;
184
- amount: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
185
- }, z.core.$strict>], "kind">;
186
- remedies: z.ZodObject<{
187
- acceptBy: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
188
- freeCancelBy: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
189
- charges: z.ZodArray<z.ZodObject<{
190
- kind: z.ZodEnum<{
191
- lateCancellation: "lateCancellation";
192
- noShow: "noShow";
193
- }>;
194
- amount: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
195
- earliest: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
196
- }, z.core.$strict>>;
197
- chargeDeadline: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
198
- }, z.core.$strict>;
199
- resolution: z.ZodObject<{
200
- contestWindow: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
201
- arbiter: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
202
- day90SupplierShareBps: z.ZodNumber;
203
- }, z.core.$strict>;
204
- backing: z.ZodDiscriminatedUnion<[z.ZodObject<{
205
- kind: z.ZodLiteral<"reserve">;
206
- side: z.ZodLiteral<"buyer">;
207
- amount: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
208
- releaseDate: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
209
- }, z.core.$strict>], "kind">;
210
- }, z.core.$strict>;
211
- requirement: z.ZodObject<{
212
- template: z.ZodLiteral<"gpu-reservation/1">;
213
- condition: z.ZodLiteral<"accepted">;
214
- disclosed: z.ZodLiteral<"subject">;
215
- }, z.core.$strict>;
216
- expiry: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
217
- buyer: z.ZodObject<{
218
- businessId: z.ZodString;
219
- account: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
220
- lock: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
221
- chainId: z.ZodNumber;
222
- mandateHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
223
- }, z.core.$strict>;
224
- requestedAt: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
225
128
  status: z.ZodLiteral<"requested">;
226
- }, z.core.$strict>, z.ZodObject<{
227
129
  orderId: z.ZodString;
228
130
  commitmentId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
229
131
  supplierBusinessId: z.ZodString;
@@ -294,6 +196,7 @@ export declare const mailboxOrderJson: z.ZodDiscriminatedUnion<[z.ZodObject<{
294
196
  mandateHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
295
197
  }, z.core.$strict>;
296
198
  requestedAt: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
199
+ }, z.core.$strict>, z.ZodObject<{
297
200
  status: z.ZodLiteral<"expired">;
298
201
  quote: z.ZodNullable<z.ZodObject<{
299
202
  terms: z.ZodUnion<readonly [z.ZodObject<{
@@ -569,7 +472,6 @@ export declare const mailboxOrderJson: z.ZodDiscriminatedUnion<[z.ZodObject<{
569
472
  supplierSignature: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
570
473
  disclosed: z.ZodArray<z.ZodUnknown>;
571
474
  }, z.core.$strict>>;
572
- }, z.core.$strict>, z.ZodObject<{
573
475
  orderId: z.ZodString;
574
476
  commitmentId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
575
477
  supplierBusinessId: z.ZodString;
@@ -640,6 +542,7 @@ export declare const mailboxOrderJson: z.ZodDiscriminatedUnion<[z.ZodObject<{
640
542
  mandateHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
641
543
  }, z.core.$strict>;
642
544
  requestedAt: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
545
+ }, z.core.$strict>, z.ZodObject<{
643
546
  status: z.ZodLiteral<"quoted">;
644
547
  quote: z.ZodObject<{
645
548
  terms: z.ZodUnion<readonly [z.ZodObject<{
@@ -915,7 +818,6 @@ export declare const mailboxOrderJson: z.ZodDiscriminatedUnion<[z.ZodObject<{
915
818
  supplierSignature: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
916
819
  disclosed: z.ZodArray<z.ZodUnknown>;
917
820
  }, z.core.$strict>;
918
- }, z.core.$strict>, z.ZodObject<{
919
821
  orderId: z.ZodString;
920
822
  commitmentId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
921
823
  supplierBusinessId: z.ZodString;
@@ -986,6 +888,7 @@ export declare const mailboxOrderJson: z.ZodDiscriminatedUnion<[z.ZodObject<{
986
888
  mandateHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
987
889
  }, z.core.$strict>;
988
890
  requestedAt: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
891
+ }, z.core.$strict>, z.ZodObject<{
989
892
  status: z.ZodLiteral<"reserved">;
990
893
  quote: z.ZodObject<{
991
894
  terms: z.ZodUnion<readonly [z.ZodObject<{
@@ -1266,7 +1169,6 @@ export declare const mailboxOrderJson: z.ZodDiscriminatedUnion<[z.ZodObject<{
1266
1169
  amount: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
1267
1170
  acceptBy: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
1268
1171
  }, z.core.$strict>;
1269
- }, z.core.$strict>, z.ZodObject<{
1270
1172
  orderId: z.ZodString;
1271
1173
  commitmentId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
1272
1174
  supplierBusinessId: z.ZodString;
@@ -1337,6 +1239,7 @@ export declare const mailboxOrderJson: z.ZodDiscriminatedUnion<[z.ZodObject<{
1337
1239
  mandateHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
1338
1240
  }, z.core.$strict>;
1339
1241
  requestedAt: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
1242
+ }, z.core.$strict>, z.ZodObject<{
1340
1243
  status: z.ZodLiteral<"accepted">;
1341
1244
  quote: z.ZodObject<{
1342
1245
  terms: z.ZodUnion<readonly [z.ZodObject<{
@@ -1618,6 +1521,76 @@ export declare const mailboxOrderJson: z.ZodDiscriminatedUnion<[z.ZodObject<{
1618
1521
  acceptBy: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
1619
1522
  }, z.core.$strict>;
1620
1523
  acceptedIn: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
1524
+ orderId: z.ZodString;
1525
+ commitmentId: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
1526
+ supplierBusinessId: z.ZodString;
1527
+ terms: z.ZodObject<{
1528
+ version: z.ZodLiteral<2>;
1529
+ currency: z.ZodEnum<{
1530
+ USD: "USD";
1531
+ }>;
1532
+ amountDecimals: z.ZodLiteral<6>;
1533
+ template: z.ZodLiteral<"job/1">;
1534
+ subject: z.ZodObject<{
1535
+ work: z.ZodObject<{
1536
+ kind: z.ZodString;
1537
+ summary: z.ZodString;
1538
+ }, z.core.$strict>;
1539
+ compute: z.ZodObject<{
1540
+ gpu: z.ZodString;
1541
+ count: z.ZodNumber;
1542
+ region: z.ZodString;
1543
+ }, z.core.$strict>;
1544
+ startsAt: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
1545
+ deliverBy: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
1546
+ }, z.core.$strict>;
1547
+ consideration: z.ZodDiscriminatedUnion<[z.ZodObject<{
1548
+ kind: z.ZodLiteral<"rate">;
1549
+ amount: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
1550
+ unit: z.ZodString;
1551
+ }, z.core.$strict>, z.ZodObject<{
1552
+ kind: z.ZodLiteral<"fixed">;
1553
+ amount: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
1554
+ }, z.core.$strict>], "kind">;
1555
+ remedies: z.ZodObject<{
1556
+ acceptBy: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
1557
+ freeCancelBy: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
1558
+ charges: z.ZodArray<z.ZodObject<{
1559
+ kind: z.ZodEnum<{
1560
+ lateCancellation: "lateCancellation";
1561
+ noShow: "noShow";
1562
+ }>;
1563
+ amount: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
1564
+ earliest: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
1565
+ }, z.core.$strict>>;
1566
+ chargeDeadline: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
1567
+ }, z.core.$strict>;
1568
+ resolution: z.ZodObject<{
1569
+ contestWindow: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
1570
+ arbiter: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
1571
+ day90SupplierShareBps: z.ZodNumber;
1572
+ }, z.core.$strict>;
1573
+ backing: z.ZodDiscriminatedUnion<[z.ZodObject<{
1574
+ kind: z.ZodLiteral<"reserve">;
1575
+ side: z.ZodLiteral<"buyer">;
1576
+ amount: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
1577
+ releaseDate: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
1578
+ }, z.core.$strict>], "kind">;
1579
+ }, z.core.$strict>;
1580
+ requirement: z.ZodObject<{
1581
+ template: z.ZodLiteral<"gpu-reservation/1">;
1582
+ condition: z.ZodLiteral<"accepted">;
1583
+ disclosed: z.ZodLiteral<"subject">;
1584
+ }, z.core.$strict>;
1585
+ expiry: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
1586
+ buyer: z.ZodObject<{
1587
+ businessId: z.ZodString;
1588
+ account: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
1589
+ lock: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
1590
+ chainId: z.ZodNumber;
1591
+ mandateHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
1592
+ }, z.core.$strict>;
1593
+ requestedAt: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
1621
1594
  }, z.core.$strict>], "status">;
1622
1595
  /** What the buyer sends once its reserve is on the lock, which Avow then reads for itself. */
1623
1596
  export declare const mailboxReservedJson: z.ZodObject<{
@@ -1646,5 +1619,5 @@ export declare function mailboxStatusAt(held: {
1646
1619
  status: MailboxStatus;
1647
1620
  expiry: bigint;
1648
1621
  }, now: bigint): MailboxStatus;
1649
- export {};
1622
+ export type { MailboxReserve };
1650
1623
  //# sourceMappingURL=mailbox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mailbox.d.ts","sourceRoot":"","sources":["../src/mailb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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAA0C,CAAA;AAEvE,8FAA8F;AAC9F,eAAO,MAAM,mBAAmB;;kBAAmD,CAAA;AACnF,oGAAoG;AACpG,eAAO,MAAM,mBAAmB;;kBAAqD,CAAA;AAErF,eAAO,MAAM,wBAAwB,+CAEpC,CAAA;AACD,eAAO,MAAM,iBAAiB,wCAAqE,CAAA;AACnG,eAAO,MAAM,iBAAiB;YAIlB,YAAY,EAAE;QAEzB,CAAA;AACD,eAAO,MAAM,oBAAoB;;QAAkC,CAAA;AACnE,eAAO,MAAM,oBAAoB;;QAAkC,CAAA;AAEnE;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAC/C,GAAG,EAAE,MAAM,GACV,aAAa,CAKf;AAED,YAAY,EAAE,cAAc,EAAE,CAAA"}
package/dist/mailbox.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { address, bytes32, u64, u256 } from './json-fields.js';
2
+ import { address, bytes32, u64 } from './json-fields.js';
3
+ import { businessIdJson, orderStagesJson, readOrNull, } from './order-wire.js';
3
4
  import { jobRequirementJson, orderIdJson, quoteRequestJson, } from './test-customer.js';
4
5
  import { jobTermsJson } from './wire.js';
5
6
  /**
@@ -23,7 +24,6 @@ export const MAILBOX_ORDER_LIFETIME_MAX = 60n * 60n;
23
24
  /** The most orders an inbox answers with at once, oldest first. */
24
25
  export const MAILBOX_INBOX_MAX = 20;
25
26
  export const MAILBOX_STATUSES = ['requested', 'quoted', 'expired', 'reserved', 'accepted'];
26
- const businessIdJson = z.string().min(1).max(100);
27
27
  export const jobBuyerJson = z.strictObject({
28
28
  businessId: businessIdJson,
29
29
  account: address,
@@ -39,41 +39,19 @@ export const mailboxOrderRequestJson = z.strictObject({
39
39
  requirement: jobRequirementJson,
40
40
  expiry: u64,
41
41
  });
42
- const reserveJson = z.strictObject({ fundedIn: bytes32.nullable(), amount: u256, acceptBy: u64 });
43
42
  const base = { ...mailboxOrderRequestJson.shape, buyer: jobBuyerJson, requestedAt: u64 };
44
- export const mailboxOrderJson = z.discriminatedUnion('status', [
45
- z.strictObject({ ...base, status: z.literal('requested') }),
46
- z.strictObject({ ...base, status: z.literal('expired'), quote: quoteRequestJson.nullable() }),
47
- z.strictObject({ ...base, status: z.literal('quoted'), quote: quoteRequestJson }),
48
- z.strictObject({
49
- ...base,
50
- status: z.literal('reserved'),
51
- quote: quoteRequestJson,
52
- reserve: reserveJson,
53
- }),
54
- z.strictObject({
55
- ...base,
56
- status: z.literal('accepted'),
57
- quote: quoteRequestJson,
58
- reserve: reserveJson,
59
- acceptedIn: bytes32.nullable(),
60
- }),
61
- ]);
43
+ export const mailboxOrderJson = orderStagesJson(base, quoteRequestJson);
62
44
  /** What the buyer sends once its reserve is on the lock, which Avow then reads for itself. */
63
45
  export const mailboxReservedJson = z.strictObject({ fundedIn: bytes32.nullable() });
64
46
  /** What the supplier sends once the lock shows its acceptance, which Avow then reads for itself. */
65
47
  export const mailboxAcceptedJson = z.strictObject({ acceptedIn: bytes32.nullable() });
66
- const read = (schema) => (json) => {
67
- const parsed = schema.safeParse(json);
68
- return parsed.success ? parsed.data : null;
69
- };
70
- export const parseMailboxOrderRequest = read(mailboxOrderRequestJson);
71
- export const parseMailboxOrder = read(mailboxOrderJson);
72
- export const parseMailboxInbox = read(z.strictObject({
48
+ export const parseMailboxOrderRequest = readOrNull(mailboxOrderRequestJson);
49
+ export const parseMailboxOrder = readOrNull(mailboxOrderJson);
50
+ export const parseMailboxInbox = readOrNull(z.strictObject({
73
51
  orders: z.array(mailboxOrderJson).max(MAILBOX_INBOX_MAX),
74
52
  }));
75
- export const parseMailboxReserved = read(mailboxReservedJson);
76
- export const parseMailboxAccepted = read(mailboxAcceptedJson);
53
+ export const parseMailboxReserved = readOrNull(mailboxReservedJson);
54
+ export const parseMailboxAccepted = readOrNull(mailboxAcceptedJson);
77
55
  /**
78
56
  * Where an order stands at `now`, from what the mailbox holds. An order nobody funded is expired
79
57
  * from its expiry on, whether or not it was quoted, and a funded one never expires here.
@@ -1 +1 @@
1
- {"version":3,"file":"mailbox.js","sourceRoot":"","sources":["../src/mailbox.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,EAEL,kBAAkB,EAClB,WAAW,EAEX,gBAAgB,GACjB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC;;;;;;;;;;;;;;;GAeG;AAEH,4FAA4F;AAC5F,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,GAAG,GAAG,CAAA;AAEnD,mEAAmE;AACnE,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAA;AA0BnC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,CAAU,CAAA;AAiCnG,MAAM,cAAc,G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