Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: markets page recommended tab and Portals assets #7736

Merged
merged 47 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
d275640
wip: markets page recommended tab
gomesalexandre Sep 11, 2024
0f891e6
feat: descynchronise chain selection
gomesalexandre Sep 12, 2024
2a1d75e
feat: dry
gomesalexandre Sep 12, 2024
0bb9f15
feat: progression
gomesalexandre Sep 12, 2024
544d218
feat: more progression
gomesalexandre Sep 12, 2024
505ca2d
feat: visual progression
gomesalexandre Sep 12, 2024
3ced439
feat: more unify
gomesalexandre Sep 12, 2024
53b628c
fix: chainIds over chainId
gomesalexandre Sep 12, 2024
51d0a04
feat: yeah right I'm definitely becoming a shepherd I guess
gomesalexandre Sep 12, 2024
a5a59ac
fix: unbork color-map script
gomesalexandre Sep 12, 2024
4443f22
feat: portals initial wire-up
gomesalexandre Sep 12, 2024
a288998
feat: onClick
gomesalexandre Sep 12, 2024
78ae09b
feat: cleanup
gomesalexandre Sep 12, 2024
402721e
feat: progression
gomesalexandre Sep 12, 2024
bf85534
feat: fetch market data
gomesalexandre Sep 12, 2024
7005494
Merge remote-tracking branch 'origin/develop' into feat_recommended_1
gomesalexandre Sep 12, 2024
79b4bcb
feat: cleanup log
gomesalexandre Sep 12, 2024
cbce36f
feat: todos
gomesalexandre Sep 12, 2024
67aa746
feat: more cleanup
gomesalexandre Sep 12, 2024
a489cd3
fix: beard oil but not by beard, maybe neo oil? but I dont have any b…
NeOMakinG Sep 13, 2024
3bb3b37
Merge remote-tracking branch 'origin/develop' into feat_recommended_1
gomesalexandre Sep 16, 2024
7c567af
Merge remote-tracking branch 'origin/develop' into feat_recommended_1
gomesalexandre Sep 16, 2024
4b59a86
fix: merge
gomesalexandre Sep 16, 2024
278f724
feat: leverage portalsPlatforms query
gomesalexandre Sep 16, 2024
534b527
feat: regen all
gomesalexandre Sep 16, 2024
5b489df
feat: cleaner apy
gomesalexandre Sep 16, 2024
ae2fadb
fix: market-data things
gomesalexandre Sep 16, 2024
aff1ad4
Merge branch 'develop' into feat_recommended_1
gomesalexandre Sep 17, 2024
20e59ae
Merge branch 'develop' into feat_recommended_1
gomesalexandre Sep 18, 2024
4d4230f
feat: :%s/`/'/g
gomesalexandre Sep 18, 2024
59d8d65
fix: missing occurences
gomesalexandre Sep 18, 2024
f64fb8e
feat: referential stability
gomesalexandre Sep 18, 2024
5fa241b
feat: parameterize percentage jump
gomesalexandre Sep 18, 2024
f2edf5e
Merge remote-tracking branch 'origin/develop' into feat_recommended_1
gomesalexandre Sep 18, 2024
366bdea
feat: add generate:all script and regen
gomesalexandre Sep 18, 2024
0d06530
feat: checkout origin/develop generatedAssetData
gomesalexandre Sep 18, 2024
d78dc6d
fix: limit
gomesalexandre Sep 18, 2024
5146448
feat: regen
gomesalexandre Sep 18, 2024
e357114
feat: regen
gomesalexandre Sep 18, 2024
9b09751
Merge branch 'develop' into feat_recommended_1
gomesalexandre Sep 19, 2024
7dfee08
feat: use assets icon
gomesalexandre Sep 19, 2024
78d258f
feat: decouple per-chain
gomesalexandre Sep 19, 2024
8f83532
feat: filter out nova
gomesalexandre Sep 19, 2024
81f9492
feat: proper query narrowing
gomesalexandre Sep 19, 2024
9d45348
feat: remove useless process.env short circuit
gomesalexandre Sep 19, 2024
16b42c9
feat: regen:all
gomesalexandre Sep 19, 2024
c4cb191
Merge remote-tracking branch 'origin/develop' into feat_recommended_1
gomesalexandre Sep 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions packages/utils/src/evmChainIds.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { EvmChainId } from '@shapeshiftoss/types'
import { KnownChainIds } from '@shapeshiftoss/types'

export const isEvmChainId = (
maybeEvmChainId: string | EvmChainId,
): maybeEvmChainId is EvmChainId => {
return evmChainIds.includes(maybeEvmChainId as EvmChainId)
}

export const evmChainIds = [
KnownChainIds.EthereumMainnet,
KnownChainIds.AvalancheMainnet,
KnownChainIds.OptimismMainnet,
KnownChainIds.BnbSmartChainMainnet,
KnownChainIds.PolygonMainnet,
KnownChainIds.GnosisMainnet,
KnownChainIds.ArbitrumMainnet,
KnownChainIds.ArbitrumNovaMainnet,
KnownChainIds.BaseMainnet,
] as const
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions packages/utils/src/index.ts
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export * from './promises'
export * from './treasury'
export * from './timeout'
export * from './createThrottle'
export * from './evmChainIds'

export const isSome = <T>(option: T | null | undefined): option is T =>
!isUndefined(option) && !isNull(option)
2 changes: 1 addition & 1 deletion scripts/generateAssetData/arbitrum/index.ts
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { arbitrumChainId } from '@shapeshiftoss/caip'
import type { Asset } from '@shapeshiftoss/types'
import partition from 'lodash/partition'
import uniqBy from 'lodash/uniqBy'
import { getPortalTokens } from 'lib/portals/utils'

import { arbitrum } from '../baseAssets'
import * as coingecko from '../coingecko'
import { getPortalTokens } from '../utils/portals'

export const getAssets = async (): Promise<Asset[]> => {
const results = await Promise.allSettled([
Expand Down
2 changes: 1 addition & 1 deletion scripts/generateAssetData/avalanche/index.ts
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { avalancheChainId } from '@shapeshiftoss/caip'
import type { Asset } from '@shapeshiftoss/types'
import partition from 'lodash/partition'
import uniqBy from 'lodash/uniqBy'
import { getPortalTokens } from 'lib/portals/utils'

import { avax } from '../baseAssets'
import * as coingecko from '../coingecko'
import { getPortalTokens } from '../utils/portals'

export const getAssets = async (): Promise<Asset[]> => {
const results = await Promise.allSettled([
Expand Down
2 changes: 1 addition & 1 deletion scripts/generateAssetData/base/index.ts
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { baseChainId } from '@shapeshiftoss/caip'
import type { Asset } from '@shapeshiftoss/types'
import partition from 'lodash/partition'
import uniqBy from 'lodash/uniqBy'
import { getPortalTokens } from 'lib/portals/utils'

import { base } from '../baseAssets'
import * as coingecko from '../coingecko'
import { getPortalTokens } from '../utils/portals'

export const getAssets = async (): Promise<Asset[]> => {
const results = await Promise.allSettled([
Expand Down
2 changes: 1 addition & 1 deletion scripts/generateAssetData/bnbsmartchain/index.ts
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { bscChainId } from '@shapeshiftoss/caip'
import type { Asset } from '@shapeshiftoss/types'
import { partition } from 'lodash'
import uniqBy from 'lodash/uniqBy'
import { getPortalTokens } from 'lib/portals/utils'

import { bnbsmartchain } from '../baseAssets'
import * as coingecko from '../coingecko'
import { getPortalTokens } from '../utils/portals'

export const getAssets = async (): Promise<Asset[]> => {
const results = await Promise.allSettled([
Expand Down
2 changes: 1 addition & 1 deletion scripts/generateAssetData/coingecko.ts
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
import type { Asset } from '@shapeshiftoss/types'
import axios from 'axios'

import { colorMap } from './../../src/lib/asset-service/service/colorMap'
import {
arbitrum,
arbitrumNova,
Expand All @@ -27,7 +28,6 @@ import {
optimism,
polygon,
} from './baseAssets'
import { colorMap } from './colorMap'

type Token = {
chainId: number
Expand Down
2 changes: 1 addition & 1 deletion scripts/generateAssetData/cosmos/index.ts
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { cosmosChainId } from '@shapeshiftoss/caip'
import type { Asset } from '@shapeshiftoss/types'
import axios from 'axios'

import { colorMap } from '../../../src/lib/asset-service/service/colorMap'
import { atom } from '../baseAssets'
import { colorMap } from '../colorMap'

type CosmosAsset = {
denom: string
Expand Down
2 changes: 1 addition & 1 deletion scripts/generateAssetData/ethTokens/uniswap.ts
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ethChainId as chainId, toAssetId } from '@shapeshiftoss/caip'
import type { Asset } from '@shapeshiftoss/types'
import axios from 'axios'

import { colorMap } from '../colorMap'
import { colorMap } from '../../../src/lib/asset-service/service/colorMap'

type UniswapToken = {
chainId: number
Expand Down
2 changes: 1 addition & 1 deletion scripts/generateAssetData/ethereum/index.ts
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import chunk from 'lodash/chunk'
import orderBy from 'lodash/orderBy'
import partition from 'lodash/partition'
import uniqBy from 'lodash/uniqBy'
import { getPortalTokens } from 'lib/portals/utils'

import { ethereum } from '../baseAssets'
import * as coingecko from '../coingecko'
import { generateTrustWalletUrl } from '../generateTrustWalletUrl/generateTrustWalletUrl'
import { getPortalTokens } from '../utils/portals'

const foxyToken: Asset = {
assetId: toAssetId({
Expand Down
3 changes: 2 additions & 1 deletion scripts/generateAssetData/generateColorMap.ts
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ const generateColorMap = async () => {
}, initial)

await fs.promises.writeFile(
`./scripts/generateAssetData/colorMap/color-map.json`,
// note: cwd is the root of the monorepo, *not* the script directory
`src/lib/asset-service/service/color-map.json`,
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
// beautify the file for github diff.
JSON.stringify(colorMap, null, 2),
)
Expand Down
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
fromAssetId,
optimismAssetId,
} from '@shapeshiftoss/caip'
import { isEvmChainId } from '@shapeshiftoss/chain-adapters'
import type { Asset, AssetsById } from '@shapeshiftoss/types'
import { isEvmChainId } from '@shapeshiftoss/utils'
import axios from 'axios'
import axiosRetry from 'axios-retry'
import fs from 'fs'
Expand Down
2 changes: 1 addition & 1 deletion scripts/generateAssetData/gnosis/index.ts
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { gnosisChainId } from '@shapeshiftoss/caip'
import type { Asset } from '@shapeshiftoss/types'
import partition from 'lodash/partition'
import uniqBy from 'lodash/uniqBy'
import { getPortalTokens } from 'lib/portals/utils'

import { gnosis } from '../baseAssets'
import * as coingecko from '../coingecko'
import { getPortalTokens } from '../utils/portals'

export const getAssets = async (): Promise<Asset[]> => {
const [assets, _portalsAssets] = await Promise.all([
Expand Down
2 changes: 1 addition & 1 deletion scripts/generateAssetData/optimism/index.ts
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { optimismChainId } from '@shapeshiftoss/caip'
import type { Asset } from '@shapeshiftoss/types'
import partition from 'lodash/partition'
import uniqBy from 'lodash/uniqBy'
import { getPortalTokens } from 'lib/portals/utils'

import { optimism } from '../baseAssets'
import * as coingecko from '../coingecko'
import { getPortalTokens } from '../utils/portals'

export const getAssets = async (): Promise<Asset[]> => {
const results = await Promise.allSettled([
Expand Down
2 changes: 1 addition & 1 deletion scripts/generateAssetData/polygon/index.ts
gomesalexandre marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { polygonChainId } from '@shapeshiftoss/caip'
import type { Asset } from '@shapeshiftoss/types'
import partition from 'lodash/partition'
import uniqBy from 'lodash/uniqBy'
import { getPortalTokens } from 'lib/portals/utils'

import { polygon } from '../baseAssets'
import * as coingecko from '../coingecko'
import { getPortalTokens } from '../utils/portals'

export const getAssets = async (): Promise<Asset[]> => {
const results = await Promise.allSettled([
Expand Down
Loading
Loading