From 5cb3505bbfde43588ba40ff91d7bf5ba0e3a90a9 Mon Sep 17 00:00:00 2001 From: Rodrigo Manuel Navarro Lajous <40175251+rlajous@users.noreply.github.com> Date: Tue, 16 May 2023 14:14:12 -0300 Subject: [PATCH] v0.0.14 * Added total with email * Added total with email * Added total with email --- packages/drops/package.json | 2 +- packages/drops/src/DropsClient.ts | 4 ++++ packages/drops/src/domain/Drop.ts | 8 +++++++- packages/drops/src/queries/PaginatedDrop.ts | 6 ++++++ packages/moments/package.json | 2 +- packages/providers/package.json | 2 +- packages/utils/package.json | 2 +- 7 files changed, 21 insertions(+), 5 deletions(-) diff --git a/packages/drops/package.json b/packages/drops/package.json index 85e02389..5139546c 100644 --- a/packages/drops/package.json +++ b/packages/drops/package.json @@ -1,6 +1,6 @@ { "name": "@poap-xyz/drops", - "version": "0.0.13", + "version": "0.0.14", "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 b09e1b1c..d0f640a0 100644 --- a/packages/drops/src/DropsClient.ts +++ b/packages/drops/src/DropsClient.ts @@ -73,6 +73,9 @@ export class DropsClient { year: Number(drop.year), poap_count: drop.stats ? Number(drop.stats.poap_count) : 0, transfer_count: drop.stats ? Number(drop.stats.transfer_count) : 0, + email_claim: drop.email_claims_stats + ? Number(drop.email_claims_stats.total) + : 0, }), ); @@ -129,6 +132,7 @@ export class DropsClient { created_date: drop.created_date, transfer_count: 0, poap_count: 0, + email_claim: 0, }); } } diff --git a/packages/drops/src/domain/Drop.ts b/packages/drops/src/domain/Drop.ts index b01bc381..e3de6bff 100644 --- a/packages/drops/src/domain/Drop.ts +++ b/packages/drops/src/domain/Drop.ts @@ -19,6 +19,7 @@ export class Drop { created_date: string; poap_count: number; transfer_count: number; + email_claim: number; constructor(properties: DropProperties) { this.id = properties.id; @@ -40,7 +41,11 @@ export class Drop { this.created_date = properties.created_date; this.poap_count = properties.poap_count; this.transfer_count = properties.transfer_count; - Object.assign(this, properties); + this.email_claim = properties.email_claim; + } + + public getTotalMinted(): number { + return this.poap_count + this.email_claim; } } @@ -64,4 +69,5 @@ export interface DropProperties { created_date: string; poap_count: number; transfer_count: number; + email_claim: number; } diff --git a/packages/drops/src/queries/PaginatedDrop.ts b/packages/drops/src/queries/PaginatedDrop.ts index 7dec8e46..60ca1099 100644 --- a/packages/drops/src/queries/PaginatedDrop.ts +++ b/packages/drops/src/queries/PaginatedDrop.ts @@ -27,6 +27,9 @@ export const PAGINATED_DROPS_QUERY = ` transfer_count poap_count } + email_claims_stats { + total + } } } `; @@ -53,6 +56,9 @@ export interface DropResponse { transfer_count: number; poap_count: number; }; + email_claims_stats: { + total: number; + }; } export interface PaginatedDropsResponse { diff --git a/packages/moments/package.json b/packages/moments/package.json index 78bc999d..65b212a8 100644 --- a/packages/moments/package.json +++ b/packages/moments/package.json @@ -1,6 +1,6 @@ { "name": "@poap-xyz/moments", - "version": "0.0.13", + "version": "0.0.14", "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 b8fb03e3..a9523b2b 100644 --- a/packages/providers/package.json +++ b/packages/providers/package.json @@ -1,6 +1,6 @@ { "name": "@poap-xyz/providers", - "version": "0.0.13", + "version": "0.0.14", "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 e194a4bc..a4ca9bf1 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@poap-xyz/utils", - "version": "0.0.13", + "version": "0.0.14", "description": "Utils module for the poap.js library", "type": "module", "main": "dist/cjs/index.cjs",