@interchainjs/auth
Version:
Authentication for web3 accounts
16 lines (15 loc) • 851 B
TypeScript
import { IPublicKey, IPublicKeyConfig, IAddress, IAddressConfig, ICryptoBytes, IPrivateKey, IAlgo } from '@interchainjs/types';
export declare class PublicKey implements IPublicKey {
readonly value: ICryptoBytes;
readonly algo: IAlgo | string;
readonly compressed: boolean;
private _algo;
constructor(value: ICryptoBytes, algo: IAlgo | string, compressed: boolean);
toAddress(config: IAddressConfig, prefix?: string): IAddress;
verify(data: Uint8Array, signature: ICryptoBytes): Promise<boolean>;
toHex(): string;
toBase64(): string;
static fromPrivateKey(privateKey: IPrivateKey, config?: IPublicKeyConfig): IPublicKey;
static fromBytes(bytes: ICryptoBytes, algo: IAlgo | string, compressed?: boolean): IPublicKey;
static fromHex(hex: string, algo: IAlgo | string, compressed?: boolean): IPublicKey;
}