@cfxlabsinc/b2b-services
    Preparing search index...

    Builds the WITHDRAW email payload for a withdrawal status change and hands it to the CustomerNotificationService core. Lives in withdrawal-services (next to the writer) so it can use the Withdrawal domain type; the writer calls notify right where it publishes the event + busts the cache.

    Relocated from the customer-dashboard sendWithdrawalNotification handler.

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Notify the relevant recipients of a withdrawal status change. Best-effort.

      Parameters

      • __namedParameters: {
            withdrawal: {
                createdAt: Date;
                customerId: string;
                data: {
                    imad?: string;
                    methodTransactionId?: string;
                    omad?: string;
                    signedTransaction?: string;
                    victorTransactionId?: string;
                };
                entityId: string;
                entityType: "IDENTITY"
                | "ORGANIZATION";
                feeSweepTxId: string | null;
                feeSweepTxType: "SOLANA_TRANSACTION_SIGNATURE" | null;
                history: WithdrawalStatusUpdateHistory[];
                id: string;
                quote: {
                    createdAt: Date;
                    customerId: string;
                    deviceIpAddress: string | null;
                    deviceLocation: { lat: number; long: number; source: "ip" } | null;
                    entityId: string;
                    expiresAt: Date;
                    fees: (
                        {
                            amount: BigNumber;
                            receiver: "CUSTOMER"
                            | "CFX"
                            | "PROVIDER";
                            type: "FIXED" | "VARIABLE";
                        } & { currency: "MOVEUSD"
                        | "USDC" }
                    )[];
                    id: string;
                    metadata: {
                        brand?: string;
                        marketing?: {
                            fbp?: string;
                            gclid?: string;
                            sub1?: string;
                            sub2?: string;
                            sub3?: string;
                            userAgent?: string;
                            utmCampaign?: string;
                            utmContent?: string;
                            utmMedium?: string;
                            utmSource?: string;
                        };
                    };
                    methodData: | {
                        achBatchId?: string;
                        bankId?: string;
                        sourceLedgerAccountId?: string;
                        speed?: "same-day"
                        | "next-day";
                        type: "US_ACH";
                    }
                    | {
                        achId: string;
                        bankId?: string;
                        sourceLedgerAccountId?: string;
                        type: "ACH_PULL";
                    }
                    | {
                        bankId?: string;
                        beneficiaryReference?: string;
                        purpose: WireWithdrawalPurpose;
                        senderMessage?: string;
                        sourceLedgerAccountId: string;
                        type: "US_WIRE"
                        | "SWIFT_WIRE";
                        wireBatchId?: string;
                    }
                    | {
                        country: string;
                        type: "AF_WITHDRAWAL";
                        withdrawalType: "bank"
                        | "momo";
                    }
                    | { sourceLedgerAccountId: string; type: "BLOCKCHAIN" }
                    | { bankId?: string; sourceLedgerAccountId?: string; type: "US_INSTANT" }
                    | {
                        bankId?: string;
                        drawdownId: string;
                        sourceAccountId: string;
                        type: "US_WIRE_DRAWDOWN";
                    }
                    | null;
                    methodId: | "US_WIRE"
                    | "SWIFT_WIRE"
                    | "US_ACH"
                    | "US_INSTANT"
                    | "MX_SPEI"
                    | "US_WIRE_DRAWDOWN"
                    | "AF_WITHDRAWAL"
                    | "ACH_PULL"
                    | "BLOCKCHAIN";
                    paymentInstrumentId: string;
                    productQuoteId: string;
                    providerQuoteId: string
                    | null;
                    sourceAmount: BigNumber;
                    sourceAmountAfterFees: BigNumber;
                    sourceCurrency: string;
                    status: "ACTIVE" | "ACCEPTED" | "EXPIRED" | "REJECTED";
                    targetAmount: BigNumber;
                    targetAmountAfterFees: BigNumber;
                    targetCurrency: string;
                    unsignedWithdrawalTransaction: string;
                    updatedAt: Date;
                    walletAddress: Address;
                    walletBlockchain: string;
                };
                receiptId: string
                | null;
                receiptType: "SOLANA_TRANSACTION_SIGNATURE" | null;
                returnReceiptId: string | null;
                status: "CREATED" | "PENDING" | "FAILED" | "COMPLETED" | "RETURNED";
                sweepTxId: string | null;
                sweepTxType: "SOLANA_TRANSACTION_SIGNATURE" | null;
                type:
                    | "US_WIRE"
                    | "SWIFT_WIRE"
                    | "US_ACH"
                    | "US_INSTANT"
                    | "MX_SPEI"
                    | "US_WIRE_DRAWDOWN"
                    | "AF_WITHDRAWAL"
                    | "ACH_PULL"
                    | "BLOCKCHAIN";
                updatedAt: Date;
            };
        }

      Returns Promise<void>