chore: remove unused __generated__ files (#1599)
* chore: remove unused __generated__ files * chore: change default env for type generation to testnet * chore: fix import in assets data provider
This commit is contained in:
parent
faa1d51acb
commit
a40f494a6f
libs
accounts/src/lib
assets/src/lib
candles-chart/src/lib
deal-ticket/src/components
deal-ticket-validation
deal-ticket
__generated__
__generated___
deal-ticket-amount.tsxdeal-ticket-container.tsxdeal-ticket-manager.tsxdeal-ticket.spec.tsxdeal-ticket.tsxindex.tstrading-mode-tooltip
fills/src
types
159
libs/accounts/src/lib/__generated__/Accounts.ts
generated
159
libs/accounts/src/lib/__generated__/Accounts.ts
generated
@ -1,159 +0,0 @@
|
|||||||
import { Schema as Types } from '@vegaprotocol/types';
|
|
||||||
|
|
||||||
import { gql } from '@apollo/client';
|
|
||||||
import * as Apollo from '@apollo/client';
|
|
||||||
const defaultOptions = {} as const;
|
|
||||||
export type AccountFieldsFragment = { __typename?: 'Account', type: Types.AccountType, balance: string, market?: { __typename?: 'Market', id: string } | null, asset: { __typename?: 'Asset', id: string } };
|
|
||||||
|
|
||||||
export type AccountsQueryVariables = Types.Exact<{
|
|
||||||
partyId: Types.Scalars['ID'];
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
export type AccountsQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, accounts?: Array<{ __typename?: 'Account', type: Types.AccountType, balance: string, market?: { __typename?: 'Market', id: string } | null, asset: { __typename?: 'Asset', id: string } }> | null } | null };
|
|
||||||
|
|
||||||
export type AccountEventsSubscriptionVariables = Types.Exact<{
|
|
||||||
partyId: Types.Scalars['ID'];
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
export type AccountEventsSubscription = { __typename?: 'Subscription', accounts: Array<{ __typename?: 'AccountUpdate', type: Types.AccountType, balance: string, assetId: string, marketId?: string | null }> };
|
|
||||||
|
|
||||||
export type AssetsFieldsFragment = { __typename?: 'Asset', id: string, name: string, symbol: string, decimals: number, quantum: string, status: Types.AssetStatus };
|
|
||||||
|
|
||||||
export type AssetsQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
|
||||||
|
|
||||||
|
|
||||||
export type AssetsQuery = { __typename?: 'Query', assetsConnection?: { __typename?: 'AssetsConnection', edges?: Array<{ __typename?: 'AssetEdge', node: { __typename?: 'Asset', id: string, name: string, symbol: string, decimals: number, quantum: string, status: Types.AssetStatus } } | null> | null } | null };
|
|
||||||
|
|
||||||
export const AccountFieldsFragmentDoc = gql`
|
|
||||||
fragment AccountFields on Account {
|
|
||||||
type
|
|
||||||
balance
|
|
||||||
market {
|
|
||||||
id
|
|
||||||
}
|
|
||||||
asset {
|
|
||||||
id
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
export const AssetsFieldsFragmentDoc = gql`
|
|
||||||
fragment AssetsFields on Asset {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
symbol
|
|
||||||
decimals
|
|
||||||
quantum
|
|
||||||
status
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
export const AccountsDocument = gql`
|
|
||||||
query Accounts($partyId: ID!) {
|
|
||||||
party(id: $partyId) {
|
|
||||||
id
|
|
||||||
accounts {
|
|
||||||
...AccountFields
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
${AccountFieldsFragmentDoc}`;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* __useAccountsQuery__
|
|
||||||
*
|
|
||||||
* To run a query within a React component, call `useAccountsQuery` and pass it any options that fit your needs.
|
|
||||||
* When your component renders, `useAccountsQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
||||||
* you can use to render your UI.
|
|
||||||
*
|
|
||||||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* const { data, loading, error } = useAccountsQuery({
|
|
||||||
* variables: {
|
|
||||||
* partyId: // value for 'partyId'
|
|
||||||
* },
|
|
||||||
* });
|
|
||||||
*/
|
|
||||||
export function useAccountsQuery(baseOptions: Apollo.QueryHookOptions<AccountsQuery, AccountsQueryVariables>) {
|
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
|
||||||
return Apollo.useQuery<AccountsQuery, AccountsQueryVariables>(AccountsDocument, options);
|
|
||||||
}
|
|
||||||
export function useAccountsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<AccountsQuery, AccountsQueryVariables>) {
|
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
|
||||||
return Apollo.useLazyQuery<AccountsQuery, AccountsQueryVariables>(AccountsDocument, options);
|
|
||||||
}
|
|
||||||
export type AccountsQueryHookResult = ReturnType<typeof useAccountsQuery>;
|
|
||||||
export type AccountsLazyQueryHookResult = ReturnType<typeof useAccountsLazyQuery>;
|
|
||||||
export type AccountsQueryResult = Apollo.QueryResult<AccountsQuery, AccountsQueryVariables>;
|
|
||||||
export const AccountEventsDocument = gql`
|
|
||||||
subscription AccountEvents($partyId: ID!) {
|
|
||||||
accounts(partyId: $partyId) {
|
|
||||||
type
|
|
||||||
balance
|
|
||||||
assetId
|
|
||||||
marketId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* __useAccountEventsSubscription__
|
|
||||||
*
|
|
||||||
* To run a query within a React component, call `useAccountEventsSubscription` and pass it any options that fit your needs.
|
|
||||||
* When your component renders, `useAccountEventsSubscription` returns an object from Apollo Client that contains loading, error, and data properties
|
|
||||||
* you can use to render your UI.
|
|
||||||
*
|
|
||||||
* @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* const { data, loading, error } = useAccountEventsSubscription({
|
|
||||||
* variables: {
|
|
||||||
* partyId: // value for 'partyId'
|
|
||||||
* },
|
|
||||||
* });
|
|
||||||
*/
|
|
||||||
export function useAccountEventsSubscription(baseOptions: Apollo.SubscriptionHookOptions<AccountEventsSubscription, AccountEventsSubscriptionVariables>) {
|
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
|
||||||
return Apollo.useSubscription<AccountEventsSubscription, AccountEventsSubscriptionVariables>(AccountEventsDocument, options);
|
|
||||||
}
|
|
||||||
export type AccountEventsSubscriptionHookResult = ReturnType<typeof useAccountEventsSubscription>;
|
|
||||||
export type AccountEventsSubscriptionResult = Apollo.SubscriptionResult<AccountEventsSubscription>;
|
|
||||||
export const AssetsDocument = gql`
|
|
||||||
query Assets {
|
|
||||||
assetsConnection {
|
|
||||||
edges {
|
|
||||||
node {
|
|
||||||
...AssetsFields
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
${AssetsFieldsFragmentDoc}`;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* __useAssetsQuery__
|
|
||||||
*
|
|
||||||
* To run a query within a React component, call `useAssetsQuery` and pass it any options that fit your needs.
|
|
||||||
* When your component renders, `useAssetsQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
||||||
* you can use to render your UI.
|
|
||||||
*
|
|
||||||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* const { data, loading, error } = useAssetsQuery({
|
|
||||||
* variables: {
|
|
||||||
* },
|
|
||||||
* });
|
|
||||||
*/
|
|
||||||
export function useAssetsQuery(baseOptions?: Apollo.QueryHookOptions<AssetsQuery, AssetsQueryVariables>) {
|
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
|
||||||
return Apollo.useQuery<AssetsQuery, AssetsQueryVariables>(AssetsDocument, options);
|
|
||||||
}
|
|
||||||
export function useAssetsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<AssetsQuery, AssetsQueryVariables>) {
|
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
|
||||||
return Apollo.useLazyQuery<AssetsQuery, AssetsQueryVariables>(AssetsDocument, options);
|
|
||||||
}
|
|
||||||
export type AssetsQueryHookResult = ReturnType<typeof useAssetsQuery>;
|
|
||||||
export type AssetsLazyQueryHookResult = ReturnType<typeof useAssetsLazyQuery>;
|
|
||||||
export type AssetsQueryResult = Apollo.QueryResult<AssetsQuery, AssetsQueryVariables>;
|
|
@ -1,9 +1,9 @@
|
|||||||
import { makeDataProvider } from '@vegaprotocol/react-helpers';
|
import { makeDataProvider } from '@vegaprotocol/react-helpers';
|
||||||
import { AssetsDocument } from './__generated__/Accounts';
|
import { AssetsDocument } from './__generated___/Accounts';
|
||||||
import type {
|
import type {
|
||||||
AssetsQuery,
|
AssetsQuery,
|
||||||
AssetsFieldsFragment,
|
AssetsFieldsFragment,
|
||||||
} from './__generated__/Accounts';
|
} from './__generated___/Accounts';
|
||||||
|
|
||||||
const getData = (responseData: AssetsQuery) =>
|
const getData = (responseData: AssetsQuery) =>
|
||||||
responseData.assetsConnection?.edges
|
responseData.assetsConnection?.edges
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
export * from './__generated__/Accounts';
|
export * from './__generated___/Accounts';
|
||||||
export * from './accounts-data-provider';
|
export * from './accounts-data-provider';
|
||||||
export * from './accounts-table';
|
export * from './accounts-table';
|
||||||
export * from './asset-balance';
|
export * from './asset-balance';
|
||||||
|
59
libs/assets/src/lib/__generated__/Asset.ts
generated
59
libs/assets/src/lib/__generated__/Asset.ts
generated
@ -1,59 +0,0 @@
|
|||||||
import { Schema as Types } from '@vegaprotocol/types';
|
|
||||||
|
|
||||||
import { gql } from '@apollo/client';
|
|
||||||
import * as Apollo from '@apollo/client';
|
|
||||||
const defaultOptions = {} as const;
|
|
||||||
export type AssetQueryVariables = Types.Exact<{
|
|
||||||
assetId: Types.Scalars['ID'];
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
export type AssetQuery = { __typename?: 'Query', asset?: { __typename?: 'Asset', id: string, name: string, symbol: string, decimals: number, quantum: string, source: { __typename?: 'BuiltinAsset' } | { __typename?: 'ERC20', contractAddress: string, lifetimeLimit: string, withdrawThreshold: string } } | null };
|
|
||||||
|
|
||||||
|
|
||||||
export const AssetDocument = gql`
|
|
||||||
query Asset($assetId: ID!) {
|
|
||||||
asset(id: $assetId) {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
symbol
|
|
||||||
decimals
|
|
||||||
quantum
|
|
||||||
source {
|
|
||||||
... on ERC20 {
|
|
||||||
contractAddress
|
|
||||||
lifetimeLimit
|
|
||||||
withdrawThreshold
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* __useAssetQuery__
|
|
||||||
*
|
|
||||||
* To run a query within a React component, call `useAssetQuery` and pass it any options that fit your needs.
|
|
||||||
* When your component renders, `useAssetQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
||||||
* you can use to render your UI.
|
|
||||||
*
|
|
||||||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* const { data, loading, error } = useAssetQuery({
|
|
||||||
* variables: {
|
|
||||||
* assetId: // value for 'assetId'
|
|
||||||
* },
|
|
||||||
* });
|
|
||||||
*/
|
|
||||||
export function useAssetQuery(baseOptions: Apollo.QueryHookOptions<AssetQuery, AssetQueryVariables>) {
|
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
|
||||||
return Apollo.useQuery<AssetQuery, AssetQueryVariables>(AssetDocument, options);
|
|
||||||
}
|
|
||||||
export function useAssetLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<AssetQuery, AssetQueryVariables>) {
|
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
|
||||||
return Apollo.useLazyQuery<AssetQuery, AssetQueryVariables>(AssetDocument, options);
|
|
||||||
}
|
|
||||||
export type AssetQueryHookResult = ReturnType<typeof useAssetQuery>;
|
|
||||||
export type AssetLazyQueryHookResult = ReturnType<typeof useAssetLazyQuery>;
|
|
||||||
export type AssetQueryResult = Apollo.QueryResult<AssetQuery, AssetQueryVariables>;
|
|
60
libs/assets/src/lib/__generated__/Assets.ts
generated
60
libs/assets/src/lib/__generated__/Assets.ts
generated
@ -1,60 +0,0 @@
|
|||||||
import { Schema as Types } from '@vegaprotocol/types';
|
|
||||||
|
|
||||||
import { gql } from '@apollo/client';
|
|
||||||
import * as Apollo from '@apollo/client';
|
|
||||||
const defaultOptions = {} as const;
|
|
||||||
export type AssetsConnectionQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
|
||||||
|
|
||||||
|
|
||||||
export type AssetsConnectionQuery = { __typename?: 'Query', assetsConnection?: { __typename?: 'AssetsConnection', edges?: Array<{ __typename?: 'AssetEdge', node: { __typename?: 'Asset', id: string, name: string, symbol: string, decimals: number, quantum: string, source: { __typename?: 'BuiltinAsset' } | { __typename?: 'ERC20', contractAddress: string, lifetimeLimit: string, withdrawThreshold: string } } } | null> | null } | null };
|
|
||||||
|
|
||||||
|
|
||||||
export const AssetsConnectionDocument = gql`
|
|
||||||
query AssetsConnection {
|
|
||||||
assetsConnection {
|
|
||||||
edges {
|
|
||||||
node {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
symbol
|
|
||||||
decimals
|
|
||||||
quantum
|
|
||||||
source {
|
|
||||||
... on ERC20 {
|
|
||||||
contractAddress
|
|
||||||
lifetimeLimit
|
|
||||||
withdrawThreshold
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* __useAssetsConnectionQuery__
|
|
||||||
*
|
|
||||||
* To run a query within a React component, call `useAssetsConnectionQuery` and pass it any options that fit your needs.
|
|
||||||
* When your component renders, `useAssetsConnectionQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
||||||
* you can use to render your UI.
|
|
||||||
*
|
|
||||||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* const { data, loading, error } = useAssetsConnectionQuery({
|
|
||||||
* variables: {
|
|
||||||
* },
|
|
||||||
* });
|
|
||||||
*/
|
|
||||||
export function useAssetsConnectionQuery(baseOptions?: Apollo.QueryHookOptions<AssetsConnectionQuery, AssetsConnectionQueryVariables>) {
|
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
|
||||||
return Apollo.useQuery<AssetsConnectionQuery, AssetsConnectionQueryVariables>(AssetsConnectionDocument, options);
|
|
||||||
}
|
|
||||||
export function useAssetsConnectionLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<AssetsConnectionQuery, AssetsConnectionQueryVariables>) {
|
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
|
||||||
return Apollo.useLazyQuery<AssetsConnectionQuery, AssetsConnectionQueryVariables>(AssetsConnectionDocument, options);
|
|
||||||
}
|
|
||||||
export type AssetsConnectionQueryHookResult = ReturnType<typeof useAssetsConnectionQuery>;
|
|
||||||
export type AssetsConnectionLazyQueryHookResult = ReturnType<typeof useAssetsConnectionLazyQuery>;
|
|
||||||
export type AssetsConnectionQueryResult = Apollo.QueryResult<AssetsConnectionQuery, AssetsConnectionQueryVariables>;
|
|
@ -1,7 +1,7 @@
|
|||||||
import { MockedProvider } from '@apollo/react-testing';
|
import { MockedProvider } from '@apollo/react-testing';
|
||||||
import { render, screen } from '@testing-library/react';
|
import { render, screen } from '@testing-library/react';
|
||||||
import { AssetDetailsDialog } from './asset-details-dialog';
|
import { AssetDetailsDialog } from './asset-details-dialog';
|
||||||
import { AssetsConnectionDocument } from './__generated__/Assets';
|
import { AssetsConnectionDocument } from './__generated___/Assets';
|
||||||
|
|
||||||
const mockedData = {
|
const mockedData = {
|
||||||
data: {
|
data: {
|
||||||
|
@ -9,7 +9,7 @@ import {
|
|||||||
Splash,
|
Splash,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
} from '@vegaprotocol/ui-toolkit';
|
} from '@vegaprotocol/ui-toolkit';
|
||||||
import { useAssetsConnectionQuery } from './__generated__/Assets';
|
import { useAssetsConnectionQuery } from './__generated___/Assets';
|
||||||
import type { Schema } from '@vegaprotocol/types';
|
import type { Schema } from '@vegaprotocol/types';
|
||||||
import create from 'zustand';
|
import create from 'zustand';
|
||||||
|
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
export * from './__generated__/Assets';
|
export * from './__generated___/Assets';
|
||||||
export * from './asset-details-dialog';
|
export * from './asset-details-dialog';
|
||||||
|
118
libs/candles-chart/src/lib/__generated__/Candles.ts
generated
118
libs/candles-chart/src/lib/__generated__/Candles.ts
generated
@ -1,118 +0,0 @@
|
|||||||
import { Schema as Types } from '@vegaprotocol/types';
|
|
||||||
|
|
||||||
import { gql } from '@apollo/client';
|
|
||||||
import * as Apollo from '@apollo/client';
|
|
||||||
const defaultOptions = {} as const;
|
|
||||||
export type CandleFieldsFragment = { __typename?: 'Candle', periodStart: string, lastUpdateInPeriod: string, high: string, low: string, open: string, close: string, volume: string };
|
|
||||||
|
|
||||||
export type CandlesQueryVariables = Types.Exact<{
|
|
||||||
marketId: Types.Scalars['ID'];
|
|
||||||
interval: Types.Interval;
|
|
||||||
since: Types.Scalars['String'];
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
export type CandlesQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, decimalPlaces: number, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', id: string, name: string, code: string } }, candlesConnection?: { __typename?: 'CandleDataConnection', edges?: Array<{ __typename?: 'CandleEdge', node: { __typename?: 'Candle', periodStart: string, lastUpdateInPeriod: string, high: string, low: string, open: string, close: string, volume: string } } | null> | null } | null } | null };
|
|
||||||
|
|
||||||
export type CandlesEventsSubscriptionVariables = Types.Exact<{
|
|
||||||
marketId: Types.Scalars['ID'];
|
|
||||||
interval: Types.Interval;
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
export type CandlesEventsSubscription = { __typename?: 'Subscription', candles: { __typename?: 'Candle', periodStart: string, lastUpdateInPeriod: string, high: string, low: string, open: string, close: string, volume: string } };
|
|
||||||
|
|
||||||
export const CandleFieldsFragmentDoc = gql`
|
|
||||||
fragment CandleFields on Candle {
|
|
||||||
periodStart
|
|
||||||
lastUpdateInPeriod
|
|
||||||
high
|
|
||||||
low
|
|
||||||
open
|
|
||||||
close
|
|
||||||
volume
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
export const CandlesDocument = gql`
|
|
||||||
query Candles($marketId: ID!, $interval: Interval!, $since: String!) {
|
|
||||||
market(id: $marketId) {
|
|
||||||
id
|
|
||||||
decimalPlaces
|
|
||||||
tradableInstrument {
|
|
||||||
instrument {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
code
|
|
||||||
}
|
|
||||||
}
|
|
||||||
candlesConnection(interval: $interval, since: $since) {
|
|
||||||
edges {
|
|
||||||
node {
|
|
||||||
...CandleFields
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
${CandleFieldsFragmentDoc}`;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* __useCandlesQuery__
|
|
||||||
*
|
|
||||||
* To run a query within a React component, call `useCandlesQuery` and pass it any options that fit your needs.
|
|
||||||
* When your component renders, `useCandlesQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
||||||
* you can use to render your UI.
|
|
||||||
*
|
|
||||||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* const { data, loading, error } = useCandlesQuery({
|
|
||||||
* variables: {
|
|
||||||
* marketId: // value for 'marketId'
|
|
||||||
* interval: // value for 'interval'
|
|
||||||
* since: // value for 'since'
|
|
||||||
* },
|
|
||||||
* });
|
|
||||||
*/
|
|
||||||
export function useCandlesQuery(baseOptions: Apollo.QueryHookOptions<CandlesQuery, CandlesQueryVariables>) {
|
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
|
||||||
return Apollo.useQuery<CandlesQuery, CandlesQueryVariables>(CandlesDocument, options);
|
|
||||||
}
|
|
||||||
export function useCandlesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<CandlesQuery, CandlesQueryVariables>) {
|
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
|
||||||
return Apollo.useLazyQuery<CandlesQuery, CandlesQueryVariables>(CandlesDocument, options);
|
|
||||||
}
|
|
||||||
export type CandlesQueryHookResult = ReturnType<typeof useCandlesQuery>;
|
|
||||||
export type CandlesLazyQueryHookResult = ReturnType<typeof useCandlesLazyQuery>;
|
|
||||||
export type CandlesQueryResult = Apollo.QueryResult<CandlesQuery, CandlesQueryVariables>;
|
|
||||||
export const CandlesEventsDocument = gql`
|
|
||||||
subscription CandlesEvents($marketId: ID!, $interval: Interval!) {
|
|
||||||
candles(marketId: $marketId, interval: $interval) {
|
|
||||||
...CandleFields
|
|
||||||
}
|
|
||||||
}
|
|
||||||
${CandleFieldsFragmentDoc}`;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* __useCandlesEventsSubscription__
|
|
||||||
*
|
|
||||||
* To run a query within a React component, call `useCandlesEventsSubscription` and pass it any options that fit your needs.
|
|
||||||
* When your component renders, `useCandlesEventsSubscription` returns an object from Apollo Client that contains loading, error, and data properties
|
|
||||||
* you can use to render your UI.
|
|
||||||
*
|
|
||||||
* @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* const { data, loading, error } = useCandlesEventsSubscription({
|
|
||||||
* variables: {
|
|
||||||
* marketId: // value for 'marketId'
|
|
||||||
* interval: // value for 'interval'
|
|
||||||
* },
|
|
||||||
* });
|
|
||||||
*/
|
|
||||||
export function useCandlesEventsSubscription(baseOptions: Apollo.SubscriptionHookOptions<CandlesEventsSubscription, CandlesEventsSubscriptionVariables>) {
|
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
|
||||||
return Apollo.useSubscription<CandlesEventsSubscription, CandlesEventsSubscriptionVariables>(CandlesEventsDocument, options);
|
|
||||||
}
|
|
||||||
export type CandlesEventsSubscriptionHookResult = ReturnType<typeof useCandlesEventsSubscription>;
|
|
||||||
export type CandlesEventsSubscriptionResult = Apollo.SubscriptionResult<CandlesEventsSubscription>;
|
|
55
libs/candles-chart/src/lib/__generated__/Chart.ts
generated
55
libs/candles-chart/src/lib/__generated__/Chart.ts
generated
@ -1,55 +0,0 @@
|
|||||||
import { Schema as Types } from '@vegaprotocol/types';
|
|
||||||
|
|
||||||
import { gql } from '@apollo/client';
|
|
||||||
import * as Apollo from '@apollo/client';
|
|
||||||
const defaultOptions = {} as const;
|
|
||||||
export type ChartQueryVariables = Types.Exact<{
|
|
||||||
marketId: Types.Scalars['ID'];
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
export type ChartQuery = { __typename?: 'Query', market?: { __typename?: 'Market', decimalPlaces: number, data?: { __typename?: 'MarketData', priceMonitoringBounds?: Array<{ __typename?: 'PriceMonitoringBounds', minValidPrice: string, maxValidPrice: string, referencePrice: string }> | null } | null } | null };
|
|
||||||
|
|
||||||
|
|
||||||
export const ChartDocument = gql`
|
|
||||||
query Chart($marketId: ID!) {
|
|
||||||
market(id: $marketId) {
|
|
||||||
decimalPlaces
|
|
||||||
data {
|
|
||||||
priceMonitoringBounds {
|
|
||||||
minValidPrice
|
|
||||||
maxValidPrice
|
|
||||||
referencePrice
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* __useChartQuery__
|
|
||||||
*
|
|
||||||
* To run a query within a React component, call `useChartQuery` and pass it any options that fit your needs.
|
|
||||||
* When your component renders, `useChartQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
||||||
* you can use to render your UI.
|
|
||||||
*
|
|
||||||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* const { data, loading, error } = useChartQuery({
|
|
||||||
* variables: {
|
|
||||||
* marketId: // value for 'marketId'
|
|
||||||
* },
|
|
||||||
* });
|
|
||||||
*/
|
|
||||||
export function useChartQuery(baseOptions: Apollo.QueryHookOptions<ChartQuery, ChartQueryVariables>) {
|
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
|
||||||
return Apollo.useQuery<ChartQuery, ChartQueryVariables>(ChartDocument, options);
|
|
||||||
}
|
|
||||||
export function useChartLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<ChartQuery, ChartQueryVariables>) {
|
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
|
||||||
return Apollo.useLazyQuery<ChartQuery, ChartQueryVariables>(ChartDocument, options);
|
|
||||||
}
|
|
||||||
export type ChartQueryHookResult = ReturnType<typeof useChartQuery>;
|
|
||||||
export type ChartLazyQueryHookResult = ReturnType<typeof useChartLazyQuery>;
|
|
||||||
export type ChartQueryResult = Apollo.QueryResult<ChartQuery, ChartQueryVariables>;
|
|
@ -3,19 +3,19 @@ import type { Candle, DataSource } from 'pennant';
|
|||||||
import { Interval as PennantInterval } from 'pennant';
|
import { Interval as PennantInterval } from 'pennant';
|
||||||
|
|
||||||
import { addDecimal } from '@vegaprotocol/react-helpers';
|
import { addDecimal } from '@vegaprotocol/react-helpers';
|
||||||
import { ChartDocument } from './__generated__/Chart';
|
import { ChartDocument } from './__generated___/Chart';
|
||||||
import type { ChartQuery, ChartQueryVariables } from './__generated__/Chart';
|
import type { ChartQuery, ChartQueryVariables } from './__generated___/Chart';
|
||||||
import {
|
import {
|
||||||
CandlesDocument,
|
CandlesDocument,
|
||||||
CandlesEventsDocument,
|
CandlesEventsDocument,
|
||||||
} from './__generated__/Candles';
|
} from './__generated___/Candles';
|
||||||
import type {
|
import type {
|
||||||
CandlesQuery,
|
CandlesQuery,
|
||||||
CandlesQueryVariables,
|
CandlesQueryVariables,
|
||||||
CandleFieldsFragment,
|
CandleFieldsFragment,
|
||||||
CandlesEventsSubscription,
|
CandlesEventsSubscription,
|
||||||
CandlesEventsSubscriptionVariables,
|
CandlesEventsSubscriptionVariables,
|
||||||
} from './__generated__/Candles';
|
} from './__generated___/Candles';
|
||||||
import type { Subscription } from 'zen-observable-ts';
|
import type { Subscription } from 'zen-observable-ts';
|
||||||
import { Interval } from '@vegaprotocol/types';
|
import { Interval } from '@vegaprotocol/types';
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
export * from './__generated__/Candles';
|
export * from './__generated___/Candles';
|
||||||
export * from './__generated__/Chart';
|
export * from './__generated___/Chart';
|
||||||
export * from './candles-chart';
|
export * from './candles-chart';
|
||||||
export * from './data-source';
|
export * from './data-source';
|
||||||
|
@ -15,7 +15,7 @@ import { Tooltip } from '@vegaprotocol/ui-toolkit';
|
|||||||
import { ERROR_SIZE_DECIMAL } from './validate-size';
|
import { ERROR_SIZE_DECIMAL } from './validate-size';
|
||||||
import { MarketDataGrid } from '../trading-mode-tooltip';
|
import { MarketDataGrid } from '../trading-mode-tooltip';
|
||||||
import { compileGridData } from '../trading-mode-tooltip/compile-grid-data';
|
import { compileGridData } from '../trading-mode-tooltip/compile-grid-data';
|
||||||
import type { DealTicketMarketFragment } from '../deal-ticket/__generated__/DealTicket';
|
import type { DealTicketMarketFragment } from '../deal-ticket/__generated___/DealTicket';
|
||||||
|
|
||||||
export const isMarketInAuction = (market: DealTicketMarketFragment) => {
|
export const isMarketInAuction = (market: DealTicketMarketFragment) => {
|
||||||
return [
|
return [
|
||||||
|
@ -1,92 +0,0 @@
|
|||||||
import { Schema as Types } from '@vegaprotocol/types';
|
|
||||||
|
|
||||||
import { gql } from '@apollo/client';
|
|
||||||
import * as Apollo from '@apollo/client';
|
|
||||||
const defaultOptions = {} as const;
|
|
||||||
export type DealTicketMarketFragment = { __typename?: 'Market', id: string, decimalPlaces: number, positionDecimalPlaces: number, state: Types.MarketState, tradingMode: Types.MarketTradingMode, data?: { __typename?: 'MarketData', indicativePrice: string, indicativeVolume: string, targetStake?: string | null, suppliedStake?: string | null, auctionStart?: string | null, auctionEnd?: string | null, trigger: Types.AuctionTrigger, market: { __typename?: 'Market', id: string } } | null, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', id: string, name: string, product: { __typename?: 'Future', quoteName: string, settlementAsset: { __typename?: 'Asset', id: string, symbol: string, decimals: number, name: string } } } }, depth: { __typename?: 'MarketDepth', lastTrade?: { __typename?: 'Trade', price: string } | null } };
|
|
||||||
|
|
||||||
export type DealTicketQueryVariables = Types.Exact<{
|
|
||||||
marketId: Types.Scalars['ID'];
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
export type DealTicketQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, decimalPlaces: number, positionDecimalPlaces: number, state: Types.MarketState, tradingMode: Types.MarketTradingMode, data?: { __typename?: 'MarketData', indicativePrice: string, indicativeVolume: string, targetStake?: string | null, suppliedStake?: string | null, auctionStart?: string | null, auctionEnd?: string | null, trigger: Types.AuctionTrigger, market: { __typename?: 'Market', id: string } } | null, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', id: string, name: string, product: { __typename?: 'Future', quoteName: string, settlementAsset: { __typename?: 'Asset', id: string, symbol: string, decimals: number, name: string } } } }, depth: { __typename?: 'MarketDepth', lastTrade?: { __typename?: 'Trade', price: string } | null } } | null };
|
|
||||||
|
|
||||||
export const DealTicketMarketFragmentDoc = gql`
|
|
||||||
fragment DealTicketMarket on Market {
|
|
||||||
id
|
|
||||||
decimalPlaces
|
|
||||||
positionDecimalPlaces
|
|
||||||
state
|
|
||||||
tradingMode
|
|
||||||
data {
|
|
||||||
market {
|
|
||||||
id
|
|
||||||
}
|
|
||||||
indicativePrice
|
|
||||||
indicativeVolume
|
|
||||||
targetStake
|
|
||||||
suppliedStake
|
|
||||||
auctionStart
|
|
||||||
auctionEnd
|
|
||||||
trigger
|
|
||||||
}
|
|
||||||
tradableInstrument {
|
|
||||||
instrument {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
product {
|
|
||||||
... on Future {
|
|
||||||
quoteName
|
|
||||||
settlementAsset {
|
|
||||||
id
|
|
||||||
symbol
|
|
||||||
decimals
|
|
||||||
name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
depth {
|
|
||||||
lastTrade {
|
|
||||||
price
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
export const DealTicketDocument = gql`
|
|
||||||
query DealTicket($marketId: ID!) {
|
|
||||||
market(id: $marketId) {
|
|
||||||
...DealTicketMarket
|
|
||||||
}
|
|
||||||
}
|
|
||||||
${DealTicketMarketFragmentDoc}`;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* __useDealTicketQuery__
|
|
||||||
*
|
|
||||||
* To run a query within a React component, call `useDealTicketQuery` and pass it any options that fit your needs.
|
|
||||||
* When your component renders, `useDealTicketQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
||||||
* you can use to render your UI.
|
|
||||||
*
|
|
||||||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* const { data, loading, error } = useDealTicketQuery({
|
|
||||||
* variables: {
|
|
||||||
* marketId: // value for 'marketId'
|
|
||||||
* },
|
|
||||||
* });
|
|
||||||
*/
|
|
||||||
export function useDealTicketQuery(baseOptions: Apollo.QueryHookOptions<DealTicketQuery, DealTicketQueryVariables>) {
|
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
|
||||||
return Apollo.useQuery<DealTicketQuery, DealTicketQueryVariables>(DealTicketDocument, options);
|
|
||||||
}
|
|
||||||
export function useDealTicketLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<DealTicketQuery, DealTicketQueryVariables>) {
|
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
|
||||||
return Apollo.useLazyQuery<DealTicketQuery, DealTicketQueryVariables>(DealTicketDocument, options);
|
|
||||||
}
|
|
||||||
export type DealTicketQueryHookResult = ReturnType<typeof useDealTicketQuery>;
|
|
||||||
export type DealTicketLazyQueryHookResult = ReturnType<typeof useDealTicketLazyQuery>;
|
|
||||||
export type DealTicketQueryResult = Apollo.QueryResult<DealTicketQuery, DealTicketQueryVariables>;
|
|
@ -3,14 +3,14 @@ import { Schema as Types } from '@vegaprotocol/types';
|
|||||||
import { gql } from '@apollo/client';
|
import { gql } from '@apollo/client';
|
||||||
import * as Apollo from '@apollo/client';
|
import * as Apollo from '@apollo/client';
|
||||||
const defaultOptions = {} as const;
|
const defaultOptions = {} as const;
|
||||||
export type DealTicketMarketFragment = { __typename?: 'Market', id: string, decimalPlaces: number, positionDecimalPlaces: number, state: Types.MarketState, tradingMode: Types.MarketTradingMode, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', id: string, name: string, product: { __typename?: 'Future', quoteName: string, settlementAsset: { __typename?: 'Asset', id: string, symbol: string, name: string } } } }, depth: { __typename?: 'MarketDepth', lastTrade?: { __typename?: 'Trade', price: string } | null } };
|
export type DealTicketMarketFragment = { __typename?: 'Market', id: string, decimalPlaces: number, positionDecimalPlaces: number, state: Types.MarketState, tradingMode: Types.MarketTradingMode, data?: { __typename?: 'MarketData', indicativePrice: string, indicativeVolume: string, targetStake?: string | null, suppliedStake?: string | null, auctionStart?: string | null, auctionEnd?: string | null, trigger: Types.AuctionTrigger, market: { __typename?: 'Market', id: string } } | null, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', id: string, name: string, product: { __typename?: 'Future', quoteName: string, settlementAsset: { __typename?: 'Asset', id: string, symbol: string, decimals: number, name: string } } } }, depth: { __typename?: 'MarketDepth', lastTrade?: { __typename?: 'Trade', price: string } | null } };
|
||||||
|
|
||||||
export type DealTicketQueryVariables = Types.Exact<{
|
export type DealTicketQueryVariables = Types.Exact<{
|
||||||
marketId: Types.Scalars['ID'];
|
marketId: Types.Scalars['ID'];
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
|
||||||
export type DealTicketQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, decimalPlaces: number, positionDecimalPlaces: number, state: Types.MarketState, tradingMode: Types.MarketTradingMode, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', id: string, name: string, product: { __typename?: 'Future', quoteName: string, settlementAsset: { __typename?: 'Asset', id: string, symbol: string, name: string } } } }, depth: { __typename?: 'MarketDepth', lastTrade?: { __typename?: 'Trade', price: string } | null } } | null };
|
export type DealTicketQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, decimalPlaces: number, positionDecimalPlaces: number, state: Types.MarketState, tradingMode: Types.MarketTradingMode, data?: { __typename?: 'MarketData', indicativePrice: string, indicativeVolume: string, targetStake?: string | null, suppliedStake?: string | null, auctionStart?: string | null, auctionEnd?: string | null, trigger: Types.AuctionTrigger, market: { __typename?: 'Market', id: string } } | null, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', id: string, name: string, product: { __typename?: 'Future', quoteName: string, settlementAsset: { __typename?: 'Asset', id: string, symbol: string, decimals: number, name: string } } } }, depth: { __typename?: 'MarketDepth', lastTrade?: { __typename?: 'Trade', price: string } | null } } | null };
|
||||||
|
|
||||||
export const DealTicketMarketFragmentDoc = gql`
|
export const DealTicketMarketFragmentDoc = gql`
|
||||||
fragment DealTicketMarket on Market {
|
fragment DealTicketMarket on Market {
|
||||||
@ -19,6 +19,18 @@ export const DealTicketMarketFragmentDoc = gql`
|
|||||||
positionDecimalPlaces
|
positionDecimalPlaces
|
||||||
state
|
state
|
||||||
tradingMode
|
tradingMode
|
||||||
|
data {
|
||||||
|
market {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
indicativePrice
|
||||||
|
indicativeVolume
|
||||||
|
targetStake
|
||||||
|
suppliedStake
|
||||||
|
auctionStart
|
||||||
|
auctionEnd
|
||||||
|
trigger
|
||||||
|
}
|
||||||
tradableInstrument {
|
tradableInstrument {
|
||||||
instrument {
|
instrument {
|
||||||
id
|
id
|
||||||
@ -29,6 +41,7 @@ export const DealTicketMarketFragmentDoc = gql`
|
|||||||
settlementAsset {
|
settlementAsset {
|
||||||
id
|
id
|
||||||
symbol
|
symbol
|
||||||
|
decimals
|
||||||
name
|
name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ import type { UseFormRegister } from 'react-hook-form';
|
|||||||
import type { OrderSubmissionBody } from '@vegaprotocol/wallet';
|
import type { OrderSubmissionBody } from '@vegaprotocol/wallet';
|
||||||
import { DealTicketMarketAmount } from './deal-ticket-market-amount';
|
import { DealTicketMarketAmount } from './deal-ticket-market-amount';
|
||||||
import { DealTicketLimitAmount } from './deal-ticket-limit-amount';
|
import { DealTicketLimitAmount } from './deal-ticket-limit-amount';
|
||||||
import type { DealTicketMarketFragment } from './__generated__/DealTicket';
|
import type { DealTicketMarketFragment } from './__generated___/DealTicket';
|
||||||
import { Schema } from '@vegaprotocol/types';
|
import { Schema } from '@vegaprotocol/types';
|
||||||
|
|
||||||
export interface DealTicketAmountProps {
|
export interface DealTicketAmountProps {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { AsyncRenderer, Splash } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer, Splash } from '@vegaprotocol/ui-toolkit';
|
||||||
import { DealTicketManager } from './deal-ticket-manager';
|
import { DealTicketManager } from './deal-ticket-manager';
|
||||||
import { t } from '@vegaprotocol/react-helpers';
|
import { t } from '@vegaprotocol/react-helpers';
|
||||||
import { useDealTicketQuery } from './__generated__/DealTicket';
|
import { useDealTicketQuery } from './__generated___/DealTicket';
|
||||||
import type { DealTicketQuery } from './__generated__/DealTicket';
|
import type { DealTicketQuery } from './__generated___/DealTicket';
|
||||||
|
|
||||||
export interface DealTicketContainerProps {
|
export interface DealTicketContainerProps {
|
||||||
marketId: string;
|
marketId: string;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
import { VegaTxStatus } from '@vegaprotocol/wallet';
|
import { VegaTxStatus } from '@vegaprotocol/wallet';
|
||||||
import { DealTicket } from './deal-ticket';
|
import { DealTicket } from './deal-ticket';
|
||||||
import type { DealTicketMarketFragment } from './__generated__/DealTicket';
|
import type { DealTicketMarketFragment } from './__generated___/DealTicket';
|
||||||
import { useOrderSubmit, OrderFeedback } from '@vegaprotocol/orders';
|
import { useOrderSubmit, OrderFeedback } from '@vegaprotocol/orders';
|
||||||
import { Schema } from '@vegaprotocol/types';
|
import { Schema } from '@vegaprotocol/types';
|
||||||
import { Icon, Intent } from '@vegaprotocol/ui-toolkit';
|
import { Icon, Intent } from '@vegaprotocol/ui-toolkit';
|
||||||
|
@ -2,7 +2,7 @@ import { VegaWalletContext } from '@vegaprotocol/wallet';
|
|||||||
import { addDecimal } from '@vegaprotocol/react-helpers';
|
import { addDecimal } from '@vegaprotocol/react-helpers';
|
||||||
import { fireEvent, render, screen, act } from '@testing-library/react';
|
import { fireEvent, render, screen, act } from '@testing-library/react';
|
||||||
import { DealTicket } from './deal-ticket';
|
import { DealTicket } from './deal-ticket';
|
||||||
import type { DealTicketMarketFragment } from './__generated__/DealTicket';
|
import type { DealTicketMarketFragment } from './__generated___/DealTicket';
|
||||||
import { Schema } from '@vegaprotocol/types';
|
import { Schema } from '@vegaprotocol/types';
|
||||||
import type { OrderSubmissionBody } from '@vegaprotocol/wallet';
|
import type { OrderSubmissionBody } from '@vegaprotocol/wallet';
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import { TypeSelector } from './type-selector';
|
|||||||
import { SideSelector } from './side-selector';
|
import { SideSelector } from './side-selector';
|
||||||
import { DealTicketAmount } from './deal-ticket-amount';
|
import { DealTicketAmount } from './deal-ticket-amount';
|
||||||
import { TimeInForceSelector } from './time-in-force-selector';
|
import { TimeInForceSelector } from './time-in-force-selector';
|
||||||
import type { DealTicketMarketFragment } from './__generated__/DealTicket';
|
import type { DealTicketMarketFragment } from './__generated___/DealTicket';
|
||||||
import { ExpirySelector } from './expiry-selector';
|
import { ExpirySelector } from './expiry-selector';
|
||||||
import type { OrderSubmissionBody } from '@vegaprotocol/wallet';
|
import type { OrderSubmissionBody } from '@vegaprotocol/wallet';
|
||||||
import { OrderTimeInForce, OrderType } from '@vegaprotocol/types';
|
import { OrderTimeInForce, OrderType } from '@vegaprotocol/types';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
export * from './__generated__/DealTicket';
|
export * from './__generated___/DealTicket';
|
||||||
export * from './deal-ticket-amount';
|
export * from './deal-ticket-amount';
|
||||||
export * from './deal-ticket-container';
|
export * from './deal-ticket-container';
|
||||||
export * from './deal-ticket-limit-amount';
|
export * from './deal-ticket-limit-amount';
|
||||||
|
@ -8,7 +8,7 @@ import Link from 'next/link';
|
|||||||
import { MarketTradingMode, AuctionTrigger } from '@vegaprotocol/types';
|
import { MarketTradingMode, AuctionTrigger } from '@vegaprotocol/types';
|
||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
import type { MarketDataGridProps } from './market-data-grid';
|
import type { MarketDataGridProps } from './market-data-grid';
|
||||||
import type { DealTicketMarketFragment } from '../deal-ticket/__generated__/DealTicket';
|
import type { DealTicketMarketFragment } from '../deal-ticket/__generated___/DealTicket';
|
||||||
|
|
||||||
export const compileGridData = (
|
export const compileGridData = (
|
||||||
market: DealTicketMarketFragment,
|
market: DealTicketMarketFragment,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
export * from './lib/fills-container';
|
export * from './lib/fills-container';
|
||||||
export * from './lib/use-fills-list';
|
export * from './lib/use-fills-list';
|
||||||
export * from './lib/fills-data-provider';
|
export * from './lib/fills-data-provider';
|
||||||
export * from './lib/__generated__/Fills';
|
export * from './lib/__generated___/Fills';
|
||||||
|
161
libs/fills/src/lib/__generated__/Fills.ts
generated
161
libs/fills/src/lib/__generated__/Fills.ts
generated
@ -1,161 +0,0 @@
|
|||||||
import { Schema as Types } from '@vegaprotocol/types';
|
|
||||||
|
|
||||||
import { gql } from '@apollo/client';
|
|
||||||
import * as Apollo from '@apollo/client';
|
|
||||||
const defaultOptions = {} as const;
|
|
||||||
export type FillFieldsFragment = { __typename?: 'Trade', id: string, createdAt: string, price: string, size: string, buyOrder: string, sellOrder: string, aggressor: Types.Side, market: { __typename?: 'Market', id: string }, buyer: { __typename?: 'Party', id: string }, seller: { __typename?: 'Party', id: string }, buyerFee: { __typename?: 'TradeFee', makerFee: string, infrastructureFee: string, liquidityFee: string }, sellerFee: { __typename?: 'TradeFee', makerFee: string, infrastructureFee: string, liquidityFee: string } };
|
|
||||||
|
|
||||||
export type FillEdgeFragment = { __typename?: 'TradeEdge', cursor: string, node: { __typename?: 'Trade', id: string, createdAt: string, price: string, size: string, buyOrder: string, sellOrder: string, aggressor: Types.Side, market: { __typename?: 'Market', id: string }, buyer: { __typename?: 'Party', id: string }, seller: { __typename?: 'Party', id: string }, buyerFee: { __typename?: 'TradeFee', makerFee: string, infrastructureFee: string, liquidityFee: string }, sellerFee: { __typename?: 'TradeFee', makerFee: string, infrastructureFee: string, liquidityFee: string } } };
|
|
||||||
|
|
||||||
export type FillsQueryVariables = Types.Exact<{
|
|
||||||
partyId: Types.Scalars['ID'];
|
|
||||||
marketId?: Types.InputMaybe<Types.Scalars['ID']>;
|
|
||||||
pagination?: Types.InputMaybe<Types.Pagination>;
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
export type FillsQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, tradesConnection?: { __typename?: 'TradeConnection', edges: Array<{ __typename?: 'TradeEdge', cursor: string, node: { __typename?: 'Trade', id: string, createdAt: string, price: string, size: string, buyOrder: string, sellOrder: string, aggressor: Types.Side, market: { __typename?: 'Market', id: string }, buyer: { __typename?: 'Party', id: string }, seller: { __typename?: 'Party', id: string }, buyerFee: { __typename?: 'TradeFee', makerFee: string, infrastructureFee: string, liquidityFee: string }, sellerFee: { __typename?: 'TradeFee', makerFee: string, infrastructureFee: string, liquidityFee: string } } }>, pageInfo: { __typename?: 'PageInfo', startCursor: string, endCursor: string, hasNextPage: boolean, hasPreviousPage: boolean } } | null } | null };
|
|
||||||
|
|
||||||
export type FillsEventSubscriptionVariables = Types.Exact<{
|
|
||||||
partyId: Types.Scalars['ID'];
|
|
||||||
}>;
|
|
||||||
|
|
||||||
|
|
||||||
export type FillsEventSubscription = { __typename?: 'Subscription', trades?: Array<{ __typename?: 'TradeUpdate', id: string, marketId: string, buyOrder: string, sellOrder: string, buyerId: string, sellerId: string, aggressor: Types.Side, price: string, size: string, createdAt: string, type: Types.TradeType, buyerFee: { __typename?: 'TradeFee', makerFee: string, infrastructureFee: string, liquidityFee: string }, sellerFee: { __typename?: 'TradeFee', makerFee: string, infrastructureFee: string, liquidityFee: string } }> | null };
|
|
||||||
|
|
||||||
export const FillFieldsFragmentDoc = gql`
|
|
||||||
fragment FillFields on Trade {
|
|
||||||
id
|
|
||||||
market {
|
|
||||||
id
|
|
||||||
}
|
|
||||||
createdAt
|
|
||||||
price
|
|
||||||
size
|
|
||||||
buyOrder
|
|
||||||
sellOrder
|
|
||||||
aggressor
|
|
||||||
buyer {
|
|
||||||
id
|
|
||||||
}
|
|
||||||
seller {
|
|
||||||
id
|
|
||||||
}
|
|
||||||
buyerFee {
|
|
||||||
makerFee
|
|
||||||
infrastructureFee
|
|
||||||
liquidityFee
|
|
||||||
}
|
|
||||||
sellerFee {
|
|
||||||
makerFee
|
|
||||||
infrastructureFee
|
|
||||||
liquidityFee
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
export const FillEdgeFragmentDoc = gql`
|
|
||||||
fragment FillEdge on TradeEdge {
|
|
||||||
node {
|
|
||||||
...FillFields
|
|
||||||
}
|
|
||||||
cursor
|
|
||||||
}
|
|
||||||
${FillFieldsFragmentDoc}`;
|
|
||||||
export const FillsDocument = gql`
|
|
||||||
query Fills($partyId: ID!, $marketId: ID, $pagination: Pagination) {
|
|
||||||
party(id: $partyId) {
|
|
||||||
id
|
|
||||||
tradesConnection(marketId: $marketId, pagination: $pagination) {
|
|
||||||
edges {
|
|
||||||
...FillEdge
|
|
||||||
}
|
|
||||||
pageInfo {
|
|
||||||
startCursor
|
|
||||||
endCursor
|
|
||||||
hasNextPage
|
|
||||||
hasPreviousPage
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
${FillEdgeFragmentDoc}`;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* __useFillsQuery__
|
|
||||||
*
|
|
||||||
* To run a query within a React component, call `useFillsQuery` and pass it any options that fit your needs.
|
|
||||||
* When your component renders, `useFillsQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
||||||
* you can use to render your UI.
|
|
||||||
*
|
|
||||||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* const { data, loading, error } = useFillsQuery({
|
|
||||||
* variables: {
|
|
||||||
* partyId: // value for 'partyId'
|
|
||||||
* marketId: // value for 'marketId'
|
|
||||||
* pagination: // value for 'pagination'
|
|
||||||
* },
|
|
||||||
* });
|
|
||||||
*/
|
|
||||||
export function useFillsQuery(baseOptions: Apollo.QueryHookOptions<FillsQuery, FillsQueryVariables>) {
|
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
|
||||||
return Apollo.useQuery<FillsQuery, FillsQueryVariables>(FillsDocument, options);
|
|
||||||
}
|
|
||||||
export function useFillsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<FillsQuery, FillsQueryVariables>) {
|
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
|
||||||
return Apollo.useLazyQuery<FillsQuery, FillsQueryVariables>(FillsDocument, options);
|
|
||||||
}
|
|
||||||
export type FillsQueryHookResult = ReturnType<typeof useFillsQuery>;
|
|
||||||
export type FillsLazyQueryHookResult = ReturnType<typeof useFillsLazyQuery>;
|
|
||||||
export type FillsQueryResult = Apollo.QueryResult<FillsQuery, FillsQueryVariables>;
|
|
||||||
export const FillsEventDocument = gql`
|
|
||||||
subscription FillsEvent($partyId: ID!) {
|
|
||||||
trades(partyId: $partyId) {
|
|
||||||
id
|
|
||||||
marketId
|
|
||||||
buyOrder
|
|
||||||
sellOrder
|
|
||||||
buyerId
|
|
||||||
sellerId
|
|
||||||
aggressor
|
|
||||||
price
|
|
||||||
size
|
|
||||||
createdAt
|
|
||||||
type
|
|
||||||
buyerFee {
|
|
||||||
makerFee
|
|
||||||
infrastructureFee
|
|
||||||
liquidityFee
|
|
||||||
}
|
|
||||||
sellerFee {
|
|
||||||
makerFee
|
|
||||||
infrastructureFee
|
|
||||||
liquidityFee
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* __useFillsEventSubscription__
|
|
||||||
*
|
|
||||||
* To run a query within a React component, call `useFillsEventSubscription` and pass it any options that fit your needs.
|
|
||||||
* When your component renders, `useFillsEventSubscription` returns an object from Apollo Client that contains loading, error, and data properties
|
|
||||||
* you can use to render your UI.
|
|
||||||
*
|
|
||||||
* @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* const { data, loading, error } = useFillsEventSubscription({
|
|
||||||
* variables: {
|
|
||||||
* partyId: // value for 'partyId'
|
|
||||||
* },
|
|
||||||
* });
|
|
||||||
*/
|
|
||||||
export function useFillsEventSubscription(baseOptions: Apollo.SubscriptionHookOptions<FillsEventSubscription, FillsEventSubscriptionVariables>) {
|
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
|
||||||
return Apollo.useSubscription<FillsEventSubscription, FillsEventSubscriptionVariables>(FillsEventDocument, options);
|
|
||||||
}
|
|
||||||
export type FillsEventSubscriptionHookResult = ReturnType<typeof useFillsEventSubscription>;
|
|
||||||
export type FillsEventSubscriptionResult = Apollo.SubscriptionResult<FillsEventSubscription>;
|
|
@ -8,13 +8,13 @@ import {
|
|||||||
import type { Market } from '@vegaprotocol/market-list';
|
import type { Market } from '@vegaprotocol/market-list';
|
||||||
import { marketsProvider } from '@vegaprotocol/market-list';
|
import { marketsProvider } from '@vegaprotocol/market-list';
|
||||||
import type { PageInfo } from '@vegaprotocol/react-helpers';
|
import type { PageInfo } from '@vegaprotocol/react-helpers';
|
||||||
import { FillsDocument, FillsEventDocument } from './__generated__/Fills';
|
import { FillsDocument, FillsEventDocument } from './__generated___/Fills';
|
||||||
import type {
|
import type {
|
||||||
FillsQuery,
|
FillsQuery,
|
||||||
FillFieldsFragment,
|
FillFieldsFragment,
|
||||||
FillEdgeFragment,
|
FillEdgeFragment,
|
||||||
FillsEventSubscription,
|
FillsEventSubscription,
|
||||||
} from './__generated__/Fills';
|
} from './__generated___/Fills';
|
||||||
|
|
||||||
const update = (
|
const update = (
|
||||||
data: FillEdgeFragment[] | null,
|
data: FillEdgeFragment[] | null,
|
||||||
|
@ -1 +1 @@
|
|||||||
GRAPHQL_SCHEMA_PATH=https://api.n04.d.vega.xyz/graphql
|
GRAPHQL_SCHEMA_PATH=https://api.n11.testnet.vega.xyz/graphql
|
||||||
|
2
libs/types/src/__generated__/types.ts
generated
2
libs/types/src/__generated__/types.ts
generated
@ -3625,7 +3625,7 @@ export type QuerypartiesConnectionArgs = {
|
|||||||
|
|
||||||
/** Queries allow a caller to read data and filter data via GraphQL. */
|
/** Queries allow a caller to read data and filter data via GraphQL. */
|
||||||
export type QuerypartyArgs = {
|
export type QuerypartyArgs = {
|
||||||
id?: InputMaybe<Scalars['ID']>;
|
id: Scalars['ID'];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user