Skip to content

Commit

Permalink
feat(meme): hide meme coins from supported list
Browse files Browse the repository at this point in the history
  • Loading branch information
milan-bc committed Oct 8, 2024
1 parent 3e96b9f commit cf8df7e
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export const getData = (state) => {
(products.includes('PrivateKey') ||
products.includes('CustodialWalletBalance') ||
products.includes('DynamicSelfCustody')) &&
coinfig.type.name !== 'FIAT'
coinfig.type.name !== 'FIAT' &&
!coinfig.categories.some((cat) => cat?.id === 'MEME')
)
})
.map((coinfig) => ({ text: coinfig.name, value: coinfig.symbol }))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as QuoteSummaryViewModel from './quoteSummaryViewModel'
const makeCoins = (): Coins => ({
BTC: {
coinfig: {
categories: [],
displaySymbol: 'BTC',
name: 'Bitcoin',
precision: 8,
Expand All @@ -22,6 +23,7 @@ const makeCoins = (): Coins => ({
},
USD: {
coinfig: {
categories: [],
displaySymbol: 'USD',
name: 'US Dollar',
precision: 2,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const makeCoinfig = () => ({
categories: [],
displaySymbol: '',
name: '',
precision: 10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ addEventListener('message', ({ data }) => {
let assets = {}
const supportedCoins = custodialAssets.currencies.concat(erc20Assets.currencies)

supportedCoins.forEach((coin) => {
assets[coin.symbol] = { coinfig: coin }
})
supportedCoins
.filter((coin) => !coin.categories.some((cat) => cat?.id === 'MEME'))
.forEach((coin) => {
console.log('coin', coin)
assets[coin.symbol] = { coinfig: coin }
})

assets.MATIC.coinfig.type.logoPngUrl = assets['MATIC.MATIC'].coinfig.type.logoPngUrl
assets.STX.coinfig.products.push('DynamicSelfCustody')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as selectors from './selectors'
const COINS_STUB: Window['coins'] = {
USDC: {
coinfig: {
categories: [],
displaySymbol: 'USDC',
name: 'USD Coin',
precision: 6,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ import { CoinType, RemoteDataType, WalletFiatType } from '../../types'

export type WalletOptionsType = typeof WalletOptions

type Category = {
description: string
id: string
name: string
}

export type CoinfigType = {
categories: Category[]
displaySymbol: string
name: string
precision: number
Expand Down
9 changes: 6 additions & 3 deletions typings/window.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ declare global {
// build injected recaptcha key
SARDINE_CLIENT_ID: string
// build injected sardine access key
SARDINE_ENVIRONMENT: string // sardine environment sandbox or production
_Sardine: any // Sardine integration
_SardineContext: any // Sardine integration
SARDINE_ENVIRONMENT: string
// Sardine integration
WALLET_V5_LINK: string
// sardine environment sandbox or production
_Sardine: any
// Sardine integration
_SardineContext: any
coins: Coins
grecaptcha: any // google recaptcha sets this on window
history?: {
Expand Down

0 comments on commit cf8df7e

Please sign in to comment.