Offizielle SDK-Bibliotheken
Offizielle Client-Bibliotheken für Python, JavaScript, Go und Rust. Vereinfachen Sie die API-Integration mit typisierten Clients, automatischer Wiederholungslogik und WebSocket-Unterstützung.
Python SDK
Paket: smartmoney-api
Installation: pip install smartmoney-api
Repository: github.com/smartmoneyapi/python-client
from smartmoney import SmartMoneyAPI
# Client initialisieren
client = SmartMoneyAPI(api_key="sk_live_abc123xyz789")
# Wal-Positionen abrufen
whales = client.whale_positions(symbol="BTCUSDT", limit=50)
for position in whales:
print(f"{position.wallet_address}: {position.position_size} BTC @ {position.entry_price}")
# Funding Rates abrufen
funding = client.funding_rates(symbol="BTCUSDT", interval="4h", limit=24)
# Live-Updates streamen
with client.stream_whale_positions(["BTCUSDT", "ETHUSDT"]) as stream:
for update in stream:
print(f"Positionsupdate: {update}")
Funktionen
- Async/await-Unterstützung (asyncio, aiohttp)
- Automatische Wiederholung mit exponentiellem Backoff
- WebSocket-Streaming mit automatischer Wiederverbindung
- Type Hints und IDE-Autovervollständigung
- Anfrageprotokollierung und Debugging
JavaScript SDK
Paket: smartmoney-api
Installation: npm install smartmoney-api
Repository: github.com/smartmoneyapi/js-client
import { SmartMoneyAPI } from "smartmoney-api";
const client = new SmartMoneyAPI({
apiKey: "sk_live_abc123xyz789"
});
// Wal-Positionen abrufen
const whales = await client.whalePositions({
symbol: "BTCUSDT",
limit: 50
});
whales.positions.forEach(pos => {
console.log(`${pos.wallet_address}: ${pos.position_size} BTC`);
});
// Echtzeit-Updates streamen
const stream = client.streamWhalePositions(["BTCUSDT", "ETHUSDT"]);
stream.on("data", (update) => {
console.log("Positionsupdate:", update);
});
stream.on("error", (err) => {
console.error("Stream-Fehler:", err);
});
Go SDK
Modul: github.com/smartmoneyapi/go-client
Installation: go get github.com/smartmoneyapi/go-client
package main
import (
"fmt"
"github.com/smartmoneyapi/go-client"
)
func main() {
// Client erstellen
client := smartmoney.NewClient("sk_live_abc123xyz789")
// Wal-Positionen abrufen
positions, err := client.WhalePositions(ctx, &smartmoney.WhalePositionsFilter{
Symbol: "BTCUSDT",
Limit: 50,
})
if err != nil {
panic(err)
}
for _, pos := range positions {
fmt.Printf("%s: %.2f BTC\n", pos.WalletAddress, pos.PositionSize)
}
}
Rust SDK
Crate: smartmoney-api
Installation: cargo add smartmoney-api
use smartmoney_api::Client;
#[tokio::main]
async fn main() -> Result<(), Box> {
let client = Client::new("sk_live_abc123xyz789");
// Wal-Positionen abrufen
let positions = client
.whale_positions()
.symbol("BTCUSDT")
.limit(50)
.send()
.await?;
for position in positions.iter() {
println!(
"{}: {} BTC @ {}",
position.wallet_address,
position.position_size,
position.entry_price
);
}
Ok(())
}
Häufige Muster
Fehlerbehandlung
Alle SDKs bieten umfangreiche Fehlertypen mit automatischer Wiederholungslogik. Fehler enthalten Statuscode, Fehlercode und menschenlesbare Nachricht.
Anfrage-Timeouts
Konfigurierbare Anfrage-Timeouts (Standard 30s). Legen Sie benutzerdefinierte Timeouts für langlaufende Operationen fest.
Rate-Limit-Behandlung
Automatisches exponentielles Backoff bei Rate-Limits. Respektiert Retry-After-Header.
Wählen Sie Ihr SDK
Steigen Sie mit Ihrer bevorzugten Programmiersprache ein. Vollständige Dokumentation und Beispiele enthalten.
API-Referenz anzeigen