@eco-foundation/api-schemas 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +152 -15
- package/dist/fixtures/index.js +10 -6
- package/dist/fixtures/index.js.map +1 -1
- package/dist/fixtures/v1/deposit-addresses-create.request.gateway-erc20.json +1 -1
- package/dist/fixtures/v1/deposit-addresses-create.response.gateway-erc20.json +1 -1
- package/dist/fixtures/v1/deposit-addresses-lookup.response.default.json +1 -1
- package/dist/fixtures/v1/intents-status.response.quote-filled-detail.json +60 -0
- package/dist/fixtures/v1/quotes-create.request.gateway-deposit.json +25 -0
- package/dist/fixtures/v1/{quotes-create.request.public-swap.json → quotes-create.request.swap.json} +4 -4
- package/dist/fixtures/v1/quotes-create.response.all-quotes.json +288 -81
- package/dist/fixtures/v1/quotes-create.response.gateway-deposit.json +206 -0
- package/dist/fixtures/v1/quotes-create.response.swap.json +228 -0
- package/dist/generated/build-digest.json +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/openapi.js +18 -0
- package/dist/openapi.js.map +1 -1
- package/dist/v1/endpoints/deposit-addresses.d.ts +12 -12
- package/dist/v1/endpoints/deposit-addresses.js +9 -9
- package/dist/v1/endpoints/quotes.d.ts +348 -193
- package/dist/v1/endpoints/quotes.js +74 -62
- package/dist/v1/endpoints/quotes.js.map +1 -1
- package/dist/v1/endpoints/registry.d.ts +118 -76
- package/dist/v1/endpoints/routes.d.ts +2 -0
- package/dist/v1/endpoints/routes.js +1 -1
- package/dist/v1/endpoints/routes.js.map +1 -1
- package/dist/v1/endpoints/status.d.ts +4 -0
- package/dist/v1/endpoints/status.js +1 -0
- package/dist/v1/endpoints/status.js.map +1 -1
- package/dist/v1/enums.d.ts +14 -30
- package/dist/v1/enums.js +10 -15
- package/dist/v1/enums.js.map +1 -1
- package/dist/v1/types.d.ts +42 -42
- package/openapi/v1.json +1084 -676
- package/package.json +1 -1
- package/dist/fixtures/v1/quotes-create.response.private-swap.json +0 -153
- package/dist/fixtures/v1/quotes-create.response.public-swap.json +0 -159
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ API. The Zod schemas are the source of truth; everything else (OpenAPI, fixtures
|
|
|
5
5
|
is generated from or gated against them.
|
|
6
6
|
|
|
7
7
|
Today the package covers **13 endpoints across 12 paths**, **39 error codes** (51 namespaced
|
|
8
|
-
legacy references), and **
|
|
8
|
+
legacy references), and **21 golden fixtures**.
|
|
9
9
|
|
|
10
10
|
## Install
|
|
11
11
|
|
|
@@ -14,13 +14,13 @@ 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.10.0"
|
|
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.10.0` or the exact `0.10.0`.
|
|
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
|
|
@@ -30,6 +30,146 @@ A matching version string is not evidence of a matching artifact: also compare
|
|
|
30
30
|
zod-bearing entry point. Which case you are in is decided entirely by your imports; see
|
|
31
31
|
[Consumers](#consumers).
|
|
32
32
|
|
|
33
|
+
## Migrating 0.9.0 -> 0.10.0
|
|
34
|
+
|
|
35
|
+
**BREAKING under 0.x semver** (breaking bumps the minor while the major is 0). One new quote
|
|
36
|
+
type, `gateway-deposit`, for the Circle Gateway fast-deposit route the deposit-addresses
|
|
37
|
+
service requests through `POST /v1/quotes`. No response SHAPE change; one response-refinement
|
|
38
|
+
carve-out (item 3). Item 1 is the breaking item: read it before bumping.
|
|
39
|
+
|
|
40
|
+
**`V1_SCHEMA_DIGEST` MOVES** to
|
|
41
|
+
`fa55e655ef48bbc69a551e263c1bf80cc91e8b920f9f98c29cf9b62b01a53be9`; it was
|
|
42
|
+
`bedfc6091a9af25adf1823740b6761f97bcb1927565bc3f226490bb2facda514` on `0.9.0`. Every consumer
|
|
43
|
+
running `assertNoSkew` moves in the same rollout.
|
|
44
|
+
|
|
45
|
+
**1. `QUOTE_TYPES` gains `'gateway-deposit'`**; `QuoteType`, `QuoteTypeTolerant` and the
|
|
46
|
+
zod-free `V1QuoteType` follow, so `QuoteCoreSchema.type` / `V1QuoteCore.type` echo the new
|
|
47
|
+
literal. A 0.9.x reader parsing response `type` with the strict `QuoteType` REJECTS it; one on
|
|
48
|
+
`QuoteTypeTolerant` receives `{ unknown: 'gateway-deposit' }` and keeps working; a reader that
|
|
49
|
+
needs the literal bumps to `~0.10.0`. The draft `/v1/routes` `swapTypes` enum widens too. This
|
|
50
|
+
is the breaking item.
|
|
51
|
+
|
|
52
|
+
**2. Request rules for `type: 'gateway-deposit'`**: three are in `QuoteRequestSchema`'s
|
|
53
|
+
refinement, 400 at the named path — `source.amount` REQUIRED (`gateway-deposit requires
|
|
54
|
+
source.amount`); `destination.amount` REJECTED (`gateway-deposit forbids destination.amount
|
|
55
|
+
(the engine derives it)`); `destination.calls` REJECTED (the existing `destination.calls is
|
|
56
|
+
only valid with type custom (D7)`, literal unchanged). `destination.recipient` REQUIRED (a
|
|
57
|
+
base-schema field, required on every type since 0.9.0; for this type it is the final Gateway
|
|
58
|
+
recipient on the destination chain). `exact-in` and `custom` continue to ACCEPT a
|
|
59
|
+
`destination.amount` (the router drops it); generalising the forbid is out of scope. The
|
|
60
|
+
per-type rule is published on the field: `destination.amount` now carries the description
|
|
61
|
+
`Required for exact-out. Rejected for gateway-deposit (the engine derives it). Not read for
|
|
62
|
+
exact-in or custom.`, and `type` carries a description of the route. Solver preconditions
|
|
63
|
+
(stated there, not as an error code): the destination must be an EVM chain for which the solvers
|
|
64
|
+
hold a Circle Gateway wallet configuration (HyperCore destinations are refused) and
|
|
65
|
+
`source.token` should be the source chain's USDC — any other token is priced only through the
|
|
66
|
+
solvers' stitched swap ladder and may be refused. A fleet-wide refusal reaches the caller as 502
|
|
67
|
+
`solver-error` with the solver texts in `solverErrors[]`, not as 422 `no-route-found`.
|
|
68
|
+
|
|
69
|
+
**3. `refineQuoteCore`'s sweep-4 ordering (`reward.deadline > route.deadline`) is NOT applied
|
|
70
|
+
when `type === 'gateway-deposit'`** — on the envelope and on every `quotes[]` entry alike. The
|
|
71
|
+
solver's STITCHED Gateway-deposit template inverts the ordering on both legs by design (reward
|
|
72
|
+
window 3600 s so refund eligibility opens early; route deadline 604800 s so fulfilment stays
|
|
73
|
+
retryable); the DIRECT shape keeps the usual ordering. Both deadlines stay `UnixSeconds`. Every
|
|
74
|
+
other type is unchanged and still strict; the carve-out is keyed on the type literal, never on a
|
|
75
|
+
same-chain or stitched predicate.
|
|
76
|
+
|
|
77
|
+
**4. Response shape** for the type depends on the winning solver's destination balance, not on
|
|
78
|
+
its role: DIRECT (one cross-chain intent, `execution.intent.route.destination ===
|
|
79
|
+
destination.chainId`, `route.portal` = the destination-chain Portal) or two-leg STITCHED
|
|
80
|
+
(`execution.intent` = leg A, a same-chain local intent on the source chain that the funder
|
|
81
|
+
funds; `steps[].intents[]` carries leg C with role `stitched-destination`). Consumers must
|
|
82
|
+
accept both. `expiresAt` is NOT the route deadline — read `execution.intent.route.deadline`.
|
|
83
|
+
`execution.encodedRoute` remains absent (0.9.0 item 8 stands); re-encode from
|
|
84
|
+
`execution.intent.route` when bytes are needed.
|
|
85
|
+
|
|
86
|
+
**5. Consumers** pin `~0.10.0` (never `^0`) and re-run `assertNoSkew`. `errors/catalog.lock.json`
|
|
87
|
+
is unchanged (no new error code — `no-route-found` and `invalid-api-key` already exist).
|
|
88
|
+
`openapi/v1.json` is regenerated (the `type` enum plus the two descriptions). Two golden
|
|
89
|
+
fixtures added — `quotes.create:request:gateway-deposit` and
|
|
90
|
+
`quotes.create:response:gateway-deposit` (the producer's stitched shape with inverted
|
|
91
|
+
deadlines on both legs) — for 21 in total; both are in the §5 mandatory list.
|
|
92
|
+
|
|
93
|
+
## Migrating 0.8.0 -> 0.9.0
|
|
94
|
+
|
|
95
|
+
**BREAKING under 0.x semver** (breaking bumps the minor while the major is 0). Eleven wire
|
|
96
|
+
corrections from the /v1 API review, all in one release. Every renamed or removed field is a
|
|
97
|
+
400 on the request side (every request object is strict) and simply absent on the response
|
|
98
|
+
side. Read the whole list before bumping; the two structural items (7 and 8) need a code
|
|
99
|
+
change in every consumer.
|
|
100
|
+
|
|
101
|
+
**`V1_SCHEMA_DIGEST` MOVES** to
|
|
102
|
+
`bedfc6091a9af25adf1823740b6761f97bcb1927565bc3f226490bb2facda514`; it was
|
|
103
|
+
`a61dfe727b15162f9097b421ca2f7660750e8cfad85ccf2d1c8dd8340207852a` on `0.8.0`. Every consumer
|
|
104
|
+
running `assertNoSkew` moves in the same rollout.
|
|
105
|
+
|
|
106
|
+
**1. `swapType` is `type`** on the request and the response. Values are unchanged
|
|
107
|
+
(`exact-in`, `exact-out`, `custom`). Exports: `SWAP_TYPES`/`SwapType`/`SwapTypeTolerant`/
|
|
108
|
+
`V1SwapType` are now `QUOTE_TYPES`/`QuoteType`/`QuoteTypeTolerant`/`V1QuoteType`. The draft
|
|
109
|
+
`/v1/routes` response field `swapTypes` (a per-route capability list) keeps its name; only the
|
|
110
|
+
quote request and response are renamed.
|
|
111
|
+
|
|
112
|
+
**2. `kind` is `type` everywhere**: `fees[].type`, `steps[].type`,
|
|
113
|
+
`execution.transaction.type` (`'evm' | 'svm'`, the discriminated-union key), and the
|
|
114
|
+
deposit-address create request, record and lookup filter (`type: 'solana' | 'gateway' |
|
|
115
|
+
'gateway-erc20'`). Exports renamed accordingly (`FeeType`, `StepType`, `DepositAddressType`
|
|
116
|
+
and their tuples/tolerant twins/zod-free aliases). The API now has exactly one discriminator
|
|
117
|
+
name.
|
|
118
|
+
|
|
119
|
+
**3. `funder` is `source.funder`**, and the response echoes it at `source.funder`.
|
|
120
|
+
|
|
121
|
+
```diff
|
|
122
|
+
{
|
|
123
|
+
- "funder": "0x…",
|
|
124
|
+
- "source": { "chainId": 8453, "token": "0x…", "amount": "1043221" },
|
|
125
|
+
+ "source": { "chainId": 8453, "token": "0x…", "amount": "1043221", "funder": "0x…" },
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
A root `funder` yields two issues: `unrecognized_keys` at path `''` and a missing
|
|
130
|
+
`source.funder`. The address-family rule now reports at `['source', 'funder']`.
|
|
131
|
+
|
|
132
|
+
**4. `dappId` is REQUIRED** on every quote request (400 at `['dappId']` when missing).
|
|
133
|
+
|
|
134
|
+
**5. Response `destination.amount` is `destination.amountOut`.** `minAmountOut` is unchanged;
|
|
135
|
+
`source.amount` and both request amounts are unchanged.
|
|
136
|
+
|
|
137
|
+
**6. `steps[].tool` is `steps[].provider`.** `aggregator` is unchanged.
|
|
138
|
+
|
|
139
|
+
**7. `relatedIntents[]` is gone; each step carries `intents[]`** with the FULL decoded intent:
|
|
140
|
+
|
|
141
|
+
```json
|
|
142
|
+
"steps": [{ "type": "swap", "provider": "uniswap-v3", "…": "…",
|
|
143
|
+
"intents": [{ "role": "local", "intentHash": "0x…",
|
|
144
|
+
"intent": { "route": { "…": "…", "calls": [ … ] }, "reward": { … } } }] }]
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
`intents` is required on every step and may be empty (a step realized by a not-yet-existing
|
|
148
|
+
intent). Root `intentHash` stays. The quote signature (F3) commits to the root hash plus every
|
|
149
|
+
step intent hash — use the new `quoteIntentHashes(quote)` to collect them; the builder still
|
|
150
|
+
lower-cases, dedupes and sorts. Exports: `RelatedIntentSchema`/`V1RelatedIntent` are
|
|
151
|
+
`StepIntentSchema`/`V1StepIntent`.
|
|
152
|
+
|
|
153
|
+
**8. `visibility`, `guarantee`, `execution.encodedRoute` and `execution.encodedReward` are
|
|
154
|
+
removed**, and `execution.intent.route.calls` is REQUIRED and non-null. Visibility was never a
|
|
155
|
+
caller's knob: how a quote is routed is a router policy decision, and the funding function was
|
|
156
|
+
never visibility's to choose — on EVM the funding transaction is always `Portal.publishAndFund`;
|
|
157
|
+
on Solana it is one `Portal.fund` instruction. The route preimage is therefore never hidden.
|
|
158
|
+
`options.visibility` is a 400; `Visibility`/`VISIBILITIES`/`V1Visibility` and
|
|
159
|
+
`Guarantee`/`GUARANTEES`/`GuaranteeTolerant`/`V1Guarantee` no longer exist.
|
|
160
|
+
|
|
161
|
+
**9. Status `steps[].intentHash` is REQUIRED** (`Bytes32`). The solver has always sent it; the
|
|
162
|
+
schema now declares it. New golden fixture `intents.status:response:quote-filled-detail`.
|
|
163
|
+
|
|
164
|
+
**10. Fixtures renamed:** `quotes.create:request:public-swap` → `…:request:swap`,
|
|
165
|
+
`quotes.create:response:public-swap` → `…:response:swap`;
|
|
166
|
+
`…:response:private-swap` is deleted.
|
|
167
|
+
|
|
168
|
+
**11. The published OpenAPI document no longer carries `additionalProperties: {}`** on any
|
|
169
|
+
response object. Semantically identical (JSON Schema is permissive by default) — it only stops
|
|
170
|
+
documentation renderers drawing a `{key}: any` row. Request objects keep
|
|
171
|
+
`additionalProperties: false`. Runtime parsing is unchanged: responses stay `looseObject`.
|
|
172
|
+
|
|
33
173
|
## Migrating 0.7.0 -> 0.8.0
|
|
34
174
|
|
|
35
175
|
**BREAKING under 0.x semver** (breaking bumps the minor while the major is 0). V1 quote requests
|
|
@@ -493,14 +633,11 @@ wallet already works.
|
|
|
493
633
|
`InvalidTokenTransferAccounts` depending on which pair swapped). The schema does not know
|
|
494
634
|
which program `programId` is, so it cannot police this; it validates each entry's shape and
|
|
495
635
|
the PRESENCE of both privilege flags, and nothing more.
|
|
496
|
-
- **`instructions`
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
headers. The instructions are independent on-chain, so submit them in the given order across
|
|
502
|
-
two transactions, or compile a v0 message against your own address-lookup table. Splitting is
|
|
503
|
-
safe; reordering is not.
|
|
636
|
+
- **`instructions` is one instruction in practice.** Since 0.9.0 the router emits `Portal.fund`
|
|
637
|
+
alone on Solana (the route preimage stays with the quoting solver; there is no `publish`), so
|
|
638
|
+
a funding transaction fits one Solana transaction. The array stays ORDERED and non-empty so a
|
|
639
|
+
producer that legitimately needs a companion instruction can add one without a wire change;
|
|
640
|
+
compile them in the given order.
|
|
504
641
|
|
|
505
642
|
**No address-lookup-table references are emitted.** An ALT must already exist on-chain and
|
|
506
643
|
eco-router has no Solana RPC with which to create or read one, so every account is inline and
|
|
@@ -550,7 +687,7 @@ consuming.)
|
|
|
550
687
|
`errors` is **OPTIONAL**: an `invalid-request` for a body that is not JSON at all has no
|
|
551
688
|
field to name, so absence is legal and means exactly that. `field` names the offending
|
|
552
689
|
input in YOUR terms — the path into what you sent, with **no `body.`/`query.` prefix**:
|
|
553
|
-
`source.chainId`, `funder`, `limit`. `detail` obeys the same free-text policy as the
|
|
690
|
+
`source.chainId`, `source.funder`, `limit`. `detail` obeys the same free-text policy as the
|
|
554
691
|
problem's own `detail`.
|
|
555
692
|
|
|
556
693
|
Because there is no prefix, `field` alone does not say whether the value came from the body
|
|
@@ -860,7 +997,7 @@ Zod-major compatibility is the reason there are two interfaces, not one:
|
|
|
860
997
|
|
|
861
998
|
There are two fixture locations and they serve different jobs — do not conflate them:
|
|
862
999
|
|
|
863
|
-
- **`src/fixtures/v1/`** — the
|
|
1000
|
+
- **`src/fixtures/v1/`** — the 21 golden request/response payloads, one per endpoint variant,
|
|
864
1001
|
consumed through **`loadV1Fixtures()`** rather than by file path. Each entry carries its
|
|
865
1002
|
endpoint id, direction, variant, and the C12 replay metadata (`method`, `path`,
|
|
866
1003
|
`expectedStatus`, `sideEffect`, optional `stability` and `headers`), so a live-replay harness
|
|
@@ -876,7 +1013,7 @@ There are two fixture locations and they serve different jobs — do not conflat
|
|
|
876
1013
|
`routes.list` is the one fixture tagged `stability: 'draft'`. A live-replay consumer skips it
|
|
877
1014
|
with the reason `draft endpoint (x-stability: draft) — not served at launch` instead of
|
|
878
1015
|
demanding a 200 from an endpoint no service serves at launch, which makes the read-safe replay
|
|
879
|
-
set **
|
|
1016
|
+
set **8 of the 9 GET fixtures**. Schema conformance still covers it in this package's own suite,
|
|
880
1017
|
which needs no server.
|
|
881
1018
|
|
|
882
1019
|
## Invariants (enforced in CI)
|
|
@@ -980,7 +1117,7 @@ already staged cannot be staged again, so a re-tag of a queued version fails unt
|
|
|
980
1117
|
one is approved or rejected.
|
|
981
1118
|
|
|
982
1119
|
Semver: breaking schema change = major, additive = minor; consumers pin minor. **While the
|
|
983
|
-
package is 0.x, "pin minor" means `~0.
|
|
1120
|
+
package is 0.x, "pin minor" means `~0.10.0` or the exact `0.10.0` — never `^0`** (see
|
|
984
1121
|
[Install](#install)). Consumers additionally compare `V1_SCHEMA_DIGEST`: a matching version
|
|
985
1122
|
string is not evidence of a matching artifact. `/v1/routes` is draft-tagged and exempt until its
|
|
986
1123
|
stability flips.
|
package/dist/fixtures/index.js
CHANGED
|
@@ -12,23 +12,26 @@ const deposit_addresses_submit_erc_2612_request_deposit_address_target_json_1 =
|
|
|
12
12
|
const deposit_addresses_submit_erc_3009_request_deposit_address_target_json_1 = __importDefault(require("./v1/deposit-addresses-submit-erc-3009.request.deposit-address-target.json"));
|
|
13
13
|
const intents_status_response_gasless_handoff_json_1 = __importDefault(require("./v1/intents-status.response.gasless-handoff.json"));
|
|
14
14
|
const intents_status_response_intent_filled_json_1 = __importDefault(require("./v1/intents-status.response.intent-filled.json"));
|
|
15
|
+
const intents_status_response_quote_filled_detail_json_1 = __importDefault(require("./v1/intents-status.response.quote-filled-detail.json"));
|
|
15
16
|
const intents_status_response_unknown_json_1 = __importDefault(require("./v1/intents-status.response.unknown.json"));
|
|
16
17
|
const intents_status_response_wallet_page_json_1 = __importDefault(require("./v1/intents-status.response.wallet-page.json"));
|
|
17
18
|
const intents_submit_erc_3009_response_job_json_1 = __importDefault(require("./v1/intents-submit-erc-3009.response.job.json"));
|
|
18
19
|
const intents_submit_permit2_request_quote_target_json_1 = __importDefault(require("./v1/intents-submit-permit2.request.quote-target.json"));
|
|
19
20
|
const intents_submit_permit3_request_quote_target_json_1 = __importDefault(require("./v1/intents-submit-permit3.request.quote-target.json"));
|
|
20
|
-
const
|
|
21
|
+
const quotes_create_request_gateway_deposit_json_1 = __importDefault(require("./v1/quotes-create.request.gateway-deposit.json"));
|
|
22
|
+
const quotes_create_request_swap_json_1 = __importDefault(require("./v1/quotes-create.request.swap.json"));
|
|
21
23
|
const quotes_create_response_all_quotes_json_1 = __importDefault(require("./v1/quotes-create.response.all-quotes.json"));
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
+
const quotes_create_response_gateway_deposit_json_1 = __importDefault(require("./v1/quotes-create.response.gateway-deposit.json"));
|
|
25
|
+
const quotes_create_response_swap_json_1 = __importDefault(require("./v1/quotes-create.response.swap.json"));
|
|
24
26
|
const routes_list_response_default_json_1 = __importDefault(require("./v1/routes-list.response.default.json"));
|
|
25
27
|
const tokens_list_response_default_json_1 = __importDefault(require("./v1/tokens-list.response.default.json"));
|
|
26
28
|
const bind = (endpointId, direction, variant, json, meta = {}) => ({ endpointId, direction, variant, json, ...meta });
|
|
27
29
|
const FIXTURE_BINDINGS = [
|
|
28
|
-
bind('quotes.create', 'request', '
|
|
29
|
-
bind('quotes.create', 'response', '
|
|
30
|
-
bind('quotes.create', 'response', 'private-swap', quotes_create_response_private_swap_json_1.default),
|
|
30
|
+
bind('quotes.create', 'request', 'swap', quotes_create_request_swap_json_1.default),
|
|
31
|
+
bind('quotes.create', 'response', 'swap', quotes_create_response_swap_json_1.default),
|
|
31
32
|
bind('quotes.create', 'response', 'all-quotes', quotes_create_response_all_quotes_json_1.default),
|
|
33
|
+
bind('quotes.create', 'request', 'gateway-deposit', quotes_create_request_gateway_deposit_json_1.default),
|
|
34
|
+
bind('quotes.create', 'response', 'gateway-deposit', quotes_create_response_gateway_deposit_json_1.default),
|
|
32
35
|
bind('intents.submit.erc-3009', 'response', 'job', intents_submit_erc_3009_response_job_json_1.default),
|
|
33
36
|
bind('intents.submit.permit2', 'request', 'quote-target', intents_submit_permit2_request_quote_target_json_1.default),
|
|
34
37
|
bind('intents.submit.permit3', 'request', 'quote-target', intents_submit_permit3_request_quote_target_json_1.default),
|
|
@@ -38,6 +41,7 @@ const FIXTURE_BINDINGS = [
|
|
|
38
41
|
bind('intents.status', 'response', 'unknown', intents_status_response_unknown_json_1.default),
|
|
39
42
|
bind('intents.status', 'response', 'gasless-handoff', intents_status_response_gasless_handoff_json_1.default),
|
|
40
43
|
bind('intents.status', 'response', 'wallet-page', intents_status_response_wallet_page_json_1.default),
|
|
44
|
+
bind('intents.status', 'response', 'quote-filled-detail', intents_status_response_quote_filled_detail_json_1.default),
|
|
41
45
|
bind('chains.list', 'response', 'default', chains_list_response_default_json_1.default),
|
|
42
46
|
bind('tokens.list', 'response', 'default', tokens_list_response_default_json_1.default),
|
|
43
47
|
bind('routes.list', 'response', 'default', routes_list_response_default_json_1.default, { stability: 'draft' }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fixtures/index.ts"],"names":[],"mappings":";;;;;;AACA,+GAAgE;AAChE,mJAAuF;AACvF,qJAAyF;AACzF,yIAA2E;AAC3E,uLAAsG;AACtG,uLAAsG;AACtG,qIAA8E;AAC9E,iIAA2E;AAC3E,qHAAsE;AACtE,6HAAuE;AACvE,+HAA2E;AAC3E,6IAAkF;AAClF,6IAAkF;AAClF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fixtures/index.ts"],"names":[],"mappings":";;;;;;AACA,+GAAgE;AAChE,mJAAuF;AACvF,qJAAyF;AACzF,yIAA2E;AAC3E,uLAAsG;AACtG,uLAAsG;AACtG,qIAA8E;AAC9E,iIAA2E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C;IACJ,CAAC;IAMD,MAAM,iBAAiB,GAAG,OAAO,CAAC,SAAS,IAAI,QAAQ,CAAC;IACxD,MAAM,aAAa,GAAI,IAAI,CAAC,SAAoC,IAAI,QAAQ,CAAC;IAC7E,IAAI,aAAa,KAAK,iBAAiB,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CACb,mDAAmD;YACjD,GAAG,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,OAAO,iBAAiB;YAC9E,GAAG,iBAAiB,eAAe,aAAa,EAAE,CACrD,CAAC;IACJ,CAAC;IACD,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,CAAC;QACjF,MAAM,IAAI,KAAK,CACb,kDAAkD;YAChD,GAAG,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,OAAO,EAAE,CAClE,CAAC;IACJ,CAAC;IACD,OAAO,IAA4B,CAAC;AACtC,CAAC;AAEY,QAAA,WAAW,GAAyB,gBAAgB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"depositAddress": "0x4444444444444444444444444444444444444444",
|
|
12
12
|
"chainId": 8453,
|
|
13
13
|
"depositor": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1",
|
|
14
|
-
"
|
|
14
|
+
"type": "gateway-erc20",
|
|
15
15
|
"destinationAddress": "0x1111111111111111111111111111111111111111",
|
|
16
16
|
"destinationChainId": 137,
|
|
17
17
|
"expiresAt": null,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"depositAddress": "0x4444444444444444444444444444444444444444",
|
|
14
14
|
"chainId": 8453,
|
|
15
15
|
"depositor": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1",
|
|
16
|
-
"
|
|
16
|
+
"type": "gateway-erc20",
|
|
17
17
|
"destinationAddress": "0x1111111111111111111111111111111111111111",
|
|
18
18
|
"destinationChainId": 137,
|
|
19
19
|
"expiresAt": null,
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"endpointId": "intents.status",
|
|
3
|
+
"direction": "response",
|
|
4
|
+
"variant": "quote-filled-detail",
|
|
5
|
+
"method": "GET",
|
|
6
|
+
"path": "/v1/intents/status?quoteId=c1ed3798-e227-45a6-ad7c-b805f9e7a392",
|
|
7
|
+
"expectedStatus": 200,
|
|
8
|
+
"sideEffect": false,
|
|
9
|
+
"payload": {
|
|
10
|
+
"results": [
|
|
11
|
+
{
|
|
12
|
+
"id": "quote:c1ed3798-e227-45a6-ad7c-b805f9e7a392",
|
|
13
|
+
"type": "quote",
|
|
14
|
+
"status": "submitted",
|
|
15
|
+
"intentHashes": ["0x28cf072bb7fcd236cb417ef542f91002a84e04afb4c144ceb3ded8056bfa790f"],
|
|
16
|
+
"updatedAt": 1789432832,
|
|
17
|
+
"steps": [
|
|
18
|
+
{
|
|
19
|
+
"type": "BRIDGE",
|
|
20
|
+
"intentHash": "0x28cf072bb7fcd236cb417ef542f91002a84e04afb4c144ceb3ded8056bfa790f",
|
|
21
|
+
"status": "FULFILLED",
|
|
22
|
+
"from": {
|
|
23
|
+
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
24
|
+
"amount": "1000000",
|
|
25
|
+
"chainId": 8453
|
|
26
|
+
},
|
|
27
|
+
"to": {
|
|
28
|
+
"token": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
|
|
29
|
+
"amount": "989500",
|
|
30
|
+
"chainId": 10
|
|
31
|
+
},
|
|
32
|
+
"transactions": {
|
|
33
|
+
"created": {
|
|
34
|
+
"chainId": 8453,
|
|
35
|
+
"txHash": "0x522dc811ae11692c9066747d24e96fa6d42315945aef9246ac19adb5663fe5c9"
|
|
36
|
+
},
|
|
37
|
+
"fulfilled": {
|
|
38
|
+
"chainId": 10,
|
|
39
|
+
"txHash": "0xace13db990e6c9aac0957510443262a90c128795c30086a5b0e62ac713c20866"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"sourceTx": {
|
|
45
|
+
"chainId": 8453,
|
|
46
|
+
"txHash": "0x522dc811ae11692c9066747d24e96fa6d42315945aef9246ac19adb5663fe5c9",
|
|
47
|
+
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
48
|
+
"amount": "1000000"
|
|
49
|
+
},
|
|
50
|
+
"destinationTx": {
|
|
51
|
+
"chainId": 10,
|
|
52
|
+
"txHash": "0xace13db990e6c9aac0957510443262a90c128795c30086a5b0e62ac713c20866",
|
|
53
|
+
"token": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
|
|
54
|
+
"amount": "989500"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"nextCursor": null
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"endpointId": "quotes.create",
|
|
3
|
+
"direction": "request",
|
|
4
|
+
"variant": "gateway-deposit",
|
|
5
|
+
"method": "POST",
|
|
6
|
+
"path": "/v1/quotes",
|
|
7
|
+
"expectedStatus": 200,
|
|
8
|
+
"sideEffect": true,
|
|
9
|
+
"payload": {
|
|
10
|
+
"type": "gateway-deposit",
|
|
11
|
+
"source": {
|
|
12
|
+
"chainId": 8453,
|
|
13
|
+
"token": "0x1111111111111111111111111111111111111111",
|
|
14
|
+
"amount": "1043221",
|
|
15
|
+
"funder": "0x3333333333333333333333333333333333333333"
|
|
16
|
+
},
|
|
17
|
+
"destination": {
|
|
18
|
+
"chainId": 10,
|
|
19
|
+
"token": "0x2222222222222222222222222222222222222222",
|
|
20
|
+
"recipient": "0x3333333333333333333333333333333333333333"
|
|
21
|
+
},
|
|
22
|
+
"refundRecipient": "0x3333333333333333333333333333333333333333",
|
|
23
|
+
"dappId": "example-dapp"
|
|
24
|
+
}
|
|
25
|
+
}
|
package/dist/fixtures/v1/{quotes-create.request.public-swap.json → quotes-create.request.swap.json}
RENAMED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"endpointId": "quotes.create",
|
|
3
3
|
"direction": "request",
|
|
4
|
-
"variant": "
|
|
4
|
+
"variant": "swap",
|
|
5
5
|
"method": "POST",
|
|
6
6
|
"path": "/v1/quotes",
|
|
7
7
|
"expectedStatus": 200,
|
|
8
8
|
"sideEffect": true,
|
|
9
9
|
"payload": {
|
|
10
|
-
"
|
|
10
|
+
"type": "exact-in",
|
|
11
11
|
"source": {
|
|
12
12
|
"chainId": 8453,
|
|
13
13
|
"token": "0x1111111111111111111111111111111111111111",
|
|
14
|
-
"amount": "1043221"
|
|
14
|
+
"amount": "1043221",
|
|
15
|
+
"funder": "0x3333333333333333333333333333333333333333"
|
|
15
16
|
},
|
|
16
17
|
"destination": {
|
|
17
18
|
"chainId": 10,
|
|
18
19
|
"token": "0x2222222222222222222222222222222222222222",
|
|
19
20
|
"recipient": "0x3333333333333333333333333333333333333333"
|
|
20
21
|
},
|
|
21
|
-
"funder": "0x3333333333333333333333333333333333333333",
|
|
22
22
|
"slippage": 0.005,
|
|
23
23
|
"dappId": "example-dapp"
|
|
24
24
|
}
|