Changing API path and updating API Docs for asset icons.
This commit is contained in:
parent
a4569788f8
commit
b1c9334119
@ -272,8 +272,8 @@ class Server {
|
|||||||
|
|
||||||
if (config.MEMPOOL.NETWORK === 'liquid') {
|
if (config.MEMPOOL.NETWORK === 'liquid') {
|
||||||
this.app
|
this.app
|
||||||
.get(config.MEMPOOL.API_URL_PREFIX + 'liquid/icons', routes.getAllLiquidIcon)
|
.get(config.MEMPOOL.API_URL_PREFIX + 'assets/icons', routes.getAllLiquidIcon)
|
||||||
.get(config.MEMPOOL.API_URL_PREFIX + 'liquid/icon/:assetId', routes.getLiquidIcon)
|
.get(config.MEMPOOL.API_URL_PREFIX + 'asset/:assetId/icon', routes.getLiquidIcon)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,8 +30,10 @@
|
|||||||
<ng-template [ngIf]="network.val === 'liquid'">
|
<ng-template [ngIf]="network.val === 'liquid'">
|
||||||
<p>Assets</p>
|
<p>Assets</p>
|
||||||
<a [routerLink]="['./']" fragment="get-assets" (click)="collapseItem.toggle()">GET Assets</a>
|
<a [routerLink]="['./']" fragment="get-assets" (click)="collapseItem.toggle()">GET Assets</a>
|
||||||
|
<a [routerLink]="['./']" fragment="get-assets-icons" (click)="collapseItem.toggle()">GET Assets Icons</a>
|
||||||
<a [routerLink]="['./']" fragment="get-asset-transactions" (click)="collapseItem.toggle()">GET Asset Transactions</a>
|
<a [routerLink]="['./']" fragment="get-asset-transactions" (click)="collapseItem.toggle()">GET Asset Transactions</a>
|
||||||
<a [routerLink]="['./']" fragment="get-asset-supply" (click)="collapseItem.toggle()">GET Asset Supply</a>
|
<a [routerLink]="['./']" fragment="get-asset-supply" (click)="collapseItem.toggle()">GET Asset Supply</a>
|
||||||
|
<a [routerLink]="['./']" fragment="get-asset-icon" (click)="collapseItem.toggle()">GET Asset Icon</a>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
<p>Blocks</p>
|
<p>Blocks</p>
|
||||||
|
@ -275,6 +275,32 @@
|
|||||||
<app-code-template [hostname]="hostname" [code]="code.assetSupply" [network]="network.val" ></app-code-template>
|
<app-code-template [hostname]="hostname" [code]="code.assetSupply" [network]="network.val" ></app-code-template>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="endpoint-container" id="get-assets-icons">
|
||||||
|
<a class="section-header" [routerLink]="['./']" fragment="get-assets-icons">GET Asset Icons <span>Assets</span></a>
|
||||||
|
<div class="endpoint">
|
||||||
|
<div class="subtitle" i18n="Api docs endpoint">Endpoint</div>
|
||||||
|
<a [href]="wrapUrl(network.val, code.assetIcons)" target="_blank">GET /liquid/api/v1/assets/icons</a>
|
||||||
|
</div>
|
||||||
|
<div class="description">
|
||||||
|
<div class="subtitle" i18n>Description</div>
|
||||||
|
<div>Get all the Asset IDs that has icons.</div>
|
||||||
|
</div>
|
||||||
|
<app-code-template [hostname]="hostname" [code]="code.assetIcons" [network]="network.val" ></app-code-template>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="endpoint-container" id="get-asset-icon">
|
||||||
|
<a class="section-header" [routerLink]="['./']" fragment="get-asset-icon">GET Asset Icon <span>Assets</span></a>
|
||||||
|
<div class="endpoint">
|
||||||
|
<div class="subtitle" i18n="Api docs endpoint">Endpoint</div>
|
||||||
|
<a [href]="wrapUrl(network.val, code.assetIcon)" target="_blank">GET /liquid/api/v1/asset/:asset_id/icon</a>
|
||||||
|
</div>
|
||||||
|
<div class="description">
|
||||||
|
<div class="subtitle" i18n>Description</div>
|
||||||
|
<div>Get the icon of the specified asset.</div>
|
||||||
|
</div>
|
||||||
|
<app-code-template [hostname]="hostname" [code]="code.assetIcon" [network]="network.val" ></app-code-template>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="api-category">
|
<div class="api-category">
|
||||||
|
@ -642,24 +642,6 @@ export class ApiDocsComponent implements OnInit {
|
|||||||
console.log(asset);
|
console.log(asset);
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
codeSampleMainnet: {
|
|
||||||
esModule: [],
|
|
||||||
commonJS: [],
|
|
||||||
curl: [],
|
|
||||||
response: ''
|
|
||||||
},
|
|
||||||
codeSampleTestnet: {
|
|
||||||
esModule: [],
|
|
||||||
commonJS: [],
|
|
||||||
curl: [],
|
|
||||||
response: ''
|
|
||||||
},
|
|
||||||
codeSampleSignet: {
|
|
||||||
esModule: [],
|
|
||||||
commonJS: [],
|
|
||||||
curl: [],
|
|
||||||
response: ''
|
|
||||||
},
|
|
||||||
codeSampleLiquid: {
|
codeSampleLiquid: {
|
||||||
esModule: [`6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d`],
|
esModule: [`6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d`],
|
||||||
commonJS: [`6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d`],
|
commonJS: [`6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d`],
|
||||||
@ -693,6 +675,60 @@ export class ApiDocsComponent implements OnInit {
|
|||||||
response: ''
|
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: {
|
assetTransactions: {
|
||||||
codeTemplate: {
|
codeTemplate: {
|
||||||
curl: `/api/asset/%{1}/txs`,
|
curl: `/api/asset/%{1}/txs`,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user