diff --git a/backend/src/index.ts b/backend/src/index.ts index 965e18c53..98a55ee18 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -272,8 +272,8 @@ class Server { if (config.MEMPOOL.NETWORK === 'liquid') { this.app - .get(config.MEMPOOL.API_URL_PREFIX + 'liquid/icons', routes.getAllLiquidIcon) - .get(config.MEMPOOL.API_URL_PREFIX + 'liquid/icon/:assetId', routes.getLiquidIcon) + .get(config.MEMPOOL.API_URL_PREFIX + 'assets/icons', routes.getAllLiquidIcon) + .get(config.MEMPOOL.API_URL_PREFIX + 'asset/:assetId/icon', routes.getLiquidIcon) ; } diff --git a/frontend/src/app/components/docs/api-docs-nav.component.html b/frontend/src/app/components/docs/api-docs-nav.component.html index a4da93428..63ed8d4e1 100644 --- a/frontend/src/app/components/docs/api-docs-nav.component.html +++ b/frontend/src/app/components/docs/api-docs-nav.component.html @@ -30,8 +30,10 @@

Assets

GET Assets + GET Assets Icons GET Asset Transactions GET Asset Supply + GET Asset Icon

Blocks

diff --git a/frontend/src/app/components/docs/api-docs.component.html b/frontend/src/app/components/docs/api-docs.component.html index 8358129f5..c41bc57c7 100644 --- a/frontend/src/app/components/docs/api-docs.component.html +++ b/frontend/src/app/components/docs/api-docs.component.html @@ -275,6 +275,32 @@ +
+ GET Asset Icons Assets +
+
Endpoint
+ GET /liquid/api/v1/assets/icons +
+
+
Description
+
Get all the Asset IDs that has icons.
+
+ +
+ +
+ GET Asset Icon Assets +
+
Endpoint
+ GET /liquid/api/v1/asset/:asset_id/icon +
+
+
Description
+
Get the icon of the specified asset.
+
+ +
+
diff --git a/frontend/src/app/components/docs/api-docs.component.ts b/frontend/src/app/components/docs/api-docs.component.ts index bbc8cad76..2dd69ee33 100644 --- a/frontend/src/app/components/docs/api-docs.component.ts +++ b/frontend/src/app/components/docs/api-docs.component.ts @@ -642,24 +642,6 @@ export class ApiDocsComponent implements OnInit { console.log(asset); `, }, - codeSampleMainnet: { - esModule: [], - commonJS: [], - curl: [], - response: '' - }, - codeSampleTestnet: { - esModule: [], - commonJS: [], - curl: [], - response: '' - }, - codeSampleSignet: { - esModule: [], - commonJS: [], - curl: [], - response: '' - }, codeSampleLiquid: { esModule: [`6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d`], commonJS: [`6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d`], @@ -693,6 +675,60 @@ export class ApiDocsComponent implements OnInit { response: '' }, }, + assetIcons: { + codeTemplate: { + curl: `/api/v1/assets/icons`, + commonJS: ` + const { %{0}: { assets } } = mempoolJS(); + + const assetsIcons = await assets.getAssetsIcons(); + + document.getElementById("result").textContent = JSON.stringify(assetsIcons, undefined, 2); + `, + esModule: ` + const { %{0}: { assets } } = mempoolJS(); + + const assetsIcons = await assets.getAssetsIcons(); + console.log(assetsIcons); + `, + }, + codeSampleLiquid: { + esModule: [`6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d`], + commonJS: [`6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d`], + curl: [`6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d`], + response: `[ + "6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d", + "ce091c998b83c78bb71a632313ba3760f1763d9cfcffae02258ffa9865a37bd2" + ... +]`, + }, + }, + assetIcon: { + codeTemplate: { + curl: `/api/v1/asset/%{1}/icon`, + commonJS: ` + const { %{0}: { assets } } = mempoolJS(); + + const asset_id = '%{1}'; + const assetIcon = await assets.getAssetIcon({ asset_id }); + + document.getElementById("result").textContent = JSON.stringify(assetIcon, undefined, 2); + `, + esModule: ` + const { %{0}: { assets } } = mempoolJS(); + + const asset_id = '%{1}'; + const assetIcon = await assets.getAssetIcon({ asset_id }); + console.log(assetIcon); + `, + }, + codeSampleLiquid: { + esModule: [`6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d`], + commonJS: [`6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d`], + curl: [`6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d`], + response: `PNG`, + }, + }, assetTransactions: { codeTemplate: { curl: `/api/asset/%{1}/txs`,