@ostium/builder-sdk@0.4.1.
Install
Core SDK surfaces
- client creation methods for each execution mode
- build-only transaction helpers for client-side signing
- SDK-managed write methods for direct submission
- read methods backed by the subgraph and builder API
- live streams for prices, positions, and low-latency account confirmations
Method index
Client creation
createSelfAndSelfcreateSelfAndGaslesscreateDelegatedAndSelfcreateDelegatedAndGaslesscreateReadOnly
Helpers
canBuildTransactionscanSubmitTransactionsgetTraderAddressisReadOnlygetSmartAccountAddresscheckUsdcAllowancegetBalancesextractOrderIdFromReceipt
Utilities and constants
parseUsdcparsePriceparseLeverageMIN_OPEN_SIZE_USDMIN_COLLATERAL_USDMAX_COLLATERAL_USD
Read methods
getPairsgetAllPricesgetOpenPositionsgetOpenOrdersgetOrdersgetBuilderOrdersgetFillsgetFillsByTimegetSimSlippagegetSimOrderbookgetCandlesstreamPricesstreamPositionUpdatesstreamAccountUpdates
Transaction builders
getSetupGaslessDelegationTxgetApproveUsdcTxgetSetDelegateTxgetRemoveDelegateTxgetOpenTradeTxgetCloseTradeTxgetCancelOrderTxgetModifyOrderTxgetUpdateCollateralTx
Write methods
approveUsdcsetupGaslessDelegationsetDelegateremoveDelegateopenTradecloseTrademodifyOrderupdateCollateralcancelOrder
Build vs submit
Every write action now has two SDK surfaces:get*Tx()returns unsigned transaction data for wallet-driven or Safe-driven client applications- the write method (
openTrade,closeTrade,approveUsdc, and so on) signs and submits through the configured mode when the client was created with credentials
get*Tx() methods return a Safe-style request instead of an EOA request.
Guides
If you want implementation examples instead of method reference, use the guides section:Error handling
See Errors for the exportedOstiumError, OstiumSubgraphError, and their error codes.
Changelog
See Changelog for the versioned SDK changes, including the0.4.1 additions.