mera exports an adapter function toViemAccount that adapts a signing session into the account shape viem accepts, so viem signs and broadcasts while the key is owned by the session.
Requests a passkey PRF evaluation and returns the first output.
@param ― options - Passkey PRF request inputs.
@returns ― The selected credential ID and first WebAuthn PRF output.
@remarks ―
Runs one assertion ceremony and shows one user-verification prompt.
The WebAuthn challenge is generated internally.
The default salt is sha256("mera.prf.salt.v1") and will not change across
library versions. The PRF output is a deterministic function of the
credential, rpId, and salt; a different salt yields an unrelated output.
The assertion requires user verification, and the requirement is not
configurable. User verification is the authenticator's local check; the
gesture depends on the platform (a biometric, a device PIN, or a password).
Authenticators built on CTAP's hmac-secret keep two PRFs per credential,
one for user-verified requests and one for the rest; WebAuthn exposes only
the user-verified PRF and overrides a weaker userVerification setting
when evaluating it, so a configurable setting could neither change the PRF
output nor skip the check.
Requests a passkey PRF evaluation and returns the first output.
@param ― options - Passkey PRF request inputs.
@returns ― The selected credential ID and first WebAuthn PRF output.
@remarks ―
Runs one assertion ceremony and shows one user-verification prompt.
The WebAuthn challenge is generated internally.
The default salt is sha256("mera.prf.salt.v1") and will not change across
library versions. The PRF output is a deterministic function of the
credential, rpId, and salt; a different salt yields an unrelated output.
The assertion requires user verification, and the requirement is not
configurable. User verification is the authenticator's local check; the
gesture depends on the platform (a biometric, a device PIN, or a password).
Authenticators built on CTAP's hmac-secret keep two PRFs per credential,
one for user-verified requests and one for the rest; WebAuthn exposes only
the user-verified PRF and overrides a weaker userVerification setting
when evaluating it, so a configurable setting could neither change the PRF
output nor skip the check.
Adapts a secp256k1 signing session into a viem local account.
Each signing method hashes its input with viem's own hashers and signs the
resulting 32-byte digest with session.signDigest, so signing never shows a
passkey prompt. The account's address is the EIP-55 checksummed address of
the session key, and publicKey is the 65-byte uncompressed public key as
hex.
@param ― session - Live secp256k1 signing session that backs the account.
@param ― options - Adapter inputs.
@returns ― A viem local account with source: "mera" implementing
signTransaction (honoring a custom serializer), signMessage (EIP-191),
signTypedData (EIP-712), signAuthorization (EIP-7702), and raw-hash
sign.
@throws ― MeraError with code SESSION_ENDED, rejected from every signing
method after session.end() has been called.
@throws ― MeraError with code INPUT_INVALID, rejected from sign when
hash is not exactly 32 bytes.
Adapts a secp256k1 signing session into a viem local account.
Each signing method hashes its input with viem's own hashers and signs the
resulting 32-byte digest with session.signDigest, so signing never shows a
passkey prompt. The account's address is the EIP-55 checksummed address of
the session key, and publicKey is the 65-byte uncompressed public key as
hex.
@param ― session - Live secp256k1 signing session that backs the account.
@param ― options - Adapter inputs.
@returns ― A viem local account with source: "mera" implementing
signTransaction (honoring a custom serializer), signMessage (EIP-191),
signTypedData (EIP-712), signAuthorization (EIP-7702), and raw-hash
sign.
@throws ― MeraError with code SESSION_ENDED, rejected from every signing
method after session.end() has been called.
@throws ― MeraError with code INPUT_INVALID, rejected from sign when
hash is not exactly 32 bytes.
A Wallet Client is an interface to interact with Ethereum Account(s) and provides the ability to retrieve accounts, execute transactions, sign messages, etc. through Wallet Actions.
A Wallet Client is an interface to interact with Ethereum Account(s) and provides the ability to retrieve accounts, execute transactions, sign messages, etc. through Wallet Actions.