diff --git a/.env b/.env new file mode 100644 index 000000000..578fadf8e --- /dev/null +++ b/.env @@ -0,0 +1 @@ +NX_VEGA_URL = "https://lb.testnet.vega.xyz/query" diff --git a/apps/explorer/src/app/components/search/__generated__/Guess.ts b/apps/explorer/src/app/components/search/__generated__/Guess.ts new file mode 100644 index 000000000..3f51b12d8 --- /dev/null +++ b/apps/explorer/src/app/components/search/__generated__/Guess.ts @@ -0,0 +1,39 @@ +/* tslint:disable */ +/* eslint-disable */ +// @generated +// This file was automatically generated and should not be edited. + +// ==================================================== +// GraphQL query operation: Guess +// ==================================================== + +export interface Guess_party { + __typename: 'Party'; + /** + * Party identifier + */ + id: string; +} + +export interface Guess_market { + __typename: 'Market'; + /** + * Market ID + */ + id: string; +} + +export interface Guess { + /** + * An entity that is trading on the VEGA network + */ + party: Guess_party | null; + /** + * An instrument that is trading on the VEGA network + */ + market: Guess_market | null; +} + +export interface GuessVariables { + guess: string; +} diff --git a/apps/explorer/src/app/components/search/index.tsx b/apps/explorer/src/app/components/search/index.tsx index 3309cbc74..69331472c 100644 --- a/apps/explorer/src/app/components/search/index.tsx +++ b/apps/explorer/src/app/components/search/index.tsx @@ -4,6 +4,7 @@ import { useState } from 'react'; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import debounce from 'lodash.debounce'; +import { Guess, GuessVariables } from './__generated__/Guess'; const TX_LENGTH = 64; @@ -28,12 +29,15 @@ const GUESS_QUERY = gql` const usePossibleType = (search: string) => { const [possibleType, setPossibleType] = useState(); - const { data, loading, error } = useQuery(GUESS_QUERY, { - variables: { - guess: search, - }, - skip: !search, - }); + const { data, loading, error } = useQuery( + GUESS_QUERY, + { + variables: { + guess: search, + }, + skip: !search, + } + ); React.useEffect(() => { if (!isNaN(Number(search))) {