forked from tahowallet/extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabilities.ts
76 lines (67 loc) · 1.57 KB
/
abilities.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import { NormalizedEVMAddress } from "./types"
type HoldERC20 = {
type: "hold"
address: string
}
type OwnNFT = {
type: "own"
nftAddress: string
}
type AllowList = {
type: "allowList"
}
type Unknown = {
type: "unknown"
}
export type AbilityRequirement = HoldERC20 | OwnNFT | AllowList | Unknown
export const ABILITY_TYPES_ENABLED = [
"mint",
"airdrop",
"vote",
"access",
"claim",
] as const
// https://docs.daylight.xyz/reference/ability-model#ability-types
export const ABILITY_TYPES = [
...ABILITY_TYPES_ENABLED,
"event",
// Abilities type `article` and `result` will be fetched from the new endpoint.
// Let's exclude this type for a moment.
// TODO Fetch abilities from the correct endpoint.
// "article",
// "result",
"misc",
] as const
export type AbilityType = (typeof ABILITY_TYPES)[number]
export type Ability = {
type: AbilityType
title: string
description: string | null
abilityId: string
slug: string
linkUrl: string
imageUrl?: string
openAt?: string
closeAt?: string
completed: boolean
removedFromUi: boolean
address: NormalizedEVMAddress
requirement: AbilityRequirement
/**
* Order number from the most interesting to the user.
* A lower number indicates a more interesting ability.
* Rank is determined by the order in which data arrives from the Daylight API.
*/
interestRank: number
}
export const ABILITY_TYPE_COLOR = {
mint: "#20c580",
airdrop: "#FF1E6F",
vote: "#E3C10B",
result: "#E3C10B",
access: "#02C0EA",
event: "#FF8A1E",
article: "#B2B2B2",
misc: "#CBCBCB",
claim: "#F4D530",
}