Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions components/allowlist-tool/allowlist-tool.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ interface AllowlistPhaseComponentItem {
readonly tokensCount: number;
}

interface AllowlistPhaseComponentWithItems
extends AllowlistPhaseComponent {
interface AllowlistPhaseComponentWithItems extends AllowlistPhaseComponent {
readonly items: AllowlistPhaseComponentItem[];
}

Expand Down Expand Up @@ -127,6 +126,7 @@ export enum AllowlistOperationCode {

export interface AllowlistOperationBase {
readonly code: AllowlistOperationCode;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
readonly params: Record<string, any>;
}

Expand Down Expand Up @@ -187,13 +187,43 @@ export enum DistributionPlanTokenPoolDownloadStatus {
COMPLETED = "COMPLETED",
}

export enum DistributionPlanTokenPoolDownloadStage {
PREPARING = "PREPARING",
REQUEUED = "REQUEUED",
CLAIMED = "CLAIMED",
CHECKING_ALCHEMY = "CHECKING_ALCHEMY",
INDEXING_SINGLE = "INDEXING_SINGLE",
INDEXING_BATCH = "INDEXING_BATCH",
BUILDING_TOKEN_OWNERS = "BUILDING_TOKEN_OWNERS",
PERSISTING_RESULTS = "PERSISTING_RESULTS",
COMPLETED = "COMPLETED",
FAILED = "FAILED",
}

export interface DistributionPlanTokenPoolDownload {
readonly contract: string;
readonly tokenIds?: string | undefined;
readonly tokenPoolId: string;
readonly allowlistId: string;
readonly blockNo: number;
readonly status: DistributionPlanTokenPoolDownloadStatus;
readonly rawStatus: DistributionPlanTokenPoolDownloadStatus;
readonly stale: boolean;
readonly retryable: boolean;
readonly errorReason?: string | null;
readonly stage?: DistributionPlanTokenPoolDownloadStage | undefined;
readonly progress?: Record<string, unknown> | undefined;
readonly attemptCount: number;
readonly failureCount: number;
readonly createdAt?: number | undefined;
readonly updatedAt?: number | undefined;
readonly claimedAt?: number | undefined;
readonly lastHeartbeatAt?: number | undefined;
readonly completedAt?: number | undefined;
readonly failedAt?: number | undefined;
readonly lastFailureAt?: number | undefined;
readonly lastFailureReason?: string | null;
readonly consolidateBlockNo?: number | null;
}

export interface DistributionPlanSnapshotToken {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ export default function DistributionPlanNextStepBtn({
loading,
showNextBtn,
showSkipBtn,
disableNextBtn = false,
}: {
showRunAnalysisBtn: boolean;
onNextStep: () => void;
loading: boolean;
showNextBtn: boolean;
showSkipBtn: boolean;
disableNextBtn?: boolean;
}) {
const { runOperations } = useContext(DistributionPlanToolContext);
return (
Expand All @@ -24,24 +26,27 @@ export default function DistributionPlanNextStepBtn({
<button
onClick={onNextStep}
type="button"
className="tw-cursor-pointer tw-bg-transparent hover:tw-bg-iron-800/80 tw-px-4 tw-py-3 tw-text-sm tw-font-medium tw-text-white tw-border-2 tw-border-solid tw-border-iron-700 tw-rounded-lg tw-transition tw-duration-300 tw-ease-out">
className="tw-cursor-pointer tw-rounded-lg tw-border-2 tw-border-solid tw-border-iron-700 tw-bg-transparent tw-px-4 tw-py-3 tw-text-sm tw-font-medium tw-text-white tw-transition tw-duration-300 tw-ease-out hover:tw-bg-iron-800/80"
>
Skip
</button>
)}
{showRunAnalysisBtn && (
<button
onClick={runOperations}
type="button"
className="tw-inline-flex tw-items-center tw-justify-center tw-cursor-pointer tw-bg-transparent hover:tw-bg-iron-800/80 tw-px-4 tw-py-3 tw-text-sm tw-font-medium tw-text-white tw-border-2 tw-border-solid tw-border-iron-700 tw-rounded-lg tw-transition tw-duration-300 tw-ease-out">
className="tw-inline-flex tw-cursor-pointer tw-items-center tw-justify-center tw-rounded-lg tw-border-2 tw-border-solid tw-border-iron-700 tw-bg-transparent tw-px-4 tw-py-3 tw-text-sm tw-font-medium tw-text-white tw-transition tw-duration-300 tw-ease-out hover:tw-bg-iron-800/80"
>
Run analysis
</button>
)}
{!showRunAnalysisBtn && showNextBtn && (
<DistributionPlanPrimaryBtn
loading={loading}
isDisabled={false}
isDisabled={disableNextBtn}
type="button"
onClick={onNextStep}>
onClick={onNextStep}
>
Next
</DistributionPlanPrimaryBtn>
)}
Expand Down
Loading
Loading