@eco-foundation/api-schemas 0.3.0 → 0.4.1
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 +323 -9
- package/dist/fixtures/v1/deposit-addresses-create.response.gateway-erc20.json +13 -1
- package/dist/generated/build-digest.json +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.js +3 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/v1/endpoints/chains.d.ts +13 -0
- package/dist/v1/endpoints/chains.js +6 -1
- package/dist/v1/endpoints/chains.js.map +1 -1
- package/dist/v1/endpoints/deposit-addresses.d.ts +23 -0
- package/dist/v1/endpoints/deposit-addresses.js +34 -2
- package/dist/v1/endpoints/deposit-addresses.js.map +1 -1
- package/dist/v1/endpoints/quotes.d.ts +84 -7
- package/dist/v1/endpoints/quotes.js +13 -2
- package/dist/v1/endpoints/quotes.js.map +1 -1
- package/dist/v1/endpoints/registry.d.ts +38 -2
- package/dist/v1/endpoints/status.d.ts +5 -0
- package/dist/v1/endpoints/status.js +16 -1
- package/dist/v1/endpoints/status.js.map +1 -1
- package/dist/v1/errors/catalog.d.ts +28 -0
- package/dist/v1/errors/catalog.js +6 -0
- package/dist/v1/errors/catalog.js.map +1 -1
- package/dist/v1/errors/problem.d.ts +16 -1
- package/dist/v1/errors/problem.js +20 -1
- package/dist/v1/errors/problem.js.map +1 -1
- package/dist/v1/primitives.d.ts +2 -0
- package/dist/v1/primitives.js +4 -1
- package/dist/v1/primitives.js.map +1 -1
- package/dist/v1/types.d.ts +28 -1
- package/errors/catalog.lock.json +20 -0
- package/openapi/v1.json +218 -7
- package/package.json +12 -3
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Zod-first schemas, error catalog, golden fixtures, and generated OpenAPI 3.1 for
|
|
|
4
4
|
API. The Zod schemas are the source of truth; everything else (OpenAPI, fixtures, plain types)
|
|
5
5
|
is generated from or gated against them.
|
|
6
6
|
|
|
7
|
-
Today the package covers **13 endpoints across 12 paths**, **
|
|
7
|
+
Today the package covers **13 endpoints across 12 paths**, **37 error codes** (51 namespaced
|
|
8
8
|
legacy references), and **19 golden fixtures**.
|
|
9
9
|
|
|
10
10
|
## Install
|
|
@@ -14,17 +14,309 @@ While the package is 0.x, pin the patch range or the exact version:
|
|
|
14
14
|
```json
|
|
15
15
|
{
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@eco-foundation/api-schemas": "~0.
|
|
17
|
+
"@eco-foundation/api-schemas": "~0.4.1"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
**Never write `^0`.** npm resolves `^0.x` as `>=0.0.0 <1.0.0`, so it silently accepts every
|
|
23
|
-
future breaking `0.y` — it is not a pin at all. Use `~0.
|
|
23
|
+
future breaking `0.y` — it is not a pin at all. Use `~0.4.1` or the exact `0.4.1`.
|
|
24
24
|
|
|
25
25
|
A matching version string is not evidence of a matching artifact: also compare
|
|
26
26
|
`V1_SCHEMA_DIGEST` (see [Invariants](#invariants-enforced-in-ci)). Two builds both called
|
|
27
|
-
`0.
|
|
27
|
+
`0.4.0` — a registry copy and a `file:` tarball, say — can carry different schemas.
|
|
28
|
+
|
|
29
|
+
`zod` is a peer dependency, and since `0.3.1` an **optional** one — required only if you import a
|
|
30
|
+
zod-bearing entry point. Which case you are in is decided entirely by your imports; see
|
|
31
|
+
[Consumers](#consumers).
|
|
32
|
+
|
|
33
|
+
## Migrating 0.4.0 -> 0.4.1
|
|
34
|
+
|
|
35
|
+
Purely additive; no schema, wire, or digest change. `V1_SCHEMA_DIGEST` is UNCHANGED, so this is
|
|
36
|
+
not a coordinated-rollout release — a fleet may run 0.4.0 and 0.4.1 side by side.
|
|
37
|
+
|
|
38
|
+
**Added — the two conformance skip reasons are exported constants.**
|
|
39
|
+
`SIDE_EFFECT_SKIP_REASON` and `DRAFT_SKIP_REASON` are now named exports of the `./testing`
|
|
40
|
+
subpath. They were previously inline literals in this package's own spec, which meant a consumer
|
|
41
|
+
pinning them had to copy the strings and had no way to notice a rewording — the published tarball
|
|
42
|
+
ships `dist/`, never the sources those literals lived in. Import them instead of copying:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import { DRAFT_SKIP_REASON, SIDE_EFFECT_SKIP_REASON } from '@eco-foundation/api-schemas/testing';
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
This is also the first release cut from `eco/eco-api-schemas`, the package's own repository. It
|
|
49
|
+
previously shipped from a pnpm workspace inside `eco-incorp/router`; nothing about the published
|
|
50
|
+
artifact's contents or layout changed with the move.
|
|
51
|
+
|
|
52
|
+
## Migrating 0.3.1 -> 0.4.0
|
|
53
|
+
|
|
54
|
+
`0.3.1` was never published, so **`0.4.0` is the upgrade from `0.3.0`** and carries `0.3.1`'s
|
|
55
|
+
change as well. It is a BREAKING release under 0.x semver (breaking bumps the minor while the
|
|
56
|
+
major is 0), and it carries ONE breaking change plus two additive ones. The break is scoped to
|
|
57
|
+
consumers that read the **SVM** branch of a quote's funding transaction; EVM quotes are
|
|
58
|
+
byte-identical to `0.3.0`. Nothing here rejects a request body `0.3.0` accepted, and no existing
|
|
59
|
+
code, status, or `legacyCodes` mapping moved.
|
|
60
|
+
|
|
61
|
+
**`V1_SCHEMA_DIGEST` MOVES.** Both digest inputs changed (`errors/catalog.lock.json` gained four
|
|
62
|
+
codes, and `openapi/v1.json` was regenerated for both the instruction list and the new response
|
|
63
|
+
member), so the value is now
|
|
64
|
+
`1d8e88e957795b23e1317dc1e3783fd64bf79b756e3f28bd40e02b047542d790` — was
|
|
65
|
+
`3d41b4893b54e77e9ea56c24af1d7a1e9de0685ee911e497834dcd746e72c1f6` on `0.3.0`/`0.3.1`. Every
|
|
66
|
+
consumer running `assertNoSkew` must move to the new value **in the same rollout**: the check
|
|
67
|
+
compares services against each other, so a fleet running two versions fails it by design.
|
|
68
|
+
|
|
69
|
+
**THE BREAKING HALF FIRST (PAR-576), then the two additive ones (PAR-601, PAR-605).**
|
|
70
|
+
|
|
71
|
+
**The SVM funding transaction is now an ORDERED LIST OF INSTRUCTIONS, not a serialized
|
|
72
|
+
transaction.** `SvmTransactionSchema` dropped `serializedTransaction` and gained `feePayer`
|
|
73
|
+
and `instructions`:
|
|
74
|
+
|
|
75
|
+
```diff
|
|
76
|
+
-{ "kind": "svm", "chainId": 1399811149, "serializedTransaction": "<base64 tx>" }
|
|
77
|
+
+{
|
|
78
|
+
+ "kind": "svm",
|
|
79
|
+
+ "chainId": 1399811149,
|
|
80
|
+
+ "feePayer": "<base58 pubkey>",
|
|
81
|
+
+ "instructions": [
|
|
82
|
+
+ {
|
|
83
|
+
+ "programId": "<base58 pubkey>",
|
|
84
|
+
+ "accounts": [{ "pubkey": "<base58>", "isSigner": true, "isWritable": true }],
|
|
85
|
+
+ "data": "<base64: 8-byte Anchor discriminator + Borsh args>"
|
|
86
|
+
+ }
|
|
87
|
+
+ ]
|
|
88
|
+
+}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
`serializedTransaction` is not deprecated-but-accepted; the key is gone and a body carrying
|
|
92
|
+
it fails `QuoteResponseSchema`. That is deliberate — response schemas are `looseObject`, so
|
|
93
|
+
leaving the old key valid would let a consumer keep reading a field the server no longer
|
|
94
|
+
fills and get `undefined` at signing time instead of a named rejection.
|
|
95
|
+
|
|
96
|
+
**Why the break, since `0.3.1` never shipped a working SVM quote:** a serialized Solana
|
|
97
|
+
transaction embeds a recent blockhash, valid for roughly 150 slots — 60 to 90 seconds. Every
|
|
98
|
+
realistic caller flow (fetch the quote, render it, let a human review it, sign, submit) is
|
|
99
|
+
longer than that, so the transaction was already dead when the caller signed it, the failure
|
|
100
|
+
surfaced as an opaque `BlockhashNotFound`, and the schema carried no field with which to
|
|
101
|
+
refresh it. The old shape was undeliverable rather than merely awkward. Instructions have no
|
|
102
|
+
expiry: the caller fetches its own blockhash at signing time, which is how every Solana
|
|
103
|
+
wallet already works.
|
|
104
|
+
|
|
105
|
+
**What the caller now owns.** In order:
|
|
106
|
+
|
|
107
|
+
1. Fetch a recent blockhash (or use a durable nonce).
|
|
108
|
+
2. Compile `instructions` **in the given order** into a legacy or v0 message, with `feePayer`
|
|
109
|
+
as the fee payer.
|
|
110
|
+
3. Sign with every key marked `isSigner` — `feePayer` is always one of them.
|
|
111
|
+
4. Choose its own compute-unit limit and priority fee. None is prescribed.
|
|
112
|
+
|
|
113
|
+
**Two contracts that are load-bearing, and that no schema can check for you:**
|
|
114
|
+
|
|
115
|
+
- **`instructions[].accounts` is POSITIONAL.** Solana resolves an instruction's accounts by
|
|
116
|
+
INDEX. Pass the array through verbatim — do not sort it, deduplicate it, drop an account
|
|
117
|
+
that also appears in another instruction, or regroup signers and writables. A permuted list
|
|
118
|
+
is a different instruction that still validates, and it fails on-chain with an unhelpful
|
|
119
|
+
message (a permuted Eco Portal `fund` reports `InvalidVault`, `InvalidAta` or
|
|
120
|
+
`InvalidTokenTransferAccounts` depending on which pair swapped). The schema does not know
|
|
121
|
+
which program `programId` is, so it cannot police this; it validates each entry's shape and
|
|
122
|
+
the PRESENCE of both privilege flags, and nothing more.
|
|
123
|
+
- **`instructions` may exceed one transaction, and that is not an error.** A public-visibility
|
|
124
|
+
quote emits `Portal.publish` (carrying the whole route preimage) plus `Portal.fund`, and
|
|
125
|
+
Solana's packet ceiling is 1232 bytes: an EVM-destination route with one token and one call
|
|
126
|
+
ABI-encodes to about 600 bytes, so `publish` alone is roughly 710 bytes of instruction data,
|
|
127
|
+
`fund` adds about 173, and ten unique pubkeys add about 320 — over the ceiling before
|
|
128
|
+
headers. The instructions are independent on-chain, so submit them in the given order across
|
|
129
|
+
two transactions, or compile a v0 message against your own address-lookup table. Splitting is
|
|
130
|
+
safe; reordering is not.
|
|
131
|
+
|
|
132
|
+
**No address-lookup-table references are emitted.** An ALT must already exist on-chain and
|
|
133
|
+
eco-router has no Solana RPC with which to create or read one, so every account is inline and
|
|
134
|
+
the message compiles as legacy. Bring your own ALT if you want a v0 message; the account metas
|
|
135
|
+
are unaffected by that choice.
|
|
136
|
+
|
|
137
|
+
**`isSigner` and `isWritable` are REQUIRED booleans** on every account meta, never optional and
|
|
138
|
+
never defaulted. Both directions of a wrong value are a real failure — a missing `isWritable`
|
|
139
|
+
makes the program's write revert, a missing `isSigner` makes Anchor's `Signer` constraint reject
|
|
140
|
+
the instruction — so absence is a 400 rather than a guess.
|
|
141
|
+
|
|
142
|
+
**New, additive:** the `Base64Bytes` primitive (standard padded base64; URL-safe, unpadded, and
|
|
143
|
+
whitespace-bearing values are rejected, because Node's decoder silently accepts all three and
|
|
144
|
+
strict decoders do not), plus the `SvmAccountMetaSchema` / `SvmInstructionSchema` schemas and the
|
|
145
|
+
zod-free `V1SvmAccountMeta` / `V1SvmInstruction` aliases.
|
|
146
|
+
|
|
147
|
+
**Unchanged:** the EVM branch, every request schema, and the error catalog — it gained NO new
|
|
148
|
+
codes from this change.
|
|
149
|
+
|
|
150
|
+
**TVM STAYS UNREPRESENTABLE, AND THAT IS NOW A DECISION RATHER THAN AN OPEN QUESTION.** Tron is
|
|
151
|
+
OUT OF SCOPE for `/v1` funding. `FundingTransactionSchema` has no `tvm` member, a `kind: "tvm"`
|
|
152
|
+
transaction fails `QuoteResponseSchema`, and eco-router answers `chain-not-supported` (422) for a
|
|
153
|
+
Tron-source funding quote. Do not read the SVM lane as a precedent that a `tvm` branch is queued
|
|
154
|
+
behind it: adding one would be a breaking wire change with its own migration note, and nothing
|
|
155
|
+
here commits `/v1` to that surface.
|
|
156
|
+
|
|
157
|
+
**Added — `./package.json` is an exported subpath.**
|
|
158
|
+
`require('@eco-foundation/api-schemas/package.json')` previously threw
|
|
159
|
+
`ERR_PACKAGE_PATH_NOT_EXPORTED`, which broke tooling that reads a dependency's manifest for
|
|
160
|
+
its version. Nothing else changes; it is purely additive. (`prepack` now also rebuilds
|
|
161
|
+
`dist/` on a manual `npm pack`/`npm publish`, which affects publishing rather than
|
|
162
|
+
consuming.)
|
|
163
|
+
|
|
164
|
+
**Added — the `errors` problem extension (per-field caller faults).**
|
|
165
|
+
|
|
166
|
+
```json
|
|
167
|
+
{
|
|
168
|
+
"type": "https://.../invalid-request",
|
|
169
|
+
"title": "Invalid request",
|
|
170
|
+
"status": 400,
|
|
171
|
+
"code": "invalid-request",
|
|
172
|
+
"detail": "source.chainId: must be a supported chain id",
|
|
173
|
+
"errors": [{ "field": "source.chainId", "detail": "must be a supported chain id" }]
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
`errors` is **OPTIONAL**: an `invalid-request` for a body that is not JSON at all has no
|
|
178
|
+
field to name, so absence is legal and means exactly that. `field` names the offending
|
|
179
|
+
input in YOUR terms — the path into what you sent, with **no `body.`/`query.` prefix**:
|
|
180
|
+
`source.chainId`, `funder`, `limit`. `detail` obeys the same free-text policy as the
|
|
181
|
+
problem's own `detail`.
|
|
182
|
+
|
|
183
|
+
Because there is no prefix, `field` alone does not say whether the value came from the body
|
|
184
|
+
or the query string. Every /v1 endpoint takes its parameters in exactly one of the two, so
|
|
185
|
+
**key on the route plus `field`**, not on `field` alone.
|
|
186
|
+
|
|
187
|
+
**`errors` is NOT `solverErrors`.** They sit adjacent and answer different questions:
|
|
188
|
+
`errors` is your own fault (a field you sent, and naming it is how you fix it);
|
|
189
|
+
`solverErrors` is a downstream solver's failure, which you did not cause and usually
|
|
190
|
+
cannot fix. A body never needs both to explain one failure. The name `errors` is the
|
|
191
|
+
de-facto RFC 9457 validation extension (Spring `ProblemDetail`, ASP.NET
|
|
192
|
+
`ValidationProblemDetails`), so it is probably already in your SDK.
|
|
193
|
+
|
|
194
|
+
`problemFromZodError` populates it from the issues it already renders into `detail`, so
|
|
195
|
+
you get the machine-readable form for free — bounded to 8 entries, and an issue with no
|
|
196
|
+
path is omitted rather than given a placeholder field.
|
|
197
|
+
|
|
198
|
+
**Added — `chains`, REQUIRED on the deposit-address create response (PAR-571).**
|
|
199
|
+
|
|
200
|
+
```json
|
|
201
|
+
{
|
|
202
|
+
"id": "deposit-address:0x…",
|
|
203
|
+
"chains": [
|
|
204
|
+
{ "chainId": 8453, "source": true, "registration": "registered" },
|
|
205
|
+
{ "chainId": 137, "source": false, "registration": "registered" }
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Four identifiers, two pairs, and the members of a pair are one word apart — pair them
|
|
211
|
+
carefully, because the wrong pairing still compiles.
|
|
212
|
+
**`DepositAddressChainRegistrationSchema`** is the ENUM and
|
|
213
|
+
**`DepositAddressChainRegistration`** its inferred type;
|
|
214
|
+
**`DepositAddressChainStatusSchema`** is the OBJECT that `chains[]` holds and
|
|
215
|
+
**`DepositAddressChainStatus`** its inferred type. The `Schema` suffix is what distinguishes
|
|
216
|
+
schema from type — the bare name is always the type.
|
|
217
|
+
|
|
218
|
+
**REQUIRED on the create response, and absent from the shared record.**
|
|
219
|
+
`DepositAddressCreateResponseSchema` is now `DepositAddressSchema.extend({ chains })`
|
|
220
|
+
rather than a bare alias. If you read a create response, `chains` is always there; if you
|
|
221
|
+
read a lookup page, it is never there. That is deliberate — an optional member on the
|
|
222
|
+
shared record would make one key mean "bug" on one lane and "correct" on the other, with
|
|
223
|
+
nothing in the type to distinguish them. **Migration:** a server build that returns 201
|
|
224
|
+
without `chains` now fails its own response schema.
|
|
225
|
+
|
|
226
|
+
`.min(1)`: the source chain is always attempted, so an empty array could only mean the
|
|
227
|
+
producer lost the outcome — and an empty `chains` reads as "no chain is live", the
|
|
228
|
+
opposite of what a 201 means.
|
|
229
|
+
|
|
230
|
+
**Two constraints are enforced beyond the shape:** exactly one entry has `source: true`,
|
|
231
|
+
and no `chainId` repeats. `source` is what tells you which chain the top-level
|
|
232
|
+
`depositAddress` is definitely correct for, so zero or two source entries would be a
|
|
233
|
+
silently wrong answer about where funds may go. Errors name the field and carry the count
|
|
234
|
+
(`chains must contain exactly one source entry, found 2`); a duplicate is reported at the
|
|
235
|
+
offending index.
|
|
236
|
+
|
|
237
|
+
These live in a `superRefine`, which means **they do not appear in `openapi/v1.json`** —
|
|
238
|
+
`z.toJSONSchema` drops refinements. Validate against the zod schema if you need them
|
|
239
|
+
enforced; a client generated from the OpenAPI document alone will accept a body the zod
|
|
240
|
+
schema rejects.
|
|
241
|
+
|
|
242
|
+
**What `.min(1)` does NOT give you:** it rejects an empty array, not an incomplete one. A
|
|
243
|
+
schema cannot know which chains should be present. Completeness is a producer guarantee —
|
|
244
|
+
deposit-addresses builds the array from the full attempted set — not something validated
|
|
245
|
+
here.
|
|
246
|
+
|
|
247
|
+
Two things to read correctly:
|
|
248
|
+
|
|
249
|
+
- **`registration` is binary today.** The enum exists so `'pending'` can be added
|
|
250
|
+
additively if a retry lane is ever built; there is no such lane, so do not look for a
|
|
251
|
+
third state.
|
|
252
|
+
- **`registration: "registered"` means the chain-state ROW EXISTS.** That row is what the
|
|
253
|
+
polling services rebuild their watch set from at boot. It does NOT promise the
|
|
254
|
+
in-process publish succeeded, so it can **lead the live process by one restart**. Read
|
|
255
|
+
it as "known, and picked up no later than the next boot" — never "being watched right
|
|
256
|
+
now". It is also **not** `isDeployed`, which is CREATE2 deployment of the address
|
|
257
|
+
contract: `isDeployed: false` does not mean "do not send funds here".
|
|
258
|
+
|
|
259
|
+
New zod-free aliases: `V1DepositAddressChainStatus` and `V1DepositAddressCreateResponse`.
|
|
260
|
+
|
|
261
|
+
**Added — four error codes for the transport statuses `/v1` could not answer (PAR-601).**
|
|
262
|
+
|
|
263
|
+
| Code | Status | Reached by |
|
|
264
|
+
| ------------------------ | ------ | ------------------------------------------------------------ |
|
|
265
|
+
| `endpoint-not-found` | 404 | a typo'd path — no `/v1` endpoint at that path |
|
|
266
|
+
| `method-not-allowed` | 405 | a real path, wrong HTTP method |
|
|
267
|
+
| `request-too-large` | 413 | body bytes over the limit, or too many urlencoded parameters |
|
|
268
|
+
| `unsupported-media-type` | 415 | an unsupported media type, charset, or content encoding |
|
|
269
|
+
|
|
270
|
+
All four are `audience: 'all'` and carry no `legacyCodes`. Before `0.4.0` these four statuses
|
|
271
|
+
had no catalog code at all, so a `/v1` response at any of them fell through to eco-router's
|
|
272
|
+
legacy envelope — a partner SDK keying on `type`/`code` saw neither.
|
|
273
|
+
|
|
274
|
+
**The one newly-possible rejection, and it is consumer-side.** `V1ProblemSchema` cross-checks a
|
|
275
|
+
KNOWN code's `status`/`type` against the catalog and ignores codes it does not know. These four
|
|
276
|
+
are now known, so a problem body carrying one of them with a CONTRADICTING status or type stops
|
|
277
|
+
parsing where `0.3.0` tolerated it as "a newer server". If you already emit any of these four
|
|
278
|
+
spellings, confirm the status and `type` match the table above before upgrading.
|
|
279
|
+
|
|
280
|
+
**`endpoint-not-found` is NOT `token-not-found`.** Both are 404. A consumer branching on status
|
|
281
|
+
alone will conflate "that path does not exist" with "that token is unknown on that chain" —
|
|
282
|
+
branch on `code`.
|
|
283
|
+
|
|
284
|
+
**Exhaustive `switch` over `V1ErrorCode` will not compile until you handle the four.** That is
|
|
285
|
+
the intended signal, not a break to work around.
|
|
286
|
+
|
|
287
|
+
**Added — `/v1/chains` may advertise the deployment's effective page bounds (PAR-605).**
|
|
288
|
+
|
|
289
|
+
```json
|
|
290
|
+
{
|
|
291
|
+
"chains": [{ "chainId": 8453, "...": "..." }],
|
|
292
|
+
"limits": { "paging": { "maxLimit": 25, "defaultLimit": 10 } }
|
|
293
|
+
}
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
`limits` is **OPTIONAL**, and **absence has a documented meaning: the published `PagingFields`
|
|
297
|
+
bounds apply** — cap `STATUS_PAGE_MAX_LIMIT` (50), default `STATUS_PAGE_DEFAULT_LIMIT` (20),
|
|
298
|
+
which is exactly the `0.3.0` contract. So a server that does not populate it stays correct and
|
|
299
|
+
a consumer needs no new branch. When `limits` IS present, `paging` is required inside it:
|
|
300
|
+
`limits: {}` is rejected rather than read as "bounds advertised, none given".
|
|
301
|
+
|
|
302
|
+
An operator may only NARROW, so both numbers are capped at the canon values, and
|
|
303
|
+
`defaultLimit <= maxLimit` is enforced — a deployment cannot advertise a first page it would
|
|
304
|
+
reject on request.
|
|
305
|
+
|
|
306
|
+
Read it if you choose page sizes programmatically. The 400 that names the bound is unchanged;
|
|
307
|
+
this exists so the bound is discoverable in one request rather than one rejection.
|
|
308
|
+
|
|
309
|
+
**Scope — it is the bound of the service serving that document.** eco-router serves
|
|
310
|
+
`/v1/chains` and `/v1/intents/status` from one config, so its answer covers both.
|
|
311
|
+
`/v1/deposit-addresses/status` and the `/v1/deposit-addresses` lookup are the
|
|
312
|
+
deposit-addresses service's, paged from its own config; `DepositAddressLookupResponseSchema`
|
|
313
|
+
deliberately does not carry this member.
|
|
314
|
+
|
|
315
|
+
**Carried over from the unpublished `0.3.1`: the `zod` peer is now `optional`.** The range is
|
|
316
|
+
unchanged (`^4.3.0`). It only widens the set of installs that resolve cleanly — a consumer
|
|
317
|
+
importing only the zod-free entry points (`./v1/signature`, `./v1/types`) no longer gets a
|
|
318
|
+
permanently wrong unmet-peer warning. `optional` suppresses the warning only when zod is
|
|
319
|
+
ABSENT: a consumer holding a zod outside `^4.3.0` still sees a version-mismatch warning.
|
|
28
320
|
|
|
29
321
|
## Migrating 0.2.0 -> 0.3.0
|
|
30
322
|
|
|
@@ -134,11 +426,32 @@ must: it is the artifact identity, not the version string.
|
|
|
134
426
|
| solver-v2 (Zod 3 — must not upgrade) | `import type { V1QuoteResponse } from '@eco-foundation/api-schemas/v1/types'` + fixtures | ZERO zod at runtime and in the `.d.ts` |
|
|
135
427
|
| any consumer needing `signatureHash` | `import { signatureHash } from '@eco-foundation/api-schemas/v1/signature'` | NONE — that subpath is zod-free |
|
|
136
428
|
|
|
429
|
+
**Do you need `zod`? Only if you import a zod-bearing entry point.** Since `0.3.1` the peer is
|
|
430
|
+
declared optional (`peerDependenciesMeta: { zod: { optional: true } }`), because for two of the
|
|
431
|
+
published entry points it is genuinely not needed:
|
|
432
|
+
|
|
433
|
+
- **Needs `zod` (`^4.3.0`):** the bare package name `.`, `./testing`, and anything reached
|
|
434
|
+
through the `v1` namespace on either. These load schema modules, and their `.d.ts` names zod
|
|
435
|
+
types.
|
|
436
|
+
- **Needs NO `zod`:** `./v1/signature` (runtime code importing `@noble/hashes` and nothing else)
|
|
437
|
+
and `./v1/types` (plain `type` aliases, erased at compile time). A consumer whose imports stay
|
|
438
|
+
inside these two installs only `@noble/hashes` — declaring zod would be dead weight.
|
|
439
|
+
|
|
440
|
+
Read `optional` narrowly: it says zod **may be absent**, not that any zod version works. pnpm
|
|
441
|
+
suppresses the unmet-peer warning only when zod is MISSING (verified against pnpm 10.16); a
|
|
442
|
+
consumer that HAS a zod outside `^4.3.0` — solver-v2, on zod 3 — still sees
|
|
443
|
+
`unmet peer zod@^4.3.0: found <version>`, since that is a version mismatch rather than a missing
|
|
444
|
+
peer. Suppressing that one is the consumer's own call
|
|
445
|
+
(`pnpm.peerDependencyRules.allowedVersions`), and it is safe exactly while its imports are
|
|
446
|
+
limited to the two zod-free subpaths above. The range itself cannot be widened — the schemas
|
|
447
|
+
require Zod 4.
|
|
448
|
+
|
|
137
449
|
Zod-major compatibility is the reason there are two interfaces, not one:
|
|
138
450
|
|
|
139
451
|
- **Zod-4 consumers** (eco-router `^4.4.3`, deposit-addresses `^4.3.5`) import the schemas
|
|
140
|
-
directly. Since `0.2.0`, `zod` is a **`peerDependency` with a range (`^4.3.0`)
|
|
141
|
-
hard-pinned dependency: the consumer's own single copy satisfies it.
|
|
452
|
+
directly. Since `0.2.0`, `zod` is a **`peerDependency` with a range (`^4.3.0`)** — optional
|
|
453
|
+
since `0.3.1` — not a hard-pinned dependency: the consumer's own single copy satisfies it. For
|
|
454
|
+
these consumers optional changes nothing; they must still install zod. The previous exact
|
|
142
455
|
`dependencies` pin at `4.4.3` materialised a SECOND nested zod for every consumer not on that
|
|
143
456
|
exact version, and two zod instances in one type graph is the documented failure — `TS2345` on
|
|
144
457
|
`_zod.version.minor` when a package schema is passed to a local `z.ZodType<T>`, and `tsc`
|
|
@@ -264,12 +577,13 @@ Two `catalog:check` outcomes are NOT failures and must not be confused with each
|
|
|
264
577
|
|
|
265
578
|
## Publishing
|
|
266
579
|
|
|
267
|
-
Tag `
|
|
268
|
-
|
|
580
|
+
Tag `v<version>` (must equal `package.json` version) — the `publish` workflow verifies and
|
|
581
|
+
publishes. It needs the `NPM_TOKEN` repo secret (an npm automation token with publish rights on
|
|
582
|
+
`@eco-foundation`). It fails with `::error::tag version <x> != package version <y>`
|
|
269
583
|
if the two drift, so a stale tag can never publish a mismatched artifact.
|
|
270
584
|
|
|
271
585
|
Semver: breaking schema change = major, additive = minor; consumers pin minor. **While the
|
|
272
|
-
package is 0.x, "pin minor" means `~0.
|
|
586
|
+
package is 0.x, "pin minor" means `~0.4.1` or the exact `0.4.1` — never `^0`** (see
|
|
273
587
|
[Install](#install)). Consumers additionally compare `V1_SCHEMA_DIGEST`: a matching version
|
|
274
588
|
string is not evidence of a matching artifact. `/v1/routes` is draft-tagged and exempt until its
|
|
275
589
|
stability flips.
|
|
@@ -15,6 +15,18 @@
|
|
|
15
15
|
"destinationAddress": "0x1111111111111111111111111111111111111111",
|
|
16
16
|
"destinationChainId": 137,
|
|
17
17
|
"expiresAt": null,
|
|
18
|
-
"createdAt": 1767225000
|
|
18
|
+
"createdAt": 1767225000,
|
|
19
|
+
"chains": [
|
|
20
|
+
{
|
|
21
|
+
"chainId": 8453,
|
|
22
|
+
"source": true,
|
|
23
|
+
"registration": "registered"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"chainId": 137,
|
|
27
|
+
"source": false,
|
|
28
|
+
"registration": "registered"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
19
31
|
}
|
|
20
32
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export { generateOpenApiDocument, STABLE_TAG } from './openapi';
|
|
|
3
3
|
export type { V1Fixture } from './testing';
|
|
4
4
|
export { assertMatchesV1Schema, loadV1Fixtures } from './testing';
|
|
5
5
|
export * as v1 from './v1';
|
|
6
|
-
export type { LegacyCodeRef, V1Chain, V1ChainType, V1DepositAddress, V1DepositAddressCreateRequest, V1DepositAddressKind, V1DestinationCall, V1ErrorCode, V1ErrorDefinition, V1Execution, V1Fee, V1FeeKind, V1FeeToken, V1FundingTransaction, V1GaslessJob, V1GaslessJobStatus, V1GaslessSubState, V1GaslessSubStatus, V1Guarantee, V1IntentCall, V1IntentReward, V1IntentRoute, V1IntentTokenAmount, V1ProblemBody, V1QuoteCore, V1QuoteRequest, V1QuoteResponse, V1RankedQuoteEntry, V1RelatedIntent, V1RelatedIntentRole, V1SolverIdentity, V1StatusEntry, V1StatusType, V1Step, V1StepKind, V1StepLeg, V1SwapType, V1TokenEntry, V1Visibility, } from './v1/types';
|
|
6
|
+
export type { LegacyCodeRef, V1Chain, V1ChainType, V1DepositAddress, V1DepositAddressChainStatus, V1DepositAddressCreateRequest, V1DepositAddressCreateResponse, V1DepositAddressKind, V1DestinationCall, V1ErrorCode, V1ErrorDefinition, V1Execution, V1Fee, V1FeeKind, V1FeeToken, V1FundingTransaction, V1GaslessJob, V1GaslessJobStatus, V1GaslessSubState, V1GaslessSubStatus, V1Guarantee, V1IntentCall, V1IntentReward, V1IntentRoute, V1IntentTokenAmount, V1ProblemBody, V1QuoteCore, V1QuoteRequest, V1QuoteResponse, V1RankedQuoteEntry, V1RelatedIntent, V1RelatedIntentRole, V1SolverIdentity, V1StatusEntry, V1StatusType, V1Step, V1StepKind, V1StepLeg, V1SvmAccountMeta, V1SvmInstruction, V1SwapType, V1TokenEntry, V1Visibility, } from './v1/types';
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -5,3 +5,5 @@ export declare function assertMatchesV1Schema(endpointId: V1EndpointId, payload:
|
|
|
5
5
|
direction?: 'request' | 'response';
|
|
6
6
|
}): void;
|
|
7
7
|
export declare function loadV1Fixtures(): readonly V1Fixture[];
|
|
8
|
+
export declare const SIDE_EFFECT_SKIP_REASON = "sideEffect fixture \u2014 covered by flow E2Es";
|
|
9
|
+
export declare const DRAFT_SKIP_REASON = "draft endpoint (x-stability: draft) \u2014 not served at launch";
|
package/dist/testing/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DRAFT_SKIP_REASON = exports.SIDE_EFFECT_SKIP_REASON = void 0;
|
|
3
4
|
exports.assertMatchesV1Schema = assertMatchesV1Schema;
|
|
4
5
|
exports.loadV1Fixtures = loadV1Fixtures;
|
|
5
6
|
const zod_1 = require("zod");
|
|
@@ -24,4 +25,6 @@ function assertMatchesV1Schema(endpointId, payload, opts = {}) {
|
|
|
24
25
|
function loadV1Fixtures() {
|
|
25
26
|
return fixtures_1.V1_FIXTURES;
|
|
26
27
|
}
|
|
28
|
+
exports.SIDE_EFFECT_SKIP_REASON = 'sideEffect fixture — covered by flow E2Es';
|
|
29
|
+
exports.DRAFT_SKIP_REASON = 'draft endpoint (x-stability: draft) — not served at launch';
|
|
27
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":";;;AA0BA,sDAqBC;AAED,wCAEC;AAnDD,6BAAwB;AAExB,0CAAqD;AACrD,uDAA4F;AAY5F,MAAM,WAAW,GAA+C,uBAAY,CAAC;AAW7E,SAAgB,qBAAqB,CACnC,UAAwB,EACxB,OAAgB,EAChB,OAA+C,EAAE;IAEjD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,UAAU,CAAC;IAC/C,MAAM,GAAG,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;IACpC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,4BAA4B,MAAM,CAAC,UAAU,CAAC,iBAAiB,SAAS,KAAK;YAC3E,cAAc,MAAM,CAAC,IAAI,CAAC,uBAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACvD,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAA0B,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC;IAC3F,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,WAAW,SAAS,SAAS,CAAC,CAAC;IACzE,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,0BAA0B,UAAU,IAAI,SAAS,aAAa,OAAC,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC9F,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAgB,cAAc;IAC5B,OAAO,sBAAW,CAAC;AACrB,CAAC;AASY,QAAA,uBAAuB,GAAG,2CAA2C,CAAC;AACtE,QAAA,iBAAiB,GAAG,4DAA4D,CAAC"}
|
|
@@ -26,6 +26,13 @@ export declare const ChainSchema: z.ZodObject<{
|
|
|
26
26
|
}, z.core.$loose>;
|
|
27
27
|
}, z.core.$loose>;
|
|
28
28
|
export type Chain = z.input<typeof ChainSchema>;
|
|
29
|
+
export declare const V1LimitsSchema: z.ZodObject<{
|
|
30
|
+
paging: z.ZodObject<{
|
|
31
|
+
maxLimit: z.ZodNumber;
|
|
32
|
+
defaultLimit: z.ZodNumber;
|
|
33
|
+
}, z.core.$loose>;
|
|
34
|
+
}, z.core.$loose>;
|
|
35
|
+
export type V1Limits = z.input<typeof V1LimitsSchema>;
|
|
29
36
|
export declare const ChainsResponseSchema: z.ZodObject<{
|
|
30
37
|
chains: z.ZodArray<z.ZodObject<{
|
|
31
38
|
chainId: z.ZodNumber;
|
|
@@ -49,4 +56,10 @@ export declare const ChainsResponseSchema: z.ZodObject<{
|
|
|
49
56
|
executor: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodString]>, z.ZodString]>>;
|
|
50
57
|
}, z.core.$loose>;
|
|
51
58
|
}, z.core.$loose>>;
|
|
59
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
paging: z.ZodObject<{
|
|
61
|
+
maxLimit: z.ZodNumber;
|
|
62
|
+
defaultLimit: z.ZodNumber;
|
|
63
|
+
}, z.core.$loose>;
|
|
64
|
+
}, z.core.$loose>>;
|
|
52
65
|
}, z.core.$loose>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ChainsResponseSchema = exports.ChainSchema = exports.ChainContractsSchema = void 0;
|
|
3
|
+
exports.ChainsResponseSchema = exports.V1LimitsSchema = exports.ChainSchema = exports.ChainContractsSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const enums_1 = require("../enums");
|
|
6
6
|
const primitives_1 = require("../primitives");
|
|
7
|
+
const status_1 = require("./status");
|
|
7
8
|
exports.ChainContractsSchema = zod_1.z.looseObject({
|
|
8
9
|
portal: primitives_1.AnyAddress,
|
|
9
10
|
executor: primitives_1.AnyAddress.nullable(),
|
|
@@ -17,7 +18,11 @@ exports.ChainSchema = zod_1.z.looseObject({
|
|
|
17
18
|
status: enums_1.ChainStatus,
|
|
18
19
|
contracts: exports.ChainContractsSchema,
|
|
19
20
|
});
|
|
21
|
+
exports.V1LimitsSchema = zod_1.z.looseObject({
|
|
22
|
+
paging: status_1.PagingBoundsSchema,
|
|
23
|
+
});
|
|
20
24
|
exports.ChainsResponseSchema = zod_1.z.looseObject({
|
|
21
25
|
chains: zod_1.z.array(exports.ChainSchema),
|
|
26
|
+
limits: exports.V1LimitsSchema.optional(),
|
|
22
27
|
});
|
|
23
28
|
//# sourceMappingURL=chains.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chains.js","sourceRoot":"","sources":["../../../src/v1/endpoints/chains.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,oCAAiE;AACjE,8CAAoD;
|
|
1
|
+
{"version":3,"file":"chains.js","sourceRoot":"","sources":["../../../src/v1/endpoints/chains.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,oCAAiE;AACjE,8CAAoD;AACpD,qCAA8C;AAKjC,QAAA,oBAAoB,GAAG,OAAC,CAAC,WAAW,CAAC;IAChD,MAAM,EAAE,uBAAU;IAMlB,QAAQ,EAAE,uBAAU,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAEU,QAAA,WAAW,GAAG,OAAC,CAAC,WAAW,CAAC;IACvC,OAAO,EAAE,oBAAO;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IASvB,WAAW,EAAE,uBAAU;IAEvB,IAAI,EAAE,iBAAS;IACf,QAAQ,EAAE,qBAAa;IAEvB,MAAM,EAAE,mBAAW;IACnB,SAAS,EAAE,4BAAoB;CAChC,CAAC,CAAC;AAwCU,QAAA,cAAc,GAAG,OAAC,CAAC,WAAW,CAAC;IAC1C,MAAM,EAAE,2BAAkB;CAC3B,CAAC,CAAC;AAGU,QAAA,oBAAoB,GAAG,OAAC,CAAC,WAAW,CAAC;IAChD,MAAM,EAAE,OAAC,CAAC,KAAK,CAAC,mBAAW,CAAC;IAC5B,MAAM,EAAE,sBAAc,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC"}
|
|
@@ -40,6 +40,20 @@ export declare const DepositAddressSchema: z.ZodObject<{
|
|
|
40
40
|
createdAt: z.ZodNumber;
|
|
41
41
|
}, z.core.$loose>;
|
|
42
42
|
export type DepositAddress = z.input<typeof DepositAddressSchema>;
|
|
43
|
+
export declare const DepositAddressChainRegistrationSchema: z.ZodEnum<{
|
|
44
|
+
registered: "registered";
|
|
45
|
+
unregistered: "unregistered";
|
|
46
|
+
}>;
|
|
47
|
+
export type DepositAddressChainRegistration = z.infer<typeof DepositAddressChainRegistrationSchema>;
|
|
48
|
+
export declare const DepositAddressChainStatusSchema: z.ZodObject<{
|
|
49
|
+
chainId: z.ZodNumber;
|
|
50
|
+
source: z.ZodBoolean;
|
|
51
|
+
registration: z.ZodEnum<{
|
|
52
|
+
registered: "registered";
|
|
53
|
+
unregistered: "unregistered";
|
|
54
|
+
}>;
|
|
55
|
+
}, z.core.$loose>;
|
|
56
|
+
export type DepositAddressChainStatus = z.input<typeof DepositAddressChainStatusSchema>;
|
|
43
57
|
export declare const DepositAddressCreateResponseSchema: z.ZodObject<{
|
|
44
58
|
id: z.ZodString;
|
|
45
59
|
depositAddress: z.ZodString;
|
|
@@ -54,7 +68,16 @@ export declare const DepositAddressCreateResponseSchema: z.ZodObject<{
|
|
|
54
68
|
destinationChainId: z.ZodOptional<z.ZodNumber>;
|
|
55
69
|
expiresAt: z.ZodNullable<z.ZodNumber>;
|
|
56
70
|
createdAt: z.ZodNumber;
|
|
71
|
+
chains: z.ZodArray<z.ZodObject<{
|
|
72
|
+
chainId: z.ZodNumber;
|
|
73
|
+
source: z.ZodBoolean;
|
|
74
|
+
registration: z.ZodEnum<{
|
|
75
|
+
registered: "registered";
|
|
76
|
+
unregistered: "unregistered";
|
|
77
|
+
}>;
|
|
78
|
+
}, z.core.$loose>>;
|
|
57
79
|
}, z.core.$loose>;
|
|
80
|
+
export type DepositAddressCreateResponse = z.input<typeof DepositAddressCreateResponseSchema>;
|
|
58
81
|
export declare const DEPOSIT_ADDRESS_LOOKUP_QUERY_SHAPE: {
|
|
59
82
|
cursor: z.ZodOptional<z.ZodString>;
|
|
60
83
|
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DepositAddressLookupResponseSchema = exports.DepositAddressLookupQuerySchema = exports.DEPOSIT_ADDRESS_LOOKUP_QUERY_SHAPE = exports.DepositAddressCreateResponseSchema = exports.DepositAddressSchema = exports.DepositAddressCreateRequestSchema = exports.DepositAddressKind = exports.DEPOSIT_ADDRESS_KINDS = void 0;
|
|
3
|
+
exports.DepositAddressLookupResponseSchema = exports.DepositAddressLookupQuerySchema = exports.DEPOSIT_ADDRESS_LOOKUP_QUERY_SHAPE = exports.DepositAddressCreateResponseSchema = exports.DepositAddressChainStatusSchema = exports.DepositAddressChainRegistrationSchema = exports.DepositAddressSchema = exports.DepositAddressCreateRequestSchema = exports.DepositAddressKind = exports.DEPOSIT_ADDRESS_KINDS = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const primitives_1 = require("../primitives");
|
|
6
6
|
const status_1 = require("./status");
|
|
@@ -38,7 +38,39 @@ exports.DepositAddressSchema = zod_1.z.looseObject({
|
|
|
38
38
|
expiresAt: primitives_1.UnixSeconds.nullable(),
|
|
39
39
|
createdAt: primitives_1.UnixSeconds,
|
|
40
40
|
});
|
|
41
|
-
exports.
|
|
41
|
+
exports.DepositAddressChainRegistrationSchema = zod_1.z.enum(['registered', 'unregistered']);
|
|
42
|
+
exports.DepositAddressChainStatusSchema = zod_1.z.looseObject({
|
|
43
|
+
chainId: primitives_1.ChainId,
|
|
44
|
+
source: zod_1.z.boolean(),
|
|
45
|
+
registration: exports.DepositAddressChainRegistrationSchema,
|
|
46
|
+
});
|
|
47
|
+
exports.DepositAddressCreateResponseSchema = exports.DepositAddressSchema.extend({
|
|
48
|
+
chains: zod_1.z.array(exports.DepositAddressChainStatusSchema).min(1),
|
|
49
|
+
}).superRefine((body, ctx) => {
|
|
50
|
+
const chains = body.chains;
|
|
51
|
+
if (!Array.isArray(chains))
|
|
52
|
+
return;
|
|
53
|
+
const sourceCount = chains.filter((entry) => entry.source === true).length;
|
|
54
|
+
if (sourceCount !== 1) {
|
|
55
|
+
ctx.addIssue({
|
|
56
|
+
code: 'custom',
|
|
57
|
+
path: ['chains'],
|
|
58
|
+
message: `chains must contain exactly one source entry, found ${sourceCount}`,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
const seen = new Set();
|
|
62
|
+
chains.forEach((entry, index) => {
|
|
63
|
+
if (seen.has(entry.chainId)) {
|
|
64
|
+
ctx.addIssue({
|
|
65
|
+
code: 'custom',
|
|
66
|
+
path: ['chains', index, 'chainId'],
|
|
67
|
+
message: `chains must not repeat a chainId, ${entry.chainId} appears more than once`,
|
|
68
|
+
});
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
seen.add(entry.chainId);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
42
74
|
const DEPOSIT_ADDRESS_LOOKUP_FILTERS = [
|
|
43
75
|
'depositAddress',
|
|
44
76
|
'depositor',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deposit-addresses.js","sourceRoot":"","sources":["../../../src/v1/endpoints/deposit-addresses.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,8CAOuB;AACvB,qCAAiE;AAepD,QAAA,qBAAqB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,eAAe,CAAU,CAAC;AACxE,QAAA,kBAAkB,GAAG,OAAC,CAAC,IAAI,CAAC,6BAAqB,CAAC,CAAC;AAkBnD,QAAA,iCAAiC,GAAG,OAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC5E,OAAC,CAAC,YAAY,CAAC;QACb,OAAO,EAAE,oBAAO;QAChB,SAAS,EAAE,uBAAU;QACrB,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;QACzB,kBAAkB,EAAE,uBAAU;KAC/B,CAAC;IACF,OAAC,CAAC,YAAY,CAAC;QACb,OAAO,EAAE,oBAAO;QAChB,SAAS,EAAE,uBAAU;QACrB,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,SAAS,CAA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