From 12c75d2eaf1cabd480b917a0df0ece88fd449a91 Mon Sep 17 00:00:00 2001 From: Martin Cayuelas Date: Tue, 31 Dec 2024 11:27:08 +0100 Subject: [PATCH] chore: Add market widget integration test --- .changeset/fresh-needles-push.md | 5 + .../marketwidget.integration.test.tsx | 64 ++ .../__integrations__/shared.tsx | 63 ++ .../__tests__/helpers.test.ts} | 0 .../components/Container.tsx | 2 +- .../components/Error.tsx | 8 +- .../components/Footer.tsx | 0 .../components/Header.tsx | 0 .../components/MissingData.tsx | 0 .../components/WidgetList.tsx | 3 +- .../MarketPerformanceWidget/index.tsx | 0 .../MarketPerformanceWidget/types.ts | 0 .../useMarketPerformanceWidget.ts | 0 .../MarketPerformanceWidget/utils/index.ts | 2 +- .../src/renderer/screens/dashboard/index.tsx | 2 +- .../tests/handlers/fixtures/market/index.ts | 7 + .../fixtures/market/mockedResponseBTC.json | 39 + .../fixtures/market/mocketMarketList.json | 699 ++++++++++++++++++ .../tests/handlers/index.ts | 3 +- .../tests/handlers/market.ts | 22 + 20 files changed, 913 insertions(+), 6 deletions(-) create mode 100644 .changeset/fresh-needles-push.md create mode 100644 apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/__integrations__/marketwidget.integration.test.tsx create mode 100644 apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/__integrations__/shared.tsx rename apps/ledger-live-desktop/src/{renderer/screens/dashboard/MarketPerformanceWidget/__tests__/useMarketPerformanceWidget.test.ts => newArch/features/MarketPerformanceWidget/__tests__/helpers.test.ts} (100%) rename apps/ledger-live-desktop/src/{renderer/screens/dashboard => newArch/features}/MarketPerformanceWidget/components/Container.tsx (94%) rename apps/ledger-live-desktop/src/{renderer/screens/dashboard => newArch/features}/MarketPerformanceWidget/components/Error.tsx (88%) rename apps/ledger-live-desktop/src/{renderer/screens/dashboard => newArch/features}/MarketPerformanceWidget/components/Footer.tsx (100%) rename apps/ledger-live-desktop/src/{renderer/screens/dashboard => newArch/features}/MarketPerformanceWidget/components/Header.tsx (100%) rename apps/ledger-live-desktop/src/{renderer/screens/dashboard => newArch/features}/MarketPerformanceWidget/components/MissingData.tsx (100%) rename apps/ledger-live-desktop/src/{renderer/screens/dashboard => newArch/features}/MarketPerformanceWidget/components/WidgetList.tsx (97%) rename apps/ledger-live-desktop/src/{renderer/screens/dashboard => newArch/features}/MarketPerformanceWidget/index.tsx (100%) rename apps/ledger-live-desktop/src/{renderer/screens/dashboard => newArch/features}/MarketPerformanceWidget/types.ts (100%) rename apps/ledger-live-desktop/src/{renderer/screens/dashboard => newArch/features}/MarketPerformanceWidget/useMarketPerformanceWidget.ts (100%) rename apps/ledger-live-desktop/src/{renderer/screens/dashboard => newArch/features}/MarketPerformanceWidget/utils/index.ts (95%) create mode 100644 apps/ledger-live-desktop/tests/handlers/fixtures/market/index.ts create mode 100644 apps/ledger-live-desktop/tests/handlers/fixtures/market/mockedResponseBTC.json create mode 100644 apps/ledger-live-desktop/tests/handlers/fixtures/market/mocketMarketList.json create mode 100644 apps/ledger-live-desktop/tests/handlers/market.ts diff --git a/.changeset/fresh-needles-push.md b/.changeset/fresh-needles-push.md new file mode 100644 index 000000000000..5b46b94e9993 --- /dev/null +++ b/.changeset/fresh-needles-push.md @@ -0,0 +1,5 @@ +--- +"ledger-live-desktop": minor +--- + +Introduce integration tests for Market Widget diff --git a/apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/__integrations__/marketwidget.integration.test.tsx b/apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/__integrations__/marketwidget.integration.test.tsx new file mode 100644 index 000000000000..72de0d77c5c3 --- /dev/null +++ b/apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/__integrations__/marketwidget.integration.test.tsx @@ -0,0 +1,64 @@ +import React from "react"; +import { render, screen, waitFor } from "tests/testUtils"; + +import { useMarketPerformanceWidget } from "../useMarketPerformanceWidget"; +import { Order } from "../types"; +import { MarketWidgetTest, FAKE_LIST } from "./shared"; + +jest.mock("../useMarketPerformanceWidget"); +const mockedUseMarketPerformanceWidgetHook = useMarketPerformanceWidget as jest.Mock; + +jest.mock("@tanstack/react-query", () => { + return { + __esModule: true, + ...jest.requireActual("@tanstack/react-query"), + }; +}); + +describe("MarketPerformance Widget", () => { + it("should display error screen when Component appears", async () => { + mockedUseMarketPerformanceWidgetHook.mockReturnValue({ + list: [], + order: Order.asc, + setOrder: jest.fn(), + isLoading: false, + hasError: true, + range: "month", + top: 0, + enableNewFeature: true, + }); + + render(, { initialRoute: `/` }); + + expect(screen.getByTestId("error-container")).toBeVisible(); + expect(screen.getByText("1M trend")).toBeVisible(); + expect(screen.getByText("Sorry, we’re unable to load the trend")).toBeVisible(); + }); + it("should display V2 screen when FF new Feature is ON and go to market detail page of selected currency when clicking on it", async () => { + mockedUseMarketPerformanceWidgetHook.mockReturnValue({ + list: FAKE_LIST, + order: Order.asc, + setOrder: jest.fn(), + isLoading: false, + hasError: false, + range: "month", + top: 0, + enableNewFeature: true, + }); + + const { user } = render(, { initialRoute: `/` }); + + expect(screen.getAllByTestId(/market-performance-widget-row/i).length).toEqual( + FAKE_LIST.length, + ); + + const btc = screen.getByTestId("market-performance-widget-row-1"); + expect(btc).toBeVisible(); + await user.click(btc); + + await waitFor(() => expect(screen.getByTestId("market-coin-page-container")).toBeVisible()); + + expect(screen.getByText("Bitcoin")).toBeVisible(); + expect(screen.getByText("BTC")).toBeVisible(); + }); +}); diff --git a/apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/__integrations__/shared.tsx b/apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/__integrations__/shared.tsx new file mode 100644 index 000000000000..61096f8bb34a --- /dev/null +++ b/apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/__integrations__/shared.tsx @@ -0,0 +1,63 @@ +import React from "react"; +import { Switch, Route, withRouter } from "react-router"; +import MarketPerformanceWidget from ".."; +import { ABTestingVariants } from "@ledgerhq/types-live"; +import MarketCoin from "~/renderer/screens/market/MarketCoin"; +import { MarketItemPerformer } from "@ledgerhq/live-common/market/utils/types"; + +export const FAKE_LIST: MarketItemPerformer[] = [ + { + id: "bitcoin", + name: "Bitcoin", + ticker: "BTC", + priceChangePercentage1h: 0.5, + priceChangePercentage24h: 2.3, + priceChangePercentage7d: 5.1, + priceChangePercentage30d: 15.8, + priceChangePercentage1y: 120.7, + image: "https://path-to-bitcoin-image.com", + price: 35000, + ledgerIds: ["bitcoin"], + }, + { + id: "ethereum", + name: "Ethereum", + ticker: "ETH", + priceChangePercentage1h: 0.3, + priceChangePercentage24h: 1.7, + priceChangePercentage7d: 3.9, + priceChangePercentage30d: 10.5, + priceChangePercentage1y: 85.3, + image: "https://path-to-ethereum-image.com", + price: 2500, + ledgerIds: ["ethereum"], + }, + { + id: "ripple", + name: "Ripple", + ticker: "XRP", + priceChangePercentage1h: 0.1, + priceChangePercentage24h: 0.9, + priceChangePercentage7d: 2.8, + priceChangePercentage30d: 5.6, + priceChangePercentage1y: 50.2, + image: "https://path-to-ripple-image.com", + price: 1.2, + ledgerIds: ["ripple"], + }, +]; + +const MarketWidgetNavigation = () => ( + + } + /> + } /> + +); + +const MarketWidgetTestBase = () => ; + +export const MarketWidgetTest = withRouter(MarketWidgetTestBase); diff --git a/apps/ledger-live-desktop/src/renderer/screens/dashboard/MarketPerformanceWidget/__tests__/useMarketPerformanceWidget.test.ts b/apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/__tests__/helpers.test.ts similarity index 100% rename from apps/ledger-live-desktop/src/renderer/screens/dashboard/MarketPerformanceWidget/__tests__/useMarketPerformanceWidget.test.ts rename to apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/__tests__/helpers.test.ts diff --git a/apps/ledger-live-desktop/src/renderer/screens/dashboard/MarketPerformanceWidget/components/Container.tsx b/apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/components/Container.tsx similarity index 94% rename from apps/ledger-live-desktop/src/renderer/screens/dashboard/MarketPerformanceWidget/components/Container.tsx rename to apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/components/Container.tsx index de92846fae93..aa9dec095dff 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/dashboard/MarketPerformanceWidget/components/Container.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/components/Container.tsx @@ -1,12 +1,12 @@ import React from "react"; import { ABTestingVariants } from "@ledgerhq/types-live"; import Card from "~/renderer/components/Box/Card"; -import { WidgetList } from "~/renderer/screens/dashboard/MarketPerformanceWidget/components/WidgetList"; import { Props, PropsBody } from "../types"; import { Flex, InfiniteLoader } from "@ledgerhq/react-ui"; import { MarketPerformanceWidgetFooter } from "./Footer"; import { MarketPerformanceWidgetHeader } from "./Header"; import { Error } from "./Error"; +import { WidgetList } from "./WidgetList"; const BodyByMode: Record> = { [ABTestingVariants.variantA]: WidgetList, diff --git a/apps/ledger-live-desktop/src/renderer/screens/dashboard/MarketPerformanceWidget/components/Error.tsx b/apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/components/Error.tsx similarity index 88% rename from apps/ledger-live-desktop/src/renderer/screens/dashboard/MarketPerformanceWidget/components/Error.tsx rename to apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/components/Error.tsx index 574f9df147c3..1e267e21fefa 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/dashboard/MarketPerformanceWidget/components/Error.tsx +++ b/apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/components/Error.tsx @@ -13,7 +13,13 @@ type Props = { export function Error({ title, description, top, range }: Props) { const { t } = useTranslation(); return ( - + diff --git a/apps/ledger-live-desktop/src/renderer/screens/dashboard/MarketPerformanceWidget/index.tsx b/apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/index.tsx similarity index 100% rename from apps/ledger-live-desktop/src/renderer/screens/dashboard/MarketPerformanceWidget/index.tsx rename to apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/index.tsx diff --git a/apps/ledger-live-desktop/src/renderer/screens/dashboard/MarketPerformanceWidget/types.ts b/apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/types.ts similarity index 100% rename from apps/ledger-live-desktop/src/renderer/screens/dashboard/MarketPerformanceWidget/types.ts rename to apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/types.ts diff --git a/apps/ledger-live-desktop/src/renderer/screens/dashboard/MarketPerformanceWidget/useMarketPerformanceWidget.ts b/apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/useMarketPerformanceWidget.ts similarity index 100% rename from apps/ledger-live-desktop/src/renderer/screens/dashboard/MarketPerformanceWidget/useMarketPerformanceWidget.ts rename to apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/useMarketPerformanceWidget.ts diff --git a/apps/ledger-live-desktop/src/renderer/screens/dashboard/MarketPerformanceWidget/utils/index.ts b/apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/utils/index.ts similarity index 95% rename from apps/ledger-live-desktop/src/renderer/screens/dashboard/MarketPerformanceWidget/utils/index.ts rename to apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/utils/index.ts index 1a00b15939e6..9d4dfc508050 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/dashboard/MarketPerformanceWidget/utils/index.ts +++ b/apps/ledger-live-desktop/src/newArch/features/MarketPerformanceWidget/utils/index.ts @@ -1,7 +1,7 @@ import { MarketItemPerformer } from "@ledgerhq/live-common/market/utils/types"; import { PortfolioRange } from "@ledgerhq/types-live"; -import { CurrencyCheck, Order } from "~/renderer/screens/dashboard/MarketPerformanceWidget/types"; +import { CurrencyCheck, Order } from "~/newArch/features/MarketPerformanceWidget/types"; export function getSlicedList(list: MarketItemPerformer[], order: Order, range: PortfolioRange) { return list.filter(elem => diff --git a/apps/ledger-live-desktop/src/renderer/screens/dashboard/index.tsx b/apps/ledger-live-desktop/src/renderer/screens/dashboard/index.tsx index fb2a91171f89..70b434f68a7f 100644 --- a/apps/ledger-live-desktop/src/renderer/screens/dashboard/index.tsx +++ b/apps/ledger-live-desktop/src/renderer/screens/dashboard/index.tsx @@ -28,7 +28,7 @@ import PostOnboardingHubBanner from "~/renderer/components/PostOnboardingHub/Pos import FeaturedButtons from "~/renderer/screens/dashboard/FeaturedButtons"; import { ABTestingVariants, AccountLike, Operation } from "@ledgerhq/types-live"; import ActionContentCards from "~/renderer/screens/dashboard/ActionContentCards"; -import MarketPerformanceWidget from "~/renderer/screens/dashboard/MarketPerformanceWidget"; +import MarketPerformanceWidget from "LLD/features/MarketPerformanceWidget"; import { useMarketPerformanceFeatureFlag } from "~/renderer/actions/marketperformance"; import { Grid } from "@ledgerhq/react-ui"; import AnalyticsOptInPrompt from "LLD/features/AnalyticsOptInPrompt/screens"; diff --git a/apps/ledger-live-desktop/tests/handlers/fixtures/market/index.ts b/apps/ledger-live-desktop/tests/handlers/fixtures/market/index.ts new file mode 100644 index 000000000000..9f068055ee43 --- /dev/null +++ b/apps/ledger-live-desktop/tests/handlers/fixtures/market/index.ts @@ -0,0 +1,7 @@ +import mockedResponseBTC from "./mockedResponseBTC.json"; +import mocketMarketList from "./mocketMarketList.json"; + +export const MarketMockedResponse = { + bitcoinDetail: mockedResponseBTC, + marketList: mocketMarketList, +}; diff --git a/apps/ledger-live-desktop/tests/handlers/fixtures/market/mockedResponseBTC.json b/apps/ledger-live-desktop/tests/handlers/fixtures/market/mockedResponseBTC.json new file mode 100644 index 000000000000..b0f578f55a80 --- /dev/null +++ b/apps/ledger-live-desktop/tests/handlers/fixtures/market/mockedResponseBTC.json @@ -0,0 +1,39 @@ +[ + { + "id": "bitcoin", + "ledgerIds": ["bitcoin"], + "ticker": "btc", + "name": "Bitcoin", + "image": "https://proxycgassets.api.live.ledger.com/coins/images/1/large/bitcoin.png", + "marketCap": 1853659311759, + "marketCapRank": 1, + "fullyDilutedValuation": 1965637466124, + "totalVolume": 59569647143, + "high24h": 94838, + "low24h": 91375, + "price": 93552, + "priceChange24h": -257.298216683208, + "priceChangePercentage1h": -0.40255063060877444, + "priceChangePercentage24h": -0.27427661250417024, + "priceChangePercentage7d": -0.30984911905827317, + "priceChangePercentage30d": -3.4861595535989562, + "priceChangePercentage1y": 118.89147816670156, + "marketCapChange24h": -5358207120.227051, + "marketCapChangePercentage24h": -0.28823, + "circulatingSupply": 19803675, + "totalSupply": 21000000, + "maxSupply": 21000000, + "allTimeHigh": 108135, + "allTimeLow": 67.81, + "allTimeHighDate": "2024-12-17T15:02:41.429Z", + "allTimeLowDate": "2013-07-06T00:00:00Z", + "sparkline": [ + 93904.34, 94180.71, 98540.01, 97744.89, 98500.26, 98166.15, 97972.34, 98116.91, 98322.234, + 99144.055, 98949.445, 98104.914, 95759.02, 95344.336, 96462.66, 95555.76, 95792.29, 96178.805, + 96120.68, 96461.414, 94017.74, 94505.445, 94248.84, 94372.445, 94337.37, 94463.18, 94745.09, + 94916.77, 94998.1, 94953.984, 94968.695, 94749.555, 93732.33, 93678.82, 93392.77, 93073.18, + 93686.19, 93614.766, 91960.47, 94197.09, 92369.18, 92286.9 + ], + "updatedAt": "2024-12-31T10:19:36.410Z" + } +] diff --git a/apps/ledger-live-desktop/tests/handlers/fixtures/market/mocketMarketList.json b/apps/ledger-live-desktop/tests/handlers/fixtures/market/mocketMarketList.json new file mode 100644 index 000000000000..4c4e3cfc1641 --- /dev/null +++ b/apps/ledger-live-desktop/tests/handlers/fixtures/market/mocketMarketList.json @@ -0,0 +1,699 @@ +[ + { + "id": "bitcoin", + "ledgerIds": ["bitcoin"], + "ticker": "btc", + "name": "Bitcoin", + "image": "https://proxycgassets.api.live.ledger.com/coins/images/1/large/bitcoin.png", + "marketCap": 1856279371756, + "marketCapRank": 1, + "fullyDilutedValuation": 1968415801959, + "totalVolume": 60797946531, + "high24h": 94838, + "low24h": 91375, + "price": 93594, + "priceChange24h": -216.18426713372173, + "priceChangePercentage1h": -0.32763932567460696, + "priceChangePercentage24h": -0.23044966743449463, + "priceChangePercentage7d": -0.3309484428868614, + "priceChangePercentage30d": -3.443744150230338, + "priceChangePercentage1y": 118.98767546128077, + "marketCapChange24h": -942147092.0244141, + "marketCapChangePercentage24h": -0.05073, + "circulatingSupply": 19803675, + "totalSupply": 21000000, + "maxSupply": 21000000, + "allTimeHigh": 108135, + "allTimeLow": 67.81, + "allTimeHighDate": "2024-12-17T15:02:41.429Z", + "allTimeLowDate": "2013-07-06T00:00:00Z", + "sparkline": [ + 93904.34, 94180.71, 98540.01, 97744.89, 98500.26, 98166.15, 97972.34, 98116.91, 98322.234, + 99144.055, 98949.445, 98104.914, 95759.02, 95344.336, 96462.66, 95555.76, 95792.29, 96178.805, + 96120.68, 96461.414, 94017.74, 94505.445, 94248.84, 94372.445, 94337.37, 94463.18, 94745.09, + 94916.77, 94998.1, 94953.984, 94968.695, 94749.555, 93732.33, 93678.82, 93392.77, 93073.18, + 93686.19, 93614.766, 91960.47, 94197.09, 92369.18, 92286.9 + ], + "updatedAt": "2024-12-31T10:16:17.881Z" + }, + { + "id": "ethereum", + "ledgerIds": [ + "zksync", + "scroll", + "base", + "arbitrum", + "mantle", + "blast", + "ethereum", + "boba", + "optimism", + "linea" + ], + "ticker": "eth", + "name": "Ethereum", + "image": "https://proxycgassets.api.live.ledger.com/coins/images/279/large/ethereum.png", + "marketCap": 407455522916, + "marketCapRank": 2, + "fullyDilutedValuation": 407455522916, + "totalVolume": 26281175634, + "high24h": 3422.87, + "low24h": 3302.16, + "price": 3376.13, + "priceChange24h": -40.36088103874272, + "priceChangePercentage1h": -0.23055075197717323, + "priceChangePercentage24h": -1.181353710087752, + "priceChangePercentage7d": -0.5885036689732097, + "priceChangePercentage30d": -8.72810696998265, + "priceChangePercentage1y": 46.01517873850519, + "marketCapChange24h": -4397259798.8914795, + "marketCapChangePercentage24h": -1.06768, + "circulatingSupply": 120472682.0703092, + "totalSupply": 120472682.0703092, + "maxSupply": null, + "allTimeHigh": 4878.26, + "allTimeLow": 0.432979, + "allTimeHighDate": "2021-11-10T14:24:19.604Z", + "allTimeLowDate": "2015-10-20T00:00:00Z", + "sparkline": [ + 3401.6921, 3404.0994, 3501.055, 3461.4106, 3484.354, 3485.7263, 3487.7695, 3479.5417, + 3448.8013, 3471.4084, 3482.414, 3432.9565, 3360.9124, 3346.2905, 3356.5989, 3315.3677, + 3346.74, 3372.3696, 3351.3591, 3406.6084, 3309.1602, 3339.4739, 3338.7966, 3339.7864, + 3339.523, 3348.5774, 3381.5535, 3394.3635, 3386.601, 3382.6958, 3391.3655, 3386.9565, + 3350.5808, 3351.4917, 3379.605, 3388.093, 3414.497, 3402.418, 3332.4773, 3394.443, 3337.7573, + 3329.6472 + ], + "updatedAt": "2024-12-31T10:16:28.831Z" + }, + { + "id": "tether", + "ledgerIds": [ + "ethereum/erc20/usd_tether__erc20_", + "arbitrum/erc20/tether_usd", + "avalanche_c_chain/erc20/tethertoken", + "scroll/erc20/tether_usd", + "celo/erc20/tether_usd_0x48065fbbe25f71c9282ddf5e1cd6d6a887483d5e", + "optimism/erc20/tether_usd", + "ton/jetton/eqcxe6mutqjkfngfarotkot1lzbdiix1kcixrv7nw2id_sds", + "solana/spl/es9vmfrzacermjfrf4h2fyd4kconky11mcce8benwnyb", + "bsc/bep20/binance-peg_bsc-usd", + "fantom/erc20/tether_usd", + "polygon_zk_evm/erc20/tether_usd", + "algorand/asa/312769", + "neon_evm/erc20/usdt", + "tron/trc20/tr7nhqjekqxgtci8q8zy4pl8otszgjlj6t" + ], + "ticker": "usdt", + "name": "Tether", + "image": "https://proxycgassets.api.live.ledger.com/coins/images/325/large/Tether.png", + "marketCap": 137436693935, + "marketCapRank": 3, + "fullyDilutedValuation": 137436693935, + "totalVolume": 48938304762, + "high24h": 1.003, + "low24h": 0.992963, + "price": 0.998002, + "priceChange24h": -0.000179157358412785, + "priceChangePercentage1h": -0.018081542973698447, + "priceChangePercentage24h": -0.017948388085776507, + "priceChangePercentage7d": 0.04645995743956099, + "priceChangePercentage30d": -0.18769443347881903, + "priceChangePercentage1y": -0.2254885409565083, + "marketCapChange24h": -1306499074.4089203, + "marketCapChangePercentage24h": -0.94167, + "circulatingSupply": 137805153955.2756, + "totalSupply": 137805153955.2756, + "maxSupply": null, + "allTimeHigh": 1.32, + "allTimeLow": 0.572521, + "allTimeHighDate": "2018-07-24T00:00:00Z", + "allTimeLowDate": "2015-03-02T00:00:00Z", + "sparkline": [ + 0.99753815, 0.99930847, 1.0002505, 1.0011468, 0.99908185, 0.9989327, 0.9991279, 0.9993284, + 0.99792516, 1.0001726, 0.9989709, 0.9990051, 0.9983475, 0.9989831, 0.9988214, 0.999667, + 0.9988895, 0.99852765, 1.001221, 0.99896175, 0.9976055, 0.999497, 0.9986037, 0.9983821, + 0.99838424, 0.99847215, 0.9987996, 0.9984923, 0.9982233, 0.9982532, 0.9983987, 0.9981741, + 0.9984002, 0.99793094, 0.99803233, 0.99675095, 0.9979377, 0.99812514, 0.9981528, 0.99822474, + 0.99779344, 0.99843454 + ], + "updatedAt": "2024-12-31T10:16:27.819Z" + }, + { + "id": "ripple", + "ledgerIds": ["ripple"], + "ticker": "xrp", + "name": "XRP", + "image": "https://proxycgassets.api.live.ledger.com/coins/images/44/large/xrp-symbol-white-128.png", + "marketCap": 118451557495, + "marketCapRank": 4, + "fullyDilutedValuation": 206297478604, + "totalVolume": 6306050703, + "high24h": 2.13, + "low24h": 2.01, + "price": 2.06, + "priceChange24h": -0.014365707931735638, + "priceChangePercentage1h": -0.5292577590095336, + "priceChangePercentage24h": -0.6914521839257468, + "priceChangePercentage7d": -7.638753599951084, + "priceChangePercentage30d": 7.8004728110956405, + "priceChangePercentage1y": 229.0644113892058, + "marketCapChange24h": -1013398019.4957428, + "marketCapChangePercentage24h": -0.84828, + "circulatingSupply": 57410227039, + "totalSupply": 99986740020, + "maxSupply": 100000000000, + "allTimeHigh": 3.4, + "allTimeLow": 0.00268621, + "allTimeHighDate": "2018-01-07T00:00:00Z", + "allTimeLowDate": "2014-05-22T00:00:00Z", + "sparkline": [ + 2.2338898, 2.2405427, 2.3122327, 2.303907, 2.3132045, 2.291526, 2.2870517, 2.28297, 2.2689455, + 2.3109877, 2.2830482, 2.2466893, 2.1837802, 2.164728, 2.1823418, 2.1503334, 2.1527176, + 2.1678674, 2.1676524, 2.199132, 2.1361635, 2.1678803, 2.147833, 2.1473386, 2.1681461, + 2.1586154, 2.1844118, 2.188436, 2.1788728, 2.1779795, 2.181503, 2.1688988, 2.1450586, + 2.130068, 2.1044095, 2.083579, 2.0661547, 2.0737975, 2.00894, 2.1084094, 2.03593, 2.016742 + ], + "updatedAt": "2024-12-31T10:16:44.544Z" + }, + { + "id": "binancecoin", + "ledgerIds": ["bsc", "binance_beacon_chain", "ethereum/erc20/bnb"], + "ticker": "bnb", + "name": "BNB", + "image": "https://proxycgassets.api.live.ledger.com/coins/images/825/large/bnb-icon2_2x.png", + "marketCap": 102740463340, + "marketCapRank": 5, + "fullyDilutedValuation": 102740463340, + "totalVolume": 997147400, + "high24h": 711.65, + "low24h": 687.31, + "price": 703.18, + "priceChange24h": 8.2, + "priceChangePercentage1h": 0.029183387752046833, + "priceChangePercentage24h": 1.1797922338698659, + "priceChangePercentage7d": 2.4648868487797246, + "priceChangePercentage30d": 7.276907297750353, + "priceChangePercentage1y": 118.0508864649656, + "marketCapChange24h": 1323209589, + "marketCapChangePercentage24h": 1.30472, + "circulatingSupply": 145887575.79, + "totalSupply": 145887575.79, + "maxSupply": 200000000, + "allTimeHigh": 788.84, + "allTimeLow": 0.0398177, + "allTimeHighDate": "2024-12-04T10:35:25.220Z", + "allTimeLowDate": "2017-10-19T00:00:00Z", + "sparkline": [ + 689.381, 684.7449, 695.4255, 694.4446, 699.1228, 702.8787, 704.006, 707.0355, 700.76117, + 702.0448, 701.4924, 704.6335, 696.14557, 684.7807, 691.6234, 686.9814, 688.07324, 687.38525, + 698.7356, 705.3626, 688.6256, 692.8107, 694.57306, 695.45856, 697.7152, 707.3639, 725.61487, + 725.792, 718.62146, 713.01324, 715.2817, 709.0866, 703.3698, 696.0417, 696.04614, 694.5073, + 695.5368, 699.08435, 694.0503, 709.1089, 704.3324, 700.15076 + ], + "updatedAt": "2024-12-31T10:16:25.454Z" + }, + { + "id": "solana", + "ledgerIds": ["solana"], + "ticker": "sol", + "name": "Solana", + "image": "https://proxycgassets.api.live.ledger.com/coins/images/4128/large/solana.png", + "marketCap": 92533229753, + "marketCapRank": 6, + "fullyDilutedValuation": 114035583695, + "totalVolume": 4149544625, + "high24h": 196.17, + "low24h": 185.97, + "price": 192.77, + "priceChange24h": -0.28298467076106704, + "priceChangePercentage1h": 0.1746128590192977, + "priceChangePercentage24h": -0.14658771316908978, + "priceChangePercentage7d": 0.4255350385467973, + "priceChangePercentage30d": -18.787096825644, + "priceChangePercentage1y": 84.45858148433732, + "marketCapChange24h": -71579490.55101013, + "marketCapChangePercentage24h": -0.0773, + "circulatingSupply": 479725890.0337176, + "totalSupply": 591201906.9168184, + "maxSupply": null, + "allTimeHigh": 263.21, + "allTimeLow": 0.500801, + "allTimeHighDate": "2024-11-23T15:05:59.896Z", + "allTimeLowDate": "2020-05-11T19:35:23.449Z", + "sparkline": [ + 191.46872, 191.61382, 196.09158, 195.31274, 196.89792, 198.98326, 197.83315, 195.95856, + 197.25461, 197.51068, 197.15337, 195.04616, 188.92361, 188.3354, 190.44397, 188.19666, + 188.94815, 189.4349, 190.11362, 190.4458, 183.82918, 185.86882, 184.87476, 184.28702, + 185.75832, 186.49767, 192.19667, 192.90097, 193.76172, 194.0329, 195.02824, 195.92563, + 192.78038, 191.7692, 191.73842, 189.53789, 192.97878, 193.06662, 186.6924, 194.58994, + 190.43396, 188.51898 + ], + "updatedAt": "2024-12-31T10:16:44.839Z" + }, + { + "id": "dogecoin", + "ledgerIds": ["dogecoin"], + "ticker": "doge", + "name": "Dogecoin", + "image": "https://proxycgassets.api.live.ledger.com/coins/images/5/large/dogecoin.png", + "marketCap": 46763109239, + "marketCapRank": 7, + "fullyDilutedValuation": 46798913016, + "totalVolume": 2790626513, + "high24h": 0.322202, + "low24h": 0.307409, + "price": 0.317016, + "priceChange24h": -0.003850658881689784, + "priceChangePercentage1h": -0.20131348074775673, + "priceChangePercentage24h": -1.2000824958928074, + "priceChangePercentage7d": -0.7909067526440405, + "priceChangePercentage30d": -25.748084785413827, + "priceChangePercentage1y": 249.11822213148142, + "marketCapChange24h": -557786272.2963638, + "marketCapChangePercentage24h": -1.17873, + "circulatingSupply": 147314376383.7052, + "totalSupply": 147427166383.7052, + "maxSupply": null, + "allTimeHigh": 0.731578, + "allTimeLow": 0.0000869, + "allTimeHighDate": "2021-05-08T05:08:23.458Z", + "allTimeLowDate": "2015-05-06T00:00:00Z", + "sparkline": [ + 0.31955165, 0.3204929, 0.33335957, 0.33267957, 0.33750984, 0.33327767, 0.33151412, 0.33185855, + 0.3280997, 0.33179682, 0.3332886, 0.32480225, 0.31608516, 0.31568608, 0.31536892, 0.31130108, + 0.31196952, 0.31402144, 0.31490153, 0.31914324, 0.3099162, 0.31416696, 0.31337523, 0.31335098, + 0.31648853, 0.31620583, 0.321431, 0.32200876, 0.32281303, 0.32365602, 0.3270534, 0.32435927, + 0.31580412, 0.3155918, 0.31521863, 0.31676018, 0.32058027, 0.32057154, 0.3086617, 0.32030347, + 0.31260067, 0.30993825 + ], + "updatedAt": "2024-12-31T10:16:28.436Z" + }, + { + "id": "usd-coin", + "ledgerIds": [ + "polygon_zk_evm/erc20/usd_coin", + "optimism/erc20/usd_coin", + "polygon/erc20/usd_coin", + "zksync/erc20/usdc", + "algorand/asa/31566704", + "arbitrum/erc20/usd_coin", + "ethereum/erc20/usd__coin", + "stellar/asset/usdc:ga5zsejyb37jrc5avcia5mop4rhtm335x2kgx3ihojapp5re34k4kzvn", + "celo/erc20/usdc_0xceba9300f2b948710d2653dd7b07f33a8b32118c", + "base/erc20/usd_coin", + "bsc/bep20/binance-peg_usd_coin", + "tron/trc20/tekxitehnzsmse2xqrbj4w32run966rdz8", + "cronos/erc20/usd_coin", + "elrond/esdt/555344432d633736663166", + "solana/spl/epjfwdd5aufqssqem2qn1xzybapc8g4weggkzwytdt1v", + "avalanche_c_chain/erc20/usd_coin" + ], + "ticker": "usdc", + "name": "USDC", + "image": "https://proxycgassets.api.live.ledger.com/coins/images/6319/large/usdc.png", + "marketCap": 43764946779, + "marketCapRank": 8, + "fullyDilutedValuation": 43767104908, + "totalVolume": 10752837647, + "high24h": 1.005, + "low24h": 0.994222, + "price": 0.998958, + "priceChange24h": -0.000905455324267224, + "priceChangePercentage1h": -0.13476068526845686, + "priceChangePercentage24h": -0.09055791507655794, + "priceChangePercentage7d": -0.09660935746937593, + "priceChangePercentage30d": -0.03865731894717229, + "priceChangePercentage1y": -0.19696822313871207, + "marketCapChange24h": 149071295, + "marketCapChangePercentage24h": 0.34178, + "circulatingSupply": 43811444420.3636, + "totalSupply": 43811962312.93909, + "maxSupply": null, + "allTimeHigh": 1.17, + "allTimeLow": 0.877647, + "allTimeHighDate": "2019-05-08T00:40:28.300Z", + "allTimeLowDate": "2023-03-11T08:02:13.981Z", + "sparkline": [ + 0.9994154, 1.0003555, 1.0008687, 1.0013796, 0.999629, 0.9997697, 1.0001675, 1.0002271, + 0.9993008, 1.0001208, 1.0001892, 1.000002, 0.9989964, 1.0000528, 0.99996537, 0.999605, + 1.0000906, 0.99975806, 0.9989594, 0.99969167, 0.9982281, 1.0009494, 1.0001237, 0.9997902, + 1.000087, 1.0001252, 0.999966, 1.0003251, 1.0002443, 1.0002514, 1.0000474, 0.99981755, + 1.0001501, 1.0002363, 1.0000467, 0.99916196, 0.9998294, 0.99948, 1.0005474, 0.9988776, + 0.99937004, 1.0001022 + ], + "updatedAt": "2024-12-31T10:16:50.230Z" + }, + { + "id": "staked-ether", + "ledgerIds": ["ethereum/erc20/steth"], + "ticker": "steth", + "name": "Lido Staked Ether", + "image": "https://proxycgassets.api.live.ledger.com/coins/images/13442/large/steth_logo.png", + "marketCap": 32825684597, + "marketCapRank": 9, + "fullyDilutedValuation": 32825684597, + "totalVolume": 93041927, + "high24h": 3420.46, + "low24h": 3300.69, + "price": 3372.68, + "priceChange24h": -44.544895619955696, + "priceChangePercentage1h": -0.14251293438119236, + "priceChangePercentage24h": -1.303538703192515, + "priceChangePercentage7d": -0.5179573152091633, + "priceChangePercentage30d": -8.765245786778962, + "priceChangePercentage1y": 46.51416023717399, + "marketCapChange24h": -234127736.3651619, + "marketCapChangePercentage24h": -0.70819, + "circulatingSupply": 9721617.002552262, + "totalSupply": 9721617.002552262, + "maxSupply": null, + "allTimeHigh": 4829.57, + "allTimeLow": 482.9, + "allTimeHighDate": "2021-11-10T14:40:47.256Z", + "allTimeLowDate": "2020-12-22T04:08:21.854Z", + "sparkline": [ + 3390.2437, 3414.727, 3479.8115, 3476.2053, 3470.687, 3483.267, 3488.973, 3480.2722, 3446.626, + 3445.1543, 3468.9534, 3432.2966, 3361.065, 3349.62, 3332.0718, 3315.1995, 3335.9, 3360.8406, + 3402.6387, 3398.407, 3306.9307, 3336.8044, 3335.874, 3339.7947, 3337.3247, 3347.99, 3377.3308, + 3392.3975, 3385.6335, 3379.8206, 3390.3706, 3383.077, 3347.888, 3350.486, 3377.4429, + 3382.9004, 3410.7134, 3402.6526, 3331.641, 3391.0867, 3332.8245, 3327.5198 + ], + "updatedAt": "2024-12-31T10:16:24.605Z" + }, + { + "id": "cardano", + "ledgerIds": ["cardano"], + "ticker": "ada", + "name": "Cardano", + "image": "https://proxycgassets.api.live.ledger.com/coins/images/975/large/cardano.png", + "marketCap": 30646036798, + "marketCapRank": 10, + "fullyDilutedValuation": 38471327209, + "totalVolume": 1015943714, + "high24h": 0.87931, + "low24h": 0.830944, + "price": 0.854918, + "priceChange24h": -0.01588781630137004, + "priceChangePercentage1h": -0.3628260392476046, + "priceChangePercentage24h": -1.8244950856522422, + "priceChangePercentage7d": -4.6381084051393815, + "priceChangePercentage30d": -20.0091899516011, + "priceChangePercentage1y": 40.654930027854896, + "marketCapChange24h": -583488766.7943726, + "marketCapChangePercentage24h": -1.86839, + "circulatingSupply": 35846739791.31494, + "totalSupply": 45000000000, + "maxSupply": 45000000000, + "allTimeHigh": 3.09, + "allTimeLow": 0.01925275, + "allTimeHighDate": "2021-09-02T06:00:10.474Z", + "allTimeLowDate": "2020-03-13T02:22:55.044Z", + "sparkline": [ + 0.899601, 0.8975901, 0.94014657, 0.9221187, 0.9340722, 0.9251793, 0.9194062, 0.91456723, + 0.9060556, 0.91426754, 0.91127723, 0.8943602, 0.86894745, 0.865996, 0.8738268, 0.8551329, + 0.8635763, 0.8679158, 0.8798324, 0.8987353, 0.8646746, 0.8881251, 0.8738225, 0.87272197, + 0.8717384, 0.8673442, 0.88198185, 0.8843288, 0.8833883, 0.8854397, 0.8868715, 0.89518315, + 0.86910075, 0.86242807, 0.86146146, 0.867494, 0.86924356, 0.8688037, 0.8332724, 0.8723539, + 0.8564482, 0.84321207 + ], + "updatedAt": "2024-12-31T10:16:47.527Z" + }, + { + "id": "tron", + "ledgerIds": ["tron"], + "ticker": "trx", + "name": "TRON", + "image": "https://proxycgassets.api.live.ledger.com/coins/images/1094/large/tron-logo.png", + "marketCap": 21970843505, + "marketCapRank": 11, + "fullyDilutedValuation": 21970894816, + "totalVolume": 1012294544, + "high24h": 0.257575, + "low24h": 0.24993, + "price": 0.254887, + "priceChange24h": -0.002687483438770955, + "priceChangePercentage1h": 0.1973075670283015, + "priceChangePercentage24h": -1.0433791014543137, + "priceChangePercentage7d": 1.54147244416966, + "priceChangePercentage30d": 22.641648638199786, + "priceChangePercentage1y": 138.9094065445957, + "marketCapChange24h": -258301322.7255478, + "marketCapChangePercentage24h": -1.16199, + "circulatingSupply": 86198202758.0796, + "totalSupply": 86198404067.76656, + "maxSupply": null, + "allTimeHigh": 0.431288, + "allTimeLow": 0.00180434, + "allTimeHighDate": "2024-12-04T00:10:40.323Z", + "allTimeLowDate": "2017-11-12T00:00:00Z", + "sparkline": [ + 0.25184745, 0.2521761, 0.25827459, 0.2546718, 0.25590792, 0.2564097, 0.25633085, 0.25624526, + 0.255653, 0.25754082, 0.25681216, 0.25404096, 0.2506206, 0.25161782, 0.25293273, 0.25233158, + 0.25398606, 0.25793663, 0.25850677, 0.26346758, 0.2583691, 0.2603921, 0.26237553, 0.2605038, + 0.25831977, 0.25779483, 0.2572659, 0.2573395, 0.2571063, 0.2596744, 0.26235452, 0.25943255, + 0.2593533, 0.25902432, 0.25807256, 0.25733986, 0.25791758, 0.25641564, 0.25063676, 0.2553439, + 0.25210392, 0.25236216 + ], + "updatedAt": "2024-12-31T10:16:47.777Z" + }, + { + "id": "avalanche-2", + "ledgerIds": ["avalanche_c_chain"], + "ticker": "avax", + "name": "Avalanche", + "image": "https://proxycgassets.api.live.ledger.com/coins/images/12559/large/Avalanche_Circle_RedWhite_Trans.png", + "marketCap": 14825812294, + "marketCapRank": 12, + "fullyDilutedValuation": 16212451242, + "totalVolume": 458866218, + "high24h": 37.1, + "low24h": 34.96, + "price": 36.11, + "priceChange24h": -0.7094664371557116, + "priceChangePercentage1h": 0.30977719688138877, + "priceChangePercentage24h": -1.9270971440418876, + "priceChangePercentage7d": -6.557584268196163, + "priceChangePercentage30d": -18.383640803640418, + "priceChangePercentage1y": -10.656817265264573, + "marketCapChange24h": -272730701.6647587, + "marketCapChangePercentage24h": -1.80634, + "circulatingSupply": 409884859.4683651, + "totalSupply": 448220857.4671019, + "maxSupply": 720000000, + "allTimeHigh": 144.96, + "allTimeLow": 2.8, + "allTimeHighDate": "2021-11-21T14:18:56.538Z", + "allTimeLowDate": "2020-12-31T13:15:21.540Z", + "sparkline": [ + 38.639652, 40.21172, 41.25474, 41.25307, 41.341526, 41.20508, 41.14042, 40.670063, 40.356552, + 40.122513, 39.861397, 39.238255, 37.97234, 37.718807, 37.287006, 37.45066, 37.612827, + 37.386074, 38.6536, 37.964516, 37.368156, 36.638863, 36.541607, 36.80831, 36.737003, + 36.881474, 37.63784, 37.676544, 37.131657, 37.228867, 37.352184, 36.94713, 36.140465, + 35.85945, 36.75003, 36.29679, 36.832157, 35.59798, 36.354767, 35.858177, 35.295567, 35.11637 + ], + "updatedAt": "2024-12-31T10:16:24.826Z" + }, + { + "id": "the-open-network", + "ledgerIds": ["ton", "bsc/bep20/wrapped_ton_coin", "ethereum/erc20/wrapped_ton_coin"], + "ticker": "ton", + "name": "Toncoin", + "image": "https://proxycgassets.api.live.ledger.com/coins/images/17980/large/photo_2024-09-10_17.09.00.jpeg", + "marketCap": 14185252559, + "marketCapRank": 13, + "fullyDilutedValuation": 28445119857, + "totalVolume": 225840656, + "high24h": 5.66, + "low24h": 5.47, + "price": 5.55, + "priceChange24h": -0.05036353834154195, + "priceChangePercentage1h": -0.2280450197322747, + "priceChangePercentage24h": -0.8990754125116793, + "priceChangePercentage7d": -1.9174051231928324, + "priceChangePercentage30d": -17.896249287878383, + "priceChangePercentage1y": 138.96015100929702, + "marketCapChange24h": -125084335.74028969, + "marketCapChangePercentage24h": -0.87408, + "circulatingSupply": 2552638032.955714, + "totalSupply": 5118706582.838319, + "maxSupply": null, + "allTimeHigh": 8.25, + "allTimeLow": 0.519364, + "allTimeHighDate": "2024-06-15T00:36:51.509Z", + "allTimeLowDate": "2021-09-21T00:33:11.092Z", + "sparkline": [ + 5.6598625, 5.754919, 5.824322, 5.7595844, 5.8867188, 5.8420277, 5.909578, 6.016784, 5.9578958, + 5.901559, 5.9173393, 5.8809633, 5.7122016, 5.7789955, 5.6930494, 5.758923, 5.757879, 5.788788, + 5.8249555, 5.841183, 5.8046365, 5.7229486, 5.7198577, 5.677256, 5.707244, 5.8204727, + 5.7941127, 5.806628, 5.816661, 5.7878323, 5.783315, 5.7607822, 5.6789203, 5.603994, 5.6749754, + 5.627846, 5.5962, 5.490087, 5.568906, 5.534949, 5.5090823, 5.4853215 + ], + "updatedAt": "2024-12-31T10:16:26.523Z" + }, + { + "id": "wrapped-steth", + "ledgerIds": ["linea/erc20/wrapped_liquid_staked_ether_2_0", "ethereum/erc20/wsteth"], + "ticker": "wsteth", + "name": "Wrapped stETH", + "image": "https://proxycgassets.api.live.ledger.com/coins/images/18834/large/wstETH.png", + "marketCap": 14046841587, + "marketCapRank": 14, + "fullyDilutedValuation": 14046841587, + "totalVolume": 71772267, + "high24h": 4068.29, + "low24h": 3930.62, + "price": 4009.06, + "priceChange24h": -53.36369553765462, + "priceChangePercentage1h": 0.42616857946941283, + "priceChangePercentage24h": -1.3135923002160776, + "priceChangePercentage7d": -0.5771659881209454, + "priceChangePercentage30d": -8.770780404106022, + "priceChangePercentage1y": 51.35599350521184, + "marketCapChange24h": -208345692.35718155, + "marketCapChangePercentage24h": -1.46154, + "circulatingSupply": 3499395.007600472, + "totalSupply": 3499395.007600472, + "maxSupply": null, + "allTimeHigh": 7256.02, + "allTimeLow": 558.54, + "allTimeHighDate": "2022-05-13T15:09:54.509Z", + "allTimeLowDate": "2022-05-13T01:36:45.053Z", + "sparkline": [ + 4032.334, 4105.441, 4141.033, 4138.362, 4120.884, 4143.014, 4142.1523, 4128.1177, 4119.916, + 4113.2095, 4125.1875, 4084.2607, 3999.3398, 3980.5872, 4068.0718, 3952.9236, 3943.785, + 4007.0645, 4054.2686, 4031.3005, 3932.3413, 3955.1396, 3965.0352, 3970.1985, 3958.6807, + 3987.275, 4028.03, 4031.0437, 4012.9043, 4019.7678, 4034.5122, 4028.8943, 3988.9834, + 3972.6184, 4072.5156, 4041.5388, 4062.6296, 4026.623, 3998.7192, 3966.1946, 3955.1667, + 3966.569 + ], + "updatedAt": "2024-12-31T10:16:27.261Z" + }, + { + "id": "chainlink", + "ledgerIds": [ + "energi/erc20/chainlink_0x68ca48ca2626c415a89756471d4ade2cc9034008", + "telos_evm/erc20/chainlink_token", + "ethereum/erc20/link_chainlink", + "linea/erc20/chainlink_token", + "polygon/erc20/chainlink_token", + "fantom/erc20/chainlink", + "polygon_zk_evm/erc20/chainlink_token", + "bsc/bep20/binance-peg_chainlink_token", + "arbitrum/erc20/chainlink_token", + "cronos/erc20/chainlink_token", + "optimism/erc20/chainlink_token", + "avalanche_c_chain/erc20/chainlink_token_(bridged)" + ], + "ticker": "link", + "name": "Chainlink", + "image": "https://proxycgassets.api.live.ledger.com/coins/images/877/large/chainlink-new-logo.png", + "marketCap": 12943987904, + "marketCapRank": 15, + "fullyDilutedValuation": 20510201984, + "totalVolume": 957624876, + "high24h": 21.35, + "low24h": 20.15, + "price": 20.51, + "priceChange24h": -0.7631204889296264, + "priceChangePercentage1h": -0.8136287865321303, + "priceChangePercentage24h": -3.587218169226621, + "priceChangePercentage7d": -14.467081168877035, + "priceChangePercentage30d": 10.158042587318166, + "priceChangePercentage1y": 33.44125427477828, + "marketCapChange24h": -484503335.92292595, + "marketCapChangePercentage24h": -3.60803, + "circulatingSupply": 631099972.3083414, + "totalSupply": 1000000000, + "maxSupply": 1000000000, + "allTimeHigh": 52.7, + "allTimeLow": 0.148183, + "allTimeHighDate": "2021-05-10T00:13:57.214Z", + "allTimeLowDate": "2017-11-29T00:00:00Z", + "sparkline": [ + 24.209078, 23.976608, 24.458948, 25.084902, 25.136507, 24.792242, 24.940084, 24.589434, + 24.348774, 24.465473, 24.248158, 23.76535, 22.929556, 22.875818, 22.99269, 22.62956, 22.76164, + 22.789274, 22.828783, 23.277178, 22.238335, 22.021738, 21.420797, 21.279528, 21.20358, + 21.167795, 21.756899, 21.857517, 21.804045, 21.700897, 21.602325, 21.411827, 21.264847, + 21.142395, 21.204641, 20.956923, 21.237356, 21.148888, 20.19856, 21.084345, 20.376377, + 20.213175 + ], + "updatedAt": "2024-12-31T10:16:47.626Z" + }, + { + "id": "shiba-inu", + "ledgerIds": ["linea/erc20/shiba_inu", "ethereum/erc20/shiba_inu"], + "ticker": "shib", + "name": "Shiba Inu", + "image": "https://proxycgassets.api.live.ledger.com/coins/images/11939/large/shiba.png", + "marketCap": 12481607650, + "marketCapRank": 16, + "fullyDilutedValuation": 12486968817, + "totalVolume": 580291080, + "high24h": 0.00002184, + "low24h": 0.00002056, + "price": 0.00002114, + "priceChange24h": -5.31628957927e-7, + "priceChangePercentage1h": 0.31051283934499996, + "priceChangePercentage24h": -2.452679951611943, + "priceChangePercentage7d": -4.997258358280292, + "priceChangePercentage30d": -29.308314654235872, + "priceChangePercentage1y": 100.05173423351302, + "marketCapChange24h": -280415045.24977875, + "marketCapChangePercentage24h": -2.19726, + "circulatingSupply": 589255408101236.4, + "totalSupply": 589508508233679.1, + "maxSupply": null, + "allTimeHigh": 0.00008616, + "allTimeLow": 5.6366e-11, + "allTimeHighDate": "2021-10-28T03:54:55.568Z", + "allTimeLowDate": "2020-11-28T11:26:25.838Z", + "sparkline": [ + 0.000022110697, 0.000023054132, 0.000023322016, 0.000023207022, 0.000023450377, + 0.000023237395, 0.000023086812, 0.000022992817, 0.00002292249, 0.000022734606, 0.000022609609, + 0.00002230877, 0.000021680142, 0.000021631971, 0.000021500486, 0.000021498727, 0.00002171554, + 0.000021772285, 0.000022265347, 0.00002201041, 0.000021903898, 0.000021632697, 0.000021620957, + 0.00002176814, 0.000021727701, 0.000021918557, 0.000022273738, 0.000022146749, 0.000021934025, + 0.000022116383, 0.0000222157, 0.000022048707, 0.000021759595, 0.000021514086, 0.000021757798, + 0.000021445107, 0.00002164095, 0.000021014488, 0.00002126644, 0.00002096944, 0.000020812407, + 0.000020611196 + ], + "updatedAt": "2024-12-31T10:16:44.352Z" + }, + { + "id": "sui", + "ledgerIds": ["sui"], + "ticker": "sui", + "name": "Sui", + "image": "https://proxycgassets.api.live.ledger.com/coins/images/26375/large/sui-ocean-square.png", + "marketCap": 12410289358, + "marketCapRank": 17, + "fullyDilutedValuation": 42389790068, + "totalVolume": 859675955, + "high24h": 4.36, + "low24h": 3.97, + "price": 4.22, + "priceChange24h": 0.142217, + "priceChangePercentage1h": -1.2420597659935377, + "priceChangePercentage24h": 3.4847539953515367, + "priceChangePercentage7d": -6.173238154297686, + "priceChangePercentage30d": 23.719208013980346, + "priceChangePercentage1y": 411.45692347112333, + "marketCapChange24h": 477436927, + "marketCapChangePercentage24h": 4.00103, + "circulatingSupply": 2927660018.558888, + "totalSupply": 10000000000, + "maxSupply": 10000000000, + "allTimeHigh": 4.91, + "allTimeLow": 0.364846, + "allTimeHighDate": "2024-12-16T00:50:33.515Z", + "allTimeLowDate": "2023-10-19T10:40:30.078Z", + "sparkline": [ + 4.5207925, 4.531386, 4.5858703, 4.5729237, 4.6054425, 4.6077275, 4.5507894, 4.4845595, + 4.536706, 4.5420294, 4.4496956, 4.392118, 4.260951, 4.2461004, 4.2840557, 4.180191, 4.2136817, + 4.2019725, 4.3009295, 4.3191204, 4.097427, 4.149929, 4.064292, 4.0341067, 4.0298157, + 4.0701776, 4.137865, 4.1757936, 4.1998167, 4.19703, 4.2234473, 4.173962, 4.1151705, 4.103249, + 4.096091, 4.0894814, 4.0987816, 4.122348, 4.0647206, 4.279524, 4.1016817, 4.076731 + ], + "updatedAt": "2024-12-31T10:16:50.343Z" + } +] diff --git a/apps/ledger-live-desktop/tests/handlers/index.ts b/apps/ledger-live-desktop/tests/handlers/index.ts index 1262cfeb2150..a038d2118ab3 100644 --- a/apps/ledger-live-desktop/tests/handlers/index.ts +++ b/apps/ledger-live-desktop/tests/handlers/index.ts @@ -1,6 +1,7 @@ import NFTsHandlers from "./nfts"; +import MarketHandlers from "./market"; -export default [...NFTsHandlers]; +export default [...NFTsHandlers, ...MarketHandlers]; export const ALLOWED_UNHANDLED_REQUESTS = [ "https://nft.api.live.ledger.com/v1/marketdata/ethereum/1/contract/0xe3BE0054Da2F8da5002E8bdD8AA4c7fDf851E86D/floor-price", diff --git a/apps/ledger-live-desktop/tests/handlers/market.ts b/apps/ledger-live-desktop/tests/handlers/market.ts new file mode 100644 index 000000000000..f8a578b496d1 --- /dev/null +++ b/apps/ledger-live-desktop/tests/handlers/market.ts @@ -0,0 +1,22 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ +import { http, HttpResponse } from "msw"; +import { MarketMockedResponse } from "./fixtures/market"; + +const handlers = [ + http.get("https://countervalues.live.ledger.com/v3/markets", ({ request }) => { + const url = new URL(request.url); + const ids = url.searchParams.get("ids"); + const to = url.searchParams.get("to"); //countervalues like USD + const limit = url.searchParams.get("limit"); + const pageSize = url.searchParams.get("pageSize"); + const sortBy = url.searchParams.get("sort"); + const idsSplit = ids?.split(","); + if (idsSplit?.length === 1 && idsSplit[0] === "bitcoin") { + return HttpResponse.json(MarketMockedResponse.bitcoinDetail); + } else { + return HttpResponse.json(MarketMockedResponse.marketList); + } + }), +]; + +export default handlers;