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 and fund filtering.
getUserBalances(options)
Get user balance information with asset filtering and sorting.
Transaction Operations
createDepositTransaction(options)
Create a deposit transaction. Required parameters: fundId, amount, userKey.
createWithdrawTransaction(options)
Create a withdraw transaction. Required parameters: fundId, amount, userKey.
getDepositInstructions(options)
Get Solana transaction instructions for deposits. Required parameters: fundId, amount, userKey.
getWithdrawInstruction(options)
Get Solana transaction instruction for withdrawals. Required parameters: fundId, 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 informationPOST /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 and fund filtering)GET /user-balances/{user_id}- Get user balance information (supports asset filtering and sorting)
POST Endpoints
POST /deposit/tx- Create deposit transaction (requires fundId, amount, userKey)POST /withdraw/tx- Create withdraw transaction (requires fundId, amount, userKey)POST /deposit/ix- Get deposit instructions (requires fundId, amount, userKey)POST /withdraw/ix- Get withdraw instruction (requires fundId, 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

