UNPKG

@roochnetwork/rooch-sdk

Version:
33 lines (32 loc) 876 B
import { Bytes } from '../types/index.js'; /** * Value to be converted into public key. */ export type PublicKeyInitData = string | Bytes | Iterable<number>; /** * A public key */ export declare abstract class PublicKey<T> { /** * Checks if two public keys are equal */ equals(publicKey: PublicKey<T>): boolean; /** * Return the base-64 representation of the public key */ toBase64(): string; toString(): string; /** * Return the byte array representation of the public key */ abstract toBytes(): Uint8Array; /** * Return signature scheme flag of the public key */ abstract flag(): number; abstract toAddress(): T; /** * Verifies that the signature is valid for the provided message */ abstract verify(data: Uint8Array, signature: Uint8Array | string): Promise<boolean>; }