Skip to content

Commit

Permalink
Add support for ENS airdrop (#4196)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikBolding authored Nov 10, 2021
1 parent ee5c30c commit 97f5452
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 1 deletion.
24 changes: 24 additions & 0 deletions src/components/ActionsPanel/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { TIcon } from '@components';
import {
ANTv1UUID,
DAPPNODE_AIRDROP_LINK,
ENS_AIRDROP_LINK,
ETHUUID,
EXT_URLS,
FAUCET_NETWORKS,
Expand Down Expand Up @@ -152,6 +153,29 @@ export const actionTemplates: ActionTemplate[] = [
},
category: ACTION_CATEGORIES.THIRD_PARTY
},
{
name: ACTION_NAME.CLAIM_ENS,
heading: translateRaw('CLAIM_TOKENS_ACTION_HEADING', { $token: 'ENS' }),
icon: 'ensLogo',
subHeading: ClaimSubHead,
body: [translate('CLAIM_TOKENS_ACTION_BODY', { $token: 'ENS' })],
filter: ({ claims }: ActionFilters) =>
claims[ClaimType.ENS]?.some((c) => c.state === ClaimState.UNCLAIMED),
priority: 30,
Component: ClaimTable,
props: {
type: ClaimType.ENS
},
button: {
component: ActionButton,
props: {
content: translateRaw('CLAIM_TOKENS_ACTION_BUTTON'),
to: ENS_AIRDROP_LINK,
external: true
}
},
category: ACTION_CATEGORIES.THIRD_PARTY
},
{
name: ACTION_NAME.MIGRATE_LEND,
heading: translateRaw('MIGRATE_LEND_ACTION_HEADING'),
Expand Down
2 changes: 2 additions & 0 deletions src/config/data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export const UNISWAP_UNI_CLAIM_API = 'https://uni.mycryptoapi.com/claims';
export const UNISWAP_TOKEN_DISTRIBUTOR = '0x090D4613473dEE047c3f2706764f49E0821D256e';
export const DAPPNODE_CLAIM_API = 'https://dappnode.mycryptoapi.com/claims';
export const DAPPNODE_TOKEN_DISTRIBUTOR = '0x87d6180b65ad76a9443064dcd1596388fcc3ee2a';
export const ENS_CLAIM_API = 'https://ensclaims.mycryptoapi.com/v1/claims';
export const ENS_TOKEN_DISTRIBUTOR = '0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72';

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

Expand Down
1 change: 1 addition & 0 deletions src/config/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ export const partnerLinks: Link[] = [

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

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

Expand Down
6 changes: 6 additions & 0 deletions src/services/ApiService/Claims/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {
DAPPNODE_CLAIM_API,
DAPPNODE_TOKEN_DISTRIBUTOR,
ENS_CLAIM_API,
ENS_TOKEN_DISTRIBUTOR,
UNISWAP_TOKEN_DISTRIBUTOR,
UNISWAP_UNI_CLAIM_API
} from '@config';
Expand All @@ -14,5 +16,9 @@ export const CLAIM_CONFIG = {
[ClaimType.NODE]: {
api: DAPPNODE_CLAIM_API,
tokenDistributor: DAPPNODE_TOKEN_DISTRIBUTOR
},
[ClaimType.ENS]: {
api: ENS_CLAIM_API,
tokenDistributor: ENS_TOKEN_DISTRIBUTOR
}
};
3 changes: 2 additions & 1 deletion src/types/claims.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { ITxValue } from './transactionFlow';

export enum ClaimType {
UNI = 'UNI',
NODE = 'NODE'
NODE = 'NODE',
ENS = 'ENS'
}

export enum ClaimState {
Expand Down
1 change: 1 addition & 0 deletions src/types/userAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export enum ACTION_NAME {
MIGRATE_ANT = 'migrate_ant',
CLAIM_UNI = 'claim_uni',
CLAIM_DAPPNODE = 'claim_dappnode',
CLAIM_ENS = 'claim_ens',
RENEW_ENS = 'renew_ens',
BUY_HW = 'buy_hw',
MYC_MEMBERSHIP = 'myc_membership',
Expand Down

0 comments on commit 97f5452

Please sign in to comment.