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

    Hierarchy (View Summary)

    Index
    db: B2bDatabase
    • Get a withdrawal by ID without customer restriction

      Parameters

      • __namedParameters: {
            customerId: string;
            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: "PROVIDER"
                          | "CFX"
                          | "CUSTOMER";
                          type: "FIXED" | "VARIABLE";
                      } & { currency: "USDC"
                      | "MOVEUSD" }
                  )[];
                  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";
                      vendorId?: string;
                  }
                  | {
                      achId: string;
                      bankId?: string;
                      sourceLedgerAccountId?: string;
                      type: "ACH_PULL";
                      vendorId?: string;
                  }
                  | {
                      bankId?: string;
                      beneficiaryReference?: string;
                      purpose: WireWithdrawalPurpose;
                      senderMessage?: string;
                      sourceLedgerAccountId: string;
                      type: "SWIFT_WIRE"
                      | "US_WIRE";
                      vendorId?: string;
                      wireBatchId?: string;
                  }
                  | {
                      country: string;
                      type: "AF_WITHDRAWAL";
                      withdrawalType: "bank"
                      | "momo";
                  }
                  | { 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_PULL"
                  | "AF_WITHDRAWAL"
                  | "BLOCKCHAIN"
                  | "MX_SPEI"
                  | "SWIFT_WIRE"
                  | "US_ACH"
                  | "US_INSTANT"
                  | "US_WIRE"
                  | "US_WIRE_DRAWDOWN";
                  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;
              }
              | null;
          },
      >

    • Admin search for withdrawals without customer restriction

      Parameters

      • __namedParameters: {
            createdAt?: DbTimestampCriteria;
            customerId: string;
            entityId?: string;
            id?: string[];
            idempotencyKeys?: string[];
            methodId?: (
                | "ACH_PULL"
                | "AF_WITHDRAWAL"
                | "BLOCKCHAIN"
                | "MX_SPEI"
                | "SWIFT_WIRE"
                | "US_ACH"
                | "US_INSTANT"
                | "US_WIRE"
                | "US_WIRE_DRAWDOWN"
            )[];
            orderBy?: DbOrderByCriterion<
                Omit<
                    PgTableWithColumns<
                        {
                            columns: {
                                createdAt: PgBuildColumn<
                                    "withdrawal_quote",
                                    SetHasDefault<SetNotNull<(...)>>,
                                    {
                                        data: Date;
                                        dataType: "object date";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: true;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                customerId: PgBuildColumn<
                                    "withdrawal_quote",
                                    SetNotNull<PgIntegerBuilder>,
                                    {
                                        data: number;
                                        dataType: "number int32";
                                        driverParam: (...) | (...);
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                deviceIpAddress: PgBuildColumn<
                                    "withdrawal_quote",
                                    PgTextBuilder<[(...), ...(...)[]]>,
                                    {
                                        data: string;
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: false;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                deviceLocation: PgBuildColumn<
                                    "withdrawal_quote",
                                    Set$Type<PgJsonbBuilder, { lat: ...; long: ...; source: ... }>,
                                    {
                                        data: { lat: ...; long: ...; source: ... };
                                        dataType: "object json";
                                        driverParam: unknown;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: false;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                expiresAt: PgBuildColumn<
                                    "withdrawal_quote",
                                    SetNotNull<PgTimestampBuilder>,
                                    {
                                        data: Date;
                                        dataType: "object date";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                externalId: PgBuildColumn<
                                    "withdrawal_quote",
                                    SetHasRuntimeDefault<SetNotNull<(...)>>,
                                    {
                                        data: string;
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: true;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                fees: PgBuildColumn<
                                    "withdrawal_quote",
                                    Set$Type<SetHasDefault<(...)>, (...)[]>,
                                    {
                                        data: (...)[];
                                        dataType: "object json";
                                        driverParam: unknown;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: true;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                id: PgBuildColumn<
                                    "withdrawal_quote",
                                    HasIdentity<SetIsPrimaryKey<(...)>, "byDefault">,
                                    {
                                        data: number;
                                        dataType: "number int32";
                                        driverParam: (...) | (...);
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: true;
                                        hasRuntimeDefault: false;
                                        identity: "byDefault";
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                idempotencyKey: PgBuildColumn<
                                    "withdrawal_quote",
                                    PgTextBuilder<[(...), ...(...)[]]>,
                                    {
                                        data: string;
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: false;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                identityId: PgBuildColumn<
                                    "withdrawal_quote",
                                    PgIntegerBuilder,
                                    {
                                        data: number;
                                        dataType: "number int32";
                                        driverParam: (...)
                                        | (...);
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: false;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                metadata: PgBuildColumn<
                                    "withdrawal_quote",
                                    Set$Type<SetHasDefault<(...)>, { brand?: ...; marketing?: ... }>,
                                    {
                                        data: { brand?: ...; marketing?: ... };
                                        dataType: "object json";
                                        driverParam: unknown;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: true;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                methodData: PgBuildColumn<
                                    "withdrawal_quote",
                                    Set$Type<
                                        PgJsonbBuilder,
                                        (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...)
                                        | (...),
                                    >,
                                    {
                                        data: (...) | (...) | (...) | (...) | (...) | (...) | (...);
                                        dataType: "object json";
                                        driverParam: unknown;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: false;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                methodId: PgBuildColumn<
                                    "withdrawal_quote",
                                    Set$Type<
                                        SetNotNull<(...)>,

                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...),
                                    >,
                                    {
                                        data:
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...);
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                organizationId: PgBuildColumn<
                                    "withdrawal_quote",
                                    PgIntegerBuilder,
                                    {
                                        data: number;
                                        dataType: "number int32";
                                        driverParam: (...)
                                        | (...);
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: false;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                paymentInstrumentId: PgBuildColumn<
                                    "withdrawal_quote",
                                    SetNotNull<PgIntegerBuilder>,
                                    {
                                        data: number;
                                        dataType: "number int32";
                                        driverParam: (...) | (...);
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                productQuoteId: PgBuildColumn<
                                    "withdrawal_quote",
                                    SetNotNull<PgIntegerBuilder>,
                                    {
                                        data: number;
                                        dataType: "number int32";
                                        driverParam: (...) | (...);
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                providerQuoteId: PgBuildColumn<
                                    "withdrawal_quote",
                                    PgTextBuilder<[(...), ...(...)[]]>,
                                    {
                                        data: string;
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: false;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                sourceAmount: PgBuildColumn<
                                    "withdrawal_quote",
                                    SetNotNull<PgNumericBuilder>,
                                    {
                                        data: string;
                                        dataType: "string numeric";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                sourceAmountAfterFees: PgBuildColumn<
                                    "withdrawal_quote",
                                    SetNotNull<PgNumericBuilder>,
                                    {
                                        data: string;
                                        dataType: "string numeric";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                sourceCurrency: PgBuildColumn<
                                    "withdrawal_quote",
                                    SetNotNull<PgTextBuilder<(...)>>,
                                    {
                                        data: string;
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                status: PgBuildColumn<
                                    "withdrawal_quote",
                                    Set$Type<SetNotNull<(...)>, (...) | (...) | (...) | (...)>,
                                    {
                                        data: (...) | (...) | (...) | (...);
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                targetAmount: PgBuildColumn<
                                    "withdrawal_quote",
                                    SetNotNull<PgNumericBuilder>,
                                    {
                                        data: string;
                                        dataType: "string numeric";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                targetAmountAfterFees: PgBuildColumn<
                                    "withdrawal_quote",
                                    SetNotNull<PgNumericBuilder>,
                                    {
                                        data: string;
                                        dataType: "string numeric";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                targetCurrency: PgBuildColumn<
                                    "withdrawal_quote",
                                    SetNotNull<PgTextBuilder<(...)>>,
                                    {
                                        data: string;
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                unsignedWithdrawalTransaction: PgBuildColumn<
                                    "withdrawal_quote",
                                    SetNotNull<PgTextBuilder<(...)>>,
                                    {
                                        data: string;
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                updatedAt: PgBuildColumn<
                                    "withdrawal_quote",
                                    SetHasDefault<SetHasDefault<(...)>>,
                                    {
                                        data: Date;
                                        dataType: "object date";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: true;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                walletAddress: PgBuildColumn<
                                    "withdrawal_quote",
                                    SetNotNull<PgTextBuilder<(...)>>,
                                    {
                                        data: string;
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                                walletChainId: PgBuildColumn<
                                    "withdrawal_quote",
                                    SetNotNull<PgIntegerBuilder>,
                                    {
                                        data: number;
                                        dataType: "number int32";
                                        driverParam: (...) | (...);
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "withdrawal_quote";
                                    },
                                >;
                            };
                            dialect: "pg";
                            name: "withdrawal_quote";
                            schema: "b2b";
                        },
                    >,
                    "enableRLS",
                >,
                "createdAt"
                | "updatedAt",
            >[];
            page?: number;
            pageSize?: number;
            providerQuoteId?: string[];
            status?: ("ACTIVE" | "ACCEPTED" | "EXPIRED" | "REJECTED")[];
            tx?: PgAsyncTransaction<NodePgQueryResultHKT, EmptyRelations>;
            updatedAt?: DbTimestampCriteria;
        }
        • OptionalcreatedAt?: DbTimestampCriteria
        • customerId: string
        • OptionalentityId?: string
        • Optionalid?: string[]
        • OptionalidempotencyKeys?: string[]

          Caller-supplied idempotency keys (dedup lookup). Filters the raw withdrawal_quote.idempotency_key column — the key is not projected onto the returned WithdrawalQuote.

        • OptionalmethodId?: (
              | "ACH_PULL"
              | "AF_WITHDRAWAL"
              | "BLOCKCHAIN"
              | "MX_SPEI"
              | "SWIFT_WIRE"
              | "US_ACH"
              | "US_INSTANT"
              | "US_WIRE"
              | "US_WIRE_DRAWDOWN"
          )[]
        • OptionalorderBy?: DbOrderByCriterion<
              Omit<
                  PgTableWithColumns<
                      {
                          columns: {
                              createdAt: PgBuildColumn<
                                  "withdrawal_quote",
                                  SetHasDefault<SetNotNull<(...)>>,
                                  {
                                      data: Date;
                                      dataType: "object date";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: true;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              customerId: PgBuildColumn<
                                  "withdrawal_quote",
                                  SetNotNull<PgIntegerBuilder>,
                                  {
                                      data: number;
                                      dataType: "number int32";
                                      driverParam: (...) | (...);
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              deviceIpAddress: PgBuildColumn<
                                  "withdrawal_quote",
                                  PgTextBuilder<[(...), ...(...)[]]>,
                                  {
                                      data: string;
                                      dataType: "string";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: false;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              deviceLocation: PgBuildColumn<
                                  "withdrawal_quote",
                                  Set$Type<PgJsonbBuilder, { lat: ...; long: ...; source: ... }>,
                                  {
                                      data: { lat: ...; long: ...; source: ... };
                                      dataType: "object json";
                                      driverParam: unknown;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: false;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              expiresAt: PgBuildColumn<
                                  "withdrawal_quote",
                                  SetNotNull<PgTimestampBuilder>,
                                  {
                                      data: Date;
                                      dataType: "object date";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              externalId: PgBuildColumn<
                                  "withdrawal_quote",
                                  SetHasRuntimeDefault<SetNotNull<(...)>>,
                                  {
                                      data: string;
                                      dataType: "string";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: true;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              fees: PgBuildColumn<
                                  "withdrawal_quote",
                                  Set$Type<SetHasDefault<(...)>, (...)[]>,
                                  {
                                      data: (...)[];
                                      dataType: "object json";
                                      driverParam: unknown;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: true;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              id: PgBuildColumn<
                                  "withdrawal_quote",
                                  HasIdentity<SetIsPrimaryKey<(...)>, "byDefault">,
                                  {
                                      data: number;
                                      dataType: "number int32";
                                      driverParam: (...) | (...);
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: true;
                                      hasRuntimeDefault: false;
                                      identity: "byDefault";
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              idempotencyKey: PgBuildColumn<
                                  "withdrawal_quote",
                                  PgTextBuilder<[(...), ...(...)[]]>,
                                  {
                                      data: string;
                                      dataType: "string";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: false;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              identityId: PgBuildColumn<
                                  "withdrawal_quote",
                                  PgIntegerBuilder,
                                  {
                                      data: number;
                                      dataType: "number int32";
                                      driverParam: (...)
                                      | (...);
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: false;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              metadata: PgBuildColumn<
                                  "withdrawal_quote",
                                  Set$Type<SetHasDefault<(...)>, { brand?: ...; marketing?: ... }>,
                                  {
                                      data: { brand?: ...; marketing?: ... };
                                      dataType: "object json";
                                      driverParam: unknown;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: true;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              methodData: PgBuildColumn<
                                  "withdrawal_quote",
                                  Set$Type<
                                      PgJsonbBuilder,
                                      (...)
                                      | (...)
                                      | (...)
                                      | (...)
                                      | (...)
                                      | (...)
                                      | (...),
                                  >,
                                  {
                                      data: (...) | (...) | (...) | (...) | (...) | (...) | (...);
                                      dataType: "object json";
                                      driverParam: unknown;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: false;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              methodId: PgBuildColumn<
                                  "withdrawal_quote",
                                  Set$Type<
                                      SetNotNull<(...)>,
                                      (...) | (...) | (...) | (...) | (...) | (...) | (...) | (...) | (...),
                                  >,
                                  {
                                      data:
                                          | (...)
                                          | (...)
                                          | (...)
                                          | (...)
                                          | (...)
                                          | (...)
                                          | (...)
                                          | (...)
                                          | (...);
                                      dataType: "string";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              organizationId: PgBuildColumn<
                                  "withdrawal_quote",
                                  PgIntegerBuilder,
                                  {
                                      data: number;
                                      dataType: "number int32";
                                      driverParam: (...)
                                      | (...);
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: false;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              paymentInstrumentId: PgBuildColumn<
                                  "withdrawal_quote",
                                  SetNotNull<PgIntegerBuilder>,
                                  {
                                      data: number;
                                      dataType: "number int32";
                                      driverParam: (...) | (...);
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              productQuoteId: PgBuildColumn<
                                  "withdrawal_quote",
                                  SetNotNull<PgIntegerBuilder>,
                                  {
                                      data: number;
                                      dataType: "number int32";
                                      driverParam: (...) | (...);
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              providerQuoteId: PgBuildColumn<
                                  "withdrawal_quote",
                                  PgTextBuilder<[(...), ...(...)[]]>,
                                  {
                                      data: string;
                                      dataType: "string";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: false;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              sourceAmount: PgBuildColumn<
                                  "withdrawal_quote",
                                  SetNotNull<PgNumericBuilder>,
                                  {
                                      data: string;
                                      dataType: "string numeric";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              sourceAmountAfterFees: PgBuildColumn<
                                  "withdrawal_quote",
                                  SetNotNull<PgNumericBuilder>,
                                  {
                                      data: string;
                                      dataType: "string numeric";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              sourceCurrency: PgBuildColumn<
                                  "withdrawal_quote",
                                  SetNotNull<PgTextBuilder<(...)>>,
                                  {
                                      data: string;
                                      dataType: "string";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              status: PgBuildColumn<
                                  "withdrawal_quote",
                                  Set$Type<SetNotNull<(...)>, (...) | (...) | (...) | (...)>,
                                  {
                                      data: (...) | (...) | (...) | (...);
                                      dataType: "string";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              targetAmount: PgBuildColumn<
                                  "withdrawal_quote",
                                  SetNotNull<PgNumericBuilder>,
                                  {
                                      data: string;
                                      dataType: "string numeric";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              targetAmountAfterFees: PgBuildColumn<
                                  "withdrawal_quote",
                                  SetNotNull<PgNumericBuilder>,
                                  {
                                      data: string;
                                      dataType: "string numeric";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              targetCurrency: PgBuildColumn<
                                  "withdrawal_quote",
                                  SetNotNull<PgTextBuilder<(...)>>,
                                  {
                                      data: string;
                                      dataType: "string";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              unsignedWithdrawalTransaction: PgBuildColumn<
                                  "withdrawal_quote",
                                  SetNotNull<PgTextBuilder<(...)>>,
                                  {
                                      data: string;
                                      dataType: "string";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              updatedAt: PgBuildColumn<
                                  "withdrawal_quote",
                                  SetHasDefault<SetHasDefault<(...)>>,
                                  {
                                      data: Date;
                                      dataType: "object date";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: true;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              walletAddress: PgBuildColumn<
                                  "withdrawal_quote",
                                  SetNotNull<PgTextBuilder<(...)>>,
                                  {
                                      data: string;
                                      dataType: "string";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                              walletChainId: PgBuildColumn<
                                  "withdrawal_quote",
                                  SetNotNull<PgIntegerBuilder>,
                                  {
                                      data: number;
                                      dataType: "number int32";
                                      driverParam: (...) | (...);
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "withdrawal_quote";
                                  },
                              >;
                          };
                          dialect: "pg";
                          name: "withdrawal_quote";
                          schema: "b2b";
                      },
                  >,
                  "enableRLS",
              >,
              "createdAt"
              | "updatedAt",
          >[]
        • Optionalpage?: number
        • OptionalpageSize?: number
        • OptionalproviderQuoteId?: string[]
        • Optionalstatus?: ("ACTIVE" | "ACCEPTED" | "EXPIRED" | "REJECTED")[]
        • Optionaltx?: PgAsyncTransaction<NodePgQueryResultHKT, EmptyRelations>
        • OptionalupdatedAt?: DbTimestampCriteria

      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: "PROVIDER"
                          | "CFX"
                          | "CUSTOMER";
                          type: "FIXED" | "VARIABLE";
                      } & { currency: "USDC"
                      | "MOVEUSD" }
                  )[];
                  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";
                      vendorId?: string;
                  }
                  | {
                      achId: string;
                      bankId?: string;
                      sourceLedgerAccountId?: string;
                      type: "ACH_PULL";
                      vendorId?: string;
                  }
                  | {
                      bankId?: string;
                      beneficiaryReference?: string;
                      purpose: WireWithdrawalPurpose;
                      senderMessage?: string;
                      sourceLedgerAccountId: string;
                      type: "SWIFT_WIRE"
                      | "US_WIRE";
                      vendorId?: string;
                      wireBatchId?: string;
                  }
                  | {
                      country: string;
                      type: "AF_WITHDRAWAL";
                      withdrawalType: "bank"
                      | "momo";
                  }
                  | { 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_PULL"
                  | "AF_WITHDRAWAL"
                  | "BLOCKCHAIN"
                  | "MX_SPEI"
                  | "SWIFT_WIRE"
                  | "US_ACH"
                  | "US_INSTANT"
                  | "US_WIRE"
                  | "US_WIRE_DRAWDOWN";
                  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;
              }[];
          },
      >