Fix/1083: Update type generator (#1219)
* feat: add new generator with config * feat: split off gql queries to separate files for the new generator * fix: delete dummy schema * feat: add generated queries with new codegen * fix: regenerate from scratch and remove duplicates * fix: libs and app gen folders * fix: remove more duplicate queries * fix: add generated files to be ignored by the formatter * fix: format * fix: generated imports * fix: lint * fix: accounts export * fix: more imports * fix: add type alias for new type system and regenerate * fix: format * fix: delete leftover file from merge
This commit is contained in:
parent
b531094fda
commit
a57d484496
@ -3,6 +3,7 @@
|
|||||||
/dist
|
/dist
|
||||||
/coverage
|
/coverage
|
||||||
__generated__
|
__generated__
|
||||||
|
__generated___
|
||||||
|
|
||||||
apps/static/src/assets/devnet-tranches.json
|
apps/static/src/assets/devnet-tranches.json
|
||||||
apps/static/src/assets/mainnet-tranches.json
|
apps/static/src/assets/mainnet-tranches.json
|
||||||
|
@ -69,7 +69,7 @@ Run `nx serve my-app` for a dev server. Navigate to the port specified in `app/<
|
|||||||
|
|
||||||
### Using Apollo GraphQL and Generate Types
|
### Using Apollo GraphQL and Generate Types
|
||||||
|
|
||||||
In order to generate the schemas for your GraphQL queries, you can run `NX_VEGA_URL=[YOUR URL HERE] nx run types:generate`.
|
In order to generate the schemas for your GraphQL queries, you can run `GRAPHQL_SCHEMA_PATH=[YOUR SCHEMA FILE / API URL HERE] nx run types:generate`.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
export NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql
|
export NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
||||||
"ignorePatterns": ["!**/*", "__generated__"],
|
"ignorePatterns": ["!**/*", "__generated__", "__generated___"],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
query MarketTags($marketId: ID!) {
|
||||||
|
market(id: $marketId) {
|
||||||
|
tradableInstrument {
|
||||||
|
instrument {
|
||||||
|
metadata {
|
||||||
|
tags
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
query PartyBalanceQuery($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
accounts {
|
||||||
|
type
|
||||||
|
balance
|
||||||
|
asset {
|
||||||
|
id
|
||||||
|
symbol
|
||||||
|
name
|
||||||
|
decimals
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type MarketTagsQueryVariables = Types.Exact<{
|
||||||
|
marketId: Types.Scalars['ID'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type MarketTagsQuery = { __typename?: 'Query', market?: { __typename?: 'Market', tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', metadata: { __typename?: 'InstrumentMetadata', tags?: Array<string> | null } } } } | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const MarketTagsDocument = gql`
|
||||||
|
query MarketTags($marketId: ID!) {
|
||||||
|
market(id: $marketId) {
|
||||||
|
tradableInstrument {
|
||||||
|
instrument {
|
||||||
|
metadata {
|
||||||
|
tags
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useMarketTagsQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useMarketTagsQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useMarketTagsQuery` 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 } = useMarketTagsQuery({
|
||||||
|
* variables: {
|
||||||
|
* marketId: // value for 'marketId'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useMarketTagsQuery(baseOptions: Apollo.QueryHookOptions<MarketTagsQuery, MarketTagsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<MarketTagsQuery, MarketTagsQueryVariables>(MarketTagsDocument, options);
|
||||||
|
}
|
||||||
|
export function useMarketTagsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<MarketTagsQuery, MarketTagsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<MarketTagsQuery, MarketTagsQueryVariables>(MarketTagsDocument, options);
|
||||||
|
}
|
||||||
|
export type MarketTagsQueryHookResult = ReturnType<typeof useMarketTagsQuery>;
|
||||||
|
export type MarketTagsLazyQueryHookResult = ReturnType<typeof useMarketTagsLazyQuery>;
|
||||||
|
export type MarketTagsQueryResult = Apollo.QueryResult<MarketTagsQuery, MarketTagsQueryVariables>;
|
@ -0,0 +1,57 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type PartyBalanceQueryQueryVariables = Types.Exact<{
|
||||||
|
partyId: Types.Scalars['ID'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type PartyBalanceQueryQuery = { __typename?: 'Query', party?: { __typename?: 'Party', accounts?: Array<{ __typename?: 'Account', type: Types.AccountType, balance: string, asset: { __typename?: 'Asset', id: string, symbol: string, name: string, decimals: number } }> | null } | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const PartyBalanceQueryDocument = gql`
|
||||||
|
query PartyBalanceQuery($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
accounts {
|
||||||
|
type
|
||||||
|
balance
|
||||||
|
asset {
|
||||||
|
id
|
||||||
|
symbol
|
||||||
|
name
|
||||||
|
decimals
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __usePartyBalanceQueryQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `usePartyBalanceQueryQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `usePartyBalanceQueryQuery` 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 } = usePartyBalanceQueryQuery({
|
||||||
|
* variables: {
|
||||||
|
* partyId: // value for 'partyId'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function usePartyBalanceQueryQuery(baseOptions: Apollo.QueryHookOptions<PartyBalanceQueryQuery, PartyBalanceQueryQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<PartyBalanceQueryQuery, PartyBalanceQueryQueryVariables>(PartyBalanceQueryDocument, options);
|
||||||
|
}
|
||||||
|
export function usePartyBalanceQueryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<PartyBalanceQueryQuery, PartyBalanceQueryQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<PartyBalanceQueryQuery, PartyBalanceQueryQueryVariables>(PartyBalanceQueryDocument, options);
|
||||||
|
}
|
||||||
|
export type PartyBalanceQueryQueryHookResult = ReturnType<typeof usePartyBalanceQueryQuery>;
|
||||||
|
export type PartyBalanceQueryLazyQueryHookResult = ReturnType<typeof usePartyBalanceQueryLazyQuery>;
|
||||||
|
export type PartyBalanceQueryQueryResult = Apollo.QueryResult<PartyBalanceQueryQuery, PartyBalanceQueryQueryVariables>;
|
@ -0,0 +1,17 @@
|
|||||||
|
query Deposits {
|
||||||
|
assetsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
symbol
|
||||||
|
decimals
|
||||||
|
source {
|
||||||
|
... on ERC20 {
|
||||||
|
contractAddress
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type DepositsQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type DepositsQuery = { __typename?: 'Query', assetsConnection: { __typename?: 'AssetsConnection', edges?: Array<{ __typename?: 'AssetEdge', node: { __typename?: 'Asset', id: string, name: string, symbol: string, decimals: number, source: { __typename?: 'BuiltinAsset' } | { __typename?: 'ERC20', contractAddress: string } } } | null> | null } };
|
||||||
|
|
||||||
|
|
||||||
|
export const DepositsDocument = gql`
|
||||||
|
query Deposits {
|
||||||
|
assetsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
symbol
|
||||||
|
decimals
|
||||||
|
source {
|
||||||
|
... on ERC20 {
|
||||||
|
contractAddress
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useDepositsQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useDepositsQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useDepositsQuery` 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 } = useDepositsQuery({
|
||||||
|
* variables: {
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useDepositsQuery(baseOptions?: Apollo.QueryHookOptions<DepositsQuery, DepositsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<DepositsQuery, DepositsQueryVariables>(DepositsDocument, options);
|
||||||
|
}
|
||||||
|
export function useDepositsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<DepositsQuery, DepositsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<DepositsQuery, DepositsQueryVariables>(DepositsDocument, options);
|
||||||
|
}
|
||||||
|
export type DepositsQueryHookResult = ReturnType<typeof useDepositsQuery>;
|
||||||
|
export type DepositsLazyQueryHookResult = ReturnType<typeof useDepositsLazyQuery>;
|
||||||
|
export type DepositsQueryResult = Apollo.QueryResult<DepositsQuery, DepositsQueryVariables>;
|
@ -0,0 +1,5 @@
|
|||||||
|
subscription CandleLive($marketId: ID!) {
|
||||||
|
candles(marketId: $marketId, interval: INTERVAL_I1H) {
|
||||||
|
close
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
fragment SimpleMarketDataFields on MarketData {
|
||||||
|
market {
|
||||||
|
id
|
||||||
|
state
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query SimpleMarkets($CandleSince: String!) {
|
||||||
|
markets {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
state
|
||||||
|
data {
|
||||||
|
...SimpleMarketDataFields
|
||||||
|
}
|
||||||
|
tradableInstrument {
|
||||||
|
instrument {
|
||||||
|
code
|
||||||
|
metadata {
|
||||||
|
tags
|
||||||
|
}
|
||||||
|
product {
|
||||||
|
__typename
|
||||||
|
... on Future {
|
||||||
|
quoteName
|
||||||
|
settlementAsset {
|
||||||
|
symbol
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
candles(interval: INTERVAL_I1H, since: $CandleSince) {
|
||||||
|
open
|
||||||
|
close
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
subscription SimpleMarketDataSub {
|
||||||
|
marketData {
|
||||||
|
...SimpleMarketDataFields
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type CandleLiveSubscriptionVariables = Types.Exact<{
|
||||||
|
marketId: Types.Scalars['ID'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type CandleLiveSubscription = { __typename?: 'Subscription', candles: { __typename?: 'Candle', close: string } };
|
||||||
|
|
||||||
|
|
||||||
|
export const CandleLiveDocument = gql`
|
||||||
|
subscription CandleLive($marketId: ID!) {
|
||||||
|
candles(marketId: $marketId, interval: INTERVAL_I1H) {
|
||||||
|
close
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useCandleLiveSubscription__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useCandleLiveSubscription` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useCandleLiveSubscription` 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 } = useCandleLiveSubscription({
|
||||||
|
* variables: {
|
||||||
|
* marketId: // value for 'marketId'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useCandleLiveSubscription(baseOptions: Apollo.SubscriptionHookOptions<CandleLiveSubscription, CandleLiveSubscriptionVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useSubscription<CandleLiveSubscription, CandleLiveSubscriptionVariables>(CandleLiveDocument, options);
|
||||||
|
}
|
||||||
|
export type CandleLiveSubscriptionHookResult = ReturnType<typeof useCandleLiveSubscription>;
|
||||||
|
export type CandleLiveSubscriptionResult = Apollo.SubscriptionResult<CandleLiveSubscription>;
|
@ -0,0 +1,117 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type SimpleMarketDataFieldsFragment = { __typename?: 'MarketData', market: { __typename?: 'Market', id: string, state: Types.MarketState } };
|
||||||
|
|
||||||
|
export type SimpleMarketsQueryVariables = Types.Exact<{
|
||||||
|
CandleSince: Types.Scalars['String'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type SimpleMarketsQuery = { __typename?: 'Query', markets?: Array<{ __typename?: 'Market', id: string, name: string, state: Types.MarketState, data?: { __typename?: 'MarketData', market: { __typename?: 'Market', id: string, state: Types.MarketState } } | null, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', code: string, metadata: { __typename?: 'InstrumentMetadata', tags?: Array<string> | null }, product: { __typename: 'Future', quoteName: string, settlementAsset: { __typename?: 'Asset', symbol: string } } } }, candles?: Array<{ __typename?: 'Candle', open: string, close: string } | null> | null }> | null };
|
||||||
|
|
||||||
|
export type SimpleMarketDataSubSubscriptionVariables = Types.Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type SimpleMarketDataSubSubscription = { __typename?: 'Subscription', marketData: { __typename?: 'MarketData', market: { __typename?: 'Market', id: string, state: Types.MarketState } } };
|
||||||
|
|
||||||
|
export const SimpleMarketDataFieldsFragmentDoc = gql`
|
||||||
|
fragment SimpleMarketDataFields on MarketData {
|
||||||
|
market {
|
||||||
|
id
|
||||||
|
state
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
export const SimpleMarketsDocument = gql`
|
||||||
|
query SimpleMarkets($CandleSince: String!) {
|
||||||
|
markets {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
state
|
||||||
|
data {
|
||||||
|
...SimpleMarketDataFields
|
||||||
|
}
|
||||||
|
tradableInstrument {
|
||||||
|
instrument {
|
||||||
|
code
|
||||||
|
metadata {
|
||||||
|
tags
|
||||||
|
}
|
||||||
|
product {
|
||||||
|
__typename
|
||||||
|
... on Future {
|
||||||
|
quoteName
|
||||||
|
settlementAsset {
|
||||||
|
symbol
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
candles(interval: INTERVAL_I1H, since: $CandleSince) {
|
||||||
|
open
|
||||||
|
close
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
${SimpleMarketDataFieldsFragmentDoc}`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useSimpleMarketsQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useSimpleMarketsQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useSimpleMarketsQuery` 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 } = useSimpleMarketsQuery({
|
||||||
|
* variables: {
|
||||||
|
* CandleSince: // value for 'CandleSince'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useSimpleMarketsQuery(baseOptions: Apollo.QueryHookOptions<SimpleMarketsQuery, SimpleMarketsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<SimpleMarketsQuery, SimpleMarketsQueryVariables>(SimpleMarketsDocument, options);
|
||||||
|
}
|
||||||
|
export function useSimpleMarketsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<SimpleMarketsQuery, SimpleMarketsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<SimpleMarketsQuery, SimpleMarketsQueryVariables>(SimpleMarketsDocument, options);
|
||||||
|
}
|
||||||
|
export type SimpleMarketsQueryHookResult = ReturnType<typeof useSimpleMarketsQuery>;
|
||||||
|
export type SimpleMarketsLazyQueryHookResult = ReturnType<typeof useSimpleMarketsLazyQuery>;
|
||||||
|
export type SimpleMarketsQueryResult = Apollo.QueryResult<SimpleMarketsQuery, SimpleMarketsQueryVariables>;
|
||||||
|
export const SimpleMarketDataSubDocument = gql`
|
||||||
|
subscription SimpleMarketDataSub {
|
||||||
|
marketData {
|
||||||
|
...SimpleMarketDataFields
|
||||||
|
}
|
||||||
|
}
|
||||||
|
${SimpleMarketDataFieldsFragmentDoc}`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useSimpleMarketDataSubSubscription__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useSimpleMarketDataSubSubscription` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useSimpleMarketDataSubSubscription` 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 } = useSimpleMarketDataSubSubscription({
|
||||||
|
* variables: {
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useSimpleMarketDataSubSubscription(baseOptions?: Apollo.SubscriptionHookOptions<SimpleMarketDataSubSubscription, SimpleMarketDataSubSubscriptionVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useSubscription<SimpleMarketDataSubSubscription, SimpleMarketDataSubSubscriptionVariables>(SimpleMarketDataSubDocument, options);
|
||||||
|
}
|
||||||
|
export type SimpleMarketDataSubSubscriptionHookResult = ReturnType<typeof useSimpleMarketDataSubSubscription>;
|
||||||
|
export type SimpleMarketDataSubSubscriptionResult = Apollo.SubscriptionResult<SimpleMarketDataSubSubscription>;
|
30
apps/console-lite/src/app/hooks/EstimateOrder.graphql
Normal file
30
apps/console-lite/src/app/hooks/EstimateOrder.graphql
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
query EstimateOrder(
|
||||||
|
$marketId: ID!
|
||||||
|
$partyId: ID!
|
||||||
|
$price: String
|
||||||
|
$size: String!
|
||||||
|
$side: Side!
|
||||||
|
$timeInForce: OrderTimeInForce!
|
||||||
|
$expiration: String
|
||||||
|
$type: OrderType!
|
||||||
|
) {
|
||||||
|
estimateOrder(
|
||||||
|
marketId: $marketId
|
||||||
|
partyId: $partyId
|
||||||
|
price: $price
|
||||||
|
size: $size
|
||||||
|
side: $side
|
||||||
|
timeInForce: $timeInForce
|
||||||
|
expiration: $expiration
|
||||||
|
type: $type
|
||||||
|
) {
|
||||||
|
fee {
|
||||||
|
makerFee
|
||||||
|
infrastructureFee
|
||||||
|
liquidityFee
|
||||||
|
}
|
||||||
|
marginLevels {
|
||||||
|
initialLevel
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
8
apps/console-lite/src/app/hooks/MarketMarkPrice.graphql
Normal file
8
apps/console-lite/src/app/hooks/MarketMarkPrice.graphql
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
query MarketMarkPrice($marketId: ID!) {
|
||||||
|
market(id: $marketId) {
|
||||||
|
decimalPlaces
|
||||||
|
data {
|
||||||
|
markPrice
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
25
apps/console-lite/src/app/hooks/MarketPositions.graphql
Normal file
25
apps/console-lite/src/app/hooks/MarketPositions.graphql
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
query MarketPositions($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
accounts {
|
||||||
|
type
|
||||||
|
balance
|
||||||
|
asset {
|
||||||
|
decimals
|
||||||
|
}
|
||||||
|
market {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
positionsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
openVolume
|
||||||
|
market {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
28
apps/console-lite/src/app/hooks/PartyMarketData.graphql
Normal file
28
apps/console-lite/src/app/hooks/PartyMarketData.graphql
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
query PartyMarketData($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
accounts {
|
||||||
|
type
|
||||||
|
balance
|
||||||
|
asset {
|
||||||
|
id
|
||||||
|
decimals
|
||||||
|
}
|
||||||
|
market {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
marginsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
market {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
initialLevel
|
||||||
|
maintenanceLevel
|
||||||
|
searchLevel
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,78 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type EstimateOrderQueryVariables = Types.Exact<{
|
||||||
|
marketId: Types.Scalars['ID'];
|
||||||
|
partyId: Types.Scalars['ID'];
|
||||||
|
price?: Types.InputMaybe<Types.Scalars['String']>;
|
||||||
|
size: Types.Scalars['String'];
|
||||||
|
side: Types.Side;
|
||||||
|
timeInForce: Types.OrderTimeInForce;
|
||||||
|
expiration?: Types.InputMaybe<Types.Scalars['String']>;
|
||||||
|
type: Types.OrderType;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type EstimateOrderQuery = { __typename?: 'Query', estimateOrder: { __typename?: 'OrderEstimate', fee: { __typename?: 'TradeFee', makerFee: string, infrastructureFee: string, liquidityFee: string }, marginLevels: { __typename?: 'MarginLevels', initialLevel: string } } };
|
||||||
|
|
||||||
|
|
||||||
|
export const EstimateOrderDocument = gql`
|
||||||
|
query EstimateOrder($marketId: ID!, $partyId: ID!, $price: String, $size: String!, $side: Side!, $timeInForce: OrderTimeInForce!, $expiration: String, $type: OrderType!) {
|
||||||
|
estimateOrder(
|
||||||
|
marketId: $marketId
|
||||||
|
partyId: $partyId
|
||||||
|
price: $price
|
||||||
|
size: $size
|
||||||
|
side: $side
|
||||||
|
timeInForce: $timeInForce
|
||||||
|
expiration: $expiration
|
||||||
|
type: $type
|
||||||
|
) {
|
||||||
|
fee {
|
||||||
|
makerFee
|
||||||
|
infrastructureFee
|
||||||
|
liquidityFee
|
||||||
|
}
|
||||||
|
marginLevels {
|
||||||
|
initialLevel
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useEstimateOrderQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useEstimateOrderQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useEstimateOrderQuery` 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 } = useEstimateOrderQuery({
|
||||||
|
* variables: {
|
||||||
|
* marketId: // value for 'marketId'
|
||||||
|
* partyId: // value for 'partyId'
|
||||||
|
* price: // value for 'price'
|
||||||
|
* size: // value for 'size'
|
||||||
|
* side: // value for 'side'
|
||||||
|
* timeInForce: // value for 'timeInForce'
|
||||||
|
* expiration: // value for 'expiration'
|
||||||
|
* type: // value for 'type'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useEstimateOrderQuery(baseOptions: Apollo.QueryHookOptions<EstimateOrderQuery, EstimateOrderQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<EstimateOrderQuery, EstimateOrderQueryVariables>(EstimateOrderDocument, options);
|
||||||
|
}
|
||||||
|
export function useEstimateOrderLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<EstimateOrderQuery, EstimateOrderQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<EstimateOrderQuery, EstimateOrderQueryVariables>(EstimateOrderDocument, options);
|
||||||
|
}
|
||||||
|
export type EstimateOrderQueryHookResult = ReturnType<typeof useEstimateOrderQuery>;
|
||||||
|
export type EstimateOrderLazyQueryHookResult = ReturnType<typeof useEstimateOrderLazyQuery>;
|
||||||
|
export type EstimateOrderQueryResult = Apollo.QueryResult<EstimateOrderQuery, EstimateOrderQueryVariables>;
|
@ -0,0 +1,51 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type MarketMarkPriceQueryVariables = Types.Exact<{
|
||||||
|
marketId: Types.Scalars['ID'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type MarketMarkPriceQuery = { __typename?: 'Query', market?: { __typename?: 'Market', decimalPlaces: number, data?: { __typename?: 'MarketData', markPrice: string } | null } | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const MarketMarkPriceDocument = gql`
|
||||||
|
query MarketMarkPrice($marketId: ID!) {
|
||||||
|
market(id: $marketId) {
|
||||||
|
decimalPlaces
|
||||||
|
data {
|
||||||
|
markPrice
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useMarketMarkPriceQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useMarketMarkPriceQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useMarketMarkPriceQuery` 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 } = useMarketMarkPriceQuery({
|
||||||
|
* variables: {
|
||||||
|
* marketId: // value for 'marketId'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useMarketMarkPriceQuery(baseOptions: Apollo.QueryHookOptions<MarketMarkPriceQuery, MarketMarkPriceQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<MarketMarkPriceQuery, MarketMarkPriceQueryVariables>(MarketMarkPriceDocument, options);
|
||||||
|
}
|
||||||
|
export function useMarketMarkPriceLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<MarketMarkPriceQuery, MarketMarkPriceQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<MarketMarkPriceQuery, MarketMarkPriceQueryVariables>(MarketMarkPriceDocument, options);
|
||||||
|
}
|
||||||
|
export type MarketMarkPriceQueryHookResult = ReturnType<typeof useMarketMarkPriceQuery>;
|
||||||
|
export type MarketMarkPriceLazyQueryHookResult = ReturnType<typeof useMarketMarkPriceLazyQuery>;
|
||||||
|
export type MarketMarkPriceQueryResult = Apollo.QueryResult<MarketMarkPriceQuery, MarketMarkPriceQueryVariables>;
|
@ -0,0 +1,68 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type MarketPositionsQueryVariables = Types.Exact<{
|
||||||
|
partyId: Types.Scalars['ID'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type MarketPositionsQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, accounts?: Array<{ __typename?: 'Account', type: Types.AccountType, balance: string, asset: { __typename?: 'Asset', decimals: number }, market?: { __typename?: 'Market', id: string } | null }> | null, positionsConnection: { __typename?: 'PositionConnection', edges?: Array<{ __typename?: 'PositionEdge', node: { __typename?: 'Position', openVolume: string, market: { __typename?: 'Market', id: string } } }> | null } } | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const MarketPositionsDocument = gql`
|
||||||
|
query MarketPositions($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
accounts {
|
||||||
|
type
|
||||||
|
balance
|
||||||
|
asset {
|
||||||
|
decimals
|
||||||
|
}
|
||||||
|
market {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
positionsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
openVolume
|
||||||
|
market {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useMarketPositionsQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useMarketPositionsQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useMarketPositionsQuery` 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 } = useMarketPositionsQuery({
|
||||||
|
* variables: {
|
||||||
|
* partyId: // value for 'partyId'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useMarketPositionsQuery(baseOptions: Apollo.QueryHookOptions<MarketPositionsQuery, MarketPositionsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<MarketPositionsQuery, MarketPositionsQueryVariables>(MarketPositionsDocument, options);
|
||||||
|
}
|
||||||
|
export function useMarketPositionsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<MarketPositionsQuery, MarketPositionsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<MarketPositionsQuery, MarketPositionsQueryVariables>(MarketPositionsDocument, options);
|
||||||
|
}
|
||||||
|
export type MarketPositionsQueryHookResult = ReturnType<typeof useMarketPositionsQuery>;
|
||||||
|
export type MarketPositionsLazyQueryHookResult = ReturnType<typeof useMarketPositionsLazyQuery>;
|
||||||
|
export type MarketPositionsQueryResult = Apollo.QueryResult<MarketPositionsQuery, MarketPositionsQueryVariables>;
|
@ -0,0 +1,71 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type PartyMarketDataQueryVariables = Types.Exact<{
|
||||||
|
partyId: Types.Scalars['ID'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type PartyMarketDataQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, accounts?: Array<{ __typename?: 'Account', type: Types.AccountType, balance: string, asset: { __typename?: 'Asset', id: string, decimals: number }, market?: { __typename?: 'Market', id: string } | null }> | null, marginsConnection: { __typename?: 'MarginConnection', edges?: Array<{ __typename?: 'MarginEdge', node: { __typename?: 'MarginLevels', initialLevel: string, maintenanceLevel: string, searchLevel: string, market: { __typename?: 'Market', id: string } } }> | null } } | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const PartyMarketDataDocument = gql`
|
||||||
|
query PartyMarketData($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
accounts {
|
||||||
|
type
|
||||||
|
balance
|
||||||
|
asset {
|
||||||
|
id
|
||||||
|
decimals
|
||||||
|
}
|
||||||
|
market {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
marginsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
market {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
initialLevel
|
||||||
|
maintenanceLevel
|
||||||
|
searchLevel
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __usePartyMarketDataQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `usePartyMarketDataQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `usePartyMarketDataQuery` 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 } = usePartyMarketDataQuery({
|
||||||
|
* variables: {
|
||||||
|
* partyId: // value for 'partyId'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function usePartyMarketDataQuery(baseOptions: Apollo.QueryHookOptions<PartyMarketDataQuery, PartyMarketDataQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<PartyMarketDataQuery, PartyMarketDataQueryVariables>(PartyMarketDataDocument, options);
|
||||||
|
}
|
||||||
|
export function usePartyMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<PartyMarketDataQuery, PartyMarketDataQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<PartyMarketDataQuery, PartyMarketDataQueryVariables>(PartyMarketDataDocument, options);
|
||||||
|
}
|
||||||
|
export type PartyMarketDataQueryHookResult = ReturnType<typeof usePartyMarketDataQuery>;
|
||||||
|
export type PartyMarketDataLazyQueryHookResult = ReturnType<typeof usePartyMarketDataLazyQuery>;
|
||||||
|
export type PartyMarketDataQueryResult = Apollo.QueryResult<PartyMarketDataQuery, PartyMarketDataQueryVariables>;
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
||||||
"ignorePatterns": ["!**/*", "__generated__"],
|
"ignorePatterns": ["!**/*", "__generated__", "__generated___"],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||||
|
27
apps/explorer/src/app/routes/assets/Assets.graphql
Normal file
27
apps/explorer/src/app/routes/assets/Assets.graphql
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
query AssetsQuery {
|
||||||
|
assetsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
symbol
|
||||||
|
decimals
|
||||||
|
source {
|
||||||
|
... on ERC20 {
|
||||||
|
contractAddress
|
||||||
|
}
|
||||||
|
... on BuiltinAsset {
|
||||||
|
maxFaucetAmountMint
|
||||||
|
}
|
||||||
|
}
|
||||||
|
infrastructureFeeAccount {
|
||||||
|
type
|
||||||
|
balance
|
||||||
|
market {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
67
apps/explorer/src/app/routes/assets/__generated___/Assets.ts
Normal file
67
apps/explorer/src/app/routes/assets/__generated___/Assets.ts
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type AssetsQueryQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type AssetsQueryQuery = { __typename?: 'Query', assetsConnection: { __typename?: 'AssetsConnection', edges?: Array<{ __typename?: 'AssetEdge', node: { __typename?: 'Asset', id: string, name: string, symbol: string, decimals: number, source: { __typename?: 'BuiltinAsset', maxFaucetAmountMint: string } | { __typename?: 'ERC20', contractAddress: string }, infrastructureFeeAccount: { __typename?: 'Account', type: Types.AccountType, balance: string, market?: { __typename?: 'Market', id: string } | null } } } | null> | null } };
|
||||||
|
|
||||||
|
|
||||||
|
export const AssetsQueryDocument = gql`
|
||||||
|
query AssetsQuery {
|
||||||
|
assetsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
symbol
|
||||||
|
decimals
|
||||||
|
source {
|
||||||
|
... on ERC20 {
|
||||||
|
contractAddress
|
||||||
|
}
|
||||||
|
... on BuiltinAsset {
|
||||||
|
maxFaucetAmountMint
|
||||||
|
}
|
||||||
|
}
|
||||||
|
infrastructureFeeAccount {
|
||||||
|
type
|
||||||
|
balance
|
||||||
|
market {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useAssetsQueryQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useAssetsQueryQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useAssetsQueryQuery` 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 } = useAssetsQueryQuery({
|
||||||
|
* variables: {
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useAssetsQueryQuery(baseOptions?: Apollo.QueryHookOptions<AssetsQueryQuery, AssetsQueryQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<AssetsQueryQuery, AssetsQueryQueryVariables>(AssetsQueryDocument, options);
|
||||||
|
}
|
||||||
|
export function useAssetsQueryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<AssetsQueryQuery, AssetsQueryQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<AssetsQueryQuery, AssetsQueryQueryVariables>(AssetsQueryDocument, options);
|
||||||
|
}
|
||||||
|
export type AssetsQueryQueryHookResult = ReturnType<typeof useAssetsQueryQuery>;
|
||||||
|
export type AssetsQueryLazyQueryHookResult = ReturnType<typeof useAssetsQueryLazyQuery>;
|
||||||
|
export type AssetsQueryQueryResult = Apollo.QueryResult<AssetsQueryQuery, AssetsQueryQueryVariables>;
|
74
apps/explorer/src/app/routes/governance/Proposals.graphql
Normal file
74
apps/explorer/src/app/routes/governance/Proposals.graphql
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
query ProposalsQuery {
|
||||||
|
proposals {
|
||||||
|
id
|
||||||
|
reference
|
||||||
|
state
|
||||||
|
datetime
|
||||||
|
rejectionReason
|
||||||
|
party {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
terms {
|
||||||
|
closingDatetime
|
||||||
|
enactmentDatetime
|
||||||
|
change {
|
||||||
|
... on NewMarket {
|
||||||
|
instrument {
|
||||||
|
name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
... on UpdateMarket {
|
||||||
|
marketId
|
||||||
|
}
|
||||||
|
... on NewAsset {
|
||||||
|
__typename
|
||||||
|
symbol
|
||||||
|
source {
|
||||||
|
... on BuiltinAsset {
|
||||||
|
maxFaucetAmountMint
|
||||||
|
}
|
||||||
|
... on ERC20 {
|
||||||
|
contractAddress
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
... on UpdateNetworkParameter {
|
||||||
|
networkParameter {
|
||||||
|
key
|
||||||
|
value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
votes {
|
||||||
|
yes {
|
||||||
|
totalTokens
|
||||||
|
totalNumber
|
||||||
|
votes {
|
||||||
|
value
|
||||||
|
party {
|
||||||
|
id
|
||||||
|
stake {
|
||||||
|
currentStakeAvailable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
datetime
|
||||||
|
}
|
||||||
|
}
|
||||||
|
no {
|
||||||
|
totalTokens
|
||||||
|
totalNumber
|
||||||
|
votes {
|
||||||
|
value
|
||||||
|
party {
|
||||||
|
id
|
||||||
|
stake {
|
||||||
|
currentStakeAvailable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
datetime
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,114 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type ProposalsQueryQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type ProposalsQueryQuery = { __typename?: 'Query', proposals?: Array<{ __typename?: 'Proposal', id?: string | null, reference: string, state: Types.ProposalState, datetime: string, rejectionReason?: Types.ProposalRejectionReason | null, party: { __typename?: 'Party', id: string }, terms: { __typename?: 'ProposalTerms', closingDatetime: string, enactmentDatetime?: string | null, change: { __typename: 'NewAsset', symbol: string, source: { __typename?: 'BuiltinAsset', maxFaucetAmountMint: string } | { __typename?: 'ERC20', contractAddress: string } } | { __typename?: 'NewFreeform' } | { __typename?: 'NewMarket', instrument: { __typename?: 'InstrumentConfiguration', name: string } } | { __typename?: 'UpdateAsset' } | { __typename?: 'UpdateMarket', marketId: string } | { __typename?: 'UpdateNetworkParameter', networkParameter: { __typename?: 'NetworkParameter', key: string, value: string } } }, votes: { __typename?: 'ProposalVotes', yes: { __typename?: 'ProposalVoteSide', totalTokens: string, totalNumber: string, votes?: Array<{ __typename?: 'Vote', value: Types.VoteValue, datetime: string, party: { __typename?: 'Party', id: string, stake: { __typename?: 'PartyStake', currentStakeAvailable: string } } }> | null }, no: { __typename?: 'ProposalVoteSide', totalTokens: string, totalNumber: string, votes?: Array<{ __typename?: 'Vote', value: Types.VoteValue, datetime: string, party: { __typename?: 'Party', id: string, stake: { __typename?: 'PartyStake', currentStakeAvailable: string } } }> | null } } }> | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const ProposalsQueryDocument = gql`
|
||||||
|
query ProposalsQuery {
|
||||||
|
proposals {
|
||||||
|
id
|
||||||
|
reference
|
||||||
|
state
|
||||||
|
datetime
|
||||||
|
rejectionReason
|
||||||
|
party {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
terms {
|
||||||
|
closingDatetime
|
||||||
|
enactmentDatetime
|
||||||
|
change {
|
||||||
|
... on NewMarket {
|
||||||
|
instrument {
|
||||||
|
name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
... on UpdateMarket {
|
||||||
|
marketId
|
||||||
|
}
|
||||||
|
... on NewAsset {
|
||||||
|
__typename
|
||||||
|
symbol
|
||||||
|
source {
|
||||||
|
... on BuiltinAsset {
|
||||||
|
maxFaucetAmountMint
|
||||||
|
}
|
||||||
|
... on ERC20 {
|
||||||
|
contractAddress
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
... on UpdateNetworkParameter {
|
||||||
|
networkParameter {
|
||||||
|
key
|
||||||
|
value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
votes {
|
||||||
|
yes {
|
||||||
|
totalTokens
|
||||||
|
totalNumber
|
||||||
|
votes {
|
||||||
|
value
|
||||||
|
party {
|
||||||
|
id
|
||||||
|
stake {
|
||||||
|
currentStakeAvailable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
datetime
|
||||||
|
}
|
||||||
|
}
|
||||||
|
no {
|
||||||
|
totalTokens
|
||||||
|
totalNumber
|
||||||
|
votes {
|
||||||
|
value
|
||||||
|
party {
|
||||||
|
id
|
||||||
|
stake {
|
||||||
|
currentStakeAvailable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
datetime
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useProposalsQueryQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useProposalsQueryQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useProposalsQueryQuery` 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 } = useProposalsQueryQuery({
|
||||||
|
* variables: {
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useProposalsQueryQuery(baseOptions?: Apollo.QueryHookOptions<ProposalsQueryQuery, ProposalsQueryQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<ProposalsQueryQuery, ProposalsQueryQueryVariables>(ProposalsQueryDocument, options);
|
||||||
|
}
|
||||||
|
export function useProposalsQueryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<ProposalsQueryQuery, ProposalsQueryQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<ProposalsQueryQuery, ProposalsQueryQueryVariables>(ProposalsQueryDocument, options);
|
||||||
|
}
|
||||||
|
export type ProposalsQueryQueryHookResult = ReturnType<typeof useProposalsQueryQuery>;
|
||||||
|
export type ProposalsQueryLazyQueryHookResult = ReturnType<typeof useProposalsQueryLazyQuery>;
|
||||||
|
export type ProposalsQueryQueryResult = Apollo.QueryResult<ProposalsQueryQuery, ProposalsQueryQueryVariables>;
|
134
apps/explorer/src/app/routes/markets/Markets.graphql
Normal file
134
apps/explorer/src/app/routes/markets/Markets.graphql
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
query MarketsQuery {
|
||||||
|
markets {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
fees {
|
||||||
|
factors {
|
||||||
|
makerFee
|
||||||
|
infrastructureFee
|
||||||
|
liquidityFee
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tradableInstrument {
|
||||||
|
instrument {
|
||||||
|
name
|
||||||
|
metadata {
|
||||||
|
tags
|
||||||
|
}
|
||||||
|
id
|
||||||
|
code
|
||||||
|
product {
|
||||||
|
... on Future {
|
||||||
|
settlementAsset {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
decimals
|
||||||
|
globalRewardPoolAccount {
|
||||||
|
balance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
riskModel {
|
||||||
|
... on LogNormalRiskModel {
|
||||||
|
tau
|
||||||
|
riskAversionParameter
|
||||||
|
params {
|
||||||
|
r
|
||||||
|
sigma
|
||||||
|
mu
|
||||||
|
}
|
||||||
|
}
|
||||||
|
... on SimpleRiskModel {
|
||||||
|
params {
|
||||||
|
factorLong
|
||||||
|
factorShort
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
marginCalculator {
|
||||||
|
scalingFactors {
|
||||||
|
searchLevel
|
||||||
|
initialMargin
|
||||||
|
collateralRelease
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
decimalPlaces
|
||||||
|
openingAuction {
|
||||||
|
durationSecs
|
||||||
|
volume
|
||||||
|
}
|
||||||
|
priceMonitoringSettings {
|
||||||
|
parameters {
|
||||||
|
triggers {
|
||||||
|
horizonSecs
|
||||||
|
probability
|
||||||
|
auctionExtensionSecs
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
liquidityMonitoringParameters {
|
||||||
|
triggeringRatio
|
||||||
|
targetStakeParameters {
|
||||||
|
timeWindow
|
||||||
|
scalingFactor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tradingMode
|
||||||
|
state
|
||||||
|
proposal {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
state
|
||||||
|
accounts {
|
||||||
|
asset {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
}
|
||||||
|
balance
|
||||||
|
type
|
||||||
|
}
|
||||||
|
data {
|
||||||
|
markPrice
|
||||||
|
bestBidPrice
|
||||||
|
bestBidVolume
|
||||||
|
bestOfferPrice
|
||||||
|
bestOfferVolume
|
||||||
|
bestStaticBidPrice
|
||||||
|
bestStaticBidVolume
|
||||||
|
bestStaticOfferPrice
|
||||||
|
bestStaticOfferVolume
|
||||||
|
midPrice
|
||||||
|
staticMidPrice
|
||||||
|
timestamp
|
||||||
|
openInterest
|
||||||
|
auctionEnd
|
||||||
|
auctionStart
|
||||||
|
indicativePrice
|
||||||
|
indicativeVolume
|
||||||
|
trigger
|
||||||
|
extensionTrigger
|
||||||
|
targetStake
|
||||||
|
suppliedStake
|
||||||
|
priceMonitoringBounds {
|
||||||
|
minValidPrice
|
||||||
|
maxValidPrice
|
||||||
|
trigger {
|
||||||
|
auctionExtensionSecs
|
||||||
|
probability
|
||||||
|
}
|
||||||
|
referencePrice
|
||||||
|
}
|
||||||
|
marketValueProxy
|
||||||
|
liquidityProviderFeeShare {
|
||||||
|
party {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
equityLikeShare
|
||||||
|
averageEntryValuation
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
174
apps/explorer/src/app/routes/markets/__generated___/Markets.ts
Normal file
174
apps/explorer/src/app/routes/markets/__generated___/Markets.ts
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type MarketsQueryQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type MarketsQueryQuery = { __typename?: 'Query', markets?: Array<{ __typename?: 'Market', id: string, name: string, decimalPlaces: number, tradingMode: Types.MarketTradingMode, state: Types.MarketState, fees: { __typename?: 'Fees', factors: { __typename?: 'FeeFactors', makerFee: string, infrastructureFee: string, liquidityFee: string } }, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', name: string, id: string, code: string, metadata: { __typename?: 'InstrumentMetadata', tags?: Array<string> | null }, product: { __typename?: 'Future', settlementAsset: { __typename?: 'Asset', id: string, name: string, decimals: number, globalRewardPoolAccount?: { __typename?: 'Account', balance: string } | null } } }, riskModel: { __typename?: 'LogNormalRiskModel', tau: number, riskAversionParameter: number, params: { __typename?: 'LogNormalModelParams', r: number, sigma: number, mu: number } } | { __typename?: 'SimpleRiskModel', params: { __typename?: 'SimpleRiskModelParams', factorLong: number, factorShort: number } }, marginCalculator?: { __typename?: 'MarginCalculator', scalingFactors: { __typename?: 'ScalingFactors', searchLevel: number, initialMargin: number, collateralRelease: number } } | null }, openingAuction: { __typename?: 'AuctionDuration', durationSecs: number, volume: number }, priceMonitoringSettings: { __typename?: 'PriceMonitoringSettings', parameters?: { __typename?: 'PriceMonitoringParameters', triggers?: Array<{ __typename?: 'PriceMonitoringTrigger', horizonSecs: number, probability: number, auctionExtensionSecs: number }> | null } | null }, liquidityMonitoringParameters: { __typename?: 'LiquidityMonitoringParameters', triggeringRatio: number, targetStakeParameters: { __typename?: 'TargetStakeParameters', timeWindow: number, scalingFactor: number } }, proposal?: { __typename?: 'Proposal', id?: string | null } | null, accounts?: Array<{ __typename?: 'Account', balance: string, type: Types.AccountType, asset: { __typename?: 'Asset', id: string, name: string } }> | null, data?: { __typename?: 'MarketData', markPrice: string, bestBidPrice: string, bestBidVolume: string, bestOfferPrice: string, bestOfferVolume: string, bestStaticBidPrice: string, bestStaticBidVolume: string, bestStaticOfferPrice: string, bestStaticOfferVolume: string, midPrice: string, staticMidPrice: string, timestamp: string, openInterest: string, auctionEnd?: string | null, auctionStart?: string | null, indicativePrice: string, indicativeVolume: string, trigger: Types.AuctionTrigger, extensionTrigger: Types.AuctionTrigger, targetStake?: string | null, suppliedStake?: string | null, marketValueProxy: string, priceMonitoringBounds?: Array<{ __typename?: 'PriceMonitoringBounds', minValidPrice: string, maxValidPrice: string, referencePrice: string, trigger: { __typename?: 'PriceMonitoringTrigger', auctionExtensionSecs: number, probability: number } }> | null, liquidityProviderFeeShare?: Array<{ __typename?: 'LiquidityProviderFeeShare', equityLikeShare: string, averageEntryValuation: string, party: { __typename?: 'Party', id: string } }> | null } | null }> | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const MarketsQueryDocument = gql`
|
||||||
|
query MarketsQuery {
|
||||||
|
markets {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
fees {
|
||||||
|
factors {
|
||||||
|
makerFee
|
||||||
|
infrastructureFee
|
||||||
|
liquidityFee
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tradableInstrument {
|
||||||
|
instrument {
|
||||||
|
name
|
||||||
|
metadata {
|
||||||
|
tags
|
||||||
|
}
|
||||||
|
id
|
||||||
|
code
|
||||||
|
product {
|
||||||
|
... on Future {
|
||||||
|
settlementAsset {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
decimals
|
||||||
|
globalRewardPoolAccount {
|
||||||
|
balance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
riskModel {
|
||||||
|
... on LogNormalRiskModel {
|
||||||
|
tau
|
||||||
|
riskAversionParameter
|
||||||
|
params {
|
||||||
|
r
|
||||||
|
sigma
|
||||||
|
mu
|
||||||
|
}
|
||||||
|
}
|
||||||
|
... on SimpleRiskModel {
|
||||||
|
params {
|
||||||
|
factorLong
|
||||||
|
factorShort
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
marginCalculator {
|
||||||
|
scalingFactors {
|
||||||
|
searchLevel
|
||||||
|
initialMargin
|
||||||
|
collateralRelease
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
decimalPlaces
|
||||||
|
openingAuction {
|
||||||
|
durationSecs
|
||||||
|
volume
|
||||||
|
}
|
||||||
|
priceMonitoringSettings {
|
||||||
|
parameters {
|
||||||
|
triggers {
|
||||||
|
horizonSecs
|
||||||
|
probability
|
||||||
|
auctionExtensionSecs
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
liquidityMonitoringParameters {
|
||||||
|
triggeringRatio
|
||||||
|
targetStakeParameters {
|
||||||
|
timeWindow
|
||||||
|
scalingFactor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tradingMode
|
||||||
|
state
|
||||||
|
proposal {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
state
|
||||||
|
accounts {
|
||||||
|
asset {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
}
|
||||||
|
balance
|
||||||
|
type
|
||||||
|
}
|
||||||
|
data {
|
||||||
|
markPrice
|
||||||
|
bestBidPrice
|
||||||
|
bestBidVolume
|
||||||
|
bestOfferPrice
|
||||||
|
bestOfferVolume
|
||||||
|
bestStaticBidPrice
|
||||||
|
bestStaticBidVolume
|
||||||
|
bestStaticOfferPrice
|
||||||
|
bestStaticOfferVolume
|
||||||
|
midPrice
|
||||||
|
staticMidPrice
|
||||||
|
timestamp
|
||||||
|
openInterest
|
||||||
|
auctionEnd
|
||||||
|
auctionStart
|
||||||
|
indicativePrice
|
||||||
|
indicativeVolume
|
||||||
|
trigger
|
||||||
|
extensionTrigger
|
||||||
|
targetStake
|
||||||
|
suppliedStake
|
||||||
|
priceMonitoringBounds {
|
||||||
|
minValidPrice
|
||||||
|
maxValidPrice
|
||||||
|
trigger {
|
||||||
|
auctionExtensionSecs
|
||||||
|
probability
|
||||||
|
}
|
||||||
|
referencePrice
|
||||||
|
}
|
||||||
|
marketValueProxy
|
||||||
|
liquidityProviderFeeShare {
|
||||||
|
party {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
equityLikeShare
|
||||||
|
averageEntryValuation
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useMarketsQueryQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useMarketsQueryQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useMarketsQueryQuery` 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 } = useMarketsQueryQuery({
|
||||||
|
* variables: {
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useMarketsQueryQuery(baseOptions?: Apollo.QueryHookOptions<MarketsQueryQuery, MarketsQueryQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<MarketsQueryQuery, MarketsQueryQueryVariables>(MarketsQueryDocument, options);
|
||||||
|
}
|
||||||
|
export function useMarketsQueryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<MarketsQueryQuery, MarketsQueryQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<MarketsQueryQuery, MarketsQueryQueryVariables>(MarketsQueryDocument, options);
|
||||||
|
}
|
||||||
|
export type MarketsQueryQueryHookResult = ReturnType<typeof useMarketsQueryQuery>;
|
||||||
|
export type MarketsQueryLazyQueryHookResult = ReturnType<typeof useMarketsQueryLazyQuery>;
|
||||||
|
export type MarketsQueryQueryResult = Apollo.QueryResult<MarketsQueryQuery, MarketsQueryQueryVariables>;
|
@ -0,0 +1,6 @@
|
|||||||
|
query NetworkParametersQuery {
|
||||||
|
networkParameters {
|
||||||
|
key
|
||||||
|
value
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type NetworkParametersQueryQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type NetworkParametersQueryQuery = { __typename?: 'Query', networkParameters?: Array<{ __typename?: 'NetworkParameter', key: string, value: string }> | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const NetworkParametersQueryDocument = gql`
|
||||||
|
query NetworkParametersQuery {
|
||||||
|
networkParameters {
|
||||||
|
key
|
||||||
|
value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useNetworkParametersQueryQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useNetworkParametersQueryQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useNetworkParametersQueryQuery` 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 } = useNetworkParametersQueryQuery({
|
||||||
|
* variables: {
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useNetworkParametersQueryQuery(baseOptions?: Apollo.QueryHookOptions<NetworkParametersQueryQuery, NetworkParametersQueryQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<NetworkParametersQueryQuery, NetworkParametersQueryQueryVariables>(NetworkParametersQueryDocument, options);
|
||||||
|
}
|
||||||
|
export function useNetworkParametersQueryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<NetworkParametersQueryQuery, NetworkParametersQueryQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<NetworkParametersQueryQuery, NetworkParametersQueryQueryVariables>(NetworkParametersQueryDocument, options);
|
||||||
|
}
|
||||||
|
export type NetworkParametersQueryQueryHookResult = ReturnType<typeof useNetworkParametersQueryQuery>;
|
||||||
|
export type NetworkParametersQueryLazyQueryHookResult = ReturnType<typeof useNetworkParametersQueryLazyQuery>;
|
||||||
|
export type NetworkParametersQueryQueryResult = Apollo.QueryResult<NetworkParametersQueryQuery, NetworkParametersQueryQueryVariables>;
|
22
apps/explorer/src/app/routes/oracles/OracleSpecs.graphql
Normal file
22
apps/explorer/src/app/routes/oracles/OracleSpecs.graphql
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
query OracleSpecs {
|
||||||
|
oracleSpecs {
|
||||||
|
status
|
||||||
|
id
|
||||||
|
createdAt
|
||||||
|
updatedAt
|
||||||
|
pubKeys
|
||||||
|
filters {
|
||||||
|
key {
|
||||||
|
name
|
||||||
|
type
|
||||||
|
}
|
||||||
|
conditions {
|
||||||
|
value
|
||||||
|
operator
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data {
|
||||||
|
pubKeys
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,62 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type OracleSpecsQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type OracleSpecsQuery = { __typename?: 'Query', oracleSpecs?: Array<{ __typename?: 'OracleSpec', status: Types.OracleSpecStatus, id: string, createdAt: string, updatedAt?: string | null, pubKeys?: Array<string> | null, filters?: Array<{ __typename?: 'Filter', key: { __typename?: 'PropertyKey', name?: string | null, type: Types.PropertyKeyType }, conditions?: Array<{ __typename?: 'Condition', value?: string | null, operator: Types.ConditionOperator }> | null }> | null, data: Array<{ __typename?: 'OracleData', pubKeys?: Array<string> | null }> }> | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const OracleSpecsDocument = gql`
|
||||||
|
query OracleSpecs {
|
||||||
|
oracleSpecs {
|
||||||
|
status
|
||||||
|
id
|
||||||
|
createdAt
|
||||||
|
updatedAt
|
||||||
|
pubKeys
|
||||||
|
filters {
|
||||||
|
key {
|
||||||
|
name
|
||||||
|
type
|
||||||
|
}
|
||||||
|
conditions {
|
||||||
|
value
|
||||||
|
operator
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data {
|
||||||
|
pubKeys
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useOracleSpecsQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useOracleSpecsQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useOracleSpecsQuery` 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 } = useOracleSpecsQuery({
|
||||||
|
* variables: {
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useOracleSpecsQuery(baseOptions?: Apollo.QueryHookOptions<OracleSpecsQuery, OracleSpecsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<OracleSpecsQuery, OracleSpecsQueryVariables>(OracleSpecsDocument, options);
|
||||||
|
}
|
||||||
|
export function useOracleSpecsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<OracleSpecsQuery, OracleSpecsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<OracleSpecsQuery, OracleSpecsQueryVariables>(OracleSpecsDocument, options);
|
||||||
|
}
|
||||||
|
export type OracleSpecsQueryHookResult = ReturnType<typeof useOracleSpecsQuery>;
|
||||||
|
export type OracleSpecsLazyQueryHookResult = ReturnType<typeof useOracleSpecsLazyQuery>;
|
||||||
|
export type OracleSpecsQueryResult = Apollo.QueryResult<OracleSpecsQuery, OracleSpecsQueryVariables>;
|
32
apps/explorer/src/app/routes/parties/PartyAssets.graphql
Normal file
32
apps/explorer/src/app/routes/parties/PartyAssets.graphql
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
query PartyAssetsQuery($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
delegations {
|
||||||
|
amount
|
||||||
|
node {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
}
|
||||||
|
epoch
|
||||||
|
}
|
||||||
|
stake {
|
||||||
|
currentStakeAvailable
|
||||||
|
}
|
||||||
|
accounts {
|
||||||
|
asset {
|
||||||
|
name
|
||||||
|
id
|
||||||
|
decimals
|
||||||
|
symbol
|
||||||
|
source {
|
||||||
|
__typename
|
||||||
|
... on ERC20 {
|
||||||
|
contractAddress
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type
|
||||||
|
balance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,75 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type PartyAssetsQueryQueryVariables = Types.Exact<{
|
||||||
|
partyId: Types.Scalars['ID'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type PartyAssetsQueryQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, delegations?: Array<{ __typename?: 'Delegation', amount: string, epoch: number, node: { __typename?: 'Node', id: string, name: string } }> | null, stake: { __typename?: 'PartyStake', currentStakeAvailable: string }, accounts?: Array<{ __typename?: 'Account', type: Types.AccountType, balance: string, asset: { __typename?: 'Asset', name: string, id: string, decimals: number, symbol: string, source: { __typename: 'BuiltinAsset' } | { __typename: 'ERC20', contractAddress: string } } }> | null } | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const PartyAssetsQueryDocument = gql`
|
||||||
|
query PartyAssetsQuery($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
delegations {
|
||||||
|
amount
|
||||||
|
node {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
}
|
||||||
|
epoch
|
||||||
|
}
|
||||||
|
stake {
|
||||||
|
currentStakeAvailable
|
||||||
|
}
|
||||||
|
accounts {
|
||||||
|
asset {
|
||||||
|
name
|
||||||
|
id
|
||||||
|
decimals
|
||||||
|
symbol
|
||||||
|
source {
|
||||||
|
__typename
|
||||||
|
... on ERC20 {
|
||||||
|
contractAddress
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type
|
||||||
|
balance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __usePartyAssetsQueryQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `usePartyAssetsQueryQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `usePartyAssetsQueryQuery` 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 } = usePartyAssetsQueryQuery({
|
||||||
|
* variables: {
|
||||||
|
* partyId: // value for 'partyId'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function usePartyAssetsQueryQuery(baseOptions: Apollo.QueryHookOptions<PartyAssetsQueryQuery, PartyAssetsQueryQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<PartyAssetsQueryQuery, PartyAssetsQueryQueryVariables>(PartyAssetsQueryDocument, options);
|
||||||
|
}
|
||||||
|
export function usePartyAssetsQueryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<PartyAssetsQueryQuery, PartyAssetsQueryQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<PartyAssetsQueryQuery, PartyAssetsQueryQueryVariables>(PartyAssetsQueryDocument, options);
|
||||||
|
}
|
||||||
|
export type PartyAssetsQueryQueryHookResult = ReturnType<typeof usePartyAssetsQueryQuery>;
|
||||||
|
export type PartyAssetsQueryLazyQueryHookResult = ReturnType<typeof usePartyAssetsQueryLazyQuery>;
|
||||||
|
export type PartyAssetsQueryQueryResult = Apollo.QueryResult<PartyAssetsQueryQuery, PartyAssetsQueryQueryVariables>;
|
23
apps/explorer/src/app/routes/validators/Nodes.graphql
Normal file
23
apps/explorer/src/app/routes/validators/Nodes.graphql
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
query NodesQuery {
|
||||||
|
nodes {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
infoUrl
|
||||||
|
avatarUrl
|
||||||
|
pubkey
|
||||||
|
tmPubkey
|
||||||
|
ethereumAddress
|
||||||
|
location
|
||||||
|
stakedByOperator
|
||||||
|
stakedByDelegates
|
||||||
|
stakedTotal
|
||||||
|
pendingStake
|
||||||
|
epochData {
|
||||||
|
total
|
||||||
|
offline
|
||||||
|
online
|
||||||
|
}
|
||||||
|
status
|
||||||
|
name
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type NodesQueryQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type NodesQueryQuery = { __typename?: 'Query', nodes?: Array<{ __typename?: 'Node', id: string, name: string, infoUrl: string, avatarUrl?: string | null, pubkey: string, tmPubkey: string, ethereumAddress: string, location: string, stakedByOperator: string, stakedByDelegates: string, stakedTotal: string, pendingStake: string, status: Types.NodeStatus, epochData?: { __typename?: 'EpochData', total: number, offline: number, online: number } | null }> | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const NodesQueryDocument = gql`
|
||||||
|
query NodesQuery {
|
||||||
|
nodes {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
infoUrl
|
||||||
|
avatarUrl
|
||||||
|
pubkey
|
||||||
|
tmPubkey
|
||||||
|
ethereumAddress
|
||||||
|
location
|
||||||
|
stakedByOperator
|
||||||
|
stakedByDelegates
|
||||||
|
stakedTotal
|
||||||
|
pendingStake
|
||||||
|
epochData {
|
||||||
|
total
|
||||||
|
offline
|
||||||
|
online
|
||||||
|
}
|
||||||
|
status
|
||||||
|
name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useNodesQueryQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useNodesQueryQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useNodesQueryQuery` 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 } = useNodesQueryQuery({
|
||||||
|
* variables: {
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useNodesQueryQuery(baseOptions?: Apollo.QueryHookOptions<NodesQueryQuery, NodesQueryQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<NodesQueryQuery, NodesQueryQueryVariables>(NodesQueryDocument, options);
|
||||||
|
}
|
||||||
|
export function useNodesQueryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<NodesQueryQuery, NodesQueryQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<NodesQueryQuery, NodesQueryQueryVariables>(NodesQueryDocument, options);
|
||||||
|
}
|
||||||
|
export type NodesQueryQueryHookResult = ReturnType<typeof useNodesQueryQuery>;
|
||||||
|
export type NodesQueryLazyQueryHookResult = ReturnType<typeof useNodesQueryLazyQuery>;
|
||||||
|
export type NodesQueryQueryResult = Apollo.QueryResult<NodesQueryQuery, NodesQueryQueryVariables>;
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
||||||
"ignorePatterns": ["!**/*", "__generated__"],
|
"ignorePatterns": ["!**/*", "__generated__", "__generated___"],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||||
|
43
apps/token/client.graphql
Normal file
43
apps/token/client.graphql
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
extend type Delegation {
|
||||||
|
"The amount field formatted by the client"
|
||||||
|
amountFormatted: String!
|
||||||
|
}
|
||||||
|
|
||||||
|
extend type PartyStake {
|
||||||
|
"The currently available stake formatted by the client"
|
||||||
|
currentStakeAvailableFormatted: String!
|
||||||
|
}
|
||||||
|
|
||||||
|
extend type NodeData {
|
||||||
|
"The total staked field formatted by the client"
|
||||||
|
stakedTotalFormatted: String!
|
||||||
|
}
|
||||||
|
|
||||||
|
extend type Node {
|
||||||
|
"The total staked field formatted by the client"
|
||||||
|
stakedTotalFormatted: String!
|
||||||
|
|
||||||
|
"The pending staked field formatted by the client"
|
||||||
|
pendingStakeFormatted: String!
|
||||||
|
|
||||||
|
"The stakes by operator field formatted by the client"
|
||||||
|
stakedByOperatorFormatted: String!
|
||||||
|
|
||||||
|
"The stakes by delegates field formatted by the client"
|
||||||
|
stakedByDelegatesFormatted: String!
|
||||||
|
}
|
||||||
|
|
||||||
|
extend type Reward {
|
||||||
|
"The amount field formatted by the client"
|
||||||
|
amountFormatted: String!
|
||||||
|
}
|
||||||
|
|
||||||
|
extend type RewardPerAssetDetail {
|
||||||
|
"The total amount field formatted by the client"
|
||||||
|
totalAmountFormatted: String!
|
||||||
|
}
|
||||||
|
|
||||||
|
extend type Account {
|
||||||
|
"The balance field formatted by the client"
|
||||||
|
balanceFormatted: String!
|
||||||
|
}
|
37
apps/token/src/components/vega-wallet/Delegations.graphql
Normal file
37
apps/token/src/components/vega-wallet/Delegations.graphql
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
query Delegations($partyId: ID!) {
|
||||||
|
epoch {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
delegations {
|
||||||
|
amountFormatted @client
|
||||||
|
amount
|
||||||
|
node {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
}
|
||||||
|
epoch
|
||||||
|
}
|
||||||
|
stake {
|
||||||
|
currentStakeAvailable
|
||||||
|
currentStakeAvailableFormatted @client
|
||||||
|
}
|
||||||
|
accounts {
|
||||||
|
asset {
|
||||||
|
name
|
||||||
|
id
|
||||||
|
decimals
|
||||||
|
symbol
|
||||||
|
source {
|
||||||
|
__typename
|
||||||
|
... on ERC20 {
|
||||||
|
contractAddress
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type
|
||||||
|
balance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -28,6 +28,9 @@ export interface Delegations_party_delegations_node {
|
|||||||
|
|
||||||
export interface Delegations_party_delegations {
|
export interface Delegations_party_delegations {
|
||||||
__typename: "Delegation";
|
__typename: "Delegation";
|
||||||
|
/**
|
||||||
|
* The amount field formatted by the client
|
||||||
|
*/
|
||||||
amountFormatted: string;
|
amountFormatted: string;
|
||||||
/**
|
/**
|
||||||
* Amount delegated
|
* Amount delegated
|
||||||
@ -49,6 +52,9 @@ export interface Delegations_party_stake {
|
|||||||
* The stake currently available for the party
|
* The stake currently available for the party
|
||||||
*/
|
*/
|
||||||
currentStakeAvailable: string;
|
currentStakeAvailable: string;
|
||||||
|
/**
|
||||||
|
* The currently available stake formatted by the client
|
||||||
|
*/
|
||||||
currentStakeAvailableFormatted: string;
|
currentStakeAvailableFormatted: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,52 +0,0 @@
|
|||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL query operation: PartyDelegations
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface PartyDelegations_epoch {
|
|
||||||
__typename: "Epoch";
|
|
||||||
/**
|
|
||||||
* Presumably this is an integer or something. If there's no such thing, disregard
|
|
||||||
*/
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PartyDelegations_party_delegations {
|
|
||||||
__typename: "Delegation";
|
|
||||||
/**
|
|
||||||
* Amount delegated
|
|
||||||
*/
|
|
||||||
amount: string;
|
|
||||||
/**
|
|
||||||
* URL of node you are delegating to
|
|
||||||
*/
|
|
||||||
node: string;
|
|
||||||
/**
|
|
||||||
* Epoch of delegation
|
|
||||||
*/
|
|
||||||
epoch: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PartyDelegations_party {
|
|
||||||
__typename: "Party";
|
|
||||||
delegations: PartyDelegations_party_delegations[] | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PartyDelegations {
|
|
||||||
/**
|
|
||||||
* get data for a specific epoch, if id omitted it gets the current epoch
|
|
||||||
*/
|
|
||||||
epoch: PartyDelegations_epoch;
|
|
||||||
/**
|
|
||||||
* An entity that is trading on the VEGA network
|
|
||||||
*/
|
|
||||||
party: PartyDelegations_party | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PartyDelegationsVariables {
|
|
||||||
partyId: string;
|
|
||||||
}
|
|
@ -0,0 +1,80 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type DelegationsQueryVariables = Types.Exact<{
|
||||||
|
partyId: Types.Scalars['ID'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type DelegationsQuery = { __typename?: 'Query', epoch: { __typename?: 'Epoch', id: string }, party?: { __typename?: 'Party', id: string, delegations?: Array<{ __typename?: 'Delegation', amountFormatted: string, amount: string, epoch: number, node: { __typename?: 'Node', id: string, name: string } }> | null, stake: { __typename?: 'PartyStake', currentStakeAvailable: string, currentStakeAvailableFormatted: string }, accounts?: Array<{ __typename?: 'Account', type: Types.AccountType, balance: string, asset: { __typename?: 'Asset', name: string, id: string, decimals: number, symbol: string, source: { __typename: 'BuiltinAsset' } | { __typename: 'ERC20', contractAddress: string } } }> | null } | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const DelegationsDocument = gql`
|
||||||
|
query Delegations($partyId: ID!) {
|
||||||
|
epoch {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
delegations {
|
||||||
|
amountFormatted @client
|
||||||
|
amount
|
||||||
|
node {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
}
|
||||||
|
epoch
|
||||||
|
}
|
||||||
|
stake {
|
||||||
|
currentStakeAvailable
|
||||||
|
currentStakeAvailableFormatted @client
|
||||||
|
}
|
||||||
|
accounts {
|
||||||
|
asset {
|
||||||
|
name
|
||||||
|
id
|
||||||
|
decimals
|
||||||
|
symbol
|
||||||
|
source {
|
||||||
|
__typename
|
||||||
|
... on ERC20 {
|
||||||
|
contractAddress
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type
|
||||||
|
balance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useDelegationsQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useDelegationsQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useDelegationsQuery` 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 } = useDelegationsQuery({
|
||||||
|
* variables: {
|
||||||
|
* partyId: // value for 'partyId'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useDelegationsQuery(baseOptions: Apollo.QueryHookOptions<DelegationsQuery, DelegationsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<DelegationsQuery, DelegationsQueryVariables>(DelegationsDocument, options);
|
||||||
|
}
|
||||||
|
export function useDelegationsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<DelegationsQuery, DelegationsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<DelegationsQuery, DelegationsQueryVariables>(DelegationsDocument, options);
|
||||||
|
}
|
||||||
|
export type DelegationsQueryHookResult = ReturnType<typeof useDelegationsQuery>;
|
||||||
|
export type DelegationsLazyQueryHookResult = ReturnType<typeof useDelegationsLazyQuery>;
|
||||||
|
export type DelegationsQueryResult = Apollo.QueryResult<DelegationsQuery, DelegationsQueryVariables>;
|
6
apps/token/src/hooks/NetworkParams.graphql
Normal file
6
apps/token/src/hooks/NetworkParams.graphql
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
query NetworkParams {
|
||||||
|
networkParameters {
|
||||||
|
key
|
||||||
|
value
|
||||||
|
}
|
||||||
|
}
|
@ -1,48 +0,0 @@
|
|||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL query operation: Erc20ApprovalPoll
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface Erc20ApprovalPoll_erc20WithdrawalApproval {
|
|
||||||
__typename: "Erc20WithdrawalApproval";
|
|
||||||
/**
|
|
||||||
* The source asset in the ethereum network
|
|
||||||
*/
|
|
||||||
assetSource: string;
|
|
||||||
/**
|
|
||||||
* The amount to be withdrawn
|
|
||||||
*/
|
|
||||||
amount: string;
|
|
||||||
/**
|
|
||||||
* The nonce to be used in the request
|
|
||||||
*/
|
|
||||||
nonce: string;
|
|
||||||
/**
|
|
||||||
* Signature aggregate from the nodes, in the following format:
|
|
||||||
* 0x + sig1 + sig2 + ... + sigN
|
|
||||||
*/
|
|
||||||
signatures: string;
|
|
||||||
/**
|
|
||||||
* The target address which will receive the funds
|
|
||||||
*/
|
|
||||||
targetAddress: string;
|
|
||||||
/**
|
|
||||||
* Timestamp in seconds for expiry of the approval
|
|
||||||
*/
|
|
||||||
expiry: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Erc20ApprovalPoll {
|
|
||||||
/**
|
|
||||||
* find an erc20 withdrawal approval using its withdrawal id
|
|
||||||
*/
|
|
||||||
erc20WithdrawalApproval: Erc20ApprovalPoll_erc20WithdrawalApproval | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Erc20ApprovalPollVariables {
|
|
||||||
withdrawalId: string;
|
|
||||||
}
|
|
93
apps/token/src/hooks/__generated__/WithdrawalPoll.ts
generated
93
apps/token/src/hooks/__generated__/WithdrawalPoll.ts
generated
@ -1,93 +0,0 @@
|
|||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
import { WithdrawalStatus } from "@vegaprotocol/types";
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL query operation: WithdrawalPoll
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface WithdrawalPoll_party_withdrawals_asset {
|
|
||||||
__typename: "Asset";
|
|
||||||
/**
|
|
||||||
* The id of the asset
|
|
||||||
*/
|
|
||||||
id: string;
|
|
||||||
/**
|
|
||||||
* The symbol of the asset (e.g: GBP)
|
|
||||||
*/
|
|
||||||
symbol: string;
|
|
||||||
/**
|
|
||||||
* The precision of the asset
|
|
||||||
*/
|
|
||||||
decimals: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface WithdrawalPoll_party_withdrawals_details {
|
|
||||||
__typename: "Erc20WithdrawalDetails";
|
|
||||||
/**
|
|
||||||
* The ethereum address of the receiver of the asset funds
|
|
||||||
*/
|
|
||||||
receiverAddress: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface WithdrawalPoll_party_withdrawals {
|
|
||||||
__typename: "Withdrawal";
|
|
||||||
/**
|
|
||||||
* The Vega internal id of the withdrawal
|
|
||||||
*/
|
|
||||||
id: string;
|
|
||||||
/**
|
|
||||||
* The amount to be withdrawn
|
|
||||||
*/
|
|
||||||
amount: string;
|
|
||||||
/**
|
|
||||||
* The current status of the withdrawal
|
|
||||||
*/
|
|
||||||
status: WithdrawalStatus;
|
|
||||||
/**
|
|
||||||
* The asset to be withdrawn
|
|
||||||
*/
|
|
||||||
asset: WithdrawalPoll_party_withdrawals_asset;
|
|
||||||
/**
|
|
||||||
* RFC3339Nano time at which the withdrawal was created
|
|
||||||
*/
|
|
||||||
createdTimestamp: string;
|
|
||||||
/**
|
|
||||||
* RFC3339Nano time at which the withdrawal was finalized
|
|
||||||
*/
|
|
||||||
withdrawnTimestamp: string | null;
|
|
||||||
/**
|
|
||||||
* Hash of the transaction on the foreign chain
|
|
||||||
*/
|
|
||||||
txHash: string | null;
|
|
||||||
/**
|
|
||||||
* Foreign chain specific details about the withdrawal
|
|
||||||
*/
|
|
||||||
details: WithdrawalPoll_party_withdrawals_details | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface WithdrawalPoll_party {
|
|
||||||
__typename: "Party";
|
|
||||||
/**
|
|
||||||
* Party identifier
|
|
||||||
*/
|
|
||||||
id: string;
|
|
||||||
/**
|
|
||||||
* The list of all withdrawals initiated by the party
|
|
||||||
*/
|
|
||||||
withdrawals: WithdrawalPoll_party_withdrawals[] | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface WithdrawalPoll {
|
|
||||||
/**
|
|
||||||
* An entity that is trading on the VEGA network
|
|
||||||
*/
|
|
||||||
party: WithdrawalPoll_party | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface WithdrawalPollVariables {
|
|
||||||
partyId: string;
|
|
||||||
}
|
|
46
apps/token/src/hooks/__generated___/NetworkParams.ts
Normal file
46
apps/token/src/hooks/__generated___/NetworkParams.ts
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type NetworkParamsQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type NetworkParamsQuery = { __typename?: 'Query', networkParameters?: Array<{ __typename?: 'NetworkParameter', key: string, value: string }> | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const NetworkParamsDocument = gql`
|
||||||
|
query NetworkParams {
|
||||||
|
networkParameters {
|
||||||
|
key
|
||||||
|
value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useNetworkParamsQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useNetworkParamsQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useNetworkParamsQuery` 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 } = useNetworkParamsQuery({
|
||||||
|
* variables: {
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useNetworkParamsQuery(baseOptions?: Apollo.QueryHookOptions<NetworkParamsQuery, NetworkParamsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<NetworkParamsQuery, NetworkParamsQueryVariables>(NetworkParamsDocument, options);
|
||||||
|
}
|
||||||
|
export function useNetworkParamsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<NetworkParamsQuery, NetworkParamsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<NetworkParamsQuery, NetworkParamsQueryVariables>(NetworkParamsDocument, options);
|
||||||
|
}
|
||||||
|
export type NetworkParamsQueryHookResult = ReturnType<typeof useNetworkParamsQuery>;
|
||||||
|
export type NetworkParamsLazyQueryHookResult = ReturnType<typeof useNetworkParamsLazyQuery>;
|
||||||
|
export type NetworkParamsQueryResult = Apollo.QueryResult<NetworkParamsQuery, NetworkParamsQueryVariables>;
|
96
apps/token/src/routes/governance/Proposal.graphql
Normal file
96
apps/token/src/routes/governance/Proposal.graphql
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
fragment ProposalFields on Proposal {
|
||||||
|
id
|
||||||
|
reference
|
||||||
|
state
|
||||||
|
datetime
|
||||||
|
rejectionReason
|
||||||
|
errorDetails
|
||||||
|
party {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
terms {
|
||||||
|
closingDatetime
|
||||||
|
enactmentDatetime
|
||||||
|
change {
|
||||||
|
... on NewMarket {
|
||||||
|
decimalPlaces
|
||||||
|
metadata
|
||||||
|
instrument {
|
||||||
|
name
|
||||||
|
code
|
||||||
|
futureProduct {
|
||||||
|
settlementAsset {
|
||||||
|
symbol
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
... on UpdateMarket {
|
||||||
|
marketId
|
||||||
|
}
|
||||||
|
... on NewAsset {
|
||||||
|
__typename
|
||||||
|
name
|
||||||
|
symbol
|
||||||
|
source {
|
||||||
|
... on BuiltinAsset {
|
||||||
|
__typename
|
||||||
|
maxFaucetAmountMint
|
||||||
|
}
|
||||||
|
... on ERC20 {
|
||||||
|
__typename
|
||||||
|
contractAddress
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
... on UpdateNetworkParameter {
|
||||||
|
networkParameter {
|
||||||
|
key
|
||||||
|
value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
votes {
|
||||||
|
yes {
|
||||||
|
totalTokens
|
||||||
|
totalNumber
|
||||||
|
votes {
|
||||||
|
value
|
||||||
|
party {
|
||||||
|
id
|
||||||
|
stake {
|
||||||
|
currentStakeAvailable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
datetime
|
||||||
|
}
|
||||||
|
}
|
||||||
|
no {
|
||||||
|
totalTokens
|
||||||
|
totalNumber
|
||||||
|
votes {
|
||||||
|
value
|
||||||
|
party {
|
||||||
|
id
|
||||||
|
stake {
|
||||||
|
currentStakeAvailable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
datetime
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query Proposal($proposalId: ID!) {
|
||||||
|
proposal(id: $proposalId) {
|
||||||
|
...ProposalFields
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query Proposals {
|
||||||
|
proposals {
|
||||||
|
...ProposalFields
|
||||||
|
}
|
||||||
|
}
|
174
apps/token/src/routes/governance/__generated___/Proposal.ts
Normal file
174
apps/token/src/routes/governance/__generated___/Proposal.ts
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type ProposalFieldsFragment = { __typename?: 'Proposal', id?: string | null, reference: string, state: Types.ProposalState, datetime: string, rejectionReason?: Types.ProposalRejectionReason | null, errorDetails?: string | null, party: { __typename?: 'Party', id: string }, terms: { __typename?: 'ProposalTerms', closingDatetime: string, enactmentDatetime?: string | null, change: { __typename: 'NewAsset', name: string, symbol: string, source: { __typename: 'BuiltinAsset', maxFaucetAmountMint: string } | { __typename: 'ERC20', contractAddress: string } } | { __typename?: 'NewFreeform' } | { __typename?: 'NewMarket', decimalPlaces: number, metadata?: Array<string> | null, instrument: { __typename?: 'InstrumentConfiguration', name: string, code: string, futureProduct?: { __typename?: 'FutureProduct', settlementAsset: { __typename?: 'Asset', symbol: string } } | null } } | { __typename?: 'UpdateAsset' } | { __typename?: 'UpdateMarket', marketId: string } | { __typename?: 'UpdateNetworkParameter', networkParameter: { __typename?: 'NetworkParameter', key: string, value: string } } }, votes: { __typename?: 'ProposalVotes', yes: { __typename?: 'ProposalVoteSide', totalTokens: string, totalNumber: string, votes?: Array<{ __typename?: 'Vote', value: Types.VoteValue, datetime: string, party: { __typename?: 'Party', id: string, stake: { __typename?: 'PartyStake', currentStakeAvailable: string } } }> | null }, no: { __typename?: 'ProposalVoteSide', totalTokens: string, totalNumber: string, votes?: Array<{ __typename?: 'Vote', value: Types.VoteValue, datetime: string, party: { __typename?: 'Party', id: string, stake: { __typename?: 'PartyStake', currentStakeAvailable: string } } }> | null } } };
|
||||||
|
|
||||||
|
export type ProposalQueryVariables = Types.Exact<{
|
||||||
|
proposalId: Types.Scalars['ID'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type ProposalQuery = { __typename?: 'Query', proposal: { __typename?: 'Proposal', id?: string | null, reference: string, state: Types.ProposalState, datetime: string, rejectionReason?: Types.ProposalRejectionReason | null, errorDetails?: string | null, party: { __typename?: 'Party', id: string }, terms: { __typename?: 'ProposalTerms', closingDatetime: string, enactmentDatetime?: string | null, change: { __typename: 'NewAsset', name: string, symbol: string, source: { __typename: 'BuiltinAsset', maxFaucetAmountMint: string } | { __typename: 'ERC20', contractAddress: string } } | { __typename?: 'NewFreeform' } | { __typename?: 'NewMarket', decimalPlaces: number, metadata?: Array<string> | null, instrument: { __typename?: 'InstrumentConfiguration', name: string, code: string, futureProduct?: { __typename?: 'FutureProduct', settlementAsset: { __typename?: 'Asset', symbol: string } } | null } } | { __typename?: 'UpdateAsset' } | { __typename?: 'UpdateMarket', marketId: string } | { __typename?: 'UpdateNetworkParameter', networkParameter: { __typename?: 'NetworkParameter', key: string, value: string } } }, votes: { __typename?: 'ProposalVotes', yes: { __typename?: 'ProposalVoteSide', totalTokens: string, totalNumber: string, votes?: Array<{ __typename?: 'Vote', value: Types.VoteValue, datetime: string, party: { __typename?: 'Party', id: string, stake: { __typename?: 'PartyStake', currentStakeAvailable: string } } }> | null }, no: { __typename?: 'ProposalVoteSide', totalTokens: string, totalNumber: string, votes?: Array<{ __typename?: 'Vote', value: Types.VoteValue, datetime: string, party: { __typename?: 'Party', id: string, stake: { __typename?: 'PartyStake', currentStakeAvailable: string } } }> | null } } } };
|
||||||
|
|
||||||
|
export type ProposalsQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type ProposalsQuery = { __typename?: 'Query', proposals?: Array<{ __typename?: 'Proposal', id?: string | null, reference: string, state: Types.ProposalState, datetime: string, rejectionReason?: Types.ProposalRejectionReason | null, errorDetails?: string | null, party: { __typename?: 'Party', id: string }, terms: { __typename?: 'ProposalTerms', closingDatetime: string, enactmentDatetime?: string | null, change: { __typename: 'NewAsset', name: string, symbol: string, source: { __typename: 'BuiltinAsset', maxFaucetAmountMint: string } | { __typename: 'ERC20', contractAddress: string } } | { __typename?: 'NewFreeform' } | { __typename?: 'NewMarket', decimalPlaces: number, metadata?: Array<string> | null, instrument: { __typename?: 'InstrumentConfiguration', name: string, code: string, futureProduct?: { __typename?: 'FutureProduct', settlementAsset: { __typename?: 'Asset', symbol: string } } | null } } | { __typename?: 'UpdateAsset' } | { __typename?: 'UpdateMarket', marketId: string } | { __typename?: 'UpdateNetworkParameter', networkParameter: { __typename?: 'NetworkParameter', key: string, value: string } } }, votes: { __typename?: 'ProposalVotes', yes: { __typename?: 'ProposalVoteSide', totalTokens: string, totalNumber: string, votes?: Array<{ __typename?: 'Vote', value: Types.VoteValue, datetime: string, party: { __typename?: 'Party', id: string, stake: { __typename?: 'PartyStake', currentStakeAvailable: string } } }> | null }, no: { __typename?: 'ProposalVoteSide', totalTokens: string, totalNumber: string, votes?: Array<{ __typename?: 'Vote', value: Types.VoteValue, datetime: string, party: { __typename?: 'Party', id: string, stake: { __typename?: 'PartyStake', currentStakeAvailable: string } } }> | null } } }> | null };
|
||||||
|
|
||||||
|
export const ProposalFieldsFragmentDoc = gql`
|
||||||
|
fragment ProposalFields on Proposal {
|
||||||
|
id
|
||||||
|
reference
|
||||||
|
state
|
||||||
|
datetime
|
||||||
|
rejectionReason
|
||||||
|
errorDetails
|
||||||
|
party {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
terms {
|
||||||
|
closingDatetime
|
||||||
|
enactmentDatetime
|
||||||
|
change {
|
||||||
|
... on NewMarket {
|
||||||
|
decimalPlaces
|
||||||
|
metadata
|
||||||
|
instrument {
|
||||||
|
name
|
||||||
|
code
|
||||||
|
futureProduct {
|
||||||
|
settlementAsset {
|
||||||
|
symbol
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
... on UpdateMarket {
|
||||||
|
marketId
|
||||||
|
}
|
||||||
|
... on NewAsset {
|
||||||
|
__typename
|
||||||
|
name
|
||||||
|
symbol
|
||||||
|
source {
|
||||||
|
... on BuiltinAsset {
|
||||||
|
__typename
|
||||||
|
maxFaucetAmountMint
|
||||||
|
}
|
||||||
|
... on ERC20 {
|
||||||
|
__typename
|
||||||
|
contractAddress
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
... on UpdateNetworkParameter {
|
||||||
|
networkParameter {
|
||||||
|
key
|
||||||
|
value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
votes {
|
||||||
|
yes {
|
||||||
|
totalTokens
|
||||||
|
totalNumber
|
||||||
|
votes {
|
||||||
|
value
|
||||||
|
party {
|
||||||
|
id
|
||||||
|
stake {
|
||||||
|
currentStakeAvailable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
datetime
|
||||||
|
}
|
||||||
|
}
|
||||||
|
no {
|
||||||
|
totalTokens
|
||||||
|
totalNumber
|
||||||
|
votes {
|
||||||
|
value
|
||||||
|
party {
|
||||||
|
id
|
||||||
|
stake {
|
||||||
|
currentStakeAvailable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
datetime
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
export const ProposalDocument = gql`
|
||||||
|
query Proposal($proposalId: ID!) {
|
||||||
|
proposal(id: $proposalId) {
|
||||||
|
...ProposalFields
|
||||||
|
}
|
||||||
|
}
|
||||||
|
${ProposalFieldsFragmentDoc}`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useProposalQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useProposalQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useProposalQuery` 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 } = useProposalQuery({
|
||||||
|
* variables: {
|
||||||
|
* proposalId: // value for 'proposalId'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useProposalQuery(baseOptions: Apollo.QueryHookOptions<ProposalQuery, ProposalQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<ProposalQuery, ProposalQueryVariables>(ProposalDocument, options);
|
||||||
|
}
|
||||||
|
export function useProposalLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<ProposalQuery, ProposalQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<ProposalQuery, ProposalQueryVariables>(ProposalDocument, options);
|
||||||
|
}
|
||||||
|
export type ProposalQueryHookResult = ReturnType<typeof useProposalQuery>;
|
||||||
|
export type ProposalLazyQueryHookResult = ReturnType<typeof useProposalLazyQuery>;
|
||||||
|
export type ProposalQueryResult = Apollo.QueryResult<ProposalQuery, ProposalQueryVariables>;
|
||||||
|
export const ProposalsDocument = gql`
|
||||||
|
query Proposals {
|
||||||
|
proposals {
|
||||||
|
...ProposalFields
|
||||||
|
}
|
||||||
|
}
|
||||||
|
${ProposalFieldsFragmentDoc}`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useProposalsQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useProposalsQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useProposalsQuery` 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 } = useProposalsQuery({
|
||||||
|
* variables: {
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useProposalsQuery(baseOptions?: Apollo.QueryHookOptions<ProposalsQuery, ProposalsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<ProposalsQuery, ProposalsQueryVariables>(ProposalsDocument, options);
|
||||||
|
}
|
||||||
|
export function useProposalsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<ProposalsQuery, ProposalsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<ProposalsQuery, ProposalsQueryVariables>(ProposalsDocument, options);
|
||||||
|
}
|
||||||
|
export type ProposalsQueryHookResult = ReturnType<typeof useProposalsQuery>;
|
||||||
|
export type ProposalsLazyQueryHookResult = ReturnType<typeof useProposalsLazyQuery>;
|
||||||
|
export type ProposalsQueryResult = Apollo.QueryResult<ProposalsQuery, ProposalsQueryVariables>;
|
@ -0,0 +1,9 @@
|
|||||||
|
query VoteButtons($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
stake {
|
||||||
|
currentStakeAvailable
|
||||||
|
currentStakeAvailableFormatted @client
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -13,6 +13,9 @@ export interface VoteButtons_party_stake {
|
|||||||
* The stake currently available for the party
|
* The stake currently available for the party
|
||||||
*/
|
*/
|
||||||
currentStakeAvailable: string;
|
currentStakeAvailable: string;
|
||||||
|
/**
|
||||||
|
* The currently available stake formatted by the client
|
||||||
|
*/
|
||||||
currentStakeAvailableFormatted: string;
|
currentStakeAvailableFormatted: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,52 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type VoteButtonsQueryVariables = Types.Exact<{
|
||||||
|
partyId: Types.Scalars['ID'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type VoteButtonsQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, stake: { __typename?: 'PartyStake', currentStakeAvailable: string, currentStakeAvailableFormatted: string } } | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const VoteButtonsDocument = gql`
|
||||||
|
query VoteButtons($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
stake {
|
||||||
|
currentStakeAvailable
|
||||||
|
currentStakeAvailableFormatted @client
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useVoteButtonsQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useVoteButtonsQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useVoteButtonsQuery` 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 } = useVoteButtonsQuery({
|
||||||
|
* variables: {
|
||||||
|
* partyId: // value for 'partyId'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useVoteButtonsQuery(baseOptions: Apollo.QueryHookOptions<VoteButtonsQuery, VoteButtonsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<VoteButtonsQuery, VoteButtonsQueryVariables>(VoteButtonsDocument, options);
|
||||||
|
}
|
||||||
|
export function useVoteButtonsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<VoteButtonsQuery, VoteButtonsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<VoteButtonsQuery, VoteButtonsQueryVariables>(VoteButtonsDocument, options);
|
||||||
|
}
|
||||||
|
export type VoteButtonsQueryHookResult = ReturnType<typeof useVoteButtonsQuery>;
|
||||||
|
export type VoteButtonsLazyQueryHookResult = ReturnType<typeof useVoteButtonsLazyQuery>;
|
||||||
|
export type VoteButtonsQueryResult = Apollo.QueryResult<VoteButtonsQuery, VoteButtonsQueryVariables>;
|
6
apps/token/src/routes/home/NodeData.graphql
Normal file
6
apps/token/src/routes/home/NodeData.graphql
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
query NodeData {
|
||||||
|
nodeData {
|
||||||
|
stakedTotal
|
||||||
|
stakedTotalFormatted @client
|
||||||
|
}
|
||||||
|
}
|
@ -13,6 +13,9 @@ export interface NodeData_nodeData {
|
|||||||
* Total staked amount across all nodes
|
* Total staked amount across all nodes
|
||||||
*/
|
*/
|
||||||
stakedTotal: string;
|
stakedTotal: string;
|
||||||
|
/**
|
||||||
|
* The total staked field formatted by the client
|
||||||
|
*/
|
||||||
stakedTotalFormatted: string;
|
stakedTotalFormatted: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
46
apps/token/src/routes/home/__generated___/NodeData.ts
Normal file
46
apps/token/src/routes/home/__generated___/NodeData.ts
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type NodeDataQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type NodeDataQuery = { __typename?: 'Query', nodeData?: { __typename?: 'NodeData', stakedTotal: string, stakedTotalFormatted: string } | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const NodeDataDocument = gql`
|
||||||
|
query NodeData {
|
||||||
|
nodeData {
|
||||||
|
stakedTotal
|
||||||
|
stakedTotalFormatted @client
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useNodeDataQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useNodeDataQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useNodeDataQuery` 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 } = useNodeDataQuery({
|
||||||
|
* variables: {
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useNodeDataQuery(baseOptions?: Apollo.QueryHookOptions<NodeDataQuery, NodeDataQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<NodeDataQuery, NodeDataQueryVariables>(NodeDataDocument, options);
|
||||||
|
}
|
||||||
|
export function useNodeDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<NodeDataQuery, NodeDataQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<NodeDataQuery, NodeDataQueryVariables>(NodeDataDocument, options);
|
||||||
|
}
|
||||||
|
export type NodeDataQueryHookResult = ReturnType<typeof useNodeDataQuery>;
|
||||||
|
export type NodeDataLazyQueryHookResult = ReturnType<typeof useNodeDataLazyQuery>;
|
||||||
|
export type NodeDataQueryResult = Apollo.QueryResult<NodeDataQuery, NodeDataQueryVariables>;
|
42
apps/token/src/routes/rewards/home/Rewards.graphql
Normal file
42
apps/token/src/routes/rewards/home/Rewards.graphql
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
query Rewards($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
rewardDetails {
|
||||||
|
asset {
|
||||||
|
id
|
||||||
|
symbol
|
||||||
|
}
|
||||||
|
rewards {
|
||||||
|
rewardType
|
||||||
|
asset {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
party {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
epoch {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
amount
|
||||||
|
amountFormatted @client
|
||||||
|
percentageOfTotal
|
||||||
|
receivedAt
|
||||||
|
}
|
||||||
|
totalAmount
|
||||||
|
totalAmountFormatted @client
|
||||||
|
}
|
||||||
|
delegations {
|
||||||
|
amount
|
||||||
|
amountFormatted @client
|
||||||
|
epoch
|
||||||
|
}
|
||||||
|
}
|
||||||
|
epoch {
|
||||||
|
id
|
||||||
|
timestamps {
|
||||||
|
start
|
||||||
|
end
|
||||||
|
expiry
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,43 +0,0 @@
|
|||||||
/* tslint:disable */
|
|
||||||
/* eslint-disable */
|
|
||||||
// @generated
|
|
||||||
// This file was automatically generated and should not be edited.
|
|
||||||
|
|
||||||
// ====================================================
|
|
||||||
// GraphQL query operation: Epoch
|
|
||||||
// ====================================================
|
|
||||||
|
|
||||||
export interface Epoch_epoch_timestamps {
|
|
||||||
__typename: "EpochTimestamps";
|
|
||||||
/**
|
|
||||||
* RFC3339 timestamp - Vega time of epoch start, null if not started
|
|
||||||
*/
|
|
||||||
start: string | null;
|
|
||||||
/**
|
|
||||||
* RFC3339 timestamp - Vega time of epoch end, null if not ended
|
|
||||||
*/
|
|
||||||
end: string | null;
|
|
||||||
/**
|
|
||||||
* RFC3339 timestamp - Vega time of epoch expiry
|
|
||||||
*/
|
|
||||||
expiry: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Epoch_epoch {
|
|
||||||
__typename: "Epoch";
|
|
||||||
/**
|
|
||||||
* Presumably this is an integer or something. If there's no such thing, disregard
|
|
||||||
*/
|
|
||||||
id: string;
|
|
||||||
/**
|
|
||||||
* Timestamps for start/end etc
|
|
||||||
*/
|
|
||||||
timestamps: Epoch_epoch_timestamps;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Epoch {
|
|
||||||
/**
|
|
||||||
* get data for a specific epoch, if id omitted it gets the current epoch
|
|
||||||
*/
|
|
||||||
epoch: Epoch_epoch;
|
|
||||||
}
|
|
@ -67,6 +67,9 @@ export interface Rewards_party_rewardDetails_rewards {
|
|||||||
* Amount received for this reward
|
* Amount received for this reward
|
||||||
*/
|
*/
|
||||||
amount: string;
|
amount: string;
|
||||||
|
/**
|
||||||
|
* The amount field formatted by the client
|
||||||
|
*/
|
||||||
amountFormatted: string;
|
amountFormatted: string;
|
||||||
/**
|
/**
|
||||||
* Percentage out of the total distributed reward
|
* Percentage out of the total distributed reward
|
||||||
@ -92,6 +95,9 @@ export interface Rewards_party_rewardDetails {
|
|||||||
* The total amount of rewards received for this asset.
|
* The total amount of rewards received for this asset.
|
||||||
*/
|
*/
|
||||||
totalAmount: string;
|
totalAmount: string;
|
||||||
|
/**
|
||||||
|
* The total amount field formatted by the client
|
||||||
|
*/
|
||||||
totalAmountFormatted: string;
|
totalAmountFormatted: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,6 +107,9 @@ export interface Rewards_party_delegations {
|
|||||||
* Amount delegated
|
* Amount delegated
|
||||||
*/
|
*/
|
||||||
amount: string;
|
amount: string;
|
||||||
|
/**
|
||||||
|
* The amount field formatted by the client
|
||||||
|
*/
|
||||||
amountFormatted: string;
|
amountFormatted: string;
|
||||||
/**
|
/**
|
||||||
* Epoch of delegation
|
* Epoch of delegation
|
||||||
|
85
apps/token/src/routes/rewards/home/__generated___/Rewards.ts
Normal file
85
apps/token/src/routes/rewards/home/__generated___/Rewards.ts
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type RewardsQueryVariables = Types.Exact<{
|
||||||
|
partyId: Types.Scalars['ID'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type RewardsQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, rewardDetails?: Array<{ __typename?: 'RewardPerAssetDetail', totalAmount: string, totalAmountFormatted: string, asset: { __typename?: 'Asset', id: string, symbol: string }, rewards?: Array<{ __typename?: 'Reward', rewardType: Types.AccountType, amount: string, amountFormatted: string, percentageOfTotal: string, receivedAt: string, asset: { __typename?: 'Asset', id: string }, party: { __typename?: 'Party', id: string }, epoch: { __typename?: 'Epoch', id: string } } | null> | null } | null> | null, delegations?: Array<{ __typename?: 'Delegation', amount: string, amountFormatted: string, epoch: number }> | null } | null, epoch: { __typename?: 'Epoch', id: string, timestamps: { __typename?: 'EpochTimestamps', start?: string | null, end?: string | null, expiry?: string | null } } };
|
||||||
|
|
||||||
|
|
||||||
|
export const RewardsDocument = gql`
|
||||||
|
query Rewards($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
rewardDetails {
|
||||||
|
asset {
|
||||||
|
id
|
||||||
|
symbol
|
||||||
|
}
|
||||||
|
rewards {
|
||||||
|
rewardType
|
||||||
|
asset {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
party {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
epoch {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
amount
|
||||||
|
amountFormatted @client
|
||||||
|
percentageOfTotal
|
||||||
|
receivedAt
|
||||||
|
}
|
||||||
|
totalAmount
|
||||||
|
totalAmountFormatted @client
|
||||||
|
}
|
||||||
|
delegations {
|
||||||
|
amount
|
||||||
|
amountFormatted @client
|
||||||
|
epoch
|
||||||
|
}
|
||||||
|
}
|
||||||
|
epoch {
|
||||||
|
id
|
||||||
|
timestamps {
|
||||||
|
start
|
||||||
|
end
|
||||||
|
expiry
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useRewardsQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useRewardsQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useRewardsQuery` 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 } = useRewardsQuery({
|
||||||
|
* variables: {
|
||||||
|
* partyId: // value for 'partyId'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useRewardsQuery(baseOptions: Apollo.QueryHookOptions<RewardsQuery, RewardsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<RewardsQuery, RewardsQueryVariables>(RewardsDocument, options);
|
||||||
|
}
|
||||||
|
export function useRewardsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<RewardsQuery, RewardsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<RewardsQuery, RewardsQueryVariables>(RewardsDocument, options);
|
||||||
|
}
|
||||||
|
export type RewardsQueryHookResult = ReturnType<typeof useRewardsQuery>;
|
||||||
|
export type RewardsLazyQueryHookResult = ReturnType<typeof useRewardsLazyQuery>;
|
||||||
|
export type RewardsQueryResult = Apollo.QueryResult<RewardsQuery, RewardsQueryVariables>;
|
23
apps/token/src/routes/staking/Nodes.graphql
Normal file
23
apps/token/src/routes/staking/Nodes.graphql
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
query Nodes {
|
||||||
|
nodes {
|
||||||
|
avatarUrl
|
||||||
|
id
|
||||||
|
name
|
||||||
|
pubkey
|
||||||
|
stakedTotal
|
||||||
|
stakedTotalFormatted @client
|
||||||
|
pendingStake
|
||||||
|
pendingStakeFormatted @client
|
||||||
|
rankingScore {
|
||||||
|
rankingScore
|
||||||
|
stakeScore
|
||||||
|
performanceScore
|
||||||
|
votingPower
|
||||||
|
status
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nodeData {
|
||||||
|
stakedTotal
|
||||||
|
stakedTotalFormatted @client
|
||||||
|
}
|
||||||
|
}
|
16
apps/token/src/routes/staking/PartyDelegations.graphql
Normal file
16
apps/token/src/routes/staking/PartyDelegations.graphql
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
query PartyDelegations($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
delegations {
|
||||||
|
amount
|
||||||
|
amountFormatted @client
|
||||||
|
node {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
epoch
|
||||||
|
}
|
||||||
|
}
|
||||||
|
epoch {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
62
apps/token/src/routes/staking/Staking.graphql
Normal file
62
apps/token/src/routes/staking/Staking.graphql
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
query Staking($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
stake {
|
||||||
|
currentStakeAvailable
|
||||||
|
currentStakeAvailableFormatted @client
|
||||||
|
}
|
||||||
|
delegations {
|
||||||
|
amount
|
||||||
|
amountFormatted @client
|
||||||
|
epoch
|
||||||
|
node {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
epoch {
|
||||||
|
id
|
||||||
|
timestamps {
|
||||||
|
start
|
||||||
|
end
|
||||||
|
expiry
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nodes {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
pubkey
|
||||||
|
infoUrl
|
||||||
|
location
|
||||||
|
ethereumAddress
|
||||||
|
stakedByOperator
|
||||||
|
stakedByDelegates
|
||||||
|
stakedTotal
|
||||||
|
pendingStake
|
||||||
|
stakedByOperatorFormatted @client
|
||||||
|
stakedByDelegatesFormatted @client
|
||||||
|
stakedTotalFormatted @client
|
||||||
|
pendingStakeFormatted @client
|
||||||
|
epochData {
|
||||||
|
total
|
||||||
|
offline
|
||||||
|
online
|
||||||
|
}
|
||||||
|
status
|
||||||
|
rankingScore {
|
||||||
|
rankingScore
|
||||||
|
stakeScore
|
||||||
|
performanceScore
|
||||||
|
votingPower
|
||||||
|
stakeScore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nodeData {
|
||||||
|
stakedTotal
|
||||||
|
stakedTotalFormatted @client
|
||||||
|
totalNodes
|
||||||
|
inactiveNodes
|
||||||
|
validatingNodes
|
||||||
|
uptime
|
||||||
|
}
|
||||||
|
}
|
@ -49,11 +49,17 @@ export interface Nodes_nodes {
|
|||||||
* Total amount staked on node
|
* Total amount staked on node
|
||||||
*/
|
*/
|
||||||
stakedTotal: string;
|
stakedTotal: string;
|
||||||
|
/**
|
||||||
|
* The total staked field formatted by the client
|
||||||
|
*/
|
||||||
stakedTotalFormatted: string;
|
stakedTotalFormatted: string;
|
||||||
/**
|
/**
|
||||||
* Amount of stake on the next epoch
|
* Amount of stake on the next epoch
|
||||||
*/
|
*/
|
||||||
pendingStake: string;
|
pendingStake: string;
|
||||||
|
/**
|
||||||
|
* The pending staked field formatted by the client
|
||||||
|
*/
|
||||||
pendingStakeFormatted: string;
|
pendingStakeFormatted: string;
|
||||||
/**
|
/**
|
||||||
* Ranking scores and status for the validator for the current epoch
|
* Ranking scores and status for the validator for the current epoch
|
||||||
@ -67,6 +73,9 @@ export interface Nodes_nodeData {
|
|||||||
* Total staked amount across all nodes
|
* Total staked amount across all nodes
|
||||||
*/
|
*/
|
||||||
stakedTotal: string;
|
stakedTotal: string;
|
||||||
|
/**
|
||||||
|
* The total staked field formatted by the client
|
||||||
|
*/
|
||||||
stakedTotalFormatted: string;
|
stakedTotalFormatted: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,9 @@ export interface PartyDelegations_party_delegations {
|
|||||||
* Amount delegated
|
* Amount delegated
|
||||||
*/
|
*/
|
||||||
amount: string;
|
amount: string;
|
||||||
|
/**
|
||||||
|
* The amount field formatted by the client
|
||||||
|
*/
|
||||||
amountFormatted: string;
|
amountFormatted: string;
|
||||||
/**
|
/**
|
||||||
* URL of node you are delegating to
|
* URL of node you are delegating to
|
||||||
|
@ -15,6 +15,9 @@ export interface Staking_party_stake {
|
|||||||
* The stake currently available for the party
|
* The stake currently available for the party
|
||||||
*/
|
*/
|
||||||
currentStakeAvailable: string;
|
currentStakeAvailable: string;
|
||||||
|
/**
|
||||||
|
* The currently available stake formatted by the client
|
||||||
|
*/
|
||||||
currentStakeAvailableFormatted: string;
|
currentStakeAvailableFormatted: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,6 +35,9 @@ export interface Staking_party_delegations {
|
|||||||
* Amount delegated
|
* Amount delegated
|
||||||
*/
|
*/
|
||||||
amount: string;
|
amount: string;
|
||||||
|
/**
|
||||||
|
* The amount field formatted by the client
|
||||||
|
*/
|
||||||
amountFormatted: string;
|
amountFormatted: string;
|
||||||
/**
|
/**
|
||||||
* Epoch of delegation
|
* Epoch of delegation
|
||||||
@ -159,9 +165,21 @@ export interface Staking_nodes {
|
|||||||
* Amount of stake on the next epoch
|
* Amount of stake on the next epoch
|
||||||
*/
|
*/
|
||||||
pendingStake: string;
|
pendingStake: string;
|
||||||
|
/**
|
||||||
|
* The stakes by operator field formatted by the client
|
||||||
|
*/
|
||||||
stakedByOperatorFormatted: string;
|
stakedByOperatorFormatted: string;
|
||||||
|
/**
|
||||||
|
* The stakes by delegates field formatted by the client
|
||||||
|
*/
|
||||||
stakedByDelegatesFormatted: string;
|
stakedByDelegatesFormatted: string;
|
||||||
|
/**
|
||||||
|
* The total staked field formatted by the client
|
||||||
|
*/
|
||||||
stakedTotalFormatted: string;
|
stakedTotalFormatted: string;
|
||||||
|
/**
|
||||||
|
* The pending staked field formatted by the client
|
||||||
|
*/
|
||||||
pendingStakeFormatted: string;
|
pendingStakeFormatted: string;
|
||||||
epochData: Staking_nodes_epochData | null;
|
epochData: Staking_nodes_epochData | null;
|
||||||
status: NodeStatus;
|
status: NodeStatus;
|
||||||
@ -177,6 +195,9 @@ export interface Staking_nodeData {
|
|||||||
* Total staked amount across all nodes
|
* Total staked amount across all nodes
|
||||||
*/
|
*/
|
||||||
stakedTotal: string;
|
stakedTotal: string;
|
||||||
|
/**
|
||||||
|
* The total staked field formatted by the client
|
||||||
|
*/
|
||||||
stakedTotalFormatted: string;
|
stakedTotalFormatted: string;
|
||||||
/**
|
/**
|
||||||
* Total number of nodes
|
* Total number of nodes
|
||||||
|
63
apps/token/src/routes/staking/__generated___/Nodes.ts
Normal file
63
apps/token/src/routes/staking/__generated___/Nodes.ts
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type NodesQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type NodesQuery = { __typename?: 'Query', nodes?: Array<{ __typename?: 'Node', avatarUrl?: string | null, id: string, name: string, pubkey: string, stakedTotal: string, stakedTotalFormatted: string, pendingStake: string, pendingStakeFormatted: string, rankingScore: { __typename?: 'RankingScore', rankingScore: string, stakeScore: string, performanceScore: string, votingPower: string, status: Types.ValidatorStatus } }> | null, nodeData?: { __typename?: 'NodeData', stakedTotal: string, stakedTotalFormatted: string } | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const NodesDocument = gql`
|
||||||
|
query Nodes {
|
||||||
|
nodes {
|
||||||
|
avatarUrl
|
||||||
|
id
|
||||||
|
name
|
||||||
|
pubkey
|
||||||
|
stakedTotal
|
||||||
|
stakedTotalFormatted @client
|
||||||
|
pendingStake
|
||||||
|
pendingStakeFormatted @client
|
||||||
|
rankingScore {
|
||||||
|
rankingScore
|
||||||
|
stakeScore
|
||||||
|
performanceScore
|
||||||
|
votingPower
|
||||||
|
status
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nodeData {
|
||||||
|
stakedTotal
|
||||||
|
stakedTotalFormatted @client
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useNodesQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useNodesQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useNodesQuery` 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 } = useNodesQuery({
|
||||||
|
* variables: {
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useNodesQuery(baseOptions?: Apollo.QueryHookOptions<NodesQuery, NodesQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<NodesQuery, NodesQueryVariables>(NodesDocument, options);
|
||||||
|
}
|
||||||
|
export function useNodesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<NodesQuery, NodesQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<NodesQuery, NodesQueryVariables>(NodesDocument, options);
|
||||||
|
}
|
||||||
|
export type NodesQueryHookResult = ReturnType<typeof useNodesQuery>;
|
||||||
|
export type NodesLazyQueryHookResult = ReturnType<typeof useNodesLazyQuery>;
|
||||||
|
export type NodesQueryResult = Apollo.QueryResult<NodesQuery, NodesQueryVariables>;
|
@ -0,0 +1,59 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type PartyDelegationsQueryVariables = Types.Exact<{
|
||||||
|
partyId: Types.Scalars['ID'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type PartyDelegationsQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, delegations?: Array<{ __typename?: 'Delegation', amount: string, amountFormatted: string, epoch: number, node: { __typename?: 'Node', id: string } }> | null } | null, epoch: { __typename?: 'Epoch', id: string } };
|
||||||
|
|
||||||
|
|
||||||
|
export const PartyDelegationsDocument = gql`
|
||||||
|
query PartyDelegations($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
delegations {
|
||||||
|
amount
|
||||||
|
amountFormatted @client
|
||||||
|
node {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
epoch
|
||||||
|
}
|
||||||
|
}
|
||||||
|
epoch {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __usePartyDelegationsQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `usePartyDelegationsQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `usePartyDelegationsQuery` 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 } = usePartyDelegationsQuery({
|
||||||
|
* variables: {
|
||||||
|
* partyId: // value for 'partyId'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function usePartyDelegationsQuery(baseOptions: Apollo.QueryHookOptions<PartyDelegationsQuery, PartyDelegationsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<PartyDelegationsQuery, PartyDelegationsQueryVariables>(PartyDelegationsDocument, options);
|
||||||
|
}
|
||||||
|
export function usePartyDelegationsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<PartyDelegationsQuery, PartyDelegationsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<PartyDelegationsQuery, PartyDelegationsQueryVariables>(PartyDelegationsDocument, options);
|
||||||
|
}
|
||||||
|
export type PartyDelegationsQueryHookResult = ReturnType<typeof usePartyDelegationsQuery>;
|
||||||
|
export type PartyDelegationsLazyQueryHookResult = ReturnType<typeof usePartyDelegationsLazyQuery>;
|
||||||
|
export type PartyDelegationsQueryResult = Apollo.QueryResult<PartyDelegationsQuery, PartyDelegationsQueryVariables>;
|
105
apps/token/src/routes/staking/__generated___/Staking.ts
Normal file
105
apps/token/src/routes/staking/__generated___/Staking.ts
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type StakingQueryVariables = Types.Exact<{
|
||||||
|
partyId: Types.Scalars['ID'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type StakingQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, stake: { __typename?: 'PartyStake', currentStakeAvailable: string, currentStakeAvailableFormatted: string }, delegations?: Array<{ __typename?: 'Delegation', amount: string, amountFormatted: string, epoch: number, node: { __typename?: 'Node', id: string } }> | null } | null, epoch: { __typename?: 'Epoch', id: string, timestamps: { __typename?: 'EpochTimestamps', start?: string | null, end?: string | null, expiry?: string | null } }, nodes?: Array<{ __typename?: 'Node', id: string, name: string, pubkey: string, infoUrl: string, location: string, ethereumAddress: string, stakedByOperator: string, stakedByDelegates: string, stakedTotal: string, pendingStake: string, stakedByOperatorFormatted: string, stakedByDelegatesFormatted: string, stakedTotalFormatted: string, pendingStakeFormatted: string, status: Types.NodeStatus, epochData?: { __typename?: 'EpochData', total: number, offline: number, online: number } | null, rankingScore: { __typename?: 'RankingScore', rankingScore: string, stakeScore: string, performanceScore: string, votingPower: string } }> | null, nodeData?: { __typename?: 'NodeData', stakedTotal: string, stakedTotalFormatted: string, totalNodes: number, inactiveNodes: number, validatingNodes: number, uptime: number } | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const StakingDocument = gql`
|
||||||
|
query Staking($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
stake {
|
||||||
|
currentStakeAvailable
|
||||||
|
currentStakeAvailableFormatted @client
|
||||||
|
}
|
||||||
|
delegations {
|
||||||
|
amount
|
||||||
|
amountFormatted @client
|
||||||
|
epoch
|
||||||
|
node {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
epoch {
|
||||||
|
id
|
||||||
|
timestamps {
|
||||||
|
start
|
||||||
|
end
|
||||||
|
expiry
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nodes {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
pubkey
|
||||||
|
infoUrl
|
||||||
|
location
|
||||||
|
ethereumAddress
|
||||||
|
stakedByOperator
|
||||||
|
stakedByDelegates
|
||||||
|
stakedTotal
|
||||||
|
pendingStake
|
||||||
|
stakedByOperatorFormatted @client
|
||||||
|
stakedByDelegatesFormatted @client
|
||||||
|
stakedTotalFormatted @client
|
||||||
|
pendingStakeFormatted @client
|
||||||
|
epochData {
|
||||||
|
total
|
||||||
|
offline
|
||||||
|
online
|
||||||
|
}
|
||||||
|
status
|
||||||
|
rankingScore {
|
||||||
|
rankingScore
|
||||||
|
stakeScore
|
||||||
|
performanceScore
|
||||||
|
votingPower
|
||||||
|
stakeScore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nodeData {
|
||||||
|
stakedTotal
|
||||||
|
stakedTotalFormatted @client
|
||||||
|
totalNodes
|
||||||
|
inactiveNodes
|
||||||
|
validatingNodes
|
||||||
|
uptime
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useStakingQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useStakingQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useStakingQuery` 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 } = useStakingQuery({
|
||||||
|
* variables: {
|
||||||
|
* partyId: // value for 'partyId'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useStakingQuery(baseOptions: Apollo.QueryHookOptions<StakingQuery, StakingQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<StakingQuery, StakingQueryVariables>(StakingDocument, options);
|
||||||
|
}
|
||||||
|
export function useStakingLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<StakingQuery, StakingQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<StakingQuery, StakingQueryVariables>(StakingDocument, options);
|
||||||
|
}
|
||||||
|
export type StakingQueryHookResult = ReturnType<typeof useStakingQuery>;
|
||||||
|
export type StakingLazyQueryHookResult = ReturnType<typeof useStakingLazyQuery>;
|
||||||
|
export type StakingQueryResult = Apollo.QueryResult<StakingQuery, StakingQueryVariables>;
|
@ -0,0 +1,12 @@
|
|||||||
|
query PartyStakeLinkings($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
stake {
|
||||||
|
linkings {
|
||||||
|
id
|
||||||
|
txHash
|
||||||
|
status
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type PartyStakeLinkingsQueryVariables = Types.Exact<{
|
||||||
|
partyId: Types.Scalars['ID'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type PartyStakeLinkingsQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, stake: { __typename?: 'PartyStake', linkings?: Array<{ __typename?: 'StakeLinking', id: string, txHash: string, status: Types.StakeLinkingStatus }> | null } } | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const PartyStakeLinkingsDocument = gql`
|
||||||
|
query PartyStakeLinkings($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
stake {
|
||||||
|
linkings {
|
||||||
|
id
|
||||||
|
txHash
|
||||||
|
status
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __usePartyStakeLinkingsQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `usePartyStakeLinkingsQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `usePartyStakeLinkingsQuery` 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 } = usePartyStakeLinkingsQuery({
|
||||||
|
* variables: {
|
||||||
|
* partyId: // value for 'partyId'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function usePartyStakeLinkingsQuery(baseOptions: Apollo.QueryHookOptions<PartyStakeLinkingsQuery, PartyStakeLinkingsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<PartyStakeLinkingsQuery, PartyStakeLinkingsQueryVariables>(PartyStakeLinkingsDocument, options);
|
||||||
|
}
|
||||||
|
export function usePartyStakeLinkingsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<PartyStakeLinkingsQuery, PartyStakeLinkingsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<PartyStakeLinkingsQuery, PartyStakeLinkingsQueryVariables>(PartyStakeLinkingsDocument, options);
|
||||||
|
}
|
||||||
|
export type PartyStakeLinkingsQueryHookResult = ReturnType<typeof usePartyStakeLinkingsQuery>;
|
||||||
|
export type PartyStakeLinkingsLazyQueryHookResult = ReturnType<typeof usePartyStakeLinkingsLazyQuery>;
|
||||||
|
export type PartyStakeLinkingsQueryResult = Apollo.QueryResult<PartyStakeLinkingsQuery, PartyStakeLinkingsQueryVariables>;
|
@ -5,7 +5,7 @@
|
|||||||
"next",
|
"next",
|
||||||
"next/core-web-vitals"
|
"next/core-web-vitals"
|
||||||
],
|
],
|
||||||
"ignorePatterns": ["!**/*", "__generated__"],
|
"ignorePatterns": ["!**/*", "__generated__", "__generated___"],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||||
|
59
apps/trading/pages/markets/Market.graphql
Normal file
59
apps/trading/pages/markets/Market.graphql
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
query Market($marketId: ID!, $interval: Interval!, $since: String!) {
|
||||||
|
market(id: $marketId) {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
tradingMode
|
||||||
|
state
|
||||||
|
decimalPlaces
|
||||||
|
positionDecimalPlaces
|
||||||
|
data {
|
||||||
|
market {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
auctionStart
|
||||||
|
auctionEnd
|
||||||
|
markPrice
|
||||||
|
indicativeVolume
|
||||||
|
indicativePrice
|
||||||
|
suppliedStake
|
||||||
|
targetStake
|
||||||
|
bestBidVolume
|
||||||
|
bestOfferVolume
|
||||||
|
bestStaticBidVolume
|
||||||
|
bestStaticOfferVolume
|
||||||
|
trigger
|
||||||
|
}
|
||||||
|
tradableInstrument {
|
||||||
|
instrument {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
code
|
||||||
|
metadata {
|
||||||
|
tags
|
||||||
|
}
|
||||||
|
product {
|
||||||
|
... on Future {
|
||||||
|
oracleSpecForTradingTermination {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
quoteName
|
||||||
|
settlementAsset {
|
||||||
|
id
|
||||||
|
symbol
|
||||||
|
name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
marketTimestamps {
|
||||||
|
open
|
||||||
|
close
|
||||||
|
}
|
||||||
|
candles(interval: $interval, since: $since) {
|
||||||
|
open
|
||||||
|
close
|
||||||
|
volume
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
106
apps/trading/pages/markets/__generated___/Market.ts
Normal file
106
apps/trading/pages/markets/__generated___/Market.ts
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type MarketQueryVariables = Types.Exact<{
|
||||||
|
marketId: Types.Scalars['ID'];
|
||||||
|
interval: Types.Interval;
|
||||||
|
since: Types.Scalars['String'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type MarketQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, name: string, tradingMode: Types.MarketTradingMode, state: Types.MarketState, decimalPlaces: number, positionDecimalPlaces: number, data?: { __typename?: 'MarketData', auctionStart?: string | null, auctionEnd?: string | null, markPrice: string, indicativeVolume: string, indicativePrice: string, suppliedStake?: string | null, targetStake?: string | null, bestBidVolume: string, bestOfferVolume: string, bestStaticBidVolume: string, bestStaticOfferVolume: string, trigger: Types.AuctionTrigger, market: { __typename?: 'Market', id: string } } | null, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', id: string, name: string, code: string, metadata: { __typename?: 'InstrumentMetadata', tags?: Array<string> | null }, product: { __typename?: 'Future', quoteName: string, oracleSpecForTradingTermination: { __typename?: 'OracleSpec', id: string }, settlementAsset: { __typename?: 'Asset', id: string, symbol: string, name: string } } } }, marketTimestamps: { __typename?: 'MarketTimestamps', open?: string | null, close?: string | null }, candles?: Array<{ __typename?: 'Candle', open: string, close: string, volume: string } | null> | null } | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const MarketDocument = gql`
|
||||||
|
query Market($marketId: ID!, $interval: Interval!, $since: String!) {
|
||||||
|
market(id: $marketId) {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
tradingMode
|
||||||
|
state
|
||||||
|
decimalPlaces
|
||||||
|
positionDecimalPlaces
|
||||||
|
data {
|
||||||
|
market {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
auctionStart
|
||||||
|
auctionEnd
|
||||||
|
markPrice
|
||||||
|
indicativeVolume
|
||||||
|
indicativePrice
|
||||||
|
suppliedStake
|
||||||
|
targetStake
|
||||||
|
bestBidVolume
|
||||||
|
bestOfferVolume
|
||||||
|
bestStaticBidVolume
|
||||||
|
bestStaticOfferVolume
|
||||||
|
trigger
|
||||||
|
}
|
||||||
|
tradableInstrument {
|
||||||
|
instrument {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
code
|
||||||
|
metadata {
|
||||||
|
tags
|
||||||
|
}
|
||||||
|
product {
|
||||||
|
... on Future {
|
||||||
|
oracleSpecForTradingTermination {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
quoteName
|
||||||
|
settlementAsset {
|
||||||
|
id
|
||||||
|
symbol
|
||||||
|
name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
marketTimestamps {
|
||||||
|
open
|
||||||
|
close
|
||||||
|
}
|
||||||
|
candles(interval: $interval, since: $since) {
|
||||||
|
open
|
||||||
|
close
|
||||||
|
volume
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useMarketQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useMarketQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useMarketQuery` 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 } = useMarketQuery({
|
||||||
|
* variables: {
|
||||||
|
* marketId: // value for 'marketId'
|
||||||
|
* interval: // value for 'interval'
|
||||||
|
* since: // value for 'since'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useMarketQuery(baseOptions: Apollo.QueryHookOptions<MarketQuery, MarketQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<MarketQuery, MarketQueryVariables>(MarketDocument, options);
|
||||||
|
}
|
||||||
|
export function useMarketLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<MarketQuery, MarketQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<MarketQuery, MarketQueryVariables>(MarketDocument, options);
|
||||||
|
}
|
||||||
|
export type MarketQueryHookResult = ReturnType<typeof useMarketQuery>;
|
||||||
|
export type MarketLazyQueryHookResult = ReturnType<typeof useMarketLazyQuery>;
|
||||||
|
export type MarketQueryResult = Apollo.QueryResult<MarketQuery, MarketQueryVariables>;
|
17
apps/trading/pages/portfolio/deposit/Deposit.graphql
Normal file
17
apps/trading/pages/portfolio/deposit/Deposit.graphql
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
query DepositPage {
|
||||||
|
assetsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
id
|
||||||
|
symbol
|
||||||
|
name
|
||||||
|
decimals
|
||||||
|
source {
|
||||||
|
... on ERC20 {
|
||||||
|
contractAddress
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type DepositPageQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type DepositPageQuery = { __typename?: 'Query', assetsConnection: { __typename?: 'AssetsConnection', edges?: Array<{ __typename?: 'AssetEdge', node: { __typename?: 'Asset', id: string, symbol: string, name: string, decimals: number, source: { __typename?: 'BuiltinAsset' } | { __typename?: 'ERC20', contractAddress: string } } } | null> | null } };
|
||||||
|
|
||||||
|
|
||||||
|
export const DepositPageDocument = gql`
|
||||||
|
query DepositPage {
|
||||||
|
assetsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
id
|
||||||
|
symbol
|
||||||
|
name
|
||||||
|
decimals
|
||||||
|
source {
|
||||||
|
... on ERC20 {
|
||||||
|
contractAddress
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useDepositPageQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useDepositPageQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useDepositPageQuery` 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 } = useDepositPageQuery({
|
||||||
|
* variables: {
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useDepositPageQuery(baseOptions?: Apollo.QueryHookOptions<DepositPageQuery, DepositPageQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<DepositPageQuery, DepositPageQueryVariables>(DepositPageDocument, options);
|
||||||
|
}
|
||||||
|
export function useDepositPageLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<DepositPageQuery, DepositPageQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<DepositPageQuery, DepositPageQueryVariables>(DepositPageDocument, options);
|
||||||
|
}
|
||||||
|
export type DepositPageQueryHookResult = ReturnType<typeof useDepositPageQuery>;
|
||||||
|
export type DepositPageLazyQueryHookResult = ReturnType<typeof useDepositPageLazyQuery>;
|
||||||
|
export type DepositPageQueryResult = Apollo.QueryResult<DepositPageQuery, DepositPageQueryVariables>;
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
||||||
"ignorePatterns": ["!**/*", "__generated__"],
|
"ignorePatterns": ["!**/*", "__generated__", "__generated___"],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||||
|
34
libs/accounts/src/lib/Accounts.graphql
Normal file
34
libs/accounts/src/lib/Accounts.graphql
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
fragment AccountFields on Account {
|
||||||
|
type
|
||||||
|
balance
|
||||||
|
market {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
}
|
||||||
|
asset {
|
||||||
|
id
|
||||||
|
symbol
|
||||||
|
decimals
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query Accounts($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
accountsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
type
|
||||||
|
balance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
subscription AccountSubscribe($partyId: ID!) {
|
||||||
|
accounts(partyId: $partyId) {
|
||||||
|
type
|
||||||
|
balance
|
||||||
|
}
|
||||||
|
}
|
3
libs/accounts/src/lib/__generated__/index.ts
generated
3
libs/accounts/src/lib/__generated__/index.ts
generated
@ -1,3 +0,0 @@
|
|||||||
export * from './AccountFields';
|
|
||||||
export * from './AccountSubscribe';
|
|
||||||
export * from './Accounts';
|
|
110
libs/accounts/src/lib/__generated___/Accounts.ts
Normal file
110
libs/accounts/src/lib/__generated___/Accounts.ts
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/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, name: string } | null, asset: { __typename?: 'Asset', id: string, symbol: string, decimals: number } };
|
||||||
|
|
||||||
|
export type AccountsQueryVariables = Types.Exact<{
|
||||||
|
partyId: Types.Scalars['ID'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type AccountsQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, accountsConnection: { __typename?: 'AccountsConnection', edges?: Array<{ __typename?: 'AccountEdge', node: { __typename?: 'Account', type: Types.AccountType, balance: string } } | null> | null } } | null };
|
||||||
|
|
||||||
|
export type AccountSubscribeSubscriptionVariables = Types.Exact<{
|
||||||
|
partyId: Types.Scalars['ID'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type AccountSubscribeSubscription = { __typename?: 'Subscription', accounts: { __typename?: 'Account', type: Types.AccountType, balance: string } };
|
||||||
|
|
||||||
|
export const AccountFieldsFragmentDoc = gql`
|
||||||
|
fragment AccountFields on Account {
|
||||||
|
type
|
||||||
|
balance
|
||||||
|
market {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
}
|
||||||
|
asset {
|
||||||
|
id
|
||||||
|
symbol
|
||||||
|
decimals
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
export const AccountsDocument = gql`
|
||||||
|
query Accounts($partyId: ID!) {
|
||||||
|
party(id: $partyId) {
|
||||||
|
id
|
||||||
|
accountsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
type
|
||||||
|
balance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __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 AccountSubscribeDocument = gql`
|
||||||
|
subscription AccountSubscribe($partyId: ID!) {
|
||||||
|
accounts(partyId: $partyId) {
|
||||||
|
type
|
||||||
|
balance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useAccountSubscribeSubscription__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useAccountSubscribeSubscription` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useAccountSubscribeSubscription` 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 } = useAccountSubscribeSubscription({
|
||||||
|
* variables: {
|
||||||
|
* partyId: // value for 'partyId'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useAccountSubscribeSubscription(baseOptions: Apollo.SubscriptionHookOptions<AccountSubscribeSubscription, AccountSubscribeSubscriptionVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useSubscription<AccountSubscribeSubscription, AccountSubscribeSubscriptionVariables>(AccountSubscribeDocument, options);
|
||||||
|
}
|
||||||
|
export type AccountSubscribeSubscriptionHookResult = ReturnType<typeof useAccountSubscribeSubscription>;
|
||||||
|
export type AccountSubscribeSubscriptionResult = Apollo.SubscriptionResult<AccountSubscribeSubscription>;
|
@ -1,4 +1,6 @@
|
|||||||
export * from './__generated__';
|
export * from './__generated__/Accounts';
|
||||||
|
export * from './__generated__/AccountFields';
|
||||||
|
export * from './__generated__/AccountSubscribe';
|
||||||
export * from './accounts-container';
|
export * from './accounts-container';
|
||||||
export * from './accounts-data-provider';
|
export * from './accounts-data-provider';
|
||||||
export * from './accounts-manager';
|
export * from './accounts-manager';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
||||||
"ignorePatterns": ["!**/*", "__generated__"],
|
"ignorePatterns": ["!**/*", "__generated__", "__generated___"],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||||
|
20
libs/assets/src/lib/Assets.graphql
Normal file
20
libs/assets/src/lib/Assets.graphql
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
query AssetsConnection {
|
||||||
|
assetsConnection {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
symbol
|
||||||
|
decimals
|
||||||
|
quantum
|
||||||
|
source {
|
||||||
|
... on ERC20 {
|
||||||
|
contractAddress
|
||||||
|
lifetimeLimit
|
||||||
|
withdrawThreshold
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
60
libs/assets/src/lib/__generated___/Assets.ts
Normal file
60
libs/assets/src/lib/__generated___/Assets.ts
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/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 } };
|
||||||
|
|
||||||
|
|
||||||
|
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 +1,2 @@
|
|||||||
|
export * from './__generated__/AssetsConnection';
|
||||||
export * from './asset-details-dialog';
|
export * from './asset-details-dialog';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
||||||
"ignorePatterns": ["!**/*", "__generated__"],
|
"ignorePatterns": ["!**/*", "__generated__", "__generated___"],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||||
|
31
libs/candles-chart/src/lib/Candles.graphql
Normal file
31
libs/candles-chart/src/lib/Candles.graphql
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
fragment CandleFields on Candle {
|
||||||
|
datetime
|
||||||
|
high
|
||||||
|
low
|
||||||
|
open
|
||||||
|
close
|
||||||
|
volume
|
||||||
|
}
|
||||||
|
|
||||||
|
query Candles($marketId: ID!, $interval: Interval!, $since: String!) {
|
||||||
|
market(id: $marketId) {
|
||||||
|
id
|
||||||
|
decimalPlaces
|
||||||
|
tradableInstrument {
|
||||||
|
instrument {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
code
|
||||||
|
}
|
||||||
|
}
|
||||||
|
candles(interval: $interval, since: $since) {
|
||||||
|
...CandleFields
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
subscription CandlesSub($marketId: ID!, $interval: Interval!) {
|
||||||
|
candles(marketId: $marketId, interval: $interval) {
|
||||||
|
...CandleFields
|
||||||
|
}
|
||||||
|
}
|
12
libs/candles-chart/src/lib/Chart.graphql
Normal file
12
libs/candles-chart/src/lib/Chart.graphql
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
query Chart($marketId: ID!) {
|
||||||
|
market(id: $marketId) {
|
||||||
|
decimalPlaces
|
||||||
|
data {
|
||||||
|
priceMonitoringBounds {
|
||||||
|
minValidPrice
|
||||||
|
maxValidPrice
|
||||||
|
referencePrice
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +0,0 @@
|
|||||||
export * from './CandleFields';
|
|
||||||
export * from './Candles';
|
|
||||||
export * from './CandlesSub';
|
|
||||||
export * from './Chart';
|
|
113
libs/candles-chart/src/lib/__generated___/Candles.ts
Normal file
113
libs/candles-chart/src/lib/__generated___/Candles.ts
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type CandleFieldsFragment = { __typename?: 'Candle', datetime: 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 } }, candles?: Array<{ __typename?: 'Candle', datetime: string, high: string, low: string, open: string, close: string, volume: string } | null> | null } | null };
|
||||||
|
|
||||||
|
export type CandlesSubSubscriptionVariables = Types.Exact<{
|
||||||
|
marketId: Types.Scalars['ID'];
|
||||||
|
interval: Types.Interval;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type CandlesSubSubscription = { __typename?: 'Subscription', candles: { __typename?: 'Candle', datetime: string, high: string, low: string, open: string, close: string, volume: string } };
|
||||||
|
|
||||||
|
export const CandleFieldsFragmentDoc = gql`
|
||||||
|
fragment CandleFields on Candle {
|
||||||
|
datetime
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
candles(interval: $interval, since: $since) {
|
||||||
|
...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 CandlesSubDocument = gql`
|
||||||
|
subscription CandlesSub($marketId: ID!, $interval: Interval!) {
|
||||||
|
candles(marketId: $marketId, interval: $interval) {
|
||||||
|
...CandleFields
|
||||||
|
}
|
||||||
|
}
|
||||||
|
${CandleFieldsFragmentDoc}`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useCandlesSubSubscription__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useCandlesSubSubscription` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useCandlesSubSubscription` 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 } = useCandlesSubSubscription({
|
||||||
|
* variables: {
|
||||||
|
* marketId: // value for 'marketId'
|
||||||
|
* interval: // value for 'interval'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useCandlesSubSubscription(baseOptions: Apollo.SubscriptionHookOptions<CandlesSubSubscription, CandlesSubSubscriptionVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useSubscription<CandlesSubSubscription, CandlesSubSubscriptionVariables>(CandlesSubDocument, options);
|
||||||
|
}
|
||||||
|
export type CandlesSubSubscriptionHookResult = ReturnType<typeof useCandlesSubSubscription>;
|
||||||
|
export type CandlesSubSubscriptionResult = Apollo.SubscriptionResult<CandlesSubSubscription>;
|
55
libs/candles-chart/src/lib/__generated___/Chart.ts
Normal file
55
libs/candles-chart/src/lib/__generated___/Chart.ts
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/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>;
|
@ -1,3 +1,6 @@
|
|||||||
export * from './__generated__';
|
export * from './__generated__/CandleFields';
|
||||||
|
export * from './__generated__/Candles';
|
||||||
|
export * from './__generated__/CandlesSub';
|
||||||
|
export * from './__generated__/Chart';
|
||||||
export * from './candles-chart';
|
export * from './candles-chart';
|
||||||
export * from './data-source';
|
export * from './data-source';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
|
||||||
"ignorePatterns": ["!**/*", "__generated__"],
|
"ignorePatterns": ["!**/*", "__generated__", "__generated___"],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||||
|
30
libs/deal-ticket/src/components/DealTicket.graphql
Normal file
30
libs/deal-ticket/src/components/DealTicket.graphql
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
query DealTicketQuery($marketId: ID!) {
|
||||||
|
market(id: $marketId) {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
decimalPlaces
|
||||||
|
positionDecimalPlaces
|
||||||
|
state
|
||||||
|
tradingMode
|
||||||
|
tradableInstrument {
|
||||||
|
instrument {
|
||||||
|
id
|
||||||
|
product {
|
||||||
|
... on Future {
|
||||||
|
quoteName
|
||||||
|
settlementAsset {
|
||||||
|
id
|
||||||
|
symbol
|
||||||
|
name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
depth {
|
||||||
|
lastTrade {
|
||||||
|
price
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
139
libs/deal-ticket/src/components/MarketInfo.graphql
Normal file
139
libs/deal-ticket/src/components/MarketInfo.graphql
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
query MarketInfoQuery($marketId: ID!, $interval: Interval!, $since: String!) {
|
||||||
|
market(id: $marketId) {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
decimalPlaces
|
||||||
|
positionDecimalPlaces
|
||||||
|
state
|
||||||
|
accounts {
|
||||||
|
type
|
||||||
|
asset {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
balance
|
||||||
|
}
|
||||||
|
tradingMode
|
||||||
|
accounts {
|
||||||
|
type
|
||||||
|
asset {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
balance
|
||||||
|
}
|
||||||
|
fees {
|
||||||
|
factors {
|
||||||
|
makerFee
|
||||||
|
infrastructureFee
|
||||||
|
liquidityFee
|
||||||
|
}
|
||||||
|
}
|
||||||
|
priceMonitoringSettings {
|
||||||
|
parameters {
|
||||||
|
triggers {
|
||||||
|
horizonSecs
|
||||||
|
probability
|
||||||
|
auctionExtensionSecs
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
riskFactors {
|
||||||
|
market
|
||||||
|
short
|
||||||
|
long
|
||||||
|
}
|
||||||
|
accounts {
|
||||||
|
type
|
||||||
|
asset {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
balance
|
||||||
|
}
|
||||||
|
data {
|
||||||
|
market {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
markPrice
|
||||||
|
indicativeVolume
|
||||||
|
bestBidVolume
|
||||||
|
bestOfferVolume
|
||||||
|
bestStaticBidVolume
|
||||||
|
bestStaticOfferVolume
|
||||||
|
openInterest
|
||||||
|
bestBidPrice
|
||||||
|
bestOfferPrice
|
||||||
|
trigger
|
||||||
|
priceMonitoringBounds {
|
||||||
|
minValidPrice
|
||||||
|
maxValidPrice
|
||||||
|
trigger {
|
||||||
|
horizonSecs
|
||||||
|
probability
|
||||||
|
auctionExtensionSecs
|
||||||
|
}
|
||||||
|
referencePrice
|
||||||
|
}
|
||||||
|
}
|
||||||
|
liquidityMonitoringParameters {
|
||||||
|
triggeringRatio
|
||||||
|
targetStakeParameters {
|
||||||
|
timeWindow
|
||||||
|
scalingFactor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
candles(interval: $interval, since: $since) {
|
||||||
|
volume
|
||||||
|
}
|
||||||
|
tradableInstrument {
|
||||||
|
instrument {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
code
|
||||||
|
metadata {
|
||||||
|
tags
|
||||||
|
}
|
||||||
|
product {
|
||||||
|
... on Future {
|
||||||
|
quoteName
|
||||||
|
settlementAsset {
|
||||||
|
id
|
||||||
|
symbol
|
||||||
|
name
|
||||||
|
}
|
||||||
|
oracleSpecForSettlementPrice {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
oracleSpecForTradingTermination {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
oracleSpecBinding {
|
||||||
|
settlementPriceProperty
|
||||||
|
tradingTerminationProperty
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
riskModel {
|
||||||
|
... on LogNormalRiskModel {
|
||||||
|
tau
|
||||||
|
riskAversionParameter
|
||||||
|
params {
|
||||||
|
r
|
||||||
|
sigma
|
||||||
|
mu
|
||||||
|
}
|
||||||
|
}
|
||||||
|
... on SimpleRiskModel {
|
||||||
|
params {
|
||||||
|
factorLong
|
||||||
|
factorShort
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
depth {
|
||||||
|
lastTrade {
|
||||||
|
price
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
20
libs/deal-ticket/src/components/MarketNames.graphql
Normal file
20
libs/deal-ticket/src/components/MarketNames.graphql
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
query MarketNames {
|
||||||
|
markets {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
state
|
||||||
|
tradableInstrument {
|
||||||
|
instrument {
|
||||||
|
code
|
||||||
|
metadata {
|
||||||
|
tags
|
||||||
|
}
|
||||||
|
product {
|
||||||
|
... on Future {
|
||||||
|
quoteName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +0,0 @@
|
|||||||
export * from './DealTicketQuery';
|
|
||||||
export * from './MarketInfoQuery';
|
|
||||||
export * from './MarketNames';
|
|
73
libs/deal-ticket/src/components/__generated___/DealTicket.ts
Normal file
73
libs/deal-ticket/src/components/__generated___/DealTicket.ts
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type DealTicketQueryQueryVariables = Types.Exact<{
|
||||||
|
marketId: Types.Scalars['ID'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type DealTicketQueryQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, name: string, decimalPlaces: number, positionDecimalPlaces: number, state: Types.MarketState, tradingMode: Types.MarketTradingMode, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', id: 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 const DealTicketQueryDocument = gql`
|
||||||
|
query DealTicketQuery($marketId: ID!) {
|
||||||
|
market(id: $marketId) {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
decimalPlaces
|
||||||
|
positionDecimalPlaces
|
||||||
|
state
|
||||||
|
tradingMode
|
||||||
|
tradableInstrument {
|
||||||
|
instrument {
|
||||||
|
id
|
||||||
|
product {
|
||||||
|
... on Future {
|
||||||
|
quoteName
|
||||||
|
settlementAsset {
|
||||||
|
id
|
||||||
|
symbol
|
||||||
|
name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
depth {
|
||||||
|
lastTrade {
|
||||||
|
price
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useDealTicketQueryQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useDealTicketQueryQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useDealTicketQueryQuery` 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 } = useDealTicketQueryQuery({
|
||||||
|
* variables: {
|
||||||
|
* marketId: // value for 'marketId'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useDealTicketQueryQuery(baseOptions: Apollo.QueryHookOptions<DealTicketQueryQuery, DealTicketQueryQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<DealTicketQueryQuery, DealTicketQueryQueryVariables>(DealTicketQueryDocument, options);
|
||||||
|
}
|
||||||
|
export function useDealTicketQueryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<DealTicketQueryQuery, DealTicketQueryQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<DealTicketQueryQuery, DealTicketQueryQueryVariables>(DealTicketQueryDocument, options);
|
||||||
|
}
|
||||||
|
export type DealTicketQueryQueryHookResult = ReturnType<typeof useDealTicketQueryQuery>;
|
||||||
|
export type DealTicketQueryLazyQueryHookResult = ReturnType<typeof useDealTicketQueryLazyQuery>;
|
||||||
|
export type DealTicketQueryQueryResult = Apollo.QueryResult<DealTicketQueryQuery, DealTicketQueryQueryVariables>;
|
186
libs/deal-ticket/src/components/__generated___/MarketInfo.ts
Normal file
186
libs/deal-ticket/src/components/__generated___/MarketInfo.ts
Normal file
@ -0,0 +1,186 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type MarketInfoQueryQueryVariables = Types.Exact<{
|
||||||
|
marketId: Types.Scalars['ID'];
|
||||||
|
interval: Types.Interval;
|
||||||
|
since: Types.Scalars['String'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type MarketInfoQueryQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, name: string, decimalPlaces: number, positionDecimalPlaces: number, state: Types.MarketState, tradingMode: Types.MarketTradingMode, accounts?: Array<{ __typename?: 'Account', type: Types.AccountType, balance: string, asset: { __typename?: 'Asset', id: string } }> | null, fees: { __typename?: 'Fees', factors: { __typename?: 'FeeFactors', makerFee: string, infrastructureFee: string, liquidityFee: string } }, priceMonitoringSettings: { __typename?: 'PriceMonitoringSettings', parameters?: { __typename?: 'PriceMonitoringParameters', triggers?: Array<{ __typename?: 'PriceMonitoringTrigger', horizonSecs: number, probability: number, auctionExtensionSecs: number }> | null } | null }, riskFactors?: { __typename?: 'RiskFactor', market: string, short: string, long: string } | null, data?: { __typename?: 'MarketData', markPrice: string, indicativeVolume: string, bestBidVolume: string, bestOfferVolume: string, bestStaticBidVolume: string, bestStaticOfferVolume: string, openInterest: string, bestBidPrice: string, bestOfferPrice: string, trigger: Types.AuctionTrigger, market: { __typename?: 'Market', id: string }, priceMonitoringBounds?: Array<{ __typename?: 'PriceMonitoringBounds', minValidPrice: string, maxValidPrice: string, referencePrice: string, trigger: { __typename?: 'PriceMonitoringTrigger', horizonSecs: number, probability: number, auctionExtensionSecs: number } }> | null } | null, liquidityMonitoringParameters: { __typename?: 'LiquidityMonitoringParameters', triggeringRatio: number, targetStakeParameters: { __typename?: 'TargetStakeParameters', timeWindow: number, scalingFactor: number } }, candles?: Array<{ __typename?: 'Candle', volume: string } | null> | null, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', id: string, name: string, code: string, metadata: { __typename?: 'InstrumentMetadata', tags?: Array<string> | null }, product: { __typename?: 'Future', quoteName: string, settlementAsset: { __typename?: 'Asset', id: string, symbol: string, name: string }, oracleSpecForSettlementPrice: { __typename?: 'OracleSpec', id: string }, oracleSpecForTradingTermination: { __typename?: 'OracleSpec', id: string }, oracleSpecBinding: { __typename?: 'OracleSpecToFutureBinding', settlementPriceProperty: string, tradingTerminationProperty: string } } }, riskModel: { __typename?: 'LogNormalRiskModel', tau: number, riskAversionParameter: number, params: { __typename?: 'LogNormalModelParams', r: number, sigma: number, mu: number } } | { __typename?: 'SimpleRiskModel', params: { __typename?: 'SimpleRiskModelParams', factorLong: number, factorShort: number } } }, depth: { __typename?: 'MarketDepth', lastTrade?: { __typename?: 'Trade', price: string } | null } } | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const MarketInfoQueryDocument = gql`
|
||||||
|
query MarketInfoQuery($marketId: ID!, $interval: Interval!, $since: String!) {
|
||||||
|
market(id: $marketId) {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
decimalPlaces
|
||||||
|
positionDecimalPlaces
|
||||||
|
state
|
||||||
|
accounts {
|
||||||
|
type
|
||||||
|
asset {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
balance
|
||||||
|
}
|
||||||
|
tradingMode
|
||||||
|
accounts {
|
||||||
|
type
|
||||||
|
asset {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
balance
|
||||||
|
}
|
||||||
|
fees {
|
||||||
|
factors {
|
||||||
|
makerFee
|
||||||
|
infrastructureFee
|
||||||
|
liquidityFee
|
||||||
|
}
|
||||||
|
}
|
||||||
|
priceMonitoringSettings {
|
||||||
|
parameters {
|
||||||
|
triggers {
|
||||||
|
horizonSecs
|
||||||
|
probability
|
||||||
|
auctionExtensionSecs
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
riskFactors {
|
||||||
|
market
|
||||||
|
short
|
||||||
|
long
|
||||||
|
}
|
||||||
|
accounts {
|
||||||
|
type
|
||||||
|
asset {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
balance
|
||||||
|
}
|
||||||
|
data {
|
||||||
|
market {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
markPrice
|
||||||
|
indicativeVolume
|
||||||
|
bestBidVolume
|
||||||
|
bestOfferVolume
|
||||||
|
bestStaticBidVolume
|
||||||
|
bestStaticOfferVolume
|
||||||
|
openInterest
|
||||||
|
bestBidPrice
|
||||||
|
bestOfferPrice
|
||||||
|
trigger
|
||||||
|
priceMonitoringBounds {
|
||||||
|
minValidPrice
|
||||||
|
maxValidPrice
|
||||||
|
trigger {
|
||||||
|
horizonSecs
|
||||||
|
probability
|
||||||
|
auctionExtensionSecs
|
||||||
|
}
|
||||||
|
referencePrice
|
||||||
|
}
|
||||||
|
}
|
||||||
|
liquidityMonitoringParameters {
|
||||||
|
triggeringRatio
|
||||||
|
targetStakeParameters {
|
||||||
|
timeWindow
|
||||||
|
scalingFactor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
candles(interval: $interval, since: $since) {
|
||||||
|
volume
|
||||||
|
}
|
||||||
|
tradableInstrument {
|
||||||
|
instrument {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
code
|
||||||
|
metadata {
|
||||||
|
tags
|
||||||
|
}
|
||||||
|
product {
|
||||||
|
... on Future {
|
||||||
|
quoteName
|
||||||
|
settlementAsset {
|
||||||
|
id
|
||||||
|
symbol
|
||||||
|
name
|
||||||
|
}
|
||||||
|
oracleSpecForSettlementPrice {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
oracleSpecForTradingTermination {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
oracleSpecBinding {
|
||||||
|
settlementPriceProperty
|
||||||
|
tradingTerminationProperty
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
riskModel {
|
||||||
|
... on LogNormalRiskModel {
|
||||||
|
tau
|
||||||
|
riskAversionParameter
|
||||||
|
params {
|
||||||
|
r
|
||||||
|
sigma
|
||||||
|
mu
|
||||||
|
}
|
||||||
|
}
|
||||||
|
... on SimpleRiskModel {
|
||||||
|
params {
|
||||||
|
factorLong
|
||||||
|
factorShort
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
depth {
|
||||||
|
lastTrade {
|
||||||
|
price
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useMarketInfoQueryQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useMarketInfoQueryQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useMarketInfoQueryQuery` 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 } = useMarketInfoQueryQuery({
|
||||||
|
* variables: {
|
||||||
|
* marketId: // value for 'marketId'
|
||||||
|
* interval: // value for 'interval'
|
||||||
|
* since: // value for 'since'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useMarketInfoQueryQuery(baseOptions: Apollo.QueryHookOptions<MarketInfoQueryQuery, MarketInfoQueryQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<MarketInfoQueryQuery, MarketInfoQueryQueryVariables>(MarketInfoQueryDocument, options);
|
||||||
|
}
|
||||||
|
export function useMarketInfoQueryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<MarketInfoQueryQuery, MarketInfoQueryQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<MarketInfoQueryQuery, MarketInfoQueryQueryVariables>(MarketInfoQueryDocument, options);
|
||||||
|
}
|
||||||
|
export type MarketInfoQueryQueryHookResult = ReturnType<typeof useMarketInfoQueryQuery>;
|
||||||
|
export type MarketInfoQueryLazyQueryHookResult = ReturnType<typeof useMarketInfoQueryLazyQuery>;
|
||||||
|
export type MarketInfoQueryQueryResult = Apollo.QueryResult<MarketInfoQueryQuery, MarketInfoQueryQueryVariables>;
|
@ -0,0 +1,60 @@
|
|||||||
|
import * as Types from '@vegaprotocol/types/types';
|
||||||
|
|
||||||
|
import { gql } from '@apollo/client';
|
||||||
|
import * as Apollo from '@apollo/client';
|
||||||
|
const defaultOptions = {} as const;
|
||||||
|
export type MarketNamesQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type MarketNamesQuery = { __typename?: 'Query', markets?: Array<{ __typename?: 'Market', id: string, name: string, state: Types.MarketState, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', code: string, metadata: { __typename?: 'InstrumentMetadata', tags?: Array<string> | null }, product: { __typename?: 'Future', quoteName: string } } } }> | null };
|
||||||
|
|
||||||
|
|
||||||
|
export const MarketNamesDocument = gql`
|
||||||
|
query MarketNames {
|
||||||
|
markets {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
state
|
||||||
|
tradableInstrument {
|
||||||
|
instrument {
|
||||||
|
code
|
||||||
|
metadata {
|
||||||
|
tags
|
||||||
|
}
|
||||||
|
product {
|
||||||
|
... on Future {
|
||||||
|
quoteName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useMarketNamesQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useMarketNamesQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useMarketNamesQuery` 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 } = useMarketNamesQuery({
|
||||||
|
* variables: {
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useMarketNamesQuery(baseOptions?: Apollo.QueryHookOptions<MarketNamesQuery, MarketNamesQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<MarketNamesQuery, MarketNamesQueryVariables>(MarketNamesDocument, options);
|
||||||
|
}
|
||||||
|
export function useMarketNamesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<MarketNamesQuery, MarketNamesQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<MarketNamesQuery, MarketNamesQueryVariables>(MarketNamesDocument, options);
|
||||||
|
}
|
||||||
|
export type MarketNamesQueryHookResult = ReturnType<typeof useMarketNamesQuery>;
|
||||||
|
export type MarketNamesLazyQueryHookResult = ReturnType<typeof useMarketNamesLazyQuery>;
|
||||||
|
export type MarketNamesQueryResult = Apollo.QueryResult<MarketNamesQuery, MarketNamesQueryVariables>;
|
@ -2,7 +2,7 @@ import { gql, useQuery } from '@apollo/client';
|
|||||||
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 type { DealTicketQuery_market, DealTicketQuery } from './__generated__';
|
import type { DealTicketQuery_market, DealTicketQuery } from './';
|
||||||
|
|
||||||
const DEAL_TICKET_QUERY = gql`
|
const DEAL_TICKET_QUERY = gql`
|
||||||
query DealTicketQuery($marketId: ID!) {
|
query DealTicketQuery($marketId: ID!) {
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
export * from './__generated__';
|
export * from './__generated__/DealTicketQuery';
|
||||||
|
export * from './__generated__/MarketInfoQuery';
|
||||||
|
export * from './__generated__/MarketNames';
|
||||||
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';
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user