diff --git a/backend/mempool-config.sample.json b/backend/mempool-config.sample.json index bf0e15056..0f265047f 100644 --- a/backend/mempool-config.sample.json +++ b/backend/mempool-config.sample.json @@ -8,7 +8,10 @@ "POLL_RATE_MS": 2000, "CACHE_DIR": "./cache", "CLEAR_PROTECTION_MINUTES": 20, - "RECOMMENDED_FEE_PERCENTILE": 50 + "RECOMMENDED_FEE_PERCENTILE": 50, + "BLOCK_WEIGHT_UNITS": 4000000, + "INITIAL_BLOCKS_AMOUNT": 8, + "MEMPOOL_BLOCKS_AMOUNT": 8 }, "CORE_RPC": { "HOST": "127.0.0.1", diff --git a/backend/src/api/blocks.ts b/backend/src/api/blocks.ts index 3bed19c14..b09a5ac06 100644 --- a/backend/src/api/blocks.ts +++ b/backend/src/api/blocks.ts @@ -9,7 +9,6 @@ import transactionUtils from './transaction-utils'; import bitcoinBaseApi from './bitcoin/bitcoin-base.api'; class Blocks { - private static INITIAL_BLOCK_AMOUNT = 8; private blocks: BlockExtended[] = []; private currentBlockHeight = 0; private currentDifficulty = 0; @@ -35,14 +34,14 @@ class Blocks { const blockHeightTip = await bitcoinApi.$getBlockHeightTip(); if (this.blocks.length === 0) { - this.currentBlockHeight = blockHeightTip - Blocks.INITIAL_BLOCK_AMOUNT; + this.currentBlockHeight = blockHeightTip - config.MEMPOOL.INITIAL_BLOCKS_AMOUNT; } else { this.currentBlockHeight = this.blocks[this.blocks.length - 1].height; } - if (blockHeightTip - this.currentBlockHeight > Blocks.INITIAL_BLOCK_AMOUNT * 2) { - logger.info(`${blockHeightTip - this.currentBlockHeight} blocks since tip. Fast forwarding to the ${Blocks.INITIAL_BLOCK_AMOUNT} recent blocks`); - this.currentBlockHeight = blockHeightTip - Blocks.INITIAL_BLOCK_AMOUNT; + if (blockHeightTip - this.currentBlockHeight > config.MEMPOOL.INITIAL_BLOCKS_AMOUNT * 2) { + logger.info(`${blockHeightTip - this.currentBlockHeight} blocks since tip. Fast forwarding to the ${config.MEMPOOL.INITIAL_BLOCKS_AMOUNT} recent blocks`); + this.currentBlockHeight = blockHeightTip - config.MEMPOOL.INITIAL_BLOCKS_AMOUNT; } if (!this.lastDifficultyAdjustmentTime) { @@ -111,8 +110,8 @@ class Blocks { blockExtended.coinbaseTx = transactionUtils.stripCoinbaseTransaction(transactions[0]); transactions.shift(); transactions.sort((a, b) => b.effectiveFeePerVsize - a.effectiveFeePerVsize); - blockExtended.medianFee = transactions.length > 1 ? Common.median(transactions.map((tx) => tx.effectiveFeePerVsize)) : 0; - blockExtended.feeRange = transactions.length > 1 ? Common.getFeesInRange(transactions, 8) : [0, 0]; + blockExtended.medianFee = transactions.length > 0 ? Common.median(transactions.map((tx) => tx.effectiveFeePerVsize)) : 0; + blockExtended.feeRange = transactions.length > 0 ? Common.getFeesInRange(transactions, 8) : [0, 0]; if (block.height % 2016 === 0) { this.previousDifficultyRetarget = (block.difficulty - this.currentDifficulty) / this.currentDifficulty * 100; @@ -121,8 +120,8 @@ class Blocks { } this.blocks.push(blockExtended); - if (this.blocks.length > Blocks.INITIAL_BLOCK_AMOUNT * 4) { - this.blocks = this.blocks.slice(-Blocks.INITIAL_BLOCK_AMOUNT * 4); + if (this.blocks.length > config.MEMPOOL.INITIAL_BLOCKS_AMOUNT * 4) { + this.blocks = this.blocks.slice(-config.MEMPOOL.INITIAL_BLOCKS_AMOUNT * 4); } if (this.newBlockCallbacks.length) { diff --git a/backend/src/api/common.ts b/backend/src/api/common.ts index a560bfdfe..5c59582a1 100644 --- a/backend/src/api/common.ts +++ b/backend/src/api/common.ts @@ -1,5 +1,5 @@ import { CpfpInfo, TransactionExtended, TransactionStripped } from '../mempool.interfaces'; - +import config from '../config'; export class Common { static median(numbers: number[]) { let medianNr = 0; @@ -105,7 +105,7 @@ export class Common { totalFees += tx.bestDescendant.fee; } - tx.effectiveFeePerVsize = Math.max(1, totalFees / (totalWeight / 4)); + tx.effectiveFeePerVsize = Math.max(config.MEMPOOL.NETWORK === 'liquid' ? 0.1 : 1, totalFees / (totalWeight / 4)); tx.cpfpChecked = true; return { diff --git a/backend/src/api/mempool-blocks.ts b/backend/src/api/mempool-blocks.ts index a9c91103d..92da3eab9 100644 --- a/backend/src/api/mempool-blocks.ts +++ b/backend/src/api/mempool-blocks.ts @@ -4,7 +4,6 @@ import { Common } from './common'; import config from '../config'; class MempoolBlocks { - private static DEFAULT_PROJECTED_BLOCKS_AMOUNT = 8; private mempoolBlocks: MempoolBlockWithTransactions[] = []; constructor() {} @@ -76,7 +75,7 @@ class MempoolBlocks { let blockSize = 0; let transactions: TransactionExtended[] = []; transactionsSorted.forEach((tx) => { - if (blockVSize + tx.vsize <= 1000000 || mempoolBlocks.length === MempoolBlocks.DEFAULT_PROJECTED_BLOCKS_AMOUNT - 1) { + if (blockVSize + tx.weight <= config.MEMPOOL.BLOCK_WEIGHT_UNITS || mempoolBlocks.length === config.MEMPOOL.MEMPOOL_BLOCKS_AMOUNT) { blockVSize += tx.vsize; blockSize += tx.size; transactions.push(tx); diff --git a/backend/src/api/transaction-utils.ts b/backend/src/api/transaction-utils.ts index 2a5d3a9ad..04d6f3259 100644 --- a/backend/src/api/transaction-utils.ts +++ b/backend/src/api/transaction-utils.ts @@ -1,7 +1,7 @@ import bitcoinApi from './bitcoin/bitcoin-api-factory'; -import logger from '../logger'; import { TransactionExtended, TransactionMinerInfo } from '../mempool.interfaces'; import { IEsploraApi } from './bitcoin/esplora-api.interface'; +import config from '../config'; class TransactionUtils { constructor() { } @@ -31,7 +31,7 @@ class TransactionUtils { // @ts-ignore return transaction; } - const feePerVbytes = Math.max(1, (transaction.fee || 0) / (transaction.weight / 4)); + const feePerVbytes = Math.max(config.MEMPOOL.NETWORK === 'liquid' ? 0.1 : 1, (transaction.fee || 0) / (transaction.weight / 4)); const transactionExtended: TransactionExtended = Object.assign({ vsize: Math.round(transaction.weight / 4), feePerVsize: feePerVbytes, diff --git a/backend/src/api/websocket-handler.ts b/backend/src/api/websocket-handler.ts index 56aac6b54..29a2ed363 100644 --- a/backend/src/api/websocket-handler.ts +++ b/backend/src/api/websocket-handler.ts @@ -97,7 +97,7 @@ class WebsocketHandler { } if (parsedMessage.action === 'init') { - const _blocks = blocks.getBlocks().slice(-8); + const _blocks = blocks.getBlocks().slice(-config.MEMPOOL.INITIAL_BLOCKS_AMOUNT); if (!_blocks) { return; } @@ -173,7 +173,7 @@ class WebsocketHandler { getInitData(_blocks?: BlockExtended[]) { if (!_blocks) { - _blocks = blocks.getBlocks().slice(-8); + _blocks = blocks.getBlocks().slice(-config.MEMPOOL.INITIAL_BLOCKS_AMOUNT); } return { 'mempoolInfo': memPool.getMempoolInfo(), diff --git a/backend/src/config.ts b/backend/src/config.ts index 4a2e4f588..399beff60 100644 --- a/backend/src/config.ts +++ b/backend/src/config.ts @@ -11,6 +11,9 @@ interface IConfig { CACHE_DIR: string; CLEAR_PROTECTION_MINUTES: number; RECOMMENDED_FEE_PERCENTILE: number; + BLOCK_WEIGHT_UNITS: number; + INITIAL_BLOCKS_AMOUNT: number; + MEMPOOL_BLOCKS_AMOUNT: number; }; ESPLORA: { REST_API_URL: string; @@ -69,6 +72,9 @@ const defaults: IConfig = { 'CACHE_DIR': './cache', 'CLEAR_PROTECTION_MINUTES': 20, 'RECOMMENDED_FEE_PERCENTILE': 50, + 'BLOCK_WEIGHT_UNITS': 4000000, + 'INITIAL_BLOCKS_AMOUNT': 8, + 'MEMPOOL_BLOCKS_AMOUNT': 8, }, 'ESPLORA': { 'REST_API_URL': 'http://127.0.0.1:3000', diff --git a/frontend/.gitignore b/frontend/.gitignore index ac68948fc..380c2a9d7 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -59,3 +59,6 @@ generated-config.js cypress/videos cypress/screenshots +# Base index +src/index.html + diff --git a/frontend/cypress/integration/liquid/liquid.spec.ts b/frontend/cypress/integration/liquid/liquid.spec.ts index 5e6dd8486..b5a736d02 100644 --- a/frontend/cypress/integration/liquid/liquid.spec.ts +++ b/frontend/cypress/integration/liquid/liquid.spec.ts @@ -75,17 +75,7 @@ describe('Liquid', () => { cy.waitForSkeletonGone(); cy.get('li:nth-of-type(5) > a').click().then(() => { cy.get('.container-xl input').click().type('Liquid CAD').then(() => { - cy.get('table tr td:nth-of-type(4) a').click(); - }); - }); - }); - - it('shows a specific asset issuance TX', () => { - cy.visit('/liquid'); - cy.waitForSkeletonGone(); - cy.get('li:nth-of-type(5) > a').click().then(() => { - cy.get('.container-xl input').click().type('Liquid CAD').then(() => { - cy.get('table tr td:nth-of-type(5) a').click(); + cy.get('table tr td:nth-of-type(1) a').click(); }); }); }); diff --git a/frontend/generate-config.js b/frontend/generate-config.js index fa856dd7d..617ab3c0e 100644 --- a/frontend/generate-config.js +++ b/frontend/generate-config.js @@ -21,6 +21,16 @@ try { } } +const indexFilePath = configContent.BASE_MODULE ? 'src/index.' + configContent.BASE_MODULE + '.html' : 'src/index.mempool.html'; + +try { + fs.copyFileSync(indexFilePath, 'src/index.html'); + console.log('Copied ' + indexFilePath + ' to src/index.html'); +} catch (e) { + console.log('Error copying the index file'); + throw new Error(e); +} + try { const packageJson = fs.readFileSync('package.json'); packetJsonVersion = JSON.parse(packageJson).version; diff --git a/frontend/mempool-frontend-config.sample.json b/frontend/mempool-frontend-config.sample.json index 9a1c72282..80e8ae4cb 100644 --- a/frontend/mempool-frontend-config.sample.json +++ b/frontend/mempool-frontend-config.sample.json @@ -8,5 +8,8 @@ "KEEP_BLOCKS_AMOUNT": 8, "NGINX_PROTOCOL": "http", "NGINX_HOSTNAME": "127.0.0.1", - "NGINX_PORT": "80" + "NGINX_PORT": "80", + "MEMPOOL_BLOCKS_AMOUNT": 8, + "BLOCK_WEIGHT_UNITS": 4000000, + "BASE_MODULE": "mempool" } diff --git a/frontend/proxy.conf.json b/frontend/proxy.conf.json index 61cd6e825..e694f0990 100644 --- a/frontend/proxy.conf.json +++ b/frontend/proxy.conf.json @@ -67,11 +67,18 @@ "^/liquid/api": "/api/v1/ws" } }, - "/liquid/api/": { - "target": "http://localhost:50001/", + "/liquid/api/v1/": { + "target": "http://localhost:8999/", "secure": false, "pathRewrite": { - "^/liquid/api/": "" + "^/liquid/api/": "/api/" + } + }, + "/liquid/api/": { + "target": "http://localhost:8999/", + "secure": false, + "pathRewrite": { + "^/liquid/api/": "/api/v1/" } }, "/bisq/api/": { diff --git a/frontend/src/app/app-routing.module.ts b/frontend/src/app/app-routing.module.ts index 2e7a5d7a6..511d077e8 100644 --- a/frontend/src/app/app-routing.module.ts +++ b/frontend/src/app/app-routing.module.ts @@ -20,6 +20,7 @@ import { PrivacyPolicyComponent } from './components/privacy-policy/privacy-poli import { TrademarkPolicyComponent } from './components/trademark-policy/trademark-policy.component'; import { BisqMasterPageComponent } from './components/bisq-master-page/bisq-master-page.component'; import { SponsorComponent } from './components/sponsor/sponsor.component'; +import { LiquidMasterPageComponent } from './components/liquid-master-page/liquid-master-page.component'; let routes: Routes = [ { @@ -303,7 +304,7 @@ const browserWindow = window || {}; // @ts-ignore const browserWindowEnv = browserWindow.__env || {}; -if (browserWindowEnv && browserWindowEnv.OFFICIAL_BISQ_MARKETS) { +if (browserWindowEnv && browserWindowEnv.BASE_MODULE === 'bisq') { routes = [{ path: '', component: BisqMasterPageComponent, @@ -311,6 +312,93 @@ if (browserWindowEnv && browserWindowEnv.OFFICIAL_BISQ_MARKETS) { }]; } +if (browserWindowEnv && browserWindowEnv.BASE_MODULE === 'liquid') { + routes = [{ + path: '', + component: LiquidMasterPageComponent, + children: [ + { + path: '', + component: StartComponent, + children: [ + { + path: '', + component: DashboardComponent + }, + { + path: 'tx/:id', + component: TransactionComponent + }, + { + path: 'block/:id', + component: BlockComponent + }, + { + path: 'mempool-block/:id', + component: MempoolBlockComponent + }, + ], + }, + { + path: 'blocks', + component: LatestBlocksComponent, + }, + { + path: 'graphs', + component: StatisticsComponent, + }, + { + path: 'address/:id', + component: AddressComponent + }, + { + path: 'asset/:id', + component: AssetComponent + }, + { + path: 'assets', + component: AssetsComponent, + }, + { + path: 'api', + component: ApiDocsComponent, + }, + { + path: 'about', + component: AboutComponent, + }, + { + path: 'terms-of-service', + component: TermsOfServiceComponent + }, + { + path: 'privacy-policy', + component: PrivacyPolicyComponent + }, + { + path: 'trademark-policy', + component: TrademarkPolicyComponent + }, + { + path: 'sponsor', + component: SponsorComponent, + }, + ], + }, + { + path: 'tv', + component: TelevisionComponent + }, + { + path: 'status', + component: StatusViewComponent + }, + { + path: '**', + redirectTo: '' + }]; +} + @NgModule({ imports: [RouterModule.forRoot(routes, { initialNavigation: 'enabled', diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts index c9d6145b6..8a984c7b2 100644 --- a/frontend/src/app/app.module.ts +++ b/frontend/src/app/app.module.ts @@ -22,6 +22,7 @@ import { AddressLabelsComponent } from './components/address-labels/address-labe import { MempoolBlocksComponent } from './components/mempool-blocks/mempool-blocks.component'; import { MasterPageComponent } from './components/master-page/master-page.component'; import { BisqMasterPageComponent } from './components/bisq-master-page/bisq-master-page.component'; +import { LiquidMasterPageComponent } from './components/liquid-master-page/liquid-master-page.component'; import { AboutComponent } from './components/about/about.component'; import { TelevisionComponent } from './components/television/television.component'; import { StatisticsComponent } from './components/statistics/statistics.component'; @@ -61,6 +62,7 @@ import { SponsorComponent } from './components/sponsor/sponsor.component'; AboutComponent, MasterPageComponent, BisqMasterPageComponent, + LiquidMasterPageComponent, TelevisionComponent, BlockchainComponent, StartComponent, diff --git a/frontend/src/app/assets/assets.component.html b/frontend/src/app/assets/assets.component.html index fb7e54fd6..71df124ef 100644 --- a/frontend/src/app/assets/assets.component.html +++ b/frontend/src/app/assets/assets.component.html @@ -20,15 +20,13 @@ Ticker Issuer domain Asset ID - Issuance TX - {{ asset.name }} + {{ asset.name }} {{ asset.ticker }} - {{ asset.entity.domain }} + {{ asset.entity && asset.entity.domain }} {{ asset.asset_id | shortenString : 13 }} - {{ asset.issuance_txin.txid | shortenString : 13 }} @@ -47,15 +45,13 @@ Ticker Issuer domain Asset ID - Issuance TX - + - diff --git a/frontend/src/app/assets/assets.component.ts b/frontend/src/app/assets/assets.component.ts index 2ae0f21d5..5f572241d 100644 --- a/frontend/src/app/assets/assets.component.ts +++ b/frontend/src/app/assets/assets.component.ts @@ -107,7 +107,7 @@ export class AssetsComponent implements OnInit { const start = (this.page - 1) * this.itemsPerPage; if (searchText.length ) { const filteredAssets = this.assetsCache.filter((asset) => asset.name.toLowerCase().indexOf(searchText.toLowerCase()) > -1 - || asset.ticker.toLowerCase().indexOf(searchText.toLowerCase()) > -1); + || (asset.ticker || '').toLowerCase().indexOf(searchText.toLowerCase()) > -1); this.assets = filteredAssets; return filteredAssets.slice(start, this.itemsPerPage + start); } else { diff --git a/frontend/src/app/bisq/bisq-dashboard/bisq-dashboard.component.html b/frontend/src/app/bisq/bisq-dashboard/bisq-dashboard.component.html index e42829e13..132384fa9 100644 --- a/frontend/src/app/bisq/bisq-dashboard/bisq-dashboard.component.html +++ b/frontend/src/app/bisq/bisq-dashboard/bisq-dashboard.component.html @@ -17,7 +17,7 @@

- Markets + Markets Bitcoin Markets

diff --git a/frontend/src/app/bisq/bisq-dashboard/bisq-dashboard.component.ts b/frontend/src/app/bisq/bisq-dashboard/bisq-dashboard.component.ts index defac305c..402c9b6fb 100644 --- a/frontend/src/app/bisq/bisq-dashboard/bisq-dashboard.component.ts +++ b/frontend/src/app/bisq/bisq-dashboard/bisq-dashboard.component.ts @@ -69,7 +69,7 @@ export class BisqDashboardComponent implements OnInit { const newTickers = []; for (const t in tickers) { - if (!this.stateService.env.OFFICIAL_BISQ_MARKETS) { + if (this.stateService.env.BASE_MODULE !== 'bisq') { const pair = t.split('_'); if (pair[1] === 'btc' && this.allowCryptoCoins.indexOf(pair[0]) === -1) { continue; @@ -106,7 +106,7 @@ export class BisqDashboardComponent implements OnInit { ]) .pipe( map(([trades, markets]) => { - if (!this.stateService.env.OFFICIAL_BISQ_MARKETS) { + if (this.stateService.env.BASE_MODULE !== 'bisq') { trades = trades.filter((trade) => { const pair = trade.market.split('_'); return !(pair[1] === 'btc' && this.allowCryptoCoins.indexOf(pair[0]) === -1); diff --git a/frontend/src/app/bisq/bisq-main-dashboard/bisq-main-dashboard.component.html b/frontend/src/app/bisq/bisq-main-dashboard/bisq-main-dashboard.component.html index 52c604882..ed61c6fd4 100644 --- a/frontend/src/app/bisq/bisq-main-dashboard/bisq-main-dashboard.component.html +++ b/frontend/src/app/bisq/bisq-main-dashboard/bisq-main-dashboard.component.html @@ -63,7 +63,7 @@
- Markets + Markets Bitcoin Markets
@@ -105,7 +105,7 @@
- +
Terms of Service diff --git a/frontend/src/app/bisq/bisq-main-dashboard/bisq-main-dashboard.component.ts b/frontend/src/app/bisq/bisq-main-dashboard/bisq-main-dashboard.component.ts index 9897d1e03..a59ad88a9 100644 --- a/frontend/src/app/bisq/bisq-main-dashboard/bisq-main-dashboard.component.ts +++ b/frontend/src/app/bisq/bisq-main-dashboard/bisq-main-dashboard.component.ts @@ -77,7 +77,7 @@ export class BisqMainDashboardComponent implements OnInit { const newTickers = []; for (const t in tickers) { - if (!this.stateService.env.OFFICIAL_BISQ_MARKETS) { + if (this.stateService.env.BASE_MODULE !== 'bisq') { const pair = t.split('_'); if (pair[1] === 'btc' && this.allowCryptoCoins.indexOf(pair[0]) === -1) { continue; @@ -114,7 +114,7 @@ export class BisqMainDashboardComponent implements OnInit { ]) .pipe( map(([trades, markets]) => { - if (!this.stateService.env.OFFICIAL_BISQ_MARKETS) { + if (this.stateService.env.BASE_MODULE !== 'bisq') { trades = trades.filter((trade) => { const pair = trade.market.split('_'); return !(pair[1] === 'btc' && this.allowCryptoCoins.indexOf(pair[0]) === -1); diff --git a/frontend/src/app/components/about/about.component.html b/frontend/src/app/components/about/about.component.html index 82ae65af4..45e8c3053 100644 --- a/frontend/src/app/components/about/about.component.html +++ b/frontend/src/app/components/about/about.component.html @@ -8,10 +8,13 @@
-
+
The Mempool Open Source Project

Building a mempool and blockchain explorer for the Bitcoin community, focusing on the transaction fee market and multi-layer ecosystem, without any advertising, altcoins, or third-party trackers.

+ +
+
@@ -30,844 +31,1905 @@ -
  • - Addresses - - - - - GET Address - - - - -
    -
    Description
    -
    Returns details about an address. Available fields: address, chain_stats, and mempool_stats. {{ '{' }}chain,mempool{{ '}' }}_stats each contain an object with tx_count, funded_txo_count, funded_txo_sum, spent_txo_count, and spent_txo_sum.
    -
    - -
    -
    - - - - GET Address Transactions - - - - -
    -
    Description
    -
    Get transaction history for the specified address/scripthash, sorted with newest first. Returns up to 50 mempool transactions plus the first 25 confirmed transactions. You can request more confirmed transactions using :last_seen_txid (see below).
    -
    - -
    -
    - - - - GET Address Transactions Chain - - - -
    -
    Description
    -
    Get confirmed transaction history for the specified address/scripthash, sorted with newest first. Returns 25 transactions per page. More can be requested by specifying the last txid seen by the previous query.
    -
    - -
    -
    - - - - GET Address Transactions Mempool - - - - - -
    -
    Description
    -
    Get unconfirmed transaction history for the specified address/scripthash. Returns up to 50 transactions (no paging).
    -
    - - -
    -
    - - - - GET Address UTXO - - - - - -
    -
    Description
    -
    Get the list of unspent transaction outputs associated with the address/scripthash. Available fields: txid, vout, value, and status (with the status of the funding tx).There is also a valuecommitment field that may appear in place of value, plus the following additional fields: asset/assetcommitment, nonce/noncecommitment, surjection_proof, and range_proof.
    -
    - - -
    -
    -
    -
    -
  • - -
  • - Assets - - - - - GET Assets - - - -
    -
    Description
    -
    Returns information about a Liquid asset.
    -
    - - -
    -
    - - - - GET Asset Transactions - - - - -
    -
    Description
    -
    Returns transactions associated with the specified Liquid asset. For the network's native asset, returns a list of peg in, peg out, and burn transactions. For user-issued assets, returns a list of issuance, reissuance, and burn transactions. Does not include regular transactions transferring this asset.
    -
    - - -
    -
    - - - - GET Asset Supply - - - - -
    -
    Description
    -
    Get the current total supply of the specified asset. For the native asset (L-BTC), this is calculated as [chain,mempool]_stats.peg_in_amount - [chain,mempool]_stats.peg_out_amount - [chain,mempool]_stats.burned_amount. For issued assets, this is calculated as [chain,mempool]_stats.issued_amount - [chain,mempool]_stats.burned_amount. Not available for assets with blinded issuances. If /decimal is specified, returns the supply as a decimal according to the asset's divisibility. Otherwise, returned in base units.
    -
    - - -
    -
    -
    -
    -
  • - -
  • - Blocks - - - - - GET Block - - - -
    -
    Description
    -
    Returns details about a block. Available fields: id, height, version, timestamp, bits, nonce, merkle_root, tx_count, size, weight, proof, and previousblockhash.
    -
    - -
    -
    - - - - GET Block Header - - - - - -
    -
    Description
    -
    Returns the hex-encoded block header.
    -
    - - -
    -
    - - - - GET Block Height - - - -
    -
    Description
    -
    Returns the hash of the block currently at :height.
    -
    - -
    -
    - - - - GET Block Raw - - - -
    -
    Description
    -
    Returns the raw block representation in binary.
    -
    - - -
    -
    - - - - GET Block Status - - -
    Get Block Status
    - -
    -
    Description
    -
    Returns the confirmation status of a block. Available fields: in_best_chain (boolean, false for orphaned blocks), next_best (the hash of the next block, only available for blocks in the best chain).
    -
    - - -
    -
    - - - - GET Block Tip Height - - - - - -
    -
    Description
    -
    Returns the height of the last block.
    -
    - - -
    -
    - - - - GET Block Tip Hash - - - - -
    -
    Description
    -
    Returns the hash of the last block.
    -
    - - -
    -
    - - - - GET Block Transaction ID - - - - - -
    -
    Description
    -
    Returns the transaction at index :index within the specified block.
    -
    - - - -
    -
    - - - - GET Block Transaction IDs - - - - -
    -
    Description
    -
    Returns a list of all txids in the block.
    -
    - - - -
    -
    - - - - GET Block Transactions - - - -
    -
    Description
    -
    Returns a list of transactions in the block (up to 25 transactions beginning at start_index). Transactions returned here do not have the status field, since all the transactions share the same block and confirmation status.
    -
    - - -
    -
    - - - - GET Blocks - - - - - -
    -
    Description
    -
    Returns the 10 newest blocks starting at the tip or at :start_height if specified.
    -
    - - -
    -
    -
    -
    -
  • - -
  • - Fees - - - - - GET Mempool Blocks - - - -
    -
    Description
    -
    Returns current mempool as projected blocks.
    -
    - -
    -
    - - - GET Recommended Fees - - - -
    -
    Description
    -
    Returns our currently suggested fees for new transactions.
    -
    - -
    -
    -
    -
    -
  • - -
  • - BSQ - - - - - - GET Address - - - - - -
    -
    Description
    -
    Returns all Bisq transactions belonging to a Bitcoin address, with 'B' prefixed in front of the address.
    -
    - - -
    -
    - - - - GET Block - - - -
    -
    Endpoint
    - GET /bisq/api/block/:hash -
    - -
    -
    Description
    -
    Returns all Bisq transactions that exist in a Bitcoin block.
    -
    - - -
    -
    - - - - GET Block Tip Height - - - - -
    -
    Description
    -
    Returns the most recently processed Bitcoin block height processed by Bisq.
    -
    - - -
    -
    - - - - GET Blocks - - - - - -
    -
    Description
    -
    Returns :length Bitcoin blocks that contain Bisq transactions, starting from :index.
    -
    - - - -
    -
    - - - - GET Stats - - - -
    -
    Endpoint
    - GET /bisq/api/stats -
    - -
    -
    Description
    -
    Returns statistics about all Bisq transactions.
    -
    - - -
    -
    - - - - GET Transaction - - - -
    -
    Endpoint
    - GET /bisq/api/tx/:txid -
    - -
    -
    Description
    -
    Returns details about a Bisq transaction.
    -
    - - -
    -
    - - - - GET Transactions - - - -
    Get Mempool Txids
    - - -
    -
    Description
    -
    Returns :length of latest Bisq transactions, starting from :index.
    -
    - - -
    -
    -
    -
    -
  • - -
  • - Mempool - - - - - GET Mempool - - - - -
    -
    Description
    -
    Returns current mempool backlog statistics.
    -
    - -
    -
    - - - GET Mempool Transactions IDs - - - -
    -
    Description
    -
    Get the full list of txids in the mempool as an array. The order of the txids is arbitrary and does not match bitcoind.
    -
    - - -
    -
    - - - - GET Mempool Recent - - - -
    -
    Description
    -
    Get a list of the last 10 transactions to enter the mempool. Each transaction object contains simplified overview data, with the following fields: txid, fee, vsize, and value.
    -
    - -
    -
    - -
    -
    -
  • - -
  • - Transactions - - - - - - GET Children Pay for Parent - - - -
    -
    Description
    -
    Returns the ancestors and the best descendant fees for a transaction.
    -
    - -
    -
    - - - - GET Transaction - - - - -
    -
    Description
    -
    Returns details about a transaction. Available fields: txid, version, locktime, size, weight, fee, vin, vout, and status.
    -
    - - -
    -
    - - - - GET Transaction Hex - - - -
  • + Addresses + + + + + GET Address + + + -
    -
    Description
    -
    Returns a transaction serialized as hex.
    -
    - - -
    -
    +
    +
    Description
    +
    Returns details about an address. Available fields: address, chain_stats, and mempool_stats. {{ '{' }}chain,mempool{{ '}' }}_stats each contain an object with tx_count, funded_txo_count, funded_txo_sum, spent_txo_count, and spent_txo_sum.
    +
    + +
    + - - - GET Transaction Merkleblock Proof - - - -
    -
    Description
    -
    Returns a merkle inclusion proof for the transaction using bitcoind's merkleblock format.
    -
    - - -
    -
    + + + GET Address Transactions + + + +
    +
    Description
    +
    Get transaction history for the specified address/scripthash, sorted with newest first. Returns up to 50 mempool transactions plus the first 25 confirmed transactions. You can request more confirmed transactions using :last_seen_txid (see below).
    +
    + +
    +
    - - - GET Transaction Merkle Proof - - + + + GET Address Transactions Chain + + + +
    +
    Description
    +
    Get confirmed transaction history for the specified address/scripthash, sorted with newest first. Returns 25 transactions per page. More can be requested by specifying the last txid seen by the previous query.
    +
    + +
    +
    - - -
    -
    Description
    -
    Returns a merkle inclusion proof for the transaction using Electrum's blockchain.transaction.get_merkle format.
    -
    - - -
    -
    - - - - GET Transaction Outspend - - + + + GET Address Transactions Mempool + + + +
    +
    Description
    +
    Get unconfirmed transaction history for the specified address/scripthash. Returns up to 50 transactions (no paging).
    +
    + +
    +
    - -
    -
    Description
    -
    Returns the spending status of a transaction output. Available fields: spent (boolean), txid (optional), vin (optional), and status (optional, the status of the spending tx).
    -
    - - -
    -
    - - - - GET Transaction Outspends - - + + + GET Address UTXO + + + +
    +
    Description
    +
    Get the list of unspent transaction outputs associated with the address/scripthash. Available fields: txid, vout, value, and status (with the status of the funding tx).There is also a valuecommitment field that may appear in place of value, plus the following additional fields: asset/assetcommitment, nonce/noncecommitment, surjection_proof, and range_proof.
    +
    + +
    +
    + +
    +
  • -
    -
    Endpoint
    - GET {{ network.val === '' ? '' : '/' + network.val }}/api/tx/:txid/outspends -
    -
    -
    Description
    -
    Returns the spending status of all transaction outputs.
    -
    - - - - - - - - GET Transaction Raw - - +
  • + Assets + + - -
    -
    Description
    -
    Returns a transaction as binary data.
    -
    - - -
    - + + + GET Assets + + + +
    +
    Description
    +
    Returns information about a Liquid asset.
    +
    + +
    +
    - - - GET Transaction Status - - + + + GET Asset Transactions + + + +
    +
    Description
    +
    Returns transactions associated with the specified Liquid asset. For the network's native asset, returns a list of peg in, peg out, and burn transactions. For user-issued assets, returns a list of issuance, reissuance, and burn transactions. Does not include regular transactions transferring this asset.
    +
    + +
    +
    - -
    -
    Description
    -
    Returns the confirmation status of a transaction. Available fields: confirmed (boolean), block_height (optional), and block_hash (optional).
    -
    + + + GET Asset Supply + + + +
    +
    Description
    +
    Get the current total supply of the specified asset. For the native asset (L-BTC), this is calculated as [chain,mempool]_stats.peg_in_amount - [chain,mempool]_stats.peg_out_amount - [chain,mempool]_stats.burned_amount. For issued assets, this is calculated as [chain,mempool]_stats.issued_amount - [chain,mempool]_stats.burned_amount. Not available for assets with blinded issuances. If /decimal is specified, returns the supply as a decimal according to the asset's divisibility. Otherwise, returned in base units.
    +
    + +
    +
    + +
    +
  • - -
    -
    - - - - POST Transaction - - +
  • + Blocks + + -
    -
    Endpoint
    -
    POST {{ network.val === '' ? '' : '/' + network.val }}/api/tx
    -
    - -
    -
    Description
    -
    Broadcast a raw transaction to the network. The transaction should be provided as hex in the request body. The txid will be returned on success.
    -
    - -
    - - - -
  • + + + GET Block + + + +
    +
    Description
    +
    Returns details about a block. Available fields: id, height, version, timestamp, bits, nonce, merkle_root, tx_count, size, weight, proof, and previousblockhash.
    +
    + +
    +
    -
  • - Websocket - -
    -
    -
    Endpoint
    - wss://{{ hostname }}{{ network.val === '' ? '' : '/' + network.val }}/api/v1/ws + + + GET Block Header + + + +
    +
    Description
    +
    Returns the hex-encoded block header.
    +
    + +
    +
    + + + + GET Block Height + + + +
    +
    Description
    +
    Returns the hash of the block currently at :height.
    +
    + +
    +
    + + + + GET Block Raw + + + +
    +
    Description
    +
    Returns the raw block representation in binary.
    +
    + +
    +
    + + + + GET Block Status + + +
    Get Block Status
    + +
    +
    Description
    +
    Returns the confirmation status of a block. Available fields: in_best_chain (boolean, false for orphaned blocks), next_best (the hash of the next block, only available for blocks in the best chain).
    +
    + +
    +
    + + + + GET Block Tip Height + + + +
    +
    Description
    +
    Returns the height of the last block.
    +
    + +
    +
    + + + + GET Block Tip Hash + + + +
    +
    Description
    +
    Returns the hash of the last block.
    +
    + +
    +
    + + + + GET Block Transaction ID + + + +
    +
    Description
    +
    Returns the transaction at index :index within the specified block.
    +
    + +
    +
    + + + + GET Block Transaction IDs + + + +
    +
    Description
    +
    Returns a list of all txids in the block.
    +
    + +
    +
    + + + + GET Block Transactions + + + +
    +
    Description
    +
    Returns a list of transactions in the block (up to 25 transactions beginning at start_index). Transactions returned here do not have the status field, since all the transactions share the same block and confirmation status.
    +
    + +
    +
    + + + + GET Blocks + + + +
    +
    Description
    +
    Returns the 10 newest blocks starting at the tip or at :start_height if specified.
    +
    + +
    +
    + + +
  • + +
  • + Fees + + + + + + GET Mempool Blocks Fees + + + +
    +
    Description
    +
    Returns current mempool as projected blocks.
    +
    + +
    +
    + + + + GET Recommended Fees + + + +
    +
    Description
    +
    Returns our currently suggested fees for new transactions.
    +
    + +
    +
    + +
    +
    +
  • + +
  • + Mempool + + + + + + GET Mempool + + + +
    +
    Description
    +
    Returns current mempool backlog statistics.
    +
    + +
    +
    + + + + GET Mempool Transactions IDs + + + +
    +
    Description
    +
    Get the full list of txids in the mempool as an array. The order of the txids is arbitrary and does not match bitcoind.
    +
    + +
    +
    + + + + GET Mempool Recent + + + +
    +
    Description
    +
    Get a list of the last 10 transactions to enter the mempool. Each transaction object contains simplified overview data, with the following fields: txid, fee, vsize, and value.
    +
    + +
    +
    + +
    +
    +
  • + +
  • + Transactions + + + + + + GET Children Pay for Parent + + + +
    +
    Description
    +
    Returns the ancestors and the best descendant fees for a transaction.
    +
    + +
    +
    + + + + GET Transaction + + + +
    +
    Description
    +
    Returns details about a transaction. Available fields: txid, version, locktime, size, weight, fee, vin, vout, and status.
    +
    + +
    +
    + + + + GET Transaction Hex + + + +
    +
    Description
    +
    Returns a transaction serialized as hex.
    +
    + +
    +
    + + + + GET Transaction Merkleblock Proof + + + +
    +
    Description
    +
    Returns a merkle inclusion proof for the transaction using bitcoind's merkleblock format.
    +
    + +
    +
    + + + + GET Transaction Merkle Proof + + + +
    +
    Description
    +
    Returns a merkle inclusion proof for the transaction using Electrum's blockchain.transaction.get_merkle format.
    +
    + +
    +
    + + + + GET Transaction Outspend + + + +
    +
    Description
    +
    Returns the spending status of a transaction output. Available fields: spent (boolean), txid (optional), vin (optional), and status (optional, the status of the spending tx).
    +
    + +
    +
    + + + + GET Transaction Outspends + + + +
    +
    Description
    +
    Returns the spending status of all transaction outputs.
    +
    + +
    +
    + + + + GET Transaction Raw + + + +
    +
    Description
    +
    Returns a transaction as binary data.
    +
    + +
    +
    + + + + GET Transaction Status + + + +
    +
    Description
    +
    Returns the confirmation status of a transaction. Available fields: confirmed (boolean), block_height (optional), and block_hash (optional).
    +
    + +
    +
    + + + + POST Transaction + + +
    +
    Endpoint
    +
    POST {{ network.val === '' ? '' : '/' + network.val }}/api/tx
    +
    +
    +
    Description
    +
    Broadcast a raw transaction to the network. The transaction should be provided as hex in the request body. The txid will be returned on success.
    +
    + +
    +
    + +
    +
    +
  • + +
  • + Websocket + +
    +
    +
    Endpoint
    + wss://{{ hostname }}{{ network.val === '' ? '' : '/' + network.val }}/api/v1/ws +
    +
    +
    Description
    +
    Default push: {{ '{' }} action: 'want', data: ['blocks', ...] {{ '}' }} to express what you want pushed. Available: blocks, mempool-blocks, live-2h-chart, and stats.

    Push transactions related to address: {{ '{' }} 'track-address': '3PbJ...bF9B' {{ '}' }} to receive all new transactions containing that address as input or output. Returns an array of transactions. address-transactions for new mempool transactions, and block-transactions for new block confirmed transactions.
    +
    +
    -
    -
    Description
    -
    Default push: {{ '{' }} action: 'want', data: ['blocks', ...] {{ '}' }} to express what you want pushed. Available: blocks, mempool-blocks, live-2h-chart, and stats.

    Push transactions related to address: {{ '{' }} 'track-address': '3PbJ...bF9B' {{ '}' }} to receive all new transactions containing that address as input or output. Returns an array of transactions. address-transactions for new mempool transactions, and block-transactions for new block confirmed transactions.
    + +
  • + + + +
  • + Addresses + + + + + + GET Address + + +
    +
    Endpoint
    + GET /api/address/:address +
    +
    +
    Description
    +
    Returns details about an address. Available fields: address, chain_stats, and mempool_stats. {{ '{' }}chain,mempool{{ '}' }}_stats each contain an object with tx_count, funded_txo_count, funded_txo_sum, spent_txo_count, and spent_txo_sum.
    +
    + +
    +
    + + + + GET Address Transactions + + + +
    +
    Description
    +
    Get transaction history for the specified address/scripthash, sorted with newest first. Returns up to 50 mempool transactions plus the first 25 confirmed transactions. You can request more confirmed transactions using :last_seen_txid (see below).
    +
    + +
    +
    + + + + GET Address Transactions Chain + + + +
    +
    Description
    +
    Get confirmed transaction history for the specified address/scripthash, sorted with newest first. Returns 25 transactions per page. More can be requested by specifying the last txid seen by the previous query.
    +
    + +
    +
    + + + + GET Address Transactions Mempool + + + +
    +
    Description
    +
    Get unconfirmed transaction history for the specified address/scripthash. Returns up to 50 transactions (no paging).
    +
    + +
    +
    + + + + GET Address UTXO + + + +
    +
    Description
    +
    Get the list of unspent transaction outputs associated with the address/scripthash. Available fields: txid, vout, value, and status (with the status of the funding tx).There is also a valuecommitment field that may appear in place of value, plus the following additional fields: asset/assetcommitment, nonce/noncecommitment, surjection_proof, and range_proof.
    +
    + +
    +
    + +
    +
    +
  • + +
  • + Assets + + + + + + GET Assets + + +
    +
    Endpoint
    + GET /api/asset/:asset_id +
    +
    +
    Description
    +
    Returns information about a Liquid asset.
    +
    + +
    +
    + + + + GET Asset Transactions + + + +
    +
    Description
    +
    Returns transactions associated with the specified Liquid asset. For the network's native asset, returns a list of peg in, peg out, and burn transactions. For user-issued assets, returns a list of issuance, reissuance, and burn transactions. Does not include regular transactions transferring this asset.
    +
    + +
    +
    + + + + GET Asset Supply + + + +
    +
    Description
    +
    Get the current total supply of the specified asset. For the native asset (L-BTC), this is calculated as [chain,mempool]_stats.peg_in_amount - [chain,mempool]_stats.peg_out_amount - [chain,mempool]_stats.burned_amount. For issued assets, this is calculated as [chain,mempool]_stats.issued_amount - [chain,mempool]_stats.burned_amount. Not available for assets with blinded issuances. If /decimal is specified, returns the supply as a decimal according to the asset's divisibility. Otherwise, returned in base units.
    +
    + +
    +
    +
    +
    +
  • + +
  • + Blocks + + + + + + GET Block + + +
    +
    Endpoint
    + GET /api/block/:hash +
    +
    +
    Description
    +
    Returns details about a block. Available fields: id, height, version, timestamp, bits, nonce, merkle_root, tx_count, size, weight, proof, and previousblockhash.
    +
    + +
    +
    + + + + GET Block Header + + + +
    +
    Description
    +
    Returns the hex-encoded block header.
    +
    + +
    +
    + + + + GET Block Height + + + +
    +
    Description
    +
    Returns the hash of the block currently at :height.
    +
    + +
    +
    + + + + GET Block Raw + + + +
    +
    Description
    +
    Returns the raw block representation in binary.
    +
    + +
    +
    + + + + GET Block Status + + +
    Get Block Status
    + +
    +
    Description
    +
    Returns the confirmation status of a block. Available fields: in_best_chain (boolean, false for orphaned blocks), next_best (the hash of the next block, only available for blocks in the best chain).
    +
    + +
    +
    + + + + GET Block Tip Height + + + +
    +
    Description
    +
    Returns the height of the last block.
    +
    + +
    +
    + + + + GET Block Tip Hash + + +
    +
    Endpoint
    + GET /api/blocks/tip/hash +
    +
    +
    Description
    +
    Returns the hash of the last block.
    +
    + +
    +
    + + + + GET Block Transaction ID + + + +
    +
    Description
    +
    Returns the transaction at index :index within the specified block.
    +
    + +
    +
    + + + + GET Block Transaction IDs + + + +
    +
    Description
    +
    Returns a list of all txids in the block.
    +
    + +
    +
    + + + + GET Block Transactions + + + +
    +
    Description
    +
    Returns a list of transactions in the block (up to 25 transactions beginning at start_index). Transactions returned here do not have the status field, since all the transactions share the same block and confirmation status.
    +
    + +
    +
    + + + + GET Blocks + + + +
    +
    Description
    +
    Returns the 10 newest blocks starting at the tip or at :start_height if specified.
    +
    + +
    +
    +
    +
    +
  • + +
  • + Fees + + + + + + GET Mempool Blocks Fees + + + +
    +
    Description
    +
    Returns current mempool as projected blocks.
    +
    + +
    +
    + + + + GET Recommended Fees + + + +
    +
    Description
    +
    Returns our currently suggested fees for new transactions.
    +
    + +
    +
    +
    +
    +
  • + +
  • + Mempool + + + + + + GET Mempool + + +
    +
    Endpoint
    + GET /api/mempool +
    +
    +
    Description
    +
    Returns current mempool backlog statistics.
    +
    + +
    +
    + + + + GET Mempool Transactions IDs + + +
    +
    Endpoint
    + GET /api/mempool/txids +
    +
    +
    Description
    +
    Get the full list of txids in the mempool as an array. The order of the txids is arbitrary and does not match bitcoind.
    +
    + +
    +
    + + + + GET Mempool Recent + + +
    +
    Endpoint
    + GET /api/mempool/recent +
    +
    +
    Description
    +
    Get a list of the last 10 transactions to enter the mempool. Each transaction object contains simplified overview data, with the following fields: txid, fee, vsize, and value.
    +
    + +
    +
    + +
    +
    +
  • + +
  • + Transactions + + + + + + GET Children Pay for Parent + + +
    +
    Endpoint
    + GET /api/v1/cpfp/:txid +
    +
    +
    Description
    +
    Returns the ancestors and the best descendant fees for a transaction.
    +
    + +
    +
    + + + + GET Transaction + + + +
    +
    Description
    +
    Returns details about a transaction. Available fields: txid, version, locktime, size, weight, fee, vin, vout, and status.
    +
    + +
    +
    + + + + GET Transaction Hex + + +
    +
    Endpoint
    + GET /api/tx/:txid/hex +
    +
    +
    Description
    +
    Returns a transaction serialized as hex.
    +
    + +
    +
    + + + + GET Transaction Merkleblock Proof + + + +
    +
    Description
    +
    Returns a merkle inclusion proof for the transaction using bitcoind's merkleblock format.
    +
    + +
    +
    + + + + GET Transaction Merkle Proof + + + +
    +
    Description
    +
    Returns a merkle inclusion proof for the transaction using Electrum's blockchain.transaction.get_merkle format.
    +
    + +
    +
    + + + + GET Transaction Outspend + + + +
    +
    Description
    +
    Returns the spending status of a transaction output. Available fields: spent (boolean), txid (optional), vin (optional), and status (optional, the status of the spending tx).
    +
    + +
    +
    + + + + GET Transaction Outspends + + + +
    +
    Description
    +
    Returns the spending status of all transaction outputs.
    +
    + +
    +
    + + + + GET Transaction Raw + + +
    +
    Endpoint
    + GET /api/tx/:txid/raw +
    +
    +
    Description
    +
    Returns a transaction as binary data.
    +
    + +
    +
    + + + + GET Transaction Status + + +
    +
    Endpoint
    + GET /api/tx/:txid/status +
    +
    +
    Description
    +
    Returns the confirmation status of a transaction. Available fields: confirmed (boolean), block_height (optional), and block_hash (optional).
    +
    + +
    +
    + + + + POST Transaction + + +
    +
    Endpoint
    +
    POST https://liquid.network/api/tx
    +
    +
    +
    Description
    +
    Broadcast a raw transaction to the network. The transaction should be provided as hex in the request body. The txid will be returned on success.
    +
    + +
    +
    + +
    +
    +
  • + +
  • + Websocket + +
    +
    +
    Endpoint
    + wss://{{ hostname }}/api/v1/ws +
    +
    +
    Description
    +
    Default push: {{ '{' }} action: 'want', data: ['blocks', ...] {{ '}' }} to express what you want pushed. Available: blocks, mempool-blocks, live-2h-chart, and stats.

    Push transactions related to address: {{ '{' }} 'track-address': '3PbJ...bF9B' {{ '}' }} to receive all new transactions containing that address as input or output. Returns an array of transactions. address-transactions for new mempool transactions, and block-transactions for new block confirmed transactions.
    +
    +
    - - -
    -
  • +
    + + + + +
  • + General + + + + + + GET Stats + + +
    +
    Endpoint
    + GET /bisq/api/stats +
    +
    +
    Description
    +
    Returns statistics about all Bisq transactions.
    +
    + +
    +
    + +
    +
    +
  • + +
  • + Addresses + + + + + + GET Address + + + +
    +
    Description
    +
    Returns all Bisq transactions belonging to a Bitcoin address, with 'B' prefixed in front of the address.
    +
    + +
    +
    + +
    +
    +
  • + +
  • + Blocks + + + + + + GET Block + + +
    +
    Endpoint
    + GET /bisq/api/block/:hash +
    +
    +
    Description
    +
    Returns all Bisq transactions that exist in a Bitcoin block.
    +
    + +
    +
    + + + + GET Block Tip Height + + + +
    +
    Description
    +
    Returns the most recently processed Bitcoin block height processed by Bisq.
    +
    + +
    +
    + + + + GET Blocks + + + +
    +
    Description
    +
    Returns :length Bitcoin blocks that contain Bisq transactions, starting from :index.
    +
    + +
    +
    + +
    +
    +
  • + +
  • + Markets + + + + + + GET Market Currencies + + +
    +
    Endpoint
    + GET /bisq/api/currencies +
    +
    +
    Description
    +
    Provides list of available currencies for a given base currency.
    +
    + +
    +
    + + + + GET Market Depth + + + +
    +
    Description
    +
    Provides list of open offer prices for a single market.
    +
    + +
    +
    + + + + GET Market HLOC + + + +
    +
    Description
    +
    Provides hi/low/open/close data for a given market. This can be used to generate a candlestick chart.
    +
    + +
    +
    + + + + GET Markets + + +
    +
    Endpoint
    + GET /bisq/api/markets +
    +
    +
    Description
    +
    Provides list of available markets.
    +
    + +
    +
    + + + + GET Market Offers + + + +
    +
    Description
    +
    Provides list of open offer details for a single market.
    +
    + +
    +
    + + + + GET Market Ticker + + +
    +
    Endpoint
    + GET /bisq/api/ticker +
    +
    +
    Description
    +
    Provides 24 hour price ticker for single market or all markets
    +
    + +
    +
    + + + + GET Market Trades + + + +
    +
    Description
    +
    Provides list of completed trades for a single market.
    +
    + +
    +
    + + + + GET Market Volumes + + + +
    +
    Description
    +
    Provides periodic volume data in terms of base currency for one or all markets.
    +
    + +
    +
    + +
    +
    +
  • + +
  • + Transactions + + + + + + GET Transaction + + +
    +
    Endpoint
    + GET /bisq/api/tx/:txid +
    +
    +
    Description
    +
    Returns details about a Bisq transaction.
    +
    + +
    +
    + + + + GET Transactions + + +
    Get Mempool Txids
    + +
    +
    Description
    +
    Returns :length of latest Bisq transactions, starting from :index.
    +
    + +
    +
    + +
    +
    +
  • +
    + + + +
  • + Markets + + + + + + GET Market Currencies + + +
    +
    Endpoint
    + GET /api/currencies +
    +
    +
    Description
    +
    Provides list of available currencies for a given base currency.
    +
    + +
    +
    + + + + GET Market Depth + + + +
    +
    Description
    +
    Provides list of open offer prices for a single market.
    +
    + +
    +
    + + + + GET Market HLOC + + + +
    +
    Description
    +
    Provides hi/low/open/close data for a given market. This can be used to generate a candlestick chart.
    +
    + +
    +
    + + + + GET Market Offers + + + +
    +
    Description
    +
    Provides list of open offer details for a single market.
    +
    + +
    +
    + + + + GET Market Ticker + + +
    +
    Endpoint
    + GET /api/ticker +
    +
    +
    Description
    +
    Provides 24 hour price ticker for single market or all markets
    +
    + +
    +
    + + + + GET Market Trades + + + +
    +
    Description
    +
    Provides list of completed trades for a single market.
    +
    + +
    +
    + + + + GET Market Volumes + + + +
    +
    Description
    +
    Provides periodic volume data in terms of base currency for one or all markets.
    +
    + +
    +
    + + + + GET Markets + + +
    +
    Endpoint
    + GET /api/markets +
    +
    +
    Description
    +
    Provides list of available markets.
    +
    + +
    +
    + +
    +
    +
  • + +
  • + General + + + + + + GET Stats + + +
    +
    Endpoint
    + GET /bisq/api/stats +
    +
    +
    Description
    +
    Returns statistics about all Bisq transactions.
    +
    + +
    +
    + +
    +
    +
  • + +
  • + Addresses + + + + + + GET Address + + + +
    +
    Description
    +
    Returns all Bisq transactions belonging to a Bitcoin address, with 'B' prefixed in front of the address.
    +
    + +
    +
    + +
    +
    +
  • + +
  • + Blocks + + + + + + GET Block + + +
    +
    Endpoint
    + GET /bisq/api/block/:hash +
    +
    +
    Description
    +
    Returns all Bisq transactions that exist in a Bitcoin block.
    +
    + +
    +
    + + + + GET Block Tip Height + + + +
    +
    Description
    +
    Returns the most recently processed Bitcoin block height processed by Bisq.
    +
    + +
    +
    + + + + GET Blocks + + + +
    +
    Description
    +
    Returns :length Bitcoin blocks that contain Bisq transactions, starting from :index.
    +
    + +
    +
    + +
    +
    +
  • + +
  • + Transactions + + + + + + GET Transaction + + +
    +
    Endpoint
    + GET /bisq/api/tx/:txid +
    +
    +
    Description
    +
    Returns details about a Bisq transaction.
    +
    + +
    +
    + + + + GET Transactions + + +
    Get Mempool Txids
    + +
    +
    Description
    +
    Returns :length of latest Bisq transactions, starting from :index.
    +
    + +
    +
    + +
    +
    +
  • +
    +
    diff --git a/frontend/src/app/components/api-docs/api-docs.component.ts b/frontend/src/app/components/api-docs/api-docs.component.ts index 7bb93c347..c017dcf1b 100644 --- a/frontend/src/app/components/api-docs/api-docs.component.ts +++ b/frontend/src/app/components/api-docs/api-docs.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { StateService } from 'src/app/services/state.service'; +import { Env, StateService } from 'src/app/services/state.service'; import { WebsocketService } from 'src/app/services/websocket.service'; import { Observable, merge, of } from 'rxjs'; import { SeoService } from 'src/app/services/seo.service'; @@ -13,60 +13,260 @@ export class ApiDocsComponent implements OnInit { hostname = document.location.hostname; network$: Observable; active = 0; + env: Env; code = { - recommendedFees: { + address: { codeSample: { - esModule: `const { %{1}: { fees } } = mempoolJS(); + esModule: `const { %{1}: { addresses } } = mempoolJS(); + const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC'; - const feesRecommended = await fees.getFeesRecommended(); - console.log(feesRecommended);`, - commonJS: `const { %{1}: { fees } } = mempoolJS(); + const myAddress = await addresses.getAddress({ address }); + console.log(myAddress); +`, + commonJS: `const { %{1}: { addresses } } = mempoolJS(); + const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC'; - const feesRecommended = await fees.getFeesRecommended(); - console.log(feesRecommended);`, - curl: `curl -X GET "https://mempool.space/api/v1/fees/recommended"`, + const myAddress = await addresses.getAddress({ address }); + console.log(myAddress);`, + curl: `curl -X GET "https://mempool.space/api/address/:address"`, }, responseSample: `{ - fastestFee: 60, - halfHourFee: 35, - hourFee: 20, - minimumFee: 1 + address: "1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC", + chain_stats: { + funded_txo_count: 765, + funded_txo_sum: 87749875807, + spent_txo_count: 765, + spent_txo_sum: 87749875807, + tx_count: 875 + }, + mempool_stats: { + funded_txo_count: 0, + funded_txo_sum: 0, + spent_txo_count: 0, + spent_txo_sum: 0, + tx_count: 0 + } }`, }, - mempoolBlocks: { + addressTransactions: { codeSample: { - esModule: `const { %{1}: { fees } } = mempoolJS(); + esModule: `const { %{1}: { addresses } } = mempoolJS(); + const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC'; - const feesMempoolBlocks = await fees.getFeesMempoolBlocks(); - console.log(feesMempoolBlocks);`, - commonJS: `const { %{1}: { fees } } = mempoolJS(); + const addressTxs = await addresses.getAddressTxs({ address }); + console.log(addressTxs); +`, + commonJS: `const { %{1}: { addresses } } = mempoolJS(); + const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC'; - const feesMempoolBlocks = await fees.getFeesMempoolBlocks(); - console.log(feesMempoolBlocks);`, - curl: `curl -X GET "https://mempool.space/api/v1/fees/mempool-blocks"`, + const addressTxs = await addresses.getAddressTxs({ address }); + console.log(addressTxs);`, + curl: `curl -X GET "https://mempool.space/api/address/:address/txs"`, }, responseSample: `[ { - blockSize: 1325044, - blockVSize: 974920, - nTx: 2314, - totalFees: 57600850, - medianFee: 59.73444413716814, - feeRange: [ - 14.091264667535855, - 27.88170055452865, - 50.123893805309734, - 59, - 60.267857142857146, - 65.47085201793722, - 100, - 474.934036939314 - ] + txid: "f39fbfd2482ac8a7174fe27caddd66aec05eec0d0e988ddf0de2136a416394c4", + version: 2, + locktime: 0, + vin: [ [Object] ], + vout: [ [Object], [Object] ], + size: 251, + weight: 1004, + fee: 8212, + status: { + confirmed: true, + block_height: 684536, + block_hash: "00000000000000000008df08f428ca4e8251ba9171d9060b056f1f94d4fefbc7", + block_time: 1621687336 + } }, ... ]`, }, + addressTransactionsChain: { + codeSample: { + esModule: `const { %{1}: { addresses } } = mempoolJS(); + const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC'; + + const addressTxsChain = await addresses.getAddressTxsChain({ address }); + console.log(addressTxsChain); +`, + commonJS: `const { %{1}: { addresses } } = mempoolJS(); + const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC'; + + const addressTxsChain = await addresses.getAddressTxsChain({ address }); + console.log(addressTxsChain);`, + curl: `curl -X GET "https://mempool.space/api/address/:address/txs/chain"`, + }, + responseSample: `[ + { + txid: "f39fbfd2482ac8a7174fe27caddd66aec05eec0d0e988ddf0de2136a416394c4", + version: 2, + locktime: 0, + vin: [ [Object] ], + vout: [ [Object], [Object] ], + size: 251, + weight: 1004, + fee: 8212, + status: { + confirmed: true, + block_height: 684536, + block_hash: "00000000000000000008df08f428ca4e8251ba9171d9060b056f1f94d4fefbc7", + block_time: 1621687336 + } + }, + ... +]`, + }, + addressTransactionsMempool: { + codeSample: { + esModule: `const { %{1}: { addresses } } = mempoolJS(); + const address = '1EnX7FFCzdBjpYnErSTaxaWyTND4m86ebK'; + + const addressTxsMempool = await addresses.getAddressTxsMempool({ address }); + console.log(addressTxsMempool);`, + commonJS: `const { %{1}: { addresses } } = mempoolJS(); + const address = '1EnX7FFCzdBjpYnErSTaxaWyTND4m86ebK'; + + const addressTxsMempool = await addresses.getAddressTxsMempool({ address }); + console.log(addressTxsMempool);`, + curl: `curl -X GET "https://mempool.space/api/address/:address/txs/mempool"`, + }, + responseSample: `[ + { + txid: "16cd9bbc6b62313a22d16671fa559aec6bf581df8b5853d37775c84b0fddfa90", + version: 2, + locktime: 0, + vin: [ [Object] ], + vout: [ [Object], [Object] ], + size: 226, + weight: 904, + fee: 6720, + status: { confirmed: false } + } +]`, + }, + addressUTXO: { + codeSample: { + esModule: `const { %{1}: { addresses } } = mempoolJS(); + const address = '1PQwtwajfHWyAkedss5utwBvULqbGocRpu'; + + const addressTxsUtxo = await addresses.getAddressTxsUtxo({ address }); + console.log(addressTxsUtxo); +`, + commonJS: `const { %{1}: { addresses } } = mempoolJS(); + const address = '1PQwtwajfHWyAkedss5utwBvULqbGocRpu'; + + const addressTxsUtxo = await addresses.getAddressTxsUtxo({ address }); + console.log(addressTxsUtxo);`, + curl: `curl -X GET "https://mempool.space/api/address/:address/utxo"`, + }, + responseSample: `[ + { + txid: 'a3e4a5ce88c9a73983aaba34243472377e478c3ca77258018222b813e1256307', + vout: 0, + status: { + confirmed: true, + block_height: 685094, + block_hash: '00000000000000000002af00dc86cfc99c8843c7a4906a1ec3b0a79712334d81', + block_time: 1622081201 + }, + value: 723191295 + }, + ... +]`, + }, + assets: { + codeSample: { + esModule: `const { liquid: { assets } } = mempoolJS(); + const asset_id = + '6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d'; + + const txs = await assets.getAsset({ asset_id }); + console.log(txs);`, + commonJS: `const { liquid: { assets } } = mempoolJS(); + const asset_id = + '6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d'; + + const asset = await assets.getAsset({ asset_id }); + console.log(asset);`, + curl: `curl -X GET "https://mempool.space/liquid/api/asset/:asset_id"`, + }, + responseSample: `{ + asset_id: "6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d", + chain_stats: { + tx_count: 3013, + peg_in_count: 1832, + peg_in_amount: 298054170045, + peg_out_count: 982, + peg_out_amount: 3905921326, + burn_count: 199, + burned_amount: 516003151 + }, + mempool_stats: { + tx_count: 0, + peg_in_count: 0, + peg_in_amount: 0, + peg_out_count: 0, + peg_out_amount: 0, + burn_count: 0, + burned_amount: 0 + } +}`, + }, + assetTransactions: { + codeSample: { + esModule: `const { liquid: { assets } } = mempoolJS(); + const asset_id = + '6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d'; + + const assetTxs = await assets.getAssetTxs({ asset_id, is_mempool: false }); + console.log(asset);`, + commonJS: `const { liquid: { assets } } = mempoolJS(); + const asset_id = + '6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d'; + + const assetTxs = await assets.getAssetTxs({ asset_id, is_mempool: false }); + console.log(asset);`, + curl: `curl -X GET "https://mempool.space/liquid/api/asset/:asset_id/txs[/mempool|/chain]"`, + }, + responseSample: `[ + { + txid: "74057c98274a5e529bd3fcf5b906b235937cea5aed7e43132856b402006068e5", + version: 2, + locktime: 0, + vin: [ [Object] ], + vout: [ [Object], [Object] ], + size: 975, + weight: 1461, + fee: 42, + status: { + confirmed: true, + block_height: 1337495, + block_hash: "e73bfee19c8e1b59967cb035f835347a78818f8639ee7ccd157d3372cdcd236e", + block_time: 1622328838 + } + }, + ... +]`, + }, + assetSupply: { + codeSample: { + esModule: `const { liquid: { assets } } = mempoolJS(); + + const txs = await transactions.getTxs({ index: 0, length: 1 }); + console.log(txs);`, + commonJS: `const { liquid: { assets } } = mempoolJS(); + const asset_id = + '6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d'; + + const assetSupply = await assets.getAssetSupply({ asset_id, decimal: false }); + console.log(assetSupply);`, + curl: `curl -X GET "https://mempool.space/liquid/api/asset/:asset_id/supply[/decimal]"`, + }, + responseSample: `293689745913`, + }, cpfp: { codeSample: { esModule: `const { %{1}: { fees } } = mempoolJS(); @@ -82,68 +282,6 @@ export class ApiDocsComponent implements OnInit { }, responseSample: ``, }, - mempool: { - codeSample: { - esModule: `const { %{1}: { mempool } } = mempoolJS(); - - const getMempool = await mempool.getMempool(); - console.log(getMempool);`, - commonJS: `const { %{1}: { mempool } } = mempoolJS(); - - const getMempool = await mempool.getMempool(); - console.log(getMempool);`, - curl: `curl -X GET "https://mempool.space/api/mempool"`, - }, - responseSample: `{ - count: 12262, - vsize: 18726518, - total_fee: 99943359, - fee_histogram: [ - [ 121.72455, 50049 ], - ... 142 more items - ] -}`, - }, - mempoolTxs: { - codeSample: { - esModule: `const { %{1}: { mempool } } = mempoolJS(); - - const getMempoolTxids = await mempool.getMempoolTxids(); - console.log(getMempoolTxids);`, - commonJS: `const { %{1}: { mempool } } = mempoolJS(); - - const getMempoolTxids = await mempool.getMempoolTxids(); - console.log(getMempoolTxids);`, - curl: `curl -X GET "https://mempool.space/api/mempool/txids"`, - }, - responseSample: `[ - '0873cc5e6c63704a27c63d5b86231db2a688d1e8dee466c8162aa6a398e719c5', - ... 12308 more items -]`, - }, - mempoolRecent: { - codeSample: { - esModule: `const { %{1}: { mempool } } = mempoolJS(); - - const getMempoolRecent = await mempool.getMempoolRecent(); - console.log(getMempoolRecent);`, - commonJS: ` - const { %{1}: { mempool } } = mempoolJS(); - - const getMempoolRecent = await mempool.getMempoolRecent(); - console.log(getMempoolRecent);`, - curl: `curl -X GET "https://mempool.space/api/mempool/recent"`, - }, - responseSample: `[ - { - txid: '4ab126bfde126a7824336080cbad0e6c3db0d39873b2093080ec5dc09205dca6', - fee: 8520, - vsize: 141, - value: 3428127849 - }, - ... -]`, - }, block: { codeSample: { esModule: `const { %{1}: { blocks } } = mempoolJS(); @@ -175,21 +313,21 @@ export class ApiDocsComponent implements OnInit { bits: 404111758, difficulty: 49402014931 }`, + }, + blockHeader: { + codeSample: { + esModule: `const { %{1}: { blocks } } = mempoolJS(); + +const blockHeader = await blocks.getBlockHeader({ hash: '0000000000000000000065bda8f8a88f2e1e00d9a6887a43d640e52a4c7660f2' }); +console.log(blockHeader);`, + commonJS: `const { %{1}: { blocks } } = mempoolJS(); + + const blockHeight = await blocks.getBlockHeight({ height: 0 }); + console.log(blockHeight);`, + curl: `curl -X GET "https://mempool.space/api/block/:hash/header"`, }, - blockHeader: { - codeSample: { - esModule: `const { %{1}: { blocks } } = mempoolJS(); - - const blockHeader = await blocks.getBlockHeader({ hash: '0000000000000000000065bda8f8a88f2e1e00d9a6887a43d640e52a4c7660f2' }); - console.log(blockHeader);`, - commonJS: `const { %{1}: { blocks } } = mempoolJS(); - - const blockHeight = await blocks.getBlockHeight({ height: 0 }); - console.log(blockHeight);`, - curl: `curl -X GET "https://mempool.space/api/block/:hash/header"`, - }, - responseSample: `040000202c04d4c450187d1da9b1bc23ba47d67fe028d22486fd0c00000000000000000059a3a33d4642c799af9f54a4dd351fff9130e6a89d4e251130c60064878616e906b5ea60ce9813173a25caf3`, - }, + responseSample: `040000202c04d4c450187d1da9b1bc23ba47d67fe028d22486fd0c00000000000000000059a3a33d4642c799af9f54a4dd351fff9130e6a89d4e251130c60064878616e906b5ea60ce9813173a25caf3`, + }, blockHeight: { codeSample: { esModule: `const { %{1}: { blocks } } = mempoolJS(); @@ -386,6 +524,160 @@ export class ApiDocsComponent implements OnInit { }, ... ]`, + }, + difficulty: { + codeSample: { + esModule: `const { bitcoin: { difficulty } } = mempoolJS(); + + const difficultyAdjustment = await difficulty.getDifficultyAdjustment(); + console.log(difficultyAdjustment);`, + commonJS: `const { bitcoin: { difficulty } } = mempoolJS(); + + const difficultyAdjustment = await difficulty.getDifficultyAdjustment(); + console.log(difficultyAdjustment);`, + curl: `curl -X GET "https://mempool.space/api/v1/difficulty-adjustment"`, + }, + responseSample: `{ + progressPercent: 44.397234501112074, + difficultyChange: 0.9845932018381687, + estimatedRetargetDate: 1627762478.9111245, + remainingBlocks: 1121, + remainingTime: 665977.6261244365, + previousRetarget: -4.807005268478962 +}`, + }, + mempoolBlocks: { + codeSample: { + esModule: `const { %{1}: { fees } } = mempoolJS(); + + const feesMempoolBlocks = await fees.getFeesMempoolBlocks(); + console.log(feesMempoolBlocks);`, + commonJS: `const { %{1}: { fees } } = mempoolJS(); + + const feesMempoolBlocks = await fees.getFeesMempoolBlocks(); + console.log(feesMempoolBlocks);`, + curl: `curl -X GET "https://mempool.space/api/v1/fees/mempool-blocks"`, + }, + responseSample: `[ + { + blockSize: 1325044, + blockVSize: 974920, + nTx: 2314, + totalFees: 57600850, + medianFee: 59.73444413716814, + feeRange: [ + 14.091264667535855, + 27.88170055452865, + 50.123893805309734, + 59, + 60.267857142857146, + 65.47085201793722, + 100, + 474.934036939314 + ] + }, + ... +]`, + }, + mempool: { + codeSample: { + esModule: `const { %{1}: { mempool } } = mempoolJS(); + + const getMempool = await mempool.getMempool(); + console.log(getMempool);`, + commonJS: `const { %{1}: { mempool } } = mempoolJS(); + + const getMempool = await mempool.getMempool(); + console.log(getMempool);`, + curl: `curl -X GET "https://mempool.space/api/mempool"`, + }, + responseSample: `{ + count: 12262, + vsize: 18726518, + total_fee: 99943359, + fee_histogram: [ + [ 121.72455, 50049 ], + ... 142 more items + ] +}`, + }, + mempoolTxs: { + codeSample: { + esModule: `const { %{1}: { mempool } } = mempoolJS(); + + const getMempoolTxids = await mempool.getMempoolTxids(); + console.log(getMempoolTxids);`, + commonJS: `const { %{1}: { mempool } } = mempoolJS(); + + const getMempoolTxids = await mempool.getMempoolTxids(); + console.log(getMempoolTxids);`, + curl: `curl -X GET "https://mempool.space/api/mempool/txids"`, + }, + responseSample: `[ + '0873cc5e6c63704a27c63d5b86231db2a688d1e8dee466c8162aa6a398e719c5', + ... 12308 more items +]`, + }, + mempoolRecent: { + codeSample: { + esModule: `const { %{1}: { mempool } } = mempoolJS(); + + const getMempoolRecent = await mempool.getMempoolRecent(); + console.log(getMempoolRecent);`, + commonJS: ` + const { %{1}: { mempool } } = mempoolJS(); + + const getMempoolRecent = await mempool.getMempoolRecent(); + console.log(getMempoolRecent);`, + curl: `curl -X GET "https://mempool.space/api/mempool/recent"`, + }, + responseSample: `[ + { + txid: '4ab126bfde126a7824336080cbad0e6c3db0d39873b2093080ec5dc09205dca6', + fee: 8520, + vsize: 141, + value: 3428127849 + }, + ... +]`, + }, + postTransaction: { + codeSample: { + esModule: `const { %{1}: { transactions } } = mempoolJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const postTx = await transactions.postTx({ txid }); + console.log(postTx); +`, + commonJS: `const { %{1}: { transactions } } = mempoolJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const postTx = await transactions.postTx({ txid }); + console.log(postTx);`, + curl: `curl -X POST "https://mempool.space/api/tx"`, + }, + responseSample: ``, + }, + recommendedFees: { + codeSample: { + esModule: `const { %{1}: { fees } } = mempoolJS(); + + const feesRecommended = await fees.getFeesRecommended(); + console.log(feesRecommended);`, + commonJS: `const { %{1}: { fees } } = mempoolJS(); + + const feesRecommended = await fees.getFeesRecommended(); + console.log(feesRecommended);`, + curl: `curl -X GET "https://mempool.space/api/v1/fees/recommended"`, + }, + responseSample: `{ + fastestFee: 60, + halfHourFee: 35, + hourFee: 20, + minimumFee: 1 +}`, }, transaction: { codeSample: { @@ -615,481 +907,6 @@ responseSample: `{ block_time: 1435754650 }`, }, - postTransaction: { - codeSample: { - esModule: `const { %{1}: { transactions } } = mempoolJS(); - const txHex = '0200000001fd5b5fcd1cb066c27cfc9fda5428b9be850b81ac440ea51f1ddba2f987189ac1010000008a4730440220686a40e9d2dbffeab4ca1ff66341d06a17806767f12a1fc4f55740a7af24c6b5022049dd3c9a85ac6c51fecd5f4baff7782a518781bbdd94453c8383755e24ba755c01410436d554adf4a3eb03a317c77aa4020a7bba62999df633bba0ea8f83f48b9e01b0861d3b3c796840f982ee6b14c3c4b7ad04fcfcc3774f81bff9aaf52a15751fedfdffffff02416c00000000000017a914bc791b2afdfe1e1b5650864a9297b20d74c61f4787d71d0000000000001976a9140a59837ccd4df25adc31cdad39be6a8d97557ed688ac00000000'; - - const postTxid = await transactions.postTx({ txHex }); - console.log(postTxid); -`, - commonJS: `const { %{1}: { transactions } } = mempoolJS(); - const txHex = '0200000001fd5b5fcd1cb066c27cfc9fda5428b9be850b81ac440ea51f1ddba2f987189ac1010000008a4730440220686a40e9d2dbffeab4ca1ff66341d06a17806767f12a1fc4f55740a7af24c6b5022049dd3c9a85ac6c51fecd5f4baff7782a518781bbdd94453c8383755e24ba755c01410436d554adf4a3eb03a317c77aa4020a7bba62999df633bba0ea8f83f48b9e01b0861d3b3c796840f982ee6b14c3c4b7ad04fcfcc3774f81bff9aaf52a15751fedfdffffff02416c00000000000017a914bc791b2afdfe1e1b5650864a9297b20d74c61f4787d71d0000000000001976a9140a59837ccd4df25adc31cdad39be6a8d97557ed688ac00000000'; - - const postTxid = await transactions.postTx({ txHex }); - console.log(postTxid);`, - curl: `curl -X POST -d 0200000001fd5b5fcd1cb066c27cfc9fda5428b9be850b81ac440ea51f1ddba2f987189ac1010000008a4730440220686a40e9d2dbffeab4ca1ff66341d06a17806767f12a1fc4f55740a7af24c6b5022049dd3c9a85ac6c51fecd5f4baff7782a518781bbdd94453c8383755e24ba755c01410436d554adf4a3eb03a317c77aa4020a7bba62999df633bba0ea8f83f48b9e01b0861d3b3c796840f982ee6b14c3c4b7ad04fcfcc3774f81bff9aaf52a15751fedfdffffff02416c00000000000017a914bc791b2afdfe1e1b5650864a9297b20d74c61f4787d71d0000000000001976a9140a59837ccd4df25adc31cdad39be6a8d97557ed688ac00000000 "https://mempool.space/api/tx"`, - }, - responseSample: ``, - }, - address: { - codeSample: { - esModule: `const { %{1}: { addresses } } = mempoolJS(); - const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC'; - - const myAddress = await addresses.getAddress({ address }); - console.log(myAddress); -`, - commonJS: `const { %{1}: { addresses } } = mempoolJS(); - const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC'; - - const myAddress = await addresses.getAddress({ address }); - console.log(myAddress);`, - curl: `curl -X GET "https://mempool.space/api/address/:address"`, - }, - responseSample: `{ - address: "1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC", - chain_stats: { - funded_txo_count: 765, - funded_txo_sum: 87749875807, - spent_txo_count: 765, - spent_txo_sum: 87749875807, - tx_count: 875 - }, - mempool_stats: { - funded_txo_count: 0, - funded_txo_sum: 0, - spent_txo_count: 0, - spent_txo_sum: 0, - tx_count: 0 - } -}`, - }, - addressTransactions: { - codeSample: { - esModule: `const { %{1}: { addresses } } = mempoolJS(); - const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC'; - - const addressTxs = await addresses.getAddressTxs({ address }); - console.log(addressTxs); -`, - commonJS: `const { %{1}: { addresses } } = mempoolJS(); - const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC'; - - const addressTxs = await addresses.getAddressTxs({ address }); - console.log(addressTxs);`, - curl: `curl -X GET "https://mempool.space/api/address/:address/txs"`, - }, - responseSample: `[ - { - txid: "f39fbfd2482ac8a7174fe27caddd66aec05eec0d0e988ddf0de2136a416394c4", - version: 2, - locktime: 0, - vin: [ [Object] ], - vout: [ [Object], [Object] ], - size: 251, - weight: 1004, - fee: 8212, - status: { - confirmed: true, - block_height: 684536, - block_hash: "00000000000000000008df08f428ca4e8251ba9171d9060b056f1f94d4fefbc7", - block_time: 1621687336 - } - }, - ... -]`, - }, - addressTransactionsChain: { - codeSample: { - esModule: `const { %{1}: { addresses } } = mempoolJS(); - const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC'; - - const addressTxsChain = await addresses.getAddressTxsChain({ address }); - console.log(addressTxsChain); -`, - commonJS: `const { %{1}: { addresses } } = mempoolJS(); - const address = '1wizSAYSbuyXbt9d8JV8ytm5acqq2TorC'; - - const addressTxsChain = await addresses.getAddressTxsChain({ address }); - console.log(addressTxsChain);`, - curl: `curl -X GET "https://mempool.space/api/address/:address/txs/chain"`, - }, - responseSample: `[ - { - txid: "f39fbfd2482ac8a7174fe27caddd66aec05eec0d0e988ddf0de2136a416394c4", - version: 2, - locktime: 0, - vin: [ [Object] ], - vout: [ [Object], [Object] ], - size: 251, - weight: 1004, - fee: 8212, - status: { - confirmed: true, - block_height: 684536, - block_hash: "00000000000000000008df08f428ca4e8251ba9171d9060b056f1f94d4fefbc7", - block_time: 1621687336 - } - }, - ... -]`, - }, - addressTransactionsMempool: { - codeSample: { - esModule: `const { %{1}: { addresses } } = mempoolJS(); - const address = '1EnX7FFCzdBjpYnErSTaxaWyTND4m86ebK'; - - const addressTxsMempool = await addresses.getAddressTxsMempool({ address }); - console.log(addressTxsMempool);`, - commonJS: `const { %{1}: { addresses } } = mempoolJS(); - const address = '1EnX7FFCzdBjpYnErSTaxaWyTND4m86ebK'; - - const addressTxsMempool = await addresses.getAddressTxsMempool({ address }); - console.log(addressTxsMempool);`, - curl: `curl -X GET "https://mempool.space/api/address/:address/txs/mempool"`, - }, - responseSample: `[ - { - txid: "16cd9bbc6b62313a22d16671fa559aec6bf581df8b5853d37775c84b0fddfa90", - version: 2, - locktime: 0, - vin: [ [Object] ], - vout: [ [Object], [Object] ], - size: 226, - weight: 904, - fee: 6720, - status: { confirmed: false } - } -]`, - }, - addressUTXO: { - codeSample: { - esModule: `const { %{1}: { addresses } } = mempoolJS(); - const address = '1PQwtwajfHWyAkedss5utwBvULqbGocRpu'; - - const addressTxsUtxo = await addresses.getAddressTxsUtxo({ address }); - console.log(addressTxsUtxo); -`, - commonJS: `const { %{1}: { addresses } } = mempoolJS(); - const address = '1PQwtwajfHWyAkedss5utwBvULqbGocRpu'; - - const addressTxsUtxo = await addresses.getAddressTxsUtxo({ address }); - console.log(addressTxsUtxo);`, - curl: `curl -X GET "https://mempool.space/api/address/:address/utxo"`, - }, - responseSample: `[ - { - txid: 'a3e4a5ce88c9a73983aaba34243472377e478c3ca77258018222b813e1256307', - vout: 0, - status: { - confirmed: true, - block_height: 685094, - block_hash: '00000000000000000002af00dc86cfc99c8843c7a4906a1ec3b0a79712334d81', - block_time: 1622081201 - }, - value: 723191295 - }, - ... -]`, - }, - bisqAddress: { - codeSample: { - esModule: `const { bisq: { addresses } } = mempoolJS(); - const address = 'B1DgwRN92rdQ9xpEVCdXRfgeqGw9X4YtrZz'; - - const myAddress = await addresses.getAddress({ address }); - console.log(myAddress); -`, - commonJS: `const { bisq: { addresses } } = mempoolJS(); - const address = 'B1DgwRN92rdQ9xpEVCdXRfgeqGw9X4YtrZz'; - - const myAddress = await addresses.getAddress({ address }); - console.log(myAddress);`, - curl: `curl -X GET "https://mempool.space/api/address/:address"`, - }, - responseSample: `[] - { - "txVersion": "1", - "id": "d6f0a6fd191ac907ff88fc51af91cae8d50e596a846952ffa0ad0cea84eedc9a", - "blockHeight": 679129, - "blockHash": "00000000000000000001328850b0482312325f7f4abd5457e45d37cad664675d", - "time": 1618369311000, - "inputs": [ ... ], - "outputs": [ ... ], - "txType": "PAY_TRADE_FEE", - "txTypeDisplayString": "Pay trade fee", - "burntFee": 6, - "invalidatedBsq": 0, - "unlockBlockHeight": 0 - }, - ... -]`, - }, - bisqBlock: { - codeSample: { - esModule: `const { bisq: { blocks } } = mempoolJS(); - const hash = '000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d'; - - const block = await blocks.getBlock({ hash }); - console.log(block); -`, - commonJS: `const { bisq: { blocks } } = mempoolJS(); - const hash = '000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d'; - - const block = await blocks.getBlock({ hash }); - console.log(block);`, - curl: `curl -X GET "https://mempool.space/api/block/:hash"`, - }, - responseSample: `{ - height: 571747, - time: 1555340856000, - hash: "000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d", - previousBlockHash: "0000000000000000001b8c271a4477a28d4ea7d4d4d1add6d96f386e3f151709", - txs: [ - { - txVersion: "1", - id: "4b5417ec5ab6112bedf539c3b4f5a806ed539542d8b717e1c4470aa3180edce5", - blockHeight: 571747, - blockHash: "000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d", - time: 1555340856000, - inputs: [], - outputs: [Array], - txType: "GENESIS", - txTypeDisplayString: "Genesis", - burntFee: 0, - invalidatedBsq: 0, - unlockBlockHeight: 0 - } - ] -}`, - }, - bisqBlockTipHeight: { - codeSample: { - esModule: `const { bisq: { blocks } } = mempoolJS(); - const hash = '000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d'; - - const myBlocksHeight = await blocks.getBlocksTipHeight({ - index: 0, - length: 1, - }); - console.log(myBlocksHeight); -`, - commonJS: `const { bisq: { blocks } } = mempoolJS(); - const hash = '000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d'; - - const myBlocksHeight = await blocks.getBlocksTipHeight({ - index: 0, - length: 1, - }); - console.log(myBlocksHeight);`, - curl: `curl -X GET "https://mempool.space/api/blocks/tip/height"`, - }, - responseSample: `685657`, - }, - bisqBlockIndex: { - codeSample: { - esModule: `const { bisq: { blocks } } = mempoolJS(); - - const myBlocks = await blocks.getBlocks({ index: 0, length: 1 }); - console.log(myBlocks); -`, - commonJS: `const { bisq: { blocks } } = mempoolJS(); - - const myBlocks = await blocks.getBlocks({ index: 0, length: 1 }); - console.log(myBlocks);`, - curl: `curl -X GET "https://mempool.space/api/blocks/:index/:length"`, - }, - responseSample: `[ - { - height: 685656, - time: 1622468887000, - hash: "00000000000000000004c7046979024bd8e8f07389ca53f4f1d7dcf84eefdb21", - previousBlockHash: "0000000000000000000bf982d024e5afa38be8fc08c3a9b6a2bd89dbd18de832", - txs: [ - [Object], [Object], - [Object], [Object], - [Object], [Object], - [Object], [Object], - [Object], [Object], - [Object] - ] - } -]`, - }, - bisqStats: { - codeSample: { - esModule: `const { bisq: { statistics } } = mempoolJS(); - const hash = '000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d'; - - const stats = await statistics.getStats(); - console.log(stats); -`, - commonJS: `const { bisq: { statistics } } = mempoolJS(); - const hash = '000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d'; - - const stats = await statistics.getStats(); - console.log(stats);`, - curl: `curl -X GET "https://mempool.space/api/stats"`, - }, - responseSample: `{ - fastestFee: 88, - halfHourFee: 49, - hourFee: 29, - minimumFee: 1 -}`, - }, - bisqTransaction: { - codeSample: { - esModule: `const { bisq: { transactions } } = mempoolJS(); - const txid = '4b5417ec5ab6112bedf539c3b4f5a806ed539542d8b717e1c4470aa3180edce5'; - - const tx = await transactions.getTx({ txid }); - console.log(tx); -`, - commonJS: `const { bisq: { transactions } } = mempoolJS(); - const txid = '4b5417ec5ab6112bedf539c3b4f5a806ed539542d8b717e1c4470aa3180edce5'; - - const tx = await transactions.getTx({ txid }); - console.log(tx);`, - curl: `curl -X GET "https://mempool.space/api/tx/:txid"`, - }, - responseSample: `{ - "txVersion":"1", - "id":"4b5417ec5ab6112bedf539c3b4f5a806ed539542d8b717e1c4470aa3180edce5", - "blockHeight":571747, - "blockHash":"000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d", - "time":1555340856000, - "inputs": [ [Object], [Object] ], - "outputs": [ [Object], [Object] ], - "txType":"GENESIS", - "txTypeDisplayString":"Genesis", - "burntFee":0, - "invalidatedBsq":0, - "unlockBlockHeight":0 -}`, - }, - bisqTransactions: { - codeSample: { - esModule: `const { bisq: { transactions } } = mempoolJS(); - - const txs = await transactions.getTxs({ index: 0, length: 1 }); - console.log(txs); -`, - commonJS: `const { bisq: { transactions } } = mempoolJS(); - - const txs = await transactions.getTxs({ index: 0, length: 1 }); - console.log(txs);`, - curl: `curl -X GET "https://mempool.space/api/txs/:index/:length"`, - }, - responseSample: `[ - { - txVersion: "1", - id: "084e94afb67df0e6dff2e9ae6913d5ccb58f3b2dab0c4543a7c90c33b70c9bed", - blockHeight: 685656, - blockHash: "00000000000000000004c7046979024bd8e8f07389ca53f4f1d7dcf84eefdb21", - time: 1622468887000, - inputs: [ [Object], [Object] ], - outputs: [ [Object], [Object], [Object] ], - txType: "PAY_TRADE_FEE", - txTypeDisplayString: "Pay trade fee", - burntFee: 57, - invalidatedBsq: 0, - unlockBlockHeight: 0 - } -]`, - }, - assets: { - codeSample: { - esModule: `const { liquid: { assets } } = mempoolJS(); - const asset_id = - '6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d'; - - const txs = await assets.getAsset({ asset_id }); - console.log(txs);`, - commonJS: `const { liquid: { assets } } = mempoolJS(); - const asset_id = - '6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d'; - - const asset = await assets.getAsset({ asset_id }); - console.log(asset);`, - curl: `curl -X GET "https://mempool.space/api/asset/:asset_id"`, - }, - responseSample: `{ - asset_id: "6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d", - chain_stats: { - tx_count: 3013, - peg_in_count: 1832, - peg_in_amount: 298054170045, - peg_out_count: 982, - peg_out_amount: 3905921326, - burn_count: 199, - burned_amount: 516003151 - }, - mempool_stats: { - tx_count: 0, - peg_in_count: 0, - peg_in_amount: 0, - peg_out_count: 0, - peg_out_amount: 0, - burn_count: 0, - burned_amount: 0 - } -}`, - }, - assetTransactions: { - codeSample: { - esModule: `const { liquid: { assets } } = mempoolJS(); - const asset_id = - '6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d'; - - const assetTxs = await assets.getAssetTxs({ asset_id, is_mempool: false }); - console.log(asset);`, - commonJS: `const { liquid: { assets } } = mempoolJS(); - const asset_id = - '6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d'; - - const assetTxs = await assets.getAssetTxs({ asset_id, is_mempool: false }); - console.log(asset);`, - curl: `curl -X GET "https://mempool.space/api/asset/:asset_id/txs[/mempool|/chain]"`, - }, - responseSample: `[ - { - txid: "74057c98274a5e529bd3fcf5b906b235937cea5aed7e43132856b402006068e5", - version: 2, - locktime: 0, - vin: [ [Object] ], - vout: [ [Object], [Object] ], - size: 975, - weight: 1461, - fee: 42, - status: { - confirmed: true, - block_height: 1337495, - block_hash: "e73bfee19c8e1b59967cb035f835347a78818f8639ee7ccd157d3372cdcd236e", - block_time: 1622328838 - } - }, - ... -]`, - }, - assetSupply: { - codeSample: { - esModule: `const { liquid: { assets } } = mempoolJS(); - - const txs = await transactions.getTxs({ index: 0, length: 1 }); - console.log(txs); -`, - commonJS: `const { liquid: { assets } } = mempoolJS(); - const asset_id = - '6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d'; - - const assetSupply = await assets.getAssetSupply({ asset_id, decimal: false }); - console.log(assetSupply);`, - curl: `curl -X GET "https://mempool.space/api/asset/:asset_id/supply[/decimal]"`, - }, - responseSample: `293689745913`, - }, websocket: { codeSample: { esModule: `const { bitcoin: { websocket } } = mempoolJS(); @@ -1138,28 +955,1759 @@ responseSample: `{ }, responseSample: ``, }, - - difficulty: { + liquidAssets: { codeSample: { - esModule:`const { bitcoin: { difficulty } } = mempoolJS(); + esModule: `const { assets } = liquidJS(); + const asset_id = + '6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d'; - const difficultyAdjustment = await difficulty.getDifficultyAdjustment(); - console.log(difficultyAdjustment);`, - commonJS:`const { bitcoin: { difficulty } } = mempoolJS(); + const txs = await assets.getAsset({ asset_id }); + console.log(txs);`, + commonJS: `const { assets } = liquidJS(); + const asset_id = + '6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d'; - const difficultyAdjustment = await difficulty.getDifficultyAdjustment(); - console.log(difficultyAdjustment);`, - curl: `curl -X GET "https://mempool.space/api/v1/difficulty-adjustment"`, + const asset = await assets.getAsset({ asset_id }); + console.log(asset);`, + curl: `curl -X GET "https://liquid.network/api/asset/:asset_id"`, }, responseSample: `{ - progressPercent: 44.397234501112074, - difficultyChange: 0.9845932018381687, - estimatedRetargetDate: 1627762478.9111245, - remainingBlocks: 1121, - remainingTime: 665977.6261244365, - previousRetarget: -4.807005268478962 + asset_id: "6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d", + chain_stats: { + tx_count: 3013, + peg_in_count: 1832, + peg_in_amount: 298054170045, + peg_out_count: 982, + peg_out_amount: 3905921326, + burn_count: 199, + burned_amount: 516003151 + }, + mempool_stats: { + tx_count: 0, + peg_in_count: 0, + peg_in_amount: 0, + peg_out_count: 0, + peg_out_amount: 0, + burn_count: 0, + burned_amount: 0 + } }`, }, + liquidAssetTransactions: { + codeSample: { + esModule: `const { assets } = liquidJS(); + const asset_id = + '6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d'; + + const assetTxs = await assets.getAssetTxs({ asset_id, is_mempool: false }); + console.log(asset);`, + commonJS: `const { assets } = liquidJS(); + const asset_id = + '6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d'; + + const assetTxs = await assets.getAssetTxs({ asset_id, is_mempool: false }); + console.log(asset);`, + curl: `curl -X GET "https://liquid.network/api/asset/:asset_id/txs[/mempool|/chain]"`, + }, + responseSample: `[ + { + txid: "74057c98274a5e529bd3fcf5b906b235937cea5aed7e43132856b402006068e5", + version: 2, + locktime: 0, + vin: [ [Object] ], + vout: [ [Object], [Object] ], + size: 975, + weight: 1461, + fee: 42, + status: { + confirmed: true, + block_height: 1337495, + block_hash: "e73bfee19c8e1b59967cb035f835347a78818f8639ee7ccd157d3372cdcd236e", + block_time: 1622328838 + } + }, + ... +]`, + }, + liquidAssetSupply: { + codeSample: { + esModule: `const { assets } = liquidJS(); + + const txs = await transactions.getTxs({ index: 0, length: 1 }); + console.log(txs);`, + commonJS: `const { assets } = liquidJS(); + const asset_id = + '6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d'; + + const assetSupply = await assets.getAssetSupply({ asset_id, decimal: false }); + console.log(assetSupply);`, + curl: `curl -X GET "https://liquid.network/api/asset/:asset_id/supply[/decimal]"`, + }, + responseSample: `293689745913`, + }, + liquidRecommendedFees: { + codeSample: { + esModule: `const { fees } = liquidJS(); + + const feesRecommended = await fees.getFeesRecommended(); + console.log(feesRecommended);`, + commonJS: `const { fees } = liquidJS(); + + const feesRecommended = await fees.getFeesRecommended(); + console.log(feesRecommended);`, + curl: `curl -X GET "https://liquid.network/api/v1/fees/recommended"`, + }, + responseSample: `{ + fastestFee: 0.1, + halfHourFee: 0.1, + hourFee: 0.1, + minimumFee: 1 +}`, + }, + liquidMempoolBlocks: { + codeSample: { + esModule: `const { fees } = liquidJS(); + + const feesMempoolBlocks = await fees.getFeesMempoolBlocks(); + console.log(feesMempoolBlocks);`, + commonJS: `const { fees } = liquidJS(); + + const feesMempoolBlocks = await fees.getFeesMempoolBlocks(); + console.log(feesMempoolBlocks);`, + curl: `curl -X GET "https://liquid.network/api/v1/fees/mempool-blocks"`, + }, + responseSample: `[ + { + blockSize: 4599, + blockVSize: 1331, + nTx: 1, + totalFees: 579, + medianFee: 0.4349295774647887, + feeRange: [ + 0.4349295774647887, + 0.4349295774647887, + 0.4349295774647887, + 0.4349295774647887, + 0.4349295774647887, + 0.4349295774647887, + 0.4349295774647887, + 0.4349295774647887 + ] + } +]`, + }, + liquidCpfp: { + codeSample: { + esModule: `const { fees } = liquidJS(); + const txid = 'txid'; + + const feesCPFP = await fees.getCPFP({ txid }); + console.log(feesCPFP);`, + commonJS: `const { fees } = liquidJS(); + const txid = 'txid'; + + const feesCPFP = await fees.getCPFP({ txid });`, + curl: `curl -X GET "https://liquid.network/api/v1/cpfp/:txid"`, + }, + responseSample: ``, + }, + liquidMempool: { + codeSample: { + esModule: `const { mempool } = liquidJS(); + + const getMempool = await mempool.getMempool(); + console.log(getMempool);`, + commonJS: `const { mempool } = liquidJS(); + + const getMempool = await mempool.getMempool(); + console.log(getMempool);`, + curl: `curl -X GET "https://liquid.network/api/mempool"`, + }, + responseSample: `{ + count: 2, + vsize: 3895, + total_fee: 836, + fee_histogram: [ + [ + 0.10023401, + 3895 + ] + ] +}`, + }, + liquidMempoolTxs: { + codeSample: { + esModule: `const { mempool } = liquidJS(); + + const getMempoolTxids = await mempool.getMempoolTxids(); + console.log(getMempoolTxids);`, + commonJS: `const { mempool } = liquidJS(); + + const getMempoolTxids = await mempool.getMempoolTxids(); + console.log(getMempoolTxids);`, + curl: `curl -X GET "https://liquid.network/api/mempool/txids"`, + }, + responseSample: `[ + '0873cc5e6c63704a27c63d5b86231db2a688d1e8dee466c8162aa6a398e719c5', + ... 12308 more items +]`, + }, + liquidMempoolRecent: { + codeSample: { + esModule: `const { mempool } = liquidJS(); + + const getMempoolRecent = await mempool.getMempoolRecent(); + console.log(getMempoolRecent);`, + commonJS: ` + const { mempool } = liquidJS(); + + const getMempoolRecent = await mempool.getMempoolRecent(); + console.log(getMempoolRecent);`, + curl: `curl -X GET "https://liquid.network/api/mempool/recent"`, + }, + responseSample: `[ + { + txid: '4ab126bfde126a7824336080cbad0e6c3db0d39873b2093080ec5dc09205dca6', + fee: 8520, + vsize: 141, + value: 3428127849 + }, + ... +]`, + }, + liquidBlock: { + codeSample: { + esModule: `const { blocks } = liquidJS(); + const hash = + '000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce'; + + const block = await blocks.getBlock({ hash }); + console.log(block);`, + commonJS: `const { blocks } = liquidJS(); + const hash = + '000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce'; + + const block = await blocks.getBlock({ hash }); + console.log(block);`, + curl: `curl -X GET "https://liquid.network/api/block/:hash"`, + }, + responseSample: `{ + id: "000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce", + height: 363366, + version: 2, + timestamp: 1435766771, + tx_count: 494, + size: 286494, + weight: 1145976, + merkle_root: "9d3cb87bf05ebae366b4262ed5f768ce8c62fc385c3886c9cb097647b04b686c", + previousblockhash: "000000000000000010c545b6fa3ef1f7cf45a2a8760b1ee9f2e89673218207ce", + mediantime: 1435763435, + nonce: 2892644888, + bits: 404111758, + difficulty: 49402014931 + }`, + }, + liquidBlockHeader: { + codeSample: { + esModule: `const { blocks } = liquidJS(); + + const blockHeader = await blocks.getBlockHeader({ hash: '0000000000000000000065bda8f8a88f2e1e00d9a6887a43d640e52a4c7660f2' }); + console.log(blockHeader);`, + commonJS: `const { blocks } = liquidJS(); + + const blockHeight = await blocks.getBlockHeight({ height: 0 }); + console.log(blockHeight);`, + curl: `curl -X GET "https://liquid.network/api/block/:hash/header"`, + }, + responseSample: `040000202c04d4c450187d1da9b1bc23ba47d67fe028d22486fd0c00000000000000000059a3a33d4642c799af9f54a4dd351fff9130e6a89d4e251130c60064878616e906b5ea60ce9813173a25caf3`, + }, + liquidBlockHeight: { + codeSample: { + esModule: `const { blocks } = liquidJS(); + + const blockHeight = await blocks.getBlockHeight({ height: 0 }); + console.log(blockHeight); +`, + commonJS: `const { blocks } = liquidJS(); + + const blockHeight = await blocks.getBlockHeight({ height: 0 }); + console.log(blockHeight);`, + curl: `curl -X GET "https://liquid.network/api/block-height/:height"`, + }, + responseSample: `000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f`, + }, + liquidBlockRaw: { + codeSample: { + esModule: `const { blocks } = liquidJS(); + const hash = + '000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce'; + + const blockRaw = await blocks.getBlockRaw({ hash }); + console.log(blockRaw); +`, + commonJS: `const { blocks } = liquidJS(); + const hash = + '000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce'; + + const blockRaw = await blocks.getBlockRaw({ hash }); + console.log(blockRaw);`, + curl: `curl -X GET "https://liquid.network/api/block/:hash/raw"`, + }, + responseSample: ``, + }, + liquidBlockStatus: { + codeSample: { + esModule: `const { blocks } = liquidJS(); + const hash = + '000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce'; + + const blockStatus = await blocks.getBlockStatus({ hash }); + console.log(blockStatus); +`, + commonJS: `const { blocks } = liquidJS(); + const hash = + '000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce'; + + const blockStatus = await blocks.getBlockStatus({ hash }); + console.log(blockStatus);`, + curl: `curl -X GET "https://liquid.network/api/block/:hash/status"`, + }, + responseSample: `{ + in_best_chain: true, + height: 363366, + next_best: "000000000000000015eb17c390eb4a920fc745332fda6a62179a6afe0d6a6548" +}`, + }, + liquidBlockTipHeight: { + codeSample: { + esModule: `const { blocks } = liquidJS(); + const blocksTipHeight = await blocks.getBlocksTipHeight(); + console.log(blocksTipHeight); +`, + commonJS: `const { blocks } = liquidJS(); + + const blocksTipHeight = await blocks.getBlocksTipHeight(); + console.log(blocksTipHeight);`, + curl: `curl -X GET "https://liquid.network/api/blocks/tip/height"`, + }, + responseSample: `685442`, + }, + liquidBlockTipHash: { + codeSample: { + esModule: `const { blocks } = liquidJS(); + const blocksTipHash = await blocks.getBlocksTipHash(); + console.log(blocksTipHash); +`, + commonJS: `const { blocks } = liquidJS(); + + const blocksTipHash = await blocks.getBlocksTipHash(); + console.log(blocksTipHash);`, + curl: `curl -X GET "https://liquid.network/api/blocks/tip/hash"`, + }, + responseSample: `00000000000000000009165c5600f52cb7436b40f3ad48e996de63d63e1a124e`, + }, + liquidBlockTxId: { + codeSample: { + esModule: `const { blocks } = liquidJS(); + const hash = + '000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce'; + + const blockTxid = await blocks.getBlockTxid({ hash, index: 218 }); + console.log(blockTxid); +`, + commonJS: `const { blocks } = liquidJS(); + const hash = + '000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce'; + + const blockTxid = await blocks.getBlockTxid({ hash, index: 218 }); + console.log(blockTxid);`, + curl: `curl -X GET "https://liquid.network/api/block/:hash/txid/:index"`, + }, + responseSample: `0fa6da60e484941f255cbb025c3d6440e5a7e970119e899b4065c7999360e406`, + }, + liquidBlockTxIds: { + codeSample: { + esModule: `const { blocks } = liquidJS(); + const hash = + '000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce'; + + const blockTxids = await blocks.getBlockTxids({ hash }); + console.log(blockTxids); +`, + commonJS: `const { blocks } = liquidJS(); + const hash = + '000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce'; + + const blockTxids = await blocks.getBlockTxids({ hash }); + console.log(blockTxids);`, + curl: `curl -X GET "https://liquid.network/api/block/:hash/txids"`, + }, + responseSample: `[ + "cfe624ccdd8010cf78dbedd1b25e1ff601b470c4d7d90fa9fc8c1bcc5cdc6e0e", + "a5ef89881bd5103f223a0fa285dfc75f4718974cb792cf85e623a7de05801bc9", + "94e8c35414db17cd10efa0ac4115e086edb168ba7bd86e737e5b8cab96821580", + ... +]`, + }, + liquidBlockTxs: { + codeSample: { + esModule: `const { blocks } = liquidJS(); + const hash = + '000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce'; + + const blockTxs = await blocks.getBlockTxs({ hash }); + console.log(blockTxs); +`, + commonJS: `const { blocks } = liquidJS(); + const hash = + '000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce'; + + const blockTxs = await blocks.getBlockTxs({ hash }); + console.log(blockTxs);`, + curl: `curl -X GET "https://liquid.network/api/block/:hash/txs[/:start_index]"`, + }, + responseSample: `[ + { + txid: "cfe624ccdd8010cf78dbedd1b25e1ff601b470c4d7d90fa9fc8c1bcc5cdc6e0e", + version: 1, + locktime: 0, + vin: [ [Object] ], + vout: [ [Object] ], + size: 102, + weight: 408, + fee: 0, + status: { + confirmed: true, + block_height: 363366, + block_hash: "000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce", + block_time: 1435766771 + } + }, + ... +]`, + }, + liquidBlocks: { + codeSample: { + esModule: `const { blocks } = liquidJS(); + + const getBlocks = await blocks.getBlocks({ start_height: 9999 }); + console.log(getBlocks); +`, + commonJS: `const { blocks } = liquidJS(); + + const getBlocks = await blocks.getBlocks({ start_height: 9999 }); + console.log(getBlocks);`, + curl: `curl -X GET "https://liquid.network/api/blocks[/:start_height]"`, + }, + responseSample: `[ + { + id: '00000000fbc97cc6c599ce9c24dd4a2243e2bfd518eda56e1d5e47d29e29c3a7', + height: 9999, + version: 1, + timestamp: 1238987491, + tx_count: 1, + size: 216, + weight: 864, + merkle_root: '5012c1d2a46d5684aa0331f0d8a900767c86c0fd83bb632f357b1ea11fa69179', + previousblockhash: '000000003dd32df94cfafd16e0a8300ea14d67dcfee9e1282786c2617b8daa09', + mediantime: 1238984702, + nonce: 3568610608, + bits: 486604799, + difficulty: 1 + }, + ... +]`, + }, + liquidTransaction: { + codeSample: { + esModule: `const { transactions } = liquidJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const tx = await transactions.getTx({ txid }); + console.log(tx); +`, + commonJS: `const { transactions } = liquidJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const tx = await transactions.getTx({ txid }); + console.log(tx);`, + curl: `curl -X GET "https://liquid.network/api/tx/:txid"`, + }, + responseSample: `{ + txid: "15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521", + version: 1, + locktime: 0, + vin: [ + { + txid: "1fdfed84588cb826b876cd761ecebcf1726453437f0a6826e82ed54b2807a036", + vout: 12, + prevout: [Object], + scriptsig: "483045022100bcdf40fb3b5ebfa2c158ac8d1a41c03eb3dba4e180b00e81836bafd56d946efd022005cc40e35022b614275c1e485c409599667cbd41f6e5d78f421cb260a020a24f01210255ea3f53ce3ed1ad2c08dfc23b211b15b852afb819492a9a0f3f99e5747cb5f0", + scriptsig_asm: "OP_PUSHBYTES_72 3045022100bcdf40fb3b5ebfa2c158ac8d1a41c03eb3dba4e180b00e81836bafd56d946efd022005cc40e35022b614275c1e485c409599667cbd41f6e5d78f421cb260a020a24f01 OP_PUSHBYTES_33 0255ea3f53ce3ed1ad2c08dfc23b211b15b852afb819492a9a0f3f99e5747cb5f0", + is_coinbase: false, + sequence: 4294967295 + }, + ... + ], + vout: [ + { + scriptpubkey: "76a91472d52e2f5b88174c35ee29844cce0d6d24b921ef88ac", + scriptpubkey_asm: "OP_DUP OP_HASH160 OP_PUSHBYTES_20 72d52e2f5b88174c35ee29844cce0d6d24b921ef OP_EQUALVERIFY OP_CHECKSIG", + scriptpubkey_type: "p2pkh", + scriptpubkey_address: "1BUBQuPV3gEV7P2XLNuAJQjf5t265Yyj9t", + value: 1240000000 + }, + ... + ], + size: 884, + weight: 3536, + fee: 20000, + status: { + confirmed: true, + block_height: 363348, + block_hash: "0000000000000000139385d7aa78ffb45469e0c715b8d6ea6cb2ffa98acc7171", + block_time: 1435754650 + } +}`, + }, + liquidTransactionHex: { + codeSample: { + esModule: `const { transactions } = liquidJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const txHex = await transactions.getTxHex({ txid }); + console.log(txHex); +`, + commonJS: `const { transactions } = liquidJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const txHex = await transactions.getTxHex({ txid }); + console.log(txHex);`, + curl: `curl -X GET "https://liquid.network/api/tx/:txid/hex"`, + }, + responseSample: `010000000536a007284bd52ee826680a7f43536472f1bcce1e76cd76b826b88c5884eddf1f0c0000006b483045022100bcdf40fb3b5ebfa2c158ac8d1a41c03eb3dba4e180b00e81836bafd56d946efd022005cc40e35022b614275c1e485c409599667cbd41f6e5d78f421cb260a020a24f01210255ea3f53ce3ed1ad2c08dfc23b211b15b852afb819492a9a0f3f99e5747cb5f0ffffffffee08cb90c4e84dd7952b2cfad81ed3b088f5b32183da2894c969f6aa7ec98405020000006a47304402206332beadf5302281f88502a53cc4dd492689057f2f2f0f82476c1b5cd107c14a02207f49abc24fc9d94270f53a4fb8a8fbebf872f85fff330b72ca91e06d160dcda50121027943329cc801a8924789dc3c561d89cf234082685cbda90f398efa94f94340f2ffffffff36a007284bd52ee826680a7f43536472f1bcce1e76cd76b826b88c5884eddf1f060000006b4830450221009c97a25ae70e208b25306cc870686c1f0c238100e9100aa2599b3cd1c010d8ff0220545b34c80ed60efcfbd18a7a22f00b5f0f04cfe58ca30f21023b873a959f1bd3012102e54cd4a05fe29be75ad539a80e7a5608a15dffbfca41bec13f6bf4a32d92e2f4ffffffff73cabea6245426bf263e7ec469a868e2e12a83345e8d2a5b0822bc7f43853956050000006b483045022100b934aa0f5cf67f284eebdf4faa2072345c2e448b758184cee38b7f3430129df302200dffac9863e03e08665f3fcf9683db0000b44bf1e308721eb40d76b180a457ce012103634b52718e4ddf125f3e66e5a3cd083765820769fd7824fd6aa38eded48cd77fffffffff36a007284bd52ee826680a7f43536472f1bcce1e76cd76b826b88c5884eddf1f0b0000006a47304402206348e277f65b0d23d8598944cc203a477ba1131185187493d164698a2b13098a02200caaeb6d3847b32568fd58149529ef63f0902e7d9c9b4cc5f9422319a8beecd50121025af6ba0ccd2b7ac96af36272ae33fa6c793aa69959c97989f5fa397eb8d13e69ffffffff0400e6e849000000001976a91472d52e2f5b88174c35ee29844cce0d6d24b921ef88ac20aaa72e000000001976a914c15b731d0116ef8192f240d4397a8cdbce5fe8bc88acf02cfa51000000001976a914c7ee32e6945d7de5a4541dd2580927128c11517488acf012e39b000000001976a9140a59837ccd4df25adc31cdad39be6a8d97557ed688ac00000000`, + }, + liquidTransactionMerkleblockProof: { + codeSample: { + esModule: `const { transactions } = liquidJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const txMerkleBlockProof = await transactions.getTxMerkleBlockProof({ txid }); + console.log(txMerkleBlockProof); +`, + commonJS: `const { transactions } = liquidJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const txMerkleBlockProof = await transactions.getTxMerkleBlockProof({ txid }); + console.log(txMerkleBlockProof);`, + curl: `curl -X GET "https://liquid.network/api/tx/:txid/merkleblock-proof"`, + }, + responseSample: `0300000058f6dd09ac5aea942c01d12e75b351e73f4304cc442741000000000000000000ef0c2fa8517414b742094a020da7eba891b47d660ef66f126ad01e5be99a2fd09ae093558e411618c14240df820700000ce4d15e17594f257b22d1ddf47d07b3b88779a8374fcd515ad883d79726c6027da6abfcbc1341a049b30277d3bf14e4663ecaa55b76cb638bb92b028e9bdeeeba65a06adaae75df61e79677b13b5d45523d5ab4067f6f3c89e27458b9c1072910436afdd26b9b89489d89f2a7daaad6d375e3ebafb169bfa3cf266b9605964debb72a79a6491481295dc5ed5198b989c6126c8b4d354c274f115a91b7d01d878c01c9a70ba5d78e11c38d1f7b94692afb177e63a9371b60665ee4cfc49cd9cffa78244de209537d97b19d5938a67078af79f7258d7afe325b16c68089fe31f9ac2185dcea0f9d66cb7b6b69c42c41127c3ddd1b1991f3ce99a89355f14507e115f92356b4c0984e291567cf9d869918726b0e650274a6c692682320257c9925eeb7240c4ced055b8b8cf804d33bbec407b4058b1e1f7c5a7127770f7cac890879706e1e34ef8e1b715e182cc691524135bc78da898afc89b401862af259dca1da9065dad015d747181e12ffb73ea0ba0480a0b89ff33fb3884514554be97bf0b603add505`, + }, + liquidTransactionMerkleProof: { + codeSample: { + esModule: `const { transactions } = liquidJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const txMerkleProof = await transactions.getTxMerkleProof({ txid }); + console.log(txMerkleProof); +`, + commonJS: `const { transactions } = liquidJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const txMerkleProof = await transactions.getTxMerkleProof({ txid }); + console.log(txMerkleProof);`, + curl: `curl -X GET "https://liquid.network/api/tx/:txid/merkle-proof"`, + }, + responseSample: `{ + block_height: 363348, + merkle: [ + "acf931fe8980c6165b32fe7a8d25f779af7870a638599db1977d5309e24d2478", + ... + ], + pos: 1465 +}`, + }, + liquidTransactionOutspend: { + codeSample: { + esModule: `const { transactions } = liquidJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const txOutspend = await transactions.getTxOutspend({ + txid, + vout: 3, + }); + console.log(txOutspend); +`, + commonJS: `const { transactions } = liquidJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const txOutspend = await transactions.getTxOutspend({ + txid, + vout: 3, + }); + console.log(txOutspend);`, + curl: `curl -X GET "https://liquid.network/api/tx/:txid/outspend/:vout"`, + }, + responseSample: `{ + spent: true, + txid: "2a1b8ec06d68096911da82b02806c3848c415b0044a0046850c4a97cbffac7b1", + vin: 1, + status: { + confirmed: true, + block_height: 363354, + block_hash: "000000000000000012e6130dec174ca877bf39ead6e3d04a8ba3b0cd683c1661", + block_time: 1435758032 + } +}`, + }, + liquidTransactionOutspends: { + codeSample: { + esModule: `const { transactions } = liquidJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const txOutspends = await transactions.getTxOutspends({ txid }); + console.log(txOutspends); +`, + commonJS: `const { transactions } = liquidJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const txOutspends = await transactions.getTxOutspends({ txid }); + console.log(txOutspends);`, + curl: `curl -X GET "https://liquid.network/api/tx/:txid/outspends"`, + }, + responseSample: `[ + { + spent: true, + txid: "34de8ba520eb846da8831fa47c06eef9b4eb4a2ff6a3271165fd6b9aafc5a20c", + vin: 12, + status: { + confirmed: true, + block_height: 363349, + block_hash: "000000000000000012ad81b3ea2cb1c4ba115901bd1b41cd05a6a8d736691322", + block_time: 1435754897 + } + }, + ... +]`, + }, + liquidTransactionRaw: { + codeSample: { + esModule: `const { transactions } = liquidJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const txRaw = await transactions.getTxRaw({ txid }); + console.log(txRaw); +`, + commonJS: `const { transactions } = liquidJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const txRaw = await transactions.getTxRaw({ txid }); + console.log(txRaw);`, + curl: `curl -X GET "https://liquid.network/api/tx/:txid/raw"`, + }, + responseSample: ``, + }, + liquidTransactionStatus: { + codeSample: { + esModule: `const { transactions } = liquidJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const txStatus = await transactions.getTxStatus({ txid }); + console.log(txStatus); +`, + commonJS: `const { transactions } = liquidJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const txStatus = await transactions.getTxStatus({ txid }); + console.log(txStatus);`, + curl: `curl -X GET "https://liquid.network/api/tx/:txid/status"`, + }, + responseSample: `{ + confirmed: true, + block_height: 363348, + block_hash: "0000000000000000139385d7aa78ffb45469e0c715b8d6ea6cb2ffa98acc7171", + block_time: 1435754650 +}`, + }, + liquidPostTransaction: { + codeSample: { + esModule: `const { transactions } = liquidJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const postTx = await transactions.postTx({ txid }); + console.log(postTx); +`, + commonJS: `const { transactions } = liquidJS(); + const txid = + '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521'; + + const postTx = await transactions.postTx({ txid }); + console.log(postTx);`, + curl: `curl -X POST "https://liquid.network/api/tx"`, + }, + responseSample: ``, + }, + liquidAddress: { + codeSample: { + esModule: `const { addresses } = liquidJS(); + const address = 'Go65t19hP2FuhBMYtgbdMDgdmEzNwh1i48'; + + const myAddress = await addresses.getAddress({ address }); + console.log(myAddress);`, + commonJS: `const { addresses } = liquidJS(); + const address = 'Go65t19hP2FuhBMYtgbdMDgdmEzNwh1i48'; + + const myAddress = await addresses.getAddress({ address }); + console.log(myAddress);`, + curl: `curl -X GET "https://liquid.network/api/address/:address"`, + }, + responseSample: `{ + address: "Go65t19hP2FuhBMYtgbdMDgdmEzNwh1i48", + chain_stats: { + funded_txo_count: 1, + spent_txo_count: 1, + tx_count: 2 + }, + mempool_stats: { + funded_txo_count: 0, + spent_txo_count: 0, + tx_count: 0 + } +}`, + }, + liquidAddressTransactions: { + codeSample: { + esModule: `const { addresses } = liquidJS(); + const address = 'Go65t19hP2FuhBMYtgbdMDgdmEzNwh1i48'; + + const addressTxs = await addresses.getAddressTxs({ address }); + console.log(addressTxs);`, + commonJS: `const { addresses } = liquidJS(); + const address = 'Go65t19hP2FuhBMYtgbdMDgdmEzNwh1i48'; + + const addressTxs = await addresses.getAddressTxs({ address }); + console.log(addressTxs);`, + curl: `curl -X GET "https://liquid.network/api/address/:address/txs"`, + }, + responseSample: `[ + { + txid: "e792f305016fdce71ba4a9c3057279df2b67a7a3e6147b173847a8253ad531ed", + version: 2, + locktime: 1438076, + vin: [Object], + vout: [Object], + size: 9205, + weight: 10492, + fee: 262, + status: { + confirmed: true, + block_height: 1438078, + block_hash: "1625ce898d2058f4e609af2e81908ce52eba77dde099667bea68360b5679d5df", + block_time: 1628564158 + } + }, + ... +]`, + }, + liquidAddressTransactionsChain: { + codeSample: { + esModule: `const { addresses } = liquidJS(); + const address = 'Go65t19hP2FuhBMYtgbdMDgdmEzNwh1i48'; + + const addressTxsChain = await addresses.getAddressTxsChain({ address }); + console.log(addressTxsChain);`, + commonJS: `const { addresses } = liquidJS(); + const address = 'Go65t19hP2FuhBMYtgbdMDgdmEzNwh1i48'; + + const addressTxsChain = await addresses.getAddressTxsChain({ address }); + console.log(addressTxsChain);`, + curl: `curl -X GET "https://liquid.network/api/address/:address/txs/chain"`, + }, + responseSample: `[ + { + txid: "e792f305016fdce71ba4a9c3057279df2b67a7a3e6147b173847a8253ad531ed", + version: 2, + locktime: 1438076, + vin: [Object], + vout: [Object], + size: 9205, + weight: 10492, + fee: 262, + status: { + confirmed: true, + block_height: 1438078, + block_hash: "1625ce898d2058f4e609af2e81908ce52eba77dde099667bea68360b5679d5df", + block_time: 1628564158 + } + }, + ... +]`, + }, + liquidAddressTransactionsMempool: { + codeSample: { + esModule: `const { addresses } = liquidJS(); + const address = '1EnX7FFCzdBjpYnErSTaxaWyTND4m86ebK'; + + const addressTxsMempool = await addresses.getAddressTxsMempool({ address }); + console.log(addressTxsMempool);`, + commonJS: `const { addresses } = liquidJS(); + const address = '1EnX7FFCzdBjpYnErSTaxaWyTND4m86ebK'; + + const addressTxsMempool = await addresses.getAddressTxsMempool({ address }); + console.log(addressTxsMempool);`, + curl: `curl -X GET "https://liquid.network/api/address/:address/txs/mempool"`, + }, + responseSample: `[ + { + txid: "16cd9bbc6b62313a22d16671fa559aec6bf581df8b5853d37775c84b0fddfa90", + version: 2, + locktime: 0, + vin: [ [Object] ], + vout: [ [Object], [Object] ], + size: 226, + weight: 904, + fee: 6720, + status: { confirmed: false } + } +]`, + }, + liquidAddressUTXO: { + codeSample: { + esModule: `const { addresses } = liquidJS(); + const address = '1PQwtwajfHWyAkedss5utwBvULqbGocRpu'; + + const addressTxsUtxo = await addresses.getAddressTxsUtxo({ address }); + console.log(addressTxsUtxo);`, + commonJS: `const { addresses } = liquidJS(); + const address = '1PQwtwajfHWyAkedss5utwBvULqbGocRpu'; + + const addressTxsUtxo = await addresses.getAddressTxsUtxo({ address }); + console.log(addressTxsUtxo);`, + curl: `curl -X GET "https://liquid.network/api/address/:address/utxo"`, + }, + responseSample: `[ + { + txid: 'a3e4a5ce88c9a73983aaba34243472377e478c3ca77258018222b813e1256307', + vout: 0, + status: { + confirmed: true, + block_height: 685094, + block_hash: '00000000000000000002af00dc86cfc99c8843c7a4906a1ec3b0a79712334d81', + block_time: 1622081201 + }, + value: 723191295 + }, + ... +]`, + }, + liquidWebsocket: { + codeSample: { + esModule: `const { websocket } = liquidJS(); + + 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); + } + });`, + commonJS: `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); + } + });`, + curl: ``, + }, + responseSample: ``, + }, + bisqAddress: { + codeSample: { + esModule: `const { bisq: { addresses } } = mempoolJS(); + const address = 'B1DgwRN92rdQ9xpEVCdXRfgeqGw9X4YtrZz'; + + const myAddress = await addresses.getAddress({ address }); + console.log(myAddress);`, + commonJS: `const { bisq: { addresses } } = mempoolJS(); + const address = 'B1DgwRN92rdQ9xpEVCdXRfgeqGw9X4YtrZz'; + + const myAddress = await addresses.getAddress({ address }); + console.log(myAddress);`, + curl: `curl -X GET "https://mempool.space/api/address/:address"`, + }, + responseSample: `[ + { + "txVersion": "1", + "id": "d6f0a6fd191ac907ff88fc51af91cae8d50e596a846952ffa0ad0cea84eedc9a", + "blockHeight": 679129, + "blockHash": "00000000000000000001328850b0482312325f7f4abd5457e45d37cad664675d", + "time": 1618369311000, + "inputs": [ ... ], + "outputs": [ ... ], + "txType": "PAY_TRADE_FEE", + "txTypeDisplayString": "Pay trade fee", + "burntFee": 6, + "invalidatedBsq": 0, + "unlockBlockHeight": 0 + }, + ... +]`, + }, + bisqBlock: { + codeSample: { + esModule: `const { bisq: { blocks } } = mempoolJS(); + const hash = '000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d'; + + const block = await blocks.getBlock({ hash }); + console.log(block);`, + commonJS: `const { bisq: { blocks } } = mempoolJS(); + const hash = '000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d'; + + const block = await blocks.getBlock({ hash }); + console.log(block);`, + curl: `curl -X GET "https://mempool.space/api/block/:hash"`, + }, + responseSample: `{ + height: 571747, + time: 1555340856000, + hash: "000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d", + previousBlockHash: "0000000000000000001b8c271a4477a28d4ea7d4d4d1add6d96f386e3f151709", + txs: [ + { + txVersion: "1", + id: "4b5417ec5ab6112bedf539c3b4f5a806ed539542d8b717e1c4470aa3180edce5", + blockHeight: 571747, + blockHash: "000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d", + time: 1555340856000, + inputs: [], + outputs: [Array], + txType: "GENESIS", + txTypeDisplayString: "Genesis", + burntFee: 0, + invalidatedBsq: 0, + unlockBlockHeight: 0 + } + ] +}`, + }, + bisqBlockTipHeight: { + codeSample: { + esModule: `const { bisq: { blocks } } = mempoolJS(); + const hash = '000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d'; + + const myBlocksHeight = await blocks.getBlocksTipHeight({ + index: 0, + length: 1, + }); + console.log(myBlocksHeight);`, + commonJS: `const { bisq: { blocks } } = mempoolJS(); + const hash = '000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d'; + + const myBlocksHeight = await blocks.getBlocksTipHeight({ + index: 0, + length: 1, + }); + console.log(myBlocksHeight);`, + curl: `curl -X GET "https://mempool.space/api/blocks/tip/height"`, + }, + responseSample: `685657`, + }, + bisqBlockIndex: { + codeSample: { + esModule: `const { bisq: { blocks } } = mempoolJS(); + + const myBlocks = await blocks.getBlocks({ index: 0, length: 1 }); + console.log(myBlocks);`, + commonJS: `const { bisq: { blocks } } = mempoolJS(); + + const myBlocks = await blocks.getBlocks({ index: 0, length: 1 }); + console.log(myBlocks);`, + curl: `curl -X GET "https://mempool.space/api/blocks/:index/:length"`, + }, + responseSample: `[ + { + height: 685656, + time: 1622468887000, + hash: "00000000000000000004c7046979024bd8e8f07389ca53f4f1d7dcf84eefdb21", + previousBlockHash: "0000000000000000000bf982d024e5afa38be8fc08c3a9b6a2bd89dbd18de832", + txs: [ + [Object], [Object], + [Object], [Object], + [Object], [Object], + [Object], [Object], + [Object], [Object], + [Object] + ] + } +]`, + }, + bisqMarketsCurrencies: { + codeSample: { + esModule: `const { bisq: { markets } } = mempoolJS(); + + const currencies = await markets.getCurrencies(); + console.log(currencies);`, + commonJS: `const { bisq: { markets } } = mempoolJS(); + + const currencies = await markets.getCurrencies(); + console.log(currencies);`, + curl: `curl -X GET "https://mempool.space/api/markets/currencies/"`, + }, + responseSample: `{ + BTC: { + code: 'BTC', + name: 'Bitcoin', + precision: 8, + _type: 'crypto' + } + ... +}`, + }, + bisqMarketsDepth: { + codeSample: { + esModule: `const { bisq: { markets } } = mempoolJS(); + + const market = "BTC_USD"; + + const depth = await markets.getDepth({ market }); + console.log(depth);`, + commonJS: `const { bisq: { markets } } = mempoolJS(); + + const market = "BTC_USD"; + + const depth = await markets.getDepth({ market }); + console.log(depth);`, + curl: `curl -X GET "https://mempool.space/api/markets/depth/"`, + }, + responseSample: `{ + btc_usd: { + buys: [ + '4.56941560', + ... + ], + sells: [ + '4.54668218', + ... + ] + } +}`, + }, + bisqMarketsHloc: { + codeSample: { + esModule: `const { bisq: { markets } } = mempoolJS(); + + const market = "BTC_USD"; + + const hloc = await markets.getHloc({ market }); + console.log(hloc);`, + commonJS: `const { bisq: { markets } } = mempoolJS(); + + const market = "BTC_USD"; + + const hloc = await markets.getHloc({ market }); + console.log(hloc);`, + curl: `curl -X GET "https://mempool.space/api/markets/hloc/"`, + }, + responseSample: `[ + { + period_start: 1609459200, + open: '30448.18510000', + close: '45717.81750000', + high: '77700.00000000', + low: '27500.00000000', + avg: '44613.01158471', + volume_right: '4923536.57150000', + volume_left: '110.36100000' + } + ... +]`, + }, + bisqMarketsMarkets: { + codeSample: { + esModule: `const { bisq: { markets } } = mempoolJS(); + + const allMarkets = await markets.getMarkets(); + console.log(allMarkets);`, + commonJS: `const { bisq: { markets } } = mempoolJS(); + + const allMarkets = await markets.getMarkets(); + console.log(allMarkets);`, + curl: `curl -X GET "https://mempool.space/api/markets/"`, + }, + responseSample: `{ + btc_brl: { + pair: 'btc_brl', + lname: 'Bitcoin', + rname: 'Brazilian Real', + lsymbol: 'BTC', + rsymbol: 'BRL', + lprecision: 8, + rprecision: 2, + ltype: 'crypto', + rtype: 'fiat', + name: 'Bitcoin/Brazilian Real' + }, + ... +}`, + }, + bisqMarketsOffers: { + codeSample: { + esModule: `const { bisq: { markets } } = mempoolJS(); + const market = "BTC_USD"; + + const offers = await markets.getOffers({ market }); + console.log(offers);`, + commonJS: `const { bisq: { markets } } = mempoolJS(); + const market = "BTC_USD"; + + const offers = await markets.getOffers({ market }); + console.log(offers);`, + curl: `curl -X GET "https://mempool.space/api/markets/offers"`, + }, + responseSample: `{ + btc_usd: { + buys: [ + [Object], + ... + ], + sells: [ + [Object], + ... + ] + } +}`, + }, + bisqMarketsTicker: { + codeSample: { + esModule: `const { bisq: { markets } } = mempoolJS(); + const market = "BTC_USD"; + + const ticker = await markets.getTicker({ market }); + console.log(ticker);`, + commonJS: `const { bisq: { markets } } = mempoolJS(); + + const market = "BTC_USD"; + + const ticker = await markets.getTicker({ market }); + console.log(ticker);`, + curl: `curl -X GET "https://mempool.space/api/markets/ticker"`, + }, + responseSample: `{ + last: '45717.81750000', + high: '56483.70620000', + low: '43531.62860000', + volume_left: '0.30170000', + volume_right: '14093.11830000', + buy: '42000.00000000', + sell: '45782.92640000' +}`, + }, + bisqMarketsTrades: { + codeSample: { + esModule: `const { bisq: { markets } } = mempoolJS(); + const market = "BTC_USD"; + + const trades = await markets.getTrades({ market }); + console.log(trades);`, + commonJS: `const { bisq: { markets } } = mempoolJS(); + + const market = "BTC_USD"; + + const trades = await markets.getTrades({ market }); + console.log(trades);`, + curl: `curl -X GET "https://mempool.space/api/markets/trades"`, + }, + responseSample: `[ + { + price: '56483.70620000', + amount: '0.02000000', + volume: '1129.67410000', + payment_method: 'AMAZON_GIFT_CARD', + trade_date: 1628619031777 + }, + ... +]`, + }, + bisqMarketsVolumes: { + codeSample: { + esModule: `const { bisq: { markets } } = mempoolJS(); + + const market = "BTC_USD"; + const basecurrency = "BTC"; + + const volumes = await markets.getVolumes({ basecurrency, market });`, + commonJS: `const { bisq: { markets } } = mempoolJS(); + + const market = "BTC_USD"; + const basecurrency = "BTC"; + + const volumes = await markets.getVolumes({ basecurrency, market }); + console.log(volumes);`, + curl: `curl -X GET "https://mempool.space/api/markets/volumes"`, + }, + responseSample: `, + { + price: '40160.32250000', + amount: '0.01000000', + volume: '401.60320000', + payment_method: 'AMAZON_GIFT_CARD', + trade_date: 1628199923855 + }, + ... +]`, + }, + bisqStats: { + codeSample: { + esModule: `const { bisq: { statistics } } = mempoolJS(); + const hash = '000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d'; + + const stats = await statistics.getStats(); + console.log(stats);`, + commonJS: `const { bisq: { statistics } } = mempoolJS(); + const hash = '000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d'; + + const stats = await statistics.getStats(); + console.log(stats);`, + curl: `curl -X GET "https://mempool.space/api/stats"`, + }, + responseSample: `[ + { + period_start: 1609459200, + open: '30448.18510000', + close: '45717.81750000', + high: '77700.00000000', + low: '27500.00000000', + avg: '44613.01158471', + volume_right: '4923536.57150000', + volume_left: '110.36100000' + }, + ... +]`, + }, + bisqTransaction: { + codeSample: { + esModule: `const { bisq: { transactions } } = mempoolJS(); + const txid = '4b5417ec5ab6112bedf539c3b4f5a806ed539542d8b717e1c4470aa3180edce5'; + + const tx = await transactions.getTx({ txid }); + console.log(tx);`, + commonJS: `const { bisq: { transactions } } = mempoolJS(); + const txid = '4b5417ec5ab6112bedf539c3b4f5a806ed539542d8b717e1c4470aa3180edce5'; + + const tx = await transactions.getTx({ txid }); + console.log(tx);`, + curl: `curl -X GET "https://mempool.space/api/tx/:txid"`, + }, + responseSample: `{ + "txVersion":"1", + "id":"4b5417ec5ab6112bedf539c3b4f5a806ed539542d8b717e1c4470aa3180edce5", + "blockHeight":571747, + "blockHash":"000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d", + "time":1555340856000, + "inputs": [ [Object], [Object] ], + "outputs": [ [Object], [Object] ], + "txType":"GENESIS", + "txTypeDisplayString":"Genesis", + "burntFee":0, + "invalidatedBsq":0, + "unlockBlockHeight":0 +}`, + }, + bisqTransactions: { + codeSample: { + esModule: `const { bisq: { transactions } } = mempoolJS(); + + const txs = await transactions.getTxs({ index: 0, length: 1 }); + console.log(txs);`, + commonJS: `const { bisq: { transactions } } = mempoolJS(); + + const txs = await transactions.getTxs({ index: 0, length: 1 }); + console.log(txs);`, + curl: `curl -X GET "https://mempool.space/api/txs/:index/:length"`, + }, + responseSample: `[ + { + txVersion: "1", + id: "084e94afb67df0e6dff2e9ae6913d5ccb58f3b2dab0c4543a7c90c33b70c9bed", + blockHeight: 685656, + blockHash: "00000000000000000004c7046979024bd8e8f07389ca53f4f1d7dcf84eefdb21", + time: 1622468887000, + inputs: [ [Object], [Object] ], + outputs: [ [Object], [Object], [Object] ], + txType: "PAY_TRADE_FEE", + txTypeDisplayString: "Pay trade fee", + burntFee: 57, + invalidatedBsq: 0, + unlockBlockHeight: 0 + } +]`, + }, + bisqAddressModule: { + codeSample: { + esModule: `const { addresses } = bisqJS(); + const address = 'B1DgwRN92rdQ9xpEVCdXRfgeqGw9X4YtrZz'; + + const myAddress = await addresses.getAddress({ address }); + console.log(myAddress);`, + commonJS: `const { addresses } = bisqJS(); + const address = 'B1DgwRN92rdQ9xpEVCdXRfgeqGw9X4YtrZz'; + + const myAddress = await addresses.getAddress({ address }); + console.log(myAddress);`, + curl: `curl -X GET "https://mempool.space/api/address/:address"`, + }, + responseSample: `[ + { + "txVersion": "1", + "id": "d6f0a6fd191ac907ff88fc51af91cae8d50e596a846952ffa0ad0cea84eedc9a", + "blockHeight": 679129, + "blockHash": "00000000000000000001328850b0482312325f7f4abd5457e45d37cad664675d", + "time": 1618369311000, + "inputs": [ ... ], + "outputs": [ ... ], + "txType": "PAY_TRADE_FEE", + "txTypeDisplayString": "Pay trade fee", + "burntFee": 6, + "invalidatedBsq": 0, + "unlockBlockHeight": 0 + }, + ... +]`, + }, + bisqBlockModule: { + codeSample: { + esModule: `const { blocks } = bisqJS(); + const hash = '000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d'; + + const block = await blocks.getBlock({ hash }); + console.log(block);`, + commonJS: `const { blocks } = bisqJS(); + const hash = '000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d'; + + const block = await blocks.getBlock({ hash }); + console.log(block);`, + curl: `curl -X GET "https://mempool.space/api/block/:hash"`, + }, + responseSample: `{ + height: 571747, + time: 1555340856000, + hash: "000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d", + previousBlockHash: "0000000000000000001b8c271a4477a28d4ea7d4d4d1add6d96f386e3f151709", + txs: [ + { + txVersion: "1", + id: "4b5417ec5ab6112bedf539c3b4f5a806ed539542d8b717e1c4470aa3180edce5", + blockHeight: 571747, + blockHash: "000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d", + time: 1555340856000, + inputs: [], + outputs: [Array], + txType: "GENESIS", + txTypeDisplayString: "Genesis", + burntFee: 0, + invalidatedBsq: 0, + unlockBlockHeight: 0 + } + ] +}`, + }, + bisqBlockTipHeightModule: { + codeSample: { + esModule: `const { blocks } = bisqJS(); + const hash = '000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d'; + + const myBlocksHeight = await blocks.getBlocksTipHeight({ + index: 0, + length: 1, + }); + console.log(myBlocksHeight);`, + commonJS: `const { blocks } = bisqJS(); + const hash = '000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d'; + + const myBlocksHeight = await blocks.getBlocksTipHeight({ + index: 0, + length: 1, + }); + console.log(myBlocksHeight);`, + curl: `curl -X GET "https://mempool.space/api/blocks/tip/height"`, + }, + responseSample: `685657`, + }, + bisqBlockIndexModule: { + codeSample: { + esModule: `const { blocks } = bisqJS(); + + const myBlocks = await blocks.getBlocks({ index: 0, length: 1 }); + console.log(myBlocks);`, + commonJS: `const { blocks } = bisqJS(); + + const myBlocks = await blocks.getBlocks({ index: 0, length: 1 }); + console.log(myBlocks);`, + curl: `curl -X GET "https://mempool.space/api/blocks/:index/:length"`, + }, + responseSample: `[ + { + height: 685656, + time: 1622468887000, + hash: "00000000000000000004c7046979024bd8e8f07389ca53f4f1d7dcf84eefdb21", + previousBlockHash: "0000000000000000000bf982d024e5afa38be8fc08c3a9b6a2bd89dbd18de832", + txs: [ + [Object], [Object], + [Object], [Object], + [Object], [Object], + [Object], [Object], + [Object], [Object], + [Object] + ] + } +]`, + }, + bisqMarketsCurrenciesModule: { + codeSample: { + esModule: `const { markets } = bisqJS(); + + const currencies = await markets.getCurrencies(); + console.log(currencies);`, + commonJS: `const { markets } = bisqJS(); + + const currencies = await markets.getCurrencies(); + console.log(currencies);`, + curl: `curl -X GET "https://bisq.markets/api/markets/currencies/"`, + }, + responseSample: `{ + BTC: { + code: 'BTC', + name: 'Bitcoin', + precision: 8, + _type: 'crypto' + } + ... +}`, + }, + bisqMarketsDepthModule: { + codeSample: { + esModule: `const { markets } = bisqJS(); + + const market = "BTC_USD"; + + const depth = await markets.getDepth({ market }); + console.log(depth);`, + commonJS: `const { markets } = bisqJS(); + + const market = "BTC_USD"; + + const depth = await markets.getDepth({ market }); + console.log(depth);`, + curl: `curl -X GET "https://bisq.markets/api/markets/depth/"`, + }, + responseSample: `{ + btc_usd: { + buys: [ + '4.56941560', + ... + ], + sells: [ + '4.54668218', + ... + ] + } +}`, + }, + bisqMarketsHlocModule: { + codeSample: { + esModule: `const { markets } = bisqJS(); + + const market = "BTC_USD"; + + const hloc = await markets.getHloc({ market }); + console.log(hloc);`, + commonJS: `const { markets } = bisqJS(); + + const market = "BTC_USD"; + + const hloc = await markets.getHloc({ market }); + console.log(hloc);`, + curl: `curl -X GET "https://bisq.markets/api/markets/hloc/"`, + }, + responseSample: `[ + { + period_start: 1609459200, + open: '30448.18510000', + close: '45717.81750000', + high: '77700.00000000', + low: '27500.00000000', + avg: '44613.01158471', + volume_right: '4923536.57150000', + volume_left: '110.36100000' + } + ... +]`, + }, + bisqMarketsMarketsModule: { + codeSample: { + esModule: `const { markets } = bisqJS(); + + const allMarkets = await markets.getMarkets(); + console.log(allMarkets);`, + commonJS: `const { markets } = bisqJS(); + + const allMarkets = await markets.getMarkets(); + console.log(allMarkets);`, + curl: `curl -X GET "https://bisq.markets/api/markets/"`, + }, + responseSample: `{ + btc_brl: { + pair: 'btc_brl', + lname: 'Bitcoin', + rname: 'Brazilian Real', + lsymbol: 'BTC', + rsymbol: 'BRL', + lprecision: 8, + rprecision: 2, + ltype: 'crypto', + rtype: 'fiat', + name: 'Bitcoin/Brazilian Real' + }, + ... +}`, + }, + bisqMarketsOffersModule: { + codeSample: { + esModule: `const { markets } = bisqJS(); + const market = "BTC_USD"; + + const offers = await markets.getOffers({ market }); + console.log(offers);`, + commonJS: `const { markets } = bisqJS(); + const market = "BTC_USD"; + + const offers = await markets.getOffers({ market }); + console.log(offers);`, + curl: `curl -X GET "https://bisq.markets/api/markets/offers"`, + }, + responseSample: `{ + btc_usd: { + buys: [ + [Object], + ... + ], + sells: [ + [Object], + ... + ] + } +}`, + }, + bisqMarketsTickerModule: { + codeSample: { + esModule: `const { markets } = bisqJS(); + const market = "BTC_USD"; + + const ticker = await markets.getTicker({ market }); + console.log(ticker);`, + commonJS: `const { markets } = bisqJS(); + + const market = "BTC_USD"; + + const ticker = await markets.getTicker({ market }); + console.log(ticker);`, + curl: `curl -X GET "https://bisq.markets/api/markets/ticker"`, + }, + responseSample: `{ + last: '45717.81750000', + high: '56483.70620000', + low: '43531.62860000', + volume_left: '0.30170000', + volume_right: '14093.11830000', + buy: '42000.00000000', + sell: '45782.92640000' +}`, + }, + bisqMarketsTradesModule: { + codeSample: { + esModule: `const { markets } = bisqJS(); + const market = "BTC_USD"; + + const trades = await markets.getTrades({ market }); + console.log(trades);`, + commonJS: `const { markets } = bisqJS(); + + const market = "BTC_USD"; + + const trades = await markets.getTrades({ market }); + console.log(trades);`, + curl: `curl -X GET "https://bisq.markets/api/markets/trades"`, + }, + responseSample: `[ + { + price: '56483.70620000', + amount: '0.02000000', + volume: '1129.67410000', + payment_method: 'AMAZON_GIFT_CARD', + trade_date: 1628619031777 + }, + ... +]`, + }, + bisqMarketsVolumesModule: { + codeSample: { + esModule: `const { markets } = bisqJS(); + + const market = "BTC_USD"; + const basecurrency = "BTC"; + + const volumes = await markets.getVolumes({ basecurrency, market });`, + commonJS: `const { markets } = bisqJS(); + + const market = "BTC_USD"; + const basecurrency = "BTC"; + + const volumes = await markets.getVolumes({ basecurrency, market }); + console.log(volumes);`, + curl: `curl -X GET "https://bisq.markets/api/markets/volumes"`, + }, + responseSample: `, + { + price: '40160.32250000', + amount: '0.01000000', + volume: '401.60320000', + payment_method: 'AMAZON_GIFT_CARD', + trade_date: 1628199923855 + }, + ... +]`, + }, + bisqStatsModule: { + codeSample: { + esModule: `const { statistics } = bisqJS(); + const hash = '000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d'; + + const stats = await statistics.getStats(); + console.log(stats);`, + commonJS: `const { statistics } = bisqJS(); + const hash = '000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d'; + + const stats = await statistics.getStats(); + console.log(stats);`, + curl: `curl -X GET "https://mempool.space/api/stats"`, + }, + responseSample: `[ + { + period_start: 1609459200, + open: '30448.18510000', + close: '45717.81750000', + high: '77700.00000000', + low: '27500.00000000', + avg: '44613.01158471', + volume_right: '4923536.57150000', + volume_left: '110.36100000' + }, + ... +]`, + }, + bisqTransactionModule: { + codeSample: { + esModule: `const { transactions } = bisqJS(); + const txid = '4b5417ec5ab6112bedf539c3b4f5a806ed539542d8b717e1c4470aa3180edce5'; + + const tx = await transactions.getTx({ txid }); + console.log(tx);`, + commonJS: `const { transactions } = bisqJS(); + const txid = '4b5417ec5ab6112bedf539c3b4f5a806ed539542d8b717e1c4470aa3180edce5'; + + const tx = await transactions.getTx({ txid }); + console.log(tx);`, + curl: `curl -X GET "https://mempool.space/api/tx/:txid"`, + }, + responseSample: `{ + "txVersion":"1", + "id":"4b5417ec5ab6112bedf539c3b4f5a806ed539542d8b717e1c4470aa3180edce5", + "blockHeight":571747, + "blockHash":"000000000000000000079aa6bfa46eb8fc20474e8673d6e8a123b211236bf82d", + "time":1555340856000, + "inputs": [ [Object], [Object] ], + "outputs": [ [Object], [Object] ], + "txType":"GENESIS", + "txTypeDisplayString":"Genesis", + "burntFee":0, + "invalidatedBsq":0, + "unlockBlockHeight":0 +}`, + }, + bisqTransactionsModule: { + codeSample: { + esModule: `const { transactions } = bisqJS(); + + const txs = await transactions.getTxs({ index: 0, length: 1 }); + console.log(txs);`, + commonJS: `const { transactions } = bisqJS(); + + const txs = await transactions.getTxs({ index: 0, length: 1 }); + console.log(txs);`, + curl: `curl -X GET "https://mempool.space/api/txs/:index/:length"`, + }, + responseSample: `[ + { + txVersion: "1", + id: "084e94afb67df0e6dff2e9ae6913d5ccb58f3b2dab0c4543a7c90c33b70c9bed", + blockHeight: 685656, + blockHash: "00000000000000000004c7046979024bd8e8f07389ca53f4f1d7dcf84eefdb21", + time: 1622468887000, + inputs: [ [Object], [Object] ], + outputs: [ [Object], [Object], [Object] ], + txType: "PAY_TRADE_FEE", + txTypeDisplayString: "Pay trade fee", + burntFee: 57, + invalidatedBsq: 0, + unlockBlockHeight: 0 + } +]`, + }, }; constructor( @@ -1169,6 +2717,7 @@ responseSample: `{ ) { } ngOnInit(): void { + this.env = this.stateService.env; this.seoService.setTitle($localize`:@@e351b40b3869a5c7d19c3d4918cb1ac7aaab95c4:API`); this.network$ = merge(of(''), this.stateService.networkChanged$); this.websocketService.want(['blocks']); @@ -1176,6 +2725,10 @@ responseSample: `{ if (document.location.port !== '') { this.hostname = this.hostname + ':' + document.location.port; } + + this.network$.subscribe((network) => { + this.active = (network === 'liquid') ? 1 : 0; + }); } } diff --git a/frontend/src/app/components/api-docs/code-template.component.html b/frontend/src/app/components/api-docs/code-template.component.html index a438dc537..8f85bfc07 100644 --- a/frontend/src/app/components/api-docs/code-template.component.html +++ b/frontend/src/app/components/api-docs/code-template.component.html @@ -12,7 +12,7 @@
    Code Example
    @@ -20,12 +20,12 @@
  • ES Module -
    Install Package
    +
    Install Package
    -
    +
    Code Example
    diff --git a/frontend/src/app/components/api-docs/code-template.component.ts b/frontend/src/app/components/api-docs/code-template.component.ts index e7c8d9915..8959121cd 100644 --- a/frontend/src/app/components/api-docs/code-template.component.ts +++ b/frontend/src/app/components/api-docs/code-template.component.ts @@ -7,6 +7,7 @@ import { Component, Input } from '@angular/core'; }) export class CodeTemplateComponent { @Input() network: string; + @Input() layer: string; @Input() code: { codeSample: { esModule: string; @@ -16,15 +17,32 @@ export class CodeTemplateComponent { responseSample: string; }; hostname = document.location.hostname; - esModuleInstall = `# npm -npm install @mempool/mempool.js --save - -# yarn -yarn add @mempool/mempool.js`; constructor( ) { } + npmGithubLink(){ + let npmLink = `https://github.com/mempool/mempool.js`; + if (this.layer === 'bisq') { + npmLink = `https://github.com/mempool/mempool.js/tree/main/npm-bisq-js`; + } + if (this.layer === 'liquid') { + npmLink = `https://github.com/mempool/mempool.js/tree/main/npm-liquid-js`; + } + return npmLink; + } + + npmModuleLink() { + let npmLink = `https://www.npmjs.org/package/@mempool/mempool.js`; + if (this.layer === 'bisq') { + npmLink = `https://www.npmjs.org/package/@mempool/bisq.js`; + } + if (this.layer === 'liquid') { + npmLink = `https://www.npmjs.org/package/@mempool/liquid.js`; + } + return npmLink; + } + normalizeCodeHostname(code: string) { let codeText: string; if (this.network === 'bisq' || this.network === 'liquid'){ @@ -44,7 +62,15 @@ yarn add @mempool/mempool.js`; });` ); } - return `import mempoolJS from "@mempool/mempool.js"; + let importText = `import mempoolJS from "@mempool/mempool.js";`; + if (this.layer === 'bisq') { + importText = `import bisqJS from "@mempool/bisq.js";`; + } + if (this.layer === 'liquid') { + importText = `import liquidJS from "@mempool/liquid.js";`; + } + + return `${importText} const init = async () => { ${codeText} @@ -60,10 +86,18 @@ init();`; hostname: '${this.hostname}/${this.network}' });` ); } + + let importText = ``; + if (this.layer === 'bisq') { + importText = ``; + } + if (this.layer === 'liquid') { + importText = ``; + } return ` - + ${importText} + + diff --git a/frontend/src/index.html b/frontend/src/index.mempool.html similarity index 100% rename from frontend/src/index.html rename to frontend/src/index.mempool.html diff --git a/frontend/src/resources/bisq-markets.svg b/frontend/src/resources/bisq-markets.svg deleted file mode 100644 index 15d9e5119..000000000 --- a/frontend/src/resources/bisq-markets.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/frontend/src/resources/bisq/bisq-markets-logo.png b/frontend/src/resources/bisq/bisq-markets-logo.png new file mode 100644 index 000000000..f2cc25277 Binary files /dev/null and b/frontend/src/resources/bisq/bisq-markets-logo.png differ diff --git a/frontend/src/resources/bisq/bisq-markets-preview.png b/frontend/src/resources/bisq/bisq-markets-preview.png new file mode 100644 index 000000000..2fff8f99e Binary files /dev/null and b/frontend/src/resources/bisq/bisq-markets-preview.png differ diff --git a/frontend/src/resources/bisq/favicons/android-chrome-192x192.png b/frontend/src/resources/bisq/favicons/android-chrome-192x192.png new file mode 100644 index 000000000..696b1ed4f Binary files /dev/null and b/frontend/src/resources/bisq/favicons/android-chrome-192x192.png differ diff --git a/frontend/src/resources/bisq/favicons/android-chrome-384x384.png b/frontend/src/resources/bisq/favicons/android-chrome-384x384.png new file mode 100644 index 000000000..fe268efa0 Binary files /dev/null and b/frontend/src/resources/bisq/favicons/android-chrome-384x384.png differ diff --git a/frontend/src/resources/bisq/favicons/apple-touch-icon.png b/frontend/src/resources/bisq/favicons/apple-touch-icon.png new file mode 100644 index 000000000..9d03238f5 Binary files /dev/null and b/frontend/src/resources/bisq/favicons/apple-touch-icon.png differ diff --git a/frontend/src/resources/bisq/favicons/browserconfig.xml b/frontend/src/resources/bisq/favicons/browserconfig.xml new file mode 100644 index 000000000..f094335eb --- /dev/null +++ b/frontend/src/resources/bisq/favicons/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #000000 + + + diff --git a/frontend/src/resources/bisq/favicons/favicon-16x16.png b/frontend/src/resources/bisq/favicons/favicon-16x16.png new file mode 100644 index 000000000..873024acd Binary files /dev/null and b/frontend/src/resources/bisq/favicons/favicon-16x16.png differ diff --git a/frontend/src/resources/bisq/favicons/favicon-32x32.png b/frontend/src/resources/bisq/favicons/favicon-32x32.png new file mode 100644 index 000000000..ce5e3bad5 Binary files /dev/null and b/frontend/src/resources/bisq/favicons/favicon-32x32.png differ diff --git a/frontend/src/resources/bisq/favicons/favicon.ico b/frontend/src/resources/bisq/favicons/favicon.ico new file mode 100644 index 000000000..ba6406e2a Binary files /dev/null and b/frontend/src/resources/bisq/favicons/favicon.ico differ diff --git a/frontend/src/resources/bisq/favicons/mstile-150x150.png b/frontend/src/resources/bisq/favicons/mstile-150x150.png new file mode 100644 index 000000000..cf0c48dd4 Binary files /dev/null and b/frontend/src/resources/bisq/favicons/mstile-150x150.png differ diff --git a/frontend/src/resources/bisq/favicons/safari-pinned-tab.svg b/frontend/src/resources/bisq/favicons/safari-pinned-tab.svg new file mode 100644 index 000000000..85903c906 --- /dev/null +++ b/frontend/src/resources/bisq/favicons/safari-pinned-tab.svg @@ -0,0 +1,18 @@ + + + + +Created by potrace 1.14, written by Peter Selinger 2001-2017 + + + + + diff --git a/frontend/src/resources/bisq/favicons/site.webmanifest b/frontend/src/resources/bisq/favicons/site.webmanifest new file mode 100644 index 000000000..99227fcb5 --- /dev/null +++ b/frontend/src/resources/bisq/favicons/site.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "bisq.markets", + "short_name": "bisq.markets", + "icons": [ + { + "src": "/resources/bisq/favicons/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/resources/bisq/favicons/android-chrome-384x384.png", + "sizes": "384x384", + "type": "image/png" + } + ], + "theme_color": "#000000", + "background_color": "#000000", + "display": "standalone" +} diff --git a/frontend/src/resources/liquid/favicons/android-chrome-192x192.png b/frontend/src/resources/liquid/favicons/android-chrome-192x192.png new file mode 100644 index 000000000..d49be9e62 Binary files /dev/null and b/frontend/src/resources/liquid/favicons/android-chrome-192x192.png differ diff --git a/frontend/src/resources/liquid/favicons/android-chrome-512x512.png b/frontend/src/resources/liquid/favicons/android-chrome-512x512.png new file mode 100644 index 000000000..c485e824f Binary files /dev/null and b/frontend/src/resources/liquid/favicons/android-chrome-512x512.png differ diff --git a/frontend/src/resources/liquid/favicons/apple-touch-icon.png b/frontend/src/resources/liquid/favicons/apple-touch-icon.png new file mode 100644 index 000000000..7727ec717 Binary files /dev/null and b/frontend/src/resources/liquid/favicons/apple-touch-icon.png differ diff --git a/frontend/src/resources/liquid/favicons/browserconfig.xml b/frontend/src/resources/liquid/favicons/browserconfig.xml new file mode 100644 index 000000000..472927d41 --- /dev/null +++ b/frontend/src/resources/liquid/favicons/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #000000 + + + diff --git a/frontend/src/resources/liquid/favicons/favicon-16x16.png b/frontend/src/resources/liquid/favicons/favicon-16x16.png new file mode 100644 index 000000000..c2c6e116b Binary files /dev/null and b/frontend/src/resources/liquid/favicons/favicon-16x16.png differ diff --git a/frontend/src/resources/liquid/favicons/favicon-32x32.png b/frontend/src/resources/liquid/favicons/favicon-32x32.png new file mode 100644 index 000000000..92a9fa65a Binary files /dev/null and b/frontend/src/resources/liquid/favicons/favicon-32x32.png differ diff --git a/frontend/src/resources/liquid/favicons/favicon.ico b/frontend/src/resources/liquid/favicons/favicon.ico new file mode 100644 index 000000000..2088bc1f2 Binary files /dev/null and b/frontend/src/resources/liquid/favicons/favicon.ico differ diff --git a/frontend/src/resources/liquid/favicons/mstile-150x150.png b/frontend/src/resources/liquid/favicons/mstile-150x150.png new file mode 100644 index 000000000..11314e9f8 Binary files /dev/null and b/frontend/src/resources/liquid/favicons/mstile-150x150.png differ diff --git a/frontend/src/resources/liquid/favicons/safari-pinned-tab.svg b/frontend/src/resources/liquid/favicons/safari-pinned-tab.svg new file mode 100644 index 000000000..b1c3ff8f2 --- /dev/null +++ b/frontend/src/resources/liquid/favicons/safari-pinned-tab.svg @@ -0,0 +1,20 @@ + + + + +Created by potrace 1.14, written by Peter Selinger 2001-2017 + + + + + diff --git a/frontend/src/resources/liquid/favicons/site.webmanifest b/frontend/src/resources/liquid/favicons/site.webmanifest new file mode 100644 index 000000000..d7a3a7970 --- /dev/null +++ b/frontend/src/resources/liquid/favicons/site.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "liquid.network", + "short_name": "liquid", + "icons": [ + { + "src": "/resources/liquid/favicons/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/resources/liquid/favicons/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#000000", + "background_color": "#000000", + "display": "standalone" +} diff --git a/frontend/src/resources/liquid/liquid-network-logo.png b/frontend/src/resources/liquid/liquid-network-logo.png new file mode 100644 index 000000000..de855fb20 Binary files /dev/null and b/frontend/src/resources/liquid/liquid-network-logo.png differ diff --git a/frontend/src/resources/liquid/liquid-network-preview.png b/frontend/src/resources/liquid/liquid-network-preview.png new file mode 100644 index 000000000..5a6ed9eb1 Binary files /dev/null and b/frontend/src/resources/liquid/liquid-network-preview.png differ diff --git a/frontend/sync-assets.js b/frontend/sync-assets.js index 37243e6f0..36fb623fd 100644 --- a/frontend/sync-assets.js +++ b/frontend/sync-assets.js @@ -1,11 +1,26 @@ var https = require('https'); var fs = require('fs'); +const CONFIG_FILE_NAME = 'mempool-frontend-config.json'; +let configContent = {}; + var PATH = 'dist/mempool/browser/en-US/resources/'; if (process.argv[2] && process.argv[2] === 'dev') { PATH = 'src/resources/'; } +try { + const rawConfig = fs.readFileSync(CONFIG_FILE_NAME); + configContent = JSON.parse(rawConfig); + console.log(`${CONFIG_FILE_NAME} file found, using provided config`); +} catch (e) { + if (e.code !== 'ENOENT') { + throw new Error(e); + } else { + console.log(`${CONFIG_FILE_NAME} file not found, using default config`); + } +} + function download(filename, url) { https.get(url, (response) => { if (response.statusCode < 200 || response.statusCode > 299) { @@ -18,9 +33,18 @@ function download(filename, url) { }); } +const poolsJsonUrl = 'https://raw.githubusercontent.com/btccom/Blockchain-Known-Pools/master/pools.json'; +let assetsJsonUrl = 'https://raw.githubusercontent.com/mempool/asset_registry_db/master/index.json'; +let assetsMinimalJsonUrl = 'https://raw.githubusercontent.com/mempool/asset_registry_db/master/index.minimal.json'; + +if (configContent.BASE_MODULE && configContent.BASE_MODULE === 'liquid') { + assetsJsonUrl = 'https://raw.githubusercontent.com/Blockstream/asset_registry_db/master/index.json'; + assetsMinimalJsonUrl = 'https://raw.githubusercontent.com/Blockstream/asset_registry_db/master/index.minimal.json'; +} + console.log('Downloading assets'); -download(PATH + 'assets.json', 'https://raw.githubusercontent.com/mempool/asset_registry_db/master/index.json'); +download(PATH + 'assets.json', assetsJsonUrl); console.log('Downloading assets minimal'); -download(PATH + 'assets.minimal.json', 'https://raw.githubusercontent.com/mempool/asset_registry_db/master/index.minimal.json'); +download(PATH + 'assets.minimal.json', assetsMinimalJsonUrl); console.log('Downloading mining pools info'); -download(PATH + 'pools.json', 'https://raw.githubusercontent.com/btccom/Blockchain-Known-Pools/master/pools.json'); +download(PATH + 'pools.json', poolsJsonUrl); diff --git a/production/mempool-upgrade-all b/production/mempool-upgrade-all index 7618ab090..bf36c6e08 100755 --- a/production/mempool-upgrade-all +++ b/production/mempool-upgrade-all @@ -1,50 +1,72 @@ -#!/usr/local/bin/zsh -x +#!/usr/local/bin/zsh PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$HOME/bin +LOCKFILE="${HOME}/lock" +REPO=origin +BRANCH=master +HOSTNAME=$(hostname) -if [ -f $HOME/lock ];then - echo "check lockfile" +if [ -f "${LOCKFILE}" ];then + echo "upgrade already running? check lockfile ${LOCKFILE}" exit 1 fi -touch $HOME/lock - -export NVM_DIR="$HOME/.nvm" -source "$NVM_DIR/nvm.sh" - -REPO=origin -BRANCH=master +trap 'rm -f "${LOCKFILE}"; exit $?' INT TERM EXIT +touch "${LOCKFILE}" TAG="${BRANCH}" [ ! -z "$1" ] && TAG=$1 -echo "upgrading mempool to ${TAG}" | wall +echo "Upgrading mempool to ${TAG}" | wall -cd "$HOME/mempool" -git fetch "${REPO}" -git reset --hard "${REPO}/${TAG}" -cd "$HOME/" - -for site in mainnet liquid testnet bisq signet -do - cd "$HOME/${site}" - git fetch "${REPO}" - git reset --hard "${REPO}/${TAG}" - hash=$(git rev-parse HEAD) - - if [ "${site}" = "mainnet" ] - then - cd "$HOME/${site}/frontend" - npm install - npm run build - rsync -av ./dist/mempool/browser/* "${HOME}/public_html/${site}/" +update_repo() +{ + local site="$1" + echo "[*] Upgrading ${site} to ${TAG}" + cd "$HOME/${site}" || exit 1 + git fetch "${REPO}" || exit 1 + if [ $(git tag -l "${TAG}") ];then + git reset --hard "tags/${TAG}" || exit 1 + else + git reset --hard "${REPO}/${TAG}" || exit 1 fi + export HASH=$(git rev-parse HEAD) +} - cd "$HOME/${site}/backend" - npm install - npm run build -done +build_frontend() +{ + local site="$1" + echo "[*] Building frontend for ${site}" + [ -z "${HASH}" ] && exit 1 + cd "$HOME/${site}/frontend" || exit 1 + npm install --no-optional || exit 1 + npm run build || exit 1 +} -hostname=$(hostname) -echo "${hostname} updated to \`${TAG}\` @ \`${hash}\`" | /usr/local/bin/keybase chat send --nonblock --channel ops mempool.space +build_backend() +{ + local site="$1" + echo "[*] Building backend for ${site}" + [ -z "${HASH}" ] && exit 1 + cd "$HOME/${site}/backend" || exit 1 + npm install --no-optional || exit 1 + npm run build || exit 1 +} -rm "$HOME/lock" +ship_frontend() +{ + local site="$1" + cd "$HOME/${site}/frontend" || exit 1 + rsync -av ./dist/mempool/browser/* "${HOME}/public_html/${site}/" || exit 1 +} + +export NVM_DIR="${HOME}/.nvm" +source "${NVM_DIR}/nvm.sh" + +for target in mainnet liquid bisq testnet signet;do update_repo "${target}";done +for target in mainnet liquid bisq testnet signet;do build_backend "${target}";done +for target in mainnet liquid bisq;do build_frontend "${target}";done +for target in mainnet liquid bisq;do ship_frontend "${target}";done + +echo "${HOSTNAME} updated to \`${TAG}\` @ \`${HASH}\`" | /usr/local/bin/keybase chat send --nonblock --channel ops mempool.space + +exit 0