blockradar
v1.0.3
Published
A comprehensive, type-safe JavaScript/TypeScript SDK for the [Blockradar API](https://docs.blockradar.co). Enable seamless stablecoin deposits and payments in your fintech application.
Readme
Blockradar JavaScript SDK
A comprehensive, type-safe JavaScript/TypeScript SDK for the Blockradar API. Enable seamless stablecoin deposits and payments in your fintech application.
Table of Contents
Installation
npm install node-fetch
# Note: This SDK is currently in development. You can copy the src/ directory
# or build it locally with 'npm run build'.Setup
Initialize the Blockradar client with your API key from the Blockradar Dashboard.
import { Blockradar } from 'blockradar';
const sdk = new Blockradar('your-api-key');Usage
Wallets
Manage master wallets and check balances.
const wallet = await sdk.wallets.get('wallet-id');
const balances = await sdk.wallets.getBalances('wallet-id');Addresses
Generate dedicated deposit addresses for your customers.
const address = await sdk.addresses.create({
walletId: 'wallet-id',
label: 'Customer 123'
});
console.log(address.data.address);Transactions
Monitor incoming and outgoing transactions.
const transactions = await sdk.transactions.list('wallet-id', { limit: 10 });Withdrawals
Initiate transfers of stablecoins.
const withdrawal = await sdk.withdrawals.initiate({
walletId: 'wallet-id',
assetId: 'USDT',
amount: '100',
address: '0x...'
});Virtual Accounts
Create fiat-to-stablecoin virtual NGN accounts.
const va = await sdk.virtualAccounts.createForWallet('wallet-id', {
type: 'AUTO_FUNDING'
});Swaps
Exchange stablecoins across blockchains.
const quote = await sdk.swaps.getQuote({
fromAsset: 'USDT',
toAsset: 'USDC',
amount: '50',
walletId: 'wallet-id'
});Auto-Settlements
Automate fund movement between wallets.
const config = await sdk.autoSettlements.getWalletConfig('wallet-id');Gateway
Access unified, chain-abstracted balances.
const balance = await sdk.gateway.getBalance();Development
Build
npm run buildTest
npm testContributing
For details on how to contribute to this project, please see CONTRIBUTING.md.
Documentation
For detailed API references, visit the official Blockradar documentation.
