@stable_sea/sdk 0.2.8 → 0.2.10
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 +18 -1
- package/dist/gen/schema.d.ts +107 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -207,7 +207,24 @@ registry metadata remains available. These figures are informational. Use a
|
|
|
207
207
|
quote to obtain the price for a trade. See the
|
|
208
208
|
[securities reference](https://docs.stablesea.com/api/reference/#GET/v1/securities).
|
|
209
209
|
|
|
210
|
-
## Transaction settlement references
|
|
210
|
+
## Transaction receipts and settlement references
|
|
211
|
+
|
|
212
|
+
Retrieve `GET /v1/transactions/{id}` with `money:read` for `financial_details`:
|
|
213
|
+
the same input/output, fee, net trade value, fund price and commission figures
|
|
214
|
+
as Terminal. Values use decimal strings. `estimated: true` means a figure can
|
|
215
|
+
change; false does not prove settlement. Optional `quoted` values are the native
|
|
216
|
+
receipt's comparison figures, with the currently disclosed fee held constant
|
|
217
|
+
for net trade comparisons. They are not necessarily the original order quote.
|
|
218
|
+
Deposit and withdrawal sections separate principal, fees, collection and
|
|
219
|
+
delivery. Fee refunds preserve their original collection history.
|
|
220
|
+
|
|
221
|
+
Input and output identify their `chain` and your `bank_account_id` or
|
|
222
|
+
`external_wallet_id` when applicable. Use `accounts:read` to retrieve linked
|
|
223
|
+
account details. Removed, internal and other businesses' accounts have no resource link.
|
|
224
|
+
|
|
225
|
+
Missing figures are omitted. A movement initiated by another business may affect
|
|
226
|
+
your balances without exposing its financial details. List responses omit receipt
|
|
227
|
+
enrichment; use `asset_changes` to reconcile settled balance effects.
|
|
211
228
|
|
|
212
229
|
Retrieve `GET /v1/transactions/{id}` with `money:read` to see
|
|
213
230
|
`onchain_transactions`. Each observed reference includes its `hash` and, when
|
package/dist/gen/schema.d.ts
CHANGED
|
@@ -534,10 +534,10 @@ export interface paths {
|
|
|
534
534
|
get: operations["orders.list"];
|
|
535
535
|
put?: never;
|
|
536
536
|
/**
|
|
537
|
-
* Place
|
|
538
|
-
* @description Creates
|
|
537
|
+
* Place an order
|
|
538
|
+
* @description Creates an order for the authenticated business and returns it as `pending`. BTC orders require both `investments:write` and `investments:btc_write` and use standard settlement. The BTC quote is indicative; execution uses the current native price and fees. Execution is asynchronous and uses the same authorization checks and trading engine as Terminal. Retrieve the order to follow it through `executing` to `filled` or `failed`.
|
|
539
539
|
*
|
|
540
|
-
*
|
|
540
|
+
* Fund orders check the quoted NAV at execution. Price changes and insufficient express liquidity can cause execution to fail. The failed order includes a reason. While the quote remains valid, an express refusal can be submitted as a new standard order.
|
|
541
541
|
*
|
|
542
542
|
* Use a Live key with the production URL or a Test key with the sandbox URL. A credential environment this host does not serve returns `environment_not_served` before an order or idempotency record is created.
|
|
543
543
|
*/
|
|
@@ -628,8 +628,8 @@ export interface paths {
|
|
|
628
628
|
cookie?: never;
|
|
629
629
|
};
|
|
630
630
|
/**
|
|
631
|
-
* Price a
|
|
632
|
-
* @description Returns
|
|
631
|
+
* Price a trade
|
|
632
|
+
* @description Returns an indicative price for BTC or a fund. Quotes have no ID and cannot be retrieved later. BTC prices use the latest unexpired native quote; reading one does not extend its expiry. Calculated BTC quote amounts are rounded to at most 18 decimal places. Actual trade amounts are determined at execution. BTC quotes include `platform_fee_usdc`, `fee_bps`, `net_usdc` and the `net_estimated_quantity` after the buy fee. `minimum_amount_usd` states the BTC order minimum. A BTC quote does not guarantee the execution price. Fund orders include the quoted NAV.
|
|
633
633
|
*
|
|
634
634
|
* `express` describes the commission, order limit, estimated quantity and settlement estimate for express settlement. These terms do not guarantee available liquidity. An express order may fail at execution; while the quote remains valid, you can submit a new standard order using the same quoted price. Standard settlement changes the commission and delivered quantity, not the quoted price.
|
|
635
635
|
*/
|
|
@@ -894,6 +894,8 @@ export interface paths {
|
|
|
894
894
|
*
|
|
895
895
|
* The status is `pending`, `processing`, `completed` or `failed`. `completed_ts` and `failed_ts` are mutually exclusive and absent while execution is pending or processing.
|
|
896
896
|
*
|
|
897
|
+
* `financial_details` contains Terminal's receipt amounts, fees and trade figures for a movement initiated by your business. Input and output identify their blockchain and link to your bank account or external wallet when applicable; retrieve linked account details with `accounts:read`. Internal and other businesses' accounts have no resource link. Missing figures are omitted. Amounts are decimal strings; `estimated: true` means a figure can change, while false does not prove settlement. Optional `quoted` figures follow Terminal's comparison precision; a net trade comparison holds the currently disclosed fee constant and is not necessarily the original order quote. Status, settled changes and financial details share one read snapshot. Refund totals describe the assessed movement; a fee-refund transaction links to it in `original_transaction_id`.
|
|
898
|
+
*
|
|
897
899
|
* `onchain_transactions` includes observed hashes, their blockchain when known, and available explorer links for movements initiated by your business. An empty array means no hashes have been observed; null means references are unavailable for this read. Lists omit these details.
|
|
898
900
|
*
|
|
899
901
|
* Unknown and cross-business IDs return the same not-found response.
|
|
@@ -1359,7 +1361,7 @@ export interface components {
|
|
|
1359
1361
|
}[];
|
|
1360
1362
|
/** @description Human-readable explanation. Use code or type for programmatic handling. */
|
|
1361
1363
|
message?: string;
|
|
1362
|
-
/** @description RFC 6901 JSON Pointer to the first offending field
|
|
1364
|
+
/** @description RFC 6901 JSON Pointer to the first offending field, on a validation error or a coded error about one field. */
|
|
1363
1365
|
param?: string;
|
|
1364
1366
|
/** @description Correlates with the Request-Id response header. */
|
|
1365
1367
|
request_id?: string;
|
|
@@ -1666,23 +1668,25 @@ export interface components {
|
|
|
1666
1668
|
/** @enum {string} */
|
|
1667
1669
|
state: "pending" | "executing" | "filled" | "failed";
|
|
1668
1670
|
symbol: string;
|
|
1671
|
+
/** @description The booked transaction, or null before a movement is committed. Retrieve it with money:read to follow settlement. A filled order means booked, not settled. */
|
|
1672
|
+
transaction_id: string | null;
|
|
1669
1673
|
};
|
|
1670
1674
|
OrderCreateInput: {
|
|
1671
|
-
/** @description The trade size as a decimal string: USD on a buy,
|
|
1675
|
+
/** @description The trade size as a decimal string: USD on a buy, asset units on a sell. Must be positive. */
|
|
1672
1676
|
amount: string;
|
|
1673
1677
|
/**
|
|
1674
1678
|
* @description Which side to trade.
|
|
1675
1679
|
* @enum {string}
|
|
1676
1680
|
*/
|
|
1677
1681
|
direction: "buy" | "sell";
|
|
1678
|
-
/** @description The price_per_unit from GET /v1/quotes.
|
|
1682
|
+
/** @description The price_per_unit from GET /v1/quotes. Fund execution checks the NAV; BTC uses an indicative price and executes at the current native price. */
|
|
1679
1683
|
quoted_price: string;
|
|
1680
1684
|
/**
|
|
1681
1685
|
* @description Settlement mode. Express (instant) carries a commission the standard path does not; see the express terms on GET /v1/quotes. Express draws on a shared reserve, so an express order can be refused at execution and the order reaches a failed state naming why — re-place it as standard against the same unexpired quote.
|
|
1682
1686
|
* @enum {string}
|
|
1683
1687
|
*/
|
|
1684
1688
|
settlement: "standard" | "instant";
|
|
1685
|
-
/** @description The
|
|
1689
|
+
/** @description The asset ticker, such as BTC or WTGXX. BTC also requires investments:btc_write. */
|
|
1686
1690
|
symbol: string;
|
|
1687
1691
|
};
|
|
1688
1692
|
OrderList: {
|
|
@@ -1818,9 +1822,19 @@ export interface components {
|
|
|
1818
1822
|
/** Format: date-time */
|
|
1819
1823
|
expires_ts: string;
|
|
1820
1824
|
express?: components["schemas"]["QuoteExpress"];
|
|
1825
|
+
/** @description Native BTC platform fee rate, in basis points. */
|
|
1826
|
+
fee_bps?: number | null;
|
|
1821
1827
|
livemode: boolean;
|
|
1828
|
+
/** @description Minimum BTC order notional in USD, before the platform fee. */
|
|
1829
|
+
minimum_amount_usd?: string;
|
|
1830
|
+
/** @description Estimated BTC received after the buy fee. Omitted on sells. */
|
|
1831
|
+
net_estimated_quantity?: string | null;
|
|
1832
|
+
/** @description USDC allocated to a BTC buy, or estimated sell proceeds, after the fee. */
|
|
1833
|
+
net_usdc?: string;
|
|
1822
1834
|
/** @enum {string} */
|
|
1823
1835
|
object: "quote";
|
|
1836
|
+
/** @description Estimated native BTC platform fee in USDC. */
|
|
1837
|
+
platform_fee_usdc?: string;
|
|
1824
1838
|
price_per_unit: string;
|
|
1825
1839
|
symbol: string;
|
|
1826
1840
|
};
|
|
@@ -2249,6 +2263,22 @@ export interface components {
|
|
|
2249
2263
|
/** @description The asset symbol, in the ledger's own casing (USDC, WTGXX, SOL:USDC). */
|
|
2250
2264
|
asset: string;
|
|
2251
2265
|
};
|
|
2266
|
+
TransactionDepositAmounts: {
|
|
2267
|
+
available: boolean;
|
|
2268
|
+
collected_platform_fee_usdc: string;
|
|
2269
|
+
/** @enum {string} */
|
|
2270
|
+
collection_status: "not_needed" | "pending" | "collected" | "failed" | "insufficient_proceeds";
|
|
2271
|
+
estimated: boolean;
|
|
2272
|
+
/** Format: date-time */
|
|
2273
|
+
first_observed_ts: string | null;
|
|
2274
|
+
gross_deposit_usd: string;
|
|
2275
|
+
gross_proceeds_usdc: string;
|
|
2276
|
+
net_usdc: string;
|
|
2277
|
+
platform_fee_usdc: string;
|
|
2278
|
+
pricing_basis: string | null;
|
|
2279
|
+
/** Format: date-time */
|
|
2280
|
+
pricing_ts: string | null;
|
|
2281
|
+
};
|
|
2252
2282
|
TransactionDetail: {
|
|
2253
2283
|
/** @description Signed net changes to settled holdings, one entry per asset, ordered by asset. Empty when no part has settled. A failed movement includes any changes that settled before failure; pending or processing status alone does not determine whether this array is empty. */
|
|
2254
2284
|
asset_changes: components["schemas"]["TransactionAssetChange"][];
|
|
@@ -2267,6 +2297,7 @@ export interface components {
|
|
|
2267
2297
|
* @description When the movement terminated as failed. Present only when status is failed, and never alongside completed_ts.
|
|
2268
2298
|
*/
|
|
2269
2299
|
failed_ts?: string;
|
|
2300
|
+
financial_details?: components["schemas"]["TransactionFinancialDetail"];
|
|
2270
2301
|
/** @description The transaction id. Stable for the life of the movement and safe to store. */
|
|
2271
2302
|
id: string;
|
|
2272
2303
|
/** @description Whether the resource represents live financial data. False for an isolated simulated ledger; independent of the reading credential. */
|
|
@@ -2286,6 +2317,43 @@ export interface components {
|
|
|
2286
2317
|
*/
|
|
2287
2318
|
type: "ach_offramp" | "ach_onramp" | "adjustment" | "buy_fund_token" | "buy_fund_token_return" | "buy_fund_token_return_sweep" | "deposit_hold" | "deposit_return" | "deposit_reversal" | "fund_cash_subscription" | "fund_dividend_payout" | "fund_distribution_payout" | "fund_gas_tank" | "fund_xlm_reserve" | "gas_tank_refill" | "gas_wallet_funding" | "go_account_conversion" | "go_account_custodial_transfer" | "go_account_external_send" | "held_deposit_release" | "onchain_deposit" | "onchain_withdrawal" | "ramp_fee_refund" | "reclassification" | "sell_fund_token" | "sell_fund_token_return" | "trade_order" | "treasury_booking" | "treasury_wire_credit" | "wire_offramp" | "wire_onramp";
|
|
2288
2319
|
};
|
|
2320
|
+
TransactionFeeReturns: {
|
|
2321
|
+
original_transaction_id: string | null;
|
|
2322
|
+
refund_transaction_ids: (string | null)[] | null;
|
|
2323
|
+
refunded: boolean;
|
|
2324
|
+
/** @description Total fee refunds recorded against this movement's assessment. A fee-refund transaction links to the original assessed transaction instead. */
|
|
2325
|
+
refunded_usdc: string;
|
|
2326
|
+
waived: boolean;
|
|
2327
|
+
};
|
|
2328
|
+
TransactionFigure: {
|
|
2329
|
+
amount: string;
|
|
2330
|
+
asset: string;
|
|
2331
|
+
/** @description Whether this figure can still change. False also covers terminal failure and a fund-trade amount fixed at placement; it does not prove settlement. */
|
|
2332
|
+
estimated: boolean;
|
|
2333
|
+
quoted?: components["schemas"]["TransactionValue"];
|
|
2334
|
+
};
|
|
2335
|
+
TransactionFinancialDetail: {
|
|
2336
|
+
automation_id: string | null;
|
|
2337
|
+
deposit?: components["schemas"]["TransactionDepositAmounts"];
|
|
2338
|
+
/**
|
|
2339
|
+
* Format: date-time
|
|
2340
|
+
* @description Pending fund settlement estimate. Null after the native receipt no longer reports an estimate.
|
|
2341
|
+
*/
|
|
2342
|
+
estimated_settlement_ts: string | null;
|
|
2343
|
+
fee?: components["schemas"]["TransactionValue"];
|
|
2344
|
+
fee_returns?: components["schemas"]["TransactionFeeReturns"];
|
|
2345
|
+
input?: components["schemas"]["TransactionSide"];
|
|
2346
|
+
net_amount?: components["schemas"]["TransactionFigure"];
|
|
2347
|
+
output?: components["schemas"]["TransactionSide"];
|
|
2348
|
+
price_per_unit?: components["schemas"]["TransactionFigure"];
|
|
2349
|
+
settlement_commission?: components["schemas"]["TransactionValue"];
|
|
2350
|
+
/**
|
|
2351
|
+
* @description Recorded fund settlement choice; null when none was recorded.
|
|
2352
|
+
* @enum {string|null}
|
|
2353
|
+
*/
|
|
2354
|
+
settlement_pathway: "standard" | "express" | null;
|
|
2355
|
+
withdrawal?: components["schemas"]["TransactionWithdrawalAmounts"];
|
|
2356
|
+
};
|
|
2289
2357
|
TransactionList: {
|
|
2290
2358
|
data: components["schemas"]["Transaction"][];
|
|
2291
2359
|
has_more: boolean;
|
|
@@ -2303,6 +2371,34 @@ export interface components {
|
|
|
2303
2371
|
/** @description Observed transaction hash. */
|
|
2304
2372
|
hash: string;
|
|
2305
2373
|
};
|
|
2374
|
+
TransactionSide: {
|
|
2375
|
+
amount: string;
|
|
2376
|
+
asset: string;
|
|
2377
|
+
/** @description Your bank-account resource, omitted after removal. Retrieve it with accounts:read for account details. */
|
|
2378
|
+
bank_account_id?: string;
|
|
2379
|
+
/** @description Blockchain used by this ledger leg, when it names one. Internal conversions and bank legs have no chain. */
|
|
2380
|
+
chain?: string;
|
|
2381
|
+
/** @description Whether this figure can still change. False also covers terminal failure and a fund-trade amount fixed at placement; it does not prove settlement. */
|
|
2382
|
+
estimated: boolean;
|
|
2383
|
+
/** @description Your external-wallet resource, omitted after removal. Retrieve it with accounts:read for wallet details. */
|
|
2384
|
+
external_wallet_id?: string;
|
|
2385
|
+
quoted?: components["schemas"]["TransactionValue"];
|
|
2386
|
+
};
|
|
2387
|
+
TransactionValue: {
|
|
2388
|
+
amount: string;
|
|
2389
|
+
asset: string;
|
|
2390
|
+
};
|
|
2391
|
+
TransactionWithdrawalAmounts: {
|
|
2392
|
+
bank_fee_usd: string;
|
|
2393
|
+
collected_platform_fee_usdc: string;
|
|
2394
|
+
/** @enum {string} */
|
|
2395
|
+
collection_status: "not_needed" | "pending" | "collected" | "failed";
|
|
2396
|
+
delivered: boolean;
|
|
2397
|
+
estimated: boolean;
|
|
2398
|
+
paid_to_bank_usd: string;
|
|
2399
|
+
platform_fee_usdc: string;
|
|
2400
|
+
total_debit_usdc: string;
|
|
2401
|
+
};
|
|
2306
2402
|
USBankAccountCreateDetails: {
|
|
2307
2403
|
account_number: string;
|
|
2308
2404
|
/** @enum {string} */
|
|
@@ -3750,11 +3846,11 @@ export interface operations {
|
|
|
3750
3846
|
"quotes.quote": {
|
|
3751
3847
|
parameters: {
|
|
3752
3848
|
query: {
|
|
3753
|
-
/** @description The
|
|
3849
|
+
/** @description The asset ticker to price, such as BTC or WTGXX. */
|
|
3754
3850
|
symbol: string;
|
|
3755
3851
|
/** @description Which side to price. */
|
|
3756
3852
|
direction: "buy" | "sell";
|
|
3757
|
-
/** @description The trade size as a decimal string: USD on a buy,
|
|
3853
|
+
/** @description The trade size as a decimal string: USD on a buy, asset units on a sell. Must be positive. */
|
|
3758
3854
|
amount: string;
|
|
3759
3855
|
};
|
|
3760
3856
|
header?: never;
|