diff --git a/package.json b/package.json index fc869ca8c..8ed6d7672 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "dependencies": { "@amcharts/amcharts4": "^4.9.12", "@apollo/client": "^3.1.5", - "@cowprotocol/cow-sdk": "^1.0.0", + "@cowprotocol/cow-sdk": "^1.0.0-RC.0", "@fortawesome/fontawesome-svg-core": "^1.2.26", "@fortawesome/free-regular-svg-icons": "^5.12.0", "@fortawesome/free-solid-svg-icons": "^5.15.4", diff --git a/src/components/orders/DetailsTable/index.tsx b/src/components/orders/DetailsTable/index.tsx index a983b227b..ed3232f25 100644 --- a/src/components/orders/DetailsTable/index.tsx +++ b/src/components/orders/DetailsTable/index.tsx @@ -27,7 +27,7 @@ import { faProjectDiagram } from '@fortawesome/free-solid-svg-icons' import { getCidHashFromAppData, getDecodedAppData } from 'hooks/useAppData' import useSafeState from 'hooks/useSafeState' import { useNetworkId } from 'state/network' -import { LatestAppDataDocVersion } from '@cowprotocol/cow-sdk' +import { AnyAppDataDocVersion } from '@cowprotocol/cow-sdk' import { DEFAULT_IPFS_READ_URI, IPFS_INVALID_APP_IDS } from 'const' const Table = styled(SimpleTable)` @@ -221,7 +221,7 @@ export function DetailsTable(props: Props): JSX.Element | null { } = order const [appDataLoading, setAppDataLoading] = useSafeState(false) const [appDataError, setAppDataError] = useSafeState(false) - const [decodedAppData, setDecodedAppData] = useSafeState(undefined) + const [decodedAppData, setDecodedAppData] = useSafeState(undefined) const [ipfsUri, setIpfsUri] = useSafeState('') const [showDecodedAppData, setShowDecodedAppData] = useSafeState(false) diff --git a/src/hooks/useAppData.ts b/src/hooks/useAppData.ts index 8a4f11db2..cf7f56345 100644 --- a/src/hooks/useAppData.ts +++ b/src/hooks/useAppData.ts @@ -1,15 +1,15 @@ import { useEffect, useState } from 'react' -import { LatestAppDataDocVersion } from '@cowprotocol/cow-sdk' +import { AnyAppDataDocVersion } from '@cowprotocol/cow-sdk' import { useNetworkId } from 'state/network' import { COW_SDK } from 'const' import { Network } from 'types' export const useAppData = ( appDataHash: string, -): { isLoading: boolean; appDataDoc: LatestAppDataDocVersion | void | undefined } => { +): { isLoading: boolean; appDataDoc: AnyAppDataDocVersion | void | undefined } => { const network = useNetworkId() || undefined const [isLoading, setLoading] = useState(false) - const [appDataDoc, setAppDataDoc] = useState() + const [appDataDoc, setAppDataDoc] = useState() useEffect(() => { async function getAppDataDoc(): Promise { setLoading(true) @@ -33,7 +33,7 @@ export const useAppData = ( export const getDecodedAppData = ( appDataHash: string, networkId = Network.MAINNET, -): Promise | undefined => { +): Promise | undefined => { return COW_SDK[networkId]?.metadataApi.decodeAppData(appDataHash) }