From 936f10aa28c89556a7204249d9bce328a9e03929 Mon Sep 17 00:00:00 2001 From: Gancho Radkov Date: Wed, 3 Jan 2024 12:26:29 +0200 Subject: [PATCH] fix: removes imports of `caip-api` --- examples/dapp/src/components/Blockchain.tsx | 26 ++++++--------------- examples/dapp/src/helpers/types.ts | 4 +--- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/examples/dapp/src/components/Blockchain.tsx b/examples/dapp/src/components/Blockchain.tsx index 50acb99..e150697 100644 --- a/examples/dapp/src/components/Blockchain.tsx +++ b/examples/dapp/src/components/Blockchain.tsx @@ -1,6 +1,5 @@ import React, { PropsWithChildren, FC } from "react"; import styled from "styled-components"; -import { ChainData } from "caip-api"; import Asset from "./Asset"; import Button from "./Button"; @@ -14,6 +13,7 @@ import { ChainMetadata, ChainNamespaces, AccountBalances, + NamespaceMetadata, } from "../helpers"; import { fonts } from "../styles"; @@ -93,13 +93,13 @@ interface BlockchainProps { } interface BlockchainDisplayData { - data: ChainData; + data: ChainMetadata; meta: ChainMetadata; } function getBlockchainDisplayData( chainId: string, - chainData: ChainNamespaces + chainData: ChainNamespaces, ): BlockchainDisplayData | undefined { const [namespace, reference] = chainId.split(":"); let meta: ChainMetadata; @@ -108,24 +108,15 @@ function getBlockchainDisplayData( } catch (e) { return undefined; } - const data: ChainData = chainData[namespace][reference]; + const data = chainData[namespace][reference]; if (typeof data === "undefined") return undefined; return { data, meta }; } const Blockchain: FC> = ( - props: PropsWithChildren + props: PropsWithChildren, ) => { - const { - chainData, - fetching, - chainId, - address, - onClick, - balances, - active, - actions, - } = props; + const { chainData, fetching, chainId, address, onClick, balances, active, actions } = props; if (!Object.keys(chainData).length) return null; @@ -162,10 +153,7 @@ const Blockchain: FC> = (
Balances
- +
) : null} diff --git a/examples/dapp/src/helpers/types.ts b/examples/dapp/src/helpers/types.ts index 71fc62b..f87d1d3 100644 --- a/examples/dapp/src/helpers/types.ts +++ b/examples/dapp/src/helpers/types.ts @@ -1,5 +1,3 @@ -import { ChainsMap } from "caip-api"; - export interface AssetData { account: string; symbol: string; @@ -145,7 +143,7 @@ export interface NamespaceMetadata { [reference: string]: ChainMetadata; } export interface ChainNamespaces { - [namespace: string]: ChainsMap; + [namespace: string]: NamespaceMetadata; } export interface AccountAction {