@stridge/openapi 0.2.1 → 0.4.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/dist/openapi.json CHANGED
@@ -25,6 +25,10 @@
25
25
  "name": "UDA",
26
26
  "description": "Universal Deposit Addresses — allocate cross-chain deposit addresses, fetch indicative quotes, and track settlements.\n"
27
27
  },
28
+ {
29
+ "name": "Routing Policies",
30
+ "description": "Tenant-scoped, centrally-editable routing policies — ordered, first-match-wins rule sets that divert UDA settlements. Editing a policy applies to every UDA that references it (or inherits the tenant default) with no per-UDA changes. Read-only over the API; create and edit them from the dashboard. Routing policies apply to UDA settlements only — gateway flows ignore them.\n"
31
+ },
28
32
  {
29
33
  "name": "Payout",
30
34
  "description": "Non-custodial vaults and the payouts they fund. Inspect a vault's addresses, per-asset balances, and total value, then send funds from a vault to an external address — payouts are idempotent by reference, tracked through a lifecycle, and have native gas funded automatically.\n"
@@ -756,7 +760,7 @@
756
760
  "Payout"
757
761
  ],
758
762
  "summary": "Create payout",
759
- "description": "Create a payout from the tenant's vault wallet to an external address. Provide either `amount` (crypto) or `usd_amount` (converted to crypto at the current rate). Payouts are idempotent by `(vault_id, reference_id)` — resubmitting a `reference_id` returns `409` instead of paying twice.\n",
763
+ "description": "Create a payout from the tenant's vault wallet to an external address. Provide either `amount` (crypto) or `usd_amount` (converted to crypto at the current rate). Payouts are idempotent by `(vault_id, reference_id)` — resubmitting a `reference_id` returns `409` instead of paying twice. Set `type` to `forceful` for a single fail-fast attempt — gas is still refilled when needed, but the refill and transfer are each tried once with no retry; the default `normal` refills and retries until `expired_at`.\n",
760
764
  "security": [
761
765
  {
762
766
  "ApiKeyAuth": []
@@ -1159,6 +1163,97 @@
1159
1163
  }
1160
1164
  }
1161
1165
  }
1166
+ },
1167
+ "/routing-policies": {
1168
+ "get": {
1169
+ "operationId": "list-routing-policies",
1170
+ "tags": [
1171
+ "Routing Policies"
1172
+ ],
1173
+ "summary": "List routing policies",
1174
+ "description": "List the routing policies configured for your tenant, including the default policy. Read-only — create and edit policies from the dashboard.\n",
1175
+ "security": [
1176
+ {
1177
+ "ApiKeyAuth": []
1178
+ }
1179
+ ],
1180
+ "parameters": [
1181
+ {
1182
+ "$ref": "#/components/parameters/LimitParam"
1183
+ },
1184
+ {
1185
+ "$ref": "#/components/parameters/OffsetParam"
1186
+ }
1187
+ ],
1188
+ "responses": {
1189
+ "200": {
1190
+ "description": "A page of routing policies.",
1191
+ "content": {
1192
+ "application/json": {
1193
+ "schema": {
1194
+ "$ref": "#/components/schemas/RoutingPolicyList"
1195
+ }
1196
+ }
1197
+ }
1198
+ },
1199
+ "400": {
1200
+ "$ref": "#/components/responses/BadRequest"
1201
+ },
1202
+ "401": {
1203
+ "$ref": "#/components/responses/Unauthorized"
1204
+ },
1205
+ "500": {
1206
+ "$ref": "#/components/responses/ServerError"
1207
+ }
1208
+ }
1209
+ }
1210
+ },
1211
+ "/routing-policies/{id}": {
1212
+ "get": {
1213
+ "operationId": "get-routing-policy",
1214
+ "tags": [
1215
+ "Routing Policies"
1216
+ ],
1217
+ "summary": "Get a routing policy",
1218
+ "description": "Fetch a single routing policy by id.",
1219
+ "security": [
1220
+ {
1221
+ "ApiKeyAuth": []
1222
+ }
1223
+ ],
1224
+ "parameters": [
1225
+ {
1226
+ "name": "id",
1227
+ "in": "path",
1228
+ "required": true,
1229
+ "description": "Routing policy id.",
1230
+ "schema": {
1231
+ "type": "string"
1232
+ }
1233
+ }
1234
+ ],
1235
+ "responses": {
1236
+ "200": {
1237
+ "description": "The routing policy.",
1238
+ "content": {
1239
+ "application/json": {
1240
+ "schema": {
1241
+ "$ref": "#/components/schemas/RoutingPolicy"
1242
+ }
1243
+ }
1244
+ }
1245
+ },
1246
+ "401": {
1247
+ "$ref": "#/components/responses/Unauthorized"
1248
+ },
1249
+ "404": {
1250
+ "$ref": "#/components/responses/NotFound"
1251
+ },
1252
+ "500": {
1253
+ "$ref": "#/components/responses/ServerError"
1254
+ }
1255
+ }
1256
+ }
1162
1257
  }
1163
1258
  },
1164
1259
  "components": {
@@ -1451,6 +1546,11 @@
1451
1546
  "$ref": "#/components/schemas/RoutingRuleInput"
1452
1547
  },
1453
1548
  "description": "Optional; max 3. Specificity-wins precedence: a rule pinning both `source_network_id` and `source_asset_symbol` beats a network-only rule. When nothing matches, settlements use the default destination.\n"
1549
+ },
1550
+ "routing_policy_id": {
1551
+ "type": "string",
1552
+ "description": "Routing policy to attach to this UDA. Omit or send an empty string to attach the tenant's default policy. Per-UDA inline `routing_rules` still take precedence over the policy.\n",
1553
+ "example": "rpol_2f8c1a9d4e5f6071"
1454
1554
  }
1455
1555
  },
1456
1556
  "required": [
@@ -1655,6 +1755,61 @@
1655
1755
  "items": {
1656
1756
  "$ref": "#/components/schemas/RoutingRule"
1657
1757
  }
1758
+ },
1759
+ "routing_policy_id": {
1760
+ "type": "string",
1761
+ "description": "The routing policy attached to this UDA, when set. Omitted for legacy UDAs that inherit the tenant default policy.\n",
1762
+ "example": "rpol_2f8c1a9d4e5f6071"
1763
+ }
1764
+ }
1765
+ },
1766
+ "RoutingPolicy": {
1767
+ "type": "object",
1768
+ "description": "A tenant-scoped, ordered routing-policy. Rules are evaluated first-match-wins; an empty rule set falls through to the UDA's default destination.\n",
1769
+ "properties": {
1770
+ "id": {
1771
+ "type": "string",
1772
+ "example": "rpol_2f8c1a9d4e5f6071"
1773
+ },
1774
+ "name": {
1775
+ "type": "string",
1776
+ "example": "vip_tier"
1777
+ },
1778
+ "is_default": {
1779
+ "type": "boolean",
1780
+ "description": "Whether this is the tenant's default policy (one per tenant).",
1781
+ "example": false
1782
+ },
1783
+ "rules": {
1784
+ "type": "array",
1785
+ "description": "Ordered, first-match-wins routing rules (dual form).",
1786
+ "items": {
1787
+ "$ref": "#/components/schemas/RoutingRule"
1788
+ }
1789
+ },
1790
+ "created_at": {
1791
+ "type": "string",
1792
+ "format": "date-time",
1793
+ "example": "2026-05-20T14:03:12Z"
1794
+ },
1795
+ "updated_at": {
1796
+ "type": "string",
1797
+ "format": "date-time",
1798
+ "example": "2026-05-20T14:03:12Z"
1799
+ }
1800
+ }
1801
+ },
1802
+ "RoutingPolicyList": {
1803
+ "type": "object",
1804
+ "properties": {
1805
+ "data": {
1806
+ "type": "array",
1807
+ "items": {
1808
+ "$ref": "#/components/schemas/RoutingPolicy"
1809
+ }
1810
+ },
1811
+ "pagination": {
1812
+ "$ref": "#/components/schemas/Pagination"
1658
1813
  }
1659
1814
  }
1660
1815
  },
@@ -2067,13 +2222,15 @@
2067
2222
  },
2068
2223
  "eip155_id": {
2069
2224
  "type": "integer",
2225
+ "description": "Chain-specific numeric id: the EIP-155 chain id for EVM networks, or the analogous numeric chain id Stridge uses for non-EVM (TVM, SVM) networks. Always present.\n",
2070
2226
  "example": 1
2071
2227
  },
2072
2228
  "chain_type": {
2073
2229
  "type": "string",
2074
2230
  "enum": [
2075
2231
  "EVM",
2076
- "TVM"
2232
+ "TVM",
2233
+ "SVM"
2077
2234
  ],
2078
2235
  "example": "EVM"
2079
2236
  },
@@ -2338,11 +2495,20 @@
2338
2495
  "description": "Free-form note stored on the payout.",
2339
2496
  "example": "Payment for order #12345"
2340
2497
  },
2498
+ "type": {
2499
+ "type": "string",
2500
+ "enum": [
2501
+ "normal",
2502
+ "forceful"
2503
+ ],
2504
+ "default": "normal",
2505
+ "description": "Payout strategy. `normal` (default) refills gas when needed and retries until `expired_at`. `forceful` still refills when needed but is single-attempt — the refill and the transfer are each tried once, with no retry and no `expired_at`; it fails immediately if either can't complete.\n"
2506
+ },
2341
2507
  "expired_at": {
2342
2508
  "type": "string",
2343
2509
  "format": "date-time",
2344
- "description": "Cutoff after which a non-confirmed payout expires.",
2345
- "example": "2026-12-31T23:59:59Z"
2510
+ "description": "Cutoff after which a non-confirmed payout expires. Defaults to 1 hour from creation; capped at 12 hours ahead. Ignored for `forceful` payouts.\n",
2511
+ "example": "2026-01-01T01:00:00Z"
2346
2512
  }
2347
2513
  },
2348
2514
  "required": [
@@ -2360,7 +2526,8 @@
2360
2526
  "reference_id": "order-12345",
2361
2527
  "amount": "100.50",
2362
2528
  "remark": "Payment for order #12345",
2363
- "expired_at": "2026-12-31T23:59:59Z"
2529
+ "type": "normal",
2530
+ "expired_at": "2026-01-01T01:00:00Z"
2364
2531
  }
2365
2532
  },
2366
2533
  "Payout": {
@@ -2409,6 +2576,15 @@
2409
2576
  "type": "string",
2410
2577
  "example": "Payment for order #12345"
2411
2578
  },
2579
+ "type": {
2580
+ "type": "string",
2581
+ "enum": [
2582
+ "normal",
2583
+ "forceful"
2584
+ ],
2585
+ "description": "Payout strategy the payout was created with.",
2586
+ "example": "normal"
2587
+ },
2412
2588
  "status": {
2413
2589
  "type": "string",
2414
2590
  "enum": [
@@ -2443,7 +2619,7 @@
2443
2619
  "expired_at": {
2444
2620
  "type": "string",
2445
2621
  "format": "date-time",
2446
- "example": "2026-12-31T23:59:59Z"
2622
+ "example": "2026-01-01T01:00:00Z"
2447
2623
  }
2448
2624
  }
2449
2625
  },