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

    Admin withdrawal-quote reads. Extends WithdrawalQuoteCache, which owns the withdrawal-quote-search namespace these reads go through.

    Hierarchy (View Summary)

    Index
    cache: ServiceCache<
        CachedSearchPage<
            {
                createdAt: Date;
                customerId: string;
                deviceIpAddress: string
                | null;
                deviceLocation: { lat: number; long: number; source: "ip" } | null;
                entityId: string;
                expiresAt: Date;
                fees: (
                    {
                        amount: BigNumber;
                        receiver: "CUSTOMER"
                        | "PROVIDER"
                        | "CFX";
                        type: "FIXED" | "VARIABLE";
                    } & { currency: string }
                )[];
                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: "ACH_CREDIT";
                    vendorId?: string;
                }
                | {
                    achId: string;
                    bankId?: string;
                    sourceLedgerAccountId?: string;
                    type: "ACH_DEBIT";
                    vendorId?: string;
                }
                | {
                    bankId?: string;
                    beneficiaryReference?: string;
                    purpose: WireWithdrawalPurpose;
                    senderMessage?: string;
                    sourceLedgerAccountId: string;
                    type: "SWIFT_WIRE"
                    | "US_WIRE";
                    vendorId?: string;
                    wireBatchId?: string;
                }
                | {
                    country: string;
                    sourceLedgerAccountId?: string;
                    type: "AF_WITHDRAWAL";
                    withdrawalType: "bank"
                    | "momo";
                }
                | {
                    asset?: {
                        decimals: number;
                        mint: string;
                        symbol: string;
                        tokenProgram: string;
                    };
                    sourceLedgerAccountId: string;
                    type: "BLOCKCHAIN";
                }
                | {
                    bankId?: string;
                    sourceLedgerAccountId?: string;
                    type: "US_INSTANT";
                    vendorId?: string;
                }
                | {
                    bankId?: string;
                    drawdownId: string;
                    sourceAccountId: string;
                    type: "US_WIRE_DRAWDOWN";
                    vendorId?: string;
                }
                | null;
                methodId: | "ACH_CREDIT"
                | "ACH_DEBIT"
                | "BLOCKCHAIN"
                | "MX_SPEI"
                | "US_WIRE_DRAWDOWN"
                | "US_INSTANT"
                | "SWIFT_WIRE"
                | "US_WIRE"
                | "AF_WITHDRAWAL";
                paymentInstrumentId: string;
                productQuoteId: string;
                providerQuoteId: string
                | null;
                sourceAmount: BigNumber;
                sourceAmountAfterFees: BigNumber;
                sourceCurrency: string;
                status: "ACTIVE" | "ACCEPTED" | "REJECTED" | "EXPIRED";
                targetAmount: BigNumber;
                targetAmountAfterFees: BigNumber;
                targetCurrency: string;
                unsignedWithdrawalTransaction: string | null;
                updatedAt: Date;
                walletAddress: Address;
                walletBlockchain: string;
            },
        >,
    >
    db: B2bDatabase
    instance: (...args: []) => WithdrawalQuoteAdminQueryService = ...

    The process default: built from each dependency's own instance().

    • Get a withdrawal by ID without customer restriction

      Parameters

      • __namedParameters: { id: string; tx?: PgAsyncTransaction<NodePgQueryResultHKT, EmptyRelations> }

      Returns Promise<
          {
              ok: true;
              value: | {
                  createdAt: Date;
                  customerId: string;
                  deviceIpAddress: string
                  | null;
                  deviceLocation: { lat: number; long: number; source: "ip" } | null;
                  entityId: string;
                  expiresAt: Date;
                  fees: (
                      {
                          amount: BigNumber;
                          receiver: "CUSTOMER"
                          | "PROVIDER"
                          | "CFX";
                          type: "FIXED" | "VARIABLE";
                      } & { currency: string }
                  )[];
                  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: "ACH_CREDIT";
                      vendorId?: string;
                  }
                  | {
                      achId: string;
                      bankId?: string;
                      sourceLedgerAccountId?: string;
                      type: "ACH_DEBIT";
                      vendorId?: string;
                  }
                  | {
                      bankId?: string;
                      beneficiaryReference?: string;
                      purpose: WireWithdrawalPurpose;
                      senderMessage?: string;
                      sourceLedgerAccountId: string;
                      type: "SWIFT_WIRE"
                      | "US_WIRE";
                      vendorId?: string;
                      wireBatchId?: string;
                  }
                  | {
                      country: string;
                      sourceLedgerAccountId?: string;
                      type: "AF_WITHDRAWAL";
                      withdrawalType: "bank"
                      | "momo";
                  }
                  | {
                      asset?: {
                          decimals: number;
                          mint: string;
                          symbol: string;
                          tokenProgram: string;
                      };
                      sourceLedgerAccountId: string;
                      type: "BLOCKCHAIN";
                  }
                  | {
                      bankId?: string;
                      sourceLedgerAccountId?: string;
                      type: "US_INSTANT";
                      vendorId?: string;
                  }
                  | {
                      bankId?: string;
                      drawdownId: string;
                      sourceAccountId: string;
                      type: "US_WIRE_DRAWDOWN";
                      vendorId?: string;
                  }
                  | null;
                  methodId: | "ACH_CREDIT"
                  | "ACH_DEBIT"
                  | "BLOCKCHAIN"
                  | "MX_SPEI"
                  | "US_WIRE_DRAWDOWN"
                  | "US_INSTANT"
                  | "SWIFT_WIRE"
                  | "US_WIRE"
                  | "AF_WITHDRAWAL";
                  paymentInstrumentId: string;
                  productQuoteId: string;
                  providerQuoteId: string
                  | null;
                  sourceAmount: BigNumber;
                  sourceAmountAfterFees: BigNumber;
                  sourceCurrency: string;
                  status: "ACTIVE" | "ACCEPTED" | "REJECTED" | "EXPIRED";
                  targetAmount: BigNumber;
                  targetAmountAfterFees: BigNumber;
                  targetCurrency: string;
                  unsignedWithdrawalTransaction: string | null;
                  updatedAt: Date;
                  walletAddress: Address;
                  walletBlockchain: string;
              }
              | null;
          },
      >

    • Clear each customer's membership tag and each record tag wherever cached, and always this namespace's collection tag. keys are exact deletes in this instance's key space: the only bust a null client honours.

      Parameters

      • __namedParameters: {
            customerIds: readonly string[];
            keys?: readonly CacheKey[];
            records?: readonly string[];
        }

      Returns Promise<void>

    • Bust after a quote write: the quote's pages and its withdrawal's.

      Parameters

      • __namedParameters: { customerIds: readonly string[]; keys: readonly CacheKey[] }

      Returns Promise<void>

    • Admin search for withdrawal quotes without customer restriction. Reads through the withdrawal-quote-search cache, except under a caller's tx.

      Parameters

      • __namedParameters: WithdrawalQuoteAdminSearchArgs

      Returns Promise<{ ok: true; value: WithdrawalQuoteAdminSearchPage }>

    • Tags for a page: the scope its query searched (each customer's membership tag, else the collection tag), so an empty page is bustable too, plus the records it projects and the fields that chose or ordered its rows.

      Parameters

      • __namedParameters: {
            customerIds: readonly string[] | undefined;
            fields?: readonly string[];
            records?: readonly string[];
        }

      Returns string[]

    • The key WithdrawalQuoteAdminQueryService.get reads through.

      Parameters

      • __namedParameters: { id: string }

      Returns CacheKey

    • The key WithdrawalQuoteQueryService.get reads through.

      Parameters

      • __namedParameters: { customerId: string; id: string }

      Returns CacheKey