- Breaking: Package renamed from
@coinbase-sample/prime-sdk-tsto@coinbase/prime-sdk-ts. Update all import paths (including subpaths/manual,/modular,/services,/client,/types). - Dependency updated from
@coinbase-sample/core-tsto@coinbase/core-ts@^0.4.0. - Repository moved to
coinbase/prime-sdk-tson GitHub.
Financing Service
getCrossMarginRiskParameters(): Get current Cross Margin (XM) risk parameters for an entity, including per-tier ratios, volatility thresholds, liquidity add-ons, and offset credit matrices (GET /entities/{entityId}/cross_margin/risk_parameters)getCrossMarginPrimeOverview(): Get full live cross-margin margin information for an entity, including margin summary, control status, margin level, and equity breakdowns (GET /v2/entities/{entityId}/cross_margin/prime)setFundingSettings(): Set FCM funding configuration for an entity β designates a funding portfolio and configures auto-conversion, auto-loans, and auto-return of excess margin (POST /entities/{entityId}/funding_settings)listMarketData(): Retrieve market data including historical volatility (5d/30d/90d/weighted) and average daily volume for assets associated with an entity, with cursor pagination (GET /entities/{entityId}/market_data)
New Models
ActiveLiquidationSummary: Summary of the active or most recent XM liquidation (ID, status, shortfall amount)GetCrossMarginRiskParametersResponse: Response for get cross margin risk parametersGetCrossMarginPrimeOverviewResponse: Response for get prime cross margin overviewSetFundingSettingsResponse: Response for set funding settings (activity ID, type, approvals remaining)GetMarketDataResponse: Paginated response for list market dataCrossMarginRiskParameters: XM 2.0 risk parameters for an asset tierTierPairRateEntry: Entry in an offset credit matrix for a tier pairCrossMarginPrimeMarginSummary: Cross-margin account summary with equity, margin requirements, and nested breakdownsCrossMarginPrimeSpotEquityBreakdown: Breakdown of spot equity componentsCrossMarginPrimeDerivativesEquityBreakdown: Breakdown of derivatives equity componentsCrossMarginPrimeRiskNettingInfo: XM margin requirement components, offset credits, and per-asset rowsCrossMarginPrimeXMPosition: Per-asset XM position row with market price, balances, and margin detailsPrimeXMMarginCallThresholds: Structured margin thresholds by margin levelPrimeXMMarginRequirementBreakdown: Breakdown of base margin, volatility/liquidity add-ons, and offset creditsPrimeXMOffsetCreditBreakdown: Breakdown of offset credit components (basis, long/short, same-tier)PrimeXMMarginThreshold: Single margin threshold entry (level, type, value)MarketData: Market data entry with volatility and ADV for a single assetValidatorUnstakePreview: Per-validator breakdown for an unstake preview (address, estimated amount, time)
Updated Models
CrossMarginOverview: AddedactiveLiquidationfield (ActiveLiquidationSummary)NetworkDetails: AddedminWithdrawalAmount,maxWithdrawalAmount,minDepositAmountfieldsPreviewUnstakeResponse: AddedwalletId,walletAddress,currentTimestamp, andvalidators(per-validator breakdown)RFQOrderPreviewResponse: AddedquoteDurationMs(echo of the requested quote timeout)RFQ(request body): AddedquoteDurationMsoptional field (quote timeout in milliseconds, 1β30000)
PrimeXMControlStatus:TRADES_AND_WITHDRAWALS,TRADES_ONLY,SESSION_LOCKEDPrimeXMMarginLevel:HEALTHY_THRESHOLD,WARNING_THRESHOLD,URGENT_MARGIN_CALL_THRESHOLD,LIQUIDATION_THRESHOLD,DEFICIT_THRESHOLDPrimeXMMarginRequirementType:MARGIN_REQUIREMENT_TYPE_DMR_PLUS_PMR,MARGIN_REQUIREMENT_TYPE_IPMR_PLUS_IFMRPrimeXMHealthStatus: Health status values fromHEALTH_STATUS_HEALTHYthroughHEALTH_STATUS_IN_DEFICITPrimeXMMarginThresholdType:MARGIN_THRESHOLD_EQUITY_RATIO,MARGIN_THRESHOLD_DEFICIT_RATIOXMLiquidationStatus:XM_LIQUIDATION_STATUS_PRE_LIQUIDATION,XM_LIQUIDATION_STATUS_LIQUIDATING,XM_LIQUIDATION_STATUS_LIQUIDATED,XM_LIQUIDATION_STATUS_CANCELED,XM_LIQUIDATION_STATUS_FAILEDUserRole: AddedBUSINESS_MANAGERvalue
generateTypes.js: Now stripsBeta/PrimeBetaprefixes from all generated model and enum names so beta API types are named consistently with stable types (e.g.BetaPrimeXMControlStatusβPrimeXMControlStatus)
XMRiskNettingInfo: FieldnodalMarginRequirementrenamed todcoMarginRequirement(Derivatives Clearing Organization Margin Requirement). Update any code reading this field.
Advanced Transfers Service (new service)
listAdvancedTransfers(): List advanced transfers for a portfolio with optional state/type/time/referenceId filtering and cursor pagination (GET /portfolios/{portfolioId}/advanced_transfers)createAdvancedTransfer(): Create a new advanced transfer (e.g. blind match settlement) (POST /portfolios/{portfolioId}/advanced_transfers)cancelAdvancedTransfer(): Cancel an advanced transfer by ID (POST /portfolios/{portfolioId}/advanced_transfers/{advancedTransferId}/cancel)listAdvancedTransferTransactions(): List transactions associated with an advanced transfer (GET /portfolios/{portfolioId}/advanced_transfers/{advancedTransferId}/transactions)
Futures Service
getEntityEquity(): Get FCM equity data for an entity (GET /entities/{entityId}/futures/equity)
Transactions Service
getTransactionTravelRuleData(): Retrieve travel rule data for a specific transaction (GET /portfolios/{portfolioId}/transactions/{transactionId}/travel_rule)
New Models
AdvancedTransfer: Represents an advanced transfer between portfoliosBlindMatchMetadata: Metadata for blind match operationsCancelAdvancedTransferResponse: Response for cancelling an advanced transferCommissionDetailTotal: Commission detail totals for orders/fillsCreateAdvancedTransferRequest/CreateAdvancedTransferResponse: Request/response for creating advanced transfersFcmScheduledMaintenance: Scheduled maintenance window details for FCMFcmTradingSessionDetails: FCM trading session state and timing detailsFundMovement: Fund movement details for transfersFutureProductDetails: Detailed futures product information (expiry, status, margin, etc.)GetFcmEquityResponse: Response for FCM entity equity endpointGetTransactionTravelRuleDataResponse: Response for transaction travel rule dataListAdvancedTransfersResponse/ListAdvancedTransferTransactionsResponse: Responses for listing advanced transfers and their transactionsPerpetualProductDetails: Perpetual futures product detailsValidatorAllocation: Validator address and amount for ETH V2 staking operations
Updated Models
Fill: Additional fields for FCM and commission detailsOrder: Additional fields for FCM order dataProduct: AddedproductType,futureProductDetails, andperpetualDetailsfieldsWalletUnstakeInputs: AddedvalidatorAllocationsfor validator-level unstakingEntityUser/PortfolioUser: Additional user fields
AdvancedTransferState,AdvancedTransferTypeContractExpiryType,ExpiringContractStatusFcmMarginHealthState,FcmTradingSessionState,FcmTradingSessionClosedReasonProductType,RiskManagementType,SecondaryPermission
- GitHub Action: Update API Spec β Daily scheduled workflow that fetches the latest OpenAPI spec, regenerates types, and opens a PR if changes are detected
- GitHub Action: Release β Publishes to npm via trusted publishing
- GitHub Action: Format & Lint β CI checks for code formatting and linting
- GitHub Action: Salus Scan β Security scanning workflow
- Added
CONTRIBUTING.mdandSECURITY.md - Added pull request template (
.github/PULL_REQUEST_TEMPLATE.md) generateTypes.js: New files now use the current year in the copyright header; existing files preserve their original year- Updated
openapitools.jsonto pin openapi-generator CLI at v7.19.0
- Removed unused models no longer in the API spec:
DateOfBirth,TravelRuleEntry,TravelRuleWalletDetails,VASP
Futures Service
getEntityEquity(): Get FCM equity data for an entity
ValidatorAllocation: Specifies validator address and amount for granular ETH V2 staking/unstaking operationsWalletUnstakeInputs: AddedvalidatorAllocationsfield for validator-level ETH V2 unstaking (Alpha)
- GitHub Action: Update API Spec β Daily scheduled workflow that fetches the latest OpenAPI spec, regenerates types, and opens a PR if changes are detected
- GitHub Action: Release - now publishing to npm via action
generateTypes.js: New files now use the current year in the copyright header; existing files preserve their original year- Updated
openapitools.jsonto pin openapi-generator CLI at v7.19.0
- Removed unused models no longer in the API spec:
DateOfBirth,TravelRuleEntry,TravelRuleWalletDetails,VASP
Transactions Service
submitDepositTravelRule(): Submit travel rule data for an existing deposit transaction- Provide originator and beneficiary information for travel rule compliance
- Supports self-transfer flag and ownership verification opt-out
Staking Service
getStakingStatus(): Get staking status for a wallet- Retrieve estimated completion times for active staking requests
- Returns validator staking information with status details
Comprehensive Input Validation Across All Services
- Added client-side validation for required path parameters (UUIDs) across all services
- Added validation for required query parameters (e.g.,
productId,startTime,endTime,granularityinlistProductCandles) - Added validation for required body parameters in create/update endpoints
- Validation errors throw
CoinbasePrimeClientExceptionwith clear, actionable error messages
Futures Service
getFcmSettings(): Get FCM settings for an entity- Retrieve target derivatives excess configuration
setFcmSettings(): Update FCM settings for an entity- Set target derivatives excess amount
Financing Service
listTFObligations(): List Trade Finance obligations for an entity- Retrieve trade finance loans with amount due, notional amounts, and due dates
listFinancingEligibleAssets(): List assets eligible for Trade Finance- Get all assets with their asset and liability adjustment factors
Staking Service
previewUnstake(): Preview an unstaking operation- Get estimated amount that would be unstaked before initiating (ETH only)
getUnstakingStatus(): Get unstaking status for a wallet- Retrieve estimated completion times for active unstaking requests
Transactions
listPortfolioTransactions()now supports:getNetworkUnifiedTransactions: Flag to retrieve all transactions across all networks for a given symboltravelRuleStatus: Filter by travel rule status (Alpha)
Activities
listEntityActivities()andlistPortfolioActivities()now support:getNetworkUnifiedActivities: Flag to retrieve all activities across all networks for a given symbol
Wallets
listWallets()now supports:getNetworkUnifiedWallets: Flag to retrieve all wallets across all networks for a given symbol
- New order type:
PEG- Pegged orders that dynamically adjust based on market conditions - New transaction types:
PORTFOLIO_STAKE,PORTFOLIO_UNSTAKE- Portfolio-level staking operations - New Travel Rule types for compliance:
TravelRuleEntry,TravelRuleParty,VASP,TravelRuleStatus - New staking types:
PreviewUnstakeResponse,GetUnstakingStatusResponse,ValidatorUnstakingInfo,UnstakingStatus - Candle granularity enum fixes:
THIRTY_MINUTEβTHIRTY_MINUTES,TWO_HOURβTWO_HOURS,FOUR_HOURβFOUR_HOURS
Products Service
listProductCandles(): Get historical candle data for a product (Beta)- Retrieve time-series market data with open, high, low, close, and volume
- Support for multiple granularities (1min, 5min, 15min, 30min, 1hr, 2hr, 4hr, 6hr, 1day)
- Includes example with default 24-hour time range
Staking Service
queryTransactionValidators(): Query ETH 0x02 validators associated with wallet-level stake transactions
Financing Service
getCrossMarginOverview(): Retrieve live Cross Margin (XM) data for XM customers
Orders Service
editOrder(): Edit an existing open order (Beta)- Modify limit price, base quantity, quote value, and other order parameters
fetch-spec: New script to download the latest OpenAPI spec from Coinbase Prime APIupdate-spec: Enhanced to include fetching the latest spec before generating types
- Updated core-ts to improve query param array handling
- Fixed query param naming of symbol to symbols for ListPortfolioBalancesRequest
- Fixed GetPaymentMethodRequest type to include paymentMethodId
- Complete SDK Examples: Added 50+ working examples across all services
- Full CRUD operations for portfolios, futures, orders, transactions, and more
- Consistent error handling and multiline console output formatting
- Flexible CLI arguments with sensible defaults and environment variable support
- CoinbasePrimeClientWithServices: New client with lazy-loaded service getters for optimal bundle size
- Services accessed via clean
client.services.method()syntax - Lazy initialization reduces initial bundle size by up to 75%
- Built-in tree-shaking for unused services
- Services accessed via clean
- Multiple Entry Points: Optimized imports for different use cases
@coinbase-sample/prime-sdk-ts/manual- Manual service instantiation (comprehensive exports)@coinbase-sample/prime-sdk-ts/modular- Lazy-loaded services (minimal bundle)@coinbase-sample/prime-sdk-ts/services- Service classes only (94% smaller bundles)@coinbase-sample/prime-sdk-ts/client- Client classes only (97% smaller bundles)@coinbase-sample/prime-sdk-ts/types- Types only (0kb runtime, perfect for shared libraries)
- Unified Configuration:
CoinbasePrimeClientConfiginterface for both clients- Extends
CoinbaseHttpClientRetryOptionswith Prime-specific pagination options - Consistent configuration across traditional and modular clients
- Extends
- Environment Factories:
CoinbasePrimeClient.fromEnv()- Load credentials from environment variablesCoinbasePrimeClientWithServices.fromEnv()- Enhanced client with env loading
- Shared Utilities:
createCredentialsFromEnv()with automatic.envfile support
- Consistent API: Both clients now use the same configuration interface
- Factory Methods: Convenient creation patterns for common scenarios
- Enhanced Documentation: Comprehensive guides for different import strategies
- Dependency Management: Centralized core-ts imports to prevent version conflicts
- Module Resolution: Improved import paths for better IDE support and faster resolution
No migration required! Existing code continues to work unchanged:
// This still works exactly the same in 0.6.3
import {
CoinbasePrimeClient,
OrdersService,
} from '@coinbase-sample/prime-sdk-ts';
const client = new CoinbasePrimeClient(credentials);
const orders = new OrdersService(client);If you want to optimize bundle size, you can choose from new entry points:
// Option 1: Manual client (similar API, comprehensive exports)
import {
CoinbasePrimeClient,
OrdersService,
} from '@coinbase-sample/prime-sdk-ts/manual';
// Option 2: Modular client (new, 75% smaller initial bundle)
import { CoinbasePrimeClientWithServices } from '@coinbase-sample/prime-sdk-ts/modular';
const client = CoinbasePrimeClientWithServices.fromEnv();
client.orders.createOrder(request); // Lazy-loaded service
// Option 3: Services only (85% smaller bundles)
import { CoinbasePrimeClient } from '@coinbase-sample/prime-sdk-ts/client-only';
import { OrdersService } from '@coinbase-sample/prime-sdk-ts/services';Users can now choose their import strategy based on bundle size requirements:
- Full SDK:
@coinbase-sample/prime-sdk-ts(~100kb) - Manual Client:
@coinbase-sample/prime-sdk-ts/manual(~90kb) - Modular Client:
@coinbase-sample/prime-sdk-ts/modular(~25kb) - Services Only:
@coinbase-sample/prime-sdk-ts/services(~15kb)
- Fix path error in listInvoices
- Add pagination functions to list resources where possible
- List responses are expanded to have a .next and .fetchAll
- maxItems and maxPages can be set at the client or request level to better control pagination
- Updated endpoints with new query parameters
- listPortfolioActivities
- listEntityActivities
- New endpoints
- listWalletAddresses
- createWalletDepositAddress
- Adding missing query parameters to listProducts
- Modify staking post parameters
- Exporting types changes
- Moved all child types to explictly named, and importable from root package
- New Service and endpoints
- CreateStake and CreateUnstake
- Adding support for Prime Financing endpoints
- listExistingLocations
- listInterestAccruals
- listPortfolioInterestAccruals
- listMarginCallSummaries
- listMarginConversions
- getEntityLocateAvailabilities
- getMarginInformation
- getPortfolioBuyingPower
- getPortfolioCreditInformation
- getPortfolioWithdrawalPower
- getTieredPricingFees
- createNewLocates
- Adding support for various other new endpoints
- BalanceService
- listEntityBalances
- PositionsService
- listAggregateEntityPositions
- listEntityPositions
- WalletService
- listWalletAddresses
- createWalletAddress
- BalanceService
- Moved Request and Response types to Named Exports
- Adding support for Order's create quote and accept quote
- Support for all Coinbase Prime API REST endpoints