mirror of
https://github.com/mempool/mempool.git
synced 2025-01-18 13:24:01 +01:00
Change Asset Icon API example to only show HTML
This commit is contained in:
parent
e332789afc
commit
533653e54a
@ -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() { }
|
||||
|
||||
|
@ -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`],
|
||||
|
@ -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>`;
|
||||
|
Loading…
Reference in New Issue
Block a user