import { Address } from './encoding/address.js'; import { Transaction } from './transaction.js'; import { MultisigMetadata } from './multisig.js'; import type { TransactionSigner } from './signer.js'; export declare const MULTISIG_MERGE_LESSTHANTWO_ERROR_MSG = "Not enough multisig transactions to merge. Need at least two"; export declare const MULTISIG_MERGE_MISMATCH_ERROR_MSG = "Cannot merge txs. txIDs differ"; export declare const MULTISIG_MERGE_MISMATCH_AUTH_ADDR_MSG = "Cannot merge txs. Auth addrs differ"; export declare const MULTISIG_MERGE_WRONG_PREIMAGE_ERROR_MSG = "Cannot merge txs. Multisig preimages differ"; export declare const MULTISIG_MERGE_SIG_MISMATCH_ERROR_MSG = "Cannot merge txs. subsigs are mismatched."; export declare const MULTISIG_NO_MUTATE_ERROR_MSG = "Cannot mutate a multisig field as it would invalidate all existing signatures."; export declare const MULTISIG_USE_PARTIAL_SIGN_ERROR_MSG = "Cannot sign a multisig transaction using `signTxn`. Use `partialSignTxn` instead."; export declare const MULTISIG_SIGNATURE_LENGTH_ERROR_MSG = "Cannot add multisig signature. Signature is not of the correct length."; /** * createMultisigTransaction creates a raw, unsigned multisig transaction blob. * @param txn - the actual transaction. * @param version - multisig version * @param threshold - multisig threshold * @param pks - ordered list of public keys in this multisig * @returns encoded multisig blob */ export declare function createMultisigTransaction(txn: Transaction, { version, threshold, addrs }: MultisigMetadata): Uint8Array; /** * mergeMultisigTransactions takes a list of multisig transaction blobs, and merges them. * @param multisigTxnBlobs - a list of blobs representing encoded multisig txns * @returns typed array msg-pack encoded multisig txn */ export declare function mergeMultisigTransactions(multisigTxnBlobs: Uint8Array[]): Uint8Array; /** * @deprecated Use {@link signMultisigTransactionWithSigner} instead * * signMultisigTransaction takes a raw transaction (see signTransaction), a multisig preimage, a secret key, and returns * a multisig transaction, which is a blob representing a transaction and multisignature account preimage. The returned * multisig txn can accumulate additional signatures through mergeMultisigTransactions or appendSignMultisigTransaction. * @param txn - object with either payment or key registration fields * @param version - multisig version * @param threshold - multisig threshold * @param addrs - a list of Algorand addresses representing possible signers for this multisig. Order is important. * @param sk - Algorand secret key. The corresponding pk should be in the pre image. * @returns object containing txID, and blob of partially signed multisig transaction (with multisig preimage information) * If the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum. */ export declare function signMultisigTransaction(txn: Transaction, { version, threshold, addrs }: MultisigMetadata, sk: Uint8Array): { txID: string; blob: Uint8Array; }; /** * signMultisigTransactionWithSigner takes a raw transaction, a multisig preimage and a signer, and * returns a multisig transaction: a blob representing a transaction and multisignature account * preimage. The returned multisig txn can accumulate additional signatures through * mergeMultisigTransactions or appendSignMultisigTransactionWithSigner. * * The signer must hold a key belonging to the multisig. That key is taken from the `sgnr` field of * the transaction the signer returns, falling back to the transaction sender when `sgnr` is absent * — which is the same convention signers use when writing it. Every signer this SDK provides * follows it. Note that `AddressWithTransactionSigner.address` cannot be used for this: it is the * address the signer sends transactions from, which for a rekeyed account is not the signing key. * * @param txn - the transaction to sign * @param version - multisig version * @param threshold - multisig threshold * @param addrs - a list of Algorand addresses representing possible signers for this multisig. Order is important. * @param txnSigner - the signer to sign with * @returns an object with txID and blob properties */ export declare function signMultisigTransactionWithSigner(txn: Transaction, { version, threshold, addrs }: MultisigMetadata, txnSigner: TransactionSigner): Promise<{ txID: string; blob: Uint8Array; }>; /** * @deprecated Use {@link appendSignMultisigTransactionWithSigner} instead * * appendSignMultisigTransaction takes a multisig transaction blob, and appends our signature to it. * While we could derive public key preimagery from the partially-signed multisig transaction, * we ask the caller to pass it back in, to ensure they know what they are signing. * @param multisigTxnBlob - an encoded multisig txn. Supports non-payment txn types. * @param version - multisig version * @param threshold - multisig threshold * @param addrs - a list of Algorand addresses representing possible signers for this multisig. Order is important. * @param sk - Algorand secret key * @returns object containing txID, and blob representing encoded multisig txn */ export declare function appendSignMultisigTransaction(multisigTxnBlob: Uint8Array, { version, threshold, addrs }: MultisigMetadata, sk: Uint8Array): { txID: string; blob: Uint8Array; }; /** * appendSignMultisigTransactionWithSigner takes a multisig transaction blob, and appends the given * signer's signature to it. While we could derive public key preimagery from the partially-signed * multisig transaction, we ask the caller to pass it back in, to ensure they know what they are * signing. * * As with {@link signMultisigTransactionWithSigner}, the signer's key is taken from the `sgnr` * field of the transaction it returns, falling back to the transaction sender when `sgnr` is * absent. * * @param multisigTxnBlob - an encoded multisig txn. Supports non-payment txn types. * @param version - multisig version * @param threshold - multisig threshold * @param addrs - a list of Algorand addresses representing possible signers for this multisig. Order is important. * @param txnSigner - the signer to sign with * @returns an object with txID and blob properties */ export declare function appendSignMultisigTransactionWithSigner(multisigTxnBlob: Uint8Array, { version, threshold, addrs }: MultisigMetadata, txnSigner: TransactionSigner): Promise<{ txID: string; blob: Uint8Array; }>; /** * appendMultisigTransactionSignature takes a multisig transaction blob, and appends a given raw signature to it. * This makes it possible to compile a multisig signature using only raw signatures from external methods. * @param multisigTxnBlob - an encoded multisig txn. Supports non-payment txn types. * @param version - multisig version * @param threshold - multisig threshold * @param addrs - a list of Algorand addresses representing possible signers for this multisig. Order is important. * @param signerAddr - address of the signer * @param signature - raw multisig signature * @returns object containing txID, and blob representing encoded multisig txn */ export declare function appendSignRawMultisigSignature(multisigTxnBlob: Uint8Array, { version, threshold, addrs }: MultisigMetadata, signerAddr: string | Address, signature: Uint8Array): { txID: string; blob: Uint8Array; };