0.4.10 • Published 6 years ago
@radar/redshift.js v0.4.10
@radar/redshift.js
The official REDSHIFT Javascript SDK
About
This package acts as a wrapper for the REDSHIFT WS & HTTP client, types, and utility packages. For more detailed documentation, follow the links to child packages in the Usage section.
Installation
npm
npm install @radar/redshift.jsyarn
yarn add @radar/redshift.jsUsage
Examples
Mainnet
Request Quote for Bitcoin Swap
import { Market, WebSocketClient } from '@radar/redshift.js';
const client = new WebSocketClient();
await client.connect();
const quote = await client.requestQuote({
market: Market.BTC_LBTC, // bitcoin <-> lightning bitcoin
invoice: 'BOLT-compatible-invoice',
refundAddress: 'P2(W)PKH-address',
});Request Quote for Ether Swap
import { Market, WebSocketClient } from '@radar/redshift.js';
const client = new WebSocketClient();
await client.connect();
const quote = await client.requestQuote({
market: Market.ETH_LBTC, // ether <-> lightning bitcoin
invoice: 'BOLT-compatible-invoice',
});Testnet
Request Quote for Bitcoin Swap
import { Market, RedshiftApiUrl, WebSocketClient } from '@radar/redshift.js';
const client = new WebSocketClient(RedshiftApiUrl.TESTNET);
await client.connect();
const quote = await client.requestQuote({
market: Market.TBTC_LTBTC, // testnet bitcoin <-> lightning testnet bitcoin
invoice: 'BOLT-compatible-invoice',
refundAddress: 'P2(W)PKH-address',
});Request Quote for Ether Swap
import { Market, RedshiftApiUrl, WebSocketClient } from '@radar/redshift.js';
const client = new WebSocketClient(RedshiftApiUrl.TESTNET);
await client.connect();
const quote = await client.requestQuote({
market: Market.KETH_LTBTC, // kovan ether <-> lightning testnet bitcoin
invoice: 'BOLT-compatible-invoice',
});0.4.10
6 years ago
0.4.8
7 years ago
0.4.7
7 years ago
0.4.6
7 years ago
0.4.5
7 years ago
0.4.4
7 years ago
0.4.3
7 years ago
0.4.2
7 years ago
0.4.1
7 years ago
0.4.0
7 years ago
0.3.5
7 years ago
0.3.4
7 years ago
0.3.3
7 years ago
0.3.2
7 years ago
0.3.1
7 years ago
0.3.0
7 years ago
0.2.6
7 years ago
0.2.5
7 years ago
0.2.4
7 years ago
0.2.3
7 years ago
0.2.2
7 years ago
0.2.1
7 years ago
0.2.0
7 years ago
0.1.0
7 years ago

