lotus-sdk
Version:
Central repository for several classes of tools for integrating with, and building for, the Lotusia ecosystem
59 lines • 2 kB
TypeScript
import { BN } from './crypto/bn.js';
import { Point } from './crypto/point.js';
import { Network } from './networks.js';
import { PrivateKey } from './privatekey.js';
import { Address } from './address.js';
export interface PublicKeyData {
point: Point;
compressed: boolean;
network?: Network;
}
export interface PublicKeyExtra {
network?: Network | string;
compressed?: boolean;
}
export interface PublicKeyObject {
x: string;
y: string;
compressed: boolean;
}
export interface PublicKeySerialized {
x: string;
y: string;
compressed: boolean;
}
export type PublicKeyInput = Point | PublicKeyObject | string | Buffer | PrivateKey;
export declare class PublicKey {
readonly point: Point;
readonly compressed: boolean;
readonly network: Network;
constructor(data: PublicKeyInput, extra?: PublicKeyExtra);
private _classifyArgs;
private static _isPrivateKey;
private static _isBuffer;
private static _transformPrivateKey;
private static _transformDER;
private static _transformX;
private static _transformObject;
static fromPrivateKey(privkey: PrivateKey): PublicKey;
static fromDER(buf: Buffer, strict?: boolean): PublicKey;
static fromBuffer(buf: Buffer, strict?: boolean): PublicKey;
static fromPoint(point: Point, compressed?: boolean): PublicKey;
static fromString(str: string, encoding?: string): PublicKey;
static fromX(odd: boolean, x: BN): PublicKey;
static getValidationError(data: PublicKeyInput): Error | null;
static isValid(data: PublicKeyInput): boolean;
static isValid(data: PublicKey): boolean;
toObject(): PublicKeySerialized;
toJSON(): PublicKeySerialized;
toBigNumber(): BN;
toBuffer(): Buffer;
toDER(): Buffer;
_getID(): Buffer;
toAddress(network?: Network | string): Address;
toString(): string;
inspect(): string;
addScalar(scalar: Buffer | BN): PublicKey;
static getN(): BN;
}
//# sourceMappingURL=publickey.d.ts.map