@stridge/openapi 0.3.0 → 0.5.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 +68 -22
- package/dist/openapi.dereferenced.json +17989 -4286
- package/dist/openapi.json +3033 -633
- package/dist/types.d.ts +11115 -1768
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -5,28 +5,67 @@ package (spec JSON + generated TypeScript types). It is the single source the
|
|
|
5
5
|
public API reference site (`reference.stridge.com`) consumes.
|
|
6
6
|
|
|
7
7
|
This repo is hand-authored and curated. It is **not** generated from core — it
|
|
8
|
-
deliberately re-expresses a
|
|
9
|
-
names, public-facing copy, and realistic examples. Core's
|
|
10
|
-
document
|
|
11
|
-
keep this spec in sync by hand when
|
|
8
|
+
deliberately re-expresses a public subset of the internal `/v1` API with clean
|
|
9
|
+
names, public-facing copy, and realistic examples. Core's handlers and response
|
|
10
|
+
structs (and its internal Swagger 2.0 document, `../core/docs/swagger.yaml`) are
|
|
11
|
+
the source of truth for field shapes — keep this spec in sync by hand when
|
|
12
|
+
core's public `/v1` endpoints change.
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
> **Stop-gap.** This hand-written spec describes what production serves on
|
|
15
|
+
> `/v1` today. It will be replaced by a spec generated from core's `/v2`
|
|
16
|
+
> contract; until then, edit it by hand and verify every change against the
|
|
17
|
+
> core release that production runs.
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
| --- | --- | --- |
|
|
19
|
-
| `GET /uda` | `list-uda-addresses` | `X-API-Key` |
|
|
20
|
-
| `POST /uda` | `create-uda-address` | `X-API-Key` |
|
|
21
|
-
| `GET /uda/quote` | `get-quote` | public |
|
|
22
|
-
| `GET /uda/supported-assets` | `list-supported-assets` | public |
|
|
23
|
-
| `GET /uda/{id}/settlements` | `list-settlements-for-uda` | `X-API-Key` |
|
|
24
|
-
| `GET /uda/settlements/{id}` | `get-settlement` | `X-API-Key` |
|
|
25
|
-
| `GET /uda/settlements/by-reference` | `list-settlements-by-reference` | `X-API-Key` |
|
|
19
|
+
## Scope
|
|
26
20
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
30 operations in 6 tags, plus one webhook (`webhook-event`, the signed envelope
|
|
22
|
+
Stridge POSTs to your endpoints):
|
|
23
|
+
|
|
24
|
+
| Method · Path | Operation | Tag | Auth |
|
|
25
|
+
| --- | --- | --- | --- |
|
|
26
|
+
| `GET /uda` | `list-uda-addresses` | UDA | `X-API-Key` |
|
|
27
|
+
| `POST /uda` | `create-uda-address` | UDA | `X-API-Key` |
|
|
28
|
+
| `GET /uda/quote` | `get-quote` | UDA | public |
|
|
29
|
+
| `GET /uda/supported-assets` | `list-supported-assets` | UDA | public |
|
|
30
|
+
| `GET /uda/{id}/settlements` | `list-settlements-for-uda` | UDA | `X-API-Key` |
|
|
31
|
+
| `GET /uda/settlements/{id}` | `get-settlement` | UDA | `X-API-Key` |
|
|
32
|
+
| `GET /uda/settlements/by-reference` | `list-settlements-by-reference` | UDA | `X-API-Key` |
|
|
33
|
+
| `GET /vault` | `list-vaults` | Payout | `X-API-Key` |
|
|
34
|
+
| `GET /vault/{vault_id}/addresses` | `list-vault-addresses` | Payout | `X-API-Key` |
|
|
35
|
+
| `GET /vault/{vault_id}/addresses/{network}` | `get-vault-address-by-network` | Payout | `X-API-Key` |
|
|
36
|
+
| `GET /vault/{vault_id}/balances` | `get-vault-balances` | Payout | `X-API-Key` |
|
|
37
|
+
| `GET /vault/{vault_id}/total` | `get-vault-total` | Payout | `X-API-Key` |
|
|
38
|
+
| `GET /transfer/payout` | `list-payouts` | Payout | `X-API-Key` |
|
|
39
|
+
| `POST /transfer/payout` | `create-payout` | Payout | `X-API-Key` |
|
|
40
|
+
| `GET /transfer/payout/pending` | `list-pending-payouts` | Payout | `X-API-Key` |
|
|
41
|
+
| `GET /transfer/payout/{id}` | `get-payout` | Payout | `X-API-Key` |
|
|
42
|
+
| `POST /transfer/payout/{id}/reject` | `reject-payout` | Payout | `X-API-Key` |
|
|
43
|
+
| `GET /gas-stations/address/{address}` | `get-gas-station-by-address` | Gas Stations | `X-API-Key` |
|
|
44
|
+
| `GET /gas-stations/wallet/{wallet_id}` | `get-gas-station-by-wallet` | Gas Stations | `X-API-Key` |
|
|
45
|
+
| `GET /gas-stations/wallets` | `list-gas-station-wallets` | Gas Stations | `X-API-Key` |
|
|
46
|
+
| `GET /routing-policies` | `list-routing-policies` | Routing Policies | `X-API-Key` |
|
|
47
|
+
| `GET /routing-policies/{id}` | `get-routing-policy` | Routing Policies | `X-API-Key` |
|
|
48
|
+
| `GET /test_helpers/options` | `get-test-helper-options` | Test Helpers | sandbox key |
|
|
49
|
+
| `POST /test_helpers/uda/deposits` | `simulate-uda-deposit` | Test Helpers | sandbox key |
|
|
50
|
+
| `POST /test_helpers/vault/deposits` | `simulate-vault-deposit` | Test Helpers | sandbox key |
|
|
51
|
+
| `POST /test_helpers/payouts` | `simulate-payout` | Test Helpers | sandbox key |
|
|
52
|
+
| `POST /test_helpers/payouts/{payout_id}/release` | `release-simulated-payout` | Test Helpers | sandbox key |
|
|
53
|
+
| `POST /test_helpers/payouts/{payout_id}/fail` | `fail-simulated-payout` | Test Helpers | sandbox key |
|
|
54
|
+
| `GET /test_helpers/simulations` | `list-simulations` | Test Helpers | sandbox key |
|
|
55
|
+
| `GET /test_helpers/simulations/{simulation_id}` | `get-simulation` | Test Helpers | sandbox key |
|
|
56
|
+
|
|
57
|
+
The `Test Helpers` operations are sandbox only (`x-sandbox-only: true`): a live
|
|
58
|
+
key is answered `404 not a sandbox environment`.
|
|
59
|
+
|
|
60
|
+
Live and sandbox keys share one server, `https://api.stridge.com/v1`; the key's
|
|
61
|
+
prefix (`sk_live_`, `sk_sbx_`, or none for older live keys) decides the
|
|
62
|
+
environment. `api.stridge.dev` is Stridge's staging cluster, not a customer
|
|
63
|
+
sandbox, and is not in the spec.
|
|
64
|
+
|
|
65
|
+
> **Excluded on purpose.** The gateway (`X-Gateway-Key`: `/gateway/*`, the
|
|
66
|
+
> onramp, and `GET /balance/onchain/{wallet_address}`) is documented in the
|
|
67
|
+
> gateway guides, not here; it serves live keys only. Direct and smart routing
|
|
68
|
+
> are switched off in production and are not described.
|
|
30
69
|
|
|
31
70
|
Paths are relative to the server base URL, which carries the `/v1` prefix
|
|
32
71
|
(`POST /uda` → `https://api.stridge.com/v1/uda`).
|
|
@@ -34,9 +73,8 @@ Paths are relative to the server base URL, which carries the `/v1` prefix
|
|
|
34
73
|
## Authoring note
|
|
35
74
|
|
|
36
75
|
The spec is authored as a **single file** (`spec/openapi.yaml`) rather than the
|
|
37
|
-
split-file layout originally sketched in the build plan.
|
|
38
|
-
|
|
39
|
-
dereferences it identically. Split by domain later if the surface grows.
|
|
76
|
+
split-file layout originally sketched in the build plan. It avoids cross-file
|
|
77
|
+
`$ref` resolution pitfalls; Redocly bundles and dereferences it identically.
|
|
40
78
|
|
|
41
79
|
### Clean name ↔ core definition map
|
|
42
80
|
|
|
@@ -55,6 +93,13 @@ dereferences it identically. Split by domain later if the surface grows.
|
|
|
55
93
|
| `Pagination` | `…PaginationResponse` |
|
|
56
94
|
| `Error` | unified from `…shared_response.ErrorResponse` + `echo.HTTPError` |
|
|
57
95
|
| `SuccessEnvelope` | `…shared_response.OkResponse` |
|
|
96
|
+
| `PagePagination` | `lib/filter.PaginationInfo` |
|
|
97
|
+
| `Livemode` (the `livemode` field) | added by `internal/shared/response/livemode.go` to every object a keyed response renders |
|
|
98
|
+
| `RoutingPolicy` | `internal/routing_policy/application/http.PolicyResponse` |
|
|
99
|
+
| `Simulation` / `SimulationCause` / `SimulationChain` | `internal/sandbox/application/http.SimulationResponse` / `internal/sandbox/domain.Cause` / `.ChainRef` |
|
|
100
|
+
| `SimulateUDADepositRequest` / `SimulateVaultDepositRequest` / `SimulatePayoutRequest` | `internal/sandbox/domain.UDADepositRequest` / `.VaultDepositRequest` / `.PayoutRequest` |
|
|
101
|
+
| `TestHelperOptions` (+ UDA/Vault/Network/Preset/Timing) | `internal/sandbox/domain.Options` (+ `Option*`) |
|
|
102
|
+
| `WebhookEnvelope` | `internal/webhook/domain.WebhookEnvelope` |
|
|
58
103
|
|
|
59
104
|
## Develop
|
|
60
105
|
|
|
@@ -62,6 +107,7 @@ dereferences it identically. Split by domain later if the surface grows.
|
|
|
62
107
|
pnpm install
|
|
63
108
|
pnpm run lint # redocly lint
|
|
64
109
|
pnpm run build # → dist/openapi.json, dist/openapi.dereferenced.json, dist/types.d.ts
|
|
110
|
+
pnpm test # contract checks on dist/openapi.json (node:test)
|
|
65
111
|
pnpm exec tsc --noEmit # typecheck the generated types
|
|
66
112
|
```
|
|
67
113
|
|