Add bisqJS and liquidJS npm modules.

This commit is contained in:
Miguel Medeiros
2021-08-10 01:30:13 -03:00
parent acc0c80953
commit 4efc927303
116 changed files with 5504 additions and 4137 deletions

View File

@@ -0,0 +1,11 @@
import bisqJS from "./../../../src/index-bisq";
const init = async () => {
const { addresses } = bisqJS();
const address = 'B1DgwRN92rdQ9xpEVCdXRfgeqGw9X4YtrZz';
const myAddress = await addresses.getAddress({ address });
console.log(myAddress);
};
init();

View File

@@ -0,0 +1,24 @@
import bisqJS from "./../../../src/index-bisq";
const init = async () => {
try {
const { blocks } = bisqJS();
const hash = '000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d';
const block = await blocks.getBlock({ hash });
console.log(block);
const myBlocks = await blocks.getBlocks({ index: 0, length: 1 });
console.log(myBlocks);
const myBlocksHeight = await blocks.getBlocksTipHeight({
index: 0,
length: 1,
});
console.log(myBlocksHeight);
} catch (error) {
console.log(error);
}
};
init();

View File

@@ -0,0 +1,38 @@
import bisqJS from "./../../../src/index-bisq";
const init = async () => {
try {
const { markets } = bisqJS();
const market = "BTC_USD";
const basecurrency = "BTC";
const allMarkets = await markets.getMarkets();
console.log(allMarkets);
const currencies = await markets.getCurrencies();
console.log(currencies);
const depth = await markets.getDepth({ market });
console.log(depth)
const hloc = await markets.getHloc({ market });
console.log(hloc);
const offers = await markets.getOffers({ market });
console.log(offers);
const ticker = await markets.getTicker({ market });
console.log(ticker);
const trades = await markets.getTrades({ market });
console.log(trades);
const volumes = await markets.getVolumes({ basecurrency, market });
console.log(volumes);
} catch (error) {
console.log(error);
}
};
init();

View File

@@ -0,0 +1,13 @@
import bisqJS from "./../../../src/index-bisq";
const init = async () => {
try {
const { statistics } = bisqJS();
const stats = await statistics.getStats();
console.log(stats);
} catch (error) {
console.log(error);
}
};
init();

View File

@@ -0,0 +1,18 @@
import bisqJS from "./../../../src/index-bisq";
const init = async () => {
try {
const { transactions } = bisqJS();
const txid = '4b5417ec5ab6112bedf539c3b4f5a806ed539542d8b717e1c4470aa3180edce5';
const tx = await transactions.getTx({ txid });
console.log(tx);
const txs = await transactions.getTxs({ index: 0, length: 1 });
console.log(txs);
} catch (error) {
console.log(error);
}
};
init();