generate guess types
This commit is contained in:
parent
6c70328bb6
commit
4bb61ad74c
39
apps/explorer/src/app/components/search/__generated__/Guess.ts
generated
Normal file
39
apps/explorer/src/app/components/search/__generated__/Guess.ts
generated
Normal file
@ -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;
|
||||||
|
}
|
@ -4,6 +4,7 @@ import { useState } from 'react';
|
|||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import debounce from 'lodash.debounce';
|
import debounce from 'lodash.debounce';
|
||||||
|
import { Guess, GuessVariables } from './__generated__/Guess';
|
||||||
|
|
||||||
const TX_LENGTH = 64;
|
const TX_LENGTH = 64;
|
||||||
|
|
||||||
@ -28,12 +29,15 @@ const GUESS_QUERY = gql`
|
|||||||
|
|
||||||
const usePossibleType = (search: string) => {
|
const usePossibleType = (search: string) => {
|
||||||
const [possibleType, setPossibleType] = useState<PossibleIdTypes>();
|
const [possibleType, setPossibleType] = useState<PossibleIdTypes>();
|
||||||
const { data, loading, error } = useQuery<any, any>(GUESS_QUERY, {
|
const { data, loading, error } = useQuery<Guess, GuessVariables>(
|
||||||
|
GUESS_QUERY,
|
||||||
|
{
|
||||||
variables: {
|
variables: {
|
||||||
guess: search,
|
guess: search,
|
||||||
},
|
},
|
||||||
skip: !search,
|
skip: !search,
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (!isNaN(Number(search))) {
|
if (!isNaN(Number(search))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user