@thirdweb-dev/wallets
Version:
<p align="center"> <br /> <a href="https://thirdweb.com"><img src="https://github.com/thirdweb-dev/js/blob/main/legacy_packages/sdk/logo.svg?raw=true" width="200" alt=""/></a> <br /> </p> <h1 align="center">thirdweb Wallet SDK</h1> <p align="center"> <a h
43 lines • 1.66 kB
TypeScript
/// <reference types="node" />
import { MessageTypes, SignTypedDataVersion, TypedDataV1, TypedMessage } from "@metamask/eth-sig-util";
/**
* Recover the public key from the given signature and message hash.
*
* @param messageHash - The hash of the signed message.
* @param signature - The signature.
* @returns The public key of the signer.
*/
export declare function recoverPublicKey(messageHash: Buffer, signature: string): Buffer;
/**
* Validate that the given value is a valid version string.
*
* @param version - The version value to validate.
* @param allowedVersions - A list of allowed versions. If omitted, all versions are assumed to be
* allowed.
*/
export declare function validateVersion(version: SignTypedDataVersion, allowedVersions?: SignTypedDataVersion[]): void;
interface RecoveryOptions<V extends SignTypedDataVersion, T extends MessageTypes> {
/**
* The typed data that was signed.
*/
data: V extends "V1" ? TypedDataV1 : TypedMessage<T>;
/**
* The '0x-prefixed hex encoded message signature.
*/
signature: string;
/**
* The signing version to use.
*/
version: V;
}
/**
* Recover the address of the account that created the given EIP-712
* signature. The version provided must match the version used to
* create the signature.
*
* @param options - The signature recovery options.
* @returns The '0x'-prefixed hex address of the signer.
*/
export declare function recoverTypedSignature<V extends SignTypedDataVersion, T extends MessageTypes>({ data, signature, version }: RecoveryOptions<V, T>): string;
export {};
//# sourceMappingURL=signature-utils.d.ts.map