/** * forked from https://github.com/EOSIO/eosjs/blob/master/src/eosjs-key-conversions.ts * * rewrite curves */ import { Key, KeyType } from "./eosjs-numeric"; import { PublicKey } from "./eosjs-key-conversions"; import { CurveFn, SignatureType, RecoveredSignatureType } from "@noble/curves/abstract/weierstrass.js"; /** Represents/stores a Signature and provides easy conversion for use with `elliptic` lib */ export declare class Signature { private signature; private ec; constructor(signature: Key, ec: CurveFn); /** Instantiate Signature from an EOSIO-format Signature */ static fromString(sig: string, ec?: CurveFn): Signature; /** Instantiate Signature from an `elliptic`-format Signature */ static fromSignature(ellipticSig: SignatureType, keyType: KeyType, ec?: CurveFn): Signature; /** Export Signature as `elliptic`-format Signature * NOTE: This isn't an actual elliptic-format Signature, as ec.Signature is not exported by the library. * That's also why the return type is `any`. We're *actually* returning an object with the 3 params * not an ec.Signature. * Further NOTE: @types/elliptic shows ec.Signature as exported; it is *not*. Hence the `any`. */ toRecoveredSignature(): RecoveredSignatureType; /** Export Signature as EOSIO-format Signature */ toString(): string; /** Export Signature in binary format */ toBinary(): Uint8Array; /** Get key type from signature */ getType(): KeyType; /** Recover a public key from a message or hashed message digest and signature */ recover(data: string | Uint8Array, shouldHash?: boolean, encoding?: BufferEncoding): PublicKey; }