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

    Cross-customer queries and instrument type-agnostic admin actions

    Hierarchy (View Summary)

    Index
    cache: ServiceCache<CachedSearchPage<CachedPaymentInstrumentSearchItem>>
    db: B2bDatabase
    • 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?:
                | "MX_CLABE"
                | "AF_BANK"
                | "AF_MOMO"
                | "EXTERNAL_US_ACH"
                | "NETWORK_WALLET"
                | "SWIFT_WIRE"
                | "US_ACH"
                | "US_INSTANT"
                | "US_WIRE"
                | "WALLET";
        } & ({ id: string } | { referenceId: string })

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

    • Bust every cached page — consumer or admin — that a write touching customerIds could have affected.

      The collection tag is always cleared alongside, because an unscoped admin page carries only that tag and no customer id can reach it.

      keys deletes exact entries in addition to the tag surgery, passing the key arguments — this cache hashes and prefixes them. It exists because invalidateTag resolves keys through the FT index, which does not exist in memory mode (valkeyClient: null); there the tag bust is a total no-op, and an exact-key delete is the only thing that keeps read-after-write honest. Services that folded get onto search pass that get's arguments.

      These deletes only reach this instance's own key space, because the key space is partitioned per surface. That is sufficient, and a writer must not try to name the other surface's key:

      • With Valkey, the other surface's get entry is itself tagged (by customer id, or by the collection tag when unscoped), so the tag bust above already evicts it from the shared L2 and publishes the peer eviction.
      • Without Valkey, the two surfaces are separate instances with separate L1 maps, so deleting a key from this instance could never have affected the other one anyway.

      Parameters

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

      Returns Promise<void>

    • Parameters

      • __namedParameters: {
            anyFieldLike?: string;
            createdAt?: DbTimestampCriteria;
            customerIds?: string[];
            deleted?: boolean;
            entityIds?: string[];
            ids?: string[];
            nameLike?: string;
            nominisWalletScreenRequestIds?: string[];
            orderBy?: DbOrderByCriterion<
                Omit<
                    PgTableWithColumns<
                        {
                            columns: {
                                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";
                                    },
                                >;
                                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";
                                    },
                                >;
                                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";
                                    },
                                >;
                                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";
                                    },
                                >;
                                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";
                                    },
                                >;
                            };
                            dialect: "pg";
                            name: "payment_instrument";
                            schema: "b2b";
                        },
                    >,
                    "enableRLS",
                >,
                "createdAt"
                | "updatedAt",
            >[];
            page?: number;
            pageSize?: number | null;
            partialText?: string;
            providerIds?: string[];
            providers?: (
                | "MX_CLABE"
                | "ACH_PUSH_DEPOSIT"
                | "CFX"
                | "LEDGER_ACCOUNT"
                | "QUILTT"
                | "VICTOR"
                | "WIRE_DEPOSIT"
                | "YELLOWCARD"
                | `chn_${string}`
            )[];
            quilttConnectionIds?: string[];
            referenceIdLike?: string;
            referenceIds?: string[];
            statuses?: ("ACTIVE" | "BLOCKED" | "DELETED" | "PENDING_VERIFICATION")[];
            tx?: PgAsyncTransaction<NodePgQueryResultHKT, EmptyRelations>;
            types?: (
                | "MX_CLABE"
                | "AF_BANK"
                | "AF_MOMO"
                | "EXTERNAL_US_ACH"
                | "NETWORK_WALLET"
                | "SWIFT_WIRE"
                | "US_ACH"
                | "US_INSTANT"
                | "US_WIRE"
                | "WALLET"
            )[];
            updatedAt?: DbTimestampCriteria;
        }
        • 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.

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

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

        • OptionalnominisWalletScreenRequestIds?: string[]
        • OptionalorderBy?: DbOrderByCriterion<
              Omit<
                  PgTableWithColumns<
                      {
                          columns: {
                              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";
                                  },
                              >;
                              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";
                                  },
                              >;
                              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";
                                  },
                              >;
                              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";
                                  },
                              >;
                              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";
                                  },
                              >;
                          };
                          dialect: "pg";
                          name: "payment_instrument";
                          schema: "b2b";
                      },
                  >,
                  "enableRLS",
              >,
              "createdAt"
              | "updatedAt",
          >[]
        • 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"
              | "ACH_PUSH_DEPOSIT"
              | "CFX"
              | "LEDGER_ACCOUNT"
              | "QUILTT"
              | "VICTOR"
              | "WIRE_DEPOSIT"
              | "YELLOWCARD"
              | `chn_${string}`
          )[]
        • OptionalquilttConnectionIds?: string[]
        • OptionalreferenceIdLike?: string
        • OptionalreferenceIds?: string[]
        • Optionalstatuses?: ("ACTIVE" | "BLOCKED" | "DELETED" | "PENDING_VERIFICATION")[]
        • Optionaltx?: PgAsyncTransaction<NodePgQueryResultHKT, EmptyRelations>
        • Optionaltypes?: (
              | "MX_CLABE"
              | "AF_BANK"
              | "AF_MOMO"
              | "EXTERNAL_US_ACH"
              | "NETWORK_WALLET"
              | "SWIFT_WIRE"
              | "US_ACH"
              | "US_INSTANT"
              | "US_WIRE"
              | "WALLET"
          )[]
        • OptionalupdatedAt?: DbTimestampCriteria

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

    • Tags to write on a page, derived from the scope the query searched — never from the customers present in the result.

      That distinction is load-bearing. An entry tagged with the customer ids in the page carries no tags when the page is empty, so nothing can ever bust it and a later create leaves it stale for the full L2 TTL. Tagging by scope means an empty page still carries the tag for what it searched.

      An unscoped read falls back to the collection tag, since no customer-id tag can reach a row whose owner did not exist when the entry was written.

      Parameters

      • __namedParameters: { customerIds: readonly string[] | undefined }

      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;
                };
                status?: "ACTIVE"
                | "BLOCKED"
                | "DELETED"
                | "PENDING_VERIFICATION";
                victorCounterpartyId?: string;
            };
            entityId?: string;
            type?: | "MX_CLABE"
            | "AF_BANK"
            | "AF_MOMO"
            | "EXTERNAL_US_ACH"
            | "NETWORK_WALLET"
            | "SWIFT_WIRE"
            | "US_ACH"
            | "US_INSTANT"
            | "US_WIRE"
            | "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;
              };
              status?: "ACTIVE"
              | "BLOCKED"
              | "DELETED"
              | "PENDING_VERIFICATION";
              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.

          • Optionalstatus?: "ACTIVE" | "BLOCKED" | "DELETED" | "PENDING_VERIFICATION"
          • OptionalvictorCounterpartyId?: string
        • OptionalentityId?: string
        • Optionaltype?:
              | "MX_CLABE"
              | "AF_BANK"
              | "AF_MOMO"
              | "EXTERNAL_US_ACH"
              | "NETWORK_WALLET"
              | "SWIFT_WIRE"
              | "US_ACH"
              | "US_INSTANT"
              | "US_WIRE"
              | "WALLET"
        • { id: string }
        • { referenceId: string }

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