Adding support for Asset Icon API endpoints
This commit is contained in:
parent
d238b1a779
commit
4893ff1d81
@ -16,8 +16,10 @@ Interface to access Liquid APIs.
|
||||
- [Get Address Txs Utxo](#get-address-txs-utxo)
|
||||
- Assets
|
||||
- [Get Asset](#get-asset)
|
||||
- [Get Asset Icon](#get-asset-icon)
|
||||
- [Get Asset Txs](#get-asset-txs)
|
||||
- [Get Asset Supply](#get-asset-supply)
|
||||
- [Get Assets Icons](#get-assets-icons)
|
||||
- Blocks
|
||||
- [Get Block](#get-block)
|
||||
- [Get Block Status](#get-block-status)
|
||||
|
@ -7,6 +7,11 @@ export const useAssets = (api: AxiosInstance): AssetsInstance => {
|
||||
return data;
|
||||
};
|
||||
|
||||
const getAssetIcon = async (params: { asset_id: string }) => {
|
||||
const { data } = await api.get<BinaryData>(`/v1/asset/${params.asset_id}/icon`);
|
||||
return data;
|
||||
};
|
||||
|
||||
const getAssetTxs = async (params: {
|
||||
asset_id: string;
|
||||
is_mempool: boolean;
|
||||
@ -29,9 +34,16 @@ export const useAssets = (api: AxiosInstance): AssetsInstance => {
|
||||
return data;
|
||||
};
|
||||
|
||||
const getAssetsIcons = async () => {
|
||||
const { data } = await api.get<string[]>(`/v1/assets/icons`);
|
||||
return data;
|
||||
};
|
||||
|
||||
return {
|
||||
getAsset,
|
||||
getAssetIcon,
|
||||
getAssetTxs,
|
||||
getAssetSupply,
|
||||
getAssetsIcons,
|
||||
};
|
||||
};
|
||||
|
@ -16,6 +16,7 @@ interface AssetStats {
|
||||
|
||||
export interface AssetsInstance {
|
||||
getAsset: (params: { asset_id: string }) => Promise<Asset>;
|
||||
getAssetIcon: (params: { asset_id: string }) => Promise<BinaryData>;
|
||||
getAssetTxs: (params: {
|
||||
asset_id: string;
|
||||
is_mempool: boolean;
|
||||
@ -24,4 +25,5 @@ export interface AssetsInstance {
|
||||
asset_id: string;
|
||||
decimal: boolean;
|
||||
}) => Promise<Asset>;
|
||||
getAssetsIcons: () => Promise<string[]>
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user