Skip to content

Commit

Permalink
feat(core): add payment status by hash query/subscription (#3899)
Browse files Browse the repository at this point in the history
* feat(core): add payment status by hash query/subscription

* chore: rename payment status related types internally

* refactor: deprecate current query/subscription

* fix: bats tests query/subscription by request

* chore: update codegen

* fix(pay): codegen issues

* chore(core): update graphql schemas

* chore(core): remove schema-diff checks from 'test' job

These checks are now included in //dev:check-sdls

* fix(pay): invoice creation to use recipient wallet id

* fix(pay): codegen settings

* fix(pay): codegen issues

---------

Co-authored-by: vindard <[email protected]>
  • Loading branch information
dolcalmi and vindard authored Feb 14, 2024
1 parent f285a37 commit f316a1b
Show file tree
Hide file tree
Showing 29 changed files with 2,476 additions and 1,838 deletions.
62 changes: 62 additions & 0 deletions apps/dashboard/services/graphql/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -679,13 +679,30 @@ export type LnInvoicePaymentInput = {
readonly walletId: Scalars['WalletId']['input'];
};

export type LnInvoicePaymentStatus = {
readonly __typename: 'LnInvoicePaymentStatus';
readonly paymentHash?: Maybe<Scalars['PaymentHash']['output']>;
readonly paymentRequest?: Maybe<Scalars['LnPaymentRequest']['output']>;
readonly status?: Maybe<InvoicePaymentStatus>;
};

export type LnInvoicePaymentStatusByHashInput = {
readonly paymentHash: Scalars['PaymentHash']['input'];
};

export type LnInvoicePaymentStatusByRequestInput = {
readonly paymentRequest: Scalars['LnPaymentRequest']['input'];
};

export type LnInvoicePaymentStatusInput = {
readonly paymentRequest: Scalars['LnPaymentRequest']['input'];
};

export type LnInvoicePaymentStatusPayload = {
readonly __typename: 'LnInvoicePaymentStatusPayload';
readonly errors: ReadonlyArray<Error>;
readonly paymentHash?: Maybe<Scalars['PaymentHash']['output']>;
readonly paymentRequest?: Maybe<Scalars['LnPaymentRequest']['output']>;
readonly status?: Maybe<InvoicePaymentStatus>;
};

Expand Down Expand Up @@ -1509,7 +1526,10 @@ export type Query = {
readonly businessMapMarkers: ReadonlyArray<MapMarker>;
readonly currencyList: ReadonlyArray<Currency>;
readonly globals?: Maybe<Globals>;
/** @deprecated Deprecated in favor of lnInvoicePaymentStatusByRequest */
readonly lnInvoicePaymentStatus: LnInvoicePaymentStatusPayload;
readonly lnInvoicePaymentStatusByHash: LnInvoicePaymentStatus;
readonly lnInvoicePaymentStatusByRequest: LnInvoicePaymentStatus;
readonly me?: Maybe<User>;
readonly mobileVersions?: Maybe<ReadonlyArray<Maybe<MobileVersions>>>;
readonly onChainTxFee: OnChainTxFee;
Expand Down Expand Up @@ -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'];
Expand Down Expand Up @@ -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 */
Expand All @@ -1671,6 +1703,16 @@ export type SubscriptionLnInvoicePaymentStatusArgs = {
};


export type SubscriptionLnInvoicePaymentStatusByHashArgs = {
input: LnInvoicePaymentStatusByHashInput;
};


export type SubscriptionLnInvoicePaymentStatusByRequestArgs = {
input: LnInvoicePaymentStatusByRequestInput;
};


export type SubscriptionPriceArgs = {
input: PriceInput;
};
Expand Down Expand Up @@ -3349,6 +3391,9 @@ export type ResolversTypes = {
LnInvoiceFeeProbeInput: LnInvoiceFeeProbeInput;
LnInvoicePayload: ResolverTypeWrapper<LnInvoicePayload>;
LnInvoicePaymentInput: LnInvoicePaymentInput;
LnInvoicePaymentStatus: ResolverTypeWrapper<LnInvoicePaymentStatus>;
LnInvoicePaymentStatusByHashInput: LnInvoicePaymentStatusByHashInput;
LnInvoicePaymentStatusByRequestInput: LnInvoicePaymentStatusByRequestInput;
LnInvoicePaymentStatusInput: LnInvoicePaymentStatusInput;
LnInvoicePaymentStatusPayload: ResolverTypeWrapper<LnInvoicePaymentStatusPayload>;
LnNoAmountInvoice: ResolverTypeWrapper<LnNoAmountInvoice>;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -4039,8 +4087,17 @@ export type LnInvoicePayloadResolvers<ContextType = any, ParentType extends Reso
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};

export type LnInvoicePaymentStatusResolvers<ContextType = any, ParentType extends ResolversParentTypes['LnInvoicePaymentStatus'] = ResolversParentTypes['LnInvoicePaymentStatus']> = {
paymentHash?: Resolver<Maybe<ResolversTypes['PaymentHash']>, ParentType, ContextType>;
paymentRequest?: Resolver<Maybe<ResolversTypes['LnPaymentRequest']>, ParentType, ContextType>;
status?: Resolver<Maybe<ResolversTypes['InvoicePaymentStatus']>, ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};

export type LnInvoicePaymentStatusPayloadResolvers<ContextType = any, ParentType extends ResolversParentTypes['LnInvoicePaymentStatusPayload'] = ResolversParentTypes['LnInvoicePaymentStatusPayload']> = {
errors?: Resolver<ReadonlyArray<ResolversTypes['Error']>, ParentType, ContextType>;
paymentHash?: Resolver<Maybe<ResolversTypes['PaymentHash']>, ParentType, ContextType>;
paymentRequest?: Resolver<Maybe<ResolversTypes['LnPaymentRequest']>, ParentType, ContextType>;
status?: Resolver<Maybe<ResolversTypes['InvoicePaymentStatus']>, ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};
Expand Down Expand Up @@ -4341,6 +4398,8 @@ export type QueryResolvers<ContextType = any, ParentType extends ResolversParent
currencyList?: Resolver<ReadonlyArray<ResolversTypes['Currency']>, ParentType, ContextType>;
globals?: Resolver<Maybe<ResolversTypes['Globals']>, ParentType, ContextType>;
lnInvoicePaymentStatus?: Resolver<ResolversTypes['LnInvoicePaymentStatusPayload'], ParentType, ContextType, RequireFields<QueryLnInvoicePaymentStatusArgs, 'input'>>;
lnInvoicePaymentStatusByHash?: Resolver<ResolversTypes['LnInvoicePaymentStatus'], ParentType, ContextType, RequireFields<QueryLnInvoicePaymentStatusByHashArgs, 'input'>>;
lnInvoicePaymentStatusByRequest?: Resolver<ResolversTypes['LnInvoicePaymentStatus'], ParentType, ContextType, RequireFields<QueryLnInvoicePaymentStatusByRequestArgs, 'input'>>;
me?: Resolver<Maybe<ResolversTypes['User']>, ParentType, ContextType>;
mobileVersions?: Resolver<Maybe<ReadonlyArray<Maybe<ResolversTypes['MobileVersions']>>>, ParentType, ContextType>;
onChainTxFee?: Resolver<ResolversTypes['OnChainTxFee'], ParentType, ContextType, RequireFields<QueryOnChainTxFeeArgs, 'address' | 'amount' | 'speed' | 'walletId'>>;
Expand Down Expand Up @@ -4438,6 +4497,8 @@ export interface SignedDisplayMajorAmountScalarConfig extends GraphQLScalarTypeC

export type SubscriptionResolvers<ContextType = any, ParentType extends ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription']> = {
lnInvoicePaymentStatus?: SubscriptionResolver<ResolversTypes['LnInvoicePaymentStatusPayload'], "lnInvoicePaymentStatus", ParentType, ContextType, RequireFields<SubscriptionLnInvoicePaymentStatusArgs, 'input'>>;
lnInvoicePaymentStatusByHash?: SubscriptionResolver<ResolversTypes['LnInvoicePaymentStatusPayload'], "lnInvoicePaymentStatusByHash", ParentType, ContextType, RequireFields<SubscriptionLnInvoicePaymentStatusByHashArgs, 'input'>>;
lnInvoicePaymentStatusByRequest?: SubscriptionResolver<ResolversTypes['LnInvoicePaymentStatusPayload'], "lnInvoicePaymentStatusByRequest", ParentType, ContextType, RequireFields<SubscriptionLnInvoicePaymentStatusByRequestArgs, 'input'>>;
myUpdates?: SubscriptionResolver<ResolversTypes['MyUpdatesPayload'], "myUpdates", ParentType, ContextType>;
price?: SubscriptionResolver<ResolversTypes['PricePayload'], "price", ParentType, ContextType, RequireFields<SubscriptionPriceArgs, 'input'>>;
realtimePrice?: SubscriptionResolver<ResolversTypes['RealtimePricePayload'], "realtimePrice", ParentType, ContextType, RequireFields<SubscriptionRealtimePriceArgs, 'input'>>;
Expand Down Expand Up @@ -4708,6 +4769,7 @@ export type Resolvers<ContextType = any> = {
Language?: GraphQLScalarType;
LnInvoice?: LnInvoiceResolvers<ContextType>;
LnInvoicePayload?: LnInvoicePayloadResolvers<ContextType>;
LnInvoicePaymentStatus?: LnInvoicePaymentStatusResolvers<ContextType>;
LnInvoicePaymentStatusPayload?: LnInvoicePaymentStatusPayloadResolvers<ContextType>;
LnNoAmountInvoice?: LnNoAmountInvoiceResolvers<ContextType>;
LnNoAmountInvoicePayload?: LnNoAmountInvoicePayloadResolvers<ContextType>;
Expand Down
20 changes: 11 additions & 9 deletions apps/pay/codegen.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -64,3 +61,8 @@ generates:
join__FieldSet: "string"
link__Import: "string"
_FieldSet: "string"
LnPubkey: "string"
EndpointId: "string"
EndpointUrl: "string"
Object: "string"
NotificationCategory: "string"
Loading

0 comments on commit f316a1b

Please sign in to comment.