0.4.10 • Published 4 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.js
yarn
yarn add @radar/redshift.js
Usage
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
4 years ago
0.4.8
4 years ago
0.4.7
4 years ago
0.4.6
4 years ago
0.4.5
4 years ago
0.4.4
4 years ago
0.4.3
4 years ago
0.4.2
5 years ago
0.4.1
5 years ago
0.4.0
5 years ago
0.3.5
5 years ago
0.3.4
5 years ago
0.3.3
5 years ago
0.3.2
5 years ago
0.3.1
5 years ago
0.3.0
5 years ago
0.2.6
5 years ago
0.2.5
5 years ago
0.2.4
5 years ago
0.2.3
5 years ago
0.2.2
5 years ago
0.2.1
5 years ago
0.2.0
5 years ago
0.1.0
5 years ago