@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.
- package/MIGRATION.md +5 -0
- package/dist/allocation-history.d.ts +30 -0
- package/dist/allocation-history.d.ts.map +1 -0
- package/dist/allocation-history.js +29 -0
- package/dist/allocation-history.js.map +1 -0
- package/dist/allocation.d.ts +31 -0
- package/dist/allocation.d.ts.map +1 -0
- package/dist/allocation.js +40 -0
- package/dist/allocation.js.map +1 -0
- package/dist/codegen.d.ts +6 -0
- package/dist/codegen.d.ts.map +1 -0
- package/dist/codegen.js +32 -0
- package/dist/codegen.js.map +1 -0
- package/dist/common.d.ts +19 -0
- package/dist/common.d.ts.map +1 -0
- package/dist/common.js +63 -0
- package/dist/common.js.map +1 -0
- package/dist/distribution.d.ts +60 -0
- package/dist/distribution.d.ts.map +1 -0
- package/dist/distribution.js +43 -0
- package/dist/distribution.js.map +1 -0
- package/dist/error.d.ts +10 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +15 -0
- package/dist/error.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/management.d.ts +80 -0
- package/dist/management.d.ts.map +1 -0
- package/dist/management.js +126 -0
- package/dist/management.js.map +1 -0
- package/dist/proof.d.ts +10 -0
- package/dist/proof.d.ts.map +1 -0
- package/dist/proof.js +25 -0
- package/dist/proof.js.map +1 -0
- package/dist/registry-management.d.ts +525 -0
- package/dist/registry-management.d.ts.map +1 -0
- package/dist/registry-management.js +33 -0
- package/dist/registry-management.js.map +1 -0
- package/dist/registry-public.d.ts +1323 -0
- package/dist/registry-public.d.ts.map +1 -0
- package/dist/registry-public.js +31 -0
- package/dist/registry-public.js.map +1 -0
- package/dist/routes-management/distributions.d.ts +137 -0
- package/dist/routes-management/distributions.d.ts.map +1 -0
- package/dist/routes-management/distributions.js +72 -0
- package/dist/routes-management/distributions.js.map +1 -0
- package/dist/routes-management/excluded-addresses.d.ts +132 -0
- package/dist/routes-management/excluded-addresses.d.ts.map +1 -0
- package/dist/routes-management/excluded-addresses.js +84 -0
- package/dist/routes-management/excluded-addresses.js.map +1 -0
- package/dist/routes-management/operational.d.ts +48 -0
- package/dist/routes-management/operational.d.ts.map +1 -0
- package/dist/routes-management/operational.js +47 -0
- package/dist/routes-management/operational.js.map +1 -0
- package/dist/routes-public/addresses.d.ts +79 -0
- package/dist/routes-public/addresses.d.ts.map +1 -0
- package/dist/routes-public/addresses.js +45 -0
- package/dist/routes-public/addresses.js.map +1 -0
- package/dist/routes-public/allocations.d.ts +155 -0
- package/dist/routes-public/allocations.d.ts.map +1 -0
- package/dist/routes-public/allocations.js +81 -0
- package/dist/routes-public/allocations.js.map +1 -0
- package/dist/routes-public/distributions.d.ts +123 -0
- package/dist/routes-public/distributions.d.ts.map +1 -0
- package/dist/routes-public/distributions.js +55 -0
- package/dist/routes-public/distributions.js.map +1 -0
- package/dist/routes-public/operational.d.ts +46 -0
- package/dist/routes-public/operational.d.ts.map +1 -0
- package/dist/routes-public/operational.js +36 -0
- package/dist/routes-public/operational.js.map +1 -0
- package/dist/routes-public/proofs.d.ts +50 -0
- package/dist/routes-public/proofs.d.ts.map +1 -0
- package/dist/routes-public/proofs.js +34 -0
- package/dist/routes-public/proofs.js.map +1 -0
- package/dist/routes-public/wire.d.ts +60 -0
- package/dist/routes-public/wire.d.ts.map +1 -0
- package/dist/routes-public/wire.js +62 -0
- package/dist/routes-public/wire.js.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/dist/unclaimed-proofs.d.ts +20 -0
- package/dist/unclaimed-proofs.d.ts.map +1 -0
- package/dist/unclaimed-proofs.js +22 -0
- package/dist/unclaimed-proofs.js.map +1 -0
- package/dist/zod.d.ts +3 -0
- package/dist/zod.d.ts.map +1 -0
- package/dist/zod.js +8 -0
- package/dist/zod.js.map +1 -0
- package/openapi.json +1215 -0
- package/package.json +49 -0
- package/src/allocation-history.ts +35 -0
- package/src/allocation.ts +51 -0
- package/src/codegen.ts +50 -0
- package/src/common.ts +76 -0
- package/src/distribution.ts +52 -0
- package/src/error.ts +17 -0
- package/src/index.ts +16 -0
- package/src/management.ts +158 -0
- package/src/proof.ts +27 -0
- package/src/registry-management.ts +36 -0
- package/src/registry-public.ts +33 -0
- package/src/routes-management/distributions.ts +87 -0
- package/src/routes-management/excluded-addresses.ts +103 -0
- package/src/routes-management/operational.ts +60 -0
- package/src/routes-public/addresses.ts +58 -0
- package/src/routes-public/allocations.ts +104 -0
- package/src/routes-public/distributions.ts +69 -0
- package/src/routes-public/operational.ts +55 -0
- package/src/routes-public/proofs.ts +46 -0
- package/src/routes-public/wire.ts +74 -0
- package/src/unclaimed-proofs.ts +27 -0
- package/src/zod.ts +9 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DistributionIdSchema, Hex32Schema, WeiSchema } from './common.ts';
|
|
2
|
+
import { z } from './zod.ts';
|
|
3
|
+
|
|
4
|
+
// One unclaimed-distribution entry in the batched-claims payload. The
|
|
5
|
+
// shape matches a Solidity verifier's expected arguments for the
|
|
6
|
+
// claimer contract's batched-claim method: pass the array straight
|
|
7
|
+
// through. Per spec §7.2, this is the **primary UI endpoint** — the
|
|
8
|
+
// frontend hands the whole array to the claimer in one transaction.
|
|
9
|
+
export const UnclaimedProofBatchSchema = z
|
|
10
|
+
.object({
|
|
11
|
+
distributionId: DistributionIdSchema,
|
|
12
|
+
merkleRoot: Hex32Schema,
|
|
13
|
+
amount: WeiSchema,
|
|
14
|
+
leafIndex: z.number().int().nonnegative(),
|
|
15
|
+
proof: z.array(Hex32Schema)
|
|
16
|
+
})
|
|
17
|
+
.openapi('UnclaimedProofBatch');
|
|
18
|
+
|
|
19
|
+
export type UnclaimedProofBatch = z.infer<typeof UnclaimedProofBatchSchema>;
|
|
20
|
+
|
|
21
|
+
export const UnclaimedProofsResponseSchema = z
|
|
22
|
+
.object({
|
|
23
|
+
items: z.array(UnclaimedProofBatchSchema)
|
|
24
|
+
})
|
|
25
|
+
.openapi('UnclaimedProofsResponse');
|
|
26
|
+
|
|
27
|
+
export type UnclaimedProofsResponse = z.infer<typeof UnclaimedProofsResponseSchema>;
|
package/src/zod.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { extendZodWithOpenApi } from '@asteasolutions/zod-to-openapi';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
// Side-effect-only import-time augmentation: adds `.openapi(...)` to
|
|
5
|
+
// every Zod schema. Imported once at the seam where schemas are first
|
|
6
|
+
// declared so it has run before any `registerPath` call.
|
|
7
|
+
extendZodWithOpenApi(z);
|
|
8
|
+
|
|
9
|
+
export { z };
|