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

    Cross-customer queries and instrument type-agnostic admin actions

    Hierarchy (View Summary)

    Index
    cache: ServiceCache<CachedSearchPage<PaymentInstrumentSearchItem>>
    db: B2bDatabase
    instance: (...args: []) => PaymentInstrumentAdminService = ...

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

    • Push an operator's beneficiary decision to AiPrise, then write its status: the RESULT_UPDATE webhook leaves a BLOCKED instrument alone, so an operator's approval would otherwise never unblock it. A caller that already read the live row passes both verificationProfileId and beneficiaryType to skip the re-read.

      Parameters

      • __namedParameters: { decision: "APPROVED" | "DECLINED"; id: string; reasonCode?: string } & (
            | { beneficiaryType?: undefined; verificationProfileId?: undefined }
            | { beneficiaryType: "BUSINESS" | "PERSON"; verificationProfileId: string }
        )
        • decision: "APPROVED" | "DECLINED"
        • id: string
        • OptionalreasonCode?: string

          Sent for a PERSON beneficiary only; AiPrise business results take none.

        • { beneficiaryType?: undefined; verificationProfileId?: undefined }
        • { beneficiaryType: "BUSINESS" | "PERSON"; verificationProfileId: string }

      Returns Promise<
          | { ok: true; value: { verificationProfileId: string } }
          | { error: ServiceError; ok: false },
      >

    • Get instrument by ID or reference ID

      It can be further narrowed down by type, customer ID and entity ID.

      Parameters

      • __namedParameters: {
            customerId?: string;
            deleted?: boolean;
            entityId?: string;
            type?:
                | "AF_BANK"
                | "AF_MOMO"
                | "EXTERNAL_US_ACH"
                | "MX_CLABE"
                | "NETWORK_WALLET"
                | "PHONE"
                | "SWIFT_WIRE"
                | "US_ACH"
                | "US_WIRE"
                | "US_INSTANT"
                | "WALLET";
        } & ({ id: string } | { referenceId: string })

      Returns Promise<{ ok: true; value: PaymentInstrumentSearchItem | null }>

    • Also clears payment-instrument.text. Every writer busts by customer alone, which reaches no field tag, yet each write may change the text a cached transaction q page matched on.

      Parameters

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

      Returns Promise<void>

    • Parameters

      • __namedParameters: {
            anyFieldLike?: string;
            bankIds?: string[];
            createdAt?: DbTimestampCriteria;
            customerIds?: string[];
            deleted?: boolean;
            entityIds?: string[];
            ids?: string[];
            linked?: boolean;
            nameLike?: string;
            nominisWalletScreenRequestIds?: string[];
            orderBy?: DbOrderByCriterion<
                Omit<
                    PgTableWithColumns<
                        {
                            columns: {
                                accountHolderName: PgBuildColumn<
                                    "payment_instrument",
                                    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: "payment_instrument";
                                    },
                                >;
                                accountName: PgBuildColumn<
                                    "payment_instrument",
                                    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: "payment_instrument";
                                    },
                                >;
                                beneficiaryName: PgBuildColumn<
                                    "payment_instrument",
                                    SetHasGenerated<PgTextBuilder<(...)>>,
                                    {
                                        data: string;
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: true;
                                        hasDefault: true;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: false;
                                        tableName: "payment_instrument";
                                    },
                                >;
                                createdAt: PgBuildColumn<
                                    "payment_instrument",
                                    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: "payment_instrument";
                                    },
                                >;
                                customerExternalId: PgBuildColumn<
                                    "payment_instrument",
                                    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: "payment_instrument";
                                    },
                                >;
                                customerId: PgBuildColumn<
                                    "payment_instrument",
                                    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: "payment_instrument";
                                    },
                                >;
                                deletedAt: PgBuildColumn<
                                    "payment_instrument",
                                    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: false;
                                        tableName: "payment_instrument";
                                    },
                                >;
                                externalId: PgBuildColumn<
                                    "payment_instrument",
                                    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: "payment_instrument";
                                    },
                                >;
                                id: PgBuildColumn<
                                    "payment_instrument",
                                    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: "payment_instrument";
                                    },
                                >;
                                identityExternalId: PgBuildColumn<
                                    "payment_instrument",
                                    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: "payment_instrument";
                                    },
                                >;
                                identityId: PgBuildColumn<
                                    "payment_instrument",
                                    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: "payment_instrument";
                                    },
                                >;
                                instrumentData: PgBuildColumn<
                                    "payment_instrument",
                                    SetNotNull<PgJsonbBuilder>,
                                    {
                                        data: unknown;
                                        dataType: "object json";
                                        driverParam: unknown;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "payment_instrument";
                                    },
                                >;
                                linkedLedgerAccountId: PgBuildColumn<
                                    "payment_instrument",
                                    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: "payment_instrument";
                                    },
                                >;
                                organizationExternalId: PgBuildColumn<
                                    "payment_instrument",
                                    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: "payment_instrument";
                                    },
                                >;
                                organizationId: PgBuildColumn<
                                    "payment_instrument",
                                    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: "payment_instrument";
                                    },
                                >;
                                provider: PgBuildColumn<
                                    "payment_instrument",
                                    SetNotNull<Set$Type<(...), (...)>>,
                                    {
                                        data:
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...)
                                            | (...);
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "payment_instrument";
                                    },
                                >;
                                providerId: PgBuildColumn<
                                    "payment_instrument",
                                    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: "payment_instrument";
                                    },
                                >;
                                referenceId: PgBuildColumn<
                                    "payment_instrument",
                                    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: "payment_instrument";
                                    },
                                >;
                                searchDocument: PgBuildColumn<
                                    "payment_instrument",
                                    SetHasGenerated<SetNotNull<(...)>>,
                                    {
                                        data: string;
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: true;
                                        hasDefault: true;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "payment_instrument";
                                    },
                                >;
                                searchDocumentAdmin: PgBuildColumn<
                                    "payment_instrument",
                                    SetHasGenerated<SetNotNull<(...)>>,
                                    {
                                        data: string;
                                        dataType: "string";
                                        driverParam: string;
                                        enumValues: undefined;
                                        generated: true;
                                        hasDefault: true;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "payment_instrument";
                                    },
                                >;
                                sendEnabled: PgBuildColumn<
                                    "payment_instrument",
                                    SetNotNull<PgBooleanBuilder>,
                                    {
                                        data: boolean;
                                        dataType: "boolean";
                                        driverParam: boolean;
                                        enumValues: undefined;
                                        generated: undefined;
                                        hasDefault: false;
                                        hasRuntimeDefault: false;
                                        identity: undefined;
                                        isAutoincrement: false;
                                        isPrimaryKey: false;
                                        name: string;
                                        notNull: true;
                                        tableName: "payment_instrument";
                                    },
                                >;
                                status: PgBuildColumn<
                                    "payment_instrument",
                                    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: "payment_instrument";
                                    },
                                >;
                                type: PgBuildColumn<
                                    "payment_instrument",
                                    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: "payment_instrument";
                                    },
                                >;
                                updatedAt: PgBuildColumn<
                                    "payment_instrument",
                                    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: "payment_instrument";
                                    },
                                >;
                                verificationProfileId: PgBuildColumn<
                                    "payment_instrument",
                                    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: "payment_instrument";
                                    },
                                >;
                            };
                            dialect: "pg";
                            isAlias: false;
                            name: "payment_instrument";
                            schema: "b2b";
                        },
                    >,
                    "enableRLS",
                >,
                "createdAt"
                | "updatedAt",
            >[];
            page?: number;
            pageSize?: number | null;
            partialText?: string;
            providerIds?: string[];
            providers?: (
                | "MX_CLABE"
                | `chn_${string}`
                | "LEDGER_ACCOUNT"
                | "WIRE_DEPOSIT"
                | "ACH_PUSH_DEPOSIT"
                | "YELLOWCARD"
                | "QUILTT"
                | "VICTOR"
                | "CFX"
            )[];
            quilttConnectionIds?: string[];
            referenceIdLike?: string;
            referenceIds?: string[];
            statuses?: (
                | "DELETED"
                | "PENDING_VERIFICATION"
                | "ACTION_REQUIRED"
                | "APPROVED"
                | "BLOCKED"
            )[];
            tx?: PgAsyncTransaction<NodePgQueryResultHKT, EmptyRelations>;
            types?: (
                | "AF_BANK"
                | "AF_MOMO"
                | "EXTERNAL_US_ACH"
                | "MX_CLABE"
                | "NETWORK_WALLET"
                | "PHONE"
                | "SWIFT_WIRE"
                | "US_ACH"
                | "US_WIRE"
                | "US_INSTANT"
                | "WALLET"
            )[];
            updatedAt?: DbTimestampCriteria;
            verificationProfileIds?: string[];
        }
        • OptionalanyFieldLike?: string

          Unscoped partial match over every instrumentData value — reaches fields no type map lists (account numbers, bank names), at the cost of a scan. Admin-only; this is what the admin surface used to expose under the name partialText.

        • OptionalbankIds?: string[]

          Instruments used in a deposit or withdrawal at one of these banks: a per-row check, so a search with it is not cached (no write to a transaction busts this cache).

        • OptionalcreatedAt?: DbTimestampCriteria
        • OptionalcustomerIds?: string[]
        • Optionaldeleted?: boolean
        • OptionalentityIds?: string[]
        • Optionalids?: string[]
        • Optionallinked?: boolean

          PHONE recipients with (true) or still without (false) a linked ledger account.

        • OptionalnameLike?: string

          Partial match over the requested types' name-ish fields. Requires types.

        • OptionalnominisWalletScreenRequestIds?: string[]
        • OptionalorderBy?: DbOrderByCriterion<
              Omit<
                  PgTableWithColumns<
                      {
                          columns: {
                              accountHolderName: PgBuildColumn<
                                  "payment_instrument",
                                  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: "payment_instrument";
                                  },
                              >;
                              accountName: PgBuildColumn<
                                  "payment_instrument",
                                  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: "payment_instrument";
                                  },
                              >;
                              beneficiaryName: PgBuildColumn<
                                  "payment_instrument",
                                  SetHasGenerated<PgTextBuilder<(...)>>,
                                  {
                                      data: string;
                                      dataType: "string";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: true;
                                      hasDefault: true;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: false;
                                      tableName: "payment_instrument";
                                  },
                              >;
                              createdAt: PgBuildColumn<
                                  "payment_instrument",
                                  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: "payment_instrument";
                                  },
                              >;
                              customerExternalId: PgBuildColumn<
                                  "payment_instrument",
                                  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: "payment_instrument";
                                  },
                              >;
                              customerId: PgBuildColumn<
                                  "payment_instrument",
                                  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: "payment_instrument";
                                  },
                              >;
                              deletedAt: PgBuildColumn<
                                  "payment_instrument",
                                  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: false;
                                      tableName: "payment_instrument";
                                  },
                              >;
                              externalId: PgBuildColumn<
                                  "payment_instrument",
                                  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: "payment_instrument";
                                  },
                              >;
                              id: PgBuildColumn<
                                  "payment_instrument",
                                  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: "payment_instrument";
                                  },
                              >;
                              identityExternalId: PgBuildColumn<
                                  "payment_instrument",
                                  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: "payment_instrument";
                                  },
                              >;
                              identityId: PgBuildColumn<
                                  "payment_instrument",
                                  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: "payment_instrument";
                                  },
                              >;
                              instrumentData: PgBuildColumn<
                                  "payment_instrument",
                                  SetNotNull<PgJsonbBuilder>,
                                  {
                                      data: unknown;
                                      dataType: "object json";
                                      driverParam: unknown;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "payment_instrument";
                                  },
                              >;
                              linkedLedgerAccountId: PgBuildColumn<
                                  "payment_instrument",
                                  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: "payment_instrument";
                                  },
                              >;
                              organizationExternalId: PgBuildColumn<
                                  "payment_instrument",
                                  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: "payment_instrument";
                                  },
                              >;
                              organizationId: PgBuildColumn<
                                  "payment_instrument",
                                  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: "payment_instrument";
                                  },
                              >;
                              provider: PgBuildColumn<
                                  "payment_instrument",
                                  SetNotNull<Set$Type<(...), (...)>>,
                                  {
                                      data:
                                          | (...)
                                          | (...)
                                          | (...)
                                          | (...)
                                          | (...)
                                          | (...)
                                          | (...)
                                          | (...)
                                          | (...);
                                      dataType: "string";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "payment_instrument";
                                  },
                              >;
                              providerId: PgBuildColumn<
                                  "payment_instrument",
                                  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: "payment_instrument";
                                  },
                              >;
                              referenceId: PgBuildColumn<
                                  "payment_instrument",
                                  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: "payment_instrument";
                                  },
                              >;
                              searchDocument: PgBuildColumn<
                                  "payment_instrument",
                                  SetHasGenerated<SetNotNull<(...)>>,
                                  {
                                      data: string;
                                      dataType: "string";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: true;
                                      hasDefault: true;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "payment_instrument";
                                  },
                              >;
                              searchDocumentAdmin: PgBuildColumn<
                                  "payment_instrument",
                                  SetHasGenerated<SetNotNull<(...)>>,
                                  {
                                      data: string;
                                      dataType: "string";
                                      driverParam: string;
                                      enumValues: undefined;
                                      generated: true;
                                      hasDefault: true;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "payment_instrument";
                                  },
                              >;
                              sendEnabled: PgBuildColumn<
                                  "payment_instrument",
                                  SetNotNull<PgBooleanBuilder>,
                                  {
                                      data: boolean;
                                      dataType: "boolean";
                                      driverParam: boolean;
                                      enumValues: undefined;
                                      generated: undefined;
                                      hasDefault: false;
                                      hasRuntimeDefault: false;
                                      identity: undefined;
                                      isAutoincrement: false;
                                      isPrimaryKey: false;
                                      name: string;
                                      notNull: true;
                                      tableName: "payment_instrument";
                                  },
                              >;
                              status: PgBuildColumn<
                                  "payment_instrument",
                                  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: "payment_instrument";
                                  },
                              >;
                              type: PgBuildColumn<
                                  "payment_instrument",
                                  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: "payment_instrument";
                                  },
                              >;
                              updatedAt: PgBuildColumn<
                                  "payment_instrument",
                                  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: "payment_instrument";
                                  },
                              >;
                              verificationProfileId: PgBuildColumn<
                                  "payment_instrument",
                                  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: "payment_instrument";
                                  },
                              >;
                          };
                          dialect: "pg";
                          isAlias: false;
                          name: "payment_instrument";
                          schema: "b2b";
                      },
                  >,
                  "enableRLS",
              >,
              "createdAt"
              | "updatedAt",
          >[]

          Ties break on the row id, in the last criterion's direction.

        • Optionalpage?: number

          Defaults to 1

        • OptionalpageSize?: number | null

          Defaults to 10. null for no limit

        • OptionalpartialText?: string

          Partial match over referenceId plus each requested type's searchable fields. Requires types. Same filter, same meaning as the consumer surface's — see internal/search.ts.

        • OptionalproviderIds?: string[]

          Provider-side account identifier. The blacklist is keyed on this, so block / unblock read their affected rows through here rather than running a bespoke query.

        • Optionalproviders?: (
              | "MX_CLABE"
              | `chn_${string}`
              | "LEDGER_ACCOUNT"
              | "WIRE_DEPOSIT"
              | "ACH_PUSH_DEPOSIT"
              | "YELLOWCARD"
              | "QUILTT"
              | "VICTOR"
              | "CFX"
          )[]
        • OptionalquilttConnectionIds?: string[]
        • OptionalreferenceIdLike?: string

          Partial match over the nickname: name on wallets, referenceId otherwise. Requires types.

        • OptionalreferenceIds?: string[]
        • Optionalstatuses?: (
              | "DELETED"
              | "PENDING_VERIFICATION"
              | "ACTION_REQUIRED"
              | "APPROVED"
              | "BLOCKED"
          )[]
        • Optionaltx?: PgAsyncTransaction<NodePgQueryResultHKT, EmptyRelations>
        • Optionaltypes?: (
              | "AF_BANK"
              | "AF_MOMO"
              | "EXTERNAL_US_ACH"
              | "MX_CLABE"
              | "NETWORK_WALLET"
              | "PHONE"
              | "SWIFT_WIRE"
              | "US_ACH"
              | "US_WIRE"
              | "US_INSTANT"
              | "WALLET"
          )[]
        • OptionalupdatedAt?: DbTimestampCriteria
        • OptionalverificationProfileIds?: string[]

          Instruments holding one of these AiPrise profiles as their beneficiary's.

      Returns Promise<
          {
              ok: true;
              value: {
                  hasNext: boolean;
                  items: PaymentInstrumentSearchItem[];
                  total: number;
              };
          },
      >

    • 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[]

    • Update an existing instrument, looked up by ID or reference ID.

      It can be further narrowed down by type, customer ID and entity ID.

      Parameters

      • __namedParameters: {
            customerId?: string;
            data: {
                nominisWalletScreen?: {
                    data?: {
                        data?: {
                            activity?: (...)[];
                            address_data?: {
                                address?: ...;
                                chain?: ...;
                                classification?: ...;
                                first_funded_by?: ...;
                                first_tx?: ...;
                                last_tx?: ...;
                                name?: ...;
                                risk_factors?: ...;
                                total_in?: ...;
                                total_out?: ...;
                            };
                            asset_distribution_in?: (...)[];
                            asset_distribution_out?: (...)[];
                            balance?: (...)[];
                            depth?: number;
                            destination_of_funds?: (...)[];
                            exposure?: (...)[];
                            geoint?: (...)[];
                            intel?: (...)[];
                            risk_categories?: (...)[];
                            risk_score?: string;
                            source_of_funds?: (...)[];
                        };
                        status?: "pending"
                        | "done";
                    };
                    error?: string;
                    req_id?: string;
                    request_type?: "check_exposure";
                    status?: "ok"
                    | "fail";
                    time?: number;
                };
                referenceId?: string
                | null;
                status?:
                    | "PENDING_VERIFICATION"
                    | "ACTION_REQUIRED"
                    | "APPROVED"
                    | "BLOCKED";
                victorCounterpartyId?: string;
            };
            entityId?: string;
            type?: | "AF_BANK"
            | "AF_MOMO"
            | "EXTERNAL_US_ACH"
            | "MX_CLABE"
            | "NETWORK_WALLET"
            | "PHONE"
            | "SWIFT_WIRE"
            | "US_ACH"
            | "US_WIRE"
            | "US_INSTANT"
            | "WALLET";
        } & ({ id: string } | { referenceId: string })
        • OptionalcustomerId?: string
        • data: {
              nominisWalletScreen?: {
                  data?: {
                      data?: {
                          activity?: (...)[];
                          address_data?: {
                              address?: ...;
                              chain?: ...;
                              classification?: ...;
                              first_funded_by?: ...;
                              first_tx?: ...;
                              last_tx?: ...;
                              name?: ...;
                              risk_factors?: ...;
                              total_in?: ...;
                              total_out?: ...;
                          };
                          asset_distribution_in?: (...)[];
                          asset_distribution_out?: (...)[];
                          balance?: (...)[];
                          depth?: number;
                          destination_of_funds?: (...)[];
                          exposure?: (...)[];
                          geoint?: (...)[];
                          intel?: (...)[];
                          risk_categories?: (...)[];
                          risk_score?: string;
                          source_of_funds?: (...)[];
                      };
                      status?: "pending"
                      | "done";
                  };
                  error?: string;
                  req_id?: string;
                  request_type?: "check_exposure";
                  status?: "ok"
                  | "fail";
                  time?: number;
              };
              referenceId?: string
              | null;
              status?:
                  | "PENDING_VERIFICATION"
                  | "ACTION_REQUIRED"
                  | "APPROVED"
                  | "BLOCKED";
              victorCounterpartyId?: string;
          }

          The admin-writable slice. status is the operator action; the other two are partner-produced values that arrive out of band — a Nominis screening verdict and a Victor counterparty id — and live inside instrumentData.

          They belong here rather than on per-field setters: each is a one-line patch of the same row, and a setter apiece would duplicate the lookup, the bust and the re-read three times over.

          • OptionalnominisWalletScreen?: {
                data?: {
                    data?: {
                        activity?: (...)[];
                        address_data?: {
                            address?: ...;
                            chain?: ...;
                            classification?: ...;
                            first_funded_by?: ...;
                            first_tx?: ...;
                            last_tx?: ...;
                            name?: ...;
                            risk_factors?: ...;
                            total_in?: ...;
                            total_out?: ...;
                        };
                        asset_distribution_in?: (...)[];
                        asset_distribution_out?: (...)[];
                        balance?: (...)[];
                        depth?: number;
                        destination_of_funds?: (...)[];
                        exposure?: (...)[];
                        geoint?: (...)[];
                        intel?: (...)[];
                        risk_categories?: (...)[];
                        risk_score?: string;
                        source_of_funds?: (...)[];
                    };
                    status?: "pending"
                    | "done";
                };
                error?: string;
                req_id?: string;
                request_type?: "check_exposure";
                status?: "ok"
                | "fail";
                time?: number;
            }
            • Optionaldata?: {
                  data?: {
                      activity?: (...)[];
                      address_data?: {
                          address?: ...;
                          chain?: ...;
                          classification?: ...;
                          first_funded_by?: ...;
                          first_tx?: ...;
                          last_tx?: ...;
                          name?: ...;
                          risk_factors?: ...;
                          total_in?: ...;
                          total_out?: ...;
                      };
                      asset_distribution_in?: (...)[];
                      asset_distribution_out?: (...)[];
                      balance?: (...)[];
                      depth?: number;
                      destination_of_funds?: (...)[];
                      exposure?: (...)[];
                      geoint?: (...)[];
                      intel?: (...)[];
                      risk_categories?: (...)[];
                      risk_score?: string;
                      source_of_funds?: (...)[];
                  };
                  status?: "pending"
                  | "done";
              }
              • Optionaldata?: {
                    activity?: (...)[];
                    address_data?: {
                        address?: ...;
                        chain?: ...;
                        classification?: ...;
                        first_funded_by?: ...;
                        first_tx?: ...;
                        last_tx?: ...;
                        name?: ...;
                        risk_factors?: ...;
                        total_in?: ...;
                        total_out?: ...;
                    };
                    asset_distribution_in?: (...)[];
                    asset_distribution_out?: (...)[];
                    balance?: (...)[];
                    depth?: number;
                    destination_of_funds?: (...)[];
                    exposure?: (...)[];
                    geoint?: (...)[];
                    intel?: (...)[];
                    risk_categories?: (...)[];
                    risk_score?: string;
                    source_of_funds?: (...)[];
                }
                • Optionalactivity?: (...)[]
                • Optionaladdress_data?: {
                      address?: ...;
                      chain?: ...;
                      classification?: ...;
                      first_funded_by?: ...;
                      first_tx?: ...;
                      last_tx?: ...;
                      name?: ...;
                      risk_factors?: ...;
                      total_in?: ...;
                      total_out?: ...;
                  }
                  • Optionaladdress?: ...

                    Wallet address.

                  • Optionalchain?: ...

                    Blockchain name.

                  • Optionalclassification?: ...

                    Categories the address belongs to (e.g., exchange, scam).

                  • Optionalfirst_funded_by?: ...

                    Details on the first funding address.

                  • Optionalfirst_tx?: ...

                    Timestamp of first transaction.

                  • Optionallast_tx?: ...

                    Timestamp of most recent transaction.

                  • Optionalname?: ...

                    Detected name or label (if known).

                  • Optionalrisk_factors?: ...

                    Detected risk indicators.

                  • Optionaltotal_in?: ...

                    Format: double

                    Total assets received (native units).

                  • Optionaltotal_out?: ...

                    Format: double

                    Total assets sent (native units).

                • Optionalasset_distribution_in?: (...)[]
                • Optionalasset_distribution_out?: (...)[]
                • Optionalbalance?: (...)[]
                • Optionaldepth?: number

                  The screen depth.

                • Optionaldestination_of_funds?: (...)[]
                • Optionalexposure?: (...)[]
                • Optionalgeoint?: (...)[]
                • Optionalintel?: (...)[]
                • Optionalrisk_categories?: (...)[]
                • Optionalrisk_score?: string

                  Risk score of the address.

                • Optionalsource_of_funds?: (...)[]
              • Optionalstatus?: "pending" | "done"

                Status of the screening (pending or done).

            • Optionalerror?: string

              Error message if applicable.

            • Optionalreq_id?: string

              Format: uuid

              A unique request ID to query the screening results.

            • Optionalrequest_type?: "check_exposure"

              Type of request such as "check_exposure".

            • Optionalstatus?: "ok" | "fail"

              Status of the request, e.g., "ok".

            • Optionaltime?: number

              Format: double

              Unix timestamp of the request.

          • OptionalreferenceId?: string | null

            An operator correcting the customer's label; null clears it. Every type has one.

          • Optionalstatus?: "PENDING_VERIFICATION" | "ACTION_REQUIRED" | "APPROVED" | "BLOCKED"

            The only status writer; DELETED goes through each rail's delete.

          • OptionalvictorCounterpartyId?: string
        • OptionalentityId?: string
        • Optionaltype?:
              | "AF_BANK"
              | "AF_MOMO"
              | "EXTERNAL_US_ACH"
              | "MX_CLABE"
              | "NETWORK_WALLET"
              | "PHONE"
              | "SWIFT_WIRE"
              | "US_ACH"
              | "US_WIRE"
              | "US_INSTANT"
              | "WALLET"
        • { id: string }
        • { referenceId: string }

      Returns Promise<
          | { error: ServiceError; ok: false }
          | { ok: true; value: PaymentInstrumentSearchItem },
      >