|
1 | 1 | import { CaipAccountId, CaipAssetType } from '@metamask/utils'; |
2 | 2 | import { InternalAccount } from '@metamask/keyring-internal-api'; |
| 3 | +import { |
| 4 | + SeasonDtoState, |
| 5 | + SeasonRewardType, |
| 6 | + SeasonStatusState, |
| 7 | +} from '../../../../shared/types/rewards'; |
3 | 8 |
|
4 | 9 | export type LoginResponseDto = { |
5 | 10 | sessionId: string; |
@@ -410,13 +415,6 @@ export type SeasonRewardDto = { |
410 | 415 | rewardType: SeasonRewardType; |
411 | 416 | }; |
412 | 417 |
|
413 | | -export enum SeasonRewardType { |
414 | | - Generic = 'Generic', |
415 | | - PerpsDiscount = 'PerpsDiscount', |
416 | | - PointsBoost = 'PointsBoost', |
417 | | - AlphaFoxInvite = 'AlphaFoxInvite', |
418 | | -} |
419 | | - |
420 | 418 | export type SeasonDto = { |
421 | 419 | id: string; |
422 | 420 | name: string; |
@@ -607,68 +605,6 @@ export type ThemeImage = { |
607 | 605 | darkModeUrl: string; |
608 | 606 | }; |
609 | 607 |
|
610 | | -export type ClaimRewardDto = { |
611 | | - data?: Record<string, string>; |
612 | | -}; |
613 | | - |
614 | | -// Serializable versions for state storage (Date objects converted to timestamps) |
615 | | -// eslint-disable-next-line @typescript-eslint/consistent-type-definitions |
616 | | -export type SeasonRewardDtoState = { |
617 | | - id: string; |
618 | | - name: string; |
619 | | - shortDescription: string; |
620 | | - longDescription: string; |
621 | | - shortUnlockedDescription: string; |
622 | | - longUnlockedDescription: string; |
623 | | - claimUrl?: string; |
624 | | - iconName: string; |
625 | | - rewardType: SeasonRewardType; |
626 | | -}; |
627 | | - |
628 | | -// eslint-disable-next-line @typescript-eslint/consistent-type-definitions |
629 | | -export type SeasonTierDtoState = { |
630 | | - id: string; |
631 | | - name: string; |
632 | | - pointsNeeded: number; |
633 | | - image: { |
634 | | - lightModeUrl: string; |
635 | | - darkModeUrl: string; |
636 | | - }; |
637 | | - levelNumber: string; |
638 | | - rewards: SeasonRewardDtoState[]; |
639 | | -}; |
640 | | - |
641 | | -// eslint-disable-next-line @typescript-eslint/consistent-type-definitions |
642 | | -export type SeasonDtoState = { |
643 | | - id: string; |
644 | | - name: string; |
645 | | - startDate: number; // timestamp |
646 | | - endDate: number; // timestamp |
647 | | - tiers: SeasonTierDtoState[]; |
648 | | - lastFetched?: number; |
649 | | -}; |
650 | | - |
651 | | -// eslint-disable-next-line @typescript-eslint/consistent-type-definitions |
652 | | -export type SeasonStatusBalanceDtoState = { |
653 | | - total: number; |
654 | | - updatedAt?: number; // timestamp |
655 | | -}; |
656 | | - |
657 | | -// eslint-disable-next-line @typescript-eslint/consistent-type-definitions |
658 | | -export type SeasonTierState = { |
659 | | - currentTier: SeasonTierDtoState; |
660 | | - nextTier: SeasonTierDtoState | null; |
661 | | - nextTierPointsNeeded: number | null; |
662 | | -}; |
663 | | - |
664 | | -// eslint-disable-next-line @typescript-eslint/consistent-type-definitions |
665 | | -export type SeasonStatusState = { |
666 | | - season: SeasonDtoState; |
667 | | - balance: SeasonStatusBalanceDtoState; |
668 | | - tier: SeasonTierState; |
669 | | - lastFetched?: number; |
670 | | -}; |
671 | | - |
672 | 608 | // eslint-disable-next-line @typescript-eslint/consistent-type-definitions |
673 | 609 | export type RewardsAccountState = { |
674 | 610 | account: CaipAccountId; |
|
0 commit comments