Class PassthroughAuth

A simple implementation of a Validator that verifies a given signature and checks the recovered address against a set of authorized signers

PassthroughAuth

Hierarchy (view full)

Constructors

Properties

abi: readonly [{
    type: "function";
    inputs: readonly [{
        name: "user";
        internalType: "address";
        type: "address";
    }];
    name: "isAuthorized";
    outputs: readonly [{
        name: "";
        internalType: "bool";
        type: "bool";
    }];
    stateMutability: "view";
}] = passthroughAuthAbi
_payload: any

The deployable payload used either for contract construction or initialization

_config: Config
_address: undefined | `0x${string}`

The internally managed address for this contract

_account?: Account

If it exists, Viem Local Account, if in a Node environment

Accessors

  • get address(): undefined | `0x${string}`
  • A getter returning this contract's deployed address, if it exists.

    Returns undefined | `0x${string}`

Methods

  • Parameters

    • address: `0x${string}`
    • Optionalparams: Partial<Omit<ReadContractParameters<readonly [{
          type: "function";
          inputs: readonly [{
              name: "user";
              internalType: "address";
              type: "address";
          }];
          name: "isAuthorized";
          outputs: readonly [{
              name: "";
              internalType: "bool";
              type: "bool";
          }];
          stateMutability: "view";
      }], "isAuthorized">,
          | "address"
          | "abi"
          | "functionName"
          | "args">>

    Returns Promise<boolean>

  • A typed wrapper for (viem.getLogs)[https://viem.sh/docs/actions/public/getLogs#getlogs]. Accepts eventName and eventNames as optional parameters to narrow the returned log types.

    Type Parameters

    • event extends string
    • const abiEvent extends never = never

    Parameters

    • Optionalparams: Omit<GetLogsParams<readonly [{
          type: "function";
          inputs: readonly [{
              name: "user";
              internalType: "address";
              type: "address";
          }];
          name: "isAuthorized";
          outputs: readonly [{
              name: "";
              internalType: "bool";
              type: "bool";
          }];
          stateMutability: "view";
      }], event, abiEvent, abiEvent[]>, "event" | "events"> & {
          eventName?: event;
          eventNames?: event[];
      }

    Returns Promise<GetLogsReturnType<abiEvent, abiEvent[]>>

    const logs = contract.getLogs({ eventName: 'EventName' })
    const logs = contract.getLogs({ eventNames: ['EventName'] })

    @public
    @async
    @template {ContractEvent} event
    @template {ExtractAbiEvent<
    ContractAbi,
    event
    >} [abiEvent=ExtractAbiEvent<ContractAbi, event>]
    @param {?Omit<
    GetLogsParams<ContractAbi, event, abiEvent, abiEvent[]>,
    'event' | 'events'
    > & {
    eventName?: event;
    eventNames?: event[];
    }} [params]
    @returns {Promise<GetLogsReturnType<abiEvent, abiEvent
  • A typed wrapper for wagmi.watchContractEvent

    Type Parameters

    • event extends string

    Parameters

    • cb: ((log: never) => unknown)
        • (log): unknown
        • Parameters

          • log: never

          Returns unknown

    • Optionalparams: Partial<Omit<UnionCompute<WatchContractEventParameters<readonly [{
          type: "function";
          inputs: readonly [{
              name: ...;
              internalType: ...;
              type: ...;
          }];
          name: "isAuthorized";
          outputs: readonly [{
              name: ...;
              internalType: ...;
              type: ...;
          }];
          stateMutability: "view";
      }], event, undefined, WebSocketTransport> & ChainIdParameter<Config, number> & SyncConnectedChainParameter>, "address" | "abi">> & {
          eventName?: event;
      }

    Returns (() => void)

      • (): void
      • Returns void

  • Protected

    Internal function to attach the connected account to write methods to avoid manually passing in an account each call.

    Parameters

    • Optionalaccount: Account

    Returns {
        account: Account;
    } | {
        account: undefined;
    }