Skip to content

Commit

Permalink
khanhpv - update sdk campaign airdrop
Browse files Browse the repository at this point in the history
  • Loading branch information
khanhpv5 committed May 27, 2024
1 parent 5778ac6 commit e9d6cbe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/extension-koni-ui/src/connector/booka/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { SWStorage } from '@subwallet/extension-base/storage';
import { createPromiseHandler } from '@subwallet/extension-base/utils';
import { AirdropCampaignRecord, BookaAccount, EnergyConfig, Game, GameInventoryItem, GameItem, GamePlay, LeaderboardPerson, ReferralRecord, Task, TaskCategory } from '@subwallet/extension-koni-ui/connector/booka/types';
import { AirdropCampaign, BookaAccount, EnergyConfig, Game, GameInventoryItem, GameItem, GamePlay, LeaderboardPerson, ReferralRecord, Task, TaskCategory } from '@subwallet/extension-koni-ui/connector/booka/types';
import { TelegramConnector } from '@subwallet/extension-koni-ui/connector/telegram';
import { signRaw } from '@subwallet/extension-koni-ui/messaging';
import { InGameItem } from '@subwallet/extension-koni-ui/Popup/Home/Games/types';
Expand Down Expand Up @@ -488,7 +488,7 @@ export class BookaSdk {
}

async fetchAirdropCampaign () {
const airdropCampaignResponse = await this.getRequest<AirdropCampaignRecord[]>(`${GAME_API_HOST}/api/airdrop/list-airdrop-campaign`);
const airdropCampaignResponse = await this.getRequest<AirdropCampaign[]>(`${GAME_API_HOST}/api/airdrop/list-airdrop-campaign`);

if (airdropCampaignResponse) {
this.airdropCampaign.next(airdropCampaignResponse);
Expand Down
19 changes: 12 additions & 7 deletions packages/extension-koni-ui/src/connector/booka/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export interface GameInventoryItem {
}
}


export interface Game {
id: number;
contentId: number;
Expand Down Expand Up @@ -174,8 +173,12 @@ export interface ReferralRecord {
referralSuccessTime: number;
accountInfo: AccountPublicInfo;
}

export interface AirdropCampaignRecord {
export enum AirdropCampaignStatus {
ACTIVE = 'ACTIVE',
INACTIVE = 'INACTIVE',
CANCELED = 'CANCELED',
}
export interface AirdropCampaign {
id: number;
name: string;
icon: string;
Expand All @@ -184,15 +187,17 @@ export interface AirdropCampaignRecord {
end_snapshot: Date;
start_claim: Date;
end_claim: Date;
eligibility_date: Date;
network: string;
total_tokens: number;
symbol: string;
decimal: number;
method: string;
raffle_count: number;
eligibility_criteria: JSON;
tokenDistributions: JSON;
npsDistributions: JSON;
start: Date;
end: Date;
status: string;
start: Date,
end: Date
createdAt: Date;
updatedAt: Date;
}

0 comments on commit e9d6cbe

Please sign in to comment.