Skip to content

Commit 97f5452

Browse files
Add support for ENS airdrop (#4196)
1 parent ee5c30c commit 97f5452

File tree

6 files changed

+36
-1
lines changed

6 files changed

+36
-1
lines changed

src/components/ActionsPanel/constants.ts

+24
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { TIcon } from '@components';
44
import {
55
ANTv1UUID,
66
DAPPNODE_AIRDROP_LINK,
7+
ENS_AIRDROP_LINK,
78
ETHUUID,
89
EXT_URLS,
910
FAUCET_NETWORKS,
@@ -152,6 +153,29 @@ export const actionTemplates: ActionTemplate[] = [
152153
},
153154
category: ACTION_CATEGORIES.THIRD_PARTY
154155
},
156+
{
157+
name: ACTION_NAME.CLAIM_ENS,
158+
heading: translateRaw('CLAIM_TOKENS_ACTION_HEADING', { $token: 'ENS' }),
159+
icon: 'ensLogo',
160+
subHeading: ClaimSubHead,
161+
body: [translate('CLAIM_TOKENS_ACTION_BODY', { $token: 'ENS' })],
162+
filter: ({ claims }: ActionFilters) =>
163+
claims[ClaimType.ENS]?.some((c) => c.state === ClaimState.UNCLAIMED),
164+
priority: 30,
165+
Component: ClaimTable,
166+
props: {
167+
type: ClaimType.ENS
168+
},
169+
button: {
170+
component: ActionButton,
171+
props: {
172+
content: translateRaw('CLAIM_TOKENS_ACTION_BUTTON'),
173+
to: ENS_AIRDROP_LINK,
174+
external: true
175+
}
176+
},
177+
category: ACTION_CATEGORIES.THIRD_PARTY
178+
},
155179
{
156180
name: ACTION_NAME.MIGRATE_LEND,
157181
heading: translateRaw('MIGRATE_LEND_ACTION_HEADING'),

src/config/data.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ export const UNISWAP_UNI_CLAIM_API = 'https://uni.mycryptoapi.com/claims';
5252
export const UNISWAP_TOKEN_DISTRIBUTOR = '0x090D4613473dEE047c3f2706764f49E0821D256e';
5353
export const DAPPNODE_CLAIM_API = 'https://dappnode.mycryptoapi.com/claims';
5454
export const DAPPNODE_TOKEN_DISTRIBUTOR = '0x87d6180b65ad76a9443064dcd1596388fcc3ee2a';
55+
export const ENS_CLAIM_API = 'https://ensclaims.mycryptoapi.com/v1/claims';
56+
export const ENS_TOKEN_DISTRIBUTOR = '0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72';
5557

5658
export const LETS_ENCRYPT_URL = 'https://letsencrypt.org/';
5759

src/config/links.ts

+1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ export const partnerLinks: Link[] = [
151151

152152
export const UNISWAP_LINK = 'https://app.uniswap.org/';
153153
export const DAPPNODE_AIRDROP_LINK = 'https://app.dappnode.io/nodedrop';
154+
export const ENS_AIRDROP_LINK = 'https://claim.ens.domains/';
154155

155156
export const MYC_WINTER_LINK = 'https://winter.mycrypto.com';
156157

src/services/ApiService/Claims/config.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import {
22
DAPPNODE_CLAIM_API,
33
DAPPNODE_TOKEN_DISTRIBUTOR,
4+
ENS_CLAIM_API,
5+
ENS_TOKEN_DISTRIBUTOR,
46
UNISWAP_TOKEN_DISTRIBUTOR,
57
UNISWAP_UNI_CLAIM_API
68
} from '@config';
@@ -14,5 +16,9 @@ export const CLAIM_CONFIG = {
1416
[ClaimType.NODE]: {
1517
api: DAPPNODE_CLAIM_API,
1618
tokenDistributor: DAPPNODE_TOKEN_DISTRIBUTOR
19+
},
20+
[ClaimType.ENS]: {
21+
api: ENS_CLAIM_API,
22+
tokenDistributor: ENS_TOKEN_DISTRIBUTOR
1723
}
1824
};

src/types/claims.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { ITxValue } from './transactionFlow';
33

44
export enum ClaimType {
55
UNI = 'UNI',
6-
NODE = 'NODE'
6+
NODE = 'NODE',
7+
ENS = 'ENS'
78
}
89

910
export enum ClaimState {

src/types/userAction.ts

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export enum ACTION_NAME {
1414
MIGRATE_ANT = 'migrate_ant',
1515
CLAIM_UNI = 'claim_uni',
1616
CLAIM_DAPPNODE = 'claim_dappnode',
17+
CLAIM_ENS = 'claim_ens',
1718
RENEW_ENS = 'renew_ens',
1819
BUY_HW = 'buy_hw',
1920
MYC_MEMBERSHIP = 'myc_membership',

0 commit comments

Comments
 (0)