diff --git a/examples/drops/backend/src/methods/fetch_multiple_drops.ts b/examples/drops/backend/src/methods/fetch_multiple_drops.ts index 28d89906..9588839a 100644 --- a/examples/drops/backend/src/methods/fetch_multiple_drops.ts +++ b/examples/drops/backend/src/methods/fetch_multiple_drops.ts @@ -6,8 +6,6 @@ export const fetch_multiple_drops = async ( ): Promise => { const data: PaginatedResult = await client.fetch({ order: 'asc', - key: '', - value: '', limit: 10, offset: 1, }); diff --git a/packages/drops/package.json b/packages/drops/package.json index c084dca4..85e02389 100644 --- a/packages/drops/package.json +++ b/packages/drops/package.json @@ -1,6 +1,6 @@ { "name": "@poap-xyz/drops", - "version": "0.0.12", + "version": "0.0.13", "description": "Drops module for the poap.js library", "main": "dist/cjs/index.cjs", "module": "dist/esm/index.mjs", diff --git a/packages/drops/src/DropsClient.ts b/packages/drops/src/DropsClient.ts index 28cf5be7..b09e1b1c 100644 --- a/packages/drops/src/DropsClient.ts +++ b/packages/drops/src/DropsClient.ts @@ -71,6 +71,8 @@ export class DropsClient { ...drop, id: Number(drop.id), year: Number(drop.year), + poap_count: drop.stats ? Number(drop.stats.poap_count) : 0, + transfer_count: drop.stats ? Number(drop.stats.transfer_count) : 0, }), ); @@ -125,6 +127,8 @@ export class DropsClient { timezone: drop.timezone, private: drop.private_event, created_date: drop.created_date, + transfer_count: 0, + poap_count: 0, }); } } diff --git a/packages/drops/src/domain/Drop.ts b/packages/drops/src/domain/Drop.ts index 43c3a010..b01bc381 100644 --- a/packages/drops/src/domain/Drop.ts +++ b/packages/drops/src/domain/Drop.ts @@ -17,6 +17,8 @@ export class Drop { timezone: string; private: boolean; created_date: string; + poap_count: number; + transfer_count: number; constructor(properties: DropProperties) { this.id = properties.id; @@ -36,6 +38,8 @@ export class Drop { this.timezone = properties.timezone; this.private = properties.private; this.created_date = properties.created_date; + this.poap_count = properties.poap_count; + this.transfer_count = properties.transfer_count; Object.assign(this, properties); } } @@ -58,4 +62,6 @@ export interface DropProperties { timezone: string; private: boolean; created_date: string; + poap_count: number; + transfer_count: number; } diff --git a/packages/drops/src/queries/PaginatedDrop.ts b/packages/drops/src/queries/PaginatedDrop.ts index 4ca15f81..7dec8e46 100644 --- a/packages/drops/src/queries/PaginatedDrop.ts +++ b/packages/drops/src/queries/PaginatedDrop.ts @@ -23,10 +23,9 @@ export const PAGINATED_DROPS_QUERY = ` timezone private created_date - } - drops_aggregate(where: $where) { - aggregate { - count + stats { + transfer_count + poap_count } } } @@ -50,15 +49,14 @@ export interface DropResponse { timezone: string; private: boolean; created_date: string; + stats: { + transfer_count: number; + poap_count: number; + }; } export interface PaginatedDropsResponse { data: { drops: DropResponse[]; - drops_aggregate: { - aggregate: { - count: number; - }; - }; }; } diff --git a/packages/moments/package.json b/packages/moments/package.json index d4428098..78bc999d 100644 --- a/packages/moments/package.json +++ b/packages/moments/package.json @@ -1,6 +1,6 @@ { "name": "@poap-xyz/moments", - "version": "0.0.12", + "version": "0.0.13", "description": "Moments module for the poap.js library", "main": "dist/cjs/index.cjs", "module": "dist/esm/index.mjs", diff --git a/packages/providers/package.json b/packages/providers/package.json index 3adee2de..b8fb03e3 100644 --- a/packages/providers/package.json +++ b/packages/providers/package.json @@ -1,6 +1,6 @@ { "name": "@poap-xyz/providers", - "version": "0.0.12", + "version": "0.0.13", "description": "Providers module for the poap.js library", "main": "dist/cjs/index.cjs", "module": "dist/esm/index.mjs", diff --git a/packages/utils/package.json b/packages/utils/package.json index bfe64650..e194a4bc 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@poap-xyz/utils", - "version": "0.0.12", + "version": "0.0.13", "description": "Utils module for the poap.js library", "type": "module", "main": "dist/cjs/index.cjs",