import { ABIDecoder } from "../serializer/Decoder.js";
import { ABIEncoder } from "../serializer/Encoder.js";
import { ABISerializableObject } from "../serializer/Serializable.js";
import { Bytes, BytesType } from "./Bytes.js";
import { Checksum256Type } from "./Checksum.js";
import { KeyType } from "./KeyType.js";
import { PublicKey } from "./PublicKey.js";
export type SignatureType = Signature | SignatureParts | string;
export type SignatureParts = {
    type: KeyType;
    r: Uint8Array;
    s: Uint8Array;
    recid: number;
};
export declare class Signature implements ABISerializableObject {
    static abiName: string;
    type: KeyType;
    data: Bytes;
    /** Create Signature object from representing types. */
    static from(value: SignatureType): Signature;
    /** @internal */
    static fromABI(decoder: ABIDecoder): Signature;
    /**
     * Build a signature directly from a hex string.
     * @param hexStr  0x-prefixed or plain hex:
     *                  • 130 chars → K1/R1/EM (r‖s‖v)
     *                  • 128 chars → ED     (r‖s)
     * @param type    KeyType.K1 | KeyType.R1 | KeyType.EM | KeyType.ED
     */
    static fromHex(hexStr: string, type: KeyType): Signature;
    /**
     * Build a Signature from raw “[r‖s‖v]” bytes.
     * @param raw    64 bytes (ED) or 65 bytes (EM/K1/R1) in [r(32)‖s(32)‖vRaw(1)] form
     * @param type   KeyType.ED | KeyType.EM | KeyType.K1 | KeyType.R1
     */
    static fromRaw(raw: Uint8Array, type: KeyType): Signature;
    /**
     * @internal
     * @param type   Which curve (K1/R1/EM/ED)
     * @param data   **Wire‐format** signature bytes:
     *               - EM/K1/R1: 65 bytes `[vWire (31–34)‖r(32)‖s(32)]`
     *               - ED:       64 bytes `[r(32)‖s(32)]`
     */
    constructor(type: KeyType, data: Bytes | Uint8Array);
    equals(other: SignatureType): boolean;
    /** Recover public key from given message digest. */
    recoverDigest(digest: Checksum256Type): PublicKey;
    /** Recover public key from given message. */
    recoverMessage(message: BytesType): PublicKey;
    /** Verify this signature with given message digest and public key. */
    verifyDigest(digest: Checksum256Type, publicKey: PublicKey): boolean;
    /**
     * Verify this signature against a message and public key.
     *
     * The signature.data must be in **wire-format**:
     *  - **KeyType.ED**: 64 bytes `[r||s]` (Ed25519 detached signature)
     *  - **KeyType.EM**: 65 bytes `[vWire‖r‖s]` where `vWire = ethV + 4` (Ethereum EIP-191)
     *  - **KeyType.K1/R1**: 65 bytes `[vWire‖r‖s]` where `vWire = recid + 31` (secp256k1 / R1)
     *
     * Verification logic:
     *  - **ED25519 (ED)**: verifies the raw message bytes directly via TweetNaCl.
     *  - **Ethereum (EM)**: unwraps wire-format to `[r||s||vRaw]`, applies the EIP-191 prefix + keccak256, then recovers and compares the address.
     *  - **K1/R1**: computes SHA-256(message) digest and verifies with the appropriate elliptic curve.
     *
     * @param message    The original message bytes (Uint8Array or BytesType, UTF-8 encoded if from string).
     * @param publicKey  The PublicKey instance corresponding to the signer’s key type.
     * @returns           `true` if the signature is valid, `false` otherwise.
     */
    verifyMessage(message: BytesType, publicKey: PublicKey): boolean;
    /** Base58check encoded string representation of this signature (`SIG_<type>_<data>`). */
    toString(): string;
    /**
     * Return the raw signature as a 0x‐prefixed hex string:
     * - EM: [r||s||v] with Ethereum v (27/28)
     * - K1/R1: [r||s||v] with secp256k1 v (0/1)
     * - ED: [r||s] (64 bytes)
     */
    toHex(): string;
    /** @internal */
    toABI(encoder: ABIEncoder): void;
    /** @internal */
    toJSON(): string;
}
/**
 * Pads an ED25519 signature for transaction wire-format.
 * @param sig - The presumed 64 byte r|s signature to pad.
 * @returns The padded 65 byte signature used for wire transactions.
 */
export declare function padEdForTx(sig: Signature): Signature;
/**
 * Strips the ED25519 padding from a signature.
 * @param sig - The signature to strip.
 * @returns The stripped signature.
 */
export declare function stripEdPad(sig: Signature): Signature;
//# sourceMappingURL=Signature.d.ts.map