diff --git a/pages/forwards.tsx b/pages/forwards.tsx index 122061fa..a76dd904 100644 --- a/pages/forwards.tsx +++ b/pages/forwards.tsx @@ -101,7 +101,7 @@ const ForwardsView = () => { - Grouped by Peer + Grouped by Channel diff --git a/server/helpers/rateLimiter.ts b/server/helpers/rateLimiter.ts index d92c28e4..05f7aab8 100644 --- a/server/helpers/rateLimiter.ts +++ b/server/helpers/rateLimiter.ts @@ -14,6 +14,7 @@ export const RateConfig: RateConfigProps = { chainBalance: { max: 10, window: '5s' }, pendingChainBalance: { max: 10, window: '5s' }, channelBalance: { max: 10, window: '5s' }, + getChannel: { max: 1000, window: '5s' }, }; const rateLimiter = getGraphQLRateLimiter({ diff --git a/server/schema/channel/resolvers.ts b/server/schema/channel/resolvers.ts index 3cc514b9..206d664d 100644 --- a/server/schema/channel/resolvers.ts +++ b/server/schema/channel/resolvers.ts @@ -1,6 +1,6 @@ import { logger } from 'server/helpers/logger'; import { toWithError } from 'server/helpers/async'; -import { getChannel } from 'ln-service'; +import { getChannel as getLnChannel } from 'ln-service'; import { ChannelType, GetChannelType } from 'server/types/ln-service.types'; import { openChannel } from './resolvers/mutation/openChannel'; import { closeChannel } from './resolvers/mutation/closeChannel'; @@ -10,6 +10,7 @@ import { getChannelBalance } from './resolvers/query/getChannelBalance'; import { getChannels } from './resolvers/query/getChannels'; import { getClosedChannels } from './resolvers/query/getClosedChannels'; import { getPendingChannels } from './resolvers/query/getPendingChannels'; +import { getChannel } from './resolvers/query/getChannel'; type ParentType = { id: string; @@ -21,6 +22,7 @@ type ParentType = { export const channelResolvers = { Query: { + getChannel, getChannelBalance, getChannels, getClosedChannels, @@ -48,7 +50,7 @@ export const channelResolvers = { } const [channel, error] = await toWithError( - getChannel({ lnd, id }) + getLnChannel({ lnd, id }) ); if (error) { diff --git a/server/schema/channel/resolvers/query/getChannel.ts b/server/schema/channel/resolvers/query/getChannel.ts new file mode 100644 index 00000000..65c69c7c --- /dev/null +++ b/server/schema/channel/resolvers/query/getChannel.ts @@ -0,0 +1,42 @@ +import { getChannel as getLnChannel } from 'ln-service'; +import { ContextType } from 'server/types/apiTypes'; +import { to } from 'server/helpers/async'; +import { requestLimiter } from 'server/helpers/rateLimiter'; +import { GetChannelType } from 'server/types/ln-service.types'; + +export const getChannel = async ( + _: undefined, + { id, pubkey }: { id: string; pubkey?: string }, + { ip, lnd }: ContextType +) => { + await requestLimiter(ip, 'getChannel'); + + const channel = await to(getLnChannel({ lnd, id })); + + if (!pubkey) { + return channel; + } + + let node_policies = null; + let partner_node_policies = null; + + channel.policies.forEach(policy => { + if (pubkey && pubkey === policy.public_key) { + node_policies = { + ...policy, + node: { lnd, publicKey: policy.public_key }, + }; + } else { + partner_node_policies = { + ...policy, + node: { lnd, publicKey: policy.public_key }, + }; + } + }); + + return { + ...(channel as GetChannelType), + node_policies, + partner_node_policies, + }; +}; diff --git a/server/schema/forwards/resolvers.ts b/server/schema/forwards/resolvers.ts new file mode 100644 index 00000000..673a8c40 --- /dev/null +++ b/server/schema/forwards/resolvers.ts @@ -0,0 +1,55 @@ +import { subDays } from 'date-fns'; +import { to } from 'server/helpers/async'; +import { requestLimiter } from 'server/helpers/rateLimiter'; +import { ContextType } from 'server/types/apiTypes'; +import { GetForwardsType } from 'server/types/ln-service.types'; +import { getForwards as getLnForwards } from 'ln-service'; +import { sortBy } from 'lodash'; + +export const forwardsResolver = { + Query: { + getForwards: async ( + _: undefined, + { days }: { days: number }, + context: ContextType + ) => { + await requestLimiter(context.ip, 'getForwardsPastDays'); + + const { lnd } = context; + + const today = new Date(); + const startDate = subDays(today, days); + + const forwardsList = await to( + getLnForwards({ + lnd, + after: startDate, + before: today, + }) + ); + + let forwards = forwardsList.forwards; + let next = forwardsList.next; + + let finishedFetching = false; + + if (!next || !forwards || forwards.length <= 0) { + finishedFetching = true; + } + + while (!finishedFetching) { + if (next) { + const moreForwards = await to( + getLnForwards({ lnd, token: next }) + ); + forwards = [...forwards, ...moreForwards.forwards]; + next = moreForwards.next; + } else { + finishedFetching = true; + } + } + + return sortBy(forwards, 'created_at').reverse(); + }, + }, +}; diff --git a/server/schema/index.ts b/server/schema/index.ts index b6e60b1a..b4d1b6e8 100644 --- a/server/schema/index.ts +++ b/server/schema/index.ts @@ -44,6 +44,7 @@ import { lnMarketsResolvers } from './lnmarkets/resolvers'; import { lnMarketsTypes } from './lnmarkets/types'; import { boltzResolvers } from './boltz/resolvers'; import { boltzTypes } from './boltz/types'; +import { forwardsResolver } from './forwards/resolvers'; const typeDefs = [ generalTypes, @@ -94,7 +95,8 @@ const resolvers = merge( tbaseResolvers, lnUrlResolvers, lnMarketsResolvers, - boltzResolvers + boltzResolvers, + forwardsResolver ); export const schema = makeExecutableSchema({ typeDefs, resolvers }); diff --git a/server/schema/transactions/resolvers.ts b/server/schema/transactions/resolvers.ts index d3d85a08..40ade1cd 100644 --- a/server/schema/transactions/resolvers.ts +++ b/server/schema/transactions/resolvers.ts @@ -1,11 +1,5 @@ -import { - getPayments, - getInvoices, - getForwards as getLnForwards, - getWalletInfo, - getClosedChannels, -} from 'ln-service'; -import { compareDesc, subDays } from 'date-fns'; +import { getPayments, getInvoices } from 'ln-service'; +import { compareDesc } from 'date-fns'; import { sortBy } from 'underscore'; import { ContextType } from 'server/types/apiTypes'; import { requestLimiter } from 'server/helpers/rateLimiter'; @@ -15,12 +9,7 @@ import { GetPaymentsType, InvoiceType, PaymentType, - GetForwardsType, - GetWalletInfoType, - GetClosedChannelsType, } from 'server/types/ln-service.types'; -import { logger } from 'server/helpers/logger'; -import { getNodeFromChannel } from './helpers'; type TransactionType = InvoiceType | PaymentType; type TransactionWithType = { isTypeOf: string } & TransactionType; @@ -105,89 +94,10 @@ export const transactionResolvers = { resume, }; }, - - getForwardsPastDays: async ( - _: undefined, - { days }: { days: number }, - context: ContextType - ) => { - await requestLimiter(context.ip, 'getForwardsPastDays'); - - const { lnd } = context; - - const today = new Date(); - const startDate = subDays(today, days); - - const walletInfo = await to(getWalletInfo({ lnd })); - - const closedChannels = await to( - getClosedChannels({ lnd }) - ); - - const forwardsList = await to( - getLnForwards({ - lnd, - after: startDate, - before: today, - }) - ); - - let forwards = forwardsList.forwards; - let next = forwardsList.next; - - let finishedFetching = false; - - if (!next || !forwards || forwards.length <= 0) { - finishedFetching = true; - } - - while (!finishedFetching) { - if (next) { - const moreForwards = await to( - getLnForwards({ lnd, token: next }) - ); - forwards = [...forwards, ...moreForwards.forwards]; - next = moreForwards.next; - } else { - finishedFetching = true; - } - } - - const final = forwards.map(f => ({ - ...f, - lnd, - public_key: walletInfo.public_key, - closed_channels: closedChannels.channels || [], - })); - - logger.debug( - `Got a total of ${final.length} forwards for the past ${days} days` - ); - - return sortBy(final, 'created_at').reverse(); - }, }, Transaction: { __resolveType(parent: TransactionWithType) { return parent.isTypeOf; }, }, - Forward: { - incoming_node(parent: any) { - return getNodeFromChannel( - parent.lnd, - parent.incoming_channel, - parent.public_key, - parent.closed_channels - ); - }, - outgoing_node(parent: any) { - return getNodeFromChannel( - parent.lnd, - parent.outgoing_channel, - parent.public_key, - parent.closed_channels - ); - }, - }, }; diff --git a/server/schema/transactions/types.ts b/server/schema/transactions/types.ts index a0396b8d..b3218583 100644 --- a/server/schema/transactions/types.ts +++ b/server/schema/transactions/types.ts @@ -9,8 +9,6 @@ export const transactionTypes = gql` mtokens: String! outgoing_channel: String! tokens: Int! - incoming_node: ForwardNodeType - outgoing_node: ForwardNodeType } type ForwardNodeType { diff --git a/server/schema/types.ts b/server/schema/types.ts index d395d806..ee057c52 100644 --- a/server/schema/types.ts +++ b/server/schema/types.ts @@ -51,6 +51,7 @@ export const queryTypes = gql` getTimeHealth: channelsTimeHealth getFeeHealth: channelsFeeHealth getChannelBalance: channelBalanceType + getChannel(id: String!, pubkey: String): singleChannelType! getChannels(active: Boolean): [channelType]! getClosedChannels(type: String): [closedChannelType] getPendingChannels: [pendingChannelType] @@ -62,7 +63,7 @@ export const queryTypes = gql` decodeRequest(request: String!): decodeType getWalletInfo: walletInfoType getResume(token: String): getResumeType - getForwardsPastDays(days: Int!): [Forward]! + getForwards(days: Int!): [Forward]! getBitcoinPrice(logger: Boolean, currency: String): String getBitcoinFees(logger: Boolean): bitcoinFeeType getForwardChannelsReport(time: String, order: String, type: String): String diff --git a/src/graphql/mutations/__generated__/addPeer.generated.tsx b/src/graphql/mutations/__generated__/addPeer.generated.tsx index a8178206..c1dee39b 100644 --- a/src/graphql/mutations/__generated__/addPeer.generated.tsx +++ b/src/graphql/mutations/__generated__/addPeer.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type AddPeerMutationVariables = Types.Exact<{ url?: Types.Maybe; publicKey?: Types.Maybe; @@ -50,7 +51,8 @@ export type AddPeerMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(AddPeerDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(AddPeerDocument, options); } export type AddPeerMutationHookResult = ReturnType; export type AddPeerMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/bosPay.generated.tsx b/src/graphql/mutations/__generated__/bosPay.generated.tsx index 26760db3..3f06d702 100644 --- a/src/graphql/mutations/__generated__/bosPay.generated.tsx +++ b/src/graphql/mutations/__generated__/bosPay.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type BosPayMutationVariables = Types.Exact<{ max_fee: Types.Scalars['Int']; max_paths: Types.Scalars['Int']; @@ -53,7 +54,8 @@ export type BosPayMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(BosPayDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(BosPayDocument, options); } export type BosPayMutationHookResult = ReturnType; export type BosPayMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/bosRebalance.generated.tsx b/src/graphql/mutations/__generated__/bosRebalance.generated.tsx index 6ebed5fb..e8733ec0 100644 --- a/src/graphql/mutations/__generated__/bosRebalance.generated.tsx +++ b/src/graphql/mutations/__generated__/bosRebalance.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type BosRebalanceMutationVariables = Types.Exact<{ avoid?: Types.Maybe> | Types.Maybe>; in_through?: Types.Maybe; @@ -100,7 +101,8 @@ export type BosRebalanceMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(BosRebalanceDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(BosRebalanceDocument, options); } export type BosRebalanceMutationHookResult = ReturnType; export type BosRebalanceMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/circularRebalance.generated.tsx b/src/graphql/mutations/__generated__/circularRebalance.generated.tsx index 4bcd13e4..c3b1a9b2 100644 --- a/src/graphql/mutations/__generated__/circularRebalance.generated.tsx +++ b/src/graphql/mutations/__generated__/circularRebalance.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type CircularRebalanceMutationVariables = Types.Exact<{ route: Types.Scalars['String']; }>; @@ -39,7 +40,8 @@ export type CircularRebalanceMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(CircularRebalanceDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(CircularRebalanceDocument, options); } export type CircularRebalanceMutationHookResult = ReturnType; export type CircularRebalanceMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/claimBoltzTransaction.generated.tsx b/src/graphql/mutations/__generated__/claimBoltzTransaction.generated.tsx index 338840b9..b3d12da8 100644 --- a/src/graphql/mutations/__generated__/claimBoltzTransaction.generated.tsx +++ b/src/graphql/mutations/__generated__/claimBoltzTransaction.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type ClaimBoltzTransactionMutationVariables = Types.Exact<{ redeem: Types.Scalars['String']; transaction: Types.Scalars['String']; @@ -56,7 +57,8 @@ export type ClaimBoltzTransactionMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(ClaimBoltzTransactionDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(ClaimBoltzTransactionDocument, options); } export type ClaimBoltzTransactionMutationHookResult = ReturnType; export type ClaimBoltzTransactionMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/closeChannel.generated.tsx b/src/graphql/mutations/__generated__/closeChannel.generated.tsx index dce16fb4..aba29eeb 100644 --- a/src/graphql/mutations/__generated__/closeChannel.generated.tsx +++ b/src/graphql/mutations/__generated__/closeChannel.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type CloseChannelMutationVariables = Types.Exact<{ id: Types.Scalars['String']; forceClose?: Types.Maybe; @@ -56,7 +57,8 @@ export type CloseChannelMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(CloseChannelDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(CloseChannelDocument, options); } export type CloseChannelMutationHookResult = ReturnType; export type CloseChannelMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/createAddress.generated.tsx b/src/graphql/mutations/__generated__/createAddress.generated.tsx index 66698035..b085fda0 100644 --- a/src/graphql/mutations/__generated__/createAddress.generated.tsx +++ b/src/graphql/mutations/__generated__/createAddress.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type CreateAddressMutationVariables = Types.Exact<{ nested?: Types.Maybe; }>; @@ -39,7 +40,8 @@ export type CreateAddressMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(CreateAddressDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(CreateAddressDocument, options); } export type CreateAddressMutationHookResult = ReturnType; export type CreateAddressMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/createBaseInvoice.generated.tsx b/src/graphql/mutations/__generated__/createBaseInvoice.generated.tsx index 2aa2bd5e..e684df21 100644 --- a/src/graphql/mutations/__generated__/createBaseInvoice.generated.tsx +++ b/src/graphql/mutations/__generated__/createBaseInvoice.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type CreateBaseInvoiceMutationVariables = Types.Exact<{ amount: Types.Scalars['Int']; }>; @@ -45,7 +46,8 @@ export type CreateBaseInvoiceMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(CreateBaseInvoiceDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(CreateBaseInvoiceDocument, options); } export type CreateBaseInvoiceMutationHookResult = ReturnType; export type CreateBaseInvoiceMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/createBaseToken.generated.tsx b/src/graphql/mutations/__generated__/createBaseToken.generated.tsx index a3b90b65..f1eeaf61 100644 --- a/src/graphql/mutations/__generated__/createBaseToken.generated.tsx +++ b/src/graphql/mutations/__generated__/createBaseToken.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type CreateBaseTokenMutationVariables = Types.Exact<{ id: Types.Scalars['String']; }>; @@ -39,7 +40,8 @@ export type CreateBaseTokenMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(CreateBaseTokenDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(CreateBaseTokenDocument, options); } export type CreateBaseTokenMutationHookResult = ReturnType; export type CreateBaseTokenMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/createBaseTokenInvoice.generated.tsx b/src/graphql/mutations/__generated__/createBaseTokenInvoice.generated.tsx index f103e2eb..feef0167 100644 --- a/src/graphql/mutations/__generated__/createBaseTokenInvoice.generated.tsx +++ b/src/graphql/mutations/__generated__/createBaseTokenInvoice.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type CreateBaseTokenInvoiceMutationVariables = Types.Exact<{ [key: string]: never; }>; @@ -42,7 +43,8 @@ export type CreateBaseTokenInvoiceMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(CreateBaseTokenInvoiceDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(CreateBaseTokenInvoiceDocument, options); } export type CreateBaseTokenInvoiceMutationHookResult = ReturnType; export type CreateBaseTokenInvoiceMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/createBoltzReverseSwap.generated.tsx b/src/graphql/mutations/__generated__/createBoltzReverseSwap.generated.tsx index 8f53cb1a..45f97169 100644 --- a/src/graphql/mutations/__generated__/createBoltzReverseSwap.generated.tsx +++ b/src/graphql/mutations/__generated__/createBoltzReverseSwap.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type CreateBoltzReverseSwapMutationVariables = Types.Exact<{ amount: Types.Scalars['Int']; address?: Types.Maybe; @@ -81,7 +82,8 @@ export type CreateBoltzReverseSwapMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(CreateBoltzReverseSwapDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(CreateBoltzReverseSwapDocument, options); } export type CreateBoltzReverseSwapMutationHookResult = ReturnType; export type CreateBoltzReverseSwapMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/createInvoice.generated.tsx b/src/graphql/mutations/__generated__/createInvoice.generated.tsx index 57458a44..3c55dfd8 100644 --- a/src/graphql/mutations/__generated__/createInvoice.generated.tsx +++ b/src/graphql/mutations/__generated__/createInvoice.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type CreateInvoiceMutationVariables = Types.Exact<{ amount: Types.Scalars['Int']; description?: Types.Maybe; @@ -53,7 +54,8 @@ export type CreateInvoiceMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(CreateInvoiceDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(CreateInvoiceDocument, options); } export type CreateInvoiceMutationHookResult = ReturnType; export type CreateInvoiceMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/createMacaroon.generated.tsx b/src/graphql/mutations/__generated__/createMacaroon.generated.tsx index 25b139a9..1e696c6d 100644 --- a/src/graphql/mutations/__generated__/createMacaroon.generated.tsx +++ b/src/graphql/mutations/__generated__/createMacaroon.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type CreateMacaroonMutationVariables = Types.Exact<{ permissions: Types.PermissionsType; }>; @@ -39,7 +40,8 @@ export type CreateMacaroonMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(CreateMacaroonDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(CreateMacaroonDocument, options); } export type CreateMacaroonMutationHookResult = ReturnType; export type CreateMacaroonMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/createThunderPoints.generated.tsx b/src/graphql/mutations/__generated__/createThunderPoints.generated.tsx index 228ff76c..a8dd5c03 100644 --- a/src/graphql/mutations/__generated__/createThunderPoints.generated.tsx +++ b/src/graphql/mutations/__generated__/createThunderPoints.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type CreateThunderPointsMutationVariables = Types.Exact<{ id: Types.Scalars['String']; alias: Types.Scalars['String']; @@ -50,7 +51,8 @@ export type CreateThunderPointsMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(CreateThunderPointsDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(CreateThunderPointsDocument, options); } export type CreateThunderPointsMutationHookResult = ReturnType; export type CreateThunderPointsMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/deleteBaseToken.generated.tsx b/src/graphql/mutations/__generated__/deleteBaseToken.generated.tsx index 639fd5f4..528c0bde 100644 --- a/src/graphql/mutations/__generated__/deleteBaseToken.generated.tsx +++ b/src/graphql/mutations/__generated__/deleteBaseToken.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type DeleteBaseTokenMutationVariables = Types.Exact<{ [key: string]: never; }>; @@ -36,7 +37,8 @@ export type DeleteBaseTokenMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(DeleteBaseTokenDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(DeleteBaseTokenDocument, options); } export type DeleteBaseTokenMutationHookResult = ReturnType; export type DeleteBaseTokenMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/getAuthToken.generated.tsx b/src/graphql/mutations/__generated__/getAuthToken.generated.tsx index 2a6cd125..4969db4d 100644 --- a/src/graphql/mutations/__generated__/getAuthToken.generated.tsx +++ b/src/graphql/mutations/__generated__/getAuthToken.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetAuthTokenMutationVariables = Types.Exact<{ cookie?: Types.Maybe; }>; @@ -39,7 +40,8 @@ export type GetAuthTokenMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(GetAuthTokenDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(GetAuthTokenDocument, options); } export type GetAuthTokenMutationHookResult = ReturnType; export type GetAuthTokenMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/getSessionToken.generated.tsx b/src/graphql/mutations/__generated__/getSessionToken.generated.tsx index b3270545..4060e051 100644 --- a/src/graphql/mutations/__generated__/getSessionToken.generated.tsx +++ b/src/graphql/mutations/__generated__/getSessionToken.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetSessionTokenMutationVariables = Types.Exact<{ id: Types.Scalars['String']; password: Types.Scalars['String']; @@ -41,7 +42,8 @@ export type GetSessionTokenMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(GetSessionTokenDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(GetSessionTokenDocument, options); } export type GetSessionTokenMutationHookResult = ReturnType; export type GetSessionTokenMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/keysend.generated.tsx b/src/graphql/mutations/__generated__/keysend.generated.tsx index 917844c8..c3c2dbba 100644 --- a/src/graphql/mutations/__generated__/keysend.generated.tsx +++ b/src/graphql/mutations/__generated__/keysend.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type KeysendMutationVariables = Types.Exact<{ destination: Types.Scalars['String']; tokens: Types.Scalars['Int']; @@ -46,7 +47,8 @@ export type KeysendMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(KeysendDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(KeysendDocument, options); } export type KeysendMutationHookResult = ReturnType; export type KeysendMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/lnMarkets.generated.tsx b/src/graphql/mutations/__generated__/lnMarkets.generated.tsx index 0f9f20ed..a5d4e444 100644 --- a/src/graphql/mutations/__generated__/lnMarkets.generated.tsx +++ b/src/graphql/mutations/__generated__/lnMarkets.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type LnMarketsLoginMutationVariables = Types.Exact<{ [key: string]: never; }>; @@ -70,7 +71,8 @@ export type LnMarketsLoginMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(LnMarketsLoginDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(LnMarketsLoginDocument, options); } export type LnMarketsLoginMutationHookResult = ReturnType; export type LnMarketsLoginMutationResult = Apollo.MutationResult; @@ -100,7 +102,8 @@ export type LnMarketsWithdrawMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(LnMarketsWithdrawDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(LnMarketsWithdrawDocument, options); } export type LnMarketsWithdrawMutationHookResult = ReturnType; export type LnMarketsWithdrawMutationResult = Apollo.MutationResult; @@ -130,7 +133,8 @@ export type LnMarketsDepositMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(LnMarketsDepositDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(LnMarketsDepositDocument, options); } export type LnMarketsDepositMutationHookResult = ReturnType; export type LnMarketsDepositMutationResult = Apollo.MutationResult; @@ -159,7 +163,8 @@ export type LnMarketsLogoutMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(LnMarketsLogoutDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(LnMarketsLogoutDocument, options); } export type LnMarketsLogoutMutationHookResult = ReturnType; export type LnMarketsLogoutMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/lnUrl.generated.tsx b/src/graphql/mutations/__generated__/lnUrl.generated.tsx index 497211d0..a188fe7e 100644 --- a/src/graphql/mutations/__generated__/lnUrl.generated.tsx +++ b/src/graphql/mutations/__generated__/lnUrl.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type FetchLnUrlMutationVariables = Types.Exact<{ url: Types.Scalars['String']; }>; @@ -103,7 +104,8 @@ export type FetchLnUrlMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(FetchLnUrlDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(FetchLnUrlDocument, options); } export type FetchLnUrlMutationHookResult = ReturnType; export type FetchLnUrlMutationResult = Apollo.MutationResult; @@ -136,7 +138,8 @@ export type AuthLnUrlMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(AuthLnUrlDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(AuthLnUrlDocument, options); } export type AuthLnUrlMutationHookResult = ReturnType; export type AuthLnUrlMutationResult = Apollo.MutationResult; @@ -175,7 +178,8 @@ export type PayLnUrlMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(PayLnUrlDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(PayLnUrlDocument, options); } export type PayLnUrlMutationHookResult = ReturnType; export type PayLnUrlMutationResult = Apollo.MutationResult; @@ -213,7 +217,8 @@ export type WithdrawLnUrlMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(WithdrawLnUrlDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(WithdrawLnUrlDocument, options); } export type WithdrawLnUrlMutationHookResult = ReturnType; export type WithdrawLnUrlMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/logout.generated.tsx b/src/graphql/mutations/__generated__/logout.generated.tsx index 8dd377e7..ae9eb3b0 100644 --- a/src/graphql/mutations/__generated__/logout.generated.tsx +++ b/src/graphql/mutations/__generated__/logout.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type LogoutMutationVariables = Types.Exact<{ [key: string]: never; }>; @@ -36,7 +37,8 @@ export type LogoutMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(LogoutDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(LogoutDocument, options); } export type LogoutMutationHookResult = ReturnType; export type LogoutMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/openChannel.generated.tsx b/src/graphql/mutations/__generated__/openChannel.generated.tsx index aceb9d01..cddd4201 100644 --- a/src/graphql/mutations/__generated__/openChannel.generated.tsx +++ b/src/graphql/mutations/__generated__/openChannel.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type OpenChannelMutationVariables = Types.Exact<{ amount: Types.Scalars['Int']; partnerPublicKey: Types.Scalars['String']; @@ -59,7 +60,8 @@ export type OpenChannelMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(OpenChannelDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(OpenChannelDocument, options); } export type OpenChannelMutationHookResult = ReturnType; export type OpenChannelMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/payViaRoute.generated.tsx b/src/graphql/mutations/__generated__/payViaRoute.generated.tsx index ccf0e12a..1e78fa10 100644 --- a/src/graphql/mutations/__generated__/payViaRoute.generated.tsx +++ b/src/graphql/mutations/__generated__/payViaRoute.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type PayViaRouteMutationVariables = Types.Exact<{ route: Types.Scalars['String']; id: Types.Scalars['String']; @@ -41,7 +42,8 @@ export type PayViaRouteMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(PayViaRouteDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(PayViaRouteDocument, options); } export type PayViaRouteMutationHookResult = ReturnType; export type PayViaRouteMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/removePeer.generated.tsx b/src/graphql/mutations/__generated__/removePeer.generated.tsx index 61db0333..99d87c31 100644 --- a/src/graphql/mutations/__generated__/removePeer.generated.tsx +++ b/src/graphql/mutations/__generated__/removePeer.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type RemovePeerMutationVariables = Types.Exact<{ publicKey: Types.Scalars['String']; }>; @@ -39,7 +40,8 @@ export type RemovePeerMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(RemovePeerDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(RemovePeerDocument, options); } export type RemovePeerMutationHookResult = ReturnType; export type RemovePeerMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/sendMessage.generated.tsx b/src/graphql/mutations/__generated__/sendMessage.generated.tsx index 804b36b1..2bb9ce50 100644 --- a/src/graphql/mutations/__generated__/sendMessage.generated.tsx +++ b/src/graphql/mutations/__generated__/sendMessage.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type SendMessageMutationVariables = Types.Exact<{ publicKey: Types.Scalars['String']; message: Types.Scalars['String']; @@ -53,7 +54,8 @@ export type SendMessageMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(SendMessageDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(SendMessageDocument, options); } export type SendMessageMutationHookResult = ReturnType; export type SendMessageMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/sendToAddress.generated.tsx b/src/graphql/mutations/__generated__/sendToAddress.generated.tsx index 7be24231..a66db304 100644 --- a/src/graphql/mutations/__generated__/sendToAddress.generated.tsx +++ b/src/graphql/mutations/__generated__/sendToAddress.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type PayAddressMutationVariables = Types.Exact<{ address: Types.Scalars['String']; tokens?: Types.Maybe; @@ -62,7 +63,8 @@ export type PayAddressMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(PayAddressDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(PayAddressDocument, options); } export type PayAddressMutationHookResult = ReturnType; export type PayAddressMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/updateFees.generated.tsx b/src/graphql/mutations/__generated__/updateFees.generated.tsx index 9e4feef9..1848be65 100644 --- a/src/graphql/mutations/__generated__/updateFees.generated.tsx +++ b/src/graphql/mutations/__generated__/updateFees.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type UpdateFeesMutationVariables = Types.Exact<{ transaction_id?: Types.Maybe; transaction_vout?: Types.Maybe; @@ -59,7 +60,8 @@ export type UpdateFeesMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(UpdateFeesDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(UpdateFeesDocument, options); } export type UpdateFeesMutationHookResult = ReturnType; export type UpdateFeesMutationResult = Apollo.MutationResult; diff --git a/src/graphql/mutations/__generated__/updateMultipleFees.generated.tsx b/src/graphql/mutations/__generated__/updateMultipleFees.generated.tsx index 6ec9a6e3..b93864b4 100644 --- a/src/graphql/mutations/__generated__/updateMultipleFees.generated.tsx +++ b/src/graphql/mutations/__generated__/updateMultipleFees.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type UpdateMultipleFeesMutationVariables = Types.Exact<{ channels: Array | Types.ChannelDetailInput; }>; @@ -39,7 +40,8 @@ export type UpdateMultipleFeesMutationFn = Apollo.MutationFunction) { - return Apollo.useMutation(UpdateMultipleFeesDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(UpdateMultipleFeesDocument, options); } export type UpdateMultipleFeesMutationHookResult = ReturnType; export type UpdateMultipleFeesMutationResult = Apollo.MutationResult; diff --git a/src/graphql/queries/__generated__/adminCheck.generated.tsx b/src/graphql/queries/__generated__/adminCheck.generated.tsx index 7147c378..bf2cffb4 100644 --- a/src/graphql/queries/__generated__/adminCheck.generated.tsx +++ b/src/graphql/queries/__generated__/adminCheck.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetCanAdminQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -34,10 +35,12 @@ export const GetCanAdminDocument = gql` * }); */ export function useGetCanAdminQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetCanAdminDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetCanAdminDocument, options); } export function useGetCanAdminLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetCanAdminDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetCanAdminDocument, options); } export type GetCanAdminQueryHookResult = ReturnType; export type GetCanAdminLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/decodeRequest.generated.tsx b/src/graphql/queries/__generated__/decodeRequest.generated.tsx index 3fd00b80..b42a3605 100644 --- a/src/graphql/queries/__generated__/decodeRequest.generated.tsx +++ b/src/graphql/queries/__generated__/decodeRequest.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type DecodeRequestQueryVariables = Types.Exact<{ request: Types.Scalars['String']; }>; @@ -115,10 +116,12 @@ export const DecodeRequestDocument = gql` * }); */ export function useDecodeRequestQuery(baseOptions: Apollo.QueryHookOptions) { - return Apollo.useQuery(DecodeRequestDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(DecodeRequestDocument, options); } export function useDecodeRequestLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(DecodeRequestDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(DecodeRequestDocument, options); } export type DecodeRequestQueryHookResult = ReturnType; export type DecodeRequestLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getAccount.generated.tsx b/src/graphql/queries/__generated__/getAccount.generated.tsx index e7d31c38..16ba8304 100644 --- a/src/graphql/queries/__generated__/getAccount.generated.tsx +++ b/src/graphql/queries/__generated__/getAccount.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetAccountQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -42,10 +43,12 @@ export const GetAccountDocument = gql` * }); */ export function useGetAccountQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetAccountDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetAccountDocument, options); } export function useGetAccountLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetAccountDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetAccountDocument, options); } export type GetAccountQueryHookResult = ReturnType; export type GetAccountLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getAccountingReport.generated.tsx b/src/graphql/queries/__generated__/getAccountingReport.generated.tsx index ca831c21..9d43c5d1 100644 --- a/src/graphql/queries/__generated__/getAccountingReport.generated.tsx +++ b/src/graphql/queries/__generated__/getAccountingReport.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetAccountingReportQueryVariables = Types.Exact<{ category?: Types.Maybe; currency?: Types.Maybe; @@ -51,10 +52,12 @@ export const GetAccountingReportDocument = gql` * }); */ export function useGetAccountingReportQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetAccountingReportDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetAccountingReportDocument, options); } export function useGetAccountingReportLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetAccountingReportDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetAccountingReportDocument, options); } export type GetAccountingReportQueryHookResult = ReturnType; export type GetAccountingReportLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getBackups.generated.tsx b/src/graphql/queries/__generated__/getBackups.generated.tsx index 1dd5de98..b00cb661 100644 --- a/src/graphql/queries/__generated__/getBackups.generated.tsx +++ b/src/graphql/queries/__generated__/getBackups.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetBackupsQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -34,10 +35,12 @@ export const GetBackupsDocument = gql` * }); */ export function useGetBackupsQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetBackupsDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetBackupsDocument, options); } export function useGetBackupsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetBackupsDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetBackupsDocument, options); } export type GetBackupsQueryHookResult = ReturnType; export type GetBackupsLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getBaseCanConnect.generated.tsx b/src/graphql/queries/__generated__/getBaseCanConnect.generated.tsx index cf3678b2..e1f02100 100644 --- a/src/graphql/queries/__generated__/getBaseCanConnect.generated.tsx +++ b/src/graphql/queries/__generated__/getBaseCanConnect.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetBaseCanConnectQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -34,10 +35,12 @@ export const GetBaseCanConnectDocument = gql` * }); */ export function useGetBaseCanConnectQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetBaseCanConnectDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetBaseCanConnectDocument, options); } export function useGetBaseCanConnectLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetBaseCanConnectDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetBaseCanConnectDocument, options); } export type GetBaseCanConnectQueryHookResult = ReturnType; export type GetBaseCanConnectLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getBaseInfo.generated.tsx b/src/graphql/queries/__generated__/getBaseInfo.generated.tsx index 59b92100..8beba91c 100644 --- a/src/graphql/queries/__generated__/getBaseInfo.generated.tsx +++ b/src/graphql/queries/__generated__/getBaseInfo.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetBaseInfoQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -41,10 +42,12 @@ export const GetBaseInfoDocument = gql` * }); */ export function useGetBaseInfoQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetBaseInfoDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetBaseInfoDocument, options); } export function useGetBaseInfoLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetBaseInfoDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetBaseInfoDocument, options); } export type GetBaseInfoQueryHookResult = ReturnType; export type GetBaseInfoLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getBaseNodes.generated.tsx b/src/graphql/queries/__generated__/getBaseNodes.generated.tsx index 757c1e82..7eb0a9a1 100644 --- a/src/graphql/queries/__generated__/getBaseNodes.generated.tsx +++ b/src/graphql/queries/__generated__/getBaseNodes.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetBaseNodesQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -42,10 +43,12 @@ export const GetBaseNodesDocument = gql` * }); */ export function useGetBaseNodesQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetBaseNodesDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetBaseNodesDocument, options); } export function useGetBaseNodesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetBaseNodesDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetBaseNodesDocument, options); } export type GetBaseNodesQueryHookResult = ReturnType; export type GetBaseNodesLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getBasePoints.generated.tsx b/src/graphql/queries/__generated__/getBasePoints.generated.tsx index be366e01..fd684f20 100644 --- a/src/graphql/queries/__generated__/getBasePoints.generated.tsx +++ b/src/graphql/queries/__generated__/getBasePoints.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetBasePointsQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -40,10 +41,12 @@ export const GetBasePointsDocument = gql` * }); */ export function useGetBasePointsQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetBasePointsDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetBasePointsDocument, options); } export function useGetBasePointsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetBasePointsDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetBasePointsDocument, options); } export type GetBasePointsQueryHookResult = ReturnType; export type GetBasePointsLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getBitcoinFees.generated.tsx b/src/graphql/queries/__generated__/getBitcoinFees.generated.tsx index adc76437..f809f285 100644 --- a/src/graphql/queries/__generated__/getBitcoinFees.generated.tsx +++ b/src/graphql/queries/__generated__/getBitcoinFees.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetBitcoinFeesQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -41,10 +42,12 @@ export const GetBitcoinFeesDocument = gql` * }); */ export function useGetBitcoinFeesQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetBitcoinFeesDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetBitcoinFeesDocument, options); } export function useGetBitcoinFeesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetBitcoinFeesDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetBitcoinFeesDocument, options); } export type GetBitcoinFeesQueryHookResult = ReturnType; export type GetBitcoinFeesLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getBitcoinPrice.generated.tsx b/src/graphql/queries/__generated__/getBitcoinPrice.generated.tsx index 05c83e67..75553e17 100644 --- a/src/graphql/queries/__generated__/getBitcoinPrice.generated.tsx +++ b/src/graphql/queries/__generated__/getBitcoinPrice.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetBitcoinPriceQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -34,10 +35,12 @@ export const GetBitcoinPriceDocument = gql` * }); */ export function useGetBitcoinPriceQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetBitcoinPriceDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetBitcoinPriceDocument, options); } export function useGetBitcoinPriceLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetBitcoinPriceDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetBitcoinPriceDocument, options); } export type GetBitcoinPriceQueryHookResult = ReturnType; export type GetBitcoinPriceLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getBoltzInfo.generated.tsx b/src/graphql/queries/__generated__/getBoltzInfo.generated.tsx index 182272a0..46100ef7 100644 --- a/src/graphql/queries/__generated__/getBoltzInfo.generated.tsx +++ b/src/graphql/queries/__generated__/getBoltzInfo.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetBoltzInfoQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -41,10 +42,12 @@ export const GetBoltzInfoDocument = gql` * }); */ export function useGetBoltzInfoQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetBoltzInfoDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetBoltzInfoDocument, options); } export function useGetBoltzInfoLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetBoltzInfoDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetBoltzInfoDocument, options); } export type GetBoltzInfoQueryHookResult = ReturnType; export type GetBoltzInfoLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getBoltzSwapStatus.generated.tsx b/src/graphql/queries/__generated__/getBoltzSwapStatus.generated.tsx index 9f2d4a3e..ff8cf07f 100644 --- a/src/graphql/queries/__generated__/getBoltzSwapStatus.generated.tsx +++ b/src/graphql/queries/__generated__/getBoltzSwapStatus.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetBoltzSwapStatusQueryVariables = Types.Exact<{ ids: Array> | Types.Maybe; }>; @@ -58,10 +59,12 @@ export const GetBoltzSwapStatusDocument = gql` * }); */ export function useGetBoltzSwapStatusQuery(baseOptions: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetBoltzSwapStatusDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetBoltzSwapStatusDocument, options); } export function useGetBoltzSwapStatusLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetBoltzSwapStatusDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetBoltzSwapStatusDocument, options); } export type GetBoltzSwapStatusQueryHookResult = ReturnType; export type GetBoltzSwapStatusLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getBosNodeScores.generated.tsx b/src/graphql/queries/__generated__/getBosNodeScores.generated.tsx index f460d060..da60ce50 100644 --- a/src/graphql/queries/__generated__/getBosNodeScores.generated.tsx +++ b/src/graphql/queries/__generated__/getBosNodeScores.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetBosNodeScoresQueryVariables = Types.Exact<{ publicKey: Types.Scalars['String']; }>; @@ -46,10 +47,12 @@ export const GetBosNodeScoresDocument = gql` * }); */ export function useGetBosNodeScoresQuery(baseOptions: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetBosNodeScoresDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetBosNodeScoresDocument, options); } export function useGetBosNodeScoresLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetBosNodeScoresDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetBosNodeScoresDocument, options); } export type GetBosNodeScoresQueryHookResult = ReturnType; export type GetBosNodeScoresLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getBosScores.generated.tsx b/src/graphql/queries/__generated__/getBosScores.generated.tsx index 2574ed68..1a20c522 100644 --- a/src/graphql/queries/__generated__/getBosScores.generated.tsx +++ b/src/graphql/queries/__generated__/getBosScores.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetBosScoresQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -50,10 +51,12 @@ export const GetBosScoresDocument = gql` * }); */ export function useGetBosScoresQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetBosScoresDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetBosScoresDocument, options); } export function useGetBosScoresLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetBosScoresDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetBosScoresDocument, options); } export type GetBosScoresQueryHookResult = ReturnType; export type GetBosScoresLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getChainTransactions.generated.tsx b/src/graphql/queries/__generated__/getChainTransactions.generated.tsx index 92154261..ecbcea8e 100644 --- a/src/graphql/queries/__generated__/getChainTransactions.generated.tsx +++ b/src/graphql/queries/__generated__/getChainTransactions.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetChainTransactionsQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -46,10 +47,12 @@ export const GetChainTransactionsDocument = gql` * }); */ export function useGetChainTransactionsQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetChainTransactionsDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetChainTransactionsDocument, options); } export function useGetChainTransactionsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetChainTransactionsDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetChainTransactionsDocument, options); } export type GetChainTransactionsQueryHookResult = ReturnType; export type GetChainTransactionsLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getChannel.generated.tsx b/src/graphql/queries/__generated__/getChannel.generated.tsx new file mode 100644 index 00000000..a25986f5 --- /dev/null +++ b/src/graphql/queries/__generated__/getChannel.generated.tsx @@ -0,0 +1,72 @@ +/* eslint-disable */ +import * as Types from '../../types'; + +import { gql } from '@apollo/client'; +import * as Apollo from '@apollo/client'; +const defaultOptions = {} +export type GetChannelQueryVariables = Types.Exact<{ + id: Types.Scalars['String']; + pubkey?: Types.Maybe; +}>; + + +export type GetChannelQuery = ( + { __typename?: 'Query' } + & { getChannel: ( + { __typename?: 'singleChannelType' } + & { partner_node_policies?: Types.Maybe<( + { __typename?: 'nodePolicyType' } + & { node?: Types.Maybe<( + { __typename?: 'Node' } + & { node: ( + { __typename?: 'nodeType' } + & Pick + ) } + )> } + )> } + ) } +); + + +export const GetChannelDocument = gql` + query GetChannel($id: String!, $pubkey: String) { + getChannel(id: $id, pubkey: $pubkey) { + partner_node_policies { + node { + node { + alias + } + } + } + } +} + `; + +/** + * __useGetChannelQuery__ + * + * To run a query within a React component, call `useGetChannelQuery` and pass it any options that fit your needs. + * When your component renders, `useGetChannelQuery` 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 } = useGetChannelQuery({ + * variables: { + * id: // value for 'id' + * pubkey: // value for 'pubkey' + * }, + * }); + */ +export function useGetChannelQuery(baseOptions: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetChannelDocument, options); + } +export function useGetChannelLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetChannelDocument, options); + } +export type GetChannelQueryHookResult = ReturnType; +export type GetChannelLazyQueryHookResult = ReturnType; +export type GetChannelQueryResult = Apollo.QueryResult; \ No newline at end of file diff --git a/src/graphql/queries/__generated__/getChannelFees.generated.tsx b/src/graphql/queries/__generated__/getChannelFees.generated.tsx index f5a842de..63f46ee5 100644 --- a/src/graphql/queries/__generated__/getChannelFees.generated.tsx +++ b/src/graphql/queries/__generated__/getChannelFees.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type ChannelFeesQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -80,10 +81,12 @@ export const ChannelFeesDocument = gql` * }); */ export function useChannelFeesQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(ChannelFeesDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(ChannelFeesDocument, options); } export function useChannelFeesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(ChannelFeesDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(ChannelFeesDocument, options); } export type ChannelFeesQueryHookResult = ReturnType; export type ChannelFeesLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getChannelReport.generated.tsx b/src/graphql/queries/__generated__/getChannelReport.generated.tsx index 60fcc6a8..1342cf31 100644 --- a/src/graphql/queries/__generated__/getChannelReport.generated.tsx +++ b/src/graphql/queries/__generated__/getChannelReport.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetLiquidReportQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -46,10 +47,12 @@ export const GetLiquidReportDocument = gql` * }); */ export function useGetLiquidReportQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetLiquidReportDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetLiquidReportDocument, options); } export function useGetLiquidReportLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetLiquidReportDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetLiquidReportDocument, options); } export type GetLiquidReportQueryHookResult = ReturnType; export type GetLiquidReportLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getChannels.generated.tsx b/src/graphql/queries/__generated__/getChannels.generated.tsx index 103c9ced..76df3fe6 100644 --- a/src/graphql/queries/__generated__/getChannels.generated.tsx +++ b/src/graphql/queries/__generated__/getChannels.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetChannelsQueryVariables = Types.Exact<{ active?: Types.Maybe; }>; @@ -124,10 +125,12 @@ export const GetChannelsDocument = gql` * }); */ export function useGetChannelsQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetChannelsDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetChannelsDocument, options); } export function useGetChannelsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetChannelsDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetChannelsDocument, options); } export type GetChannelsQueryHookResult = ReturnType; export type GetChannelsLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getClosedChannels.generated.tsx b/src/graphql/queries/__generated__/getClosedChannels.generated.tsx index 510a406c..f8f0b40c 100644 --- a/src/graphql/queries/__generated__/getClosedChannels.generated.tsx +++ b/src/graphql/queries/__generated__/getClosedChannels.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetClosedChannelsQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -69,10 +70,12 @@ export const GetClosedChannelsDocument = gql` * }); */ export function useGetClosedChannelsQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetClosedChannelsDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetClosedChannelsDocument, options); } export function useGetClosedChannelsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetClosedChannelsDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetClosedChannelsDocument, options); } export type GetClosedChannelsQueryHookResult = ReturnType; export type GetClosedChannelsLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getFeeHealth.generated.tsx b/src/graphql/queries/__generated__/getFeeHealth.generated.tsx index f9c55d71..0bef24b1 100644 --- a/src/graphql/queries/__generated__/getFeeHealth.generated.tsx +++ b/src/graphql/queries/__generated__/getFeeHealth.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetFeeHealthQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -82,10 +83,12 @@ export const GetFeeHealthDocument = gql` * }); */ export function useGetFeeHealthQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetFeeHealthDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetFeeHealthDocument, options); } export function useGetFeeHealthLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetFeeHealthDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetFeeHealthDocument, options); } export type GetFeeHealthQueryHookResult = ReturnType; export type GetFeeHealthLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getForwards.generated.tsx b/src/graphql/queries/__generated__/getForwards.generated.tsx new file mode 100644 index 00000000..c9bc7fc1 --- /dev/null +++ b/src/graphql/queries/__generated__/getForwards.generated.tsx @@ -0,0 +1,61 @@ +/* eslint-disable */ +import * as Types from '../../types'; + +import { gql } from '@apollo/client'; +import * as Apollo from '@apollo/client'; +const defaultOptions = {} +export type GetForwardsQueryVariables = Types.Exact<{ + days: Types.Scalars['Int']; +}>; + + +export type GetForwardsQuery = ( + { __typename?: 'Query' } + & { getForwards: Array + )>> } +); + + +export const GetForwardsDocument = gql` + query GetForwards($days: Int!) { + getForwards(days: $days) { + created_at + fee + fee_mtokens + incoming_channel + mtokens + outgoing_channel + tokens + } +} + `; + +/** + * __useGetForwardsQuery__ + * + * To run a query within a React component, call `useGetForwardsQuery` and pass it any options that fit your needs. + * When your component renders, `useGetForwardsQuery` 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 } = useGetForwardsQuery({ + * variables: { + * days: // value for 'days' + * }, + * }); + */ +export function useGetForwardsQuery(baseOptions: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetForwardsDocument, options); + } +export function useGetForwardsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetForwardsDocument, options); + } +export type GetForwardsQueryHookResult = ReturnType; +export type GetForwardsLazyQueryHookResult = ReturnType; +export type GetForwardsQueryResult = Apollo.QueryResult; \ No newline at end of file diff --git a/src/graphql/queries/__generated__/getForwardsPastDays.generated.tsx b/src/graphql/queries/__generated__/getForwardsPastDays.generated.tsx deleted file mode 100644 index 8e289a6a..00000000 --- a/src/graphql/queries/__generated__/getForwardsPastDays.generated.tsx +++ /dev/null @@ -1,75 +0,0 @@ -/* eslint-disable */ -import * as Types from '../../types'; - -import { gql } from '@apollo/client'; -import * as Apollo from '@apollo/client'; -export type GetForwardsPastDaysQueryVariables = Types.Exact<{ - days: Types.Scalars['Int']; -}>; - - -export type GetForwardsPastDaysQuery = ( - { __typename?: 'Query' } - & { getForwardsPastDays: Array - & { incoming_node?: Types.Maybe<( - { __typename?: 'ForwardNodeType' } - & Pick - )>, outgoing_node?: Types.Maybe<( - { __typename?: 'ForwardNodeType' } - & Pick - )> } - )>> } -); - - -export const GetForwardsPastDaysDocument = gql` - query GetForwardsPastDays($days: Int!) { - getForwardsPastDays(days: $days) { - created_at - fee - fee_mtokens - incoming_channel - mtokens - outgoing_channel - tokens - incoming_node { - alias - public_key - channel_id - } - outgoing_node { - alias - public_key - channel_id - } - } -} - `; - -/** - * __useGetForwardsPastDaysQuery__ - * - * To run a query within a React component, call `useGetForwardsPastDaysQuery` and pass it any options that fit your needs. - * When your component renders, `useGetForwardsPastDaysQuery` 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 } = useGetForwardsPastDaysQuery({ - * variables: { - * days: // value for 'days' - * }, - * }); - */ -export function useGetForwardsPastDaysQuery(baseOptions: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetForwardsPastDaysDocument, baseOptions); - } -export function useGetForwardsPastDaysLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetForwardsPastDaysDocument, baseOptions); - } -export type GetForwardsPastDaysQueryHookResult = ReturnType; -export type GetForwardsPastDaysLazyQueryHookResult = ReturnType; -export type GetForwardsPastDaysQueryResult = Apollo.QueryResult; \ No newline at end of file diff --git a/src/graphql/queries/__generated__/getInOut.generated.tsx b/src/graphql/queries/__generated__/getInOut.generated.tsx index 8696c772..d62a2c85 100644 --- a/src/graphql/queries/__generated__/getInOut.generated.tsx +++ b/src/graphql/queries/__generated__/getInOut.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetInOutQueryVariables = Types.Exact<{ time?: Types.Maybe; }>; @@ -45,10 +46,12 @@ export const GetInOutDocument = gql` * }); */ export function useGetInOutQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetInOutDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetInOutDocument, options); } export function useGetInOutLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetInOutDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetInOutDocument, options); } export type GetInOutQueryHookResult = ReturnType; export type GetInOutLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getInvoiceStatusChange.generated.tsx b/src/graphql/queries/__generated__/getInvoiceStatusChange.generated.tsx index 72654c18..eb22507e 100644 --- a/src/graphql/queries/__generated__/getInvoiceStatusChange.generated.tsx +++ b/src/graphql/queries/__generated__/getInvoiceStatusChange.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetInvoiceStatusChangeQueryVariables = Types.Exact<{ id: Types.Scalars['String']; }>; @@ -37,10 +38,12 @@ export const GetInvoiceStatusChangeDocument = gql` * }); */ export function useGetInvoiceStatusChangeQuery(baseOptions: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetInvoiceStatusChangeDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetInvoiceStatusChangeDocument, options); } export function useGetInvoiceStatusChangeLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetInvoiceStatusChangeDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetInvoiceStatusChangeDocument, options); } export type GetInvoiceStatusChangeQueryHookResult = ReturnType; export type GetInvoiceStatusChangeLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getLatestVersion.generated.tsx b/src/graphql/queries/__generated__/getLatestVersion.generated.tsx index 88fa6813..5c7c083f 100644 --- a/src/graphql/queries/__generated__/getLatestVersion.generated.tsx +++ b/src/graphql/queries/__generated__/getLatestVersion.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetLatestVersionQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -34,10 +35,12 @@ export const GetLatestVersionDocument = gql` * }); */ export function useGetLatestVersionQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetLatestVersionDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetLatestVersionDocument, options); } export function useGetLatestVersionLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetLatestVersionDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetLatestVersionDocument, options); } export type GetLatestVersionQueryHookResult = ReturnType; export type GetLatestVersionLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getLnMarketsStatus.generated.tsx b/src/graphql/queries/__generated__/getLnMarketsStatus.generated.tsx index 9d58a1d0..ccafcf36 100644 --- a/src/graphql/queries/__generated__/getLnMarketsStatus.generated.tsx +++ b/src/graphql/queries/__generated__/getLnMarketsStatus.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetLnMarketsStatusQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -34,10 +35,12 @@ export const GetLnMarketsStatusDocument = gql` * }); */ export function useGetLnMarketsStatusQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetLnMarketsStatusDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetLnMarketsStatusDocument, options); } export function useGetLnMarketsStatusLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetLnMarketsStatusDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetLnMarketsStatusDocument, options); } export type GetLnMarketsStatusQueryHookResult = ReturnType; export type GetLnMarketsStatusLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getLnMarketsUrl.generated.tsx b/src/graphql/queries/__generated__/getLnMarketsUrl.generated.tsx index c65a7f6a..447332d9 100644 --- a/src/graphql/queries/__generated__/getLnMarketsUrl.generated.tsx +++ b/src/graphql/queries/__generated__/getLnMarketsUrl.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetLnMarketsUrlQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -34,10 +35,12 @@ export const GetLnMarketsUrlDocument = gql` * }); */ export function useGetLnMarketsUrlQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetLnMarketsUrlDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetLnMarketsUrlDocument, options); } export function useGetLnMarketsUrlLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetLnMarketsUrlDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetLnMarketsUrlDocument, options); } export type GetLnMarketsUrlQueryHookResult = ReturnType; export type GetLnMarketsUrlLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getLnMarketsUserInfo.generated.tsx b/src/graphql/queries/__generated__/getLnMarketsUserInfo.generated.tsx index 82b15a52..b80765ef 100644 --- a/src/graphql/queries/__generated__/getLnMarketsUserInfo.generated.tsx +++ b/src/graphql/queries/__generated__/getLnMarketsUserInfo.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetLnMarketsUserInfoQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -44,10 +45,12 @@ export const GetLnMarketsUserInfoDocument = gql` * }); */ export function useGetLnMarketsUserInfoQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetLnMarketsUserInfoDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetLnMarketsUserInfoDocument, options); } export function useGetLnMarketsUserInfoLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetLnMarketsUserInfoDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetLnMarketsUserInfoDocument, options); } export type GetLnMarketsUserInfoQueryHookResult = ReturnType; export type GetLnMarketsUserInfoLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getMessages.generated.tsx b/src/graphql/queries/__generated__/getMessages.generated.tsx index 514f38e4..07987574 100644 --- a/src/graphql/queries/__generated__/getMessages.generated.tsx +++ b/src/graphql/queries/__generated__/getMessages.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetMessagesQueryVariables = Types.Exact<{ initialize?: Types.Maybe; lastMessage?: Types.Maybe; @@ -58,10 +59,12 @@ export const GetMessagesDocument = gql` * }); */ export function useGetMessagesQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetMessagesDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetMessagesDocument, options); } export function useGetMessagesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetMessagesDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetMessagesDocument, options); } export type GetMessagesQueryHookResult = ReturnType; export type GetMessagesLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getNetworkInfo.generated.tsx b/src/graphql/queries/__generated__/getNetworkInfo.generated.tsx index 31b78b86..cdf5c9d6 100644 --- a/src/graphql/queries/__generated__/getNetworkInfo.generated.tsx +++ b/src/graphql/queries/__generated__/getNetworkInfo.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetNetworkInfoQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -46,10 +47,12 @@ export const GetNetworkInfoDocument = gql` * }); */ export function useGetNetworkInfoQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetNetworkInfoDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetNetworkInfoDocument, options); } export function useGetNetworkInfoLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetNetworkInfoDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetNetworkInfoDocument, options); } export type GetNetworkInfoQueryHookResult = ReturnType; export type GetNetworkInfoLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getNode.generated.tsx b/src/graphql/queries/__generated__/getNode.generated.tsx index 83c84a13..0c21936c 100644 --- a/src/graphql/queries/__generated__/getNode.generated.tsx +++ b/src/graphql/queries/__generated__/getNode.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetNodeQueryVariables = Types.Exact<{ publicKey: Types.Scalars['String']; withoutChannels?: Types.Maybe; @@ -53,10 +54,12 @@ export const GetNodeDocument = gql` * }); */ export function useGetNodeQuery(baseOptions: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetNodeDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetNodeDocument, options); } export function useGetNodeLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetNodeDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetNodeDocument, options); } export type GetNodeQueryHookResult = ReturnType; export type GetNodeLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getNodeInfo.generated.tsx b/src/graphql/queries/__generated__/getNodeInfo.generated.tsx index cad825f5..ede95f85 100644 --- a/src/graphql/queries/__generated__/getNodeInfo.generated.tsx +++ b/src/graphql/queries/__generated__/getNodeInfo.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetCanConnectQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -84,10 +85,12 @@ export const GetCanConnectDocument = gql` * }); */ export function useGetCanConnectQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetCanConnectDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetCanConnectDocument, options); } export function useGetCanConnectLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetCanConnectDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetCanConnectDocument, options); } export type GetCanConnectQueryHookResult = ReturnType; export type GetCanConnectLazyQueryHookResult = ReturnType; @@ -131,10 +134,12 @@ export const GetNodeInfoDocument = gql` * }); */ export function useGetNodeInfoQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetNodeInfoDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetNodeInfoDocument, options); } export function useGetNodeInfoLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetNodeInfoDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetNodeInfoDocument, options); } export type GetNodeInfoQueryHookResult = ReturnType; export type GetNodeInfoLazyQueryHookResult = ReturnType; @@ -165,10 +170,12 @@ export const GetChannelAmountInfoDocument = gql` * }); */ export function useGetChannelAmountInfoQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetChannelAmountInfoDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetChannelAmountInfoDocument, options); } export function useGetChannelAmountInfoLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetChannelAmountInfoDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetChannelAmountInfoDocument, options); } export type GetChannelAmountInfoQueryHookResult = ReturnType; export type GetChannelAmountInfoLazyQueryHookResult = ReturnType; @@ -199,10 +206,12 @@ export const GetCanConnectInfoDocument = gql` * }); */ export function useGetCanConnectInfoQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetCanConnectInfoDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetCanConnectInfoDocument, options); } export function useGetCanConnectInfoLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetCanConnectInfoDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetCanConnectInfoDocument, options); } export type GetCanConnectInfoQueryHookResult = ReturnType; export type GetCanConnectInfoLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getPeers.generated.tsx b/src/graphql/queries/__generated__/getPeers.generated.tsx index 00b3fe29..e101f9ed 100644 --- a/src/graphql/queries/__generated__/getPeers.generated.tsx +++ b/src/graphql/queries/__generated__/getPeers.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetPeersQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -63,10 +64,12 @@ export const GetPeersDocument = gql` * }); */ export function useGetPeersQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetPeersDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetPeersDocument, options); } export function useGetPeersLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetPeersDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetPeersDocument, options); } export type GetPeersQueryHookResult = ReturnType; export type GetPeersLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getPendingChannels.generated.tsx b/src/graphql/queries/__generated__/getPendingChannels.generated.tsx index aec19232..b4f7484f 100644 --- a/src/graphql/queries/__generated__/getPendingChannels.generated.tsx +++ b/src/graphql/queries/__generated__/getPendingChannels.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetPendingChannelsQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -68,10 +69,12 @@ export const GetPendingChannelsDocument = gql` * }); */ export function useGetPendingChannelsQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetPendingChannelsDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetPendingChannelsDocument, options); } export function useGetPendingChannelsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetPendingChannelsDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetPendingChannelsDocument, options); } export type GetPendingChannelsQueryHookResult = ReturnType; export type GetPendingChannelsLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getResume.generated.tsx b/src/graphql/queries/__generated__/getResume.generated.tsx index 96c45336..93a77541 100644 --- a/src/graphql/queries/__generated__/getResume.generated.tsx +++ b/src/graphql/queries/__generated__/getResume.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetResumeQueryVariables = Types.Exact<{ token?: Types.Maybe; }>; @@ -114,10 +115,12 @@ export const GetResumeDocument = gql` * }); */ export function useGetResumeQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetResumeDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetResumeDocument, options); } export function useGetResumeLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetResumeDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetResumeDocument, options); } export type GetResumeQueryHookResult = ReturnType; export type GetResumeLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getRoutes.generated.tsx b/src/graphql/queries/__generated__/getRoutes.generated.tsx index 19a50547..ba4f3f4c 100644 --- a/src/graphql/queries/__generated__/getRoutes.generated.tsx +++ b/src/graphql/queries/__generated__/getRoutes.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetRoutesQueryVariables = Types.Exact<{ outgoing: Types.Scalars['String']; incoming: Types.Scalars['String']; @@ -74,10 +75,12 @@ export const GetRoutesDocument = gql` * }); */ export function useGetRoutesQuery(baseOptions: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetRoutesDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetRoutesDocument, options); } export function useGetRoutesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetRoutesDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetRoutesDocument, options); } export type GetRoutesQueryHookResult = ReturnType; export type GetRoutesLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getServerAccounts.generated.tsx b/src/graphql/queries/__generated__/getServerAccounts.generated.tsx index 59565171..f8965766 100644 --- a/src/graphql/queries/__generated__/getServerAccounts.generated.tsx +++ b/src/graphql/queries/__generated__/getServerAccounts.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetServerAccountsQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -42,10 +43,12 @@ export const GetServerAccountsDocument = gql` * }); */ export function useGetServerAccountsQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetServerAccountsDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetServerAccountsDocument, options); } export function useGetServerAccountsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetServerAccountsDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetServerAccountsDocument, options); } export type GetServerAccountsQueryHookResult = ReturnType; export type GetServerAccountsLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getTimeHealth.generated.tsx b/src/graphql/queries/__generated__/getTimeHealth.generated.tsx index 9bb6d965..0d518958 100644 --- a/src/graphql/queries/__generated__/getTimeHealth.generated.tsx +++ b/src/graphql/queries/__generated__/getTimeHealth.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetTimeHealthQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -63,10 +64,12 @@ export const GetTimeHealthDocument = gql` * }); */ export function useGetTimeHealthQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetTimeHealthDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetTimeHealthDocument, options); } export function useGetTimeHealthLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetTimeHealthDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetTimeHealthDocument, options); } export type GetTimeHealthQueryHookResult = ReturnType; export type GetTimeHealthLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getUtxos.generated.tsx b/src/graphql/queries/__generated__/getUtxos.generated.tsx index a9be8bab..c6600b9a 100644 --- a/src/graphql/queries/__generated__/getUtxos.generated.tsx +++ b/src/graphql/queries/__generated__/getUtxos.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetUtxosQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -45,10 +46,12 @@ export const GetUtxosDocument = gql` * }); */ export function useGetUtxosQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetUtxosDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetUtxosDocument, options); } export function useGetUtxosLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetUtxosDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetUtxosDocument, options); } export type GetUtxosQueryHookResult = ReturnType; export type GetUtxosLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getVolumeHealth.generated.tsx b/src/graphql/queries/__generated__/getVolumeHealth.generated.tsx index e5d7c91c..d21d4753 100644 --- a/src/graphql/queries/__generated__/getVolumeHealth.generated.tsx +++ b/src/graphql/queries/__generated__/getVolumeHealth.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetVolumeHealthQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -61,10 +62,12 @@ export const GetVolumeHealthDocument = gql` * }); */ export function useGetVolumeHealthQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetVolumeHealthDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetVolumeHealthDocument, options); } export function useGetVolumeHealthLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetVolumeHealthDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetVolumeHealthDocument, options); } export type GetVolumeHealthQueryHookResult = ReturnType; export type GetVolumeHealthLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/getWalletInfo.generated.tsx b/src/graphql/queries/__generated__/getWalletInfo.generated.tsx index 279eebbb..30a647aa 100644 --- a/src/graphql/queries/__generated__/getWalletInfo.generated.tsx +++ b/src/graphql/queries/__generated__/getWalletInfo.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type GetWalletInfoQueryVariables = Types.Exact<{ [key: string]: never; }>; @@ -47,10 +48,12 @@ export const GetWalletInfoDocument = gql` * }); */ export function useGetWalletInfoQuery(baseOptions?: Apollo.QueryHookOptions) { - return Apollo.useQuery(GetWalletInfoDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetWalletInfoDocument, options); } export function useGetWalletInfoLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(GetWalletInfoDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetWalletInfoDocument, options); } export type GetWalletInfoQueryHookResult = ReturnType; export type GetWalletInfoLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/recoverFunds.generated.tsx b/src/graphql/queries/__generated__/recoverFunds.generated.tsx index f6cc73a3..fb191a6a 100644 --- a/src/graphql/queries/__generated__/recoverFunds.generated.tsx +++ b/src/graphql/queries/__generated__/recoverFunds.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type RecoverFundsQueryVariables = Types.Exact<{ backup: Types.Scalars['String']; }>; @@ -37,10 +38,12 @@ export const RecoverFundsDocument = gql` * }); */ export function useRecoverFundsQuery(baseOptions: Apollo.QueryHookOptions) { - return Apollo.useQuery(RecoverFundsDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(RecoverFundsDocument, options); } export function useRecoverFundsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(RecoverFundsDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(RecoverFundsDocument, options); } export type RecoverFundsQueryHookResult = ReturnType; export type RecoverFundsLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/signMessage.generated.tsx b/src/graphql/queries/__generated__/signMessage.generated.tsx index 1605ee15..9d54e2fb 100644 --- a/src/graphql/queries/__generated__/signMessage.generated.tsx +++ b/src/graphql/queries/__generated__/signMessage.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type SignMessageQueryVariables = Types.Exact<{ message: Types.Scalars['String']; }>; @@ -37,10 +38,12 @@ export const SignMessageDocument = gql` * }); */ export function useSignMessageQuery(baseOptions: Apollo.QueryHookOptions) { - return Apollo.useQuery(SignMessageDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(SignMessageDocument, options); } export function useSignMessageLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(SignMessageDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(SignMessageDocument, options); } export type SignMessageQueryHookResult = ReturnType; export type SignMessageLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/verifyBackups.generated.tsx b/src/graphql/queries/__generated__/verifyBackups.generated.tsx index e76cca25..fc203b94 100644 --- a/src/graphql/queries/__generated__/verifyBackups.generated.tsx +++ b/src/graphql/queries/__generated__/verifyBackups.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type VerifyBackupsQueryVariables = Types.Exact<{ backup: Types.Scalars['String']; }>; @@ -37,10 +38,12 @@ export const VerifyBackupsDocument = gql` * }); */ export function useVerifyBackupsQuery(baseOptions: Apollo.QueryHookOptions) { - return Apollo.useQuery(VerifyBackupsDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(VerifyBackupsDocument, options); } export function useVerifyBackupsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(VerifyBackupsDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(VerifyBackupsDocument, options); } export type VerifyBackupsQueryHookResult = ReturnType; export type VerifyBackupsLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/__generated__/verifyMessage.generated.tsx b/src/graphql/queries/__generated__/verifyMessage.generated.tsx index 898f7a09..ab92d526 100644 --- a/src/graphql/queries/__generated__/verifyMessage.generated.tsx +++ b/src/graphql/queries/__generated__/verifyMessage.generated.tsx @@ -3,6 +3,7 @@ import * as Types from '../../types'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; +const defaultOptions = {} export type VerifyMessageQueryVariables = Types.Exact<{ message: Types.Scalars['String']; signature: Types.Scalars['String']; @@ -39,10 +40,12 @@ export const VerifyMessageDocument = gql` * }); */ export function useVerifyMessageQuery(baseOptions: Apollo.QueryHookOptions) { - return Apollo.useQuery(VerifyMessageDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(VerifyMessageDocument, options); } export function useVerifyMessageLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - return Apollo.useLazyQuery(VerifyMessageDocument, baseOptions); + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(VerifyMessageDocument, options); } export type VerifyMessageQueryHookResult = ReturnType; export type VerifyMessageLazyQueryHookResult = ReturnType; diff --git a/src/graphql/queries/getChannel.ts b/src/graphql/queries/getChannel.ts new file mode 100644 index 00000000..8da48020 --- /dev/null +++ b/src/graphql/queries/getChannel.ts @@ -0,0 +1,15 @@ +import { gql } from '@apollo/client'; + +export const GET_CHANNEL = gql` + query GetChannel($id: String!, $pubkey: String) { + getChannel(id: $id, pubkey: $pubkey) { + partner_node_policies { + node { + node { + alias + } + } + } + } + } +`; diff --git a/src/graphql/queries/getForwards.ts b/src/graphql/queries/getForwards.ts new file mode 100644 index 00000000..facb8005 --- /dev/null +++ b/src/graphql/queries/getForwards.ts @@ -0,0 +1,15 @@ +import { gql } from '@apollo/client'; + +export const GET_FORWARDS = gql` + query GetForwards($days: Int!) { + getForwards(days: $days) { + created_at + fee + fee_mtokens + incoming_channel + mtokens + outgoing_channel + tokens + } + } +`; diff --git a/src/graphql/queries/getForwardsPastDays.ts b/src/graphql/queries/getForwardsPastDays.ts deleted file mode 100644 index 3d95c935..00000000 --- a/src/graphql/queries/getForwardsPastDays.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { gql } from '@apollo/client'; - -export const GET_FORWARDS_PAST_DAYS = gql` - query GetForwardsPastDays($days: Int!) { - getForwardsPastDays(days: $days) { - created_at - fee - fee_mtokens - incoming_channel - mtokens - outgoing_channel - tokens - incoming_node { - alias - public_key - channel_id - } - outgoing_node { - alias - public_key - channel_id - } - } - } -`; diff --git a/src/graphql/types.ts b/src/graphql/types.ts index bfe71baa..0ec3e456 100644 --- a/src/graphql/types.ts +++ b/src/graphql/types.ts @@ -60,6 +60,7 @@ export type Query = { getTimeHealth?: Maybe; getFeeHealth?: Maybe; getChannelBalance?: Maybe; + getChannel: SingleChannelType; getChannels: Array>; getClosedChannels?: Maybe>>; getPendingChannels?: Maybe>>; @@ -71,7 +72,7 @@ export type Query = { decodeRequest?: Maybe; getWalletInfo?: Maybe; getResume?: Maybe; - getForwardsPastDays: Array>; + getForwards: Array>; getBitcoinPrice?: Maybe; getBitcoinFees?: Maybe; getForwardChannelsReport?: Maybe; @@ -118,6 +119,12 @@ export type QueryGetAccountingReportArgs = { }; +export type QueryGetChannelArgs = { + id: Scalars['String']; + pubkey?: Maybe; +}; + + export type QueryGetChannelsArgs = { active?: Maybe; }; @@ -144,7 +151,7 @@ export type QueryGetResumeArgs = { }; -export type QueryGetForwardsPastDaysArgs = { +export type QueryGetForwardsArgs = { days: Scalars['Int']; }; @@ -830,8 +837,6 @@ export type Forward = { mtokens: Scalars['String']; outgoing_channel: Scalars['String']; tokens: Scalars['Int']; - incoming_node?: Maybe; - outgoing_node?: Maybe; }; export type ForwardNodeType = { diff --git a/src/views/forwards/ForwardTable.tsx b/src/views/forwards/ForwardTable.tsx index db4b2d76..93ad28fc 100644 --- a/src/views/forwards/ForwardTable.tsx +++ b/src/views/forwards/ForwardTable.tsx @@ -6,9 +6,10 @@ import { getPrice } from 'src/components/price/Price'; import { Table } from 'src/components/table'; import { useConfigState } from 'src/context/ConfigContext'; import { usePriceState } from 'src/context/PriceContext'; -import { useGetForwardsPastDaysQuery } from 'src/graphql/queries/__generated__/getForwardsPastDays.generated'; +import { useGetForwardsQuery } from 'src/graphql/queries/__generated__/getForwards.generated'; import { Forward } from 'src/graphql/types'; import { getErrorContent } from 'src/utils/error'; +import { ChannelAlias } from '../home/reports/forwardReport/ChannelAlias'; import { ReportType } from '../home/reports/forwardReport/ForwardReport'; import { sortByNode } from './helpers'; @@ -32,7 +33,7 @@ export const ForwardTable: FC<{ days: number; order: ReportType }> = ({ days, order, }) => { - const { data, loading } = useGetForwardsPastDaysQuery({ + const { data, loading } = useGetForwardsQuery({ ssr: false, variables: { days }, onError: error => toast.error(getErrorContent(error)), @@ -42,17 +43,18 @@ export const ForwardTable: FC<{ days: number; order: ReportType }> = ({ const priceContext = usePriceState(); const format = getPrice(currency, displayValues, priceContext); - if (loading || !data?.getForwardsPastDays?.length) { + if (loading || !data?.getForwards?.length) { return null; } const { final, maxIn, maxOut } = sortByNode( order, - data.getForwardsPastDays as Forward[] + data.getForwards as Forward[] ); const columns = [ { Header: 'Alias', accessor: 'alias' }, + { Header: 'Channel', accessor: 'channel' }, { Header: 'Incoming', accessor: 'incoming' }, { Header: 'Outgoing', accessor: 'outgoing' }, { Header: 'Incoming', accessor: 'incomingBar' }, @@ -61,6 +63,7 @@ export const ForwardTable: FC<{ days: number; order: ReportType }> = ({ const tableData = final.map(f => ({ ...f, + alias: , incoming: format({ amount: f.incoming, noUnit: order === 'amount' }), outgoing: format({ amount: f.outgoing, noUnit: order === 'amount' }), incomingBar: , diff --git a/src/views/forwards/ForwardsCard.tsx b/src/views/forwards/ForwardsCard.tsx index 18f53a8b..98eb458f 100644 --- a/src/views/forwards/ForwardsCard.tsx +++ b/src/views/forwards/ForwardsCard.tsx @@ -14,6 +14,7 @@ import { renderLine, } from '../../components/generic/helpers'; import { Price } from '../../components/price/Price'; +import { ChannelAlias } from '../home/reports/forwardReport/ChannelAlias'; interface ForwardCardProps { forward: Forward; @@ -35,15 +36,13 @@ export const ForwardCard = ({ incoming_channel, outgoing_channel, tokens, - incoming_node, - outgoing_node, } = forward; const formatAmount = ; const formatFee = ; - const incoming_name = incoming_node?.alias || incoming_channel; - const outgoing_name = outgoing_node?.alias || outgoing_channel; + const incoming_name = ; + const outgoing_name = ; const handleClick = () => { if (indexOpen === index) { diff --git a/src/views/forwards/forwardChord.tsx b/src/views/forwards/forwardChord.tsx index 373e0991..a43394a3 100644 --- a/src/views/forwards/forwardChord.tsx +++ b/src/views/forwards/forwardChord.tsx @@ -1,5 +1,4 @@ import React, { useEffect, useState } from 'react'; -import { useGetForwardsPastDaysQuery } from 'src/graphql/queries/__generated__/getForwardsPastDays.generated'; import { toast } from 'react-toastify'; import { getErrorContent } from 'src/utils/error'; import { Forward } from 'src/graphql/types'; @@ -18,6 +17,8 @@ import { getPrice } from 'src/components/price/Price'; import { useConfigState } from 'src/context/ConfigContext'; import { ReportType } from '../home/reports/forwardReport/ForwardReport'; import { getChordMatrix } from './helpers'; +import { useGetForwardsQuery } from 'src/graphql/queries/__generated__/getForwards.generated'; +import { ChannelAlias } from '../home/reports/forwardReport/ChannelAlias'; const Wrapper = styled.div` height: 800px; @@ -62,7 +63,7 @@ export const ForwardChord = ({ setSelected(null); }, [order]); - const { data, loading } = useGetForwardsPastDaysQuery({ + const { data, loading } = useGetForwardsQuery({ ssr: false, variables: { days }, onError: error => toast.error(getErrorContent(error)), @@ -72,13 +73,13 @@ export const ForwardChord = ({ const priceContext = usePriceState(); const format = getPrice(currency, displayValues, priceContext); - if (loading || !data?.getForwardsPastDays?.length) { + if (loading || !data?.getForwards?.length) { return null; } const { matrix, uniqueNodes } = getChordMatrix( order, - data.getForwardsPastDays as Forward[] + data.getForwards as Forward[] ); const handleGroupClick = (group: SingleGroupProps) => { @@ -99,7 +100,11 @@ export const ForwardChord = ({ if (selected.type === 'group') { return ( <> - {renderLine('Node', uniqueNodes[selected.group.index])} + {renderLine( + 'With', + + )} + {renderLine('Channel Id', uniqueNodes[selected.group.index])} {renderLine( getTitle(order), format({ amount: selected.group.value, noUnit: order === 'amount' }) @@ -111,7 +116,15 @@ export const ForwardChord = ({ return ( <> {renderLine( - 'Flow between', + 'Between', + <> + + {` - `} + + + )} + {renderLine( + 'Channel Ids', `${uniqueNodes[selected.chord.source.index]} - ${ uniqueNodes[selected.chord.target.index] }` diff --git a/src/views/forwards/helpers.tsx b/src/views/forwards/helpers.tsx index 2d0b4636..86c2c138 100644 --- a/src/views/forwards/helpers.tsx +++ b/src/views/forwards/helpers.tsx @@ -13,14 +13,14 @@ export const getChordMatrix = (order: ReportType, forwardArray: Forward[]) => { } return { - aliasIn: f.incoming_node?.alias || 'Unknown', - aliasOut: f.outgoing_node?.alias || 'Unknown', + incoming_channel: f.incoming_channel, + outgoing_channel: f.outgoing_channel, value, }; }); - const incomingNodes = cleaned.map(f => f.aliasIn); - const outgoingNodes = cleaned.map(f => f.aliasOut); + const incomingNodes = cleaned.map(f => f.incoming_channel); + const outgoingNodes = cleaned.map(f => f.outgoing_channel); const uniqueNodes = [...new Set(incomingNodes), ...new Set(outgoingNodes)]; const nodeLength = uniqueNodes.length; @@ -32,8 +32,8 @@ export const getChordMatrix = (order: ReportType, forwardArray: Forward[]) => { } cleaned.forEach(f => { - const inIndex = uniqueNodes.indexOf(f.aliasIn); - const outIndex = uniqueNodes.indexOf(f.aliasOut); + const inIndex = uniqueNodes.indexOf(f.incoming_channel); + const outIndex = uniqueNodes.indexOf(f.outgoing_channel); const previousValue = matrix[inIndex][outIndex]; const previousOutValue = matrix[outIndex][inIndex]; @@ -56,14 +56,14 @@ export const sortByNode = (order: ReportType, forwardArray: Forward[]) => { } return { - aliasIn: f.incoming_node?.alias || 'Unknown', - aliasOut: f.outgoing_node?.alias || 'Unknown', + incoming_channel: f.incoming_channel, + outgoing_channel: f.outgoing_channel, value, }; }); - const incomingNodes = cleaned.map(f => f.aliasIn); - const outgoingNodes = cleaned.map(f => f.aliasOut); + const incomingNodes = cleaned.map(f => f.incoming_channel); + const outgoingNodes = cleaned.map(f => f.outgoing_channel); const uniqueNodes = [...new Set(incomingNodes), ...new Set(outgoingNodes)]; const nodeLength = uniqueNodes.length; @@ -72,8 +72,8 @@ export const sortByNode = (order: ReportType, forwardArray: Forward[]) => { const outgoing = new Array(nodeLength).fill(0); cleaned.forEach(f => { - const inIndex = uniqueNodes.indexOf(f.aliasIn); - const outIndex = uniqueNodes.indexOf(f.aliasOut); + const inIndex = uniqueNodes.indexOf(f.incoming_channel); + const outIndex = uniqueNodes.indexOf(f.outgoing_channel); const currentIncoming = incoming[inIndex]; const currentOutgoing = outgoing[outIndex]; @@ -93,7 +93,7 @@ export const sortByNode = (order: ReportType, forwardArray: Forward[]) => { maxOut = Math.max(maxOut, outgoingValue); return { - alias: n, + channel: n, incoming: incomingValue, outgoing: outgoingValue, }; diff --git a/src/views/forwards/index.tsx b/src/views/forwards/index.tsx index 6694b07b..a2a35977 100644 --- a/src/views/forwards/index.tsx +++ b/src/views/forwards/index.tsx @@ -1,7 +1,7 @@ import { FC, useState } from 'react'; import { toast } from 'react-toastify'; import { LoadingCard } from 'src/components/loading/LoadingCard'; -import { useGetForwardsPastDaysQuery } from 'src/graphql/queries/__generated__/getForwardsPastDays.generated'; +import { useGetForwardsQuery } from 'src/graphql/queries/__generated__/getForwards.generated'; import { Forward } from 'src/graphql/types'; import { getErrorContent } from 'src/utils/error'; import { ForwardCard } from './ForwardsCard'; @@ -13,7 +13,7 @@ type ForwardProps = { export const ForwardsList: FC = ({ days }) => { const [indexOpen, setIndexOpen] = useState(0); - const { loading, data } = useGetForwardsPastDaysQuery({ + const { loading, data } = useGetForwardsQuery({ variables: { days }, onError: error => toast.error(getErrorContent(error)), }); @@ -22,7 +22,7 @@ export const ForwardsList: FC = ({ days }) => { return ; } - if (!data?.getForwardsPastDays?.length) { + if (!data?.getForwards?.length) { return (

{`Your node has not forwarded any payments in the past ${days} ${ days > 1 ? 'days' : 'day' @@ -32,7 +32,7 @@ export const ForwardsList: FC = ({ days }) => { return ( <> - {data?.getForwardsPastDays?.map((forward, index) => ( + {data?.getForwards?.map((forward, index) => ( = ({ id }) => { + const { publicKey } = useNodeInfo(); + + const { data: closedChannelData } = useGetClosedChannelsQuery({ + skip: !id || !publicKey, + errorPolicy: 'ignore', + }); + + const { data, loading } = useGetChannelQuery({ + skip: !id || !publicKey, + errorPolicy: 'ignore', + variables: { id, pubkey: publicKey }, + }); + + if (!id || !publicKey) { + return <>Unknown; + } + + if (loading) { + return ; + } + + if (data?.getChannel.partner_node_policies?.node?.node.alias) { + return <>{data.getChannel.partner_node_policies.node.node.alias}; + } + + if (closedChannelData?.getClosedChannels?.length) { + const { alias: closedAlias, closed } = getAliasFromClosedChannels( + id, + closedChannelData.getClosedChannels + ); + + if (closed) { + return ( + <> + {closedAlias} + + + + + This channel has been closed. + + + ); + } + + return <>{closedAlias}; + } + + return <>Unknown; +}; diff --git a/src/views/home/reports/forwardReport/ForwardChannelReport.tsx b/src/views/home/reports/forwardReport/ForwardChannelReport.tsx index 4460c33e..33dc978e 100644 --- a/src/views/home/reports/forwardReport/ForwardChannelReport.tsx +++ b/src/views/home/reports/forwardReport/ForwardChannelReport.tsx @@ -5,7 +5,6 @@ import { MultiButton, SingleButton, } from 'src/components/buttons/multiButton/MultiButton'; -import { useGetForwardsPastDaysQuery } from 'src/graphql/queries/__generated__/getForwardsPastDays.generated'; import { Forward } from 'src/graphql/types'; import styled from 'styled-components'; import { getErrorContent } from '../../../../utils/error'; @@ -13,31 +12,20 @@ import { SingleLine, SubTitle } from '../../../../components/generic/Styled'; import { LoadingCard } from '../../../../components/loading/LoadingCard'; import { ReportType } from './ForwardReport'; import { orderForwardChannels } from './helpers'; -import { ChannelTable, RouteTable } from './ForwardReportTables'; +import { + ChannelTable, + RouteTable, + RouteType, + ChannelType, +} from './ForwardReportTables'; import { CardContent } from '.'; +import { useGetForwardsQuery } from 'src/graphql/queries/__generated__/getForwards.generated'; type Props = { days: number; order: ReportType; }; -type ParsedRouteType = { - route: string; - aliasIn: string; - aliasOut: string; - fee: number; - tokens: number; - amount: number; -}; - -type ParsedChannelType = { - alias: string; - name: string; - fee: number; - tokens: number; - amount: number; -}; - const Spacing = styled.div` margin-bottom: 16px; `; @@ -45,37 +33,31 @@ const Spacing = styled.div` export const ForwardChannelsReport = ({ days, order }: Props) => { const [type, setType] = useState<'route' | 'incoming' | 'outgoing'>('route'); - const { data, loading } = useGetForwardsPastDaysQuery({ + const { data, loading } = useGetForwardsQuery({ ssr: false, variables: { days }, onError: error => toast.error(getErrorContent(error)), }); - if (!data || loading) { + if (!data?.getForwards || loading) { return ; } const forwardArray = orderForwardChannels( type, order, - data.getForwardsPastDays as Forward[] + data.getForwards as Forward[] ); - const renderContent = (parsed: (ParsedChannelType | ParsedRouteType)[]) => { + const renderContent = (parsed: (ChannelType | RouteType)[]) => { switch (type) { case 'route': return ( - + ); default: return ( - + ); } }; diff --git a/src/views/home/reports/forwardReport/ForwardReport.tsx b/src/views/home/reports/forwardReport/ForwardReport.tsx index a0656e98..7d3fae5d 100644 --- a/src/views/home/reports/forwardReport/ForwardReport.tsx +++ b/src/views/home/reports/forwardReport/ForwardReport.tsx @@ -9,7 +9,6 @@ import { } from 'victory'; import { toast } from 'react-toastify'; import { renderLine } from 'src/components/generic/helpers'; -import { useGetForwardsPastDaysQuery } from 'src/graphql/queries/__generated__/getForwardsPastDays.generated'; import { Forward } from 'src/graphql/types'; import { chartAxisColor, @@ -23,6 +22,7 @@ import { getPrice } from '../../../../components/price/Price'; import { usePriceState } from '../../../../context/PriceContext'; import { orderAndReducedArray } from './helpers'; import { CardContent } from '.'; +import { useGetForwardsQuery } from 'src/graphql/queries/__generated__/getForwards.generated'; export type ReportDuration = | 'day' @@ -44,7 +44,7 @@ export const ForwardReport = ({ days, order }: Props) => { const priceContext = usePriceState(); const format = getPrice(currency, displayValues, priceContext); - const { data, loading } = useGetForwardsPastDaysQuery({ + const { data, loading } = useGetForwardsQuery({ ssr: false, variables: { days }, onError: error => toast.error(getErrorContent(error)), @@ -78,17 +78,14 @@ export const ForwardReport = ({ days, order }: Props) => { return format({ amount: value }); }; - const reduced = orderAndReducedArray( - days, - data.getForwardsPastDays as Forward[] - ); + const reduced = orderAndReducedArray(days, data.getForwards as Forward[]); const total = getLabelString( reduced.map(x => x[order]).reduce((a, c) => a + c, 0) ); const renderContent = () => { - if (data.getForwardsPastDays.length <= 0) { + if (data.getForwards.length <= 0) { return (

{`Your node has not forwarded any payments in the past ${days} ${ days > 1 ? 'days' : 'day' diff --git a/src/views/home/reports/forwardReport/ForwardReportTables.tsx b/src/views/home/reports/forwardReport/ForwardReportTables.tsx index 37f5a88d..fcaf70b2 100644 --- a/src/views/home/reports/forwardReport/ForwardReportTables.tsx +++ b/src/views/home/reports/forwardReport/ForwardReportTables.tsx @@ -1,18 +1,19 @@ import { FC } from 'react'; import { Table } from 'src/components/table'; +import { ChannelAlias } from './ChannelAlias'; import { ReportType } from './ForwardReport'; -type RouteType = { +export type RouteType = { route: string; - aliasIn: string; - aliasOut: string; + incoming_channel: string; + outgoing_channel: string; fee: number; tokens: number; amount: number; }; -type ChannelType = { - alias: string; +export type ChannelType = { + channelId: string; name: string; fee: number; tokens: number; @@ -58,7 +59,13 @@ export const RouteTable: FC = ({ order, forwardArray }) => { { Header: getTitle(), accessor: getAccesor() }, ]; - return ; + const tableData = forwardArray.map(f => ({ + ...f, + aliasIn: , + aliasOut: , + })); + + return
; }; export const ChannelTable: FC = ({ @@ -93,5 +100,10 @@ export const ChannelTable: FC = ({ { Header: getTitle(), accessor: getAccesor() }, ]; - return
; + const tableData = forwardArray.map(f => ({ + ...f, + alias: , + })); + + return
; }; diff --git a/src/views/home/reports/forwardReport/helpers.ts b/src/views/home/reports/forwardReport/helpers.ts index e425004f..bb5cff49 100644 --- a/src/views/home/reports/forwardReport/helpers.ts +++ b/src/views/home/reports/forwardReport/helpers.ts @@ -1,6 +1,7 @@ import { differenceInCalendarDays, differenceInHours, subDays } from 'date-fns'; import groupBy from 'lodash.groupby'; import sortBy from 'lodash.sortby'; +import { GetClosedChannelsQuery } from 'src/graphql/queries/__generated__/getClosedChannels.generated'; import { Forward } from 'src/graphql/types'; type ListProps = { @@ -77,8 +78,8 @@ const countRoutes = (list: Forward[]) => { .reduce((p: number, c: number) => p + c); channelInfo.push({ - aliasIn: element[0].incoming_node?.alias || 'Unknown', - aliasOut: element[0].outgoing_node?.alias || 'Unknown', + incoming_channel: element[0].incoming_channel, + outgoing_channel: element[0].outgoing_channel, route: key, amount: element.length, fee, @@ -107,12 +108,12 @@ const countArray = (list: Forward[], type: boolean) => { .map(forward => forward.tokens) .reduce((p: number, c: number) => p + c); - const alias = type - ? element[0].incoming_node?.alias || 'Unknown' - : element[0].outgoing_node?.alias || 'Unknown'; + const channelId = type + ? element[0].incoming_channel + : element[0].outgoing_channel; channelInfo.push({ - alias, + channelId, name: key, amount: element.length, fee, @@ -150,3 +151,18 @@ export const orderForwardChannels = ( const sortedOutCount = sortBy(outgoingCount, order).reverse().slice(0, 10); return sortedOutCount; }; + +export const getAliasFromClosedChannels = ( + channelId: string, + channels: GetClosedChannelsQuery['getClosedChannels'] +): { alias: string; closed: boolean } => { + if (!channels) return { alias: 'Unknown', closed: false }; + + const channel = channels.find(c => c?.id === channelId); + + if (channel?.partner_node_info.node.alias) { + return { alias: channel.partner_node_info.node.alias, closed: true }; + } + + return { alias: 'Unknown', closed: false }; +};