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,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>

View 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>

View 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>

View 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>

View 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>

View File

@ -1,21 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://mempool.space/mempool.js"></script>
<script>
const init = async () => {
const {
bisq: { addresses },
} = mempoolJS();
const address = 'B1DgwRN92rdQ9xpEVCdXRfgeqGw9X4YtrZz';
const myAddress = await addresses.getAddress({ address });
console.log(myAddress);
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -1,31 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://mempool.space/mempool.js"></script>
<script>
const init = async () => {
const {
bisq: { blocks },
} = mempoolJS();
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);
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -1,19 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://mempool.space/mempool.js"></script>
<script>
const init = async () => {
const {
bisq: { statistics },
} = mempoolJS();
const stats = await statistics.getStats();
console.log(stats);
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -1,24 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://mempool.space/mempool.js"></script>
<script>
const init = async () => {
const {
bisq: { transactions },
} = mempoolJS();
const txid = 'B1DgwRN92rdQ9xpEVCdXRfgeqGw9X4YtrZz';
const tx = await transactions.getTx({ txid });
console.log(tx);
const txs = await transactions.getTxs({ index: 0, length: 1 });
console.log(txs);
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -1,35 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://mempool.space/mempool.js"></script>
<script>
const init = async () => {
const {
bitcoin: { addresses },
} = mempoolJS();
const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC';
const myAddress = await addresses.getAddress({ address });
console.log(myAddress);
const addressTxs = await addresses.getAddressTxs({ address });
console.log(addressTxs);
const addressTxsChain = await addresses.getAddressTxsChain({ address });
console.log(addressTxsChain);
const addressTxsMempool = await addresses.getAddressTxsMempool({
address,
});
console.log(addressTxsMempool);
const addressTxsUtxo = await addresses.getAddressTxsUtxo({ address });
console.log(addressTxsUtxo);
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -1,52 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://mempool.space/mempool.js"></script>
<script>
const init = async () => {
const {
bitcoin: { blocks },
} = mempoolJS();
const hash =
'000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce';
const block = await blocks.getBlock({ hash });
console.log(block);
const blockStatus = await blocks.getBlockStatus({ hash });
console.log(blockStatus);
const blockTxs = await blocks.getBlockTxs({ hash });
console.log(blockTxs);
const blockTxids = await blocks.getBlockTxids({ hash });
console.log(blockTxids);
const blockTxid = await blocks.getBlockTxid({ hash, index: 218 });
console.log(blockTxid);
const blockRaw = await blocks.getBlockRaw({ hash });
console.log(blockRaw);
const blockHeader = await blocks.getBlockHeader({ hash });
console.log(blockHeader);
const blockHeight = await blocks.getBlockHeight({ height: 0 });
console.log(blockHeight);
const getBlocks = await blocks.getBlocks({ start_height: 9999 });
console.log(getBlocks);
const blocksTipHeight = await blocks.getBlocksTipHeight();
console.log(blocksTipHeight);
const blocksTipHash = await blocks.getBlocksTipHash();
console.log(blocksTipHash);
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -1,20 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://mempool.space/mempool.js"></script>
<script>
const init = async () => {
const {
bitcoin: { difficulty },
} = mempoolJS();
const difficultyAdjustment = await difficulty.getDifficultyAdjustment();
console.log(difficultyAdjustment);
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -1,22 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://mempool.space/mempool.js"></script>
<script>
const init = async () => {
const {
bitcoin: { fees },
} = mempoolJS();
const feesRecommended = await fees.getFeesRecommended();
console.log(feesRecommended);
const feesMempoolBlocks = await fees.getFeesMempoolBlocks();
console.log(feesMempoolBlocks);
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -1,25 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://mempool.space/mempool.js"></script>
<script>
const init = async () => {
const {
bitcoin: { mempool },
} = mempoolJS();
const getMempool = await mempool.getMempool();
console.log(getMempool);
const getMempoolRecent = await mempool.getMempoolRecent();
console.log(getMempoolRecent);
const getMempoolTxids = await mempool.getMempoolTxids();
console.log(getMempoolTxids);
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -1,51 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://mempool.space/mempool.js"></script>
<script>
const init = async () => {
const {
bitcoin: { transactions },
} = mempoolJS();
const txid =
'15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521';
const tx = await transactions.getTx({ txid });
console.log(tx);
const txStatus = await transactions.getTxStatus({ txid });
console.log(txStatus);
const txHex = await transactions.getTxHex({ txid });
console.log(txHex);
const txRaw = await transactions.getTxRaw({ txid });
console.log(txRaw);
const txMerkleBlockProof = await transactions.getTxMerkleBlockProof({
txid,
});
console.log(txMerkleBlockProof);
const txMerkleProof = await transactions.getTxMerkleProof({ txid });
console.log(txMerkleProof);
const txOutspend = await transactions.getTxOutspend({
txid,
vout: 3,
});
console.log(txOutspend);
const txOutspends = await transactions.getTxOutspends({ txid });
console.log(txOutspends);
// const postTx = await transactions.postTx({ txid });
// console.log(postTx);
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -1,36 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://mempool.space/mempool.js"></script>
<script>
const init = async () => {
const {
bitcoin: { websocket },
} = mempoolJS();
const ws = websocket.initClient({
options: ['blocks', 'stats', 'mempool-blocks', 'live-2h-chart'],
});
ws.addEventListener('message', function incoming({data}) {
const res = JSON.parse(data.toString());
if (res.blocks) {
console.log(res.blocks);
}
if (res.mempoolInfo) {
console.log(res.mempoolInfo);
}
if (res.transactions) {
console.log(res.transactions);
}
if (res.mempoolBlocks) {
console.log(res.mempoolBlocks);
}
});
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../dist/liquid.js"></script>
<script>
const init = async () => {
try {
const { addresses } = liquidJS();
const address = 'Go65t19hP2FuhBMYtgbdMDgdmEzNwh1i48';
const myAddress = await addresses.getAddress({ address });
console.log(myAddress);
const addressTxs = await addresses.getAddressTxs({ address });
console.log(addressTxs);
const addressTxsChain = await addresses.getAddressTxsChain({ address });
console.log(addressTxsChain);
const addressTxsMempool = await addresses.getAddressTxsMempool({
address,
});
console.log(addressTxsMempool);
const addressTxsUtxo = await addresses.getAddressTxsUtxo({ address });
console.log(addressTxsUtxo);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../dist/liquid.js"></script>
<script>
const init = async () => {
try {
const { assets } = liquidJS();
const asset_id = 'a0c358a0f6947864af3a06f3f6a2aeb304df7fd95c922f2f22d7412399ce7691';
const asset = await assets.getAsset({ asset_id });
console.log(asset);
const assetTxs = await assets.getAssetTxs({
asset_id,
is_mempool: false,
});
console.log(assetTxs);
const assetSupply = await assets.getAssetSupply({
asset_id,
decimal: false,
});
console.log(assetSupply);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../dist/liquid.js"></script>
<script>
const init = async () => {
try {
const { blocks } = liquidJS();
const hash =
'54f02bdec5509ea769c8be82aed51f689969b653d92a2812d5a36266cbfbc55e';
const block = await blocks.getBlock({ hash });
console.log(block);
const blockStatus = await blocks.getBlockStatus({ hash });
console.log(blockStatus);
const blockTxs = await blocks.getBlockTxs({ hash });
console.log(blockTxs);
const blockTxids = await blocks.getBlockTxids({ hash });
console.log(blockTxids);
const blockTxid = await blocks.getBlockTxid({ hash, index: 0 });
console.log(blockTxid);
const blockRaw = await blocks.getBlockRaw({ hash });
console.log(blockRaw);
const blockHeight = await blocks.getBlockHeight({ height: 0 });
console.log(blockHeight);
const getBlocks = await blocks.getBlocks({ start_height: 9999 });
console.log(getBlocks);
const blocksTipHeight = await blocks.getBlocksTipHeight();
console.log(blocksTipHeight);
const blocksTipHash = await blocks.getBlocksTipHash();
console.log(blocksTipHash);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../dist/liquid.js"></script>
<script>
const init = async () => {
try {
const { fees } = liquidJS();
const feesRecommended = await fees.getFeesRecommended();
console.log(feesRecommended);
const feesMempoolBlocks = await fees.getFeesMempoolBlocks();
console.log(feesMempoolBlocks);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../dist/liquid.js"></script>
<script>
const init = async () => {
try {
const { mempool } = liquidJS();
const getMempool = await mempool.getMempool();
console.log(getMempool);
const getMempoolRecent = await mempool.getMempoolRecent();
console.log(getMempoolRecent);
const getMempoolTxids = await mempool.getMempoolTxids();
console.log(getMempoolTxids);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,48 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../dist/liquid.js"></script>
<script>
const init = async () => {
try {
const { transactions } = liquidJS();
const txid =
'f4e0cae35f8eb239c1eee9177884582aa6e4ce41e919f276617e9c7557168b53';
const tx = await transactions.getTx({ txid });
console.log(tx);
const txStatus = await transactions.getTxStatus({ txid });
console.log(txStatus);
const txHex = await transactions.getTxHex({ txid });
console.log(txHex);
const txRaw = await transactions.getTxRaw({ txid });
console.log(txRaw);
const txMerkleProof = await transactions.getTxMerkleProof({ txid });
console.log(txMerkleProof);
const txOutspend = await transactions.getTxOutspend({ txid, vout: 3 });
console.log(txOutspend);
const txOutspends = await transactions.getTxOutspends({ txid });
console.log(txOutspends);
const txMerkleBlockProof = await transactions.getTxMerkleBlockProof({ txid });
console.log(txMerkleBlockProof);
// const postTx = await transactions.postTx({ txhex });
// console.log(postTx);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../dist/liquid.js"></script>
<script>
const init = async () => {
try {
const { websocket } = liquidJS();
const ws = websocket.initClient({
options: ['blocks', 'stats', 'mempool-blocks', 'live-2h-chart'],
});
ws.addEventListener('message', function incoming({data}) {
const res = JSON.parse(data.toString());
if (res.blocks) {
console.log(res.blocks);
}
if (res.mempoolInfo) {
console.log(res.mempoolInfo);
}
if (res.transactions) {
console.log(res.transactions);
}
if (res.mempoolBlocks) {
console.log(res.mempoolBlocks);
}
});
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -1,35 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://mempool.space/mempool.js"></script>
<script>
const init = async () => {
const {
liquid: { addresses },
} = mempoolJS();
const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC';
const myAddress = await addresses.getAddress({ address });
console.log(myAddress);
const addressTxs = await addresses.getAddressTxs({ address });
console.log(addressTxs);
const addressTxsChain = await addresses.getAddressTxsChain({ address });
console.log(addressTxsChain);
const addressTxsMempool = await addresses.getAddressTxsMempool({
address,
});
console.log(addressTxsMempool);
const addressTxsUtxo = await addresses.getAddressTxsUtxo({ address });
console.log(addressTxsUtxo);
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -1,33 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://mempool.space/mempool.js"></script>
<script>
const init = async () => {
const {
liquid: { assets },
} = mempoolJS();
const asset_id = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC';
const asset = await assets.getAsset({ asset_id });
console.log(asset);
const assetTxs = await assets.getAssetTxs({
asset_id,
is_mempool: false,
});
console.log(assetTxs);
const assetSupply = await assets.getAssetSupply({
asset_id,
decimal: false,
});
console.log(assetSupply);
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -1,49 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://mempool.space/mempool.js"></script>
<script>
const init = async () => {
const {
liquid: { blocks },
} = mempoolJS();
const hash =
'000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce';
const block = await blocks.getBlock({ hash });
console.log(block);
const blockStatus = await blocks.getBlockStatus({ hash });
console.log(blockStatus);
const blockTxs = await blocks.getBlockTxs({ hash });
console.log(blockTxs);
const blockTxids = await blocks.getBlockTxids({ hash });
console.log(blockTxids);
const blockTxid = await blocks.getBlockTxid({ hash, index: 218 });
console.log(blockTxid);
const blockRaw = await blocks.getBlockRaw({ hash });
console.log(blockRaw);
const blockHeight = await blocks.getBlockHeight({ height: 0 });
console.log(blockHeight);
const getBlocks = await blocks.getBlocks({ start_height: 9999 });
console.log(getBlocks);
const blocksTipHeight = await blocks.getBlocksTipHeight();
console.log(blocksTipHeight);
const blocksTipHash = await blocks.getBlocksTipHash();
console.log(blocksTipHash);
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -1,22 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://mempool.space/mempool.js"></script>
<script>
const init = async () => {
const {
liquid: { fees },
} = mempoolJS();
const feesRecommended = await fees.getFeesRecommended();
console.log(feesRecommended);
const feesMempoolBlocks = await fees.getFeesMempoolBlocks();
console.log(feesMempoolBlocks);
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -1,25 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://mempool.space/mempool.js"></script>
<script>
const init = async () => {
const {
liquid: { mempool },
} = mempoolJS();
const getMempool = await mempool.getMempool();
console.log(getMempool);
const getMempoolRecent = await mempool.getMempoolRecent();
console.log(getMempoolRecent);
const getMempoolTxids = await mempool.getMempoolTxids();
console.log(getMempoolTxids);
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -1,51 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://mempool.space/mempool.js"></script>
<script>
const init = async () => {
const {
liquid: { transactions },
} = mempoolJS();
const txid =
'15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521';
const tx = await transactions.getTx({ txid });
console.log(tx);
const txStatus = await transactions.getTxStatus({ txid });
console.log(txStatus);
const txHex = await transactions.getTxHex({ txid });
console.log(txHex);
const txRaw = await transactions.getTxRaw({ txid });
console.log(txRaw);
const txMerkleBlockProof = await transactions.getTxMerkleBlockProof({
txid,
});
console.log(txMerkleBlockProof);
const txMerkleProof = await transactions.getTxMerkleProof({ txid });
console.log(txMerkleProof);
const txOutspend = await transactions.getTxOutspend({
txid,
vout: 3,
});
console.log(txOutspend);
const txOutspends = await transactions.getTxOutspends({ txid });
console.log(txOutspends);
// const postTx = await transactions.postTx({ txid });
// console.log(postTx);
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -1,36 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://mempool.space/mempool.js"></script>
<script>
const init = async () => {
const {
liquid: { websocket },
} = mempoolJS();
const ws = websocket.initClient({
options: ['blocks', 'stats', 'mempool-blocks', 'live-2h-chart'],
});
ws.addEventListener('message', function incoming({data}) {
const res = JSON.parse(data.toString());
if (res.blocks) {
console.log(res.blocks);
}
if (res.mempoolInfo) {
console.log(res.mempoolInfo);
}
if (res.transactions) {
console.log(res.transactions);
}
if (res.mempoolBlocks) {
console.log(res.mempoolBlocks);
}
});
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../../dist/mempool.js"></script>
<script>
const init = async () => {
try {
const {
bisq: { addresses },
} = mempoolJS();
const address = 'B1DgwRN92rdQ9xpEVCdXRfgeqGw9X4YtrZz';
const myAddress = await addresses.getAddress({ address });
console.log(myAddress);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../../dist/mempool.js"></script>
<script>
const init = async () => {
try {
const {
bisq: { blocks },
} = mempoolJS();
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>

View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../../dist/mempool.js"></script>
<script>
const init = async () => {
try {
const {
bisq: { statistics },
} = mempoolJS();
const stats = await statistics.getStats();
console.log(stats);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../../dist/mempool.js"></script>
<script>
const init = async () => {
try {
const {
bisq: { transactions },
} = mempoolJS();
const txid = 'e5a42c5eff51822eb0ab503cac0e0eadf2141089c83c9f8363210a004c6e66a7';
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>

View File

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../../dist/mempool.js"></script>
<script>
const init = async () => {
try {
const {
bitcoin: { addresses },
} = mempoolJS();
const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC';
const myAddress = await addresses.getAddress({ address });
console.log(myAddress);
const addressTxs = await addresses.getAddressTxs({ address });
console.log(addressTxs);
const addressTxsChain = await addresses.getAddressTxsChain({ address });
console.log(addressTxsChain);
const addressTxsMempool = await addresses.getAddressTxsMempool({
address,
});
console.log(addressTxsMempool);
const addressTxsUtxo = await addresses.getAddressTxsUtxo({ address });
console.log(addressTxsUtxo);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,56 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../../dist/mempool.js"></script>
<script>
const init = async () => {
try {
const {
bitcoin: { blocks },
} = mempoolJS();
const hash =
'000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce';
const block = await blocks.getBlock({ hash });
console.log(block);
const blockStatus = await blocks.getBlockStatus({ hash });
console.log(blockStatus);
const blockTxs = await blocks.getBlockTxs({ hash });
console.log(blockTxs);
const blockTxids = await blocks.getBlockTxids({ hash });
console.log(blockTxids);
const blockTxid = await blocks.getBlockTxid({ hash, index: 218 });
console.log(blockTxid);
const blockRaw = await blocks.getBlockRaw({ hash });
console.log(blockRaw);
const blockHeader = await blocks.getBlockHeader({ hash });
console.log(blockHeader);
const blockHeight = await blocks.getBlockHeight({ height: 0 });
console.log(blockHeight);
const getBlocks = await blocks.getBlocks({ start_height: 9999 });
console.log(getBlocks);
const blocksTipHeight = await blocks.getBlocksTipHeight();
console.log(blocksTipHeight);
const blocksTipHash = await blocks.getBlocksTipHash();
console.log(blocksTipHash);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../../dist/mempool.js"></script>
<script>
const init = async () => {
try {
const {
bitcoin: { difficulty },
} = mempoolJS();
const difficultyAdjustment = await difficulty.getDifficultyAdjustment();
console.log(difficultyAdjustment);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../../dist/mempool.js"></script>
<script>
const init = async () => {
try {
const {
bitcoin: { fees },
} = mempoolJS();
const feesRecommended = await fees.getFeesRecommended();
console.log(feesRecommended);
const feesMempoolBlocks = await fees.getFeesMempoolBlocks();
console.log(feesMempoolBlocks);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../../dist/mempool.js"></script>
<script>
const init = async () => {
try {
const {
bitcoin: { mempool },
} = mempoolJS();
const getMempool = await mempool.getMempool();
console.log(getMempool);
const getMempoolRecent = await mempool.getMempoolRecent();
console.log(getMempoolRecent);
const getMempoolTxids = await mempool.getMempoolTxids();
console.log(getMempoolTxids);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,56 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../../dist/mempool.js"></script>
<script>
const init = async () => {
try {
const {
bitcoin: { transactions },
} = mempoolJS();
const txid =
'15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521';
const tx = await transactions.getTx({ txid });
console.log(tx);
const txStatus = await transactions.getTxStatus({ txid });
console.log(txStatus);
const txHex = await transactions.getTxHex({ txid });
console.log(txHex);
const txRaw = await transactions.getTxRaw({ txid });
console.log(txRaw);
const txMerkleBlockProof = await transactions.getTxMerkleBlockProof({
txid,
});
console.log(txMerkleBlockProof);
const txMerkleProof = await transactions.getTxMerkleProof({ txid });
console.log(txMerkleProof);
const txOutspend = await transactions.getTxOutspend({
txid,
vout: 3,
});
console.log(txOutspend);
const txOutspends = await transactions.getTxOutspends({ txid });
console.log(txOutspends);
const postTx = await transactions.postTx({ txhex });
console.log(postTx);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../../dist/mempool.js"></script>
<script>
const init = async () => {
try {
const {
bitcoin: { websocket },
} = mempoolJS();
const ws = websocket.initClient({
options: ['blocks', 'stats', 'mempool-blocks', 'live-2h-chart'],
});
ws.addEventListener('message', function incoming({data}) {
const res = JSON.parse(data.toString());
if (res.blocks) {
console.log(res.blocks);
}
if (res.mempoolInfo) {
console.log(res.mempoolInfo);
}
if (res.transactions) {
console.log(res.transactions);
}
if (res.mempoolBlocks) {
console.log(res.mempoolBlocks);
}
});
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../../dist/mempool.js"></script>
<script>
const init = async () => {
try {
const {
liquid: { addresses },
} = mempoolJS();
const address = 'Go65t19hP2FuhBMYtgbdMDgdmEzNwh1i48';
const myAddress = await addresses.getAddress({ address });
console.log(myAddress);
const addressTxs = await addresses.getAddressTxs({ address });
console.log(addressTxs);
const addressTxsChain = await addresses.getAddressTxsChain({ address });
console.log(addressTxsChain);
const addressTxsMempool = await addresses.getAddressTxsMempool({
address,
});
console.log(addressTxsMempool);
const addressTxsUtxo = await addresses.getAddressTxsUtxo({ address });
console.log(addressTxsUtxo);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../../dist/mempool.js"></script>
<script>
const init = async () => {
try {
const {
liquid: { assets },
} = mempoolJS();
const asset_id = 'a0c358a0f6947864af3a06f3f6a2aeb304df7fd95c922f2f22d7412399ce7691';
const asset = await assets.getAsset({ asset_id });
console.log(asset);
const assetTxs = await assets.getAssetTxs({
asset_id,
is_mempool: false,
});
console.log(assetTxs);
const assetSupply = await assets.getAssetSupply({
asset_id,
decimal: false,
});
console.log(assetSupply);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,53 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../../dist/mempool.js"></script>
<script>
const init = async () => {
try {
const {
liquid: { blocks },
} = mempoolJS();
const hash =
'54f02bdec5509ea769c8be82aed51f689969b653d92a2812d5a36266cbfbc55e';
const block = await blocks.getBlock({ hash });
console.log(block);
const blockStatus = await blocks.getBlockStatus({ hash });
console.log(blockStatus);
const blockTxs = await blocks.getBlockTxs({ hash });
console.log(blockTxs);
const blockTxids = await blocks.getBlockTxids({ hash });
console.log(blockTxids);
const blockTxid = await blocks.getBlockTxid({ hash, index: 0 });
console.log(blockTxid);
const blockRaw = await blocks.getBlockRaw({ hash });
console.log(blockRaw);
const blockHeight = await blocks.getBlockHeight({ height: 0 });
console.log(blockHeight);
const getBlocks = await blocks.getBlocks({ start_height: 9999 });
console.log(getBlocks);
const blocksTipHeight = await blocks.getBlocksTipHeight();
console.log(blocksTipHeight);
const blocksTipHash = await blocks.getBlocksTipHash();
console.log(blocksTipHash);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../../dist/mempool.js"></script>
<script>
const init = async () => {
try {
const {
liquid: { fees },
} = mempoolJS();
const feesRecommended = await fees.getFeesRecommended();
console.log(feesRecommended);
const feesMempoolBlocks = await fees.getFeesMempoolBlocks();
console.log(feesMempoolBlocks);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../../dist/mempool.js"></script>
<script>
const init = async () => {
try {
const {
liquid: { mempool },
} = mempoolJS();
const getMempool = await mempool.getMempool();
console.log(getMempool);
const getMempoolRecent = await mempool.getMempoolRecent();
console.log(getMempoolRecent);
const getMempoolTxids = await mempool.getMempoolTxids();
console.log(getMempoolTxids);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,55 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../../dist/mempool.js"></script>
<script>
const init = async () => {
try {
const {
liquid: { transactions },
} = mempoolJS();
const txid =
'15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521';
const tx = await transactions.getTx({ txid });
console.log(tx);
const txStatus = await transactions.getTxStatus({ txid });
console.log(txStatus);
const txHex = await transactions.getTxHex({ txid });
console.log(txHex);
const txRaw = await transactions.getTxRaw({ txid });
console.log(txRaw);
const txMerkleBlockProof = await transactions.getTxMerkleBlockProof({
txid,
});
console.log(txMerkleBlockProof);
const txMerkleProof = await transactions.getTxMerkleProof({ txid });
console.log(txMerkleProof);
const txOutspend = await transactions.getTxOutspend({
txid,
vout: 3,
});
console.log(txOutspend);
const txOutspends = await transactions.getTxOutspends({ txid });
console.log(txOutspends);
// const postTx = await transactions.postTx({ txhex });
// console.log(postTx);
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="./../../../../dist/mempool.js"></script>
<script>
const init = async () => {
try {
const {
liquid: { websocket },
} = mempoolJS();
const ws = websocket.initClient({
options: ['blocks', 'stats', 'mempool-blocks', 'live-2h-chart'],
});
ws.addEventListener('message', function incoming({data}) {
const res = JSON.parse(data.toString());
if (res.blocks) {
console.log(res.blocks);
}
if (res.mempoolInfo) {
console.log(res.mempoolInfo);
}
if (res.transactions) {
console.log(res.transactions);
}
if (res.mempoolBlocks) {
console.log(res.mempoolBlocks);
}
});
} catch (error) {
console.log(error);
}
};
init();
</script>
</head>
<body></body>
</html>

View File

@ -1,9 +1,7 @@
import mempoolJS from "@mempool/mempool.js";
import bisqJS from "./../../../src/index-bisq";
const init = async () => {
const {
bisq: { addresses },
} = mempoolJS();
const { addresses } = bisqJS();
const address = 'B1DgwRN92rdQ9xpEVCdXRfgeqGw9X4YtrZz';

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();

View File

@ -1,23 +0,0 @@
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {
bisq: { blocks },
} = mempoolJS();
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);
};
init();

View File

@ -1,11 +0,0 @@
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {
bisq: { statistics },
} = mempoolJS();
const stats = await statistics.getStats();
console.log(stats);
};
init();

View File

@ -1,17 +0,0 @@
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {
bisq: { transactions },
} = mempoolJS();
const txid =
'4b5417ec5ab6112bedf539c3b4f5a806ed539542d8b717e1c4470aa3180edce5';
const tx = await transactions.getTx({ txid });
console.log(tx);
const txs = await transactions.getTxs({ index: 0, length: 1 });
console.log(txs);
};
init();

View File

@ -1,25 +0,0 @@
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {
bitcoin: { addresses },
} = mempoolJS();
const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC';
const myAddress = await addresses.getAddress({ address });
console.log(myAddress);
const addressTxs = await addresses.getAddressTxs({ address });
console.log(addressTxs);
const addressTxsChain = await addresses.getAddressTxsChain({ address });
console.log(addressTxsChain);
const addressTxsMempool = await addresses.getAddressTxsMempool({ address });
console.log(addressTxsMempool);
const addressTxsUtxo = await addresses.getAddressTxsUtxo({ address });
console.log(addressTxsUtxo);
};
init();

View File

@ -1,44 +0,0 @@
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {
bitcoin: { blocks },
} = mempoolJS();
const hash =
'000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce';
const block = await blocks.getBlock({ hash });
console.log(block);
const blockStatus = await blocks.getBlockStatus({ hash });
console.log(blockStatus);
const blockTxs = await blocks.getBlockTxs({ hash });
console.log(blockTxs);
const blockTxids = await blocks.getBlockTxids({ hash });
console.log(blockTxids);
const blockTxid = await blocks.getBlockTxid({ hash, index: 218 });
console.log(blockTxid);
const blockRaw = await blocks.getBlockRaw({ hash });
console.log(blockRaw);
const blockHeader = await blocks.getBlockHeader({ hash });
console.log(blockHeader);
const blockHeight = await blocks.getBlockHeight({ height: 0 });
console.log(blockHeight);
const getBlocks = await blocks.getBlocks({ start_height: 9999 });
console.log(getBlocks);
const blocksTipHeight = await blocks.getBlocksTipHeight();
console.log(blocksTipHeight);
const blocksTipHash = await blocks.getBlocksTipHash();
console.log(blocksTipHash);
};
init();

View File

@ -1,11 +0,0 @@
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {
bitcoin: { difficulty },
} = mempoolJS();
const difficultyAdjustment = await difficulty.getDifficultyAdjustment();
console.log(difficultyAdjustment);
};
init();

View File

@ -1,19 +0,0 @@
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {
bitcoin: { fees },
} = mempoolJS();
const feesRecommended = await fees.getFeesRecommended();
console.log(feesRecommended);
const feesMempoolBlocks = await fees.getFeesMempoolBlocks();
console.log(feesMempoolBlocks);
const txid = 'txid';
const feesCPFP = await fees.getCPFP({ txid });
console.log(feesCPFP);
};
init();

View File

@ -1,17 +0,0 @@
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {
bitcoin: { mempool },
} = mempoolJS();
const getMempool = await mempool.getMempool();
console.log(getMempool);
const getMempoolRecent = await mempool.getMempoolRecent();
console.log(getMempoolRecent);
const getMempoolTxids = await mempool.getMempoolTxids();
console.log(getMempoolTxids);
};
init();

View File

@ -1,41 +0,0 @@
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {
bitcoin: { transactions },
} = mempoolJS();
const txid =
'15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521';
const tx = await transactions.getTx({ txid });
console.log(tx);
const txStatus = await transactions.getTxStatus({ txid });
console.log(txStatus);
const txHex = await transactions.getTxHex({ txid });
console.log(txHex);
const txRaw = await transactions.getTxRaw({ txid });
console.log(txRaw);
const txMerkleBlockProof = await transactions.getTxMerkleBlockProof({ txid });
console.log(txMerkleBlockProof);
const txMerkleProof = await transactions.getTxMerkleProof({ txid });
console.log(txMerkleProof);
const txOutspend = await transactions.getTxOutspend({
txid,
vout: 3,
});
console.log(txOutspend);
const txOutspends = await transactions.getTxOutspends({ txid });
console.log(txOutspends);
// const postTx = await transactions.postTx({ txid });
// console.log(postTx);
};
init();

View File

@ -1,27 +0,0 @@
import mempoolJS from "@mempool/mempool.js";
const { bitcoin: { websocket } } = mempoolJS();
const init = async () => {
const ws = websocket.initServer({
options: ["blocks", "stats", "mempool-blocks", "live-2h-chart"],
});
ws.on("message", function incoming(data) {
const res = JSON.parse(data.toString());
if (res.blocks) {
console.log(res.blocks);
}
if (res.mempoolInfo) {
console.log(res.mempoolInfo);
}
if (res.transactions) {
console.log(res.transactions);
}
if (res.mempoolBlocks) {
console.log(res.mempoolBlocks);
}
});
}
init();

View File

@ -1,19 +0,0 @@
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const { bitcoin } = mempoolJS({
hostname:'localhost:4200'
});
const feesRecommended = await bitcoin.fees.getFeesRecommended();
console.log(feesRecommended);
const hash = "0000000000000000000065bda8f8a88f2e1e00d9a6887a43d640e52a4c7660f2";
const block = await bitcoin.blocks.getBlockHeader({hash});
console.log(block);
const difficultyAdjustment = await bitcoin.difficulty.getDifficultyAdjustment();
console.log(difficultyAdjustment);
};
init();

View File

@ -0,0 +1,29 @@
import mempoolJS from "./../../../src/index";
const init = async () => {
try {
const {
liquid: { addresses },
} = mempoolJS();
const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC';
const myAddress = await addresses.getAddress({ address });
console.log(myAddress);
const addressTxs = await addresses.getAddressTxs({ address });
console.log(addressTxs);
const addressTxsChain = await addresses.getAddressTxsChain({ address });
console.log(addressTxsChain);
const addressTxsMempool = await addresses.getAddressTxsMempool({ address });
console.log(addressTxsMempool);
const addressTxsUtxo = await addresses.getAddressTxsUtxo({ address });
console.log(addressTxsUtxo);
} catch (error) {
console.log(error);
}
};
init();

View File

@ -0,0 +1,24 @@
import mempoolJS from "./../../../src/index";
const init = async () => {
try {
const {
liquid: { assets },
} = mempoolJS();
const asset_id =
'6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d';
const asset = await assets.getAsset({ asset_id });
console.log(asset);
const assetTxs = await assets.getAssetTxs({ asset_id, is_mempool: false });
console.log(assetTxs);
const assetSupply = await assets.getAssetSupply({ asset_id, decimal: false });
console.log(assetSupply);
} catch (error) {
console.log(error);
}
};
init();

View File

@ -0,0 +1,45 @@
import mempoolJS from "./../../../src/index";
const init = async () => {
try {
const {
liquid: { blocks },
} = mempoolJS();
const hash =
'000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce';
const block = await blocks.getBlock({ hash });
console.log(block);
const blockStatus = await blocks.getBlockStatus({ hash });
console.log(blockStatus);
const blockTxs = await blocks.getBlockTxs({ hash });
console.log(blockTxs);
const blockTxids = await blocks.getBlockTxids({ hash });
console.log(blockTxids);
const blockTxid = await blocks.getBlockTxid({ hash, index: 218 });
console.log(blockTxid);
const blockRaw = await blocks.getBlockRaw({ hash });
console.log(blockRaw);
const blockHeight = await blocks.getBlockHeight({ height: 0 });
console.log(blockHeight);
const getBlocks = await blocks.getBlocks({ start_height: 9999 });
console.log(getBlocks);
const blocksTipHeight = await blocks.getBlocksTipHeight();
console.log(blocksTipHeight);
const blocksTipHash = await blocks.getBlocksTipHash();
console.log(blocksTipHash);
} catch (error) {
console.log(error);
}
};
init();

View File

@ -0,0 +1,18 @@
import mempoolJS from "./../../../src/index";
const init = async () => {
try {
const {
liquid: { fees },
} = mempoolJS();
const feesRecommended = await fees.getFeesRecommended();
console.log(feesRecommended);
const feesMempoolBlocks = await fees.getFeesMempoolBlocks();
console.log(feesMempoolBlocks);
} catch (error) {
console.log(error);
}
};
init();

View File

@ -0,0 +1,21 @@
import mempoolJS from "./../../../src/index";
const init = async () => {
try {
const {
liquid: { mempool },
} = mempoolJS();
const getMempool = await mempool.getMempool();
console.log(getMempool);
const getMempoolRecent = await mempool.getMempoolRecent();
console.log(getMempoolRecent);
const getMempoolTxids = await mempool.getMempoolTxids();
console.log(getMempoolTxids);
} catch (error) {
console.log(error);
}
};
init();

View File

@ -0,0 +1,45 @@
import mempoolJS from "./../../../src/index";
const init = async () => {
try {
const {
liquid: { transactions },
} = mempoolJS();
const txid =
'15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521';
const tx = await transactions.getTx({ txid });
console.log(tx);
const txStatus = await transactions.getTxStatus({ txid });
console.log(txStatus);
const txHex = await transactions.getTxHex({ txid });
console.log(txHex);
const txRaw = await transactions.getTxRaw({ txid });
console.log(txRaw);
const txMerkleBlockProof = await transactions.getTxMerkleBlockProof({ txid });
console.log(txMerkleBlockProof);
const txMerkleProof = await transactions.getTxMerkleProof({ txid });
console.log(txMerkleProof);
const txOutspend = await transactions.getTxOutspend({
txid,
vout: 3,
});
console.log(txOutspend);
const txOutspends = await transactions.getTxOutspends({ txid });
console.log(txOutspends);
// const postTx = await transactions.postTx({ txhex });
// console.log(postTx);
} catch (error) {
console.log(error);
}
};
init();

View File

@ -0,0 +1,30 @@
import mempoolJS from "./../../../src/index";
const { liquid: { websocket } } = mempoolJS();
const init = async () => {
try {
const ws = websocket.initServer({
options: ["blocks", "stats", "mempool-blocks", "live-2h-chart"],
});
ws.on("message", function incoming(data) {
const res = JSON.parse(data.toString());
if (res.blocks) {
console.log(res.blocks);
}
if (res.mempoolInfo) {
console.log(res.mempoolInfo);
}
if (res.transactions) {
console.log(res.transactions);
}
if (res.mempoolBlocks) {
console.log(res.mempoolBlocks);
}
});
} catch (error) {
console.log(error);
}
}
init();

View File

@ -1,25 +0,0 @@
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {
liquid: { addresses },
} = mempoolJS();
const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC';
const myAddress = await addresses.getAddress({ address });
console.log(myAddress);
const addressTxs = await addresses.getAddressTxs({ address });
console.log(addressTxs);
const addressTxsChain = await addresses.getAddressTxsChain({ address });
console.log(addressTxsChain);
const addressTxsMempool = await addresses.getAddressTxsMempool({ address });
console.log(addressTxsMempool);
const addressTxsUtxo = await addresses.getAddressTxsUtxo({ address });
console.log(addressTxsUtxo);
};
init();

View File

@ -1,20 +0,0 @@
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {
liquid: { assets },
} = mempoolJS();
const asset_id =
'6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d';
const asset = await assets.getAsset({ asset_id });
console.log(asset);
const assetTxs = await assets.getAssetTxs({ asset_id, is_mempool: false });
console.log(assetTxs);
const assetSupply = await assets.getAssetSupply({ asset_id, decimal: false });
console.log(assetSupply);
};
init();

View File

@ -1,41 +0,0 @@
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {
liquid: { blocks },
} = mempoolJS();
const hash =
'000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce';
const block = await blocks.getBlock({ hash });
console.log(block);
const blockStatus = await blocks.getBlockStatus({ hash });
console.log(blockStatus);
const blockTxs = await blocks.getBlockTxs({ hash });
console.log(blockTxs);
const blockTxids = await blocks.getBlockTxids({ hash });
console.log(blockTxids);
const blockTxid = await blocks.getBlockTxid({ hash, index: 218 });
console.log(blockTxid);
const blockRaw = await blocks.getBlockRaw({ hash });
console.log(blockRaw);
const blockHeight = await blocks.getBlockHeight({ height: 0 });
console.log(blockHeight);
const getBlocks = await blocks.getBlocks({ start_height: 9999 });
console.log(getBlocks);
const blocksTipHeight = await blocks.getBlocksTipHeight();
console.log(blocksTipHeight);
const blocksTipHash = await blocks.getBlocksTipHash();
console.log(blocksTipHash);
};
init();

View File

@ -1,14 +0,0 @@
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {
liquid: { fees },
} = mempoolJS();
const feesRecommended = await fees.getFeesRecommended();
console.log(feesRecommended);
const feesMempoolBlocks = await fees.getFeesMempoolBlocks();
console.log(feesMempoolBlocks);
};
init();

View File

@ -1,17 +0,0 @@
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {
liquid: { mempool },
} = mempoolJS();
const getMempool = await mempool.getMempool();
console.log(getMempool);
const getMempoolRecent = await mempool.getMempoolRecent();
console.log(getMempoolRecent);
const getMempoolTxids = await mempool.getMempoolTxids();
console.log(getMempoolTxids);
};
init();

View File

@ -1,41 +0,0 @@
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {
liquid: { transactions },
} = mempoolJS();
const txid =
'15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521';
const tx = await transactions.getTx({ txid });
console.log(tx);
const txStatus = await transactions.getTxStatus({ txid });
console.log(txStatus);
const txHex = await transactions.getTxHex({ txid });
console.log(txHex);
const txRaw = await transactions.getTxRaw({ txid });
console.log(txRaw);
const txMerkleBlockProof = await transactions.getTxMerkleBlockProof({ txid });
console.log(txMerkleBlockProof);
const txMerkleProof = await transactions.getTxMerkleProof({ txid });
console.log(txMerkleProof);
const txOutspend = await transactions.getTxOutspend({
txid,
vout: 3,
});
console.log(txOutspend);
const txOutspends = await transactions.getTxOutspends({ txid });
console.log(txOutspends);
// const postTx = await transactions.postTx({ txid });
// console.log(postTx);
};
init();

View File

@ -1,27 +0,0 @@
import mempoolJS from "@mempool/mempool.js";
const { liquid: { websocket } } = mempoolJS();
const init = async () => {
const ws = websocket.initServer({
options: ["blocks", "stats", "mempool-blocks", "live-2h-chart"],
});
ws.on("message", function incoming(data) {
const res = JSON.parse(data.toString());
if (res.blocks) {
console.log(res.blocks);
}
if (res.mempoolInfo) {
console.log(res.mempoolInfo);
}
if (res.transactions) {
console.log(res.transactions);
}
if (res.mempoolBlocks) {
console.log(res.mempoolBlocks);
}
});
}
init();

View File

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

View File

@ -0,0 +1,27 @@
import mempoolJS from "./../../../../src/index";
const init = async () => {
try {
const {
bisq: { blocks },
} = mempoolJS();
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,40 @@
import mempoolJS from "./../../../../src/index";
const init = async () => {
try {
const {
bisq: { markets },
} = mempoolJS();
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,15 @@
import mempoolJS from "./../../../../src/index";
const init = async () => {
try {
const {
bisq: { statistics },
} = mempoolJS();
const stats = await statistics.getStats();
console.log(stats);
} catch (error) {
console.log(error);
}
};
init();

View File

@ -0,0 +1,21 @@
import mempoolJS from "./../../../../src/index";
const init = async () => {
try {
const {
bisq: { transactions },
} = mempoolJS();
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();

View File

@ -0,0 +1,27 @@
import mempoolJS from "./../../../../src/index";
const init = async () => {
try {
const { bitcoin: { addresses } } = mempoolJS();
const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC';
const myAddress = await addresses.getAddress({ address });
console.log(myAddress);
const addressTxs = await addresses.getAddressTxs({ address });
console.log(addressTxs);
const addressTxsChain = await addresses.getAddressTxsChain({ address });
console.log(addressTxsChain);
const addressTxsMempool = await addresses.getAddressTxsMempool({ address });
console.log(addressTxsMempool);
const addressTxsUtxo = await addresses.getAddressTxsUtxo({ address });
console.log(addressTxsUtxo);
} catch (error) {
console.log(error);
}
};
init();

View File

@ -0,0 +1,49 @@
import mempoolJS from "./../../../../src/index";
const init = async () => {
try {
const {
bitcoin: { blocks },
} = mempoolJS();
const hash =
'000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce';
const block = await blocks.getBlock({ hash });
console.log(block);
const blockStatus = await blocks.getBlockStatus({ hash });
console.log(blockStatus);
const blockTxs = await blocks.getBlockTxs({ hash });
console.log(blockTxs);
const blockTxids = await blocks.getBlockTxids({ hash });
console.log(blockTxids);
const blockTxid = await blocks.getBlockTxid({ hash, index: 218 });
console.log(blockTxid);
const blockRaw = await blocks.getBlockRaw({ hash });
console.log(blockRaw);
const blockHeader = await blocks.getBlockHeader({ hash });
console.log(blockHeader);
const blockHeight = await blocks.getBlockHeight({ height: 0 });
console.log(blockHeight);
const getBlocks = await blocks.getBlocks({ start_height: 9999 });
console.log(getBlocks);
const blocksTipHeight = await blocks.getBlocksTipHeight();
console.log(blocksTipHeight);
const blocksTipHash = await blocks.getBlocksTipHash();
console.log(blocksTipHash);
} catch (error) {
console.log(error);
}
};
init();

View File

@ -0,0 +1,15 @@
import mempoolJS from "./../../../../src/index";
const init = async () => {
try {
const {
bitcoin: { difficulty },
} = mempoolJS();
const difficultyAdjustment = await difficulty.getDifficultyAdjustment();
console.log(difficultyAdjustment);
} catch (error) {
console.log(error);
}
};
init();

View File

@ -0,0 +1,23 @@
import mempoolJS from "./../../../../src/index";
const init = async () => {
try {
const {
bitcoin: { fees },
} = mempoolJS();
const feesRecommended = await fees.getFeesRecommended();
console.log(feesRecommended);
const feesMempoolBlocks = await fees.getFeesMempoolBlocks();
console.log(feesMempoolBlocks);
const txid = 'txid';
const feesCPFP = await fees.getCPFP({ txid });
console.log(feesCPFP);
} catch (error) {
console.log(error);
}
};
init();

View File

@ -0,0 +1,21 @@
import mempoolJS from "./../../../../src/index";
const init = async () => {
try {
const {
bitcoin: { mempool },
} = mempoolJS();
const getMempool = await mempool.getMempool();
console.log(getMempool);
const getMempoolRecent = await mempool.getMempoolRecent();
console.log(getMempoolRecent);
const getMempoolTxids = await mempool.getMempoolTxids();
console.log(getMempoolTxids);
} catch (error) {
console.log(error);
}
};
init();

View File

@ -0,0 +1,45 @@
import mempoolJS from "./../../../../src/index";
const init = async () => {
try {
const {
bitcoin: { transactions },
} = mempoolJS();
const txid =
'15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521';
const tx = await transactions.getTx({ txid });
console.log(tx);
const txStatus = await transactions.getTxStatus({ txid });
console.log(txStatus);
const txHex = await transactions.getTxHex({ txid });
console.log(txHex);
const txRaw = await transactions.getTxRaw({ txid });
console.log(txRaw);
const txMerkleBlockProof = await transactions.getTxMerkleBlockProof({ txid });
console.log(txMerkleBlockProof);
const txMerkleProof = await transactions.getTxMerkleProof({ txid });
console.log(txMerkleProof);
const txOutspend = await transactions.getTxOutspend({
txid,
vout: 3,
});
console.log(txOutspend);
const txOutspends = await transactions.getTxOutspends({ txid });
console.log(txOutspends);
// const postTx = await transactions.postTx({ txhex });
// console.log(postTx);
} catch (error) {
console.log(error);
}
};
init();

View File

@ -0,0 +1,30 @@
import mempoolJS from "./../../../../src/index";
const { bitcoin: { websocket } } = mempoolJS();
const init = async () => {
try {
const ws = websocket.initServer({
options: ["blocks", "stats", "mempool-blocks", "live-2h-chart"],
});
ws.on("message", function incoming(data) {
const res = JSON.parse(data.toString());
if (res.blocks) {
console.log(res.blocks);
}
if (res.mempoolInfo) {
console.log(res.mempoolInfo);
}
if (res.transactions) {
console.log(res.transactions);
}
if (res.mempoolBlocks) {
console.log(res.mempoolBlocks);
}
});
} catch (error) {
console.log(error);
}
}
init();

View File

@ -0,0 +1,29 @@
import mempoolJS from "./../../../../src/index";
const init = async () => {
try {
const {
liquid: { addresses },
} = mempoolJS();
const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC';
const myAddress = await addresses.getAddress({ address });
console.log(myAddress);
const addressTxs = await addresses.getAddressTxs({ address });
console.log(addressTxs);
const addressTxsChain = await addresses.getAddressTxsChain({ address });
console.log(addressTxsChain);
const addressTxsMempool = await addresses.getAddressTxsMempool({ address });
console.log(addressTxsMempool);
const addressTxsUtxo = await addresses.getAddressTxsUtxo({ address });
console.log(addressTxsUtxo);
} catch (error) {
console.log(error);
}
};
init();

View File

@ -0,0 +1,24 @@
import mempoolJS from "./../../../../src/index";
const init = async () => {
try {
const {
liquid: { assets },
} = mempoolJS();
const asset_id =
'6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d';
const asset = await assets.getAsset({ asset_id });
console.log(asset);
const assetTxs = await assets.getAssetTxs({ asset_id, is_mempool: false });
console.log(assetTxs);
const assetSupply = await assets.getAssetSupply({ asset_id, decimal: false });
console.log(assetSupply);
} catch (error) {
console.log(error);
}
};
init();

View File

@ -0,0 +1,45 @@
import mempoolJS from "./../../../../src/index";
const init = async () => {
try {
const {
liquid: { blocks },
} = mempoolJS();
const hash =
'000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce';
const block = await blocks.getBlock({ hash });
console.log(block);
const blockStatus = await blocks.getBlockStatus({ hash });
console.log(blockStatus);
const blockTxs = await blocks.getBlockTxs({ hash });
console.log(blockTxs);
const blockTxids = await blocks.getBlockTxids({ hash });
console.log(blockTxids);
const blockTxid = await blocks.getBlockTxid({ hash, index: 218 });
console.log(blockTxid);
const blockRaw = await blocks.getBlockRaw({ hash });
console.log(blockRaw);
const blockHeight = await blocks.getBlockHeight({ height: 0 });
console.log(blockHeight);
const getBlocks = await blocks.getBlocks({ start_height: 9999 });
console.log(getBlocks);
const blocksTipHeight = await blocks.getBlocksTipHeight();
console.log(blocksTipHeight);
const blocksTipHash = await blocks.getBlocksTipHash();
console.log(blocksTipHash);
} catch (error) {
console.log(error);
}
};
init();

View File

@ -0,0 +1,18 @@
import mempoolJS from "./../../../../src/index";
const init = async () => {
try {
const {
liquid: { fees },
} = mempoolJS();
const feesRecommended = await fees.getFeesRecommended();
console.log(feesRecommended);
const feesMempoolBlocks = await fees.getFeesMempoolBlocks();
console.log(feesMempoolBlocks);
} catch (error) {
console.log(error);
}
};
init();

View File

@ -0,0 +1,21 @@
import mempoolJS from "./../../../../src/index";
const init = async () => {
try {
const {
liquid: { mempool },
} = mempoolJS();
const getMempool = await mempool.getMempool();
console.log(getMempool);
const getMempoolRecent = await mempool.getMempoolRecent();
console.log(getMempoolRecent);
const getMempoolTxids = await mempool.getMempoolTxids();
console.log(getMempoolTxids);
} catch (error) {
console.log(error);
}
};
init();

View File

@ -0,0 +1,45 @@
import mempoolJS from "./../../../../src/index";
const init = async () => {
try {
const {
liquid: { transactions },
} = mempoolJS();
const txid =
'15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521';
const tx = await transactions.getTx({ txid });
console.log(tx);
const txStatus = await transactions.getTxStatus({ txid });
console.log(txStatus);
const txHex = await transactions.getTxHex({ txid });
console.log(txHex);
const txRaw = await transactions.getTxRaw({ txid });
console.log(txRaw);
const txMerkleBlockProof = await transactions.getTxMerkleBlockProof({ txid });
console.log(txMerkleBlockProof);
const txMerkleProof = await transactions.getTxMerkleProof({ txid });
console.log(txMerkleProof);
const txOutspend = await transactions.getTxOutspend({
txid,
vout: 3,
});
console.log(txOutspend);
const txOutspends = await transactions.getTxOutspends({ txid });
console.log(txOutspends);
// const postTx = await transactions.postTx({ txhex });
// console.log(postTx);
} catch (error) {
console.log(error);
}
};
init();

View File

@ -0,0 +1,30 @@
import mempoolJS from "./../../../../src/index";
const { liquid: { websocket } } = mempoolJS();
const init = async () => {
try {
const ws = websocket.initServer({
options: ["blocks", "stats", "mempool-blocks", "live-2h-chart"],
});
ws.on("message", function incoming(data) {
const res = JSON.parse(data.toString());
if (res.blocks) {
console.log(res.blocks);
}
if (res.mempoolInfo) {
console.log(res.mempoolInfo);
}
if (res.transactions) {
console.log(res.transactions);
}
if (res.mempoolBlocks) {
console.log(res.mempoolBlocks);
}
});
} catch (error) {
console.log(error);
}
}
init();

View File

@ -1,5 +1,5 @@
{
"watch": ["src"],
"watch": ["src", "examples"],
"ext": "ts,json",
"ignore": ["src/**/*.spec.ts"],
"exec": "ts-node ./src/index.ts"

6
npm-bisq-js/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
/node_modules
/lib
/dist/*
!.gitkeep
yarn-error.log

1
npm-bisq-js/README.md Normal file
View File

@ -0,0 +1 @@
# Bisq JS API

Some files were not shown because too many files have changed in this diff Show More