import { BIP32Interface } from 'bip32';
import { Bech32String, BroadcastMode, BroadcastTx, Bytes, KeyPair, StdSignature, StdSignMsg, StdTx, Tx, SignMeta, Wallet } from './types';
export * from './types';
export * from './util';
/**
 * Bech32 prefix for Cosmos addresses.
 */
export declare const COSMOS_PREFIX = "cosmos";
/**
 * BIP32 derivation path for Cosmos keys.
 */
export declare const COSMOS_PATH = "m/44'/118'/0'/0/0";
/**
 * Defines a transaction broadcast mode where the client returns immediately.
 */
export declare const BROADCAST_MODE_SYNC = "sync";
/**
 * Defines a transaction broadcast mode where the client waits for a `CheckTx` execution response only.
 */
export declare const BROADCAST_MODE_ASYNC = "async";
/**
 * Defines a transaction broadcast mode where the client waits for the transaction to be committed in a block.
 */
export declare const BROADCAST_MODE_BLOCK = "block";
/**
 * Create a {@link Wallet|`Wallet`} from a known mnemonic.
 *
 * @param   mnemonic - BIP39 mnemonic seed
 * @param   prefix   - Bech32 human readable part, defaulting to {@link COSMOS_PREFIX|`COSMOS_PREFIX`}
 * @param   path     - BIP32 derivation path, defaulting to {@link COSMOS_PATH|`COSMOS_PATH`}
 *
 * @returns a keypair and address derived from the provided mnemonic
 * @throws  will throw if the provided mnemonic is invalid
 */
export declare function createWalletFromMnemonic(mnemonic: string, prefix?: string, path?: string): Wallet;
/**
 * Derive a BIP32 master key from a mnemonic.
 *
 * @param   mnemonic - BIP39 mnemonic seed
 *
 * @returns BIP32 master key
 * @throws  will throw if the provided mnemonic is invalid
 */
export declare function createMasterKeyFromMnemonic(mnemonic: string): BIP32Interface;
/**
 * Create a {@link Wallet|`Wallet`} from a BIP32 master key.
 *
 * @param   masterKey - BIP32 master key
 * @param   prefix    - Bech32 human readable part, defaulting to {@link COSMOS_PREFIX|`COSMOS_PREFIX`}
 * @param   path      - BIP32 derivation path, defaulting to {@link COSMOS_PATH|`COSMOS_PATH`}
 *
 * @returns a keypair and address derived from the provided master key
 */
export declare function createWalletFromMasterKey(masterKey: BIP32Interface, prefix?: string, path?: string): Wallet;
/**
 * Derive a keypair from a BIP32 master key.
 *
 * @param   masterKey - BIP32 master key
 * @param   path      - BIP32 derivation path, defaulting to {@link COSMOS_PATH|`COSMOS_PATH`}
 *
 * @returns derived public and private key pair
 * @throws  will throw if a private key cannot be derived
 */
export declare function createKeyPairFromMasterKey(masterKey: BIP32Interface, path?: string): KeyPair;
/**
 * Derive a Bech32 address from a public key.
 *
 * @param   publicKey - public key bytes
 * @param   prefix    - Bech32 human readable part, defaulting to {@link COSMOS_PREFIX|`COSMOS_PREFIX`}
 *
 * @returns Bech32-encoded address
 */
export declare function createAddress(publicKey: Bytes, prefix?: string): Bech32String;
/**
 * Sign a transaction.
 *
 * This combines the {@link Tx|`Tx`} and {@link SignMeta|`SignMeta`} into a {@link StdSignMsg|`StdSignMsg`}, signs it,
 * and attaches the signature to the transaction. If the transaction is already signed, the signature will be
 * added to the existing signatures.
 *
 * @param   tx      - transaction (signed or unsigned)
 * @param   meta    - metadata for signing
 * @param   keyPair - public and private key pair (or {@link Wallet|`Wallet`})
 *
 * @returns a signed transaction
 */
export declare function signTx(tx: Tx | StdTx, meta: SignMeta, keyPair: KeyPair): StdTx;
/**
 * Create a transaction with metadata for signing.
 *
 * @param   tx   - unsigned transaction
 * @param   meta - metadata for signing
 *
 * @returns
 */
export declare function createSignMsg(tx: Tx, meta: SignMeta): StdSignMsg;
/**
 * Create a signature from a {@link StdSignMsg|`StdSignMsg`}.
 *
 * @param   signMsg - transaction with metadata for signing
 * @param   keyPair - public and private key pair (or {@link Wallet|`Wallet`})
 *
 * @returns a signature and corresponding public key
 */
export declare function createSignature(signMsg: StdSignMsg, { privateKey, publicKey }: KeyPair): StdSignature;
/**
 * Create signature bytes from a {@link StdSignMsg|`StdSignMsg`}.
 *
 * @param   signMsg    - transaction with metadata for signing
 * @param   privateKey - private key bytes
 *
 * @returns signature bytes
 */
export declare function createSignatureBytes(signMsg: StdSignMsg, privateKey: Bytes): Bytes;
/**
 * Sign the sha256 hash of `bytes` with a secp256k1 private key.
 *
 * @param   bytes      - bytes to hash and sign
 * @param   privateKey - private key bytes
 *
 * @returns signed hash of the bytes
 * @throws  will throw if the provided private key is invalid
 */
export declare function sign(bytes: Bytes, privateKey: Bytes): Bytes;
/**
 * Verify a signed transaction's signatures.
 *
 * @param   tx   - signed transaction
 * @param   meta - metadata for signing
 *
 * @returns `true` if all signatures are valid and match, `false` otherwise or if no signatures were provided
 */
export declare function verifyTx(tx: StdTx, meta: SignMeta): boolean;
/**
 * Verify a {@link StdSignMsg|`StdSignMsg`} against multiple {@link StdSignature|`StdSignature`}s.
 *
 * @param   signMsg    - transaction with metadata for signing
 * @param   signatures - signatures
 *
 * @returns `true` if all signatures are valid and match, `false` otherwise or if no signatures were provided
 */
export declare function verifySignatures(signMsg: StdSignMsg, signatures: StdSignature[]): boolean;
/**
 * Verify a {@link StdSignMsg|`StdSignMsg`} against a {@link StdSignature|`StdSignature`}.
 *
 * @param   signMsg   - transaction with metadata for signing
 * @param   signature - signature
 *
 * @returns `true` if the signature is valid and matches, `false` otherwise
 */
export declare function verifySignature(signMsg: StdSignMsg, signature: StdSignature): boolean;
/**
 * Verify a signature against a {@link StdSignMsg|`StdSignMsg`}.
 *
 * @param   signMsg   - transaction with metadata for signing
 * @param   signature - signature bytes
 * @param   publicKey - public key bytes
 *
 * @returns `true` if the signature is valid and matches, `false` otherwise
 */
export declare function verifySignatureBytes(signMsg: StdSignMsg, signature: Bytes, publicKey: Bytes): boolean;
/**
 * Prepare a signed transaction for broadcast.
 *
 * @param   tx   - signed transaction
 * @param   mode - broadcast mode
 *
 * @returns a transaction broadcast
 */
export declare function createBroadcastTx(tx: StdTx, mode?: BroadcastMode): BroadcastTx;
