@polygonlabs/staker-pool-allocations-schemas 0.1.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 (114) hide show
  1. package/MIGRATION.md +5 -0
  2. package/dist/allocation-history.d.ts +30 -0
  3. package/dist/allocation-history.d.ts.map +1 -0
  4. package/dist/allocation-history.js +29 -0
  5. package/dist/allocation-history.js.map +1 -0
  6. package/dist/allocation.d.ts +31 -0
  7. package/dist/allocation.d.ts.map +1 -0
  8. package/dist/allocation.js +40 -0
  9. package/dist/allocation.js.map +1 -0
  10. package/dist/codegen.d.ts +6 -0
  11. package/dist/codegen.d.ts.map +1 -0
  12. package/dist/codegen.js +32 -0
  13. package/dist/codegen.js.map +1 -0
  14. package/dist/common.d.ts +19 -0
  15. package/dist/common.d.ts.map +1 -0
  16. package/dist/common.js +63 -0
  17. package/dist/common.js.map +1 -0
  18. package/dist/distribution.d.ts +60 -0
  19. package/dist/distribution.d.ts.map +1 -0
  20. package/dist/distribution.js +43 -0
  21. package/dist/distribution.js.map +1 -0
  22. package/dist/error.d.ts +10 -0
  23. package/dist/error.d.ts.map +1 -0
  24. package/dist/error.js +15 -0
  25. package/dist/error.js.map +1 -0
  26. package/dist/index.d.ts +13 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +17 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/management.d.ts +80 -0
  31. package/dist/management.d.ts.map +1 -0
  32. package/dist/management.js +126 -0
  33. package/dist/management.js.map +1 -0
  34. package/dist/proof.d.ts +10 -0
  35. package/dist/proof.d.ts.map +1 -0
  36. package/dist/proof.js +25 -0
  37. package/dist/proof.js.map +1 -0
  38. package/dist/registry-management.d.ts +525 -0
  39. package/dist/registry-management.d.ts.map +1 -0
  40. package/dist/registry-management.js +33 -0
  41. package/dist/registry-management.js.map +1 -0
  42. package/dist/registry-public.d.ts +1323 -0
  43. package/dist/registry-public.d.ts.map +1 -0
  44. package/dist/registry-public.js +31 -0
  45. package/dist/registry-public.js.map +1 -0
  46. package/dist/routes-management/distributions.d.ts +137 -0
  47. package/dist/routes-management/distributions.d.ts.map +1 -0
  48. package/dist/routes-management/distributions.js +72 -0
  49. package/dist/routes-management/distributions.js.map +1 -0
  50. package/dist/routes-management/excluded-addresses.d.ts +132 -0
  51. package/dist/routes-management/excluded-addresses.d.ts.map +1 -0
  52. package/dist/routes-management/excluded-addresses.js +84 -0
  53. package/dist/routes-management/excluded-addresses.js.map +1 -0
  54. package/dist/routes-management/operational.d.ts +48 -0
  55. package/dist/routes-management/operational.d.ts.map +1 -0
  56. package/dist/routes-management/operational.js +47 -0
  57. package/dist/routes-management/operational.js.map +1 -0
  58. package/dist/routes-public/addresses.d.ts +79 -0
  59. package/dist/routes-public/addresses.d.ts.map +1 -0
  60. package/dist/routes-public/addresses.js +45 -0
  61. package/dist/routes-public/addresses.js.map +1 -0
  62. package/dist/routes-public/allocations.d.ts +155 -0
  63. package/dist/routes-public/allocations.d.ts.map +1 -0
  64. package/dist/routes-public/allocations.js +81 -0
  65. package/dist/routes-public/allocations.js.map +1 -0
  66. package/dist/routes-public/distributions.d.ts +123 -0
  67. package/dist/routes-public/distributions.d.ts.map +1 -0
  68. package/dist/routes-public/distributions.js +55 -0
  69. package/dist/routes-public/distributions.js.map +1 -0
  70. package/dist/routes-public/operational.d.ts +46 -0
  71. package/dist/routes-public/operational.d.ts.map +1 -0
  72. package/dist/routes-public/operational.js +36 -0
  73. package/dist/routes-public/operational.js.map +1 -0
  74. package/dist/routes-public/proofs.d.ts +50 -0
  75. package/dist/routes-public/proofs.d.ts.map +1 -0
  76. package/dist/routes-public/proofs.js +34 -0
  77. package/dist/routes-public/proofs.js.map +1 -0
  78. package/dist/routes-public/wire.d.ts +60 -0
  79. package/dist/routes-public/wire.d.ts.map +1 -0
  80. package/dist/routes-public/wire.js +62 -0
  81. package/dist/routes-public/wire.js.map +1 -0
  82. package/dist/tsconfig.lib.tsbuildinfo +1 -0
  83. package/dist/unclaimed-proofs.d.ts +20 -0
  84. package/dist/unclaimed-proofs.d.ts.map +1 -0
  85. package/dist/unclaimed-proofs.js +22 -0
  86. package/dist/unclaimed-proofs.js.map +1 -0
  87. package/dist/zod.d.ts +3 -0
  88. package/dist/zod.d.ts.map +1 -0
  89. package/dist/zod.js +8 -0
  90. package/dist/zod.js.map +1 -0
  91. package/openapi.json +1215 -0
  92. package/package.json +49 -0
  93. package/src/allocation-history.ts +35 -0
  94. package/src/allocation.ts +51 -0
  95. package/src/codegen.ts +50 -0
  96. package/src/common.ts +76 -0
  97. package/src/distribution.ts +52 -0
  98. package/src/error.ts +17 -0
  99. package/src/index.ts +16 -0
  100. package/src/management.ts +158 -0
  101. package/src/proof.ts +27 -0
  102. package/src/registry-management.ts +36 -0
  103. package/src/registry-public.ts +33 -0
  104. package/src/routes-management/distributions.ts +87 -0
  105. package/src/routes-management/excluded-addresses.ts +103 -0
  106. package/src/routes-management/operational.ts +60 -0
  107. package/src/routes-public/addresses.ts +58 -0
  108. package/src/routes-public/allocations.ts +104 -0
  109. package/src/routes-public/distributions.ts +69 -0
  110. package/src/routes-public/operational.ts +55 -0
  111. package/src/routes-public/proofs.ts +46 -0
  112. package/src/routes-public/wire.ts +74 -0
  113. package/src/unclaimed-proofs.ts +27 -0
  114. package/src/zod.ts +9 -0
package/MIGRATION.md ADDED
@@ -0,0 +1,5 @@
1
+ # Migration Guide
2
+
3
+ No migrations yet — this package's first public release. This file ships
4
+ with the package (`files` in `package.json`) and will document breaking
5
+ changes between major versions as they happen.
@@ -0,0 +1,30 @@
1
+ import { z } from './zod.ts';
2
+ export declare const AllocationHistoryRowSchema: z.ZodObject<{
3
+ distributionId: z.ZodString;
4
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
5
+ amount: z.ZodString;
6
+ leafIndex: z.ZodNullable<z.ZodNumber>;
7
+ merkleRoot: z.ZodString;
8
+ completedAt: z.ZodISODateTime;
9
+ status: z.ZodEnum<{
10
+ claimed: "claimed";
11
+ unclaimed: "unclaimed";
12
+ }>;
13
+ }, z.core.$strip>;
14
+ export type AllocationHistoryRow = z.infer<typeof AllocationHistoryRowSchema>;
15
+ export declare const AllocationHistoryResponseSchema: z.ZodObject<{
16
+ items: z.ZodArray<z.ZodObject<{
17
+ distributionId: z.ZodString;
18
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
19
+ amount: z.ZodString;
20
+ leafIndex: z.ZodNullable<z.ZodNumber>;
21
+ merkleRoot: z.ZodString;
22
+ completedAt: z.ZodISODateTime;
23
+ status: z.ZodEnum<{
24
+ claimed: "claimed";
25
+ unclaimed: "unclaimed";
26
+ }>;
27
+ }, z.core.$strip>>;
28
+ }, z.core.$strip>;
29
+ export type AllocationHistoryResponse = z.infer<typeof AllocationHistoryResponseSchema>;
30
+ //# sourceMappingURL=allocation-history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"allocation-history.d.ts","sourceRoot":"","sources":["../src/allocation-history.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAO7B,eAAO,MAAM,0BAA0B;;;;;;;;;;;iBAgBL,CAAC;AAEnC,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;iBAIL,CAAC;AAExC,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { AddressSchema, DistributionIdSchema, Hex32Schema, WeiSchema } from "./common.js";
2
+ import { z } from "./zod.js";
3
+ // One row in the per-address cross-distribution allocation history.
4
+ // Distinct from `AllocationRowSchema` because the history view carries
5
+ // distribution-scoped fields (id, merkleRoot, completedAt) and the
6
+ // claim status derived live from the `pos-staker-pool-claims`
7
+ // subgraph (spec §3.6, D10).
8
+ export const AllocationHistoryRowSchema = z
9
+ .object({
10
+ distributionId: DistributionIdSchema,
11
+ address: AddressSchema,
12
+ amount: WeiSchema,
13
+ // null for excluded addresses: stored allocation, excluded from the
14
+ // merkle tree (settled off-chain), not claimable on-chain.
15
+ leafIndex: z.number().int().nonnegative().nullable(),
16
+ merkleRoot: Hex32Schema,
17
+ completedAt: z.iso.datetime(),
18
+ status: z.enum(['claimed', 'unclaimed']).openapi({
19
+ description: "Derived live at request time by diffing the address's allocations against the " +
20
+ 'pos-staker-pool-claims subgraph. Never persisted (spec D10).'
21
+ })
22
+ })
23
+ .openapi('AllocationHistoryRow');
24
+ export const AllocationHistoryResponseSchema = z
25
+ .object({
26
+ items: z.array(AllocationHistoryRowSchema)
27
+ })
28
+ .openapi('AllocationHistoryResponse');
29
+ //# sourceMappingURL=allocation-history.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"allocation-history.js","sourceRoot":"","sources":["../src/allocation-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAE7B,oEAAoE;AACpE,uEAAuE;AACvE,mEAAmE;AACnE,8DAA8D;AAC9D,6BAA6B;AAC7B,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC;KACxC,MAAM,CAAC;IACN,cAAc,EAAE,oBAAoB;IACpC,OAAO,EAAE,aAAa;IACtB,MAAM,EAAE,SAAS;IACjB,oEAAoE;IACpE,2DAA2D;IAC3D,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IACpD,UAAU,EAAE,WAAW;IACvB,WAAW,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;IAC7B,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC;QAC/C,WAAW,EACT,gFAAgF;YAChF,8DAA8D;KACjE,CAAC;CACH,CAAC;KACD,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAInC,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC;KAC7C,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC;CAC3C,CAAC;KACD,OAAO,CAAC,2BAA2B,CAAC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { z } from './zod.ts';
2
+ export declare const AllocationRowSchema: z.ZodObject<{
3
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
4
+ amount: z.ZodString;
5
+ leafIndex: z.ZodNullable<z.ZodNumber>;
6
+ }, z.core.$strip>;
7
+ export type AllocationRow = z.infer<typeof AllocationRowSchema>;
8
+ export declare const AllocationListResponseSchema: z.ZodObject<{
9
+ items: z.ZodArray<z.ZodObject<{
10
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
11
+ amount: z.ZodString;
12
+ leafIndex: z.ZodNullable<z.ZodNumber>;
13
+ }, z.core.$strip>>;
14
+ nextCursor: z.ZodNullable<z.ZodString>;
15
+ }, z.core.$strip>;
16
+ export type AllocationListResponse = z.infer<typeof AllocationListResponseSchema>;
17
+ export declare const ExcludedAllocationRowSchema: z.ZodObject<{
18
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
19
+ amount: z.ZodString;
20
+ }, z.core.$strip>;
21
+ export type ExcludedAllocationRow = z.infer<typeof ExcludedAllocationRowSchema>;
22
+ export declare const ExcludedAllocationsResponseSchema: z.ZodObject<{
23
+ items: z.ZodArray<z.ZodObject<{
24
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
25
+ amount: z.ZodString;
26
+ }, z.core.$strip>>;
27
+ total: z.ZodNumber;
28
+ totalAmount: z.ZodString;
29
+ }, z.core.$strip>;
30
+ export type ExcludedAllocationsResponse = z.infer<typeof ExcludedAllocationsResponseSchema>;
31
+ //# sourceMappingURL=allocation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"allocation.d.ts","sourceRoot":"","sources":["../src/allocation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAE7B,eAAO,MAAM,mBAAmB;;;;iBAQL,CAAC;AAE5B,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,4BAA4B;;;;;;;iBAKL,CAAC;AAErC,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAMlF,eAAO,MAAM,2BAA2B;;;iBAKL,CAAC;AAEpC,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAOhF,eAAO,MAAM,iCAAiC;;;;;;;iBAML,CAAC;AAE1C,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { AddressSchema, WeiSchema } from "./common.js";
2
+ import { z } from "./zod.js";
3
+ export const AllocationRowSchema = z
4
+ .object({
5
+ address: AddressSchema,
6
+ amount: WeiSchema,
7
+ // null for excluded addresses: they have a stored allocation but are
8
+ // excluded from the merkle tree (settled off-chain) and cannot claim.
9
+ leafIndex: z.number().int().nonnegative().nullable()
10
+ })
11
+ .openapi('AllocationRow');
12
+ export const AllocationListResponseSchema = z
13
+ .object({
14
+ items: z.array(AllocationRowSchema),
15
+ nextCursor: z.string().nullable()
16
+ })
17
+ .openapi('AllocationListResponse');
18
+ // A single off-chain (excluded-from-merkle) allocation. These addresses
19
+ // (excluded addresses) receive a stored allocation but no merkle leaf — they
20
+ // cannot claim on-chain and are settled manually. No `leafIndex` (always
21
+ // null), so it's omitted from this shape entirely.
22
+ export const ExcludedAllocationRowSchema = z
23
+ .object({
24
+ address: AddressSchema,
25
+ amount: WeiSchema
26
+ })
27
+ .openapi('ExcludedAllocationRow');
28
+ // The full set of off-chain allocations for a distribution — the manual
29
+ // settlement list. Not paginated: the excluded set is the configured list (e.g. LST contracts)
30
+ // contracts (a small, bounded set), returned in one response. `totalAmount`
31
+ // is the sum to settle off-chain and equals the distribution's
32
+ // `total_allocated - claimable_total`.
33
+ export const ExcludedAllocationsResponseSchema = z
34
+ .object({
35
+ items: z.array(ExcludedAllocationRowSchema),
36
+ total: z.number().int().nonnegative(),
37
+ totalAmount: WeiSchema
38
+ })
39
+ .openapi('ExcludedAllocationsResponse');
40
+ //# sourceMappingURL=allocation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"allocation.js","sourceRoot":"","sources":["../src/allocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAE7B,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC;KACjC,MAAM,CAAC;IACN,OAAO,EAAE,aAAa;IACtB,MAAM,EAAE,SAAS;IACjB,qEAAqE;IACrE,sEAAsE;IACtE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;CACrD,CAAC;KACD,OAAO,CAAC,eAAe,CAAC,CAAC;AAI5B,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC;KAC1C,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC;IACnC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC;KACD,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAIrC,wEAAwE;AACxE,6EAA6E;AAC7E,yEAAyE;AACzE,mDAAmD;AACnD,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC;KACzC,MAAM,CAAC;IACN,OAAO,EAAE,aAAa;IACtB,MAAM,EAAE,SAAS;CAClB,CAAC;KACD,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAIpC,wEAAwE;AACxE,+FAA+F;AAC/F,4EAA4E;AAC5E,+DAA+D;AAC/D,uCAAuC;AACvC,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC/C,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,2BAA2B,CAAC;IAC3C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACrC,WAAW,EAAE,SAAS;CACvB,CAAC;KACD,OAAO,CAAC,6BAA6B,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { AllocationHistoryResponseWireSchema as AllocationHistoryResponse, AllocationHistoryRowWireSchema as AllocationHistoryRow, AllocationListResponseWireSchema as AllocationListResponse, AllocationRowWireSchema as AllocationRow, ExcludedAllocationRowWireSchema as ExcludedAllocationRow, ExcludedAllocationsResponseWireSchema as ExcludedAllocationsResponse, ProofResponseWireSchema as ProofResponse } from './routes-public/wire.ts';
2
+ export { OperationalStatusSchema as OperationalStatus } from './routes-public/operational.ts';
3
+ export { DistributionDetailSchema as DistributionDetail, DistributionListResponseSchema as DistributionListResponse, DistributionSummarySchema as DistributionSummary } from './distribution.ts';
4
+ export { UnclaimedProofBatchSchema as UnclaimedProofBatch, UnclaimedProofsResponseSchema as UnclaimedProofsResponse } from './unclaimed-proofs.ts';
5
+ export { ErrorResponseSchema as ErrorResponse, ValidationErrorResponseSchema as ValidationErrorResponse } from '@polygonlabs/openapi-registry/error-schemas';
6
+ //# sourceMappingURL=codegen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../src/codegen.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,mCAAmC,IAAI,yBAAyB,EAChE,8BAA8B,IAAI,oBAAoB,EACtD,gCAAgC,IAAI,sBAAsB,EAC1D,uBAAuB,IAAI,aAAa,EACxC,+BAA+B,IAAI,qBAAqB,EACxD,qCAAqC,IAAI,2BAA2B,EACpE,uBAAuB,IAAI,aAAa,EACzC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,uBAAuB,IAAI,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAC9F,OAAO,EACL,wBAAwB,IAAI,kBAAkB,EAC9C,8BAA8B,IAAI,wBAAwB,EAC1D,yBAAyB,IAAI,mBAAmB,EACjD,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,yBAAyB,IAAI,mBAAmB,EAChD,6BAA6B,IAAI,uBAAuB,EACzD,MAAM,uBAAuB,CAAC;AAK/B,OAAO,EACL,mBAAmB,IAAI,aAAa,EACpC,6BAA6B,IAAI,uBAAuB,EACzD,MAAM,6CAA6C,CAAC"}
@@ -0,0 +1,32 @@
1
+ // Codegen-facing surface: registered name === exported binding name.
2
+ //
3
+ // The @polygonlabs/zod-to-openapi-heyapi plugin emits
4
+ // `import { <RegisteredName> } from '<schemasFrom>'` for every schema a
5
+ // public-registry route response `$ref`s, and its codegen-time audit fails
6
+ // the client build when a registered name has no matching named export of
7
+ // the `schemasFrom` module. The generated client's response transformer
8
+ // then calls `<RegisteredName>.parseAsync(data)` at runtime against these
9
+ // exact values.
10
+ //
11
+ // This lives on its own `./codegen` subpath (the plugin README's
12
+ // "schemas exposed under a subpath export" case) rather than the main
13
+ // barrel: the barrel star-exports `z.infer` *types* under these same
14
+ // names (`AllocationRow`, `DistributionSummary`, …), and TypeScript
15
+ // rejects a re-exported value alias alongside a re-exported type of the
16
+ // same name (TS2300). A dedicated module sidesteps the collision without
17
+ // renaming anything the worker and rest-api already import.
18
+ //
19
+ // Response slots in the public registry reference the wire variants (see
20
+ // `routes-public/wire.ts` for why `z.encode` can't take the canonical
21
+ // address-bearing schemas), so those names bind the wire values — the
22
+ // client validates exactly the shape the service emits. Schemas that are
23
+ // already encode-safe bind their canonical definition.
24
+ export { AllocationHistoryResponseWireSchema as AllocationHistoryResponse, AllocationHistoryRowWireSchema as AllocationHistoryRow, AllocationListResponseWireSchema as AllocationListResponse, AllocationRowWireSchema as AllocationRow, ExcludedAllocationRowWireSchema as ExcludedAllocationRow, ExcludedAllocationsResponseWireSchema as ExcludedAllocationsResponse, ProofResponseWireSchema as ProofResponse } from "./routes-public/wire.js";
25
+ export { OperationalStatusSchema as OperationalStatus } from "./routes-public/operational.js";
26
+ export { DistributionDetailSchema as DistributionDetail, DistributionListResponseSchema as DistributionListResponse, DistributionSummarySchema as DistributionSummary } from "./distribution.js";
27
+ export { UnclaimedProofBatchSchema as UnclaimedProofBatch, UnclaimedProofsResponseSchema as UnclaimedProofsResponse } from "./unclaimed-proofs.js";
28
+ // Canonical error response schemas, renamed to drop the `Schema` suffix so
29
+ // the binding matches the OpenAPI registered name — the TypedRegistry
30
+ // auto-injects these into every route's 400/500 response slots.
31
+ export { ErrorResponseSchema as ErrorResponse, ValidationErrorResponseSchema as ValidationErrorResponse } from '@polygonlabs/openapi-registry/error-schemas';
32
+ //# sourceMappingURL=codegen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codegen.js","sourceRoot":"","sources":["../src/codegen.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,EAAE;AACF,sDAAsD;AACtD,wEAAwE;AACxE,2EAA2E;AAC3E,0EAA0E;AAC1E,wEAAwE;AACxE,0EAA0E;AAC1E,gBAAgB;AAChB,EAAE;AACF,iEAAiE;AACjE,sEAAsE;AACtE,qEAAqE;AACrE,oEAAoE;AACpE,wEAAwE;AACxE,yEAAyE;AACzE,4DAA4D;AAC5D,EAAE;AACF,yEAAyE;AACzE,sEAAsE;AACtE,sEAAsE;AACtE,yEAAyE;AACzE,uDAAuD;AACvD,OAAO,EACL,mCAAmC,IAAI,yBAAyB,EAChE,8BAA8B,IAAI,oBAAoB,EACtD,gCAAgC,IAAI,sBAAsB,EAC1D,uBAAuB,IAAI,aAAa,EACxC,+BAA+B,IAAI,qBAAqB,EACxD,qCAAqC,IAAI,2BAA2B,EACpE,uBAAuB,IAAI,aAAa,EACzC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,uBAAuB,IAAI,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAC9F,OAAO,EACL,wBAAwB,IAAI,kBAAkB,EAC9C,8BAA8B,IAAI,wBAAwB,EAC1D,yBAAyB,IAAI,mBAAmB,EACjD,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,yBAAyB,IAAI,mBAAmB,EAChD,6BAA6B,IAAI,uBAAuB,EACzD,MAAM,uBAAuB,CAAC;AAE/B,2EAA2E;AAC3E,sEAAsE;AACtE,gEAAgE;AAChE,OAAO,EACL,mBAAmB,IAAI,aAAa,EACpC,6BAA6B,IAAI,uBAAuB,EACzD,MAAM,6CAA6C,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { z } from './zod.ts';
2
+ export declare const NetworkSchema: z.ZodEnum<{
3
+ mainnet: "mainnet";
4
+ amoy: "amoy";
5
+ }>;
6
+ export type Network = z.infer<typeof NetworkSchema>;
7
+ export declare const AddressSchema: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
8
+ export declare const DistributionIdSchema: z.ZodString;
9
+ export declare const WeiSchema: z.ZodString;
10
+ export declare const Hex32Schema: z.ZodString;
11
+ export declare const PolUsdPriceSchema: z.ZodString;
12
+ export declare const PaginationQuerySchema: z.ZodObject<{
13
+ cursor: z.ZodOptional<z.ZodString>;
14
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
15
+ }, z.core.$strip>;
16
+ export type PaginationQuery = z.infer<typeof PaginationQuerySchema>;
17
+ export declare function encodeCursor<T>(payload: T): string;
18
+ export declare function decodeCursor<T>(cursor: string): T;
19
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAK7B,eAAO,MAAM,aAAa;;;EAIxB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAIpD,eAAO,MAAM,aAAa,wDAI2C,CAAC;AAKtE,eAAO,MAAM,oBAAoB,aAGC,CAAC;AAKnC,eAAO,MAAM,SAAS,aAGwB,CAAC;AAI/C,eAAO,MAAM,WAAW,aAGsB,CAAC;AAO/C,eAAO,MAAM,iBAAiB,aAGK,CAAC;AAMpC,eAAO,MAAM,qBAAqB;;;iBAGhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAIpE,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,MAAM,CAElD;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,CAIjD"}
package/dist/common.js ADDED
@@ -0,0 +1,63 @@
1
+ import { z } from "./zod.js";
2
+ // Network discriminator surfaced as a path parameter (`/v1/:network/...`)
3
+ // and persisted on every domain row. The set is closed — adding a third
4
+ // network is a schema + migration change, not a config flip.
5
+ export const NetworkSchema = z.enum(['mainnet', 'amoy']).openapi({
6
+ description: 'Polygon network the distribution covers. `mainnet` is PoS mainnet, `amoy` is the PoS testnet.',
7
+ example: 'mainnet'
8
+ });
9
+ // Lowercased 0x-prefixed 40-hex EVM address. Transform normalises so
10
+ // downstream code never has to think about case.
11
+ export const AddressSchema = z
12
+ .string()
13
+ .regex(/^0x[0-9a-fA-F]{40}$/)
14
+ .transform((s) => s.toLowerCase())
15
+ .openapi({ example: '0xabc0000000000000000000000000000000000001' });
16
+ // Distributions are named by the month they cover, e.g. "2026-04". The
17
+ // spec deliberately picks a human-readable scheme rather than UUIDs so
18
+ // the URL path is meaningful to operators.
19
+ export const DistributionIdSchema = z
20
+ .string()
21
+ .regex(/^[0-9]{4}-[0-9]{2}$/)
22
+ .openapi({ example: '2026-04' });
23
+ // All POL amounts cross the API boundary as decimal strings — uint256
24
+ // can't fit in a JS number, and JSON has no native bigint. Callers cast
25
+ // to BigInt at the seam.
26
+ export const WeiSchema = z
27
+ .string()
28
+ .regex(/^[0-9]+$/)
29
+ .openapi({ example: '1234567890000000000' });
30
+ // 32-byte hex with the 0x prefix — used for merkle roots, inputs
31
+ // hashes, and subgraph block hashes.
32
+ export const Hex32Schema = z
33
+ .string()
34
+ .regex(/^0x[0-9a-fA-F]{64}$/)
35
+ .openapi({ example: '0x' + 'a'.repeat(64) });
36
+ // POL/USD price as a decimal string with up to 6 fractional digits (the
37
+ // micro-USD precision the worker and storage use). String, not number, so
38
+ // it round-trips through the API and the inputs hash without float drift —
39
+ // `0.42` always means `0.420000`. Used both for the trigger override and the
40
+ // stored price on the distribution detail.
41
+ export const PolUsdPriceSchema = z
42
+ .string()
43
+ .regex(/^[0-9]+(\.[0-9]{1,6})?$/)
44
+ .openapi({ example: '0.423100' });
45
+ // Cursor-based pagination. The cursor is an opaque base64-encoded
46
+ // JSON object — decoded server-side only. The shape inside differs
47
+ // per endpoint (e.g. `{ id }` for distributions, `{ leafIndex }` for
48
+ // allocations); the encoder/decoder lives next to each route.
49
+ export const PaginationQuerySchema = z.object({
50
+ cursor: z.string().min(1).optional(),
51
+ limit: z.coerce.number().int().min(1).max(100).default(50)
52
+ });
53
+ // Opaque cursor encode/decode pair. Forces every endpoint to round-trip
54
+ // the same way so the cursor format is consistent across the API.
55
+ export function encodeCursor(payload) {
56
+ return Buffer.from(JSON.stringify(payload), 'utf8').toString('base64url');
57
+ }
58
+ export function decodeCursor(cursor) {
59
+ // Throws SyntaxError on malformed JSON / base64; route handlers wrap
60
+ // this in a typed 400 via the error envelope.
61
+ return JSON.parse(Buffer.from(cursor, 'base64url').toString('utf8'));
62
+ }
63
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAE7B,0EAA0E;AAC1E,wEAAwE;AACxE,6DAA6D;AAC7D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IAC/D,WAAW,EACT,+FAA+F;IACjG,OAAO,EAAE,SAAS;CACnB,CAAC,CAAC;AAIH,qEAAqE;AACrE,iDAAiD;AACjD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC;KAC3B,MAAM,EAAE;KACR,KAAK,CAAC,qBAAqB,CAAC;KAC5B,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;KACjC,OAAO,CAAC,EAAE,OAAO,EAAE,4CAA4C,EAAE,CAAC,CAAC;AAEtE,uEAAuE;AACvE,uEAAuE;AACvE,2CAA2C;AAC3C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC;KAClC,MAAM,EAAE;KACR,KAAK,CAAC,qBAAqB,CAAC;KAC5B,OAAO,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;AAEnC,sEAAsE;AACtE,wEAAwE;AACxE,yBAAyB;AACzB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC;KACvB,MAAM,EAAE;KACR,KAAK,CAAC,UAAU,CAAC;KACjB,OAAO,CAAC,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,CAAC;AAE/C,iEAAiE;AACjE,qCAAqC;AACrC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC;KACzB,MAAM,EAAE;KACR,KAAK,CAAC,qBAAqB,CAAC;KAC5B,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAE/C,wEAAwE;AACxE,0EAA0E;AAC1E,2EAA2E;AAC3E,6EAA6E;AAC7E,2CAA2C;AAC3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,MAAM,EAAE;KACR,KAAK,CAAC,yBAAyB,CAAC;KAChC,OAAO,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;AAEpC,kEAAkE;AAClE,mEAAmE;AACnE,qEAAqE;AACrE,8DAA8D;AAC9D,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACpC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CAC3D,CAAC,CAAC;AAIH,wEAAwE;AACxE,kEAAkE;AAClE,MAAM,UAAU,YAAY,CAAI,OAAU;IACxC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,YAAY,CAAI,MAAc;IAC5C,qEAAqE;IACrE,8CAA8C;IAC9C,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAM,CAAC;AAC5E,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { z } from './zod.ts';
2
+ export declare const DistributionSummarySchema: z.ZodObject<{
3
+ distributionId: z.ZodString;
4
+ status: z.ZodEnum<{
5
+ pending: "pending";
6
+ running: "running";
7
+ completed: "completed";
8
+ failed: "failed";
9
+ }>;
10
+ startPoSBlock: z.ZodString;
11
+ endPoSBlock: z.ZodString;
12
+ merkleRoot: z.ZodNullable<z.ZodString>;
13
+ totalAllocated: z.ZodNullable<z.ZodString>;
14
+ completedAt: z.ZodNullable<z.ZodISODateTime>;
15
+ }, z.core.$strip>;
16
+ export type DistributionSummary = z.infer<typeof DistributionSummarySchema>;
17
+ export declare const DistributionDetailSchema: z.ZodObject<{
18
+ distributionId: z.ZodString;
19
+ status: z.ZodEnum<{
20
+ pending: "pending";
21
+ running: "running";
22
+ completed: "completed";
23
+ failed: "failed";
24
+ }>;
25
+ startPoSBlock: z.ZodString;
26
+ endPoSBlock: z.ZodString;
27
+ merkleRoot: z.ZodNullable<z.ZodString>;
28
+ totalAllocated: z.ZodNullable<z.ZodString>;
29
+ completedAt: z.ZodNullable<z.ZodISODateTime>;
30
+ checkpointCount: z.ZodNumber;
31
+ polUsdPrice: z.ZodNullable<z.ZodString>;
32
+ maxClaimableUsdThreshold: z.ZodNullable<z.ZodString>;
33
+ inputsHash: z.ZodNullable<z.ZodString>;
34
+ posStakingSubgraphBlock: z.ZodNullable<z.ZodString>;
35
+ posStakingSubgraphHash: z.ZodNullable<z.ZodString>;
36
+ posCheckpointsSubgraphBlock: z.ZodNullable<z.ZodString>;
37
+ posCheckpointsSubgraphHash: z.ZodNullable<z.ZodString>;
38
+ posPriorityFeesSubgraphBlock: z.ZodNullable<z.ZodString>;
39
+ posPriorityFeesSubgraphHash: z.ZodNullable<z.ZodString>;
40
+ }, z.core.$strip>;
41
+ export type DistributionDetail = z.infer<typeof DistributionDetailSchema>;
42
+ export declare const DistributionListResponseSchema: z.ZodObject<{
43
+ items: z.ZodArray<z.ZodObject<{
44
+ distributionId: z.ZodString;
45
+ status: z.ZodEnum<{
46
+ pending: "pending";
47
+ running: "running";
48
+ completed: "completed";
49
+ failed: "failed";
50
+ }>;
51
+ startPoSBlock: z.ZodString;
52
+ endPoSBlock: z.ZodString;
53
+ merkleRoot: z.ZodNullable<z.ZodString>;
54
+ totalAllocated: z.ZodNullable<z.ZodString>;
55
+ completedAt: z.ZodNullable<z.ZodISODateTime>;
56
+ }, z.core.$strip>>;
57
+ nextCursor: z.ZodNullable<z.ZodString>;
58
+ }, z.core.$strip>;
59
+ export type DistributionListResponse = z.infer<typeof DistributionListResponseSchema>;
60
+ //# sourceMappingURL=distribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distribution.d.ts","sourceRoot":"","sources":["../src/distribution.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAQ7B,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;iBAUL,CAAC;AAElC,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAK5E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;iBAcL,CAAC;AAEjC,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;iBAKL,CAAC;AAEvC,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { DistributionIdSchema, Hex32Schema, PolUsdPriceSchema, WeiSchema } from "./common.js";
2
+ import { z } from "./zod.js";
3
+ const DistributionStatusSchema = z
4
+ .enum(['pending', 'running', 'completed', 'failed'])
5
+ .openapi({ example: 'completed' });
6
+ // List-view shape. Drops the full subgraph-pin block hashes (visible in
7
+ // the detail endpoint only) and the error blob.
8
+ export const DistributionSummarySchema = z
9
+ .object({
10
+ distributionId: DistributionIdSchema,
11
+ status: DistributionStatusSchema,
12
+ startPoSBlock: WeiSchema,
13
+ endPoSBlock: WeiSchema,
14
+ merkleRoot: Hex32Schema.nullable(),
15
+ totalAllocated: WeiSchema.nullable(),
16
+ completedAt: z.iso.datetime().nullable()
17
+ })
18
+ .openapi('DistributionSummary');
19
+ // Detail view extends the summary with subgraph pins + checkpoint
20
+ // count + the inputs hash. Used by `GET /v1/distributions/:id` and
21
+ // (with the `error` field) by the management variant.
22
+ export const DistributionDetailSchema = DistributionSummarySchema.extend({
23
+ checkpointCount: z.number().int().nonnegative(),
24
+ // POL/USD price applied this run and the USD claim ceiling (decimal
25
+ // strings, up to 6 dp). `maxClaimableUsdThreshold` is null when the
26
+ // threshold was inert for the run. Both null until completion.
27
+ polUsdPrice: PolUsdPriceSchema.nullable(),
28
+ maxClaimableUsdThreshold: PolUsdPriceSchema.nullable(),
29
+ inputsHash: Hex32Schema.nullable(),
30
+ posStakingSubgraphBlock: WeiSchema.nullable(),
31
+ posStakingSubgraphHash: Hex32Schema.nullable(),
32
+ posCheckpointsSubgraphBlock: WeiSchema.nullable(),
33
+ posCheckpointsSubgraphHash: Hex32Schema.nullable(),
34
+ posPriorityFeesSubgraphBlock: WeiSchema.nullable(),
35
+ posPriorityFeesSubgraphHash: Hex32Schema.nullable()
36
+ }).openapi('DistributionDetail');
37
+ export const DistributionListResponseSchema = z
38
+ .object({
39
+ items: z.array(DistributionSummarySchema),
40
+ nextCursor: z.string().nullable()
41
+ })
42
+ .openapi('DistributionListResponse');
43
+ //# sourceMappingURL=distribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distribution.js","sourceRoot":"","sources":["../src/distribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC9F,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAE7B,MAAM,wBAAwB,GAAG,CAAC;KAC/B,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;KACnD,OAAO,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;AAErC,wEAAwE;AACxE,gDAAgD;AAChD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC;KACvC,MAAM,CAAC;IACN,cAAc,EAAE,oBAAoB;IACpC,MAAM,EAAE,wBAAwB;IAChC,aAAa,EAAE,SAAS;IACxB,WAAW,EAAE,SAAS;IACtB,UAAU,EAAE,WAAW,CAAC,QAAQ,EAAE;IAClC,cAAc,EAAE,SAAS,CAAC,QAAQ,EAAE;IACpC,WAAW,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACzC,CAAC;KACD,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAIlC,kEAAkE;AAClE,mEAAmE;AACnE,sDAAsD;AACtD,MAAM,CAAC,MAAM,wBAAwB,GAAG,yBAAyB,CAAC,MAAM,CAAC;IACvE,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC/C,oEAAoE;IACpE,oEAAoE;IACpE,+DAA+D;IAC/D,WAAW,EAAE,iBAAiB,CAAC,QAAQ,EAAE;IACzC,wBAAwB,EAAE,iBAAiB,CAAC,QAAQ,EAAE;IACtD,UAAU,EAAE,WAAW,CAAC,QAAQ,EAAE;IAClC,uBAAuB,EAAE,SAAS,CAAC,QAAQ,EAAE;IAC7C,sBAAsB,EAAE,WAAW,CAAC,QAAQ,EAAE;IAC9C,2BAA2B,EAAE,SAAS,CAAC,QAAQ,EAAE;IACjD,0BAA0B,EAAE,WAAW,CAAC,QAAQ,EAAE;IAClD,4BAA4B,EAAE,SAAS,CAAC,QAAQ,EAAE;IAClD,2BAA2B,EAAE,WAAW,CAAC,QAAQ,EAAE;CACpD,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAIjC,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC;KAC5C,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,yBAAyB,CAAC;IACzC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC;KACD,OAAO,CAAC,0BAA0B,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { z } from './zod.ts';
2
+ export declare const ErrorEnvelopeSchema: z.ZodObject<{
3
+ error: z.ZodObject<{
4
+ code: z.ZodString;
5
+ message: z.ZodString;
6
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
7
+ }, z.core.$strip>;
8
+ }, z.core.$strip>;
9
+ export type ErrorEnvelope = z.infer<typeof ErrorEnvelopeSchema>;
10
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAM7B,eAAO,MAAM,mBAAmB;;;;;;iBAQL,CAAC;AAE5B,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
package/dist/error.js ADDED
@@ -0,0 +1,15 @@
1
+ import { z } from "./zod.js";
2
+ // Canonical error envelope every 4xx and 5xx response uses. Per spec
3
+ // §7.1: 4xx responses populate `details` from VError.info; 5xx wipe
4
+ // both `details` and the stack to avoid leaking internal state to
5
+ // untrusted callers.
6
+ export const ErrorEnvelopeSchema = z
7
+ .object({
8
+ error: z.object({
9
+ code: z.string().openapi({ example: 'DISTRIBUTION_NOT_FOUND' }),
10
+ message: z.string().openapi({ example: 'Distribution not found.' }),
11
+ details: z.record(z.string(), z.unknown()).optional()
12
+ })
13
+ })
14
+ .openapi('ErrorEnvelope');
15
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAE7B,qEAAqE;AACrE,oEAAoE;AACpE,kEAAkE;AAClE,qBAAqB;AACrB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC;KACjC,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;QAC/D,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC;QACnE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;KACtD,CAAC;CACH,CAAC;KACD,OAAO,CAAC,eAAe,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ export * from './zod.ts';
2
+ export * from './common.ts';
3
+ export * from './error.ts';
4
+ export * from './distribution.ts';
5
+ export * from './allocation.ts';
6
+ export * from './allocation-history.ts';
7
+ export * from './unclaimed-proofs.ts';
8
+ export * from './proof.ts';
9
+ export * from './management.ts';
10
+ export * from './registry-public.ts';
11
+ export * from './registry-management.ts';
12
+ export * from './routes-management/operational.ts';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ // Package barrel: the extended Zod instance (with the OpenAPI registry) plus
2
+ // every request/response schema. Consumers (the api + worker apps) import the
3
+ // schemas they need from here; internal files still reference `./common.ts`
4
+ // and `./zod.ts` by relative path.
5
+ export * from "./zod.js";
6
+ export * from "./common.js";
7
+ export * from "./error.js";
8
+ export * from "./distribution.js";
9
+ export * from "./allocation.js";
10
+ export * from "./allocation-history.js";
11
+ export * from "./unclaimed-proofs.js";
12
+ export * from "./proof.js";
13
+ export * from "./management.js";
14
+ export * from "./registry-public.js";
15
+ export * from "./registry-management.js";
16
+ export * from "./routes-management/operational.js";
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,8EAA8E;AAC9E,4EAA4E;AAC5E,mCAAmC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC"}
@@ -0,0 +1,80 @@
1
+ import { z } from './zod.ts';
2
+ export declare const DistributionTriggerRequestSchema: z.ZodObject<{
3
+ startPoSBlock: z.ZodString;
4
+ endPoSBlock: z.ZodString;
5
+ distributionId: z.ZodOptional<z.ZodString>;
6
+ force: z.ZodOptional<z.ZodBoolean>;
7
+ polUsdPrice: z.ZodOptional<z.ZodString>;
8
+ }, z.core.$strip>;
9
+ export type DistributionTriggerRequest = z.infer<typeof DistributionTriggerRequestSchema>;
10
+ export declare const DistributionTriggerResponseSchema: z.ZodObject<{
11
+ network: z.ZodEnum<{
12
+ mainnet: "mainnet";
13
+ amoy: "amoy";
14
+ }>;
15
+ distributionId: z.ZodString;
16
+ status: z.ZodEnum<{
17
+ pending: "pending";
18
+ running: "running";
19
+ completed: "completed";
20
+ failed: "failed";
21
+ }>;
22
+ }, z.core.$strip>;
23
+ export type DistributionTriggerResponse = z.infer<typeof DistributionTriggerResponseSchema>;
24
+ export declare const DistributionDeleteResponseSchema: z.ZodObject<{
25
+ network: z.ZodEnum<{
26
+ mainnet: "mainnet";
27
+ amoy: "amoy";
28
+ }>;
29
+ distributionId: z.ZodString;
30
+ removed: z.ZodBoolean;
31
+ priorStatus: z.ZodEnum<{
32
+ pending: "pending";
33
+ running: "running";
34
+ failed: "failed";
35
+ }>;
36
+ deletedAllocations: z.ZodNumber;
37
+ }, z.core.$strip>;
38
+ export type DistributionDeleteResponse = z.infer<typeof DistributionDeleteResponseSchema>;
39
+ export declare const AddExcludedAddressRequestSchema: z.ZodObject<{
40
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
41
+ label: z.ZodString;
42
+ createdBy: z.ZodOptional<z.ZodString>;
43
+ }, z.core.$strip>;
44
+ export type AddExcludedAddressRequest = z.infer<typeof AddExcludedAddressRequestSchema>;
45
+ export declare const ManagedExcludedAddressSchema: z.ZodObject<{
46
+ network: z.ZodEnum<{
47
+ mainnet: "mainnet";
48
+ amoy: "amoy";
49
+ }>;
50
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
51
+ label: z.ZodString;
52
+ createdBy: z.ZodString;
53
+ createdAt: z.ZodISODateTime;
54
+ updatedAt: z.ZodISODateTime;
55
+ }, z.core.$strip>;
56
+ export type ManagedExcludedAddress = z.infer<typeof ManagedExcludedAddressSchema>;
57
+ export declare const ExcludedAddressListResponseSchema: z.ZodObject<{
58
+ items: z.ZodArray<z.ZodObject<{
59
+ network: z.ZodEnum<{
60
+ mainnet: "mainnet";
61
+ amoy: "amoy";
62
+ }>;
63
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
64
+ label: z.ZodString;
65
+ createdBy: z.ZodString;
66
+ createdAt: z.ZodISODateTime;
67
+ updatedAt: z.ZodISODateTime;
68
+ }, z.core.$strip>>;
69
+ }, z.core.$strip>;
70
+ export type ExcludedAddressListResponse = z.infer<typeof ExcludedAddressListResponseSchema>;
71
+ export declare const RemoveExcludedAddressResponseSchema: z.ZodObject<{
72
+ network: z.ZodEnum<{
73
+ mainnet: "mainnet";
74
+ amoy: "amoy";
75
+ }>;
76
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
77
+ removed: z.ZodBoolean;
78
+ }, z.core.$strip>;
79
+ export type RemoveExcludedAddressResponse = z.infer<typeof RemoveExcludedAddressResponseSchema>;
80
+ //# sourceMappingURL=management.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"management.d.ts","sourceRoot":"","sources":["../src/management.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAa7B,eAAO,MAAM,gCAAgC;;;;;;iBAgCL,CAAC;AAEzC,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAM1F,eAAO,MAAM,iCAAiC;;;;;;;;;;;;iBAWL,CAAC;AAE1C,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAK5F,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;iBAgBL,CAAC;AAEzC,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAM1F,eAAO,MAAM,+BAA+B;;;;iBAmBL,CAAC;AAExC,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAGxF,eAAO,MAAM,4BAA4B;;;;;;;;;;iBASL,CAAC;AAErC,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;iBAIL,CAAC;AAE1C,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAI5F,eAAO,MAAM,mCAAmC;;;;;;;iBAML,CAAC;AAE5C,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC"}