Breeze SDK
A comprehensive TypeScript SDK for interacting with the Breeze API, providing a clean interface for user yield tracking, balance management, and transaction handling.Installation
Quick Start
API Reference
BreezeSDK Class
The main SDK class that provides a convenient interface to all API endpoints.Constructor
apiKey: string- Your API authentication key (required)baseUrl?: string- Base URL for the API (default: ‘https://api.breeze.baby/’)timeout?: number- Request timeout in milliseconds (default: 30000)
Methods
User Operations
getUserYield(options)
Get user yield data with pagination.
getUserBalances(options)
Get user balance information with asset filtering and sorting.
getBreezeBalances(options)
Get breeze-specific balance information with strategy details, including position values, yields, and APY data.
Strategy Operations
getStrategyInfo(strategyId)
Get detailed information about a specific strategy, including supported assets and APY data per asset.
Transaction Operations
createDepositTransaction(options)
Create a deposit transaction. Required parameters: strategyId, baseAsset (mint address), amount, userKey.
createWithdrawTransaction(options)
Create a withdraw transaction. Required parameters: strategyId, baseAsset (mint address), amount, userKey.
getDepositInstructions(options)
Get Solana transaction instructions for deposits. Required parameters: strategyId, baseAsset (mint address), amount, userKey.
getWithdrawInstruction(options)
Get Solana transaction instruction for withdrawals. Required parameters: strategyId, baseAsset (mint address), amount, userKey.
Utility Methods
updateApiKey(newApiKey: string)
Update the API key used for authentication.
getApiClient()
Get the underlying ApiClient instance for advanced usage.
Complete Example
Transaction Signing and Execution
For executing transactions on Solana, you’ll need to sign and send them:Low-Level API
For advanced use cases, you can use the individual functions and ApiClient directly:Required API Endpoint
The SDK requires access to the Breeze API at: Base URL:https://api.breeze.baby/
Make sure your API key has access to the following endpoints:
GET /user-yield/{user_id}- User yield data retrievalGET /user-balances/{user_id}- User balance informationGET /breeze-balances/{user_id}- Breeze-specific balance information with strategy detailsGET /strategy-info/{strategy_id}- Strategy information and APY dataPOST /deposit/tx- Deposit transaction creationPOST /withdraw/tx- Withdraw transaction creationPOST /deposit/ix- Deposit instruction generationPOST /withdraw/ix- Withdraw instruction generation
Error Types
- BreezeApiError: Thrown for API-related errors
message: string- Error messagestatus?: number- HTTP status codecode?: string- Error code (‘TIMEOUT’, ‘NETWORK_ERROR’, etc.)response?: any- Full error response from the API
TypeScript Support
The SDK is written in TypeScript and provides full type definitions:Testing
Integration Tests
Run integration tests against real API server:Example Scripts
Test the SDK with example scripts: Check the examples out, in the packages/sdk/examplesAPI Endpoints
The SDK interacts with these API endpoints:GET Endpoints
GET /user-yield/{user_id}- Get user yield data (supports pagination)GET /user-balances/{user_id}- Get user balance information (supports asset filtering and sorting)GET /breeze-balances/{user_id}- Get breeze balances with strategy details (requires strategyId, supports asset filtering, sorting, and pagination)GET /strategy-info/{strategy_id}- Get strategy information including assets and APY data
POST Endpoints
POST /deposit/tx- Create deposit transaction (requires strategyId, baseAsset, amount, userKey)POST /withdraw/tx- Create withdraw transaction (requires strategyId, baseAsset, amount, userKey)POST /deposit/ix- Get deposit instructions (requires strategyId, baseAsset, amount, userKey)POST /withdraw/ix- Get withdraw instruction (requires strategyId, baseAsset, amount, userKey)
Development
Building
Example Usage
The SDK includes comprehensive examples in theexamples/ directory:
basic-usage.ts- Simple SDK initialization and basic method callsintegration-flow.ts- Complete transaction flow with Solana executionintegration-flow-simple.ts- API demonstration without transaction execution

