SDKs & Libraries
Official and community-maintained SDKs for the Bond API.
The following SDKs are provided by partners and users, and are not officially produced by Bond. They are provided to help users become familiar with the API endpoints. Please use them with caution and expand development according to your own requirements. Bond does not make any commitment to the safety and performance of these SDKs.
Python
Bond Futures Connector
Install
pip install bond-sdk-derivatives-trading-usds-futures
from bond.futures import Client client = Client( api_key='your_api_key', api_secret='your_secret_key' ) # Get account information account = client.get_account() print(f"Balance: {account['totalWalletBalance']}") # Place an order order = client.new_order( symbol='BTCUSDT', side='BUY', type='LIMIT', timeInForce='GTC', quantity=0.001, price=40000 ) print(f"Order ID: {order['orderId']}")
Java
Bond Futures Connector
import com.bond.connector.futures.client.FuturesClient; FuturesClient client = new FuturesClientImpl( "your_api_key", "your_secret_key" ); // Get account information String account = client.getAccount(); // Place an order String order = client.newOrder( "BTCUSDT", "BUY", "LIMIT", "GTC", 0.001, 40000.0 );
Node.js (Community)
No official Node.js SDK. Use standard HTTP libraries with the REST API.
const axios = require('axios'); const crypto = require('crypto'); const API_KEY = 'your_api_key'; const SECRET_KEY = 'your_secret_key'; const BASE_URL = 'https://fapi.bond.xyz'; function createSignature(queryString) { return crypto .createHmac('sha256', SECRET_KEY) .update(queryString) .digest('hex'); } async function getAccount() { const timestamp = Date.now(); const queryString = `timestamp=${timestamp}`; const signature = createSignature(queryString); const response = await axios.get(`${BASE_URL}/fapi/v1/account`, { params: { timestamp, signature }, headers: { 'X-MBX-APIKEY': API_KEY } }); return response.data; }
Go (Community)
package main import ( "crypto/hmac" "crypto/sha256" "encoding/hex" "fmt" "net/http" "time" ) const ( APIKey = "your_api_key" SecretKey = "your_secret_key" BaseURL = "https://fapi.bond.xyz" ) func createSignature(queryString string) string { mac := hmac.New(sha256.New, []byte(SecretKey)) mac.Write([]byte(queryString)) return hex.EncodeToString(mac.Sum(nil)) } func getAccount() { timestamp := time.Now().UnixMilli() qs := fmt.Sprintf("timestamp=%d", timestamp) sig := createSignature(qs) url := fmt.Sprintf("%s/fapi/v1/account?%s&signature=%s", BaseURL, qs, sig) req, _ := http.NewRequest("GET", url, nil) req.Header.Add("X-MBX-APIKEY", APIKey) client := &http.Client{} resp, _ := client.Do(req) defer resp.Body.Close() }
Development Best Practices
Credentials
Always use environment variables; never hardcode
Error handling
Catch HTTPError, handle 429 (rate limit) and 5XX (server) separately
Connection pooling
Reuse HTTP sessions with retry adapters
Rate limit tracking
Monitor X-MBX-USED-WEIGHT and X-MBX-ORDER-COUNT headers