diff --git a/apps/dashboard/services/graphql/generated.ts b/apps/dashboard/services/graphql/generated.ts index 408a1956ca..420cd3d8f4 100644 --- a/apps/dashboard/services/graphql/generated.ts +++ b/apps/dashboard/services/graphql/generated.ts @@ -679,6 +679,21 @@ export type LnInvoicePaymentInput = { readonly walletId: Scalars['WalletId']['input']; }; +export type LnInvoicePaymentStatus = { + readonly __typename: 'LnInvoicePaymentStatus'; + readonly paymentHash?: Maybe; + readonly paymentRequest?: Maybe; + readonly status?: Maybe; +}; + +export type LnInvoicePaymentStatusByHashInput = { + readonly paymentHash: Scalars['PaymentHash']['input']; +}; + +export type LnInvoicePaymentStatusByRequestInput = { + readonly paymentRequest: Scalars['LnPaymentRequest']['input']; +}; + export type LnInvoicePaymentStatusInput = { readonly paymentRequest: Scalars['LnPaymentRequest']['input']; }; @@ -686,6 +701,8 @@ export type LnInvoicePaymentStatusInput = { export type LnInvoicePaymentStatusPayload = { readonly __typename: 'LnInvoicePaymentStatusPayload'; readonly errors: ReadonlyArray; + readonly paymentHash?: Maybe; + readonly paymentRequest?: Maybe; readonly status?: Maybe; }; @@ -1509,7 +1526,10 @@ export type Query = { readonly businessMapMarkers: ReadonlyArray; readonly currencyList: ReadonlyArray; readonly globals?: Maybe; + /** @deprecated Deprecated in favor of lnInvoicePaymentStatusByRequest */ readonly lnInvoicePaymentStatus: LnInvoicePaymentStatusPayload; + readonly lnInvoicePaymentStatusByHash: LnInvoicePaymentStatus; + readonly lnInvoicePaymentStatusByRequest: LnInvoicePaymentStatus; readonly me?: Maybe; readonly mobileVersions?: Maybe>>; readonly onChainTxFee: OnChainTxFee; @@ -1539,6 +1559,16 @@ export type QueryLnInvoicePaymentStatusArgs = { }; +export type QueryLnInvoicePaymentStatusByHashArgs = { + input: LnInvoicePaymentStatusByHashInput; +}; + + +export type QueryLnInvoicePaymentStatusByRequestArgs = { + input: LnInvoicePaymentStatusByRequestInput; +}; + + export type QueryOnChainTxFeeArgs = { address: Scalars['OnChainAddress']['input']; amount: Scalars['SatAmount']['input']; @@ -1659,6 +1689,8 @@ export type SettlementViaOnChain = { export type Subscription = { readonly __typename: 'Subscription'; readonly lnInvoicePaymentStatus: LnInvoicePaymentStatusPayload; + readonly lnInvoicePaymentStatusByHash: LnInvoicePaymentStatusPayload; + readonly lnInvoicePaymentStatusByRequest: LnInvoicePaymentStatusPayload; readonly myUpdates: MyUpdatesPayload; readonly price: PricePayload; /** Returns the price of 1 satoshi */ @@ -1671,6 +1703,16 @@ export type SubscriptionLnInvoicePaymentStatusArgs = { }; +export type SubscriptionLnInvoicePaymentStatusByHashArgs = { + input: LnInvoicePaymentStatusByHashInput; +}; + + +export type SubscriptionLnInvoicePaymentStatusByRequestArgs = { + input: LnInvoicePaymentStatusByRequestInput; +}; + + export type SubscriptionPriceArgs = { input: PriceInput; }; @@ -3349,6 +3391,9 @@ export type ResolversTypes = { LnInvoiceFeeProbeInput: LnInvoiceFeeProbeInput; LnInvoicePayload: ResolverTypeWrapper; LnInvoicePaymentInput: LnInvoicePaymentInput; + LnInvoicePaymentStatus: ResolverTypeWrapper; + LnInvoicePaymentStatusByHashInput: LnInvoicePaymentStatusByHashInput; + LnInvoicePaymentStatusByRequestInput: LnInvoicePaymentStatusByRequestInput; LnInvoicePaymentStatusInput: LnInvoicePaymentStatusInput; LnInvoicePaymentStatusPayload: ResolverTypeWrapper; LnNoAmountInvoice: ResolverTypeWrapper; @@ -3564,6 +3609,9 @@ export type ResolversParentTypes = { LnInvoiceFeeProbeInput: LnInvoiceFeeProbeInput; LnInvoicePayload: LnInvoicePayload; LnInvoicePaymentInput: LnInvoicePaymentInput; + LnInvoicePaymentStatus: LnInvoicePaymentStatus; + LnInvoicePaymentStatusByHashInput: LnInvoicePaymentStatusByHashInput; + LnInvoicePaymentStatusByRequestInput: LnInvoicePaymentStatusByRequestInput; LnInvoicePaymentStatusInput: LnInvoicePaymentStatusInput; LnInvoicePaymentStatusPayload: LnInvoicePaymentStatusPayload; LnNoAmountInvoice: LnNoAmountInvoice; @@ -4039,8 +4087,17 @@ export type LnInvoicePayloadResolvers; }; +export type LnInvoicePaymentStatusResolvers = { + paymentHash?: Resolver, ParentType, ContextType>; + paymentRequest?: Resolver, ParentType, ContextType>; + status?: Resolver, ParentType, ContextType>; + __isTypeOf?: IsTypeOfResolverFn; +}; + export type LnInvoicePaymentStatusPayloadResolvers = { errors?: Resolver, ParentType, ContextType>; + paymentHash?: Resolver, ParentType, ContextType>; + paymentRequest?: Resolver, ParentType, ContextType>; status?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }; @@ -4341,6 +4398,8 @@ export type QueryResolvers, ParentType, ContextType>; globals?: Resolver, ParentType, ContextType>; lnInvoicePaymentStatus?: Resolver>; + lnInvoicePaymentStatusByHash?: Resolver>; + lnInvoicePaymentStatusByRequest?: Resolver>; me?: Resolver, ParentType, ContextType>; mobileVersions?: Resolver>>, ParentType, ContextType>; onChainTxFee?: Resolver>; @@ -4438,6 +4497,8 @@ export interface SignedDisplayMajorAmountScalarConfig extends GraphQLScalarTypeC export type SubscriptionResolvers = { lnInvoicePaymentStatus?: SubscriptionResolver>; + lnInvoicePaymentStatusByHash?: SubscriptionResolver>; + lnInvoicePaymentStatusByRequest?: SubscriptionResolver>; myUpdates?: SubscriptionResolver; price?: SubscriptionResolver>; realtimePrice?: SubscriptionResolver>; @@ -4708,6 +4769,7 @@ export type Resolvers = { Language?: GraphQLScalarType; LnInvoice?: LnInvoiceResolvers; LnInvoicePayload?: LnInvoicePayloadResolvers; + LnInvoicePaymentStatus?: LnInvoicePaymentStatusResolvers; LnInvoicePaymentStatusPayload?: LnInvoicePaymentStatusPayloadResolvers; LnNoAmountInvoice?: LnNoAmountInvoiceResolvers; LnNoAmountInvoicePayload?: LnNoAmountInvoicePayloadResolvers; diff --git a/apps/pay/codegen.yml b/apps/pay/codegen.yml index dfbe546cf5..b8191642ca 100644 --- a/apps/pay/codegen.yml +++ b/apps/pay/codegen.yml @@ -1,14 +1,11 @@ overwrite: true -schema: "https://raw.githubusercontent.com/GaloyMoney/galoy/main/src/graphql/public/schema.graphql" +schema: "https://raw.githubusercontent.com/GaloyMoney/galoy/main/core/api/src/graphql/public/schema.graphql" documents: - - "components/**/*.ts" - - "components/**/*.tsx" - - "lib/**/*.ts" - - "lib/**/*.tsx" - - "pages/**/*.ts" - - "pages/**/*.tsx" - - "hooks/**/*.ts" - - "hooks/**/*.tsx" + - "app/**/*.{ts,tsx}" + - "components/**/*.{ts,tsx}" + - "lib/**/*.{ts,tsx}" + - "pages/**/*.{ts,tsx}" + - "hooks/**/*.{ts,tsx}" generates: lib/graphql/generated.ts: plugins: @@ -64,3 +61,8 @@ generates: join__FieldSet: "string" link__Import: "string" _FieldSet: "string" + LnPubkey: "string" + EndpointId: "string" + EndpointUrl: "string" + Object: "string" + NotificationCategory: "string" diff --git a/apps/pay/lib/graphql/generated.ts b/apps/pay/lib/graphql/generated.ts index 2a180168c0..c98ea62fc4 100644 --- a/apps/pay/lib/graphql/generated.ts +++ b/apps/pay/lib/graphql/generated.ts @@ -1,1271 +1,1616 @@ // this file is autogenerated by codegen /* eslint-disable */ -import { gql } from "@apollo/client" -import * as Apollo from "@apollo/client" -export type Maybe = T | null -export type InputMaybe = Maybe -export type Exact = { [K in keyof T]: T[K] } -export type MakeOptional = Omit & { - [SubKey in K]?: Maybe -} -export type MakeMaybe = Omit & { - [SubKey in K]: Maybe -} -const defaultOptions = {} as const +import { gql } from '@apollo/client'; +import * as Apollo from '@apollo/client'; +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +const defaultOptions = {} as const; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { - ID: string - String: string - Boolean: boolean - Int: number - Float: number + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; /** An Opaque Bearer token */ - AuthToken: string + AuthToken: string; /** (Positive) Cent amount (1/100 of a dollar) */ - CentAmount: number + CentAmount: number; /** An alias name that a user can set for a wallet (with which they have transactions) */ - ContactAlias: string + ContactAlias: string; /** A CCA2 country code (ex US, FR, etc) */ - CountryCode: string + CountryCode: string; /** Display currency of an account */ - DisplayCurrency: string + DisplayCurrency: string; /** Email address */ - EmailAddress: string + EmailAddress: string; /** An id to be passed between registrationInitiate and registrationValidate for confirming email */ - EmailRegistrationId: string + EmailRegistrationId: string; + EndpointId: string; + /** Url that will be fetched on events for the account */ + EndpointUrl: string; /** Feedback shared with our user */ - Feedback: string + Feedback: string; /** Hex-encoded string of 32 bytes */ - Hex32Bytes: string - Language: string - LnPaymentPreImage: string + Hex32Bytes: string; + Language: string; + LnPaymentPreImage: string; /** BOLT11 lightning invoice payment request with the amount included */ - LnPaymentRequest: string - LnPaymentSecret: string + LnPaymentRequest: string; + LnPaymentSecret: string; /** Text field in a lightning payment transaction */ - Memo: string + Memo: string; /** (Positive) amount of minutes */ - Minutes: string + Minutes: string; + NotificationCategory: string; /** An address for an on-chain bitcoin destination */ - OnChainAddress: string - OnChainTxHash: string + OnChainAddress: string; + OnChainTxHash: string; /** An authentication code valid for a single use */ - OneTimeAuthCode: string - PaymentHash: string + OneTimeAuthCode: string; + PaymentHash: string; /** Phone number which includes country code */ - Phone: string + Phone: string; /** Non-fractional signed whole numeric value between -(2^53) + 1 and 2^53 - 1 */ - SafeInt: number + SafeInt: number; /** (Positive) Satoshi amount */ - SatAmount: number + SatAmount: number; /** (Positive) amount of seconds */ - Seconds: number + Seconds: number; /** An amount (of a currency) that can be negative (e.g. in a transaction) */ - SignedAmount: number + SignedAmount: number; /** A string amount (of a currency) that can be negative (e.g. in a transaction) */ - SignedDisplayMajorAmount: string - /** (Positive) Number of blocks in which the transaction is expected to be confirmed */ - TargetConfirmations: number + SignedDisplayMajorAmount: string; /** Timestamp field, serialized as Unix time (the number of seconds since the Unix epoch) */ - Timestamp: number + Timestamp: number; /** A time-based one-time password */ - TotpCode: string + TotpCode: string; /** An id to be passed between set and verify for confirming totp */ - TotpRegistrationId: string + TotpRegistrationId: string; /** A secret to generate time-based one-time password */ - TotpSecret: string + TotpSecret: string; /** Unique identifier of a user */ - Username: string + Username: string; /** Unique identifier of a wallet */ - WalletId: string - _FieldSet: string -} + WalletId: string; + _FieldSet: string; +}; export type Account = { - readonly csvTransactions: Scalars["String"] - readonly defaultWalletId: Scalars["WalletId"] - readonly displayCurrency: Scalars["DisplayCurrency"] - readonly id: Scalars["ID"] - readonly level: AccountLevel - readonly limits: AccountLimits - readonly realtimePrice: RealtimePrice - readonly transactions?: Maybe - readonly wallets: ReadonlyArray -} + readonly callbackEndpoints: ReadonlyArray; + readonly csvTransactions: Scalars['String']; + readonly defaultWallet: PublicWallet; + /** @deprecated Shifting property to 'defaultWallet.id' */ + readonly defaultWalletId: Scalars['WalletId']; + readonly displayCurrency: Scalars['DisplayCurrency']; + readonly id: Scalars['ID']; + readonly invoices?: Maybe; + readonly level: AccountLevel; + readonly limits: AccountLimits; + readonly notificationSettings: NotificationSettings; + readonly pendingIncomingTransactions: ReadonlyArray; + readonly realtimePrice: RealtimePrice; + readonly transactions?: Maybe; + readonly walletById: Wallet; + readonly wallets: ReadonlyArray; +}; + export type AccountCsvTransactionsArgs = { - walletIds: ReadonlyArray -} + walletIds: ReadonlyArray; +}; + + +export type AccountInvoicesArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + walletIds?: InputMaybe>>; +}; + + +export type AccountPendingIncomingTransactionsArgs = { + walletIds?: InputMaybe>>; +}; + export type AccountTransactionsArgs = { - after?: InputMaybe - before?: InputMaybe - first?: InputMaybe - last?: InputMaybe - walletIds?: InputMaybe>> -} + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + walletIds?: InputMaybe>>; +}; + + +export type AccountWalletByIdArgs = { + walletId: Scalars['WalletId']; +}; export type AccountDeletePayload = { - readonly __typename: "AccountDeletePayload" - readonly errors: ReadonlyArray - readonly success: Scalars["Boolean"] -} + readonly __typename: 'AccountDeletePayload'; + readonly errors: ReadonlyArray; + readonly success: Scalars['Boolean']; +}; + +export type AccountDisableNotificationCategoryInput = { + readonly category: Scalars['NotificationCategory']; + readonly channel?: InputMaybe; +}; + +export type AccountDisableNotificationChannelInput = { + readonly channel: NotificationChannel; +}; + +export type AccountEnableNotificationCategoryInput = { + readonly category: Scalars['NotificationCategory']; + readonly channel?: InputMaybe; +}; + +export type AccountEnableNotificationChannelInput = { + readonly channel: NotificationChannel; +}; export const AccountLevel = { - One: "ONE", - Two: "TWO", - Zero: "ZERO", -} as const + One: 'ONE', + Two: 'TWO', + Zero: 'ZERO' +} as const; -export type AccountLevel = (typeof AccountLevel)[keyof typeof AccountLevel] +export type AccountLevel = typeof AccountLevel[keyof typeof AccountLevel]; export type AccountLimit = { /** The rolling time interval in seconds that the limits would apply for. */ - readonly interval?: Maybe + readonly interval?: Maybe; /** The amount of cents remaining below the limit for the current 24 hour period. */ - readonly remainingLimit?: Maybe + readonly remainingLimit?: Maybe; /** The current maximum limit for a given 24 hour period. */ - readonly totalLimit: Scalars["CentAmount"] -} + readonly totalLimit: Scalars['CentAmount']; +}; export type AccountLimits = { - readonly __typename: "AccountLimits" + readonly __typename: 'AccountLimits'; /** Limits for converting between currencies among a account's own wallets. */ - readonly convert: ReadonlyArray + readonly convert: ReadonlyArray; /** Limits for sending to other internal accounts. */ - readonly internalSend: ReadonlyArray + readonly internalSend: ReadonlyArray; /** Limits for withdrawing to external onchain or lightning destinations. */ - readonly withdrawal: ReadonlyArray -} + readonly withdrawal: ReadonlyArray; +}; export type AccountUpdateDefaultWalletIdInput = { - readonly walletId: Scalars["WalletId"] -} + readonly walletId: Scalars['WalletId']; +}; export type AccountUpdateDefaultWalletIdPayload = { - readonly __typename: "AccountUpdateDefaultWalletIdPayload" - readonly account?: Maybe - readonly errors: ReadonlyArray -} + readonly __typename: 'AccountUpdateDefaultWalletIdPayload'; + readonly account?: Maybe; + readonly errors: ReadonlyArray; +}; export type AccountUpdateDisplayCurrencyInput = { - readonly currency: Scalars["DisplayCurrency"] -} + readonly currency: Scalars['DisplayCurrency']; +}; export type AccountUpdateDisplayCurrencyPayload = { - readonly __typename: "AccountUpdateDisplayCurrencyPayload" - readonly account?: Maybe - readonly errors: ReadonlyArray -} + readonly __typename: 'AccountUpdateDisplayCurrencyPayload'; + readonly account?: Maybe; + readonly errors: ReadonlyArray; +}; + +export type AccountUpdateNotificationSettingsPayload = { + readonly __typename: 'AccountUpdateNotificationSettingsPayload'; + readonly account?: Maybe; + readonly errors: ReadonlyArray; +}; export type AuthTokenPayload = { - readonly __typename: "AuthTokenPayload" - readonly authToken?: Maybe - readonly errors: ReadonlyArray - readonly totpRequired?: Maybe -} + readonly __typename: 'AuthTokenPayload'; + readonly authToken?: Maybe; + readonly errors: ReadonlyArray; + readonly totpRequired?: Maybe; +}; /** A wallet belonging to an account which contains a BTC balance and a list of transactions. */ export type BtcWallet = Wallet & { - readonly __typename: "BTCWallet" - readonly accountId: Scalars["ID"] + readonly __typename: 'BTCWallet'; + readonly accountId: Scalars['ID']; /** A balance stored in BTC. */ - readonly balance: Scalars["SignedAmount"] - readonly id: Scalars["ID"] + readonly balance: Scalars['SignedAmount']; + readonly id: Scalars['ID']; + readonly invoiceByPaymentHash: Invoice; + /** A list of all invoices associated with walletIds optionally passed. */ + readonly invoices?: Maybe; /** An unconfirmed incoming onchain balance. */ - readonly pendingIncomingBalance: Scalars["SignedAmount"] + readonly pendingIncomingBalance: Scalars['SignedAmount']; + readonly pendingIncomingTransactions: ReadonlyArray; + readonly pendingIncomingTransactionsByAddress: ReadonlyArray; + readonly transactionById: Transaction; /** A list of BTC transactions associated with this wallet. */ - readonly transactions?: Maybe - readonly transactionsByAddress?: Maybe - readonly walletCurrency: WalletCurrency -} + readonly transactions?: Maybe; + readonly transactionsByAddress?: Maybe; + readonly transactionsByPaymentHash: ReadonlyArray; + readonly walletCurrency: WalletCurrency; +}; + + +/** A wallet belonging to an account which contains a BTC balance and a list of transactions. */ +export type BtcWalletInvoiceByPaymentHashArgs = { + paymentHash: Scalars['PaymentHash']; +}; + + +/** A wallet belonging to an account which contains a BTC balance and a list of transactions. */ +export type BtcWalletInvoicesArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + + +/** A wallet belonging to an account which contains a BTC balance and a list of transactions. */ +export type BtcWalletPendingIncomingTransactionsByAddressArgs = { + address: Scalars['OnChainAddress']; +}; + + +/** A wallet belonging to an account which contains a BTC balance and a list of transactions. */ +export type BtcWalletTransactionByIdArgs = { + transactionId: Scalars['ID']; +}; + /** A wallet belonging to an account which contains a BTC balance and a list of transactions. */ export type BtcWalletTransactionsArgs = { - after?: InputMaybe - before?: InputMaybe - first?: InputMaybe - last?: InputMaybe -} + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + /** A wallet belonging to an account which contains a BTC balance and a list of transactions. */ export type BtcWalletTransactionsByAddressArgs = { - address: Scalars["OnChainAddress"] - after?: InputMaybe - before?: InputMaybe - first?: InputMaybe - last?: InputMaybe -} + address: Scalars['OnChainAddress']; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + + +/** A wallet belonging to an account which contains a BTC balance and a list of transactions. */ +export type BtcWalletTransactionsByPaymentHashArgs = { + paymentHash: Scalars['PaymentHash']; +}; export type BuildInformation = { - readonly __typename: "BuildInformation" - readonly commitHash?: Maybe - readonly helmRevision?: Maybe -} + readonly __typename: 'BuildInformation'; + readonly commitHash?: Maybe; + readonly helmRevision?: Maybe; +}; + +export type CallbackEndpoint = { + readonly __typename: 'CallbackEndpoint'; + readonly id: Scalars['EndpointId']; + readonly url: Scalars['EndpointUrl']; +}; + +export type CallbackEndpointAddInput = { + /** callback endpoint to be called */ + readonly url: Scalars['EndpointUrl']; +}; + +export type CallbackEndpointAddPayload = { + readonly __typename: 'CallbackEndpointAddPayload'; + readonly errors: ReadonlyArray; + readonly id?: Maybe; +}; + +export type CallbackEndpointDeleteInput = { + readonly id: Scalars['EndpointId']; +}; export type CaptchaCreateChallengePayload = { - readonly __typename: "CaptchaCreateChallengePayload" - readonly errors: ReadonlyArray - readonly result?: Maybe -} + readonly __typename: 'CaptchaCreateChallengePayload'; + readonly errors: ReadonlyArray; + readonly result?: Maybe; +}; export type CaptchaCreateChallengeResult = { - readonly __typename: "CaptchaCreateChallengeResult" - readonly challengeCode: Scalars["String"] - readonly failbackMode: Scalars["Boolean"] - readonly id: Scalars["String"] - readonly newCaptcha: Scalars["Boolean"] -} + readonly __typename: 'CaptchaCreateChallengeResult'; + readonly challengeCode: Scalars['String']; + readonly failbackMode: Scalars['Boolean']; + readonly id: Scalars['String']; + readonly newCaptcha: Scalars['Boolean']; +}; export type CaptchaRequestAuthCodeInput = { - readonly challengeCode: Scalars["String"] - readonly channel?: InputMaybe - readonly phone: Scalars["Phone"] - readonly secCode: Scalars["String"] - readonly validationCode: Scalars["String"] -} + readonly challengeCode: Scalars['String']; + readonly channel?: InputMaybe; + readonly phone: Scalars['Phone']; + readonly secCode: Scalars['String']; + readonly validationCode: Scalars['String']; +}; export type CentAmountPayload = { - readonly __typename: "CentAmountPayload" - readonly amount?: Maybe - readonly errors: ReadonlyArray -} + readonly __typename: 'CentAmountPayload'; + readonly amount?: Maybe; + readonly errors: ReadonlyArray; +}; export type ConsumerAccount = Account & { - readonly __typename: "ConsumerAccount" + readonly __typename: 'ConsumerAccount'; + readonly callbackEndpoints: ReadonlyArray; /** return CSV stream, base64 encoded, of the list of transactions in the wallet */ - readonly csvTransactions: Scalars["String"] - readonly defaultWalletId: Scalars["WalletId"] - readonly displayCurrency: Scalars["DisplayCurrency"] - readonly id: Scalars["ID"] - readonly level: AccountLevel - readonly limits: AccountLimits + readonly csvTransactions: Scalars['String']; + readonly defaultWallet: PublicWallet; + readonly defaultWalletId: Scalars['WalletId']; + readonly displayCurrency: Scalars['DisplayCurrency']; + readonly id: Scalars['ID']; + /** A list of all invoices associated with walletIds optionally passed. */ + readonly invoices?: Maybe; + readonly level: AccountLevel; + readonly limits: AccountLimits; + readonly notificationSettings: NotificationSettings; + readonly pendingIncomingTransactions: ReadonlyArray; /** List the quiz questions of the consumer account */ - readonly quiz: ReadonlyArray - readonly realtimePrice: RealtimePrice + readonly quiz: ReadonlyArray; + readonly realtimePrice: RealtimePrice; /** A list of all transactions associated with walletIds optionally passed. */ - readonly transactions?: Maybe - readonly wallets: ReadonlyArray -} + readonly transactions?: Maybe; + readonly walletById: Wallet; + readonly wallets: ReadonlyArray; +}; + export type ConsumerAccountCsvTransactionsArgs = { - walletIds: ReadonlyArray -} + walletIds: ReadonlyArray; +}; + + +export type ConsumerAccountInvoicesArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + walletIds?: InputMaybe>>; +}; + + +export type ConsumerAccountPendingIncomingTransactionsArgs = { + walletIds?: InputMaybe>>; +}; + export type ConsumerAccountTransactionsArgs = { - after?: InputMaybe - before?: InputMaybe - first?: InputMaybe - last?: InputMaybe - walletIds?: InputMaybe>> -} + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + walletIds?: InputMaybe>>; +}; + + +export type ConsumerAccountWalletByIdArgs = { + walletId: Scalars['WalletId']; +}; export type Coordinates = { - readonly __typename: "Coordinates" - readonly latitude: Scalars["Float"] - readonly longitude: Scalars["Float"] -} + readonly __typename: 'Coordinates'; + readonly latitude: Scalars['Float']; + readonly longitude: Scalars['Float']; +}; export type Country = { - readonly __typename: "Country" - readonly id: Scalars["CountryCode"] - readonly supportedAuthChannels: ReadonlyArray -} + readonly __typename: 'Country'; + readonly id: Scalars['CountryCode']; + readonly supportedAuthChannels: ReadonlyArray; +}; export type Currency = { - readonly __typename: "Currency" - readonly flag: Scalars["String"] - readonly fractionDigits: Scalars["Int"] - readonly id: Scalars["ID"] - readonly name: Scalars["String"] - readonly symbol: Scalars["String"] -} + readonly __typename: 'Currency'; + readonly flag: Scalars['String']; + readonly fractionDigits: Scalars['Int']; + readonly id: Scalars['ID']; + readonly name: Scalars['String']; + readonly symbol: Scalars['String']; +}; export type DepositFeesInformation = { - readonly __typename: "DepositFeesInformation" - readonly minBankFee: Scalars["String"] + readonly __typename: 'DepositFeesInformation'; + readonly minBankFee: Scalars['String']; /** below this amount minBankFee will be charged */ - readonly minBankFeeThreshold: Scalars["String"] + readonly minBankFeeThreshold: Scalars['String']; /** ratio to charge as basis points above minBankFeeThreshold amount */ - readonly ratio: Scalars["String"] -} + readonly ratio: Scalars['String']; +}; export type DeviceNotificationTokenCreateInput = { - readonly deviceToken: Scalars["String"] -} + readonly deviceToken: Scalars['String']; +}; export type Email = { - readonly __typename: "Email" - readonly address?: Maybe - readonly verified?: Maybe -} + readonly __typename: 'Email'; + readonly address?: Maybe; + readonly verified?: Maybe; +}; export type Error = { - readonly code?: Maybe - readonly message: Scalars["String"] - readonly path?: Maybe>> -} + readonly code?: Maybe; + readonly message: Scalars['String']; + readonly path?: Maybe>>; +}; export const ExchangeCurrencyUnit = { - Btcsat: "BTCSAT", - Usdcent: "USDCENT", -} as const + Btcsat: 'BTCSAT', + Usdcent: 'USDCENT' +} as const; -export type ExchangeCurrencyUnit = - (typeof ExchangeCurrencyUnit)[keyof typeof ExchangeCurrencyUnit] +export type ExchangeCurrencyUnit = typeof ExchangeCurrencyUnit[keyof typeof ExchangeCurrencyUnit]; export type FeedbackSubmitInput = { - readonly feedback: Scalars["Feedback"] -} + readonly feedback: Scalars['Feedback']; +}; export type FeesInformation = { - readonly __typename: "FeesInformation" - readonly deposit: DepositFeesInformation -} + readonly __typename: 'FeesInformation'; + readonly deposit: DepositFeesInformation; +}; /** Provides global settings for the application which might have an impact for the user. */ export type Globals = { - readonly __typename: "Globals" - readonly buildInformation: BuildInformation - readonly feesInformation: FeesInformation + readonly __typename: 'Globals'; + readonly buildInformation: BuildInformation; + readonly feesInformation: FeesInformation; /** The domain name for lightning addresses accepted by this Galoy instance */ - readonly lightningAddressDomain: Scalars["String"] - readonly lightningAddressDomainAliases: ReadonlyArray + readonly lightningAddressDomain: Scalars['String']; + readonly lightningAddressDomainAliases: ReadonlyArray; /** Which network (mainnet, testnet, regtest, signet) this instance is running on. */ - readonly network: Network + readonly network: Network; /** * A list of public keys for the running lightning nodes. * This can be used to know if an invoice belongs to one of our nodes. */ - readonly nodesIds: ReadonlyArray + readonly nodesIds: ReadonlyArray; /** A list of countries and their supported auth channels */ - readonly supportedCountries: ReadonlyArray -} + readonly supportedCountries: ReadonlyArray; +}; export type GraphQlApplicationError = Error & { - readonly __typename: "GraphQLApplicationError" - readonly code?: Maybe - readonly message: Scalars["String"] - readonly path?: Maybe>> -} + readonly __typename: 'GraphQLApplicationError'; + readonly code?: Maybe; + readonly message: Scalars['String']; + readonly path?: Maybe>>; +}; -export type InitiationVia = - | InitiationViaIntraLedger - | InitiationViaLn - | InitiationViaOnChain +export type InitiationVia = InitiationViaIntraLedger | InitiationViaLn | InitiationViaOnChain; export type InitiationViaIntraLedger = { - readonly __typename: "InitiationViaIntraLedger" - readonly counterPartyUsername?: Maybe - readonly counterPartyWalletId?: Maybe -} + readonly __typename: 'InitiationViaIntraLedger'; + readonly counterPartyUsername?: Maybe; + readonly counterPartyWalletId?: Maybe; +}; export type InitiationViaLn = { - readonly __typename: "InitiationViaLn" - readonly paymentHash: Scalars["PaymentHash"] -} + readonly __typename: 'InitiationViaLn'; + readonly paymentHash: Scalars['PaymentHash']; + /** Bolt11 invoice */ + readonly paymentRequest: Scalars['LnPaymentRequest']; +}; export type InitiationViaOnChain = { - readonly __typename: "InitiationViaOnChain" - readonly address: Scalars["OnChainAddress"] -} + readonly __typename: 'InitiationViaOnChain'; + readonly address: Scalars['OnChainAddress']; +}; export type IntraLedgerPaymentSendInput = { /** Amount in satoshis. */ - readonly amount: Scalars["SatAmount"] + readonly amount: Scalars['SatAmount']; /** Optional memo to be attached to the payment. */ - readonly memo?: InputMaybe - readonly recipientWalletId: Scalars["WalletId"] + readonly memo?: InputMaybe; + readonly recipientWalletId: Scalars['WalletId']; /** The wallet ID of the sender. */ - readonly walletId: Scalars["WalletId"] -} + readonly walletId: Scalars['WalletId']; +}; export type IntraLedgerUpdate = { - readonly __typename: "IntraLedgerUpdate" - readonly amount: Scalars["SatAmount"] - readonly displayCurrencyPerSat: Scalars["Float"] - readonly txNotificationType: TxNotificationType + readonly __typename: 'IntraLedgerUpdate'; + /** @deprecated Deprecated in favor of transaction */ + readonly amount: Scalars['SatAmount']; + /** @deprecated Deprecated in favor of transaction */ + readonly displayCurrencyPerSat: Scalars['Float']; + readonly transaction: Transaction; + readonly txNotificationType: TxNotificationType; /** @deprecated updated over displayCurrencyPerSat */ - readonly usdPerSat: Scalars["Float"] - readonly walletId: Scalars["WalletId"] -} + readonly usdPerSat: Scalars['Float']; + /** @deprecated Deprecated in favor of transaction */ + readonly walletId: Scalars['WalletId']; +}; export type IntraLedgerUsdPaymentSendInput = { /** Amount in cents. */ - readonly amount: Scalars["CentAmount"] + readonly amount: Scalars['CentAmount']; /** Optional memo to be attached to the payment. */ - readonly memo?: InputMaybe - readonly recipientWalletId: Scalars["WalletId"] + readonly memo?: InputMaybe; + readonly recipientWalletId: Scalars['WalletId']; /** The wallet ID of the sender. */ - readonly walletId: Scalars["WalletId"] -} + readonly walletId: Scalars['WalletId']; +}; + +/** A lightning invoice. */ +export type Invoice = { + readonly createdAt: Scalars['Timestamp']; + /** The payment hash of the lightning invoice. */ + readonly paymentHash: Scalars['PaymentHash']; + /** The bolt11 invoice to be paid. */ + readonly paymentRequest: Scalars['LnPaymentRequest']; + /** The payment secret of the lightning invoice. This is not the preimage of the payment hash. */ + readonly paymentSecret: Scalars['LnPaymentSecret']; + /** The payment status of the invoice. */ + readonly paymentStatus: InvoicePaymentStatus; +}; + +/** A connection to a list of items. */ +export type InvoiceConnection = { + readonly __typename: 'InvoiceConnection'; + /** A list of edges. */ + readonly edges?: Maybe>; + /** Information to aid in pagination. */ + readonly pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type InvoiceEdge = { + readonly __typename: 'InvoiceEdge'; + /** A cursor for use in pagination */ + readonly cursor: Scalars['String']; + /** The item at the end of the edge */ + readonly node: Invoice; +}; export const InvoicePaymentStatus = { - Expired: "EXPIRED", - Paid: "PAID", - Pending: "PENDING", -} as const - -export type InvoicePaymentStatus = - (typeof InvoicePaymentStatus)[keyof typeof InvoicePaymentStatus] -export type LnInvoice = { - readonly __typename: "LnInvoice" - readonly paymentHash: Scalars["PaymentHash"] - readonly paymentRequest: Scalars["LnPaymentRequest"] - readonly paymentSecret: Scalars["LnPaymentSecret"] - readonly satoshis?: Maybe -} + Expired: 'EXPIRED', + Paid: 'PAID', + Pending: 'PENDING' +} as const; + +export type InvoicePaymentStatus = typeof InvoicePaymentStatus[keyof typeof InvoicePaymentStatus]; +export type LnAddressPaymentSendInput = { + /** Amount in satoshis. */ + readonly amount: Scalars['SatAmount']; + /** Lightning address to send to. */ + readonly lnAddress: Scalars['String']; + /** Wallet ID to send bitcoin from. */ + readonly walletId: Scalars['WalletId']; +}; + +export type LnInvoice = Invoice & { + readonly __typename: 'LnInvoice'; + readonly createdAt: Scalars['Timestamp']; + readonly paymentHash: Scalars['PaymentHash']; + readonly paymentRequest: Scalars['LnPaymentRequest']; + readonly paymentSecret: Scalars['LnPaymentSecret']; + readonly paymentStatus: InvoicePaymentStatus; + readonly satoshis: Scalars['SatAmount']; +}; export type LnInvoiceCreateInput = { /** Amount in satoshis. */ - readonly amount: Scalars["SatAmount"] + readonly amount: Scalars['SatAmount']; /** Optional invoice expiration time in minutes. */ - readonly expiresIn?: InputMaybe + readonly expiresIn?: InputMaybe; /** Optional memo for the lightning invoice. */ - readonly memo?: InputMaybe + readonly memo?: InputMaybe; /** Wallet ID for a BTC wallet belonging to the current account. */ - readonly walletId: Scalars["WalletId"] -} + readonly walletId: Scalars['WalletId']; +}; export type LnInvoiceCreateOnBehalfOfRecipientInput = { /** Amount in satoshis. */ - readonly amount: Scalars["SatAmount"] - readonly descriptionHash?: InputMaybe + readonly amount: Scalars['SatAmount']; + readonly descriptionHash?: InputMaybe; /** Optional invoice expiration time in minutes. */ - readonly expiresIn?: InputMaybe + readonly expiresIn?: InputMaybe; /** Optional memo for the lightning invoice. */ - readonly memo?: InputMaybe + readonly memo?: InputMaybe; /** Wallet ID for a BTC wallet which belongs to any account. */ - readonly recipientWalletId: Scalars["WalletId"] -} + readonly recipientWalletId: Scalars['WalletId']; +}; export type LnInvoiceFeeProbeInput = { - readonly paymentRequest: Scalars["LnPaymentRequest"] - readonly walletId: Scalars["WalletId"] -} + readonly paymentRequest: Scalars['LnPaymentRequest']; + readonly walletId: Scalars['WalletId']; +}; export type LnInvoicePayload = { - readonly __typename: "LnInvoicePayload" - readonly errors: ReadonlyArray - readonly invoice?: Maybe -} + readonly __typename: 'LnInvoicePayload'; + readonly errors: ReadonlyArray; + readonly invoice?: Maybe; +}; export type LnInvoicePaymentInput = { /** Optional memo to associate with the lightning invoice. */ - readonly memo?: InputMaybe + readonly memo?: InputMaybe; /** Payment request representing the invoice which is being paid. */ - readonly paymentRequest: Scalars["LnPaymentRequest"] + readonly paymentRequest: Scalars['LnPaymentRequest']; /** Wallet ID with sufficient balance to cover amount of invoice. Must belong to the account of the current user. */ - readonly walletId: Scalars["WalletId"] -} + readonly walletId: Scalars['WalletId']; +}; export type LnInvoicePaymentStatusInput = { - readonly paymentRequest: Scalars["LnPaymentRequest"] -} + readonly paymentRequest: Scalars['LnPaymentRequest']; +}; export type LnInvoicePaymentStatusPayload = { - readonly __typename: "LnInvoicePaymentStatusPayload" - readonly errors: ReadonlyArray - readonly status?: Maybe -} - -export type LnNoAmountInvoice = { - readonly __typename: "LnNoAmountInvoice" - readonly paymentHash: Scalars["PaymentHash"] - readonly paymentRequest: Scalars["LnPaymentRequest"] - readonly paymentSecret: Scalars["LnPaymentSecret"] -} + readonly __typename: 'LnInvoicePaymentStatusPayload'; + readonly errors: ReadonlyArray; + readonly status?: Maybe; +}; + +export type LnNoAmountInvoice = Invoice & { + readonly __typename: 'LnNoAmountInvoice'; + readonly createdAt: Scalars['Timestamp']; + readonly paymentHash: Scalars['PaymentHash']; + readonly paymentRequest: Scalars['LnPaymentRequest']; + readonly paymentSecret: Scalars['LnPaymentSecret']; + readonly paymentStatus: InvoicePaymentStatus; +}; export type LnNoAmountInvoiceCreateInput = { /** Optional invoice expiration time in minutes. */ - readonly expiresIn?: InputMaybe + readonly expiresIn?: InputMaybe; /** Optional memo for the lightning invoice. */ - readonly memo?: InputMaybe + readonly memo?: InputMaybe; /** ID for either a USD or BTC wallet belonging to the account of the current user. */ - readonly walletId: Scalars["WalletId"] -} + readonly walletId: Scalars['WalletId']; +}; export type LnNoAmountInvoiceCreateOnBehalfOfRecipientInput = { /** Optional invoice expiration time in minutes. */ - readonly expiresIn?: InputMaybe + readonly expiresIn?: InputMaybe; /** Optional memo for the lightning invoice. */ - readonly memo?: InputMaybe + readonly memo?: InputMaybe; /** ID for either a USD or BTC wallet which belongs to the account of any user. */ - readonly recipientWalletId: Scalars["WalletId"] -} + readonly recipientWalletId: Scalars['WalletId']; +}; export type LnNoAmountInvoiceFeeProbeInput = { - readonly amount: Scalars["SatAmount"] - readonly paymentRequest: Scalars["LnPaymentRequest"] - readonly walletId: Scalars["WalletId"] -} + readonly amount: Scalars['SatAmount']; + readonly paymentRequest: Scalars['LnPaymentRequest']; + readonly walletId: Scalars['WalletId']; +}; export type LnNoAmountInvoicePayload = { - readonly __typename: "LnNoAmountInvoicePayload" - readonly errors: ReadonlyArray - readonly invoice?: Maybe -} + readonly __typename: 'LnNoAmountInvoicePayload'; + readonly errors: ReadonlyArray; + readonly invoice?: Maybe; +}; export type LnNoAmountInvoicePaymentInput = { /** Amount to pay in satoshis. */ - readonly amount: Scalars["SatAmount"] + readonly amount: Scalars['SatAmount']; /** Optional memo to associate with the lightning invoice. */ - readonly memo?: InputMaybe + readonly memo?: InputMaybe; /** Payment request representing the invoice which is being paid. */ - readonly paymentRequest: Scalars["LnPaymentRequest"] + readonly paymentRequest: Scalars['LnPaymentRequest']; /** Wallet ID with sufficient balance to cover amount defined in mutation request. Must belong to the account of the current user. */ - readonly walletId: Scalars["WalletId"] -} + readonly walletId: Scalars['WalletId']; +}; export type LnNoAmountUsdInvoiceFeeProbeInput = { - readonly amount: Scalars["CentAmount"] - readonly paymentRequest: Scalars["LnPaymentRequest"] - readonly walletId: Scalars["WalletId"] -} + readonly amount: Scalars['CentAmount']; + readonly paymentRequest: Scalars['LnPaymentRequest']; + readonly walletId: Scalars['WalletId']; +}; export type LnNoAmountUsdInvoicePaymentInput = { /** Amount to pay in USD cents. */ - readonly amount: Scalars["CentAmount"] + readonly amount: Scalars['CentAmount']; /** Optional memo to associate with the lightning invoice. */ - readonly memo?: InputMaybe + readonly memo?: InputMaybe; /** Payment request representing the invoice which is being paid. */ - readonly paymentRequest: Scalars["LnPaymentRequest"] + readonly paymentRequest: Scalars['LnPaymentRequest']; /** Wallet ID with sufficient balance to cover amount defined in mutation request. Must belong to the account of the current user. */ - readonly walletId: Scalars["WalletId"] -} + readonly walletId: Scalars['WalletId']; +}; export type LnUpdate = { - readonly __typename: "LnUpdate" - readonly paymentHash: Scalars["PaymentHash"] - readonly status: InvoicePaymentStatus - readonly walletId: Scalars["WalletId"] -} + readonly __typename: 'LnUpdate'; + /** @deprecated Deprecated in favor of transaction */ + readonly paymentHash: Scalars['PaymentHash']; + readonly status: InvoicePaymentStatus; + readonly transaction: Transaction; + /** @deprecated Deprecated in favor of transaction */ + readonly walletId: Scalars['WalletId']; +}; + +export type LnUsdInvoiceBtcDenominatedCreateOnBehalfOfRecipientInput = { + /** Amount in satoshis. */ + readonly amount: Scalars['SatAmount']; + readonly descriptionHash?: InputMaybe; + /** Optional invoice expiration time in minutes. */ + readonly expiresIn?: InputMaybe; + /** Optional memo for the lightning invoice. Acts as a note to the recipient. */ + readonly memo?: InputMaybe; + /** Wallet ID for a USD wallet which belongs to the account of any user. */ + readonly recipientWalletId: Scalars['WalletId']; +}; export type LnUsdInvoiceCreateInput = { /** Amount in USD cents. */ - readonly amount: Scalars["CentAmount"] + readonly amount: Scalars['CentAmount']; /** Optional invoice expiration time in minutes. */ - readonly expiresIn?: InputMaybe + readonly expiresIn?: InputMaybe; /** Optional memo for the lightning invoice. */ - readonly memo?: InputMaybe + readonly memo?: InputMaybe; /** Wallet ID for a USD wallet belonging to the current user. */ - readonly walletId: Scalars["WalletId"] -} + readonly walletId: Scalars['WalletId']; +}; export type LnUsdInvoiceCreateOnBehalfOfRecipientInput = { /** Amount in USD cents. */ - readonly amount: Scalars["CentAmount"] - readonly descriptionHash?: InputMaybe + readonly amount: Scalars['CentAmount']; + readonly descriptionHash?: InputMaybe; /** Optional invoice expiration time in minutes. */ - readonly expiresIn?: InputMaybe + readonly expiresIn?: InputMaybe; /** Optional memo for the lightning invoice. Acts as a note to the recipient. */ - readonly memo?: InputMaybe + readonly memo?: InputMaybe; /** Wallet ID for a USD wallet which belongs to the account of any user. */ - readonly recipientWalletId: Scalars["WalletId"] -} + readonly recipientWalletId: Scalars['WalletId']; +}; export type LnUsdInvoiceFeeProbeInput = { - readonly paymentRequest: Scalars["LnPaymentRequest"] - readonly walletId: Scalars["WalletId"] -} + readonly paymentRequest: Scalars['LnPaymentRequest']; + readonly walletId: Scalars['WalletId']; +}; + +export type LnurlPaymentSendInput = { + /** Amount in satoshis. */ + readonly amount: Scalars['SatAmount']; + /** Lnurl string to send to. */ + readonly lnurl: Scalars['String']; + /** Wallet ID to send bitcoin from. */ + readonly walletId: Scalars['WalletId']; +}; export type MapInfo = { - readonly __typename: "MapInfo" - readonly coordinates: Coordinates - readonly title: Scalars["String"] -} + readonly __typename: 'MapInfo'; + readonly coordinates: Coordinates; + readonly title: Scalars['String']; +}; export type MapMarker = { - readonly __typename: "MapMarker" - readonly mapInfo: MapInfo - readonly username?: Maybe -} + readonly __typename: 'MapMarker'; + readonly mapInfo: MapInfo; + readonly username: Scalars['Username']; +}; + +export type Merchant = { + readonly __typename: 'Merchant'; + /** GPS coordinates for the merchant that can be used to place the related business on a map */ + readonly coordinates: Coordinates; + readonly createdAt: Scalars['Timestamp']; + readonly id: Scalars['ID']; + readonly title: Scalars['String']; + /** The username of the merchant */ + readonly username: Scalars['Username']; + /** Whether the merchant has been validated */ + readonly validated: Scalars['Boolean']; +}; + +export type MerchantMapSuggestInput = { + readonly latitude: Scalars['Float']; + readonly longitude: Scalars['Float']; + readonly title: Scalars['String']; + readonly username: Scalars['Username']; +}; + +export type MerchantPayload = { + readonly __typename: 'MerchantPayload'; + readonly errors: ReadonlyArray; + readonly merchant?: Maybe; +}; export type MobileVersions = { - readonly __typename: "MobileVersions" - readonly currentSupported: Scalars["Int"] - readonly minSupported: Scalars["Int"] - readonly platform: Scalars["String"] -} + readonly __typename: 'MobileVersions'; + readonly currentSupported: Scalars['Int']; + readonly minSupported: Scalars['Int']; + readonly platform: Scalars['String']; +}; export type Mutation = { - readonly __typename: "Mutation" - readonly accountDelete: AccountDeletePayload - readonly accountUpdateDefaultWalletId: AccountUpdateDefaultWalletIdPayload - readonly accountUpdateDisplayCurrency: AccountUpdateDisplayCurrencyPayload - readonly captchaCreateChallenge: CaptchaCreateChallengePayload - readonly captchaRequestAuthCode: SuccessPayload - readonly deviceNotificationTokenCreate: SuccessPayload - readonly feedbackSubmit: SuccessPayload + readonly __typename: 'Mutation'; + readonly accountDelete: AccountDeletePayload; + readonly accountDisableNotificationCategory: AccountUpdateNotificationSettingsPayload; + readonly accountDisableNotificationChannel: AccountUpdateNotificationSettingsPayload; + readonly accountEnableNotificationCategory: AccountUpdateNotificationSettingsPayload; + readonly accountEnableNotificationChannel: AccountUpdateNotificationSettingsPayload; + readonly accountUpdateDefaultWalletId: AccountUpdateDefaultWalletIdPayload; + readonly accountUpdateDisplayCurrency: AccountUpdateDisplayCurrencyPayload; + readonly callbackEndpointAdd: CallbackEndpointAddPayload; + readonly callbackEndpointDelete: SuccessPayload; + readonly captchaCreateChallenge: CaptchaCreateChallengePayload; + readonly captchaRequestAuthCode: SuccessPayload; + readonly deviceNotificationTokenCreate: SuccessPayload; + readonly feedbackSubmit: SuccessPayload; /** * Actions a payment which is internal to the ledger e.g. it does * not use onchain/lightning. Returns payment status (success, * failed, pending, already_paid). */ - readonly intraLedgerPaymentSend: PaymentSendPayload + readonly intraLedgerPaymentSend: PaymentSendPayload; /** * Actions a payment which is internal to the ledger e.g. it does * not use onchain/lightning. Returns payment status (success, * failed, pending, already_paid). */ - readonly intraLedgerUsdPaymentSend: PaymentSendPayload + readonly intraLedgerUsdPaymentSend: PaymentSendPayload; + /** Sends a payment to a lightning address. */ + readonly lnAddressPaymentSend: PaymentSendPayload; /** * Returns a lightning invoice for an associated wallet. * When invoice is paid the value will be credited to a BTC wallet. * Expires after 'expiresIn' or 24 hours. */ - readonly lnInvoiceCreate: LnInvoicePayload + readonly lnInvoiceCreate: LnInvoicePayload; /** * Returns a lightning invoice for an associated wallet. * When invoice is paid the value will be credited to a BTC wallet. * Expires after 'expiresIn' or 24 hours. */ - readonly lnInvoiceCreateOnBehalfOfRecipient: LnInvoicePayload - readonly lnInvoiceFeeProbe: SatAmountPayload + readonly lnInvoiceCreateOnBehalfOfRecipient: LnInvoicePayload; + readonly lnInvoiceFeeProbe: SatAmountPayload; /** * Pay a lightning invoice using a balance from a wallet which is owned by the account of the current user. * Provided wallet can be USD or BTC and must have sufficient balance to cover amount in lightning invoice. * Returns payment status (success, failed, pending, already_paid). */ - readonly lnInvoicePaymentSend: PaymentSendPayload + readonly lnInvoicePaymentSend: PaymentSendPayload; /** * Returns a lightning invoice for an associated wallet. * Can be used to receive any supported currency value (currently USD or BTC). * Expires after 'expiresIn' or 24 hours for BTC invoices or 5 minutes for USD invoices. */ - readonly lnNoAmountInvoiceCreate: LnNoAmountInvoicePayload + readonly lnNoAmountInvoiceCreate: LnNoAmountInvoicePayload; /** * Returns a lightning invoice for an associated wallet. * Can be used to receive any supported currency value (currently USD or BTC). * Expires after 'expiresIn' or 24 hours for BTC invoices or 5 minutes for USD invoices. */ - readonly lnNoAmountInvoiceCreateOnBehalfOfRecipient: LnNoAmountInvoicePayload - readonly lnNoAmountInvoiceFeeProbe: SatAmountPayload + readonly lnNoAmountInvoiceCreateOnBehalfOfRecipient: LnNoAmountInvoicePayload; + readonly lnNoAmountInvoiceFeeProbe: SatAmountPayload; /** * Pay a lightning invoice using a balance from a wallet which is owned by the account of the current user. * Provided wallet must be BTC and must have sufficient balance to cover amount specified in mutation request. * Returns payment status (success, failed, pending, already_paid). */ - readonly lnNoAmountInvoicePaymentSend: PaymentSendPayload - readonly lnNoAmountUsdInvoiceFeeProbe: CentAmountPayload + readonly lnNoAmountInvoicePaymentSend: PaymentSendPayload; + readonly lnNoAmountUsdInvoiceFeeProbe: CentAmountPayload; /** * Pay a lightning invoice using a balance from a wallet which is owned by the account of the current user. * Provided wallet must be USD and have sufficient balance to cover amount specified in mutation request. * Returns payment status (success, failed, pending, already_paid). */ - readonly lnNoAmountUsdInvoicePaymentSend: PaymentSendPayload + readonly lnNoAmountUsdInvoicePaymentSend: PaymentSendPayload; + /** + * Returns a lightning invoice denominated in satoshis for an associated wallet. + * When invoice is paid the equivalent value at invoice creation will be credited to a USD wallet. + * Expires after 'expiresIn' or 5 minutes (short expiry time because there is a USD/BTC exchange rate + * associated with the amount). + */ + readonly lnUsdInvoiceBtcDenominatedCreateOnBehalfOfRecipient: LnInvoicePayload; /** * Returns a lightning invoice denominated in satoshis for an associated wallet. * When invoice is paid the equivalent value at invoice creation will be credited to a USD wallet. * Expires after 'expiresIn' or 5 minutes (short expiry time because there is a USD/BTC exchange rate * associated with the amount). */ - readonly lnUsdInvoiceCreate: LnInvoicePayload + readonly lnUsdInvoiceCreate: LnInvoicePayload; /** * Returns a lightning invoice denominated in satoshis for an associated wallet. * When invoice is paid the equivalent value at invoice creation will be credited to a USD wallet. * Expires after 'expiresIn' or 5 minutes (short expiry time because there is a USD/BTC exchange rate * associated with the amount). */ - readonly lnUsdInvoiceCreateOnBehalfOfRecipient: LnInvoicePayload - readonly lnUsdInvoiceFeeProbe: SatAmountPayload - readonly onChainAddressCreate: OnChainAddressPayload - readonly onChainAddressCurrent: OnChainAddressPayload - readonly onChainPaymentSend: PaymentSendPayload - readonly onChainPaymentSendAll: PaymentSendPayload - readonly onChainUsdPaymentSend: PaymentSendPayload - readonly onChainUsdPaymentSendAsBtcDenominated: PaymentSendPayload - readonly quizCompleted: QuizCompletedPayload + readonly lnUsdInvoiceCreateOnBehalfOfRecipient: LnInvoicePayload; + readonly lnUsdInvoiceFeeProbe: SatAmountPayload; + /** Sends a payment to a lightning address. */ + readonly lnurlPaymentSend: PaymentSendPayload; + readonly merchantMapSuggest: MerchantPayload; + readonly onChainAddressCreate: OnChainAddressPayload; + readonly onChainAddressCurrent: OnChainAddressPayload; + readonly onChainPaymentSend: PaymentSendPayload; + readonly onChainPaymentSendAll: PaymentSendPayload; + readonly onChainUsdPaymentSend: PaymentSendPayload; + readonly onChainUsdPaymentSendAsBtcDenominated: PaymentSendPayload; + readonly quizClaim: QuizClaimPayload; + /** @deprecated Use quizClaim instead */ + readonly quizCompleted: QuizCompletedPayload; /** @deprecated will be moved to AccountContact */ - readonly userContactUpdateAlias: UserContactUpdateAliasPayload - readonly userEmailDelete: UserEmailDeletePayload - readonly userEmailRegistrationInitiate: UserEmailRegistrationInitiatePayload - readonly userEmailRegistrationValidate: UserEmailRegistrationValidatePayload - readonly userLogin: AuthTokenPayload - readonly userLoginUpgrade: UpgradePayload - readonly userLogout: SuccessPayload - readonly userPhoneDelete: UserPhoneDeletePayload - readonly userPhoneRegistrationInitiate: SuccessPayload - readonly userPhoneRegistrationValidate: UserPhoneRegistrationValidatePayload - /** @deprecated Use QuizCompletedMutation instead */ - readonly userQuizQuestionUpdateCompleted: UserQuizQuestionUpdateCompletedPayload - readonly userRequestAuthCode: SuccessPayload - readonly userTotpDelete: UserTotpDeletePayload - readonly userTotpRegistrationInitiate: UserTotpRegistrationInitiatePayload - readonly userTotpRegistrationValidate: UserTotpRegistrationValidatePayload - readonly userUpdateLanguage: UserUpdateLanguagePayload + readonly userContactUpdateAlias: UserContactUpdateAliasPayload; + readonly userEmailDelete: UserEmailDeletePayload; + readonly userEmailRegistrationInitiate: UserEmailRegistrationInitiatePayload; + readonly userEmailRegistrationValidate: UserEmailRegistrationValidatePayload; + readonly userLogin: AuthTokenPayload; + readonly userLoginUpgrade: UpgradePayload; + readonly userLogout: SuccessPayload; + readonly userPhoneDelete: UserPhoneDeletePayload; + readonly userPhoneRegistrationInitiate: SuccessPayload; + readonly userPhoneRegistrationValidate: UserPhoneRegistrationValidatePayload; + readonly userTotpDelete: UserTotpDeletePayload; + readonly userTotpRegistrationInitiate: UserTotpRegistrationInitiatePayload; + readonly userTotpRegistrationValidate: UserTotpRegistrationValidatePayload; + readonly userUpdateLanguage: UserUpdateLanguagePayload; /** @deprecated Username will be moved to @Handle in Accounts. Also SetUsername naming should be used instead of UpdateUsername to reflect the idempotency of Handles */ - readonly userUpdateUsername: UserUpdateUsernamePayload -} + readonly userUpdateUsername: UserUpdateUsernamePayload; +}; + + +export type MutationAccountDisableNotificationCategoryArgs = { + input: AccountDisableNotificationCategoryInput; +}; + + +export type MutationAccountDisableNotificationChannelArgs = { + input: AccountDisableNotificationChannelInput; +}; + + +export type MutationAccountEnableNotificationCategoryArgs = { + input: AccountEnableNotificationCategoryInput; +}; + + +export type MutationAccountEnableNotificationChannelArgs = { + input: AccountEnableNotificationChannelInput; +}; + export type MutationAccountUpdateDefaultWalletIdArgs = { - input: AccountUpdateDefaultWalletIdInput -} + input: AccountUpdateDefaultWalletIdInput; +}; + export type MutationAccountUpdateDisplayCurrencyArgs = { - input: AccountUpdateDisplayCurrencyInput -} + input: AccountUpdateDisplayCurrencyInput; +}; + + +export type MutationCallbackEndpointAddArgs = { + input: CallbackEndpointAddInput; +}; + + +export type MutationCallbackEndpointDeleteArgs = { + input: CallbackEndpointDeleteInput; +}; + export type MutationCaptchaRequestAuthCodeArgs = { - input: CaptchaRequestAuthCodeInput -} + input: CaptchaRequestAuthCodeInput; +}; + export type MutationDeviceNotificationTokenCreateArgs = { - input: DeviceNotificationTokenCreateInput -} + input: DeviceNotificationTokenCreateInput; +}; + export type MutationFeedbackSubmitArgs = { - input: FeedbackSubmitInput -} + input: FeedbackSubmitInput; +}; + export type MutationIntraLedgerPaymentSendArgs = { - input: IntraLedgerPaymentSendInput -} + input: IntraLedgerPaymentSendInput; +}; + export type MutationIntraLedgerUsdPaymentSendArgs = { - input: IntraLedgerUsdPaymentSendInput -} + input: IntraLedgerUsdPaymentSendInput; +}; + + +export type MutationLnAddressPaymentSendArgs = { + input: LnAddressPaymentSendInput; +}; + export type MutationLnInvoiceCreateArgs = { - input: LnInvoiceCreateInput -} + input: LnInvoiceCreateInput; +}; + export type MutationLnInvoiceCreateOnBehalfOfRecipientArgs = { - input: LnInvoiceCreateOnBehalfOfRecipientInput -} + input: LnInvoiceCreateOnBehalfOfRecipientInput; +}; + export type MutationLnInvoiceFeeProbeArgs = { - input: LnInvoiceFeeProbeInput -} + input: LnInvoiceFeeProbeInput; +}; + export type MutationLnInvoicePaymentSendArgs = { - input: LnInvoicePaymentInput -} + input: LnInvoicePaymentInput; +}; + export type MutationLnNoAmountInvoiceCreateArgs = { - input: LnNoAmountInvoiceCreateInput -} + input: LnNoAmountInvoiceCreateInput; +}; + export type MutationLnNoAmountInvoiceCreateOnBehalfOfRecipientArgs = { - input: LnNoAmountInvoiceCreateOnBehalfOfRecipientInput -} + input: LnNoAmountInvoiceCreateOnBehalfOfRecipientInput; +}; + export type MutationLnNoAmountInvoiceFeeProbeArgs = { - input: LnNoAmountInvoiceFeeProbeInput -} + input: LnNoAmountInvoiceFeeProbeInput; +}; + export type MutationLnNoAmountInvoicePaymentSendArgs = { - input: LnNoAmountInvoicePaymentInput -} + input: LnNoAmountInvoicePaymentInput; +}; + export type MutationLnNoAmountUsdInvoiceFeeProbeArgs = { - input: LnNoAmountUsdInvoiceFeeProbeInput -} + input: LnNoAmountUsdInvoiceFeeProbeInput; +}; + export type MutationLnNoAmountUsdInvoicePaymentSendArgs = { - input: LnNoAmountUsdInvoicePaymentInput -} + input: LnNoAmountUsdInvoicePaymentInput; +}; + + +export type MutationLnUsdInvoiceBtcDenominatedCreateOnBehalfOfRecipientArgs = { + input: LnUsdInvoiceBtcDenominatedCreateOnBehalfOfRecipientInput; +}; + export type MutationLnUsdInvoiceCreateArgs = { - input: LnUsdInvoiceCreateInput -} + input: LnUsdInvoiceCreateInput; +}; + export type MutationLnUsdInvoiceCreateOnBehalfOfRecipientArgs = { - input: LnUsdInvoiceCreateOnBehalfOfRecipientInput -} + input: LnUsdInvoiceCreateOnBehalfOfRecipientInput; +}; + export type MutationLnUsdInvoiceFeeProbeArgs = { - input: LnUsdInvoiceFeeProbeInput -} + input: LnUsdInvoiceFeeProbeInput; +}; + + +export type MutationLnurlPaymentSendArgs = { + input: LnurlPaymentSendInput; +}; + + +export type MutationMerchantMapSuggestArgs = { + input: MerchantMapSuggestInput; +}; + export type MutationOnChainAddressCreateArgs = { - input: OnChainAddressCreateInput -} + input: OnChainAddressCreateInput; +}; + export type MutationOnChainAddressCurrentArgs = { - input: OnChainAddressCurrentInput -} + input: OnChainAddressCurrentInput; +}; + export type MutationOnChainPaymentSendArgs = { - input: OnChainPaymentSendInput -} + input: OnChainPaymentSendInput; +}; + export type MutationOnChainPaymentSendAllArgs = { - input: OnChainPaymentSendAllInput -} + input: OnChainPaymentSendAllInput; +}; + export type MutationOnChainUsdPaymentSendArgs = { - input: OnChainUsdPaymentSendInput -} + input: OnChainUsdPaymentSendInput; +}; + export type MutationOnChainUsdPaymentSendAsBtcDenominatedArgs = { - input: OnChainUsdPaymentSendAsBtcDenominatedInput -} + input: OnChainUsdPaymentSendAsBtcDenominatedInput; +}; + + +export type MutationQuizClaimArgs = { + input: QuizClaimInput; +}; + export type MutationQuizCompletedArgs = { - input: QuizCompletedInput -} + input: QuizCompletedInput; +}; + export type MutationUserContactUpdateAliasArgs = { - input: UserContactUpdateAliasInput -} + input: UserContactUpdateAliasInput; +}; + export type MutationUserEmailRegistrationInitiateArgs = { - input: UserEmailRegistrationInitiateInput -} + input: UserEmailRegistrationInitiateInput; +}; + export type MutationUserEmailRegistrationValidateArgs = { - input: UserEmailRegistrationValidateInput -} + input: UserEmailRegistrationValidateInput; +}; + export type MutationUserLoginArgs = { - input: UserLoginInput -} + input: UserLoginInput; +}; + export type MutationUserLoginUpgradeArgs = { - input: UserLoginUpgradeInput -} + input: UserLoginUpgradeInput; +}; -export type MutationUserLogoutArgs = { - input: UserLogoutInput -} -export type MutationUserPhoneRegistrationInitiateArgs = { - input: UserPhoneRegistrationInitiateInput -} +export type MutationUserLogoutArgs = { + input?: InputMaybe; +}; -export type MutationUserPhoneRegistrationValidateArgs = { - input: UserPhoneRegistrationValidateInput -} -export type MutationUserQuizQuestionUpdateCompletedArgs = { - input: UserQuizQuestionUpdateCompletedInput -} +export type MutationUserPhoneRegistrationInitiateArgs = { + input: UserPhoneRegistrationInitiateInput; +}; -export type MutationUserRequestAuthCodeArgs = { - input: UserRequestAuthCodeInput -} -export type MutationUserTotpDeleteArgs = { - input: UserTotpDeleteInput -} +export type MutationUserPhoneRegistrationValidateArgs = { + input: UserPhoneRegistrationValidateInput; +}; -export type MutationUserTotpRegistrationInitiateArgs = { - input: UserTotpRegistrationInitiateInput -} export type MutationUserTotpRegistrationValidateArgs = { - input: UserTotpRegistrationValidateInput -} + input: UserTotpRegistrationValidateInput; +}; + export type MutationUserUpdateLanguageArgs = { - input: UserUpdateLanguageInput -} + input: UserUpdateLanguageInput; +}; + export type MutationUserUpdateUsernameArgs = { - input: UserUpdateUsernameInput -} + input: UserUpdateUsernameInput; +}; export type MyUpdatesPayload = { - readonly __typename: "MyUpdatesPayload" - readonly errors: ReadonlyArray - readonly me?: Maybe - readonly update?: Maybe -} + readonly __typename: 'MyUpdatesPayload'; + readonly errors: ReadonlyArray; + readonly me?: Maybe; + readonly update?: Maybe; +}; export const Network = { - Mainnet: "mainnet", - Regtest: "regtest", - Signet: "signet", - Testnet: "testnet", -} as const + Mainnet: 'mainnet', + Regtest: 'regtest', + Signet: 'signet', + Testnet: 'testnet' +} as const; + +export type Network = typeof Network[keyof typeof Network]; +export const NotificationChannel = { + Push: 'PUSH' +} as const; + +export type NotificationChannel = typeof NotificationChannel[keyof typeof NotificationChannel]; +export type NotificationChannelSettings = { + readonly __typename: 'NotificationChannelSettings'; + readonly disabledCategories: ReadonlyArray; + readonly enabled: Scalars['Boolean']; +}; + +export type NotificationSettings = { + readonly __typename: 'NotificationSettings'; + readonly push: NotificationChannelSettings; +}; -export type Network = (typeof Network)[keyof typeof Network] export type OnChainAddressCreateInput = { - readonly walletId: Scalars["WalletId"] -} + readonly walletId: Scalars['WalletId']; +}; export type OnChainAddressCurrentInput = { - readonly walletId: Scalars["WalletId"] -} + readonly walletId: Scalars['WalletId']; +}; export type OnChainAddressPayload = { - readonly __typename: "OnChainAddressPayload" - readonly address?: Maybe - readonly errors: ReadonlyArray -} + readonly __typename: 'OnChainAddressPayload'; + readonly address?: Maybe; + readonly errors: ReadonlyArray; +}; export type OnChainPaymentSendAllInput = { - readonly address: Scalars["OnChainAddress"] - readonly memo?: InputMaybe - readonly speed?: InputMaybe - /** @deprecated Ignored - will be replaced */ - readonly targetConfirmations?: InputMaybe - readonly walletId: Scalars["WalletId"] -} + readonly address: Scalars['OnChainAddress']; + readonly memo?: InputMaybe; + readonly speed?: PayoutSpeed; + readonly walletId: Scalars['WalletId']; +}; export type OnChainPaymentSendInput = { - readonly address: Scalars["OnChainAddress"] - readonly amount: Scalars["SatAmount"] - readonly memo?: InputMaybe - readonly speed?: InputMaybe - /** @deprecated Ignored - will be replaced */ - readonly targetConfirmations?: InputMaybe - readonly walletId: Scalars["WalletId"] -} + readonly address: Scalars['OnChainAddress']; + readonly amount: Scalars['SatAmount']; + readonly memo?: InputMaybe; + readonly speed?: PayoutSpeed; + readonly walletId: Scalars['WalletId']; +}; export type OnChainTxFee = { - readonly __typename: "OnChainTxFee" - readonly amount: Scalars["SatAmount"] - /** @deprecated Ignored - will be removed */ - readonly targetConfirmations: Scalars["TargetConfirmations"] -} + readonly __typename: 'OnChainTxFee'; + readonly amount: Scalars['SatAmount']; +}; export type OnChainUpdate = { - readonly __typename: "OnChainUpdate" - readonly amount: Scalars["SatAmount"] - readonly displayCurrencyPerSat: Scalars["Float"] - readonly txHash: Scalars["OnChainTxHash"] - readonly txNotificationType: TxNotificationType + readonly __typename: 'OnChainUpdate'; + /** @deprecated Deprecated in favor of transaction */ + readonly amount: Scalars['SatAmount']; + /** @deprecated Deprecated in favor of transaction */ + readonly displayCurrencyPerSat: Scalars['Float']; + readonly transaction: Transaction; + /** @deprecated Deprecated in favor of transaction */ + readonly txHash: Scalars['OnChainTxHash']; + readonly txNotificationType: TxNotificationType; /** @deprecated updated over displayCurrencyPerSat */ - readonly usdPerSat: Scalars["Float"] - readonly walletId: Scalars["WalletId"] -} + readonly usdPerSat: Scalars['Float']; + /** @deprecated Deprecated in favor of transaction */ + readonly walletId: Scalars['WalletId']; +}; export type OnChainUsdPaymentSendAsBtcDenominatedInput = { - readonly address: Scalars["OnChainAddress"] - readonly amount: Scalars["SatAmount"] - readonly memo?: InputMaybe - readonly speed?: InputMaybe - /** @deprecated Ignored - will be replaced */ - readonly targetConfirmations?: InputMaybe - readonly walletId: Scalars["WalletId"] -} + readonly address: Scalars['OnChainAddress']; + readonly amount: Scalars['SatAmount']; + readonly memo?: InputMaybe; + readonly speed?: PayoutSpeed; + readonly walletId: Scalars['WalletId']; +}; export type OnChainUsdPaymentSendInput = { - readonly address: Scalars["OnChainAddress"] - readonly amount: Scalars["CentAmount"] - readonly memo?: InputMaybe - readonly speed?: InputMaybe - /** @deprecated Ignored - will be replaced */ - readonly targetConfirmations?: InputMaybe - readonly walletId: Scalars["WalletId"] -} + readonly address: Scalars['OnChainAddress']; + readonly amount: Scalars['CentAmount']; + readonly memo?: InputMaybe; + readonly speed?: PayoutSpeed; + readonly walletId: Scalars['WalletId']; +}; export type OnChainUsdTxFee = { - readonly __typename: "OnChainUsdTxFee" - readonly amount: Scalars["CentAmount"] - /** @deprecated Ignored - will be removed */ - readonly targetConfirmations: Scalars["TargetConfirmations"] -} + readonly __typename: 'OnChainUsdTxFee'; + readonly amount: Scalars['CentAmount']; +}; export type OneDayAccountLimit = AccountLimit & { - readonly __typename: "OneDayAccountLimit" + readonly __typename: 'OneDayAccountLimit'; /** The rolling time interval value in seconds for the current 24 hour period. */ - readonly interval?: Maybe + readonly interval?: Maybe; /** The amount of cents remaining below the limit for the current 24 hour period. */ - readonly remainingLimit?: Maybe + readonly remainingLimit?: Maybe; /** The current maximum limit for a given 24 hour period. */ - readonly totalLimit: Scalars["CentAmount"] -} + readonly totalLimit: Scalars['CentAmount']; +}; /** Information about pagination in a connection. */ export type PageInfo = { - readonly __typename: "PageInfo" + readonly __typename: 'PageInfo'; /** When paginating forwards, the cursor to continue. */ - readonly endCursor?: Maybe + readonly endCursor?: Maybe; /** When paginating forwards, are there more items? */ - readonly hasNextPage: Scalars["Boolean"] + readonly hasNextPage: Scalars['Boolean']; /** When paginating backwards, are there more items? */ - readonly hasPreviousPage: Scalars["Boolean"] + readonly hasPreviousPage: Scalars['Boolean']; /** When paginating backwards, the cursor to continue. */ - readonly startCursor?: Maybe -} + readonly startCursor?: Maybe; +}; export type PaymentSendPayload = { - readonly __typename: "PaymentSendPayload" - readonly errors: ReadonlyArray - readonly status?: Maybe -} + readonly __typename: 'PaymentSendPayload'; + readonly errors: ReadonlyArray; + readonly status?: Maybe; + readonly transaction?: Maybe; +}; export const PaymentSendResult = { - AlreadyPaid: "ALREADY_PAID", - Failure: "FAILURE", - Pending: "PENDING", - Success: "SUCCESS", -} as const + AlreadyPaid: 'ALREADY_PAID', + Failure: 'FAILURE', + Pending: 'PENDING', + Success: 'SUCCESS' +} as const; -export type PaymentSendResult = (typeof PaymentSendResult)[keyof typeof PaymentSendResult] +export type PaymentSendResult = typeof PaymentSendResult[keyof typeof PaymentSendResult]; export const PayoutSpeed = { - Fast: "FAST", -} as const + Fast: 'FAST' +} as const; -export type PayoutSpeed = (typeof PayoutSpeed)[keyof typeof PayoutSpeed] +export type PayoutSpeed = typeof PayoutSpeed[keyof typeof PayoutSpeed]; export const PhoneCodeChannelType = { - Sms: "SMS", - Whatsapp: "WHATSAPP", -} as const + Sms: 'SMS', + Whatsapp: 'WHATSAPP' +} as const; -export type PhoneCodeChannelType = - (typeof PhoneCodeChannelType)[keyof typeof PhoneCodeChannelType] +export type PhoneCodeChannelType = typeof PhoneCodeChannelType[keyof typeof PhoneCodeChannelType]; /** Price amount expressed in base/offset. To calculate, use: `base / 10^offset` */ export type Price = { - readonly __typename: "Price" - readonly base: Scalars["SafeInt"] - readonly currencyUnit: Scalars["String"] - readonly formattedAmount: Scalars["String"] - readonly offset: Scalars["Int"] -} + readonly __typename: 'Price'; + readonly base: Scalars['SafeInt']; + readonly currencyUnit: Scalars['String']; + readonly formattedAmount: Scalars['String']; + readonly offset: Scalars['Int']; +}; /** The range for the X axis in the BTC price graph */ export const PriceGraphRange = { - FiveYears: "FIVE_YEARS", - OneDay: "ONE_DAY", - OneMonth: "ONE_MONTH", - OneWeek: "ONE_WEEK", - OneYear: "ONE_YEAR", -} as const - -export type PriceGraphRange = (typeof PriceGraphRange)[keyof typeof PriceGraphRange] + FiveYears: 'FIVE_YEARS', + OneDay: 'ONE_DAY', + OneMonth: 'ONE_MONTH', + OneWeek: 'ONE_WEEK', + OneYear: 'ONE_YEAR' +} as const; + +export type PriceGraphRange = typeof PriceGraphRange[keyof typeof PriceGraphRange]; export type PriceInput = { - readonly amount: Scalars["SatAmount"] - readonly amountCurrencyUnit: ExchangeCurrencyUnit - readonly priceCurrencyUnit: ExchangeCurrencyUnit -} + readonly amount: Scalars['SatAmount']; + readonly amountCurrencyUnit: ExchangeCurrencyUnit; + readonly priceCurrencyUnit: ExchangeCurrencyUnit; +}; export type PriceInterface = { - readonly base: Scalars["SafeInt"] + readonly base: Scalars['SafeInt']; /** @deprecated Deprecated due to type renaming */ - readonly currencyUnit: Scalars["String"] - readonly offset: Scalars["Int"] -} + readonly currencyUnit: Scalars['String']; + readonly offset: Scalars['Int']; +}; /** Price of 1 sat in base/offset. To calculate, use: `base / 10^offset` */ export type PriceOfOneSatInMinorUnit = PriceInterface & { - readonly __typename: "PriceOfOneSatInMinorUnit" - readonly base: Scalars["SafeInt"] + readonly __typename: 'PriceOfOneSatInMinorUnit'; + readonly base: Scalars['SafeInt']; /** @deprecated Deprecated due to type renaming */ - readonly currencyUnit: Scalars["String"] - readonly offset: Scalars["Int"] -} + readonly currencyUnit: Scalars['String']; + readonly offset: Scalars['Int']; +}; /** Price of 1 sat or 1 usd cent in base/offset. To calculate, use: `base / 10^offset` */ export type PriceOfOneSettlementMinorUnitInDisplayMinorUnit = PriceInterface & { - readonly __typename: "PriceOfOneSettlementMinorUnitInDisplayMinorUnit" - readonly base: Scalars["SafeInt"] + readonly __typename: 'PriceOfOneSettlementMinorUnitInDisplayMinorUnit'; + readonly base: Scalars['SafeInt']; /** @deprecated Deprecated due to type renaming */ - readonly currencyUnit: Scalars["String"] + readonly currencyUnit: Scalars['String']; /** @deprecated Deprecated please use `base / 10^offset` */ - readonly formattedAmount: Scalars["String"] - readonly offset: Scalars["Int"] -} + readonly formattedAmount: Scalars['String']; + readonly offset: Scalars['Int']; +}; /** Price of 1 usd cent in base/offset. To calculate, use: `base / 10^offset` */ export type PriceOfOneUsdCentInMinorUnit = PriceInterface & { - readonly __typename: "PriceOfOneUsdCentInMinorUnit" - readonly base: Scalars["SafeInt"] + readonly __typename: 'PriceOfOneUsdCentInMinorUnit'; + readonly base: Scalars['SafeInt']; /** @deprecated Deprecated due to type renaming */ - readonly currencyUnit: Scalars["String"] - readonly offset: Scalars["Int"] -} + readonly currencyUnit: Scalars['String']; + readonly offset: Scalars['Int']; +}; export type PricePayload = { - readonly __typename: "PricePayload" - readonly errors: ReadonlyArray - readonly price?: Maybe -} + readonly __typename: 'PricePayload'; + readonly errors: ReadonlyArray; + readonly price?: Maybe; +}; export type PricePoint = { - readonly __typename: "PricePoint" - readonly price: Price + readonly __typename: 'PricePoint'; + readonly price: Price; /** Unix timestamp (number of seconds elapsed since January 1, 1970 00:00:00 UTC) */ - readonly timestamp: Scalars["Timestamp"] -} + readonly timestamp: Scalars['Timestamp']; +}; /** A public view of a generic wallet which stores value in one of our supported currencies. */ export type PublicWallet = { - readonly __typename: "PublicWallet" - readonly id: Scalars["ID"] - readonly walletCurrency: WalletCurrency -} + readonly __typename: 'PublicWallet'; + readonly currency: WalletCurrency; + readonly id: Scalars['ID']; + /** @deprecated Shifting property to 'currency' */ + readonly walletCurrency: WalletCurrency; +}; export type Query = { - readonly __typename: "Query" - readonly accountDefaultWallet: PublicWallet - /** @deprecated Deprecated in favor of realtimePrice */ - readonly btcPrice?: Maybe - readonly btcPriceList?: Maybe>> - readonly businessMapMarkers?: Maybe>> - readonly currencyList: ReadonlyArray - readonly globals?: Maybe - readonly lnInvoicePaymentStatus: LnInvoicePaymentStatusPayload - readonly me?: Maybe - readonly mobileVersions?: Maybe>> - readonly onChainTxFee: OnChainTxFee - readonly onChainUsdTxFee: OnChainUsdTxFee - readonly onChainUsdTxFeeAsBtcDenominated: OnChainUsdTxFee - /** @deprecated TODO: remove. we don't need a non authenticated version of this query. the users can only do the query while authenticated */ - readonly quizQuestions?: Maybe>> + readonly __typename: 'Query'; + readonly accountDefaultWallet: PublicWallet; + readonly btcPriceList?: Maybe>>; + readonly businessMapMarkers: ReadonlyArray; + readonly currencyList: ReadonlyArray; + readonly globals?: Maybe; + readonly lnInvoicePaymentStatus: LnInvoicePaymentStatusPayload; + readonly me?: Maybe; + readonly mobileVersions?: Maybe>>; + readonly onChainTxFee: OnChainTxFee; + readonly onChainUsdTxFee: OnChainUsdTxFee; + readonly onChainUsdTxFeeAsBtcDenominated: OnChainUsdTxFee; /** Returns 1 Sat and 1 Usd Cent price for the given currency */ - readonly realtimePrice: RealtimePrice + readonly realtimePrice: RealtimePrice; /** @deprecated will be migrated to AccountDefaultWalletId */ - readonly userDefaultWalletId: Scalars["WalletId"] - readonly usernameAvailable?: Maybe -} + readonly userDefaultWalletId: Scalars['WalletId']; + readonly usernameAvailable?: Maybe; +}; + export type QueryAccountDefaultWalletArgs = { - username: Scalars["Username"] - walletCurrency?: InputMaybe -} + username: Scalars['Username']; + walletCurrency?: InputMaybe; +}; -export type QueryBtcPriceArgs = { - currency?: Scalars["DisplayCurrency"] -} export type QueryBtcPriceListArgs = { - range: PriceGraphRange -} + range: PriceGraphRange; +}; + export type QueryLnInvoicePaymentStatusArgs = { - input: LnInvoicePaymentStatusInput -} + input: LnInvoicePaymentStatusInput; +}; + export type QueryOnChainTxFeeArgs = { - address: Scalars["OnChainAddress"] - amount: Scalars["SatAmount"] - speed?: InputMaybe - targetConfirmations?: InputMaybe - walletId: Scalars["WalletId"] -} + address: Scalars['OnChainAddress']; + amount: Scalars['SatAmount']; + speed?: PayoutSpeed; + walletId: Scalars['WalletId']; +}; + export type QueryOnChainUsdTxFeeArgs = { - address: Scalars["OnChainAddress"] - amount: Scalars["CentAmount"] - speed?: InputMaybe - targetConfirmations?: InputMaybe - walletId: Scalars["WalletId"] -} + address: Scalars['OnChainAddress']; + amount: Scalars['CentAmount']; + speed?: PayoutSpeed; + walletId: Scalars['WalletId']; +}; + export type QueryOnChainUsdTxFeeAsBtcDenominatedArgs = { - address: Scalars["OnChainAddress"] - amount: Scalars["SatAmount"] - speed?: InputMaybe - targetConfirmations?: InputMaybe - walletId: Scalars["WalletId"] -} + address: Scalars['OnChainAddress']; + amount: Scalars['SatAmount']; + speed?: PayoutSpeed; + walletId: Scalars['WalletId']; +}; + export type QueryRealtimePriceArgs = { - currency?: InputMaybe -} + currency?: InputMaybe; +}; + export type QueryUserDefaultWalletIdArgs = { - username: Scalars["Username"] -} + username: Scalars['Username']; +}; + export type QueryUsernameAvailableArgs = { - username: Scalars["Username"] -} + username: Scalars['Username']; +}; export type Quiz = { - readonly __typename: "Quiz" + readonly __typename: 'Quiz'; /** The reward in Satoshis for the quiz question */ - readonly amount: Scalars["SatAmount"] - readonly completed: Scalars["Boolean"] - readonly id: Scalars["ID"] -} + readonly amount: Scalars['SatAmount']; + readonly completed: Scalars['Boolean']; + readonly id: Scalars['ID']; + readonly notBefore?: Maybe; +}; + +export type QuizClaimInput = { + readonly id: Scalars['ID']; +}; + +export type QuizClaimPayload = { + readonly __typename: 'QuizClaimPayload'; + readonly errors: ReadonlyArray; + readonly quizzes: ReadonlyArray; +}; export type QuizCompletedInput = { - readonly id: Scalars["ID"] -} + readonly id: Scalars['ID']; +}; export type QuizCompletedPayload = { - readonly __typename: "QuizCompletedPayload" - readonly errors: ReadonlyArray - readonly quiz?: Maybe -} - -export type QuizQuestion = { - readonly __typename: "QuizQuestion" - /** The earn reward in Satoshis for the quiz question */ - readonly earnAmount: Scalars["SatAmount"] - readonly id: Scalars["ID"] -} + readonly __typename: 'QuizCompletedPayload'; + readonly errors: ReadonlyArray; + readonly quiz?: Maybe; +}; export type RealtimePrice = { - readonly __typename: "RealtimePrice" - readonly btcSatPrice: PriceOfOneSatInMinorUnit - readonly denominatorCurrency: Scalars["DisplayCurrency"] - readonly id: Scalars["ID"] + readonly __typename: 'RealtimePrice'; + readonly btcSatPrice: PriceOfOneSatInMinorUnit; + readonly denominatorCurrency: Scalars['DisplayCurrency']; + readonly id: Scalars['ID']; /** Unix timestamp (number of seconds elapsed since January 1, 1970 00:00:00 UTC) */ - readonly timestamp: Scalars["Timestamp"] - readonly usdCentPrice: PriceOfOneUsdCentInMinorUnit -} + readonly timestamp: Scalars['Timestamp']; + readonly usdCentPrice: PriceOfOneUsdCentInMinorUnit; +}; export type RealtimePriceInput = { - readonly currency?: InputMaybe -} + readonly currency?: InputMaybe; +}; export type RealtimePricePayload = { - readonly __typename: "RealtimePricePayload" - readonly errors: ReadonlyArray - readonly realtimePrice?: Maybe -} + readonly __typename: 'RealtimePricePayload'; + readonly errors: ReadonlyArray; + readonly realtimePrice?: Maybe; +}; export type SatAmountPayload = { - readonly __typename: "SatAmountPayload" - readonly amount?: Maybe - readonly errors: ReadonlyArray -} + readonly __typename: 'SatAmountPayload'; + readonly amount?: Maybe; + readonly errors: ReadonlyArray; +}; -export type SettlementVia = - | SettlementViaIntraLedger - | SettlementViaLn - | SettlementViaOnChain +export type SettlementVia = SettlementViaIntraLedger | SettlementViaLn | SettlementViaOnChain; export type SettlementViaIntraLedger = { - readonly __typename: "SettlementViaIntraLedger" + readonly __typename: 'SettlementViaIntraLedger'; /** Settlement destination: Could be null if the payee does not have a username */ - readonly counterPartyUsername?: Maybe - readonly counterPartyWalletId?: Maybe -} + readonly counterPartyUsername?: Maybe; + readonly counterPartyWalletId?: Maybe; + readonly preImage?: Maybe; +}; export type SettlementViaLn = { - readonly __typename: "SettlementViaLn" + readonly __typename: 'SettlementViaLn'; /** @deprecated Shifting property to 'preImage' to improve granularity of the LnPaymentSecret type */ - readonly paymentSecret?: Maybe - readonly preImage?: Maybe -} + readonly paymentSecret?: Maybe; + readonly preImage?: Maybe; +}; export type SettlementViaOnChain = { - readonly __typename: "SettlementViaOnChain" - readonly transactionHash?: Maybe - readonly vout?: Maybe -} + readonly __typename: 'SettlementViaOnChain'; + readonly arrivalInMempoolEstimatedAt?: Maybe; + readonly transactionHash?: Maybe; + readonly vout?: Maybe; +}; export type Subscription = { - readonly __typename: "Subscription" - readonly lnInvoicePaymentStatus: LnInvoicePaymentStatusPayload - readonly myUpdates: MyUpdatesPayload - readonly price: PricePayload + readonly __typename: 'Subscription'; + readonly lnInvoicePaymentStatus: LnInvoicePaymentStatusPayload; + readonly myUpdates: MyUpdatesPayload; + readonly price: PricePayload; /** Returns the price of 1 satoshi */ - readonly realtimePrice: RealtimePricePayload -} + readonly realtimePrice: RealtimePricePayload; +}; + export type SubscriptionLnInvoicePaymentStatusArgs = { - input: LnInvoicePaymentStatusInput -} + input: LnInvoicePaymentStatusInput; +}; + export type SubscriptionPriceArgs = { - input: PriceInput -} + input: PriceInput; +}; + export type SubscriptionRealtimePriceArgs = { - input: RealtimePriceInput -} + input: RealtimePriceInput; +}; export type SuccessPayload = { - readonly __typename: "SuccessPayload" - readonly errors: ReadonlyArray - readonly success?: Maybe -} + readonly __typename: 'SuccessPayload'; + readonly errors: ReadonlyArray; + readonly success?: Maybe; +}; /** * Give details about an individual transaction. @@ -1275,625 +1620,608 @@ export type SuccessPayload = { * or with lightning but settled intraledger. */ export type Transaction = { - readonly __typename: "Transaction" - readonly createdAt: Scalars["Timestamp"] - readonly direction: TxDirection - readonly id: Scalars["ID"] + readonly __typename: 'Transaction'; + readonly createdAt: Scalars['Timestamp']; + readonly direction: TxDirection; + readonly id: Scalars['ID']; /** From which protocol the payment has been initiated. */ - readonly initiationVia: InitiationVia - readonly memo?: Maybe + readonly initiationVia: InitiationVia; + readonly memo?: Maybe; /** Amount of the settlement currency sent or received. */ - readonly settlementAmount: Scalars["SignedAmount"] + readonly settlementAmount: Scalars['SignedAmount']; /** Wallet currency for transaction. */ - readonly settlementCurrency: WalletCurrency - readonly settlementDisplayAmount: Scalars["SignedDisplayMajorAmount"] - readonly settlementDisplayCurrency: Scalars["DisplayCurrency"] - readonly settlementDisplayFee: Scalars["SignedDisplayMajorAmount"] - readonly settlementFee: Scalars["SignedAmount"] + readonly settlementCurrency: WalletCurrency; + readonly settlementDisplayAmount: Scalars['SignedDisplayMajorAmount']; + readonly settlementDisplayCurrency: Scalars['DisplayCurrency']; + readonly settlementDisplayFee: Scalars['SignedDisplayMajorAmount']; + readonly settlementFee: Scalars['SignedAmount']; /** Price in WALLETCURRENCY/SETTLEMENTUNIT at time of settlement. */ - readonly settlementPrice: PriceOfOneSettlementMinorUnitInDisplayMinorUnit + readonly settlementPrice: PriceOfOneSettlementMinorUnitInDisplayMinorUnit; /** To which protocol the payment has settled on. */ - readonly settlementVia: SettlementVia - readonly status: TxStatus -} + readonly settlementVia: SettlementVia; + readonly status: TxStatus; +}; /** A connection to a list of items. */ export type TransactionConnection = { - readonly __typename: "TransactionConnection" + readonly __typename: 'TransactionConnection'; /** A list of edges. */ - readonly edges?: Maybe> + readonly edges?: Maybe>; /** Information to aid in pagination. */ - readonly pageInfo: PageInfo -} + readonly pageInfo: PageInfo; +}; /** An edge in a connection. */ export type TransactionEdge = { - readonly __typename: "TransactionEdge" + readonly __typename: 'TransactionEdge'; /** A cursor for use in pagination */ - readonly cursor: Scalars["String"] + readonly cursor: Scalars['String']; /** The item at the end of the edge */ - readonly node: Transaction -} + readonly node: Transaction; +}; export const TxDirection = { - Receive: "RECEIVE", - Send: "SEND", -} as const + Receive: 'RECEIVE', + Send: 'SEND' +} as const; -export type TxDirection = (typeof TxDirection)[keyof typeof TxDirection] +export type TxDirection = typeof TxDirection[keyof typeof TxDirection]; export const TxNotificationType = { - IntraLedgerPayment: "IntraLedgerPayment", - IntraLedgerReceipt: "IntraLedgerReceipt", - LnInvoicePaid: "LnInvoicePaid", - OnchainPayment: "OnchainPayment", - OnchainReceipt: "OnchainReceipt", - OnchainReceiptPending: "OnchainReceiptPending", -} as const - -export type TxNotificationType = - (typeof TxNotificationType)[keyof typeof TxNotificationType] + IntraLedgerPayment: 'IntraLedgerPayment', + IntraLedgerReceipt: 'IntraLedgerReceipt', + LigtningReceipt: 'LigtningReceipt', + OnchainPayment: 'OnchainPayment', + OnchainReceipt: 'OnchainReceipt', + OnchainReceiptPending: 'OnchainReceiptPending' +} as const; + +export type TxNotificationType = typeof TxNotificationType[keyof typeof TxNotificationType]; export const TxStatus = { - Failure: "FAILURE", - Pending: "PENDING", - Success: "SUCCESS", -} as const + Failure: 'FAILURE', + Pending: 'PENDING', + Success: 'SUCCESS' +} as const; -export type TxStatus = (typeof TxStatus)[keyof typeof TxStatus] +export type TxStatus = typeof TxStatus[keyof typeof TxStatus]; export type UpgradePayload = { - readonly __typename: "UpgradePayload" - readonly authToken?: Maybe - readonly errors: ReadonlyArray - readonly success: Scalars["Boolean"] -} + readonly __typename: 'UpgradePayload'; + readonly authToken?: Maybe; + readonly errors: ReadonlyArray; + readonly success: Scalars['Boolean']; +}; /** A wallet belonging to an account which contains a USD balance and a list of transactions. */ export type UsdWallet = Wallet & { - readonly __typename: "UsdWallet" - readonly accountId: Scalars["ID"] - readonly balance: Scalars["SignedAmount"] - readonly id: Scalars["ID"] + readonly __typename: 'UsdWallet'; + readonly accountId: Scalars['ID']; + readonly balance: Scalars['SignedAmount']; + readonly id: Scalars['ID']; + readonly invoiceByPaymentHash: Invoice; + /** A list of all invoices associated with walletIds optionally passed. */ + readonly invoices?: Maybe; /** An unconfirmed incoming onchain balance. */ - readonly pendingIncomingBalance: Scalars["SignedAmount"] - readonly transactions?: Maybe - readonly transactionsByAddress?: Maybe - readonly walletCurrency: WalletCurrency -} + readonly pendingIncomingBalance: Scalars['SignedAmount']; + readonly pendingIncomingTransactions: ReadonlyArray; + readonly pendingIncomingTransactionsByAddress: ReadonlyArray; + readonly transactionById: Transaction; + readonly transactions?: Maybe; + readonly transactionsByAddress?: Maybe; + readonly transactionsByPaymentHash: ReadonlyArray; + readonly walletCurrency: WalletCurrency; +}; + + +/** A wallet belonging to an account which contains a USD balance and a list of transactions. */ +export type UsdWalletInvoiceByPaymentHashArgs = { + paymentHash: Scalars['PaymentHash']; +}; + + +/** A wallet belonging to an account which contains a USD balance and a list of transactions. */ +export type UsdWalletInvoicesArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + + +/** A wallet belonging to an account which contains a USD balance and a list of transactions. */ +export type UsdWalletPendingIncomingTransactionsByAddressArgs = { + address: Scalars['OnChainAddress']; +}; + + +/** A wallet belonging to an account which contains a USD balance and a list of transactions. */ +export type UsdWalletTransactionByIdArgs = { + transactionId: Scalars['ID']; +}; + /** A wallet belonging to an account which contains a USD balance and a list of transactions. */ export type UsdWalletTransactionsArgs = { - after?: InputMaybe - before?: InputMaybe - first?: InputMaybe - last?: InputMaybe -} + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + /** A wallet belonging to an account which contains a USD balance and a list of transactions. */ export type UsdWalletTransactionsByAddressArgs = { - address: Scalars["OnChainAddress"] - after?: InputMaybe - before?: InputMaybe - first?: InputMaybe - last?: InputMaybe -} + address: Scalars['OnChainAddress']; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + + +/** A wallet belonging to an account which contains a USD balance and a list of transactions. */ +export type UsdWalletTransactionsByPaymentHashArgs = { + paymentHash: Scalars['PaymentHash']; +}; export type User = { - readonly __typename: "User" + readonly __typename: 'User'; /** * Get single contact details. * Can include the transactions associated with the contact. * @deprecated will be moved to Accounts */ - readonly contactByUsername: UserContact + readonly contactByUsername: UserContact; /** * Get full list of contacts. * Can include the transactions associated with each contact. * @deprecated will be moved to account */ - readonly contacts: ReadonlyArray - readonly createdAt: Scalars["Timestamp"] - readonly defaultAccount: Account + readonly contacts: ReadonlyArray; + readonly createdAt: Scalars['Timestamp']; + readonly defaultAccount: Account; /** Email address */ - readonly email?: Maybe - readonly id: Scalars["ID"] + readonly email?: Maybe; + readonly id: Scalars['ID']; /** * Preferred language for user. * When value is 'default' the intent is to use preferred language from OS settings. */ - readonly language: Scalars["Language"] + readonly language: Scalars['Language']; /** Phone number with international calling code. */ - readonly phone?: Maybe - /** - * List the quiz questions the user may have completed. - * @deprecated use Quiz from Account instead - */ - readonly quizQuestions: ReadonlyArray + readonly phone?: Maybe; /** Whether TOTP is enabled for this user. */ - readonly totpEnabled: Scalars["Boolean"] + readonly totpEnabled: Scalars['Boolean']; /** * Optional immutable user friendly identifier. * @deprecated will be moved to @Handle in Account and Wallet */ - readonly username?: Maybe -} + readonly username?: Maybe; +}; + export type UserContactByUsernameArgs = { - username: Scalars["Username"] -} + username: Scalars['Username']; +}; export type UserContact = { - readonly __typename: "UserContact" + readonly __typename: 'UserContact'; /** * Alias the user can set for this contact. * Only the user can see the alias attached to their contact. */ - readonly alias?: Maybe - readonly id: Scalars["Username"] + readonly alias?: Maybe; + readonly id: Scalars['Username']; /** Paginated list of transactions sent to/from this contact. */ - readonly transactions?: Maybe - readonly transactionsCount: Scalars["Int"] + readonly transactions?: Maybe; + readonly transactionsCount: Scalars['Int']; /** Actual identifier of the contact. */ - readonly username: Scalars["Username"] -} + readonly username: Scalars['Username']; +}; + export type UserContactTransactionsArgs = { - after?: InputMaybe - before?: InputMaybe - first?: InputMaybe - last?: InputMaybe -} + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; export type UserContactUpdateAliasInput = { - readonly alias: Scalars["ContactAlias"] - readonly username: Scalars["Username"] -} + readonly alias: Scalars['ContactAlias']; + readonly username: Scalars['Username']; +}; export type UserContactUpdateAliasPayload = { - readonly __typename: "UserContactUpdateAliasPayload" - readonly contact?: Maybe - readonly errors: ReadonlyArray -} + readonly __typename: 'UserContactUpdateAliasPayload'; + readonly contact?: Maybe; + readonly errors: ReadonlyArray; +}; export type UserEmailDeletePayload = { - readonly __typename: "UserEmailDeletePayload" - readonly errors: ReadonlyArray - readonly me?: Maybe -} + readonly __typename: 'UserEmailDeletePayload'; + readonly errors: ReadonlyArray; + readonly me?: Maybe; +}; export type UserEmailRegistrationInitiateInput = { - readonly email: Scalars["EmailAddress"] -} + readonly email: Scalars['EmailAddress']; +}; export type UserEmailRegistrationInitiatePayload = { - readonly __typename: "UserEmailRegistrationInitiatePayload" - readonly emailRegistrationId?: Maybe - readonly errors: ReadonlyArray - readonly me?: Maybe -} + readonly __typename: 'UserEmailRegistrationInitiatePayload'; + readonly emailRegistrationId?: Maybe; + readonly errors: ReadonlyArray; + readonly me?: Maybe; +}; export type UserEmailRegistrationValidateInput = { - readonly code: Scalars["OneTimeAuthCode"] - readonly emailRegistrationId: Scalars["EmailRegistrationId"] -} + readonly code: Scalars['OneTimeAuthCode']; + readonly emailRegistrationId: Scalars['EmailRegistrationId']; +}; export type UserEmailRegistrationValidatePayload = { - readonly __typename: "UserEmailRegistrationValidatePayload" - readonly errors: ReadonlyArray - readonly me?: Maybe -} + readonly __typename: 'UserEmailRegistrationValidatePayload'; + readonly errors: ReadonlyArray; + readonly me?: Maybe; +}; export type UserLoginInput = { - readonly code: Scalars["OneTimeAuthCode"] - readonly phone: Scalars["Phone"] -} + readonly code: Scalars['OneTimeAuthCode']; + readonly phone: Scalars['Phone']; +}; export type UserLoginUpgradeInput = { - readonly code: Scalars["OneTimeAuthCode"] - readonly phone: Scalars["Phone"] -} + readonly code: Scalars['OneTimeAuthCode']; + readonly phone: Scalars['Phone']; +}; export type UserLogoutInput = { - readonly authToken: Scalars["AuthToken"] -} + readonly deviceToken: Scalars['String']; +}; export type UserPhoneDeletePayload = { - readonly __typename: "UserPhoneDeletePayload" - readonly errors: ReadonlyArray - readonly me?: Maybe -} + readonly __typename: 'UserPhoneDeletePayload'; + readonly errors: ReadonlyArray; + readonly me?: Maybe; +}; export type UserPhoneRegistrationInitiateInput = { - readonly channel?: InputMaybe - readonly phone: Scalars["Phone"] -} + readonly channel?: InputMaybe; + readonly phone: Scalars['Phone']; +}; export type UserPhoneRegistrationValidateInput = { - readonly code: Scalars["OneTimeAuthCode"] - readonly phone: Scalars["Phone"] -} + readonly code: Scalars['OneTimeAuthCode']; + readonly phone: Scalars['Phone']; +}; export type UserPhoneRegistrationValidatePayload = { - readonly __typename: "UserPhoneRegistrationValidatePayload" - readonly errors: ReadonlyArray - readonly me?: Maybe -} - -export type UserQuizQuestion = { - readonly __typename: "UserQuizQuestion" - readonly completed: Scalars["Boolean"] - readonly question: QuizQuestion -} - -export type UserQuizQuestionUpdateCompletedInput = { - readonly id: Scalars["ID"] -} - -export type UserQuizQuestionUpdateCompletedPayload = { - readonly __typename: "UserQuizQuestionUpdateCompletedPayload" - readonly errors: ReadonlyArray - readonly userQuizQuestion?: Maybe -} - -export type UserRequestAuthCodeInput = { - readonly channel?: InputMaybe - readonly phone: Scalars["Phone"] -} - -export type UserTotpDeleteInput = { - readonly authToken: Scalars["AuthToken"] -} + readonly __typename: 'UserPhoneRegistrationValidatePayload'; + readonly errors: ReadonlyArray; + readonly me?: Maybe; +}; export type UserTotpDeletePayload = { - readonly __typename: "UserTotpDeletePayload" - readonly errors: ReadonlyArray - readonly me?: Maybe -} - -export type UserTotpRegistrationInitiateInput = { - readonly authToken: Scalars["AuthToken"] -} + readonly __typename: 'UserTotpDeletePayload'; + readonly errors: ReadonlyArray; + readonly me?: Maybe; +}; export type UserTotpRegistrationInitiatePayload = { - readonly __typename: "UserTotpRegistrationInitiatePayload" - readonly errors: ReadonlyArray - readonly totpRegistrationId?: Maybe - readonly totpSecret?: Maybe -} + readonly __typename: 'UserTotpRegistrationInitiatePayload'; + readonly errors: ReadonlyArray; + readonly totpRegistrationId?: Maybe; + readonly totpSecret?: Maybe; +}; export type UserTotpRegistrationValidateInput = { - readonly authToken: Scalars["AuthToken"] - readonly totpCode: Scalars["TotpCode"] - readonly totpRegistrationId: Scalars["TotpRegistrationId"] -} + readonly authToken?: InputMaybe; + readonly totpCode: Scalars['TotpCode']; + readonly totpRegistrationId: Scalars['TotpRegistrationId']; +}; export type UserTotpRegistrationValidatePayload = { - readonly __typename: "UserTotpRegistrationValidatePayload" - readonly errors: ReadonlyArray - readonly me?: Maybe -} + readonly __typename: 'UserTotpRegistrationValidatePayload'; + readonly errors: ReadonlyArray; + readonly me?: Maybe; +}; -export type UserUpdate = - | IntraLedgerUpdate - | LnUpdate - | OnChainUpdate - | Price - | RealtimePrice +export type UserUpdate = IntraLedgerUpdate | LnUpdate | OnChainUpdate | Price | RealtimePrice; export type UserUpdateLanguageInput = { - readonly language: Scalars["Language"] -} + readonly language: Scalars['Language']; +}; export type UserUpdateLanguagePayload = { - readonly __typename: "UserUpdateLanguagePayload" - readonly errors: ReadonlyArray - readonly user?: Maybe -} + readonly __typename: 'UserUpdateLanguagePayload'; + readonly errors: ReadonlyArray; + readonly user?: Maybe; +}; export type UserUpdateUsernameInput = { - readonly username: Scalars["Username"] -} + readonly username: Scalars['Username']; +}; export type UserUpdateUsernamePayload = { - readonly __typename: "UserUpdateUsernamePayload" - readonly errors: ReadonlyArray - readonly user?: Maybe -} + readonly __typename: 'UserUpdateUsernamePayload'; + readonly errors: ReadonlyArray; + readonly user?: Maybe; +}; /** A generic wallet which stores value in one of our supported currencies. */ export type Wallet = { - readonly accountId: Scalars["ID"] - readonly balance: Scalars["SignedAmount"] - readonly id: Scalars["ID"] - readonly pendingIncomingBalance: Scalars["SignedAmount"] + readonly accountId: Scalars['ID']; + readonly balance: Scalars['SignedAmount']; + readonly id: Scalars['ID']; + readonly invoiceByPaymentHash: Invoice; + readonly invoices?: Maybe; + readonly pendingIncomingBalance: Scalars['SignedAmount']; + /** + * Pending incoming OnChain transactions. When transactions + * are confirmed they will receive a new id and be found in the transactions + * list. Transactions are ordered anti-chronologically, + * ie: the newest transaction will be first + */ + readonly pendingIncomingTransactions: ReadonlyArray; + /** + * Pending incoming OnChain transactions. When transactions + * are confirmed they will receive a new id and be found in the transactions + * list. Transactions are ordered anti-chronologically, + * ie: the newest transaction will be first + */ + readonly pendingIncomingTransactionsByAddress: ReadonlyArray; + readonly transactionById: Transaction; /** * Transactions are ordered anti-chronologically, * ie: the newest transaction will be first */ - readonly transactions?: Maybe + readonly transactions?: Maybe; /** * Transactions are ordered anti-chronologically, * ie: the newest transaction will be first */ - readonly transactionsByAddress?: Maybe - readonly walletCurrency: WalletCurrency -} + readonly transactionsByAddress?: Maybe; + /** Returns the transactions that include this paymentHash. This should be a list of size one for a received lightning payment. This can be more that one transaction for a sent lightning payment. */ + readonly transactionsByPaymentHash: ReadonlyArray; + readonly walletCurrency: WalletCurrency; +}; + + +/** A generic wallet which stores value in one of our supported currencies. */ +export type WalletInvoiceByPaymentHashArgs = { + paymentHash: Scalars['PaymentHash']; +}; + + +/** A generic wallet which stores value in one of our supported currencies. */ +export type WalletInvoicesArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + + +/** A generic wallet which stores value in one of our supported currencies. */ +export type WalletPendingIncomingTransactionsByAddressArgs = { + address: Scalars['OnChainAddress']; +}; + + +/** A generic wallet which stores value in one of our supported currencies. */ +export type WalletTransactionByIdArgs = { + transactionId: Scalars['ID']; +}; + /** A generic wallet which stores value in one of our supported currencies. */ export type WalletTransactionsArgs = { - after?: InputMaybe - before?: InputMaybe - first?: InputMaybe - last?: InputMaybe -} + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + /** A generic wallet which stores value in one of our supported currencies. */ export type WalletTransactionsByAddressArgs = { - address: Scalars["OnChainAddress"] - after?: InputMaybe - before?: InputMaybe - first?: InputMaybe - last?: InputMaybe -} + address: Scalars['OnChainAddress']; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; +}; + + +/** A generic wallet which stores value in one of our supported currencies. */ +export type WalletTransactionsByPaymentHashArgs = { + paymentHash: Scalars['PaymentHash']; +}; export const WalletCurrency = { - Btc: "BTC", - Usd: "USD", -} as const + Btc: 'BTC', + Usd: 'USD' +} as const; + +export type WalletCurrency = typeof WalletCurrency[keyof typeof WalletCurrency]; +export type LnInvoiceCreateOnBehalfOfRecipientMutationVariables = Exact<{ + walletId: Scalars['WalletId']; + amount: Scalars['SatAmount']; + descriptionHash: Scalars['Hex32Bytes']; +}>; + + +export type LnInvoiceCreateOnBehalfOfRecipientMutation = { readonly __typename: 'Mutation', readonly mutationData: { readonly __typename: 'LnInvoicePayload', readonly errors: ReadonlyArray<{ readonly __typename: 'GraphQLApplicationError', readonly message: string }>, readonly invoice?: { readonly __typename: 'LnInvoice', readonly paymentRequest: string, readonly paymentHash: string } | null } }; + +export type AccountDefaultWalletQueryVariables = Exact<{ + username: Scalars['Username']; + walletCurrency: WalletCurrency; +}>; + + +export type AccountDefaultWalletQuery = { readonly __typename: 'Query', readonly accountDefaultWallet: { readonly __typename: 'PublicWallet', readonly id: string, readonly walletCurrency: WalletCurrency } }; -export type WalletCurrency = (typeof WalletCurrency)[keyof typeof WalletCurrency] export type LnInvoicePaymentStatusSubscriptionVariables = Exact<{ - input: LnInvoicePaymentStatusInput -}> - -export type LnInvoicePaymentStatusSubscription = { - readonly __typename: "Subscription" - readonly lnInvoicePaymentStatus: { - readonly __typename: "LnInvoicePaymentStatusPayload" - readonly status?: InvoicePaymentStatus | null - readonly errors: ReadonlyArray<{ - readonly __typename: "GraphQLApplicationError" - readonly message: string - }> - } -} + input: LnInvoicePaymentStatusInput; +}>; + + +export type LnInvoicePaymentStatusSubscription = { readonly __typename: 'Subscription', readonly lnInvoicePaymentStatus: { readonly __typename: 'LnInvoicePaymentStatusPayload', readonly status?: InvoicePaymentStatus | null, readonly errors: ReadonlyArray<{ readonly __typename: 'GraphQLApplicationError', readonly message: string }> } }; export type LnNoAmountInvoiceCreateOnBehalfOfRecipientMutationVariables = Exact<{ - walletId: Scalars["WalletId"] -}> - -export type LnNoAmountInvoiceCreateOnBehalfOfRecipientMutation = { - readonly __typename: "Mutation" - readonly mutationData: { - readonly __typename: "LnNoAmountInvoicePayload" - readonly errors: ReadonlyArray<{ - readonly __typename: "GraphQLApplicationError" - readonly message: string - }> - readonly invoice?: { - readonly __typename: "LnNoAmountInvoice" - readonly paymentRequest: string - } | null - } -} + walletId: Scalars['WalletId']; +}>; + + +export type LnNoAmountInvoiceCreateOnBehalfOfRecipientMutation = { readonly __typename: 'Mutation', readonly mutationData: { readonly __typename: 'LnNoAmountInvoicePayload', readonly errors: ReadonlyArray<{ readonly __typename: 'GraphQLApplicationError', readonly message: string }>, readonly invoice?: { readonly __typename: 'LnNoAmountInvoice', readonly paymentRequest: string } | null } }; export type LnUsdInvoiceCreateOnBehalfOfRecipientMutationVariables = Exact<{ - input: LnUsdInvoiceCreateOnBehalfOfRecipientInput -}> - -export type LnUsdInvoiceCreateOnBehalfOfRecipientMutation = { - readonly __typename: "Mutation" - readonly lnUsdInvoiceCreateOnBehalfOfRecipient: { - readonly __typename: "LnInvoicePayload" - readonly errors: ReadonlyArray<{ - readonly __typename: "GraphQLApplicationError" - readonly message: string - }> - readonly invoice?: { - readonly __typename: "LnInvoice" - readonly paymentHash: string - readonly paymentRequest: string - readonly paymentSecret: string - readonly satoshis?: number | null - } | null - } -} + input: LnUsdInvoiceCreateOnBehalfOfRecipientInput; +}>; + + +export type LnUsdInvoiceCreateOnBehalfOfRecipientMutation = { readonly __typename: 'Mutation', readonly lnUsdInvoiceCreateOnBehalfOfRecipient: { readonly __typename: 'LnInvoicePayload', readonly errors: ReadonlyArray<{ readonly __typename: 'GraphQLApplicationError', readonly message: string }>, readonly invoice?: { readonly __typename: 'LnInvoice', readonly paymentHash: string, readonly paymentRequest: string, readonly paymentSecret: string, readonly satoshis: number } | null } }; export type LnInvoiceCreateOnBehalfOfRecipientsMutationVariables = Exact<{ - input: LnInvoiceCreateOnBehalfOfRecipientInput -}> - -export type LnInvoiceCreateOnBehalfOfRecipientsMutation = { - readonly __typename: "Mutation" - readonly lnInvoiceCreateOnBehalfOfRecipient: { - readonly __typename: "LnInvoicePayload" - readonly errors: ReadonlyArray<{ - readonly __typename: "GraphQLApplicationError" - readonly message: string - }> - readonly invoice?: { - readonly __typename: "LnInvoice" - readonly paymentHash: string - readonly paymentRequest: string - readonly paymentSecret: string - readonly satoshis?: number | null - } | null - } -} + input: LnInvoiceCreateOnBehalfOfRecipientInput; +}>; -export type CurrencyListQueryVariables = Exact<{ [key: string]: never }> - -export type CurrencyListQuery = { - readonly __typename: "Query" - readonly currencyList: ReadonlyArray<{ - readonly __typename: "Currency" - readonly id: string - readonly flag: string - readonly name: string - readonly symbol: string - readonly fractionDigits: number - }> -} + +export type LnInvoiceCreateOnBehalfOfRecipientsMutation = { readonly __typename: 'Mutation', readonly lnInvoiceCreateOnBehalfOfRecipient: { readonly __typename: 'LnInvoicePayload', readonly errors: ReadonlyArray<{ readonly __typename: 'GraphQLApplicationError', readonly message: string }>, readonly invoice?: { readonly __typename: 'LnInvoice', readonly paymentHash: string, readonly paymentRequest: string, readonly paymentSecret: string, readonly satoshis: number } | null } }; + +export type CurrencyListQueryVariables = Exact<{ [key: string]: never; }>; + + +export type CurrencyListQuery = { readonly __typename: 'Query', readonly currencyList: ReadonlyArray<{ readonly __typename: 'Currency', readonly id: string, readonly flag: string, readonly name: string, readonly symbol: string, readonly fractionDigits: number }> }; export type RealtimePriceWsSubscriptionVariables = Exact<{ - currency: Scalars["DisplayCurrency"] -}> - -export type RealtimePriceWsSubscription = { - readonly __typename: "Subscription" - readonly realtimePrice: { - readonly __typename: "RealtimePricePayload" - readonly errors: ReadonlyArray<{ - readonly __typename: "GraphQLApplicationError" - readonly message: string - }> - readonly realtimePrice?: { - readonly __typename: "RealtimePrice" - readonly timestamp: number - readonly denominatorCurrency: string - readonly btcSatPrice: { - readonly __typename: "PriceOfOneSatInMinorUnit" - readonly base: number - readonly offset: number - } - readonly usdCentPrice: { - readonly __typename: "PriceOfOneUsdCentInMinorUnit" - readonly base: number - readonly offset: number - } - } | null - } -} + currency: Scalars['DisplayCurrency']; +}>; + + +export type RealtimePriceWsSubscription = { readonly __typename: 'Subscription', readonly realtimePrice: { readonly __typename: 'RealtimePricePayload', readonly errors: ReadonlyArray<{ readonly __typename: 'GraphQLApplicationError', readonly message: string }>, readonly realtimePrice?: { readonly __typename: 'RealtimePrice', readonly timestamp: number, readonly denominatorCurrency: string, readonly btcSatPrice: { readonly __typename: 'PriceOfOneSatInMinorUnit', readonly base: number, readonly offset: number }, readonly usdCentPrice: { readonly __typename: 'PriceOfOneUsdCentInMinorUnit', readonly base: number, readonly offset: number } } | null } }; export type RealtimePriceInitialQueryVariables = Exact<{ - currency: Scalars["DisplayCurrency"] -}> - -export type RealtimePriceInitialQuery = { - readonly __typename: "Query" - readonly realtimePrice: { - readonly __typename: "RealtimePrice" - readonly timestamp: number - readonly denominatorCurrency: string - readonly btcSatPrice: { - readonly __typename: "PriceOfOneSatInMinorUnit" - readonly base: number - readonly offset: number - } - readonly usdCentPrice: { - readonly __typename: "PriceOfOneUsdCentInMinorUnit" - readonly base: number - readonly offset: number - } - } -} + currency: Scalars['DisplayCurrency']; +}>; + + +export type RealtimePriceInitialQuery = { readonly __typename: 'Query', readonly realtimePrice: { readonly __typename: 'RealtimePrice', readonly timestamp: number, readonly denominatorCurrency: string, readonly btcSatPrice: { readonly __typename: 'PriceOfOneSatInMinorUnit', readonly base: number, readonly offset: number }, readonly usdCentPrice: { readonly __typename: 'PriceOfOneUsdCentInMinorUnit', readonly base: number, readonly offset: number } } }; export type PriceSubscriptionVariables = Exact<{ - amount: Scalars["SatAmount"] - amountCurrencyUnit: ExchangeCurrencyUnit - priceCurrencyUnit: ExchangeCurrencyUnit -}> - -export type PriceSubscription = { - readonly __typename: "Subscription" - readonly price: { - readonly __typename: "PricePayload" - readonly errors: ReadonlyArray<{ - readonly __typename: "GraphQLApplicationError" - readonly message: string - }> - readonly price?: { - readonly __typename: "Price" - readonly base: number - readonly offset: number - readonly currencyUnit: string - readonly formattedAmount: string - } | null - } -} + amount: Scalars['SatAmount']; + amountCurrencyUnit: ExchangeCurrencyUnit; + priceCurrencyUnit: ExchangeCurrencyUnit; +}>; + + +export type PriceSubscription = { readonly __typename: 'Subscription', readonly price: { readonly __typename: 'PricePayload', readonly errors: ReadonlyArray<{ readonly __typename: 'GraphQLApplicationError', readonly message: string }>, readonly price?: { readonly __typename: 'Price', readonly base: number, readonly offset: number, readonly currencyUnit: string, readonly formattedAmount: string } | null } }; export type AccountDefaultWalletsQueryVariables = Exact<{ - username: Scalars["Username"] -}> - -export type AccountDefaultWalletsQuery = { - readonly __typename: "Query" - readonly accountDefaultWallet: { - readonly __typename: "PublicWallet" - readonly id: string - readonly walletCurrency: WalletCurrency - } -} + username: Scalars['Username']; +}>; -export type AccountDefaultWalletQueryVariables = Exact<{ - username: Scalars["Username"] - walletCurrency: WalletCurrency -}> - -export type AccountDefaultWalletQuery = { - readonly __typename: "Query" - readonly accountDefaultWallet: { - readonly __typename: "PublicWallet" - readonly id: string - readonly walletCurrency: WalletCurrency - } -} -export type LnInvoiceCreateOnBehalfOfRecipientMutationVariables = Exact<{ - walletId: Scalars["WalletId"] - amount: Scalars["SatAmount"] - descriptionHash: Scalars["Hex32Bytes"] -}> - -export type LnInvoiceCreateOnBehalfOfRecipientMutation = { - readonly __typename: "Mutation" - readonly mutationData: { - readonly __typename: "LnInvoicePayload" - readonly errors: ReadonlyArray<{ - readonly __typename: "GraphQLApplicationError" - readonly message: string - }> - readonly invoice?: { - readonly __typename: "LnInvoice" - readonly paymentRequest: string - readonly paymentHash: string - } | null - } -} +export type AccountDefaultWalletsQuery = { readonly __typename: 'Query', readonly accountDefaultWallet: { readonly __typename: 'PublicWallet', readonly id: string, readonly walletCurrency: WalletCurrency } }; -export type NodeIdsQueryVariables = Exact<{ [key: string]: never }> +export type NodeIdsQueryVariables = Exact<{ [key: string]: never; }>; -export type NodeIdsQuery = { - readonly __typename: "Query" - readonly globals?: { - readonly __typename: "Globals" - readonly nodesIds: ReadonlyArray - } | null -} -export type AccountDefaultWallet2QueryVariables = Exact<{ - username: Scalars["Username"] -}> +export type NodeIdsQuery = { readonly __typename: 'Query', readonly globals?: { readonly __typename: 'Globals', readonly nodesIds: ReadonlyArray } | null }; + -export type AccountDefaultWallet2Query = { - readonly __typename: "Query" - readonly accountDefaultWallet: { - readonly __typename: "PublicWallet" - readonly id: string - readonly walletCurrency: WalletCurrency +export const LnInvoiceCreateOnBehalfOfRecipientDocument = gql` + mutation lnInvoiceCreateOnBehalfOfRecipient($walletId: WalletId!, $amount: SatAmount!, $descriptionHash: Hex32Bytes!) { + mutationData: lnInvoiceCreateOnBehalfOfRecipient( + input: {recipientWalletId: $walletId, amount: $amount, descriptionHash: $descriptionHash} + ) { + errors { + message + } + invoice { + paymentRequest + paymentHash + } + } +} + `; +export type LnInvoiceCreateOnBehalfOfRecipientMutationFn = Apollo.MutationFunction; + +/** + * __useLnInvoiceCreateOnBehalfOfRecipientMutation__ + * + * To run a mutation, you first call `useLnInvoiceCreateOnBehalfOfRecipientMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useLnInvoiceCreateOnBehalfOfRecipientMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [lnInvoiceCreateOnBehalfOfRecipientMutation, { data, loading, error }] = useLnInvoiceCreateOnBehalfOfRecipientMutation({ + * variables: { + * walletId: // value for 'walletId' + * amount: // value for 'amount' + * descriptionHash: // value for 'descriptionHash' + * }, + * }); + */ +export function useLnInvoiceCreateOnBehalfOfRecipientMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(LnInvoiceCreateOnBehalfOfRecipientDocument, options); + } +export type LnInvoiceCreateOnBehalfOfRecipientMutationHookResult = ReturnType; +export type LnInvoiceCreateOnBehalfOfRecipientMutationResult = Apollo.MutationResult; +export type LnInvoiceCreateOnBehalfOfRecipientMutationOptions = Apollo.BaseMutationOptions; +export const AccountDefaultWalletDocument = gql` + query accountDefaultWallet($username: Username!, $walletCurrency: WalletCurrency!) { + accountDefaultWallet(username: $username, walletCurrency: $walletCurrency) { + __typename + id + walletCurrency } } + `; +/** + * __useAccountDefaultWalletQuery__ + * + * To run a query within a React component, call `useAccountDefaultWalletQuery` and pass it any options that fit your needs. + * When your component renders, `useAccountDefaultWalletQuery` 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 } = useAccountDefaultWalletQuery({ + * variables: { + * username: // value for 'username' + * walletCurrency: // value for 'walletCurrency' + * }, + * }); + */ +export function useAccountDefaultWalletQuery(baseOptions: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(AccountDefaultWalletDocument, options); + } +export function useAccountDefaultWalletLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(AccountDefaultWalletDocument, options); + } +export type AccountDefaultWalletQueryHookResult = ReturnType; +export type AccountDefaultWalletLazyQueryHookResult = ReturnType; +export type AccountDefaultWalletQueryResult = Apollo.QueryResult; export const LnInvoicePaymentStatusDocument = gql` - subscription lnInvoicePaymentStatus($input: LnInvoicePaymentStatusInput!) { - lnInvoicePaymentStatus(input: $input) { + subscription lnInvoicePaymentStatus($input: LnInvoicePaymentStatusInput!) { + lnInvoicePaymentStatus(input: $input) { + __typename + errors { + message __typename - errors { - message - __typename - } - status } + status } -` +} + `; /** * __useLnInvoicePaymentStatusSubscription__ @@ -1911,42 +2239,27 @@ export const LnInvoicePaymentStatusDocument = gql` * }, * }); */ -export function useLnInvoicePaymentStatusSubscription( - baseOptions: Apollo.SubscriptionHookOptions< - LnInvoicePaymentStatusSubscription, - LnInvoicePaymentStatusSubscriptionVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions } - return Apollo.useSubscription< - LnInvoicePaymentStatusSubscription, - LnInvoicePaymentStatusSubscriptionVariables - >(LnInvoicePaymentStatusDocument, options) -} -export type LnInvoicePaymentStatusSubscriptionHookResult = ReturnType< - typeof useLnInvoicePaymentStatusSubscription -> -export type LnInvoicePaymentStatusSubscriptionResult = - Apollo.SubscriptionResult -export const LnNoAmountInvoiceCreateOnBehalfOfRecipientDocument = gql` - mutation lnNoAmountInvoiceCreateOnBehalfOfRecipient($walletId: WalletId!) { - mutationData: lnNoAmountInvoiceCreateOnBehalfOfRecipient( - input: { recipientWalletId: $walletId } - ) { - errors { - message - } - invoice { - paymentRequest +export function useLnInvoicePaymentStatusSubscription(baseOptions: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(LnInvoicePaymentStatusDocument, options); } +export type LnInvoicePaymentStatusSubscriptionHookResult = ReturnType; +export type LnInvoicePaymentStatusSubscriptionResult = Apollo.SubscriptionResult; +export const LnNoAmountInvoiceCreateOnBehalfOfRecipientDocument = gql` + mutation lnNoAmountInvoiceCreateOnBehalfOfRecipient($walletId: WalletId!) { + mutationData: lnNoAmountInvoiceCreateOnBehalfOfRecipient( + input: {recipientWalletId: $walletId} + ) { + errors { + message + } + invoice { + paymentRequest } } -` -export type LnNoAmountInvoiceCreateOnBehalfOfRecipientMutationFn = - Apollo.MutationFunction< - LnNoAmountInvoiceCreateOnBehalfOfRecipientMutation, - LnNoAmountInvoiceCreateOnBehalfOfRecipientMutationVariables - > +} + `; +export type LnNoAmountInvoiceCreateOnBehalfOfRecipientMutationFn = Apollo.MutationFunction; /** * __useLnNoAmountInvoiceCreateOnBehalfOfRecipientMutation__ @@ -1965,52 +2278,32 @@ export type LnNoAmountInvoiceCreateOnBehalfOfRecipientMutationFn = * }, * }); */ -export function useLnNoAmountInvoiceCreateOnBehalfOfRecipientMutation( - baseOptions?: Apollo.MutationHookOptions< - LnNoAmountInvoiceCreateOnBehalfOfRecipientMutation, - LnNoAmountInvoiceCreateOnBehalfOfRecipientMutationVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions } - return Apollo.useMutation< - LnNoAmountInvoiceCreateOnBehalfOfRecipientMutation, - LnNoAmountInvoiceCreateOnBehalfOfRecipientMutationVariables - >(LnNoAmountInvoiceCreateOnBehalfOfRecipientDocument, options) -} -export type LnNoAmountInvoiceCreateOnBehalfOfRecipientMutationHookResult = ReturnType< - typeof useLnNoAmountInvoiceCreateOnBehalfOfRecipientMutation -> -export type LnNoAmountInvoiceCreateOnBehalfOfRecipientMutationResult = - Apollo.MutationResult -export type LnNoAmountInvoiceCreateOnBehalfOfRecipientMutationOptions = - Apollo.BaseMutationOptions< - LnNoAmountInvoiceCreateOnBehalfOfRecipientMutation, - LnNoAmountInvoiceCreateOnBehalfOfRecipientMutationVariables - > -export const LnUsdInvoiceCreateOnBehalfOfRecipientDocument = gql` - mutation lnUsdInvoiceCreateOnBehalfOfRecipient( - $input: LnUsdInvoiceCreateOnBehalfOfRecipientInput! - ) { - lnUsdInvoiceCreateOnBehalfOfRecipient(input: $input) { - errors { - __typename - message - } - invoice { - __typename - paymentHash - paymentRequest - paymentSecret - satoshis +export function useLnNoAmountInvoiceCreateOnBehalfOfRecipientMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(LnNoAmountInvoiceCreateOnBehalfOfRecipientDocument, options); } +export type LnNoAmountInvoiceCreateOnBehalfOfRecipientMutationHookResult = ReturnType; +export type LnNoAmountInvoiceCreateOnBehalfOfRecipientMutationResult = Apollo.MutationResult; +export type LnNoAmountInvoiceCreateOnBehalfOfRecipientMutationOptions = Apollo.BaseMutationOptions; +export const LnUsdInvoiceCreateOnBehalfOfRecipientDocument = gql` + mutation lnUsdInvoiceCreateOnBehalfOfRecipient($input: LnUsdInvoiceCreateOnBehalfOfRecipientInput!) { + lnUsdInvoiceCreateOnBehalfOfRecipient(input: $input) { + errors { + __typename + message + } + invoice { __typename + paymentHash + paymentRequest + paymentSecret + satoshis } + __typename } -` -export type LnUsdInvoiceCreateOnBehalfOfRecipientMutationFn = Apollo.MutationFunction< - LnUsdInvoiceCreateOnBehalfOfRecipientMutation, - LnUsdInvoiceCreateOnBehalfOfRecipientMutationVariables -> +} + `; +export type LnUsdInvoiceCreateOnBehalfOfRecipientMutationFn = Apollo.MutationFunction; /** * __useLnUsdInvoiceCreateOnBehalfOfRecipientMutation__ @@ -2029,52 +2322,32 @@ export type LnUsdInvoiceCreateOnBehalfOfRecipientMutationFn = Apollo.MutationFun * }, * }); */ -export function useLnUsdInvoiceCreateOnBehalfOfRecipientMutation( - baseOptions?: Apollo.MutationHookOptions< - LnUsdInvoiceCreateOnBehalfOfRecipientMutation, - LnUsdInvoiceCreateOnBehalfOfRecipientMutationVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions } - return Apollo.useMutation< - LnUsdInvoiceCreateOnBehalfOfRecipientMutation, - LnUsdInvoiceCreateOnBehalfOfRecipientMutationVariables - >(LnUsdInvoiceCreateOnBehalfOfRecipientDocument, options) -} -export type LnUsdInvoiceCreateOnBehalfOfRecipientMutationHookResult = ReturnType< - typeof useLnUsdInvoiceCreateOnBehalfOfRecipientMutation -> -export type LnUsdInvoiceCreateOnBehalfOfRecipientMutationResult = - Apollo.MutationResult -export type LnUsdInvoiceCreateOnBehalfOfRecipientMutationOptions = - Apollo.BaseMutationOptions< - LnUsdInvoiceCreateOnBehalfOfRecipientMutation, - LnUsdInvoiceCreateOnBehalfOfRecipientMutationVariables - > -export const LnInvoiceCreateOnBehalfOfRecipientsDocument = gql` - mutation lnInvoiceCreateOnBehalfOfRecipients( - $input: LnInvoiceCreateOnBehalfOfRecipientInput! - ) { - lnInvoiceCreateOnBehalfOfRecipient(input: $input) { - errors { - __typename - message - } - invoice { - __typename - paymentHash - paymentRequest - paymentSecret - satoshis +export function useLnUsdInvoiceCreateOnBehalfOfRecipientMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(LnUsdInvoiceCreateOnBehalfOfRecipientDocument, options); } +export type LnUsdInvoiceCreateOnBehalfOfRecipientMutationHookResult = ReturnType; +export type LnUsdInvoiceCreateOnBehalfOfRecipientMutationResult = Apollo.MutationResult; +export type LnUsdInvoiceCreateOnBehalfOfRecipientMutationOptions = Apollo.BaseMutationOptions; +export const LnInvoiceCreateOnBehalfOfRecipientsDocument = gql` + mutation lnInvoiceCreateOnBehalfOfRecipients($input: LnInvoiceCreateOnBehalfOfRecipientInput!) { + lnInvoiceCreateOnBehalfOfRecipient(input: $input) { + errors { __typename + message } + invoice { + __typename + paymentHash + paymentRequest + paymentSecret + satoshis + } + __typename } -` -export type LnInvoiceCreateOnBehalfOfRecipientsMutationFn = Apollo.MutationFunction< - LnInvoiceCreateOnBehalfOfRecipientsMutation, - LnInvoiceCreateOnBehalfOfRecipientsMutationVariables -> +} + `; +export type LnInvoiceCreateOnBehalfOfRecipientsMutationFn = Apollo.MutationFunction; /** * __useLnInvoiceCreateOnBehalfOfRecipientsMutation__ @@ -2093,40 +2366,25 @@ export type LnInvoiceCreateOnBehalfOfRecipientsMutationFn = Apollo.MutationFunct * }, * }); */ -export function useLnInvoiceCreateOnBehalfOfRecipientsMutation( - baseOptions?: Apollo.MutationHookOptions< - LnInvoiceCreateOnBehalfOfRecipientsMutation, - LnInvoiceCreateOnBehalfOfRecipientsMutationVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions } - return Apollo.useMutation< - LnInvoiceCreateOnBehalfOfRecipientsMutation, - LnInvoiceCreateOnBehalfOfRecipientsMutationVariables - >(LnInvoiceCreateOnBehalfOfRecipientsDocument, options) -} -export type LnInvoiceCreateOnBehalfOfRecipientsMutationHookResult = ReturnType< - typeof useLnInvoiceCreateOnBehalfOfRecipientsMutation -> -export type LnInvoiceCreateOnBehalfOfRecipientsMutationResult = - Apollo.MutationResult -export type LnInvoiceCreateOnBehalfOfRecipientsMutationOptions = - Apollo.BaseMutationOptions< - LnInvoiceCreateOnBehalfOfRecipientsMutation, - LnInvoiceCreateOnBehalfOfRecipientsMutationVariables - > +export function useLnInvoiceCreateOnBehalfOfRecipientsMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(LnInvoiceCreateOnBehalfOfRecipientsDocument, options); + } +export type LnInvoiceCreateOnBehalfOfRecipientsMutationHookResult = ReturnType; +export type LnInvoiceCreateOnBehalfOfRecipientsMutationResult = Apollo.MutationResult; +export type LnInvoiceCreateOnBehalfOfRecipientsMutationOptions = Apollo.BaseMutationOptions; export const CurrencyListDocument = gql` - query currencyList { - currencyList { - __typename - id - flag - name - symbol - fractionDigits - } + query currencyList { + currencyList { + __typename + id + flag + name + symbol + fractionDigits } -` +} + `; /** * __useCurrencyListQuery__ @@ -2143,54 +2401,38 @@ export const CurrencyListDocument = gql` * }, * }); */ -export function useCurrencyListQuery( - baseOptions?: Apollo.QueryHookOptions, -) { - const options = { ...defaultOptions, ...baseOptions } - return Apollo.useQuery( - CurrencyListDocument, - options, - ) -} -export function useCurrencyListLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions< - CurrencyListQuery, - CurrencyListQueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions } - return Apollo.useLazyQuery( - CurrencyListDocument, - options, - ) -} -export type CurrencyListQueryHookResult = ReturnType -export type CurrencyListLazyQueryHookResult = ReturnType -export type CurrencyListQueryResult = Apollo.QueryResult< - CurrencyListQuery, - CurrencyListQueryVariables -> -export const RealtimePriceWsDocument = gql` - subscription realtimePriceWs($currency: DisplayCurrency!) { - realtimePrice(input: { currency: $currency }) { - errors { - message +export function useCurrencyListQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(CurrencyListDocument, options); } - realtimePrice { - timestamp - btcSatPrice { - base - offset - } - usdCentPrice { - base - offset +export function useCurrencyListLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(CurrencyListDocument, options); } - denominatorCurrency +export type CurrencyListQueryHookResult = ReturnType; +export type CurrencyListLazyQueryHookResult = ReturnType; +export type CurrencyListQueryResult = Apollo.QueryResult; +export const RealtimePriceWsDocument = gql` + subscription realtimePriceWs($currency: DisplayCurrency!) { + realtimePrice(input: {currency: $currency}) { + errors { + message + } + realtimePrice { + timestamp + btcSatPrice { + base + offset } + usdCentPrice { + base + offset + } + denominatorCurrency } } -` +} + `; /** * __useRealtimePriceWsSubscription__ @@ -2208,39 +2450,28 @@ export const RealtimePriceWsDocument = gql` * }, * }); */ -export function useRealtimePriceWsSubscription( - baseOptions: Apollo.SubscriptionHookOptions< - RealtimePriceWsSubscription, - RealtimePriceWsSubscriptionVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions } - return Apollo.useSubscription< - RealtimePriceWsSubscription, - RealtimePriceWsSubscriptionVariables - >(RealtimePriceWsDocument, options) -} -export type RealtimePriceWsSubscriptionHookResult = ReturnType< - typeof useRealtimePriceWsSubscription -> -export type RealtimePriceWsSubscriptionResult = - Apollo.SubscriptionResult -export const RealtimePriceInitialDocument = gql` - query realtimePriceInitial($currency: DisplayCurrency!) { - realtimePrice(currency: $currency) { - timestamp - btcSatPrice { - base - offset +export function useRealtimePriceWsSubscription(baseOptions: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(RealtimePriceWsDocument, options); } - usdCentPrice { - base - offset - } - denominatorCurrency +export type RealtimePriceWsSubscriptionHookResult = ReturnType; +export type RealtimePriceWsSubscriptionResult = Apollo.SubscriptionResult; +export const RealtimePriceInitialDocument = gql` + query realtimePriceInitial($currency: DisplayCurrency!) { + realtimePrice(currency: $currency) { + timestamp + btcSatPrice { + base + offset } + usdCentPrice { + base + offset + } + denominatorCurrency } -` +} + `; /** * __useRealtimePriceInitialQuery__ @@ -2258,65 +2489,34 @@ export const RealtimePriceInitialDocument = gql` * }, * }); */ -export function useRealtimePriceInitialQuery( - baseOptions: Apollo.QueryHookOptions< - RealtimePriceInitialQuery, - RealtimePriceInitialQueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions } - return Apollo.useQuery( - RealtimePriceInitialDocument, - options, - ) -} -export function useRealtimePriceInitialLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions< - RealtimePriceInitialQuery, - RealtimePriceInitialQueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions } - return Apollo.useLazyQuery< - RealtimePriceInitialQuery, - RealtimePriceInitialQueryVariables - >(RealtimePriceInitialDocument, options) -} -export type RealtimePriceInitialQueryHookResult = ReturnType< - typeof useRealtimePriceInitialQuery -> -export type RealtimePriceInitialLazyQueryHookResult = ReturnType< - typeof useRealtimePriceInitialLazyQuery -> -export type RealtimePriceInitialQueryResult = Apollo.QueryResult< - RealtimePriceInitialQuery, - RealtimePriceInitialQueryVariables -> +export function useRealtimePriceInitialQuery(baseOptions: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(RealtimePriceInitialDocument, options); + } +export function useRealtimePriceInitialLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(RealtimePriceInitialDocument, options); + } +export type RealtimePriceInitialQueryHookResult = ReturnType; +export type RealtimePriceInitialLazyQueryHookResult = ReturnType; +export type RealtimePriceInitialQueryResult = Apollo.QueryResult; export const PriceDocument = gql` - subscription price( - $amount: SatAmount! - $amountCurrencyUnit: ExchangeCurrencyUnit! - $priceCurrencyUnit: ExchangeCurrencyUnit! + subscription price($amount: SatAmount!, $amountCurrencyUnit: ExchangeCurrencyUnit!, $priceCurrencyUnit: ExchangeCurrencyUnit!) { + price( + input: {amount: $amount, amountCurrencyUnit: $amountCurrencyUnit, priceCurrencyUnit: $priceCurrencyUnit} ) { - price( - input: { - amount: $amount - amountCurrencyUnit: $amountCurrencyUnit - priceCurrencyUnit: $priceCurrencyUnit - } - ) { - errors { - message - } - price { - base - offset - currencyUnit - formattedAmount - } + errors { + message + } + price { + base + offset + currencyUnit + formattedAmount } } -` +} + `; /** * __usePriceSubscription__ @@ -2336,29 +2536,21 @@ export const PriceDocument = gql` * }, * }); */ -export function usePriceSubscription( - baseOptions: Apollo.SubscriptionHookOptions< - PriceSubscription, - PriceSubscriptionVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions } - return Apollo.useSubscription( - PriceDocument, - options, - ) -} -export type PriceSubscriptionHookResult = ReturnType -export type PriceSubscriptionResult = Apollo.SubscriptionResult +export function usePriceSubscription(baseOptions: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(PriceDocument, options); + } +export type PriceSubscriptionHookResult = ReturnType; +export type PriceSubscriptionResult = Apollo.SubscriptionResult; export const AccountDefaultWalletsDocument = gql` - query accountDefaultWallets($username: Username!) { - accountDefaultWallet(username: $username) { - __typename - id - walletCurrency - } + query accountDefaultWallets($username: Username!) { + accountDefaultWallet(username: $username) { + __typename + id + walletCurrency } -` +} + `; /** * __useAccountDefaultWalletsQuery__ @@ -2376,177 +2568,24 @@ export const AccountDefaultWalletsDocument = gql` * }, * }); */ -export function useAccountDefaultWalletsQuery( - baseOptions: Apollo.QueryHookOptions< - AccountDefaultWalletsQuery, - AccountDefaultWalletsQueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions } - return Apollo.useQuery( - AccountDefaultWalletsDocument, - options, - ) -} -export function useAccountDefaultWalletsLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions< - AccountDefaultWalletsQuery, - AccountDefaultWalletsQueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions } - return Apollo.useLazyQuery< - AccountDefaultWalletsQuery, - AccountDefaultWalletsQueryVariables - >(AccountDefaultWalletsDocument, options) -} -export type AccountDefaultWalletsQueryHookResult = ReturnType< - typeof useAccountDefaultWalletsQuery -> -export type AccountDefaultWalletsLazyQueryHookResult = ReturnType< - typeof useAccountDefaultWalletsLazyQuery -> -export type AccountDefaultWalletsQueryResult = Apollo.QueryResult< - AccountDefaultWalletsQuery, - AccountDefaultWalletsQueryVariables -> -export const AccountDefaultWalletDocument = gql` - query accountDefaultWallet($username: Username!, $walletCurrency: WalletCurrency!) { - accountDefaultWallet(username: $username, walletCurrency: $walletCurrency) { - __typename - id - walletCurrency - } - } -` - -/** - * __useAccountDefaultWalletQuery__ - * - * To run a query within a React component, call `useAccountDefaultWalletQuery` and pass it any options that fit your needs. - * When your component renders, `useAccountDefaultWalletQuery` 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 } = useAccountDefaultWalletQuery({ - * variables: { - * username: // value for 'username' - * walletCurrency: // value for 'walletCurrency' - * }, - * }); - */ -export function useAccountDefaultWalletQuery( - baseOptions: Apollo.QueryHookOptions< - AccountDefaultWalletQuery, - AccountDefaultWalletQueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions } - return Apollo.useQuery( - AccountDefaultWalletDocument, - options, - ) -} -export function useAccountDefaultWalletLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions< - AccountDefaultWalletQuery, - AccountDefaultWalletQueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions } - return Apollo.useLazyQuery< - AccountDefaultWalletQuery, - AccountDefaultWalletQueryVariables - >(AccountDefaultWalletDocument, options) -} -export type AccountDefaultWalletQueryHookResult = ReturnType< - typeof useAccountDefaultWalletQuery -> -export type AccountDefaultWalletLazyQueryHookResult = ReturnType< - typeof useAccountDefaultWalletLazyQuery -> -export type AccountDefaultWalletQueryResult = Apollo.QueryResult< - AccountDefaultWalletQuery, - AccountDefaultWalletQueryVariables -> -export const LnInvoiceCreateOnBehalfOfRecipientDocument = gql` - mutation lnInvoiceCreateOnBehalfOfRecipient( - $walletId: WalletId! - $amount: SatAmount! - $descriptionHash: Hex32Bytes! - ) { - mutationData: lnInvoiceCreateOnBehalfOfRecipient( - input: { - recipientWalletId: $walletId - amount: $amount - descriptionHash: $descriptionHash - } - ) { - errors { - message - } - invoice { - paymentRequest - paymentHash +export function useAccountDefaultWalletsQuery(baseOptions: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(AccountDefaultWalletsDocument, options); } - } - } -` -export type LnInvoiceCreateOnBehalfOfRecipientMutationFn = Apollo.MutationFunction< - LnInvoiceCreateOnBehalfOfRecipientMutation, - LnInvoiceCreateOnBehalfOfRecipientMutationVariables -> - -/** - * __useLnInvoiceCreateOnBehalfOfRecipientMutation__ - * - * To run a mutation, you first call `useLnInvoiceCreateOnBehalfOfRecipientMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useLnInvoiceCreateOnBehalfOfRecipientMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [lnInvoiceCreateOnBehalfOfRecipientMutation, { data, loading, error }] = useLnInvoiceCreateOnBehalfOfRecipientMutation({ - * variables: { - * walletId: // value for 'walletId' - * amount: // value for 'amount' - * descriptionHash: // value for 'descriptionHash' - * }, - * }); - */ -export function useLnInvoiceCreateOnBehalfOfRecipientMutation( - baseOptions?: Apollo.MutationHookOptions< - LnInvoiceCreateOnBehalfOfRecipientMutation, - LnInvoiceCreateOnBehalfOfRecipientMutationVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions } - return Apollo.useMutation< - LnInvoiceCreateOnBehalfOfRecipientMutation, - LnInvoiceCreateOnBehalfOfRecipientMutationVariables - >(LnInvoiceCreateOnBehalfOfRecipientDocument, options) -} -export type LnInvoiceCreateOnBehalfOfRecipientMutationHookResult = ReturnType< - typeof useLnInvoiceCreateOnBehalfOfRecipientMutation -> -export type LnInvoiceCreateOnBehalfOfRecipientMutationResult = - Apollo.MutationResult -export type LnInvoiceCreateOnBehalfOfRecipientMutationOptions = - Apollo.BaseMutationOptions< - LnInvoiceCreateOnBehalfOfRecipientMutation, - LnInvoiceCreateOnBehalfOfRecipientMutationVariables - > +export function useAccountDefaultWalletsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(AccountDefaultWalletsDocument, options); + } +export type AccountDefaultWalletsQueryHookResult = ReturnType; +export type AccountDefaultWalletsLazyQueryHookResult = ReturnType; +export type AccountDefaultWalletsQueryResult = Apollo.QueryResult; export const NodeIdsDocument = gql` - query nodeIds { - globals { - nodesIds - } + query nodeIds { + globals { + nodesIds } -` +} + `; /** * __useNodeIdsQuery__ @@ -2563,80 +2602,14 @@ export const NodeIdsDocument = gql` * }, * }); */ -export function useNodeIdsQuery( - baseOptions?: Apollo.QueryHookOptions, -) { - const options = { ...defaultOptions, ...baseOptions } - return Apollo.useQuery(NodeIdsDocument, options) -} -export function useNodeIdsLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions, -) { - const options = { ...defaultOptions, ...baseOptions } - return Apollo.useLazyQuery( - NodeIdsDocument, - options, - ) -} -export type NodeIdsQueryHookResult = ReturnType -export type NodeIdsLazyQueryHookResult = ReturnType -export type NodeIdsQueryResult = Apollo.QueryResult -export const AccountDefaultWallet2Document = gql` - query accountDefaultWallet2($username: Username!) { - accountDefaultWallet(username: $username) { - id - walletCurrency - } - } -` - -/** - * __useAccountDefaultWallet2Query__ - * - * To run a query within a React component, call `useAccountDefaultWallet2Query` and pass it any options that fit your needs. - * When your component renders, `useAccountDefaultWallet2Query` 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 } = useAccountDefaultWallet2Query({ - * variables: { - * username: // value for 'username' - * }, - * }); - */ -export function useAccountDefaultWallet2Query( - baseOptions: Apollo.QueryHookOptions< - AccountDefaultWallet2Query, - AccountDefaultWallet2QueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions } - return Apollo.useQuery( - AccountDefaultWallet2Document, - options, - ) -} -export function useAccountDefaultWallet2LazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions< - AccountDefaultWallet2Query, - AccountDefaultWallet2QueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions } - return Apollo.useLazyQuery< - AccountDefaultWallet2Query, - AccountDefaultWallet2QueryVariables - >(AccountDefaultWallet2Document, options) -} -export type AccountDefaultWallet2QueryHookResult = ReturnType< - typeof useAccountDefaultWallet2Query -> -export type AccountDefaultWallet2LazyQueryHookResult = ReturnType< - typeof useAccountDefaultWallet2LazyQuery -> -export type AccountDefaultWallet2QueryResult = Apollo.QueryResult< - AccountDefaultWallet2Query, - AccountDefaultWallet2QueryVariables -> +export function useNodeIdsQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(NodeIdsDocument, options); + } +export function useNodeIdsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(NodeIdsDocument, options); + } +export type NodeIdsQueryHookResult = ReturnType; +export type NodeIdsLazyQueryHookResult = ReturnType; +export type NodeIdsQueryResult = Apollo.QueryResult; \ No newline at end of file diff --git a/bats/core/api/public-ln-receive.bats b/bats/core/api/public-ln-receive.bats index 07ede63dd7..4d7628e47e 100644 --- a/bats/core/api/public-ln-receive.bats +++ b/bats/core/api/public-ln-receive.bats @@ -109,7 +109,7 @@ usd_amount=50 [[ "$error_msg" == "Account does not exist for username idontexist" ]] || exit 1 } -@test "public-ln-receive: receive via invoice - can receive on btc invoice, with subscription" { +@test "public-ln-receive: receive via invoice - can receive on btc invoice, with subscription by payment request" { token_name="$ALICE" btc_wallet_name="$token_name.btc_wallet_id" @@ -125,22 +125,71 @@ usd_amount=50 payment_request="$(echo $invoice | jq -r '.paymentRequest')" [[ "${payment_request}" != "null" ]] || exit 1 - # Setup subscription + payment_hash="$(echo $invoice | jq -r '.paymentHash')" + [[ "${payment_hash}" != "null" ]] || exit 1 + + # Setup subscriptions variables=$( jq -n \ --arg payment_request "$payment_request" \ '{input: {paymentRequest: $payment_request}}' ) - subscribe_to 'anon' 'ln-invoice-payment-status-sub' "$variables" + subscribe_to 'anon' 'ln-invoice-payment-status-by-request-sub' "$variables" sleep 3 - retry 10 1 grep "Data.*lnInvoicePaymentStatus.*PENDING" "$SUBSCRIBER_LOG_FILE" + retry 10 1 grep "Data.*lnInvoicePaymentStatusByRequest.*PENDING" "$SUBSCRIBER_LOG_FILE" + retry 10 1 grep "Data.*lnInvoicePaymentStatusByRequest.*$payment_hash" "$SUBSCRIBER_LOG_FILE" + retry 10 1 grep "Data.*lnInvoicePaymentStatusByRequest.*$payment_request" "$SUBSCRIBER_LOG_FILE" + + # Receive payment + lnd_outside_cli payinvoice -f \ + --pay_req "$payment_request" \ + + # Check for settled with subscriptions + retry 10 1 grep "Data.*lnInvoicePaymentStatusByRequest.*PAID" "$SUBSCRIBER_LOG_FILE" + retry 10 1 grep "Data.*lnInvoicePaymentStatusByRequest.*$payment_hash" "$SUBSCRIBER_LOG_FILE" + retry 10 1 grep "Data.*lnInvoicePaymentStatusByRequest.*$payment_request" "$SUBSCRIBER_LOG_FILE" + stop_subscriber +} + +@test "public-ln-receive: receive via invoice - can receive on btc invoice, with subscription by payment hash" { + token_name="$ALICE" + btc_wallet_name="$token_name.btc_wallet_id" + + variables=$( + jq -n \ + --arg wallet_id "$(read_value $btc_wallet_name)" \ + --arg amount "$btc_amount" \ + '{input: {recipientWalletId: $wallet_id, amount: $amount}}' + ) + exec_graphql 'anon' 'ln-invoice-create-on-behalf-of-recipient' "$variables" + invoice="$(graphql_output '.data.lnInvoiceCreateOnBehalfOfRecipient.invoice')" + + payment_request="$(echo $invoice | jq -r '.paymentRequest')" + [[ "${payment_request}" != "null" ]] || exit 1 + + payment_hash="$(echo $invoice | jq -r '.paymentHash')" + [[ "${payment_hash}" != "null" ]] || exit 1 + + # Setup subscription + variables=$( + jq -n \ + --arg payment_hash "$payment_hash" \ + '{input: {paymentHash: $payment_hash}}' + ) + subscribe_to 'anon' 'ln-invoice-payment-status-by-hash-sub' "$variables" + sleep 3 + retry 10 1 grep "Data.*lnInvoicePaymentStatusByHash.*PENDING" "$SUBSCRIBER_LOG_FILE" + retry 10 1 grep "Data.*lnInvoicePaymentStatusByHash.*$payment_hash" "$SUBSCRIBER_LOG_FILE" + retry 10 1 grep "Data.*lnInvoicePaymentStatusByHash.*$payment_request" "$SUBSCRIBER_LOG_FILE" # Receive payment lnd_outside_cli payinvoice -f \ --pay_req "$payment_request" \ # Check for settled with subscription - retry 10 1 grep "Data.*lnInvoicePaymentStatus.*PAID" "$SUBSCRIBER_LOG_FILE" + retry 10 1 grep "Data.*lnInvoicePaymentStatusByHash.*PAID" "$SUBSCRIBER_LOG_FILE" + retry 10 1 grep "Data.*lnInvoicePaymentStatusByHash.*$payment_hash" "$SUBSCRIBER_LOG_FILE" + retry 10 1 grep "Data.*lnInvoicePaymentStatusByHash.*$payment_request" "$SUBSCRIBER_LOG_FILE" stop_subscriber } @@ -160,12 +209,16 @@ usd_amount=50 payment_request="$(echo $invoice | jq -r '.paymentRequest')" [[ "${payment_request}" != "null" ]] || exit 1 + payment_hash="$(echo $invoice | jq -r '.paymentHash')" + [[ "${payment_hash}" != "null" ]] || exit 1 + # Receive payment lnd_outside_cli payinvoice -f \ --pay_req "$payment_request" \ # Check for settled with query - retry 15 1 check_ln_payment_settled "$payment_request" + retry 15 1 check_ln_payment_settled "$payment_request" "$payment_hash" + retry 15 1 check_ln_payment_settled_by_hash "$payment_request" "$payment_hash" } @test "public-ln-receive: receive via invoice - can receive on usd invoice, sats denominated" { @@ -184,12 +237,16 @@ usd_amount=50 payment_request="$(echo $invoice | jq -r '.paymentRequest')" [[ "${payment_request}" != "null" ]] || exit 1 + payment_hash="$(echo $invoice | jq -r '.paymentHash')" + [[ "${payment_hash}" != "null" ]] || exit 1 + # Receive payment lnd_outside_cli payinvoice -f \ --pay_req "$payment_request" \ # Check for settled with query - retry 15 1 check_ln_payment_settled "$payment_request" + retry 15 1 check_ln_payment_settled "$payment_request" "$payment_hash" + retry 15 1 check_ln_payment_settled_by_hash "$payment_request" "$payment_hash" } @test "public-ln-receive: receive via invoice - can receive on btc amountless invoice" { @@ -207,13 +264,17 @@ usd_amount=50 payment_request="$(echo $invoice | jq -r '.paymentRequest')" [[ "${payment_request}" != "null" ]] || exit 1 + payment_hash="$(echo $invoice | jq -r '.paymentHash')" + [[ "${payment_hash}" != "null" ]] || exit 1 + # Receive payment lnd_outside_cli payinvoice -f \ --pay_req "$payment_request" \ --amt "$btc_amount" # Check for settled with query - retry 15 1 check_ln_payment_settled "$payment_request" + retry 15 1 check_ln_payment_settled "$payment_request" "$payment_hash" + retry 15 1 check_ln_payment_settled_by_hash "$payment_request" "$payment_hash" } @test "public-ln-receive: receive via invoice - can receive on usd amountless invoice" { @@ -231,13 +292,17 @@ usd_amount=50 payment_request="$(echo $invoice | jq -r '.paymentRequest')" [[ "${payment_request}" != "null" ]] || exit 1 + payment_hash="$(echo $invoice | jq -r '.paymentHash')" + [[ "${payment_hash}" != "null" ]] || exit 1 + # Receive payment lnd_outside_cli payinvoice -f \ --pay_req "$payment_request" \ --amt "$btc_amount" # Check for settled with query - retry 15 1 check_ln_payment_settled "$payment_request" + retry 15 1 check_ln_payment_settled "$payment_request" "$payment_hash" + retry 15 1 check_ln_payment_settled_by_hash "$payment_request" "$payment_hash" } @test "public-ln-receive: fail to create invoice - invalid wallet-id" { diff --git a/bats/gql/ln-invoice-payment-status-by-hash-sub.gql b/bats/gql/ln-invoice-payment-status-by-hash-sub.gql new file mode 100644 index 0000000000..5393eebf3f --- /dev/null +++ b/bats/gql/ln-invoice-payment-status-by-hash-sub.gql @@ -0,0 +1,10 @@ +subscription lnInvoicePaymentStatusByHashSubscription($input: LnInvoicePaymentStatusByHashInput!) { + lnInvoicePaymentStatusByHash(input: $input) { + errors { + message + } + status + paymentHash + paymentRequest + } +} diff --git a/bats/gql/ln-invoice-payment-status-by-hash.gql b/bats/gql/ln-invoice-payment-status-by-hash.gql new file mode 100644 index 0000000000..2de705e071 --- /dev/null +++ b/bats/gql/ln-invoice-payment-status-by-hash.gql @@ -0,0 +1,7 @@ +query LnInvoicePaymentStatusByHashQuery($input: LnInvoicePaymentStatusByHashInput!) { + lnInvoicePaymentStatusByHash(input: $input) { + status + paymentHash + paymentRequest + } +} diff --git a/bats/gql/ln-invoice-payment-status-by-request-sub.gql b/bats/gql/ln-invoice-payment-status-by-request-sub.gql new file mode 100644 index 0000000000..ff0b219d4e --- /dev/null +++ b/bats/gql/ln-invoice-payment-status-by-request-sub.gql @@ -0,0 +1,10 @@ +subscription lnInvoicePaymentStatusByRequestSubscription($input: LnInvoicePaymentStatusByRequestInput!) { + lnInvoicePaymentStatusByRequest(input: $input) { + errors { + message + } + status + paymentHash + paymentRequest + } +} diff --git a/bats/gql/ln-invoice-payment-status-by-request.gql b/bats/gql/ln-invoice-payment-status-by-request.gql new file mode 100644 index 0000000000..8d0245512e --- /dev/null +++ b/bats/gql/ln-invoice-payment-status-by-request.gql @@ -0,0 +1,7 @@ +query LnInvoicePaymentStatusByRequestQuery($input: LnInvoicePaymentStatusByRequestInput!) { + lnInvoicePaymentStatusByRequest(input: $input) { + status + paymentHash + paymentRequest + } +} diff --git a/bats/gql/ln-invoice-payment-status-sub.gql b/bats/gql/ln-invoice-payment-status-sub.gql deleted file mode 100644 index 6e26bd0732..0000000000 --- a/bats/gql/ln-invoice-payment-status-sub.gql +++ /dev/null @@ -1,8 +0,0 @@ -subscription lnInvoicePaymentStatusSubscription($input: LnInvoicePaymentStatusInput!) { - lnInvoicePaymentStatus(input: $input) { - errors { - message - } - status - } -} diff --git a/bats/gql/ln-invoice-payment-status.gql b/bats/gql/ln-invoice-payment-status.gql deleted file mode 100644 index af9e729f35..0000000000 --- a/bats/gql/ln-invoice-payment-status.gql +++ /dev/null @@ -1,5 +0,0 @@ -query LnInvoicePaymentStatusQuery($input: LnInvoicePaymentStatusInput!) { - lnInvoicePaymentStatus(input: $input) { - status - } -} diff --git a/bats/helpers/ln.bash b/bats/helpers/ln.bash index 213893d1c2..fd1b5b4acf 100644 --- a/bats/helpers/ln.bash +++ b/bats/helpers/ln.bash @@ -96,14 +96,37 @@ check_for_ln_update() { check_ln_payment_settled() { local payment_request=$1 + local payment_hash=$2 variables=$( jq -n \ --arg payment_request "$payment_request" \ '{"input": {"paymentRequest": $payment_request}}' ) - exec_graphql 'anon' 'ln-invoice-payment-status' "$variables" - payment_status="$(graphql_output '.data.lnInvoicePaymentStatus.status')" + exec_graphql 'anon' 'ln-invoice-payment-status-by-request' "$variables" + payment_status="$(graphql_output '.data.lnInvoicePaymentStatusByRequest.status')" + payment_request_resp="$(graphql_output '.data.lnInvoicePaymentStatusByRequest.paymentRequest')" + payment_hash_resp="$(graphql_output '.data.lnInvoicePaymentStatusByRequest.paymentHash')" + [[ "${payment_hash}" = "${payment_hash_resp}" ]] || exit 1 + [[ "${payment_request}" = "${payment_request_resp}" ]] || exit 1 + [[ "${payment_status}" = "PAID" ]] +} + +check_ln_payment_settled_by_hash() { + local payment_request=$1 + local payment_hash=$2 + + variables=$( + jq -n \ + --arg payment_hash "$payment_hash" \ + '{"input": {"paymentHash": $payment_hash}}' + ) + exec_graphql 'anon' 'ln-invoice-payment-status-by-hash' "$variables" + payment_status="$(graphql_output '.data.lnInvoicePaymentStatusByHash.status')" + payment_request_resp="$(graphql_output '.data.lnInvoicePaymentStatusByHash.paymentRequest')" + payment_hash_resp="$(graphql_output '.data.lnInvoicePaymentStatusByHash.paymentHash')" + [[ "${payment_hash}" = "${payment_hash_resp}" ]] || exit 1 + [[ "${payment_request}" = "${payment_request_resp}" ]] || exit 1 [[ "${payment_status}" = "PAID" ]] } diff --git a/core/api/BUCK b/core/api/BUCK index 1e8d95c08c..873cefbd55 100644 --- a/core/api/BUCK +++ b/core/api/BUCK @@ -208,8 +208,6 @@ test_suite( ":check-type", ":check-yaml", ":check-circular-dependencies", - ":public-schema-diff", - ":admin-schema-diff", ":unit-tests", ], ) diff --git a/core/api/dev/apollo-federation/supergraph.graphql b/core/api/dev/apollo-federation/supergraph.graphql index 0560477573..e5ad5e75ad 100644 --- a/core/api/dev/apollo-federation/supergraph.graphql +++ b/core/api/dev/apollo-federation/supergraph.graphql @@ -811,6 +811,26 @@ input LnInvoicePaymentInput walletId: WalletId! } +type LnInvoicePaymentStatus + @join__type(graph: PUBLIC) +{ + paymentHash: PaymentHash + paymentRequest: LnPaymentRequest + status: InvoicePaymentStatus +} + +input LnInvoicePaymentStatusByHashInput + @join__type(graph: PUBLIC) +{ + paymentHash: PaymentHash! +} + +input LnInvoicePaymentStatusByRequestInput + @join__type(graph: PUBLIC) +{ + paymentRequest: LnPaymentRequest! +} + input LnInvoicePaymentStatusInput @join__type(graph: PUBLIC) { @@ -821,6 +841,8 @@ type LnInvoicePaymentStatusPayload @join__type(graph: PUBLIC) { errors: [Error!]! + paymentHash: PaymentHash + paymentRequest: LnPaymentRequest status: InvoicePaymentStatus } @@ -1545,7 +1567,9 @@ type Query businessMapMarkers: [MapMarker!]! @join__field(graph: PUBLIC) currencyList: [Currency!]! @join__field(graph: PUBLIC) globals: Globals @join__field(graph: PUBLIC) - lnInvoicePaymentStatus(input: LnInvoicePaymentStatusInput!): LnInvoicePaymentStatusPayload! @join__field(graph: PUBLIC) + lnInvoicePaymentStatus(input: LnInvoicePaymentStatusInput!): LnInvoicePaymentStatusPayload! @join__field(graph: PUBLIC) @deprecated(reason: "Deprecated in favor of lnInvoicePaymentStatusByRequest") + lnInvoicePaymentStatusByHash(input: LnInvoicePaymentStatusByHashInput!): LnInvoicePaymentStatus! @join__field(graph: PUBLIC) + lnInvoicePaymentStatusByRequest(input: LnInvoicePaymentStatusByRequestInput!): LnInvoicePaymentStatus! @join__field(graph: PUBLIC) me: User @join__field(graph: PUBLIC) mobileVersions: [MobileVersions] @join__field(graph: PUBLIC) onChainTxFee(address: OnChainAddress!, amount: SatAmount!, speed: PayoutSpeed! = FAST, walletId: WalletId!): OnChainTxFee! @join__field(graph: PUBLIC) @@ -1688,7 +1712,9 @@ scalar SignedDisplayMajorAmount type Subscription @join__type(graph: PUBLIC) { - lnInvoicePaymentStatus(input: LnInvoicePaymentStatusInput!): LnInvoicePaymentStatusPayload! + lnInvoicePaymentStatus(input: LnInvoicePaymentStatusInput!): LnInvoicePaymentStatusPayload! @deprecated(reason: "Deprecated in favor of lnInvoicePaymentStatusByRequest") + lnInvoicePaymentStatusByHash(input: LnInvoicePaymentStatusByHashInput!): LnInvoicePaymentStatusPayload! + lnInvoicePaymentStatusByRequest(input: LnInvoicePaymentStatusByRequestInput!): LnInvoicePaymentStatusPayload! myUpdates: MyUpdatesPayload! price(input: PriceInput!): PricePayload! diff --git a/core/api/src/app/lightning/payment-status-checker.ts b/core/api/src/app/lightning/payment-status-checker.ts index bcc208b91a..7b2c88dcbd 100644 --- a/core/api/src/app/lightning/payment-status-checker.ts +++ b/core/api/src/app/lightning/payment-status-checker.ts @@ -1,3 +1,5 @@ +import { getInvoiceRequestByHash } from "./get-payment-request" + import { RepositoryError } from "@/domain/errors" import { decodeInvoice } from "@/domain/bitcoin/lightning" import { LedgerService } from "@/services/ledger" @@ -6,9 +8,10 @@ export const PaymentStatusChecker = async (uncheckedPaymentRequest: string) => { const decodedInvoice = decodeInvoice(uncheckedPaymentRequest) if (decodedInvoice instanceof Error) return decodedInvoice - const { paymentHash, expiresAt, isExpired } = decodedInvoice + const { paymentRequest, paymentHash, expiresAt, isExpired } = decodedInvoice return { + paymentRequest, paymentHash, expiresAt, isExpired, @@ -20,3 +23,14 @@ export const PaymentStatusChecker = async (uncheckedPaymentRequest: string) => { }, } } + +export const PaymentStatusCheckerByHash = async ({ + paymentHash, +}: { + paymentHash: PaymentHash +}) => { + const paymentRequest = await getInvoiceRequestByHash({ paymentHash }) + if (paymentRequest instanceof Error) return paymentRequest + + return PaymentStatusChecker(paymentRequest) +} diff --git a/core/api/src/graphql/public/queries.ts b/core/api/src/graphql/public/queries.ts index 7e71914273..a9daf59caf 100644 --- a/core/api/src/graphql/public/queries.ts +++ b/core/api/src/graphql/public/queries.ts @@ -14,6 +14,8 @@ import BusinessMapMarkersQuery from "@/graphql/public/root/query/business-map-ma import AccountDefaultWalletQuery from "@/graphql/public/root/query/account-default-wallet" import AccountDefaultWalletIdQuery from "@/graphql/public/root/query/account-default-wallet-id" import LnInvoicePaymentStatusQuery from "@/graphql/public/root/query/ln-invoice-payment-status" +import LnInvoicePaymentStatusByHashQuery from "@/graphql/public/root/query/ln-invoice-payment-status-by-hash" +import LnInvoicePaymentStatusByRequestQuery from "@/graphql/public/root/query/ln-invoice-payment-status-by-request" export const queryFields = { unauthed: { @@ -27,6 +29,8 @@ export const queryFields = { realtimePrice: RealtimePriceQuery, btcPriceList: BtcPriceListQuery, lnInvoicePaymentStatus: LnInvoicePaymentStatusQuery, + lnInvoicePaymentStatusByHash: LnInvoicePaymentStatusByHashQuery, + lnInvoicePaymentStatusByRequest: LnInvoicePaymentStatusByRequestQuery, }, authed: { atAccountLevel: { diff --git a/core/api/src/graphql/public/root/query/ln-invoice-payment-status-by-hash.ts b/core/api/src/graphql/public/root/query/ln-invoice-payment-status-by-hash.ts new file mode 100644 index 0000000000..57558b768e --- /dev/null +++ b/core/api/src/graphql/public/root/query/ln-invoice-payment-status-by-hash.ts @@ -0,0 +1,41 @@ +import { Lightning } from "@/app" +import { WalletInvoiceStatus } from "@/domain/wallet-invoices" + +import { GT } from "@/graphql/index" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import LnInvoicePaymentStatus from "@/graphql/public/types/object/ln-invoice-payment-status" +import LnInvoicePaymentStatusByHashInput from "@/graphql/public/types/object/ln-invoice-payment-status-by-hash-input" + +const LnInvoicePaymentStatusByHashQuery = GT.Field({ + type: GT.NonNull(LnInvoicePaymentStatus), + args: { + input: { type: GT.NonNull(LnInvoicePaymentStatusByHashInput) }, + }, + resolve: async (_, args) => { + const { paymentHash } = args.input + if (paymentHash instanceof Error) throw paymentHash + + const paymentStatusChecker = await Lightning.PaymentStatusCheckerByHash({ + paymentHash, + }) + if (paymentStatusChecker instanceof Error) { + throw mapAndParseErrorForGqlResponse(paymentStatusChecker) + } + + const paid = await paymentStatusChecker.invoiceIsPaid() + if (paid instanceof Error) { + throw mapAndParseErrorForGqlResponse(paid) + } + + const { paymentRequest, isExpired } = paymentStatusChecker + + if (paid) { + return { paymentHash, paymentRequest, status: WalletInvoiceStatus.Paid } + } + + const status = isExpired ? WalletInvoiceStatus.Expired : WalletInvoiceStatus.Pending + return { paymentHash, paymentRequest, status } + }, +}) + +export default LnInvoicePaymentStatusByHashQuery diff --git a/core/api/src/graphql/public/root/query/ln-invoice-payment-status-by-request.ts b/core/api/src/graphql/public/root/query/ln-invoice-payment-status-by-request.ts new file mode 100644 index 0000000000..4d55555735 --- /dev/null +++ b/core/api/src/graphql/public/root/query/ln-invoice-payment-status-by-request.ts @@ -0,0 +1,39 @@ +import { Lightning } from "@/app" +import { WalletInvoiceStatus } from "@/domain/wallet-invoices" + +import { GT } from "@/graphql/index" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import LnInvoicePaymentStatus from "@/graphql/public/types/object/ln-invoice-payment-status" +import LnInvoicePaymentStatusByRequestInput from "@/graphql/public/types/object/ln-invoice-payment-status-by-request-input" + +const LnInvoicePaymentStatusByRequestQuery = GT.Field({ + type: GT.NonNull(LnInvoicePaymentStatus), + args: { + input: { type: GT.NonNull(LnInvoicePaymentStatusByRequestInput) }, + }, + resolve: async (_, args) => { + const { paymentRequest } = args.input + if (paymentRequest instanceof Error) throw paymentRequest + + const paymentStatusChecker = await Lightning.PaymentStatusChecker(paymentRequest) + if (paymentStatusChecker instanceof Error) { + throw mapAndParseErrorForGqlResponse(paymentStatusChecker) + } + + const paid = await paymentStatusChecker.invoiceIsPaid() + if (paid instanceof Error) { + throw mapAndParseErrorForGqlResponse(paid) + } + + const { paymentHash, isExpired } = paymentStatusChecker + + if (paid) { + return { paymentHash, paymentRequest, status: WalletInvoiceStatus.Paid } + } + + const status = isExpired ? WalletInvoiceStatus.Expired : WalletInvoiceStatus.Pending + return { paymentHash, paymentRequest, status } + }, +}) + +export default LnInvoicePaymentStatusByRequestQuery diff --git a/core/api/src/graphql/public/root/query/ln-invoice-payment-status.ts b/core/api/src/graphql/public/root/query/ln-invoice-payment-status.ts index 404f0aa07d..992b4ca40d 100644 --- a/core/api/src/graphql/public/root/query/ln-invoice-payment-status.ts +++ b/core/api/src/graphql/public/root/query/ln-invoice-payment-status.ts @@ -1,32 +1,41 @@ import { Lightning } from "@/app" +import { WalletInvoiceStatus } from "@/domain/wallet-invoices" import { GT } from "@/graphql/index" -import { mapError } from "@/graphql/error-map" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" import LnInvoicePaymentStatusPayload from "@/graphql/public/types/payload/ln-invoice-payment-status" import LnInvoicePaymentStatusInput from "@/graphql/public/types/object/ln-invoice-payment-status-input" -import { WalletInvoiceStatus } from "@/domain/wallet-invoices" const LnInvoicePaymentStatusQuery = GT.Field({ type: GT.NonNull(LnInvoicePaymentStatusPayload), + deprecationReason: "Deprecated in favor of lnInvoicePaymentStatusByRequest", args: { input: { type: GT.NonNull(LnInvoicePaymentStatusInput) }, }, resolve: async (_, args) => { const { paymentRequest } = args.input - if (paymentRequest instanceof Error) throw paymentRequest + if (paymentRequest instanceof Error) { + return { errors: [{ message: paymentRequest.message }] } + } const paymentStatusChecker = await Lightning.PaymentStatusChecker(paymentRequest) - if (paymentStatusChecker instanceof Error) throw mapError(paymentStatusChecker) + if (paymentStatusChecker instanceof Error) { + return { errors: [mapAndParseErrorForGqlResponse(paymentStatusChecker)] } + } const paid = await paymentStatusChecker.invoiceIsPaid() - if (paid instanceof Error) throw mapError(paid) + if (paid instanceof Error) { + return { errors: [mapAndParseErrorForGqlResponse(paid)] } + } + + const { paymentHash, isExpired } = paymentStatusChecker - if (paid) return { errors: [], status: WalletInvoiceStatus.Paid } + if (paid) { + return { errors: [], paymentHash, paymentRequest, status: WalletInvoiceStatus.Paid } + } - const status = paymentStatusChecker.isExpired - ? WalletInvoiceStatus.Expired - : WalletInvoiceStatus.Pending - return { errors: [], status } + const status = isExpired ? WalletInvoiceStatus.Expired : WalletInvoiceStatus.Pending + return { errors: [], paymentHash, paymentRequest, status } }, }) diff --git a/core/api/src/graphql/public/root/subscription/ln-invoice-payment-status-by-hash.ts b/core/api/src/graphql/public/root/subscription/ln-invoice-payment-status-by-hash.ts new file mode 100644 index 0000000000..b6500cfcdb --- /dev/null +++ b/core/api/src/graphql/public/root/subscription/ln-invoice-payment-status-by-hash.ts @@ -0,0 +1,127 @@ +import { Lightning } from "@/app" + +import { customPubSubTrigger, PubSubDefaultTriggers } from "@/domain/pubsub" + +import { PubSubService } from "@/services/pubsub" +import { baseLogger } from "@/services/logger" + +import { GT } from "@/graphql/index" +import LnInvoicePaymentStatusPayload from "@/graphql/public/types/payload/ln-invoice-payment-status" +import LnInvoicePaymentStatusByHashInput from "@/graphql/public/types/object/ln-invoice-payment-status-by-hash-input" +import { UnknownClientError } from "@/graphql/error" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import { WalletInvoiceStatus } from "@/domain/wallet-invoices" + +const pubsub = PubSubService() + +type LnInvoicePaymentStatusByHashSubscribeArgs = { + input: { + paymentHash: PaymentHash | Error + } +} + +type LnInvoicePaymentStatusByHashResolveSource = { + errors?: IError[] + status?: string + paymentHash?: PaymentHash + paymentRequest?: EncodedPaymentRequest +} + +const LnInvoicePaymentStatusByHashSubscription = { + type: GT.NonNull(LnInvoicePaymentStatusPayload), + args: { + input: { type: GT.NonNull(LnInvoicePaymentStatusByHashInput) }, + }, + resolve: async (source: LnInvoicePaymentStatusByHashResolveSource | undefined) => { + if (source === undefined) { + throw new UnknownClientError({ + message: + "Got 'undefined' payload. Check url used to ensure right websocket endpoint was used for subscription.", + logger: baseLogger, + }) + } + + if (source.errors) { + return { errors: source.errors } + } + + let paymentRequest = source.paymentRequest + if (source.paymentHash && !source.paymentRequest) { + const invoice = await Lightning.getInvoiceRequestByHash({ + paymentHash: source.paymentHash, + }) + paymentRequest = invoice instanceof Error ? paymentRequest : invoice + } + return { + errors: [], + status: source.status, + paymentHash: source.paymentHash, + paymentRequest, + } + }, + + subscribe: async ( + _source: unknown, + args: LnInvoicePaymentStatusByHashSubscribeArgs, + ) => { + const { paymentHash } = args.input + if (paymentHash instanceof Error) throw paymentHash + + const paymentStatusChecker = await Lightning.PaymentStatusCheckerByHash({ + paymentHash, + }) + if (paymentStatusChecker instanceof Error) { + const lnPaymentStatusTrigger = customPubSubTrigger({ + event: PubSubDefaultTriggers.LnPaymentStatus, + suffix: paymentHash, + }) + pubsub.publishDelayed({ + trigger: lnPaymentStatusTrigger, + payload: { errors: [mapAndParseErrorForGqlResponse(paymentStatusChecker)] }, + }) + + return pubsub.createAsyncIterator({ trigger: lnPaymentStatusTrigger }) + } + + const paymentRequest = paymentStatusChecker.paymentRequest + const trigger = customPubSubTrigger({ + event: PubSubDefaultTriggers.LnPaymentStatus, + suffix: paymentHash, + }) + const paid = await paymentStatusChecker.invoiceIsPaid() + + if (paid instanceof Error) { + pubsub.publishDelayed({ + trigger, + payload: { errors: [mapAndParseErrorForGqlResponse(paid)] }, + }) + } + + if (paid) { + pubsub.publishDelayed({ + trigger, + payload: { paymentHash, paymentRequest, status: WalletInvoiceStatus.Paid }, + }) + return pubsub.createAsyncIterator({ trigger }) + } + + const status = paymentStatusChecker.isExpired + ? WalletInvoiceStatus.Expired + : WalletInvoiceStatus.Pending + pubsub.publishDelayed({ trigger, payload: { paymentHash, paymentRequest, status } }) + + if (!paymentStatusChecker.isExpired) { + const timeout = Math.max(paymentStatusChecker.expiresAt.getTime() - Date.now(), 0) + setTimeout(() => { + pubsub.publish({ + trigger, + payload: { paymentHash, paymentRequest, status: WalletInvoiceStatus.Expired }, + }) + }, timeout + 1000) + } + + return pubsub.createAsyncIterator({ trigger }) + }, +} + +export default LnInvoicePaymentStatusByHashSubscription diff --git a/core/api/src/graphql/public/root/subscription/ln-invoice-payment-status-by-request.ts b/core/api/src/graphql/public/root/subscription/ln-invoice-payment-status-by-request.ts new file mode 100644 index 0000000000..e274fa3a7f --- /dev/null +++ b/core/api/src/graphql/public/root/subscription/ln-invoice-payment-status-by-request.ts @@ -0,0 +1,126 @@ +import { Lightning } from "@/app" + +import { customPubSubTrigger, PubSubDefaultTriggers } from "@/domain/pubsub" + +import { PubSubService } from "@/services/pubsub" +import { baseLogger } from "@/services/logger" + +import { GT } from "@/graphql/index" +import LnInvoicePaymentStatusPayload from "@/graphql/public/types/payload/ln-invoice-payment-status" +import LnInvoicePaymentStatusByRequestInput from "@/graphql/public/types/object/ln-invoice-payment-status-by-request-input" +import { UnknownClientError } from "@/graphql/error" +import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" +import { WalletInvoiceStatus } from "@/domain/wallet-invoices" + +const pubsub = PubSubService() + +type LnInvoicePaymentStatusByRequestSubscribeArgs = { + input: { + paymentRequest: EncodedPaymentRequest | Error + } +} + +type LnInvoicePaymentStatusByRequestResolveSource = { + errors?: IError[] + status?: string + paymentHash?: PaymentHash + paymentRequest?: EncodedPaymentRequest +} + +const LnInvoicePaymentStatusByRequestSubscription = { + type: GT.NonNull(LnInvoicePaymentStatusPayload), + args: { + input: { type: GT.NonNull(LnInvoicePaymentStatusByRequestInput) }, + }, + resolve: async (source: LnInvoicePaymentStatusByRequestResolveSource | undefined) => { + if (source === undefined) { + throw new UnknownClientError({ + message: + "Got 'undefined' payload. Check url used to ensure right websocket endpoint was used for subscription.", + logger: baseLogger, + }) + } + + if (source.errors) { + return { errors: source.errors } + } + + let paymentRequest = source.paymentRequest + if (source.paymentHash && !source.paymentRequest) { + const invoice = await Lightning.getInvoiceRequestByHash({ + paymentHash: source.paymentHash, + }) + paymentRequest = invoice instanceof Error ? paymentRequest : invoice + } + return { + errors: [], + status: source.status, + paymentHash: source.paymentHash, + paymentRequest, + } + }, + + subscribe: async ( + _source: unknown, + args: LnInvoicePaymentStatusByRequestSubscribeArgs, + ) => { + const { paymentRequest } = args.input + if (paymentRequest instanceof Error) throw paymentRequest + + const paymentStatusChecker = await Lightning.PaymentStatusChecker(paymentRequest) + + if (paymentStatusChecker instanceof Error) { + const lnPaymentStatusTrigger = customPubSubTrigger({ + event: PubSubDefaultTriggers.LnPaymentStatus, + suffix: paymentRequest, + }) + pubsub.publishDelayed({ + trigger: lnPaymentStatusTrigger, + payload: { errors: [mapAndParseErrorForGqlResponse(paymentStatusChecker)] }, + }) + + return pubsub.createAsyncIterator({ trigger: lnPaymentStatusTrigger }) + } + + const paymentHash = paymentStatusChecker.paymentHash + const trigger = customPubSubTrigger({ + event: PubSubDefaultTriggers.LnPaymentStatus, + suffix: paymentHash, + }) + const paid = await paymentStatusChecker.invoiceIsPaid() + + if (paid instanceof Error) { + pubsub.publishDelayed({ + trigger, + payload: { errors: [mapAndParseErrorForGqlResponse(paid)] }, + }) + } + + if (paid) { + pubsub.publishDelayed({ + trigger, + payload: { paymentHash, paymentRequest, status: WalletInvoiceStatus.Paid }, + }) + return pubsub.createAsyncIterator({ trigger }) + } + + const status = paymentStatusChecker.isExpired + ? WalletInvoiceStatus.Expired + : WalletInvoiceStatus.Pending + pubsub.publishDelayed({ trigger, payload: { paymentHash, paymentRequest, status } }) + + if (!paymentStatusChecker.isExpired) { + const timeout = Math.max(paymentStatusChecker.expiresAt.getTime() - Date.now(), 0) + setTimeout(() => { + pubsub.publish({ + trigger, + payload: { paymentHash, paymentRequest, status: WalletInvoiceStatus.Expired }, + }) + }, timeout + 1000) + } + + return pubsub.createAsyncIterator({ trigger }) + }, +} + +export default LnInvoicePaymentStatusByRequestSubscription diff --git a/core/api/src/graphql/public/root/subscription/ln-invoice-payment-status.ts b/core/api/src/graphql/public/root/subscription/ln-invoice-payment-status.ts index 124268ccae..33eb980c1a 100644 --- a/core/api/src/graphql/public/root/subscription/ln-invoice-payment-status.ts +++ b/core/api/src/graphql/public/root/subscription/ln-invoice-payment-status.ts @@ -16,23 +16,24 @@ const pubsub = PubSubService() type LnInvoicePaymentSubscribeArgs = { input: { - paymentRequest: string | Error + paymentRequest: EncodedPaymentRequest | Error } } type LnInvoicePaymentResolveSource = { errors?: IError[] status?: string + paymentHash?: PaymentHash + paymentRequest?: EncodedPaymentRequest } const LnInvoicePaymentStatusSubscription = { type: GT.NonNull(LnInvoicePaymentStatusPayload), - + deprecationReason: "Deprecated in favor of lnInvoicePaymentStatusByRequest", args: { input: { type: GT.NonNull(LnInvoicePaymentStatusInput) }, }, - - resolve: (source: LnInvoicePaymentResolveSource | undefined) => { + resolve: async (source: LnInvoicePaymentResolveSource | undefined) => { if (source === undefined) { throw new UnknownClientError({ message: @@ -44,9 +45,19 @@ const LnInvoicePaymentStatusSubscription = { if (source.errors) { return { errors: source.errors } } + + let paymentRequest = source.paymentRequest + if (source.paymentHash && !source.paymentRequest) { + const invoice = await Lightning.getInvoiceRequestByHash({ + paymentHash: source.paymentHash, + }) + paymentRequest = invoice instanceof Error ? paymentRequest : invoice + } return { errors: [], status: source.status, + paymentHash: source.paymentHash, + paymentRequest, } }, @@ -69,9 +80,10 @@ const LnInvoicePaymentStatusSubscription = { return pubsub.createAsyncIterator({ trigger: lnPaymentStatusTrigger }) } + const paymentHash = paymentStatusChecker.paymentHash const trigger = customPubSubTrigger({ event: PubSubDefaultTriggers.LnPaymentStatus, - suffix: paymentStatusChecker.paymentHash, + suffix: paymentHash, }) const paid = await paymentStatusChecker.invoiceIsPaid() @@ -83,19 +95,25 @@ const LnInvoicePaymentStatusSubscription = { } if (paid) { - pubsub.publishDelayed({ trigger, payload: { status: WalletInvoiceStatus.Paid } }) + pubsub.publishDelayed({ + trigger, + payload: { paymentHash, paymentRequest, status: WalletInvoiceStatus.Paid }, + }) return pubsub.createAsyncIterator({ trigger }) } const status = paymentStatusChecker.isExpired ? WalletInvoiceStatus.Expired : WalletInvoiceStatus.Pending - pubsub.publishDelayed({ trigger, payload: { status } }) + pubsub.publishDelayed({ trigger, payload: { paymentHash, paymentRequest, status } }) if (!paymentStatusChecker.isExpired) { const timeout = Math.max(paymentStatusChecker.expiresAt.getTime() - Date.now(), 0) setTimeout(() => { - pubsub.publish({ trigger, payload: { status: WalletInvoiceStatus.Expired } }) + pubsub.publish({ + trigger, + payload: { paymentHash, paymentRequest, status: WalletInvoiceStatus.Expired }, + }) }, timeout + 1000) } diff --git a/core/api/src/graphql/public/schema.graphql b/core/api/src/graphql/public/schema.graphql index 5bdfa82c2f..a90bf0d5f2 100644 --- a/core/api/src/graphql/public/schema.graphql +++ b/core/api/src/graphql/public/schema.graphql @@ -595,12 +595,28 @@ input LnInvoicePaymentInput { walletId: WalletId! } +type LnInvoicePaymentStatus { + paymentHash: PaymentHash + paymentRequest: LnPaymentRequest + status: InvoicePaymentStatus +} + +input LnInvoicePaymentStatusByHashInput { + paymentHash: PaymentHash! +} + +input LnInvoicePaymentStatusByRequestInput { + paymentRequest: LnPaymentRequest! +} + input LnInvoicePaymentStatusInput { paymentRequest: LnPaymentRequest! } type LnInvoicePaymentStatusPayload { errors: [Error!]! + paymentHash: PaymentHash + paymentRequest: LnPaymentRequest status: InvoicePaymentStatus } @@ -1193,7 +1209,9 @@ type Query { businessMapMarkers: [MapMarker!]! currencyList: [Currency!]! globals: Globals - lnInvoicePaymentStatus(input: LnInvoicePaymentStatusInput!): LnInvoicePaymentStatusPayload! + lnInvoicePaymentStatus(input: LnInvoicePaymentStatusInput!): LnInvoicePaymentStatusPayload! @deprecated(reason: "Deprecated in favor of lnInvoicePaymentStatusByRequest") + lnInvoicePaymentStatusByHash(input: LnInvoicePaymentStatusByHashInput!): LnInvoicePaymentStatus! + lnInvoicePaymentStatusByRequest(input: LnInvoicePaymentStatusByRequestInput!): LnInvoicePaymentStatus! me: User mobileVersions: [MobileVersions] onChainTxFee(address: OnChainAddress!, amount: SatAmount!, speed: PayoutSpeed! = FAST, walletId: WalletId!): OnChainTxFee! @@ -1300,7 +1318,9 @@ A string amount (of a currency) that can be negative (e.g. in a transaction) scalar SignedDisplayMajorAmount type Subscription { - lnInvoicePaymentStatus(input: LnInvoicePaymentStatusInput!): LnInvoicePaymentStatusPayload! + lnInvoicePaymentStatus(input: LnInvoicePaymentStatusInput!): LnInvoicePaymentStatusPayload! @deprecated(reason: "Deprecated in favor of lnInvoicePaymentStatusByRequest") + lnInvoicePaymentStatusByHash(input: LnInvoicePaymentStatusByHashInput!): LnInvoicePaymentStatusPayload! + lnInvoicePaymentStatusByRequest(input: LnInvoicePaymentStatusByRequestInput!): LnInvoicePaymentStatusPayload! myUpdates: MyUpdatesPayload! price(input: PriceInput!): PricePayload! diff --git a/core/api/src/graphql/public/subscriptions.ts b/core/api/src/graphql/public/subscriptions.ts index b9c35d3867..4a3340241d 100644 --- a/core/api/src/graphql/public/subscriptions.ts +++ b/core/api/src/graphql/public/subscriptions.ts @@ -4,6 +4,8 @@ import PriceSubscription from "@/graphql/public/root/subscription/price" import MyUpdatesSubscription from "@/graphql/public/root/subscription/my-updates" import RealtimePriceSubscription from "@/graphql/public/root/subscription/realtime-price" import LnInvoicePaymentStatusSubscription from "@/graphql/public/root/subscription/ln-invoice-payment-status" +import LnInvoicePaymentStatusByHashSubscription from "@/graphql/public/root/subscription/ln-invoice-payment-status-by-hash" +import LnInvoicePaymentStatusByRequestSubscription from "@/graphql/public/root/subscription/ln-invoice-payment-status-by-request" import { ACCOUNT_USERNAME, addAttributesToCurrentSpan, @@ -15,6 +17,8 @@ const fields = { price: PriceSubscription, realtimePrice: RealtimePriceSubscription, lnInvoicePaymentStatus: LnInvoicePaymentStatusSubscription, + lnInvoicePaymentStatusByHash: LnInvoicePaymentStatusByHashSubscription, + lnInvoicePaymentStatusByRequest: LnInvoicePaymentStatusByRequestSubscription, } const addTracing = () => { diff --git a/core/api/src/graphql/public/types/object/ln-invoice-payment-status-by-hash-input.ts b/core/api/src/graphql/public/types/object/ln-invoice-payment-status-by-hash-input.ts new file mode 100644 index 0000000000..ba50f5ec06 --- /dev/null +++ b/core/api/src/graphql/public/types/object/ln-invoice-payment-status-by-hash-input.ts @@ -0,0 +1,11 @@ +import { GT } from "@/graphql/index" +import PaymentHash from "@/graphql/shared/types/scalar/payment-hash" + +const LnInvoicePaymentStatusByHashInput = GT.Input({ + name: "LnInvoicePaymentStatusByHashInput", + fields: () => ({ + paymentHash: { type: GT.NonNull(PaymentHash) }, + }), +}) + +export default LnInvoicePaymentStatusByHashInput diff --git a/core/api/src/graphql/public/types/object/ln-invoice-payment-status-by-request-input.ts b/core/api/src/graphql/public/types/object/ln-invoice-payment-status-by-request-input.ts new file mode 100644 index 0000000000..c843a8c5d1 --- /dev/null +++ b/core/api/src/graphql/public/types/object/ln-invoice-payment-status-by-request-input.ts @@ -0,0 +1,11 @@ +import { GT } from "@/graphql/index" +import LnPaymentRequest from "@/graphql/shared/types/scalar/ln-payment-request" + +const LnInvoicePaymentStatusByRequestInput = GT.Input({ + name: "LnInvoicePaymentStatusByRequestInput", + fields: () => ({ + paymentRequest: { type: GT.NonNull(LnPaymentRequest) }, + }), +}) + +export default LnInvoicePaymentStatusByRequestInput diff --git a/core/api/src/graphql/public/types/object/ln-invoice-payment-status.ts b/core/api/src/graphql/public/types/object/ln-invoice-payment-status.ts new file mode 100644 index 0000000000..b7d3d8f060 --- /dev/null +++ b/core/api/src/graphql/public/types/object/ln-invoice-payment-status.ts @@ -0,0 +1,15 @@ +import { GT } from "@/graphql/index" +import PaymentHash from "@/graphql/shared/types/scalar/payment-hash" +import LnPaymentRequest from "@/graphql/shared/types/scalar/ln-payment-request" +import InvoicePaymentStatus from "@/graphql/shared/types/scalar/invoice-payment-status" + +const LnInvoicePaymentStatus = GT.Object({ + name: "LnInvoicePaymentStatus", + fields: () => ({ + paymentHash: { type: PaymentHash }, + paymentRequest: { type: LnPaymentRequest }, + status: { type: InvoicePaymentStatus }, + }), +}) + +export default LnInvoicePaymentStatus diff --git a/core/api/src/graphql/public/types/payload/ln-invoice-payment-status.ts b/core/api/src/graphql/public/types/payload/ln-invoice-payment-status.ts index 60aefdb5eb..511efb77b5 100644 --- a/core/api/src/graphql/public/types/payload/ln-invoice-payment-status.ts +++ b/core/api/src/graphql/public/types/payload/ln-invoice-payment-status.ts @@ -1,7 +1,8 @@ -import InvoicePaymentStatus from "../../../shared/types/scalar/invoice-payment-status" - -import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" +import IError from "@/graphql/shared/types/abstract/error" +import PaymentHash from "@/graphql/shared/types/scalar/payment-hash" +import LnPaymentRequest from "@/graphql/shared/types/scalar/ln-payment-request" +import InvoicePaymentStatus from "@/graphql/shared/types/scalar/invoice-payment-status" const LnInvoicePaymentStatusPayload = GT.Object({ name: "LnInvoicePaymentStatusPayload", @@ -9,6 +10,8 @@ const LnInvoicePaymentStatusPayload = GT.Object({ errors: { type: GT.NonNullList(IError), }, + paymentHash: { type: PaymentHash }, + paymentRequest: { type: LnPaymentRequest }, status: { type: InvoicePaymentStatus }, }), }) diff --git a/core/api/src/services/notifications/index.ts b/core/api/src/services/notifications/index.ts index c18e741b2f..06be29e0bc 100644 --- a/core/api/src/services/notifications/index.ts +++ b/core/api/src/services/notifications/index.ts @@ -97,7 +97,7 @@ export const NotificationsService = (): INotificationsService => { const result = Promise.all([ pubsub.publish({ trigger: lnPaymentStatusTrigger, - payload: { status: WalletInvoiceStatus.Paid }, + payload: { paymentHash, status: WalletInvoiceStatus.Paid }, }), pubsub.publish({ trigger: accountUpdatedTrigger, diff --git a/dev/config/apollo-federation/supergraph.graphql b/dev/config/apollo-federation/supergraph.graphql index 0560477573..e5ad5e75ad 100644 --- a/dev/config/apollo-federation/supergraph.graphql +++ b/dev/config/apollo-federation/supergraph.graphql @@ -811,6 +811,26 @@ input LnInvoicePaymentInput walletId: WalletId! } +type LnInvoicePaymentStatus + @join__type(graph: PUBLIC) +{ + paymentHash: PaymentHash + paymentRequest: LnPaymentRequest + status: InvoicePaymentStatus +} + +input LnInvoicePaymentStatusByHashInput + @join__type(graph: PUBLIC) +{ + paymentHash: PaymentHash! +} + +input LnInvoicePaymentStatusByRequestInput + @join__type(graph: PUBLIC) +{ + paymentRequest: LnPaymentRequest! +} + input LnInvoicePaymentStatusInput @join__type(graph: PUBLIC) { @@ -821,6 +841,8 @@ type LnInvoicePaymentStatusPayload @join__type(graph: PUBLIC) { errors: [Error!]! + paymentHash: PaymentHash + paymentRequest: LnPaymentRequest status: InvoicePaymentStatus } @@ -1545,7 +1567,9 @@ type Query businessMapMarkers: [MapMarker!]! @join__field(graph: PUBLIC) currencyList: [Currency!]! @join__field(graph: PUBLIC) globals: Globals @join__field(graph: PUBLIC) - lnInvoicePaymentStatus(input: LnInvoicePaymentStatusInput!): LnInvoicePaymentStatusPayload! @join__field(graph: PUBLIC) + lnInvoicePaymentStatus(input: LnInvoicePaymentStatusInput!): LnInvoicePaymentStatusPayload! @join__field(graph: PUBLIC) @deprecated(reason: "Deprecated in favor of lnInvoicePaymentStatusByRequest") + lnInvoicePaymentStatusByHash(input: LnInvoicePaymentStatusByHashInput!): LnInvoicePaymentStatus! @join__field(graph: PUBLIC) + lnInvoicePaymentStatusByRequest(input: LnInvoicePaymentStatusByRequestInput!): LnInvoicePaymentStatus! @join__field(graph: PUBLIC) me: User @join__field(graph: PUBLIC) mobileVersions: [MobileVersions] @join__field(graph: PUBLIC) onChainTxFee(address: OnChainAddress!, amount: SatAmount!, speed: PayoutSpeed! = FAST, walletId: WalletId!): OnChainTxFee! @join__field(graph: PUBLIC) @@ -1688,7 +1712,9 @@ scalar SignedDisplayMajorAmount type Subscription @join__type(graph: PUBLIC) { - lnInvoicePaymentStatus(input: LnInvoicePaymentStatusInput!): LnInvoicePaymentStatusPayload! + lnInvoicePaymentStatus(input: LnInvoicePaymentStatusInput!): LnInvoicePaymentStatusPayload! @deprecated(reason: "Deprecated in favor of lnInvoicePaymentStatusByRequest") + lnInvoicePaymentStatusByHash(input: LnInvoicePaymentStatusByHashInput!): LnInvoicePaymentStatusPayload! + lnInvoicePaymentStatusByRequest(input: LnInvoicePaymentStatusByRequestInput!): LnInvoicePaymentStatusPayload! myUpdates: MyUpdatesPayload! price(input: PriceInput!): PricePayload!