From 8426ce4c7b17951c4cb8e2d47f9042f9094ccb76 Mon Sep 17 00:00:00 2001 From: ajiesaw Date: Tue, 22 Oct 2024 18:03:03 +0700 Subject: [PATCH 1/2] feat: add lists params for near --- stellar/frontend/src/app/application/create-round/page.tsx | 6 +++++- stellar/frontend/src/services/near/type.ts | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/stellar/frontend/src/app/application/create-round/page.tsx b/stellar/frontend/src/app/application/create-round/page.tsx index f6ff091c..0523a0e0 100644 --- a/stellar/frontend/src/app/application/create-round/page.tsx +++ b/stellar/frontend/src/app/application/create-round/page.tsx @@ -339,7 +339,11 @@ const CreateRoundPage = () => { use_compliance: data.allow_compliance || false, use_referrals: false, referrer_fee_basis_points: 0, - use_whitelist: false, + use_whitelist: checkedListIds.length > 0, + whitelisted_voters: + checkedListIds.length > 0 + ? checkedListIds.map((id) => id.toString()) + : [], voting_end_ms: data.voting_duration_end?.getTime() || 0, voting_start_ms: data.voting_duration_start?.getTime() || 0, num_picks_per_voter: data.vote_per_person, diff --git a/stellar/frontend/src/services/near/type.ts b/stellar/frontend/src/services/near/type.ts index c7b204fd..bc19a3ae 100644 --- a/stellar/frontend/src/services/near/type.ts +++ b/stellar/frontend/src/services/near/type.ts @@ -22,6 +22,7 @@ export type NearCreateRoundParams = { application_requires_video: boolean expected_amount: string use_whitelist: boolean | undefined + whitelisted_voters: string[] num_picks_per_voter: number max_participants: number | undefined use_cooldown: boolean From 4dd146c06505a721e879cdec2877910f4c642994 Mon Sep 17 00:00:00 2001 From: ajiesaw Date: Thu, 24 Oct 2024 12:05:10 +0700 Subject: [PATCH 2/2] fix: list param data type --- stellar/frontend/src/app/application/create-round/page.tsx | 5 +---- stellar/frontend/src/services/near/type.ts | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/stellar/frontend/src/app/application/create-round/page.tsx b/stellar/frontend/src/app/application/create-round/page.tsx index 0523a0e0..949d8906 100644 --- a/stellar/frontend/src/app/application/create-round/page.tsx +++ b/stellar/frontend/src/app/application/create-round/page.tsx @@ -340,10 +340,7 @@ const CreateRoundPage = () => { use_referrals: false, referrer_fee_basis_points: 0, use_whitelist: checkedListIds.length > 0, - whitelisted_voters: - checkedListIds.length > 0 - ? checkedListIds.map((id) => id.toString()) - : [], + wl_list_id: checkedListIds.length > 0 ? checkedListIds[0] : undefined, voting_end_ms: data.voting_duration_end?.getTime() || 0, voting_start_ms: data.voting_duration_start?.getTime() || 0, num_picks_per_voter: data.vote_per_person, diff --git a/stellar/frontend/src/services/near/type.ts b/stellar/frontend/src/services/near/type.ts index bc19a3ae..825391b7 100644 --- a/stellar/frontend/src/services/near/type.ts +++ b/stellar/frontend/src/services/near/type.ts @@ -22,7 +22,7 @@ export type NearCreateRoundParams = { application_requires_video: boolean expected_amount: string use_whitelist: boolean | undefined - whitelisted_voters: string[] + wl_list_id: bigint | undefined num_picks_per_voter: number max_participants: number | undefined use_cooldown: boolean