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

    Hierarchy (View Summary)

    Index
    db: B2bDatabase
    yellowcardClient: YellowcardClient
    instance: (...args: []) => YellowcardWithdrawalQuoteService = ...

    The process service, starting workflows on the temporal namespace's queue.

    • Quotes a payout funded from the owner's ledger account. CFX signs the mintfx withdraw hold when the quote is accepted.

      Parameters

      • args: Pick<
            YellowcardWithdrawalQuote,
            "deviceIpAddress"
            | "deviceLocation"
            | "entityId",
        > & {
            channelId?: string;
            country: string;
            customerId: string;
            idempotencyKey?: string;
            kyc?: SenderKyc;
            reason: YellowcardReason;
            sourceAccountId: string;
            sourceAmount: BigNumber;
            targetCurrency: string;
            targetPaymentInstrument: string;
            withdrawalType: "bank" | "momo";
        }
        • OptionalchannelId?: string
        • country: string
        • customerId: string
        • OptionalidempotencyKey?: string

          Caller-supplied idempotency key (from the API Idempotency-Key header). Threaded into productQuoteService.quote() (dedupes the pinned engine quote) and withdrawalQuoteService.create() (dedupes the withdrawal quote). Optional — internal callers don't supply one.

        • Optionalkyc?: SenderKyc

          An identity's sender details, in place of its verified profile.

        • reason: YellowcardReason
        • sourceAccountId: string
        • sourceAmount: BigNumber
        • targetCurrency: string
        • targetPaymentInstrument: string
        • withdrawalType: "bank" | "momo"

      Returns Promise<
          | { ok: true; value: YellowcardWithdrawalQuote }
          | {
              error:
                  | ServiceError<
                      | "INSUFFICIENT_FUNDS"
                      | "PRODUCT_INACTIVE"
                      | "NO_ELIGIBLE_ROUTE"
                      | "CUSTOMER_NOT_ACTIVE"
                      | "PAYMENT_INSTRUMENT_BLOCKED"
                      | "PAYMENT_INSTRUMENT_ACTION_REQUIRED",
                  >
                  | ServiceError<"LIMIT_EXCEEDED", ProductLimitViolation>
                  | ServiceError<QuoteInvariantViolation>
                  | ServiceError<
                      "ENTITY_NOT_FOUND"
                      | "ENTITY_CANNOT_TRANSACT"
                      | "NO_COUNTRY",
                  >
                  | ServiceError<"UNSUPPORTED_COUNTRY" | "UNSUPPORTED_PRODUCT">
                  | ServiceError<"IDENTITY_NOT_ACTIVE">
                  | ServiceError<"ORGANIZATION_REGISTRATION_NUMBER_REQUIRED">
                  | ServiceError<"LEDGER_ACCOUNT_NOT_FOUND", { id: string }>
                  | ServiceError<"NO_AVAILABLE_CHANNELS" | "CHANNEL_NOT_AVAILABLE">
                  | ServiceError<"AMOUNT_BELOW_MINIMUM" | "AMOUNT_ABOVE_MAXIMUM">
                  | ServiceError<"INVALID_INSTRUMENT">;
              ok: false;
          },
      >

    • Parameters

      • args: {
            country: string;
            customerId: string;
            entityId: string;
            source: { amount: BigNumber };
            targetCurrency: string;
            withdrawalType: "bank" | "momo";
        }

      Returns Promise<
          | { error: ServiceError<string, object>; ok: false }
          | {
              ok: true;
              value: {
                  exchangeRate: BigNumber;
                  fees: Fees;
                  sourceAmount: BigNumber;
                  targetAmountAfterFees: BigNumber;
                  totalFees: BigNumber;
                  withdrawalType: "bank" | "momo";
              };
          },
      >

    • Parameters

      • country: string

      Returns Promise<
          {
              accountNumberType: string;
              channelIds: string[];
              code?: string;
              country: string;
              id: string;
              name: string;
              status: string;
          }[],
      >