Add bisqJS and liquidJS npm modules.
This commit is contained in:
23
examples/html/bisq-js/addresses.html
Normal file
23
examples/html/bisq-js/addresses.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Page Title</title>
|
||||
<script src="./../../../dist/bisq.js"></script>
|
||||
<script>
|
||||
const init = async () => {
|
||||
try {
|
||||
const { addresses } = bisqJS();
|
||||
|
||||
const address = 'B1DgwRN92rdQ9xpEVCdXRfgeqGw9X4YtrZz';
|
||||
|
||||
const myAddress = await addresses.getAddress({ address });
|
||||
console.log(myAddress);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
init();
|
||||
</script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
33
examples/html/bisq-js/blocks.html
Normal file
33
examples/html/bisq-js/blocks.html
Normal file
@@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Page Title</title>
|
||||
<script src="./../../../dist/bisq.js"></script>
|
||||
<script>
|
||||
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();
|
||||
</script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
46
examples/html/bisq-js/markets.html
Normal file
46
examples/html/bisq-js/markets.html
Normal file
@@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Page Title</title>
|
||||
<script src="./../../../dist/bisq.js"></script>
|
||||
<script>
|
||||
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();
|
||||
</script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
21
examples/html/bisq-js/statistics.html
Normal file
21
examples/html/bisq-js/statistics.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Page Title</title>
|
||||
<script src="./../../../dist/bisq.js"></script>
|
||||
<script>
|
||||
const init = async () => {
|
||||
try {
|
||||
const { statistics } = bisqJS();
|
||||
|
||||
const stats = await statistics.getStats();
|
||||
console.log(stats);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
init();
|
||||
</script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
28
examples/html/bisq-js/transactions.html
Normal file
28
examples/html/bisq-js/transactions.html
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Page Title</title>
|
||||
<script src="./../../../dist/bisq.js"></script>
|
||||
<script>
|
||||
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();
|
||||
</script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user