diff --git a/src/App.vue b/src/App.vue index 6c972b9..36de214 100644 --- a/src/App.vue +++ b/src/App.vue @@ -19,8 +19,8 @@
- - Add Fund + + Admin Register diff --git a/src/api/composed.ts b/src/api/composed.ts index 6f60f0c..3d8664c 100644 --- a/src/api/composed.ts +++ b/src/api/composed.ts @@ -7,6 +7,7 @@ import { CreateQueueRequest, CreateQueueResponse, CreateRewardFundRequest, + EditQueueRequest, GetBalanceRequest, GetBalanceResponse, GetContributionsRequest, @@ -19,6 +20,9 @@ import { GetRewardFundsRequest, GetRewardFundsResponse, LoginResponse, + NearlyCompleteFundsRequest, + NearlyCompleteFundsResponse, + QueueMember, SuccessResponse, } from '@/api/types'; @@ -49,8 +53,7 @@ export const createRewardFund = ( issuerWallet: string, memo: string, minContribution: number, - title: string, - description: string, + telegramLink: string, bonuses: Bonus[], queueID?: number | null | undefined, ) => controller.post('CreateRewardFund', { @@ -60,8 +63,7 @@ export const createRewardFund = ( issuerWallet, memo, minContribution, - title, - description, + telegramLink, bonuses, queueID, }); @@ -103,3 +105,10 @@ export const contribute = (privateKey: string, amount: number, rewardFund: numbe amount, rewardFund, }); + +export const getNearlyCompletedFunds = (threshold: number) => controller.post('NearlyCompleteFunds', { threshold }); + +export const reorderQueue = (queueID: number, fundOrders: QueueMember[]) => controller.post('EditQueue', { + queueID, + fundOrders, +}); diff --git a/src/api/types.ts b/src/api/types.ts index f51e5d7..cd25ab3 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -28,8 +28,7 @@ export interface RewardFund { amountGoal: number; minContribution: number; contributions: Contribution[] | null; - title: string; - description: string; + telegramLink: string; } export interface Queue { @@ -37,6 +36,12 @@ export interface Queue { name: string; } +export interface QueueMember { + id?: number; + asset: string; + order: number; +} + export interface CreateQueueRequest { name: string; } @@ -70,8 +75,7 @@ export interface CreateRewardFundRequest { issuerWallet: string; memo: string; minContribution: number; - title: string; - description: string; + telegramLink: string; queueID?: number | null; bonuses: Bonus[]; } @@ -87,8 +91,7 @@ export interface FundInfo { amountAvailable: number; amountGoal: number; minContribution: number; - title: string; - description: string; + telegramLink: string; bonuses: Bonus[]; queueID: number | null; } @@ -149,6 +152,24 @@ export interface Claims { exp: number; } +export interface NearlyCompletedFund { + id: number; + asset: string; + minContribution: number; + amountAvailable: number; + memo: string; + fundWallet: string; + raised: number; +} + +export interface NearlyCompleteFundsRequest { + threshold: number; +} + +export interface NearlyCompleteFundsResponse { + funds: NearlyCompletedFund[]; +} + export interface GetContributionsRequest { id: number; offset: number; @@ -162,3 +183,8 @@ export interface CloseRewardFundRequest { id: number; close: boolean; } + +export interface EditQueueRequest { + queueID: number; + fundOrders: QueueMember[]; +} diff --git a/src/components/EditQueue.vue b/src/components/EditQueue.vue index 8915e8b..755c2b8 100644 --- a/src/components/EditQueue.vue +++ b/src/components/EditQueue.vue @@ -1,7 +1,18 @@