import { VeChainProvider, ThorClient, VeChainSigner, VeChainAbstractSigner, AvailableVeChainProviders, TransactionRequestInput } from '@vechain/sdk-network';

interface KMSClientParameters {
    keyId: string;
    region: string;
    credentials?: {
        accessKeyId: string;
        secretAccessKey: string;
        sessionToken?: string;
    };
    endpoint?: string;
}
declare class KMSVeChainProvider extends VeChainProvider {
    private readonly kmsClient;
    private readonly keyId;
    private signer?;
    /**
     * Creates a new instance of KMSVeChainProvider.
     * @param thorClient The thor client instance to use.
     * @param params The parameters to configure the KMS client and the keyId.
     * @param enableDelegation Whether to enable delegation or not.
     **/
    constructor(thorClient: ThorClient, params: KMSClientParameters, enableDelegation?: boolean);
    /**
     * Returns a new instance of the KMSVeChainSigner using this provider configuration.
     * @param _addressOrIndex Unused parameter, will always return the signer associated to the keyId
     * @returns {KMSVeChainSigner} An instance of KMSVeChainSigner
     */
    getSigner(_addressOrIndex?: string | number): Promise<VeChainSigner | null>;
    /**
     * Returns the public key associated with the keyId provided in the constructor.
     * @returns {Uint8Array} The public key associated with the keyId
     */
    getPublicKey(): Promise<Uint8Array>;
    /**
     * Performs a sign operation using the keyId provided in the constructor.
     * @param {Uint8Array} message Message to sign using KMS
     * @returns {Uint8Array} The signature of the message
     */
    sign(message: Uint8Array): Promise<Uint8Array>;
}

declare class KMSVeChainSigner extends VeChainAbstractSigner {
    private readonly kmsVeChainProvider?;
    private readonly kmsVeChainGasPayerProvider?;
    private readonly kmsVeChainGasPayerServiceUrl?;
    constructor(provider?: AvailableVeChainProviders, gasPayer?: {
        provider?: AvailableVeChainProviders;
        url?: string;
    });
    /**
     * Connects the signer to a provider.
     * @param provider The provider to connect to.
     * @returns {this} The signer instance.
     * @override VeChainAbstractSigner.connect
     **/
    connect(provider: AvailableVeChainProviders): this;
    /**
     * Decodes the public key from the DER-encoded public key.
     * @param {Uint8Array} encodedPublicKey DER-encoded public key
     * @returns {Uint8Array} The decoded public key.
     */
    private decodePublicKey;
    /**
     * Gets the DER-encoded public key from KMS and decodes it.
     * @param {KMSVeChainProvider} kmsProvider (Optional) The provider to get the public key from.
     * @returns {Uint8Array} The decoded public key.
     */
    private getDecodedPublicKey;
    /**
     * It returns the address associated with the signer.
     * @param {boolean} fromGasPayerProvider (Optional) If true, the provider will be the gasPayer.
     * @returns The address associated with the signer.
     */
    getAddress(fromGasPayerProvider?: boolean | undefined): Promise<string>;
    /**
     * It builds a VeChain signature from a bytes' payload.
     * @param {Uint8Array} payload to sign.
     * @param {KMSVeChainProvider} kmsProvider The provider to sign the payload.
     * @returns {Uint8Array} The signature following the VeChain format.
     */
    private buildVeChainSignatureFromPayload;
    /**
     * Returns the recovery bit of a signature.
     * @param {SignatureType} decodedSignatureWithoutRecoveryBit Signature with the R and S components only.
     * @param {Uint8Array} transactionHash Raw transaction hash.
     * @param {KMSVeChainProvider} kmsProvider The provider to sign the payload.
     * @returns {number} The V component of the signature (either 0 or 1).
     */
    private getRecoveryBit;
    /**
     * Concat the origin signature to the gasPayer signature if the gasPayer is set.
     * @param {Transaction} transaction Transaction to sign.
     * @returns Both signatures concatenated if the gasPayer is set, the origin signature otherwise.
     */
    private concatSignatureIfDelegation;
    /**
     * It signs a transaction.
     * @param transactionToSign Transaction body to sign in plain format.
     * @returns {string} The signed transaction in hexadecimal format.
     */
    signTransaction(transactionToSign: TransactionRequestInput): Promise<string>;
    /**
     * Submits a signed transaction to the network.
     * @param transactionToSend Transaction to be signed and sent to the network.
     * @returns {string} The transaction ID.
     */
    sendTransaction(transactionToSend: TransactionRequestInput): Promise<string>;
    /**
     * Signs a bytes payload returning the VeChain signature in hexadecimal format.
     * @param {Uint8Array} payload in bytes to sign.
     * @returns {string} The VeChain signature in hexadecimal format.
     */
    signPayload(payload: Uint8Array): Promise<string>;
}

export { type KMSClientParameters, KMSVeChainProvider, KMSVeChainSigner };
