fix: #1537 fix generated types in LP and deposits
This commit is contained in:
+45
@@ -0,0 +1,45 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
// ====================================================
|
||||
// GraphQL query operation: AddSignerBundle
|
||||
// ====================================================
|
||||
|
||||
export interface AddSignerBundle_erc20MultiSigSignerAddedBundles_edges_node {
|
||||
__typename: "ERC20MultiSigSignerAddedBundle";
|
||||
/**
|
||||
* The ethereum address of the signer to be added
|
||||
*/
|
||||
newSigner: string;
|
||||
/**
|
||||
* The nonce used in the signing operation
|
||||
*/
|
||||
nonce: string;
|
||||
/**
|
||||
* The bundle of signatures from current validators to sign in the new signer
|
||||
*/
|
||||
signatures: string;
|
||||
}
|
||||
|
||||
export interface AddSignerBundle_erc20MultiSigSignerAddedBundles_edges {
|
||||
__typename: "ERC20MultiSigSignerAddedBundleEdge";
|
||||
node: AddSignerBundle_erc20MultiSigSignerAddedBundles_edges_node;
|
||||
}
|
||||
|
||||
export interface AddSignerBundle_erc20MultiSigSignerAddedBundles {
|
||||
__typename: "ERC20MultiSigSignerAddedConnection";
|
||||
edges: (AddSignerBundle_erc20MultiSigSignerAddedBundles_edges | null)[] | null;
|
||||
}
|
||||
|
||||
export interface AddSignerBundle {
|
||||
/**
|
||||
* Get the signature bundle to add a particular validator to the signer list of the multisig contract
|
||||
*/
|
||||
erc20MultiSigSignerAddedBundles: AddSignerBundle_erc20MultiSigSignerAddedBundles;
|
||||
}
|
||||
|
||||
export interface AddSignerBundleVariables {
|
||||
nodeId: string;
|
||||
}
|
||||
Generated
+48
@@ -0,0 +1,48 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
// ====================================================
|
||||
// GraphQL query operation: RemoveSignerBundle
|
||||
// ====================================================
|
||||
|
||||
export interface RemoveSignerBundle_erc20MultiSigSignerRemovedBundles_edges_node {
|
||||
__typename: "ERC20MultiSigSignerRemovedBundle";
|
||||
/**
|
||||
* The ethereum address of the signer to be removed
|
||||
*/
|
||||
oldSigner: string;
|
||||
/**
|
||||
* The nonce used in the signing operation
|
||||
*/
|
||||
nonce: string;
|
||||
/**
|
||||
* The bundle of signatures from current validators to sign in the new signer
|
||||
*/
|
||||
signatures: string;
|
||||
}
|
||||
|
||||
export interface RemoveSignerBundle_erc20MultiSigSignerRemovedBundles_edges {
|
||||
__typename: "ERC20MultiSigSignerRemovedBundleEdge";
|
||||
node: RemoveSignerBundle_erc20MultiSigSignerRemovedBundles_edges_node;
|
||||
}
|
||||
|
||||
export interface RemoveSignerBundle_erc20MultiSigSignerRemovedBundles {
|
||||
__typename: "ERC20MultiSigSignerRemovedConnection";
|
||||
/**
|
||||
* The list of signer bundles for that validator
|
||||
*/
|
||||
edges: (RemoveSignerBundle_erc20MultiSigSignerRemovedBundles_edges | null)[] | null;
|
||||
}
|
||||
|
||||
export interface RemoveSignerBundle {
|
||||
/**
|
||||
* Get the signatures bundle to remove a particular validator from signer list of the multisig contract
|
||||
*/
|
||||
erc20MultiSigSignerRemovedBundles: RemoveSignerBundle_erc20MultiSigSignerRemovedBundles;
|
||||
}
|
||||
|
||||
export interface RemoveSignerBundleVariables {
|
||||
nodeId: string;
|
||||
}
|
||||
-72
@@ -1,72 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import { AssetStatus } from "@vegaprotocol/types";
|
||||
|
||||
// ====================================================
|
||||
// GraphQL query operation: DepositAsset
|
||||
// ====================================================
|
||||
|
||||
export interface DepositAsset_assetsConnection_edges_node_source_BuiltinAsset {
|
||||
__typename: "BuiltinAsset";
|
||||
}
|
||||
|
||||
export interface DepositAsset_assetsConnection_edges_node_source_ERC20 {
|
||||
__typename: "ERC20";
|
||||
/**
|
||||
* The address of the ERC20 contract
|
||||
*/
|
||||
contractAddress: string;
|
||||
}
|
||||
|
||||
export type DepositAsset_assetsConnection_edges_node_source = DepositAsset_assetsConnection_edges_node_source_BuiltinAsset | DepositAsset_assetsConnection_edges_node_source_ERC20;
|
||||
|
||||
export interface DepositAsset_assetsConnection_edges_node {
|
||||
__typename: "Asset";
|
||||
/**
|
||||
* The ID of the asset
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The full name of the asset (e.g: Great British Pound)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The symbol of the asset (e.g: GBP)
|
||||
*/
|
||||
symbol: string;
|
||||
/**
|
||||
* The precision of the asset. Should match the decimal precision of the asset on its native chain, e.g: for ERC20 assets, it is often 18
|
||||
*/
|
||||
decimals: number;
|
||||
/**
|
||||
* The status of the asset in the Vega network
|
||||
*/
|
||||
status: AssetStatus;
|
||||
/**
|
||||
* The origin source of the asset (e.g: an ERC20 asset)
|
||||
*/
|
||||
source: DepositAsset_assetsConnection_edges_node_source;
|
||||
}
|
||||
|
||||
export interface DepositAsset_assetsConnection_edges {
|
||||
__typename: "AssetEdge";
|
||||
node: DepositAsset_assetsConnection_edges_node;
|
||||
}
|
||||
|
||||
export interface DepositAsset_assetsConnection {
|
||||
__typename: "AssetsConnection";
|
||||
/**
|
||||
* The assets
|
||||
*/
|
||||
edges: (DepositAsset_assetsConnection_edges | null)[] | null;
|
||||
}
|
||||
|
||||
export interface DepositAsset {
|
||||
/**
|
||||
* The list of all assets in use in the Vega network or the specified asset if ID is provided
|
||||
*/
|
||||
assetsConnection: DepositAsset_assetsConnection;
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
export * from './Deposit';
|
||||
export * from './DepositAsset';
|
||||
@@ -1,112 +0,0 @@
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
const defaultOptions = {} as const;
|
||||
export type DepositFieldsFragment = { __typename?: 'Deposit', id: string, status: Types.DepositStatus, amount: string, createdTimestamp: string, creditedTimestamp?: string | null, txHash?: string | null, asset: { __typename?: 'Asset', id: string, symbol: string, decimals: number } };
|
||||
|
||||
export type DepositsQueryVariables = Types.Exact<{
|
||||
partyId: Types.Scalars['ID'];
|
||||
}>;
|
||||
|
||||
|
||||
export type DepositsQuery = { __typename?: 'Query', party?: { __typename?: 'Party', id: string, depositsConnection?: { __typename?: 'DepositsConnection', edges?: Array<{ __typename?: 'DepositEdge', node: { __typename?: 'Deposit', id: string, status: Types.DepositStatus, amount: string, createdTimestamp: string, creditedTimestamp?: string | null, txHash?: string | null, asset: { __typename?: 'Asset', id: string, symbol: string, decimals: number } } } | null> | null } | null } | null };
|
||||
|
||||
export type DepositEventSubscriptionVariables = Types.Exact<{
|
||||
partyId: Types.Scalars['ID'];
|
||||
}>;
|
||||
|
||||
|
||||
export type DepositEventSubscription = { __typename?: 'Subscription', busEvents?: Array<{ __typename?: 'BusEvent', event: { __typename?: 'Account' } | { __typename?: 'Asset' } | { __typename?: 'AuctionEvent' } | { __typename?: 'Deposit', id: string, status: Types.DepositStatus, amount: string, createdTimestamp: string, creditedTimestamp?: string | null, txHash?: string | null, asset: { __typename?: 'Asset', id: string, symbol: string, decimals: number } } | { __typename?: 'LiquidityProvision' } | { __typename?: 'LossSocialization' } | { __typename?: 'MarginLevels' } | { __typename?: 'Market' } | { __typename?: 'MarketData' } | { __typename?: 'MarketEvent' } | { __typename?: 'MarketTick' } | { __typename?: 'NodeSignature' } | { __typename?: 'OracleSpec' } | { __typename?: 'Order' } | { __typename?: 'Party' } | { __typename?: 'PositionResolution' } | { __typename?: 'Proposal' } | { __typename?: 'RiskFactor' } | { __typename?: 'SettleDistressed' } | { __typename?: 'SettlePosition' } | { __typename?: 'TimeUpdate' } | { __typename?: 'Trade' } | { __typename?: 'TransferResponses' } | { __typename?: 'Vote' } | { __typename?: 'Withdrawal' } }> | null };
|
||||
|
||||
export const DepositFieldsFragmentDoc = gql`
|
||||
fragment DepositFields on Deposit {
|
||||
id
|
||||
status
|
||||
amount
|
||||
asset {
|
||||
id
|
||||
symbol
|
||||
decimals
|
||||
}
|
||||
createdTimestamp
|
||||
creditedTimestamp
|
||||
txHash
|
||||
}
|
||||
`;
|
||||
export const DepositsDocument = gql`
|
||||
query Deposits($partyId: ID!) {
|
||||
party(id: $partyId) {
|
||||
id
|
||||
depositsConnection {
|
||||
edges {
|
||||
node {
|
||||
...DepositFields
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
${DepositFieldsFragmentDoc}`;
|
||||
|
||||
/**
|
||||
* __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: {
|
||||
* partyId: // value for 'partyId'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
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>;
|
||||
export const DepositEventDocument = gql`
|
||||
subscription DepositEvent($partyId: ID!) {
|
||||
busEvents(partyId: $partyId, batchSize: 0, types: [Deposit]) {
|
||||
event {
|
||||
... on Deposit {
|
||||
...DepositFields
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
${DepositFieldsFragmentDoc}`;
|
||||
|
||||
/**
|
||||
* __useDepositEventSubscription__
|
||||
*
|
||||
* To run a query within a React component, call `useDepositEventSubscription` and pass it any options that fit your needs.
|
||||
* When your component renders, `useDepositEventSubscription` 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 } = useDepositEventSubscription({
|
||||
* variables: {
|
||||
* partyId: // value for 'partyId'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useDepositEventSubscription(baseOptions: Apollo.SubscriptionHookOptions<DepositEventSubscription, DepositEventSubscriptionVariables>) {
|
||||
const options = {...defaultOptions, ...baseOptions}
|
||||
return Apollo.useSubscription<DepositEventSubscription, DepositEventSubscriptionVariables>(DepositEventDocument, options);
|
||||
}
|
||||
export type DepositEventSubscriptionHookResult = ReturnType<typeof useDepositEventSubscription>;
|
||||
export type DepositEventSubscriptionResult = Apollo.SubscriptionResult<DepositEventSubscription>;
|
||||
@@ -1,80 +0,0 @@
|
||||
import { Schema as Types } from '@vegaprotocol/types';
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
import * as Apollo from '@apollo/client';
|
||||
const defaultOptions = {} as const;
|
||||
export type StatisticsQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type StatisticsQuery = { __typename?: 'Query', statistics: { __typename?: 'Statistics', chainId: string, blockHeight: string } };
|
||||
|
||||
export type BlockTimeSubscriptionVariables = Types.Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type BlockTimeSubscription = { __typename?: 'Subscription', busEvents?: Array<{ __typename?: 'BusEvent', id: string }> | null };
|
||||
|
||||
|
||||
export const StatisticsDocument = gql`
|
||||
query Statistics {
|
||||
statistics {
|
||||
chainId
|
||||
blockHeight
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useStatisticsQuery__
|
||||
*
|
||||
* To run a query within a React component, call `useStatisticsQuery` and pass it any options that fit your needs.
|
||||
* When your component renders, `useStatisticsQuery` 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 } = useStatisticsQuery({
|
||||
* variables: {
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useStatisticsQuery(baseOptions?: Apollo.QueryHookOptions<StatisticsQuery, StatisticsQueryVariables>) {
|
||||
const options = {...defaultOptions, ...baseOptions}
|
||||
return Apollo.useQuery<StatisticsQuery, StatisticsQueryVariables>(StatisticsDocument, options);
|
||||
}
|
||||
export function useStatisticsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<StatisticsQuery, StatisticsQueryVariables>) {
|
||||
const options = {...defaultOptions, ...baseOptions}
|
||||
return Apollo.useLazyQuery<StatisticsQuery, StatisticsQueryVariables>(StatisticsDocument, options);
|
||||
}
|
||||
export type StatisticsQueryHookResult = ReturnType<typeof useStatisticsQuery>;
|
||||
export type StatisticsLazyQueryHookResult = ReturnType<typeof useStatisticsLazyQuery>;
|
||||
export type StatisticsQueryResult = Apollo.QueryResult<StatisticsQuery, StatisticsQueryVariables>;
|
||||
export const BlockTimeDocument = gql`
|
||||
subscription BlockTime {
|
||||
busEvents(types: TimeUpdate, batchSize: 1) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useBlockTimeSubscription__
|
||||
*
|
||||
* To run a query within a React component, call `useBlockTimeSubscription` and pass it any options that fit your needs.
|
||||
* When your component renders, `useBlockTimeSubscription` 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 } = useBlockTimeSubscription({
|
||||
* variables: {
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useBlockTimeSubscription(baseOptions?: Apollo.SubscriptionHookOptions<BlockTimeSubscription, BlockTimeSubscriptionVariables>) {
|
||||
const options = {...defaultOptions, ...baseOptions}
|
||||
return Apollo.useSubscription<BlockTimeSubscription, BlockTimeSubscriptionVariables>(BlockTimeDocument, options);
|
||||
}
|
||||
export type BlockTimeSubscriptionHookResult = ReturnType<typeof useBlockTimeSubscription>;
|
||||
export type BlockTimeSubscriptionResult = Apollo.SubscriptionResult<BlockTimeSubscription>;
|
||||
@@ -6,10 +6,8 @@ import type {
|
||||
LiquidityProvisionsSubscription,
|
||||
MarketLiquidityQuery,
|
||||
} from './__generated___/MarketLiquidity';
|
||||
import {
|
||||
MarketLiquidityDocument,
|
||||
LiquidityProvisionsDocument,
|
||||
} from './__generated___/MarketLiquidity';
|
||||
import { LiquidityProvisionsDocument } from './__generated___/MarketLiquidity';
|
||||
import { MarketLiquidityDocument } from './__generated___/MarketLiquidity';
|
||||
|
||||
export function isLpFragment(
|
||||
lp:
|
||||
@@ -99,101 +97,3 @@ export const marketLiquidityDataProvider = makeDataProvider<
|
||||
return delta;
|
||||
},
|
||||
});
|
||||
|
||||
// export const marketLiquidityDataProvider = makeDataProvider<
|
||||
// MarketLiquidityQuery,
|
||||
// never>){
|
||||
// query: MarketLiquidityDocument
|
||||
// }
|
||||
|
||||
// export const liquidityProviderFeeShareDataProvider = makeDataProvider<
|
||||
// MarketLiquidityQuery,
|
||||
|
||||
// export const useLiquidityProvision = ({
|
||||
// marketId,
|
||||
// partyId,
|
||||
// }: {
|
||||
// partyId?: string;
|
||||
// marketId?: string;
|
||||
// }) => {
|
||||
// const { param: stakeToCcySiskas } = useNetworkParam(
|
||||
// NetworkParams.market_liquidity_stakeToCcySiskas
|
||||
// );
|
||||
// const stakeToCcySiska = stakeToCcySiskas && stakeToCcySiskas[0];
|
||||
// const { data, loading, error } = useMarketLiquidityQuery({
|
||||
// variables: { marketId: marketId || '' },
|
||||
// });
|
||||
// const liquidityData: LiquidityData = getLiquidityData(
|
||||
// data,
|
||||
// partyId,
|
||||
// stakeToCcySiska
|
||||
// );
|
||||
// return { data: liquidityData, loading, error };
|
||||
// };
|
||||
|
||||
// function getLiquidityData(
|
||||
// data: MarketLiquidityQuery | undefined,
|
||||
// partyId: string | undefined,
|
||||
// stakeToCcySiska: string
|
||||
// ) {
|
||||
// const liquidityProviders = (
|
||||
// data?.market?.data?.liquidityProviderFeeShare || []
|
||||
// )
|
||||
// ?.filter((p) => !partyId || p.party.id === partyId) // if partyId is provided, filter out other parties
|
||||
// .map((provider) => {
|
||||
// const liquidityProvisionConnection =
|
||||
// data?.market?.liquidityProvisionsConnection?.edges?.find(
|
||||
// (e) => e?.node.party.id === provider.party.id
|
||||
// );
|
||||
// const balance =
|
||||
// liquidityProvisionConnection?.node?.party.accountsConnection?.edges?.reduce(
|
||||
// (acc, e) => {
|
||||
// return e?.node.type === AccountType.ACCOUNT_TYPE_BOND // just an extra check to make sure we only use bond accounts
|
||||
// ? acc.plus(new BigNumber(e?.node.balance ?? 0))
|
||||
// : acc;
|
||||
// },
|
||||
// new BigNumber(0)
|
||||
// );
|
||||
// const obligation =
|
||||
// stakeToCcySiska &&
|
||||
// new BigNumber(stakeToCcySiska)
|
||||
// .times(liquidityProvisionConnection?.node?.commitmentAmount ?? 1)
|
||||
// .toString();
|
||||
// const supplied =
|
||||
// stakeToCcySiska &&
|
||||
// new BigNumber(stakeToCcySiska).times(balance ?? 1).toString();
|
||||
// return {
|
||||
// party: provider.party.id,
|
||||
// createdAt: liquidityProvisionConnection?.node?.createdAt,
|
||||
// updatedAt: liquidityProvisionConnection?.node?.updatedAt,
|
||||
// commitmentAmount: liquidityProvisionConnection?.node?.commitmentAmount,
|
||||
// fee: liquidityProvisionConnection?.node?.fee,
|
||||
// status: liquidityProvisionConnection?.node?.status,
|
||||
// equityLikeShare: provider.equityLikeShare,
|
||||
// averageEntryValuation: provider.averageEntryValuation,
|
||||
// obligation,
|
||||
// supplied,
|
||||
// };
|
||||
// });
|
||||
// const liquidityData: LiquidityData = {
|
||||
// liquidityProviders,
|
||||
// suppliedStake: data?.market?.data?.suppliedStake,
|
||||
// targetStake: data?.market?.data?.targetStake,
|
||||
// decimalPlaces: data?.market?.decimalPlaces,
|
||||
// positionDecimalPlaces: data?.market?.positionDecimalPlaces,
|
||||
// code: data?.market?.tradableInstrument.instrument.code,
|
||||
// name: data?.market?.tradableInstrument.instrument.name,
|
||||
// assetDecimalPlaces:
|
||||
// data?.market?.tradableInstrument.instrument.product.settlementAsset
|
||||
// .decimals,
|
||||
// symbol:
|
||||
// data?.market?.tradableInstrument.instrument.product.settlementAsset
|
||||
// .symbol,
|
||||
// };
|
||||
// return liquidityData;
|
||||
// }
|
||||
|
||||
// export const lpDataProvider = makeDerivedDataProvider<LiquidityData, never>(
|
||||
// [liquidityDataProvider],
|
||||
// (parts) => parts[0]
|
||||
// );
|
||||
|
||||
Reference in New Issue
Block a user