From 4049f6611964994a57bd29a7e0b086d126ed53af Mon Sep 17 00:00:00 2001 From: mirunagherman Date: Wed, 30 Sep 2026 15:50:37 +0300 Subject: [PATCH] chore: remove wallet address not found webhook --- packages/wallet/backend/src/rafiki/service.ts | 12 ++---------- packages/wallet/backend/src/rafiki/validation.ts | 11 ++--------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/packages/wallet/backend/src/rafiki/service.ts b/packages/wallet/backend/src/rafiki/service.ts index 706223316..c08eeb770 100644 --- a/packages/wallet/backend/src/rafiki/service.ts +++ b/packages/wallet/backend/src/rafiki/service.ts @@ -24,8 +24,7 @@ export enum EventType { IncomingPaymentExpired = 'incoming_payment.expired', OutgoingPaymentCreated = 'outgoing_payment.created', OutgoingPaymentCompleted = 'outgoing_payment.completed', - OutgoingPaymentFailed = 'outgoing_payment.failed', - WalletAddressNotFound = 'wallet_address.not_found' + OutgoingPaymentFailed = 'outgoing_payment.failed' } export interface WebHook { @@ -93,11 +92,7 @@ export class RafikiService implements IRafikiService { ) {} public async onWebHook(wh: WebhookType): Promise { - this.logger.info( - `received webhook of type : ${wh.type} for : ${ - wh.type === EventType.WalletAddressNotFound ? '' : `${wh.id}}` - }` - ) + this.logger.info(`received webhook of type : ${wh.type} for : ${wh.id}`) switch (wh.type) { case EventType.OutgoingPaymentCreated: @@ -118,9 +113,6 @@ export class RafikiService implements IRafikiService { case EventType.IncomingPaymentExpired: await this.handleIncomingPaymentExpired(wh) break - case EventType.WalletAddressNotFound: - this.logger.warn(`${EventType.WalletAddressNotFound} received`) - break } } diff --git a/packages/wallet/backend/src/rafiki/validation.ts b/packages/wallet/backend/src/rafiki/validation.ts index 4952508fe..72426295c 100644 --- a/packages/wallet/backend/src/rafiki/validation.ts +++ b/packages/wallet/backend/src/rafiki/validation.ts @@ -97,17 +97,10 @@ export const outgoingPaymentWebhookSchema = z.object({ ]), data: outgoingPaymentSchema }) -export const walletAddressWebhookSchema = z.object({ - id: z.string(), - type: z.literal(EventType.WalletAddressNotFound), - data: z.object({ - walletAddressUrl: z.string() - }) -}) + export const webhookSchema = z.discriminatedUnion('type', [ incomingPaymentWebhookSchema, - outgoingPaymentWebhookSchema, - walletAddressWebhookSchema + outgoingPaymentWebhookSchema ]) export const webhookBodySchema = z.object({