Skip to content

Commit

Permalink
v0.0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
rlajous authored May 15, 2023
1 parent e54ce00 commit dd779b9
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 15 deletions.
2 changes: 0 additions & 2 deletions examples/drops/backend/src/methods/fetch_multiple_drops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ export const fetch_multiple_drops = async (
): Promise<void> => {
const data: PaginatedResult<Drop> = await client.fetch({
order: 'asc',
key: '',
value: '',
limit: 10,
offset: 1,
});
Expand Down
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.12",
"version": "0.0.13",
"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 @@ -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,
}),
);

Expand Down Expand Up @@ -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,
});
}
}
6 changes: 6 additions & 0 deletions packages/drops/src/domain/Drop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
}
Expand All @@ -58,4 +62,6 @@ export interface DropProperties {
timezone: string;
private: boolean;
created_date: string;
poap_count: number;
transfer_count: number;
}
16 changes: 7 additions & 9 deletions packages/drops/src/queries/PaginatedDrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ export const PAGINATED_DROPS_QUERY = `
timezone
private
created_date
}
drops_aggregate(where: $where) {
aggregate {
count
stats {
transfer_count
poap_count
}
}
}
Expand All @@ -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;
};
};
};
}
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.12",
"version": "0.0.13",
"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.12",
"version": "0.0.13",
"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.12",
"version": "0.0.13",
"description": "Utils module for the poap.js library",
"type": "module",
"main": "dist/cjs/index.cjs",
Expand Down

0 comments on commit dd779b9

Please sign in to comment.