@stable_sea/sdk 0.2.40 → 0.2.42
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 +67 -7
- package/dist/gen/schema.d.ts +735 -5
- package/dist/gen/session-schema.d.ts +650 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ import { createStableSeaClient } from "@stable_sea/sdk";
|
|
|
21
21
|
const client = createStableSeaClient({
|
|
22
22
|
apiKey: process.env.STABLE_SEA_API_KEY!,
|
|
23
23
|
baseUrl: process.env.STABLE_SEA_BASE_URL!,
|
|
24
|
-
version: "2026-10-
|
|
24
|
+
version: "2026-10-26",
|
|
25
25
|
});
|
|
26
26
|
```
|
|
27
27
|
|
|
@@ -53,9 +53,9 @@ keys and rotations reuse that data.
|
|
|
53
53
|
WTGXX supports standard and instant settlement. FLTTX supports standard
|
|
54
54
|
settlement; instant orders are refused in both production and sandbox.
|
|
55
55
|
|
|
56
|
-
Every fund order names the network it settles on, `ethereum
|
|
57
|
-
API never applies a business's default network. A BTC order settles
|
|
58
|
-
and must not name one. The generated `network` type is optional because BTC shares
|
|
56
|
+
Every fund order names the network it settles on, `ethereum`, `stellar` or
|
|
57
|
+
`solana`. The API never applies a business's default network. A BTC order settles
|
|
58
|
+
on no network and must not name one. The generated `network` type is optional because BTC shares
|
|
59
59
|
the request, so the server enforces both rules: a fund order without a network
|
|
60
60
|
fails with `network_required`, and a BTC order with one fails with
|
|
61
61
|
`network_not_applicable`. Sandbox settles on `ethereum`. Instant settlement is
|
|
@@ -188,6 +188,12 @@ Test-key Sandbox does not serve member sessions. Test approval review and
|
|
|
188
188
|
business-rule management use this same business client and session. Your existing
|
|
189
189
|
member permissions apply.
|
|
190
190
|
|
|
191
|
+
The member client also reads `GET /money/maintenance` using the signed-in
|
|
192
|
+
business session. Its customer response contains `paused`, the custody `revision`
|
|
193
|
+
and optional `updated_ts`, excluding operator reasons or actors. Pause new money
|
|
194
|
+
actions and withhold cached deposit instructions while paused or when this
|
|
195
|
+
authority cannot be read; scope instruction caches by business and revision.
|
|
196
|
+
|
|
191
197
|
```ts
|
|
192
198
|
import { createStableSeaSessionClient } from "@stable_sea/sdk";
|
|
193
199
|
|
|
@@ -629,15 +635,32 @@ its first chart refresh. The document's captured financial figures remain readab
|
|
|
629
635
|
balance, for a business whose WisdomTree Solana switch is on (otherwise
|
|
630
636
|
`FailedPrecondition`); every other fund, and every sell with
|
|
631
637
|
`proceeds_destination: "solana"`, is refused with a 400
|
|
632
|
-
`invalid_settlement_source`. `/v1` fund orders
|
|
638
|
+
`invalid_settlement_source`. `/v1` fund orders name Solana from the
|
|
639
|
+
October 26 contract below. A
|
|
633
640
|
fund-trade approval's `fund_route` reports `source: "solana"` and
|
|
634
641
|
`source_network: "solana"` for such a buy.
|
|
635
642
|
|
|
643
|
+
## October 26 API contract
|
|
644
|
+
|
|
645
|
+
Update to the latest SDK before placing a fund order on Solana. `POST /v1/orders`
|
|
646
|
+
accepts `network: "solana"` for a fund order, and every order read may return
|
|
647
|
+
`network: "solana"`. A standard WTGXX buy on Solana is funded from the business's
|
|
648
|
+
segregated Solana USDC balance, and a standard WTGXX sell on Solana returns its
|
|
649
|
+
proceeds there, through the same execution path as Terminal. Any other Solana
|
|
650
|
+
order (another fund, or instant settlement), and any Solana order from a business
|
|
651
|
+
outside the WisdomTree Solana program or outside its Solana deposit rollout, ends
|
|
652
|
+
`failed` with `network_not_eligible`. While the platform is still setting up the
|
|
653
|
+
business's Solana wallet, or refilling the SOL it pays network fees with, the order
|
|
654
|
+
stays `pending` and is retried.
|
|
655
|
+
A business that turned Solana off gets `network_not_in_use`. The HTTP request pin
|
|
656
|
+
is `2026-10-26`; the retired `2026-10-16` pin returns
|
|
657
|
+
`400 unsupported_api_version`.
|
|
658
|
+
|
|
636
659
|
## October 16 API contract
|
|
637
660
|
|
|
638
661
|
Update to the latest SDK before placing fund orders. `POST /v1/orders` takes a
|
|
639
662
|
`network` for every fund order and refuses it for BTC, and every order read returns
|
|
640
|
-
`network` (`null` for BTC). The HTTP request pin
|
|
663
|
+
`network` (`null` for BTC). The HTTP request pin was `2026-10-16`; the retired
|
|
641
664
|
`2026-10-15` pin returns `400 unsupported_api_version`. An order whose network the
|
|
642
665
|
business turned off, or cannot settle on, ends `failed` with `network_not_in_use`
|
|
643
666
|
or `network_not_eligible`.
|
|
@@ -649,7 +672,7 @@ with `client.DELETE("/v1/bank_accounts/{id}")`, without a body or idempotency ke
|
|
|
649
672
|
Read bank and wallet operation `status` instead of `state`. Retrieve issued
|
|
650
673
|
statement content with `GET /v1/statements/{id}`; the `/content` route is retired.
|
|
651
674
|
|
|
652
|
-
The HTTP request pin is `2026-10-
|
|
675
|
+
The HTTP request pin is `2026-10-26`. The retired pin returns
|
|
653
676
|
`400 unsupported_api_version`. Existing API keys remain valid; stored key and
|
|
654
677
|
thin-event/webhook versions are preserved.
|
|
655
678
|
|
|
@@ -727,3 +750,40 @@ a queued fee refund is separate from both principal recovery and a settled refun
|
|
|
727
750
|
The [Sandbox test project](consumer-test/README.md#test-a-withdrawal) includes
|
|
728
751
|
`npm run test:withdrawal` for a saved Test destination. It preserves request keys
|
|
729
752
|
and receipts so an interrupted run can resume without creating a new withdrawal.
|
|
753
|
+
|
|
754
|
+
## Swap stablecoins
|
|
755
|
+
|
|
756
|
+
Swaps between USDC and USDT on Ethereum run in your Go Account once Stable Sea
|
|
757
|
+
enables them for your business. Create a key with **Swap stablecoins**
|
|
758
|
+
(`money:swaps_write`) and **Read financial data** (`money:read`). The permission
|
|
759
|
+
appears only while swaps are enabled.
|
|
760
|
+
|
|
761
|
+
Read `GET /v1/swap_routes` for whether swaps are enabled, each route's limits,
|
|
762
|
+
your swap fee rate and the available balance of each asset. Estimates, quotes and
|
|
763
|
+
swaps are processed in the background: poll each until `status` leaves `pending`.
|
|
764
|
+
|
|
765
|
+
```ts
|
|
766
|
+
const quoting = client.mutation();
|
|
767
|
+
const { data: quote } = await quoting.POST("/v1/swap_quotes", {
|
|
768
|
+
body: { route: "ethereum_usdc_usdt", from_asset: "USDC", to_asset: "USDT", amount: "1000" },
|
|
769
|
+
});
|
|
770
|
+
// Retrieve GET /v1/swap_quotes/{id} until status is ready, then review terms.
|
|
771
|
+
const swapping = client.mutation();
|
|
772
|
+
const { data: swap } = await swapping.POST("/v1/swaps", { body: { quote_id: quote!.id } });
|
|
773
|
+
```
|
|
774
|
+
|
|
775
|
+
`POST /v1/swap_estimates` prices a swap without a binding quote; its `result`
|
|
776
|
+
names the first check a quote would fail in `refusal_reason`. A firm quote lives
|
|
777
|
+
for at most a minute, so submit it promptly; a swap that starts after
|
|
778
|
+
`expires_ts` fails with `quote_expired`. Each quote executes once. A refused
|
|
779
|
+
estimate, quote or swap reports why in `failure_code`.
|
|
780
|
+
|
|
781
|
+
Follow `GET /v1/swaps/{id}` to `completed` or `failed`. Once booked,
|
|
782
|
+
`transaction_id` names the transaction whose legs carry the amounts actually sent,
|
|
783
|
+
received and charged. After a lost response, resend the same body with the same
|
|
784
|
+
`Idempotency-Key`, or find the swap with `GET /v1/swap_submissions?idempotency_key=…`.
|
|
785
|
+
Never submit the quote again under a new key.
|
|
786
|
+
|
|
787
|
+
Signed-in members use the member client's `/money/swap_routes`,
|
|
788
|
+
`/money/swap_estimate`, `/money/swap_quotes`, `/money/swaps` and
|
|
789
|
+
`/money/swap_submissions`, with their own buy or sell permission.
|