Skip to content

Commit c92e797

Browse files
authored
Merge pull request #14185 from ethereum/new-to-crypto-wallets
refactor: extract protected newToCrypto array
2 parents 74595c6 + 4e1b569 commit c92e797

File tree

4 files changed

+22
-41
lines changed

4 files changed

+22
-41
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99

1010
# Owners of specific files
1111
/src/data/consensus-bounty-hunters.json @djrtwo @asanso @fredriksvantes
12+
/src/data/wallets/new-to-crypto.ts @konopkja @minimalsm

.github/workflows/wallets-check.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/data/wallets/new-to-crypto.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import type { WalletName } from "./wallet-data"
2+
3+
export const newToCrypto: WalletName[] = [
4+
"Coinbase Wallet",
5+
"Rainbow",
6+
"MEW wallet",
7+
"Zerion Wallet",
8+
"OneKey",
9+
]

src/data/wallets/wallet-data.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { WalletData } from "@/lib/types"
22

3+
import { newToCrypto } from "./new-to-crypto"
4+
35
import OneInchWalletImage from "@/public/images/wallets/1inch.png"
46
import AlphaWalletImage from "@/public/images/wallets/alpha.png"
57
import AmbireImage from "@/public/images/wallets/ambire.png"
@@ -40,7 +42,7 @@ import TrustWalletImage from "@/public/images/wallets/trustwallet.png"
4042
import UnstoppableWalletImage from "@/public/images/wallets/unstoppable.png"
4143
import ZerionImage from "@/public/images/wallets/zerion.png"
4244

43-
export const walletsData: WalletData[] = [
45+
const walletsData = [
4446
{
4547
last_updated: "2024-10-30",
4648
name: "Keystone",
@@ -235,7 +237,6 @@ export const walletsData: WalletData[] = [
235237
social_recovery: false,
236238
onboard_documentation: "https://www.coinbase.com/wallet/tutorials",
237239
documentation: "",
238-
new_to_crypto: true,
239240
// note: "Community contribution, let's follow up with Coinbase",
240241
},
241242
{
@@ -789,7 +790,6 @@ export const walletsData: WalletData[] = [
789790
social_recovery: false,
790791
onboard_documentation: "https://www.mewtopia.com/",
791792
documentation: "https://help.myetherwallet.com/en/",
792-
new_to_crypto: true,
793793
},
794794
{
795795
last_updated: "2022-06-24",
@@ -1092,7 +1092,6 @@ export const walletsData: WalletData[] = [
10921092
social_recovery: false,
10931093
onboard_documentation: "https://learn.rainbow.me/",
10941094
documentation: "",
1095-
new_to_crypto: true,
10961095
},
10971096
{
10981097
last_updated: "2024-09-01",
@@ -1335,7 +1334,6 @@ export const walletsData: WalletData[] = [
13351334
social_recovery: false,
13361335
onboard_documentation: "",
13371336
documentation: "",
1338-
new_to_crypto: false,
13391337
},
13401338
{
13411339
last_updated: "2024-09-26",
@@ -1396,7 +1394,6 @@ export const walletsData: WalletData[] = [
13961394
onboard_documentation:
13971395
"https://help.zerion.io/en/collections/5525626-zerion-wallet",
13981396
documentation: "https://help.zerion.io/en/",
1399-
new_to_crypto: true,
14001397
},
14011398
{
14021399
last_updated: "2022-08-31",
@@ -1642,7 +1639,6 @@ export const walletsData: WalletData[] = [
16421639
social_recovery: false,
16431640
onboard_documentation: "https://help.onekey.so/hc/en-us",
16441641
documentation: "https://developer.onekey.so/guide/introduction",
1645-
new_to_crypto: true,
16461642
},
16471643
{
16481644
last_updated: "2023-04-21",
@@ -2081,6 +2077,13 @@ export const walletsData: WalletData[] = [
20812077
onboard_documentation: "https://clear-wallet.flashsoft.eu/",
20822078
documentation: "https://clear-wallet.flashsoft.eu/docs/",
20832079
},
2084-
]
2080+
] as const satisfies Omit<WalletData, "new_to_crypto">[]
2081+
2082+
export type WalletName = (typeof walletsData)[number]["name"]
2083+
2084+
const allWalletData = walletsData.map((wallet) => ({
2085+
...wallet,
2086+
new_to_crypto: newToCrypto.includes(wallet.name),
2087+
})) as WalletData[]
20852088

2086-
export default walletsData
2089+
export default allWalletData

0 commit comments

Comments
 (0)