import { AuditDecryptedKeyParams, BaseCoin, BitGoBase, ExplanationResult, KeyPair, MPCAlgorithm, MultisigType, ParsedTransaction, ParseTransactionOptions, SignedTransaction, SignTransactionOptions, VerifyAddressOptions, VerifyTransactionOptions } from '@bitgo/sdk-core'; import { BaseCoin as StaticsBaseCoin, CoinFamily } from '@bitgo/statics'; import { Coin } from '@cosmjs/stargate'; import { Buffer } from 'buffer'; import { Hash } from 'crypto'; import * as request from 'superagent'; import { CosmosKeyPair, CosmosLikeCoinRecoveryOutput, CosmosTransaction, GasAmountDetails, RecoveryOptions, CosmosTransactionBuilder, KeyShares } from './lib'; /** * Cosmos accounts support memo Id based addresses */ interface AddressDetails { address: string; memoId?: string | undefined; } export declare class CosmosCoin extends BaseCoin { protected readonly _staticsCoin: Readonly; protected constructor(bitgo: BitGoBase, staticsCoin?: Readonly); static createInstance(bitgo: BitGoBase, staticsCoin?: Readonly): BaseCoin; /** * Creates an instance of TransactionBuilderFactory for the coin specific sdk */ getBuilder(): any; /** @inheritDoc **/ getBaseFactor(): string | number; /** @inheritDoc **/ getChain(): string; /** @inheritDoc **/ getFamily(): CoinFamily; /** @inheritDoc **/ getFullName(): string; /** @inheritDoc */ supportsTss(): boolean; /** inherited doc */ getDefaultMultisigType(): MultisigType; /** @inheritDoc **/ getMPCAlgorithm(): MPCAlgorithm; /** @inheritDoc **/ isValidPub(pub: string): boolean; /** @inheritDoc **/ isValidPrv(prv: string): boolean; isValidAddress(address: string): boolean; /** * Builds a funds recovery transaction without BitGo * @param {RecoveryOptions} params parameters needed to construct and * (maybe) sign the transaction * * @returns {CosmosLikeCoinRecoveryOutput} the serialized transaction hex string and index * of the address being swept */ recover(params: RecoveryOptions): Promise; /** * Validates the recovery parameters */ private validateRecoveryParams; /** * Checks if this is an unsigned sweep operation */ private isUnsignedSweep; /** * Gets sender details including address, public key and key shares */ private getSenderDetails; /** * Gets key shares from recovery parameters */ private getKeyShares; /** * Processes account balances and validates sufficient funds */ private processBalances; /** * Builds transaction messages for all balances */ private buildTransactionMessages; /** * Builds and signs the transaction */ private buildAndSignTransaction; /** * Signs the transaction with MPC */ /** * Signs the transaction using MPC (Multi-Party Computation) * @param unsignedTransaction The unsigned transaction to sign * @param txnBuilder The transaction builder instance * @param keyShares The key shares for MPC signing * @param publicKey The public key for verification * @returns The signed transaction output * @throws Error if validation fails or signing process encounters an error */ protected signTransactionWithMpc(unsignedTransaction: CosmosTransaction, txnBuilder: CosmosTransactionBuilder, keyShares: KeyShares, publicKey: string): Promise; /** * Builds a redelegate transaction * @param {RecoveryOptions} params parameters needed to construct and * (maybe) sign the transaction * * @returns {CosmosLikeCoinRecoveryOutput} the serialized transaction hex string */ redelegate(params: RecoveryOptions & { validatorSrcAddress: string; validatorDstAddress: string; amountToRedelegate: string; }): Promise; /** @inheritDoc **/ verifyTransaction(params: VerifyTransactionOptions): Promise; /** @inheritDoc **/ explainTransaction(options: { txHex: string; }): Promise; /** * Sign a transaction with a single private key * @param params parameters in the form of { txPrebuild: {txHex}, prv } * @returns signed transaction in the form of { txHex } */ signTransaction(params: SignTransactionOptions & { txPrebuild: { txHex: string; }; prv: string; }): Promise; /** @inheritDoc **/ parseTransaction(params: ParseTransactionOptions & { txHex: string; }): Promise; /** * Get the public node url from the Environments constant we have defined */ protected getPublicNodeUrl(): string; /** * Get account number from public node */ protected getAccountFromNode(senderAddress: string): Promise; /** * Get balance from public node */ protected getBalanceFromNode(senderAddress: string): Promise; /** * Get chain id from public node */ protected getChainIdFromNode(): Promise; /** * Helper to fetch account balance */ protected getAccountBalance(senderAddress: string): Promise; /** * Helper to fetch chainId */ protected getChainId(): Promise; /** * Helper to fetch account number */ protected getAccountDetails(senderAddress: string): Promise; /** @inheritDoc **/ generateKeyPair(seed?: Buffer): KeyPair; /** * Retrieves the address from a public key. * @param {string} pubKey - The public key. * @returns {string} The corresponding address. */ getAddressFromPublicKey(pubKey: string): string; /** @inheritDoc **/ isWalletAddress(params: VerifyAddressOptions): Promise; /** @inheritDoc **/ getHashFunction(): Hash; /** * Process address into address and memo id * * @param address the address * @returns object containing address and memo id */ getAddressDetails(address: string): AddressDetails; /** * Return boolean indicating whether a memo id is valid * * @param memoId memo id * @returns true if memo id is valid */ isValidMemoId(memoId: string): boolean; /** * Helper method to return the respective coin's base unit */ getDenomination(): string; /** * Helper method to fetch gas amount details for respective coin */ getGasAmountDetails(): GasAmountDetails; /** * Helper method to get key pair for individual coin * @param publicKey */ getKeyPair(publicKey: string): CosmosKeyPair; /** @inheritDoc **/ auditDecryptedKey({ multiSigType, publicKey, prv }: AuditDecryptedKeyParams): void; } export {}; //# sourceMappingURL=cosmosCoin.d.ts.map