Skip to content

Commit

Permalink
v0.0.14
Browse files Browse the repository at this point in the history
* Added total with email

* Added total with email

* Added total with email
  • Loading branch information
rlajous authored May 16, 2023
1 parent a5b1566 commit 5cb3505
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/drops/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/drops/src/DropsClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
);

Expand Down Expand Up @@ -129,6 +132,7 @@ export class DropsClient {
created_date: drop.created_date,
transfer_count: 0,
poap_count: 0,
email_claim: 0,
});
}
}
8 changes: 7 additions & 1 deletion packages/drops/src/domain/Drop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
}

Expand All @@ -64,4 +69,5 @@ export interface DropProperties {
created_date: string;
poap_count: number;
transfer_count: number;
email_claim: number;
}
6 changes: 6 additions & 0 deletions packages/drops/src/queries/PaginatedDrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ export const PAGINATED_DROPS_QUERY = `
transfer_count
poap_count
}
email_claims_stats {
total
}
}
}
`;
Expand All @@ -53,6 +56,9 @@ export interface DropResponse {
transfer_count: number;
poap_count: number;
};
email_claims_stats: {
total: number;
};
}

export interface PaginatedDropsResponse {
Expand Down
2 changes: 1 addition & 1 deletion packages/moments/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/providers/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 5cb3505

Please sign in to comment.