Change Asset Icon API example to only show HTML

This commit is contained in:
softsimon 2021-12-23 15:35:17 +04:00
parent e332789afc
commit 533653e54a
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
3 changed files with 7 additions and 16 deletions

View File

@ -8,7 +8,7 @@ import { Component, OnInit, Input } from '@angular/core';
export class ApiDocsNavComponent implements OnInit {
@Input() network: any;
@Input() collapseItem: any;
@Input() collapseItem: any = { toggle: () => {} };
constructor() { }

View File

@ -704,23 +704,10 @@ export class ApiDocsComponent implements OnInit {
},
},
assetIcon: {
noWrap: true,
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);
`,
commonJS: `<img src="https://liquid.place/api/v1/asset/%{1}/icon">`,
},
codeSampleLiquid: {
esModule: [`6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d`],

View File

@ -164,6 +164,10 @@ init();`;
codeText = this.replaceJSPlaceholder(codeText, code.codeSampleBisq.esModule);
}
if (code.noWrap) {
return codeText;
}
let importText = `<script src="https://mempool.space/mempool.js"></script>`;
if (this.env.BASE_MODULE === 'bisq') {
importText = `<script src="https://bisq.markets/bisq.js"></script>`;