lotus-sdk
Version:
Central repository for several classes of tools for integrating with, and building for, the Lotusia ecosystem
53 lines • 1.81 kB
TypeScript
import { BN } from './bn.js';
export interface SignatureData {
r: BN;
s: BN;
i?: number;
compressed?: boolean;
isSchnorr?: boolean;
nhashtype?: number;
}
export type SignatureSigningMethod = 'schnorr' | 'ecdsa';
export declare class Signature {
r: BN;
s: BN;
i?: number;
compressed?: boolean;
isSchnorr?: boolean;
nhashtype?: number;
static readonly SIGHASH_ALL = 1;
static readonly SIGHASH_NONE = 2;
static readonly SIGHASH_SINGLE = 3;
static readonly SIGHASH_FORKID = 64;
static readonly SIGHASH_LOTUS = 96;
static readonly SIGHASH_ANYONECANPAY = 128;
constructor(r: BN | SignatureData, s?: BN, isSchnorr?: boolean);
static create(r?: BN | SignatureData, s?: BN, isSchnorr?: boolean): Signature;
set(obj: SignatureData): Signature;
static fromCompact(buf: Buffer): Signature;
static fromDER(buf: Buffer, strict?: boolean): Signature;
static fromBuffer(buf: Buffer, strict?: boolean): Signature;
static fromTxFormat(buf: Buffer): Signature;
static fromDataFormat(buf: Buffer): Signature;
static fromString(str: string): Signature;
static fromSchnorr(buf: Buffer): Signature;
static parseSchnorrEncodedSig(buf: Buffer): {
r: BN;
s: BN;
nhashtype?: Buffer;
};
static parseDER(buf: Buffer, strict?: boolean): {
r: BN;
s: BN;
};
toCompact(i?: number, compressed?: boolean): Buffer;
toDER(signingMethod?: string): Buffer;
toBuffer(signingMethod?: string): Buffer;
toString(): string;
toTxFormat(signingMethod?: SignatureSigningMethod): Buffer;
static isDER(buf: Buffer): boolean;
hasLowS(): boolean;
hasDefinedHashtype(): boolean;
static isTxDER(buf: Buffer): boolean;
}
//# sourceMappingURL=signature.d.ts.map