JSPM

  • Created
  • Published
  • Downloads 899
  • Score
    100M100P100Q113737F
  • License MIT

Bluvo SDK for TypeScript

Package Exports

  • @bluvo/sdk-ts
  • @bluvo/sdk-ts/dist/index.esm.js
  • @bluvo/sdk-ts/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@bluvo/sdk-ts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Bluvo TypeScript SDK

npm version License: MIT

Official TypeScript SDK for the Bluvo API - a unified cryptocurrency exchange (CEX) API aggregator infrastructure.

Features

  • Unified API: Interact with multiple exchanges through a single, consistent interface
  • Simple Authentication: Connect to Binance, Coinbase, Kraken, KuCoin, OKX and more with just a few lines of code
  • Market Data: Access real-time and historical price information across exchanges
  • Wallet Management: Easily connect, list, and manage exchange wallets
  • Type Safety: Full TypeScript support with proper types for all API responses

Installation

# Using npm
npm install @bluvo/sdk-ts

# Using yarn
yarn add @bluvo/sdk-ts

# Using pnpm
pnpm add @bluvo/sdk-ts

Quick Start

Initialize the SDK Server Side

import { createClient } from '@bluvo/sdk-ts';

// Get yours at https://docs.bluvo.co/introduction
const client = createClient({
    apiKey: 'your-api-key',
    orgId: 'your-org-id',
    projectId: 'your-project-id',
});

Wallets

Withdraw from Wallet (Server-side)

// Withdraw cryptocurrency from a connected wallet
const withdrawal = await client.wallet.transaction.withdraw({
  walletId: 'connected-wallet-id',
  destinationAddress: '3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5',
  amount: '0.05',
  asset: 'BTC',
  network: 'BTC',           // Optional network specification
  tag: '123456'             // Optional memo/tag for certain cryptos
});

console.log('Withdrawal status:', withdrawal.status);

Get Wallet Details

// Get details of a specific wallet
const wallet = await client.wallet.get('wallet-id');

Workflow Management

Track the status of asynchronous operations:

// Check status of a workflow run (e.g., after connecting a wallet)
const workflow = await client.workflow.getWorkflow('workflow-run-id');
console.log('Workflow status:', workflow.status);
console.log('Workflow steps:', workflow.steps);

Supported Exchanges

  • Binance
  • Coinbase
  • Kraken
  • KuCoin
  • Gemini
  • Bitfinex
  • OKX
  • More coming soon!

More Examples

For more examples and inspiration, check out the Bluvo Awesome List.

Documentation

For comprehensive documentation, visit the Bluvo API Documentation.

Client-side OTT (One-Time Token) Usage

For client-side applications where you don't want to expose your API keys, use OTT tokens:

Step 1: Generate OTT Token (Server-side)

// On your server, generate an OTT token
const ottResponse = await client.ott.get('wallet-id');
const { ott, idem } = ottResponse;

Step 2: Connect Wallet with OTT (Client-side)

// On the client-side, use the OTT token to connect a wallet
import { createClient } from '@bluvo/sdk-ts';

const client = createClient({
  orgId: 'your-org-id',
  projectId: 'your-project-id',
  // No API key needed for OTT operations
});

// Connect wallet using OTT
const connection = await client.ott.connect(
  {
    exchange: 'binance',
    walletId: 'unique-wallet-id',
    idem: idem,               // From server
    ott: ott                  // From server
  },
  {
    apiKey: 'user-exchange-api-key',
    apiSecret: 'user-exchange-api-secret'
  }
);

console.log('Wallet connected:', connection.status);

Step 3: Withdraw with OTT (Client-side)

// Withdraw funds using OTT authentication
const withdrawal = await client.ott.withdraw({
  walletId: 'connected-wallet-id',
  asset: 'BTC',
  amount: 0.05,
  address: '3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5',
  tag: 'optional-memo',
  network: 'BTC'
});

console.log('Withdrawal initiated:', withdrawal.transactionId);

Benefits of OTT Pattern

  • Security: API keys never leave your server
  • Flexibility: Users can perform operations without exposing credentials
  • Controlled Access: Each OTT token is single-use and time-limited
  • Client-side Friendly: Perfect for web applications and mobile apps

License

MIT Bluvo Inc.