diff --git a/pages/owned/index.vue b/pages/owned/index.vue index 80651c8..3795d6e 100644 --- a/pages/owned/index.vue +++ b/pages/owned/index.vue @@ -15,7 +15,7 @@ #{{ i + 1 }} @@ -28,7 +28,11 @@ - +
+
{{ new BigNumber(item.price).shiftedBy(-9).toFixed() }}LIKE
+
till {{ item.expiration }}
+
+ @@ -38,6 +42,7 @@ diff --git a/utils/cosmos.ts b/utils/cosmos.ts index 4e1e1f4..c8daaa9 100644 --- a/utils/cosmos.ts +++ b/utils/cosmos.ts @@ -197,6 +197,21 @@ export async function getRecentBuyNFTEvents() { return events; } +export async function getNFTMarketplaceListing(creator: string) { + const items = [] as any[]; + let key = ''; + do { + const { data } = await axios.get( + `${LCD_URL}/likechain/likenft/v1/marketplace?type=listing&creator=${creator}&pagination.key=${key}` + ); + key = data.pagination.next_key; + if (data.items) { + items.push(...data.items); + } + } while (key); + return items; +} + export async function getNFTs({ classId = '', owner = '', needCount = 0 }) { const baseURL = `${LCD_URL}/cosmos/nft/v1beta1/nfts?owner=${owner}&class_id=${classId}`; const nfts = [];