Skip to content

SDKs & Libraries

Official SDKs

LanguagePackageInstall
TypeScript/Node.js@cryptachain/sdknpm install @cryptachain/sdk
Pythoncryptachainpip install cryptachain
Javacom.cryptachain:cryptachain-sdkMaven Central

TypeScript SDK

bash
npm install @cryptachain/sdk
typescript
import CryptaChain from '@cryptachain/sdk';

const client = new CryptaChain({ apiKey: process.env.CRYPTACHAIN_API_KEY! });

// Wallet balances
const balances = await client.wallets.getBalances('0xd8dA...', { chain: 'ethereum', includePrices: true });
console.log(`Portfolio: $${balances.totalValueUsd}`);

// Stream all transfers (auto-pagination)
for await (const tx of client.wallets.getAllTransfers('0xd8dA...', { chain: 'ethereum' })) {
  console.log(`${tx.blockTimestamp} ${tx.direction} ${tx.value} ${tx.assetSymbol}`);
}

// Price lookup (v2.3 response shape)
const price = await client.prices.bySymbol('BTC', '2026-04-04', 'EUR');
console.log(`BTC: €${price.price} (${price.source}, quality: ${price.qualityScore})`);

// FX rate
const rate = await client.fx.getRate('EUR', 'USD', '2026-04-04');
console.log(`1 EUR = $${rate.rate} (${rate.source})`);

// IAS 21 monthly average
const avg = await client.fx.getMonthlyAverage('EUR', 2026, 4);
console.log(`April 2026 EUR/USD avg: ${avg.averageRate}`);

Python SDK

bash
pip install cryptachain
python
from cryptachain import CryptaChain

client = CryptaChain(api_key="your-api-key")

# Wallet balances
balances = client.wallets.get_balances("0xd8dA...", chain="ethereum")
print(f"Portfolio: ${balances.total_value_usd}")

# Stream all transfers (auto-pagination)
for transfer in client.wallets.iter_all_transfers("0xd8dA...", chain="ethereum"):
    print(f"{transfer.block_timestamp} {transfer.direction} {transfer.value} {transfer.asset_symbol}")

# Price lookup (v2.3 response shape)
price = client.prices.by_symbol("BTC", date="2026-04-04", currency="EUR")
print(f"BTC: €{price.price} (source: {price.source}, quality: {price.quality_score})")

# FX rate
rate = client.fx.get_rate("EUR", "USD", "2026-04-04")
print(f"1 EUR = ${rate.rate} ({rate.source})")

# Export to pandas DataFrame
df = client.wallets.to_dataframe("0xd8dA...", chain="ethereum")

Java SDK

xml
<dependency>
    <groupId>com.cryptachain</groupId>
    <artifactId>cryptachain-sdk</artifactId>
    <version>0.1.0</version>
</dependency>
java
var client = CryptaChain.builder()
    .apiKey("your-api-key")
    .build();

// Wallet balances
var balances = client.wallets().getBalances("0xd8dA...", "ethereum");
System.out.println("Portfolio: $" + balances.totalValueUsd());

// Stream all transfers (auto-pagination)
client.wallets().streamAllTransfers("0xd8dA...", "ethereum")
    .forEach(tx -> System.out.printf("%s %s %s %s%n",
        tx.blockTimestamp(), tx.direction(), tx.value(), tx.assetSymbol()));

// Price lookup (v2.3 response shape)
var price = client.prices().bySymbol("BTC", LocalDate.of(2026, 4, 4), "EUR");
System.out.println("BTC: €" + price.price() + " (" + price.source() + ")");

// FX rate
var rate = client.fx().getRate("EUR", "USD", LocalDate.of(2026, 4, 4));
System.out.println("1 EUR = $" + rate.rate() + " (" + rate.source() + ")");

REST API (no SDK)

Every endpoint in this documentation can be called directly with any HTTP client. The SDKs are convenience wrappers — they add type safety, automatic retries, and rate limit handling, but the raw API is fully documented here.

bash
# Any HTTP client works
curl https://api.cryptachain.com/v1/fx/rate?from=EUR&to=USD&date=2026-04-04 \
  -H "X-API-Key: $CRYPTACHAIN_API_KEY"

CryptaChain API — built by CryptaCount Luxembourg S.a r.l.