getWebauthnValidatorSignature
Get the encoded signature for the WebAuthn validator.
Usage
const signature = getWebauthnValidatorSignature({
authenticatorData: "0x123...",
clientDataJSON: "{data:...}",
responseTypeLocation: 0,
r: 10,
s: 5,
usePrecompiled: true,
});
Parameters
authenticatorData
- Type:
Hex
(opens in a new tab)
The authenticator data formatted as a hex string.
clientDataJSON
- Type:
string
The JSON object of the client data that was signed.
responseTypeLocation
- Type:
number
The location of the response type in the client data JSON.
r
- Type:
number
The r
value of the signature.
s
- Type:
number
The s
value of the signature.
usePrecompiled
- Type:
boolean
A flag to indicate whether to use the precompiled contract for EIP-7212. Note that not all networks support the precompile.
Returns
signature
- Type:
Hex
(opens in a new tab)
The encoded signature for the WebAuthn validator.