import { DelegateeDetails, DelegatorDetails } from '@airgap/coinlib-core'; import { DelegationDetails } from '@airgap/coinlib-core/protocols/ICoinDelegateProtocol'; import { Address, AirGapProtocol, AirGapTransaction, AirGapTransactionsWithCursor, Amount, Balance, CryptoDerivative, FeeDefaults, KeyPair, ProtocolMetadata, PublicKey, SecretKey, Signature, TransactionFullConfiguration, TransactionDetails } from '@airgap/module-kit'; import { AirGapDelegateProtocol } from '@airgap/module-kit/internal'; import { CosmosCryptoConfiguration } from '../types/crypto'; import { CosmosTransaction } from '../types/data/transaction/CosmosTransaction'; import { CosmosProtocolNetwork, CosmosProtocolOptions } from '../types/protocol'; import { CosmosDelegation, CosmosUnbondingDelegation, CosmosValidator } from '../types/rpc'; import { CosmosDelegationActionType, CosmosSignedTransaction, CosmosTransactionCursor, CosmosUnsignedTransaction } from '../types/transaction'; export interface CosmosBaseProtocol<_Units extends string> extends AirGapProtocol<{ AddressResult: Address; ProtocolNetwork: CosmosProtocolNetwork; CryptoConfiguration: CosmosCryptoConfiguration; SignedTransaction: CosmosSignedTransaction; TransactionCursor: CosmosTransactionCursor; Units: _Units; FeeEstimation: FeeDefaults<_Units>; UnsignedTransaction: CosmosUnsignedTransaction; }, 'Crypto', 'FetchDataForAddress'> { getKeyPairFromSecretKey(secretKey: SecretKey): Promise; } export interface CosmosBaseStakingProtocol<_Units extends string> extends CosmosBaseProtocol<_Units>, AirGapDelegateProtocol { prepareDelegatorActionFromPublicKey(publicKey: PublicKey, type: CosmosDelegationActionType, data?: { validator: Address; amount?: string; }): Promise; undelegate(publicKey: PublicKey, validatorAddress: Address, amount: Amount<_Units>, memo?: string): Promise; delegate(publicKey: PublicKey, validatorAddress: Address | string[], amount: Amount<_Units>, undelegate: boolean, memo?: string): Promise; withdrawDelegationRewards(publicKey: PublicKey, validatorAddresses: Address[], memo?: string): Promise; withdrawAllDelegationRewards(delegatorAddress: Address, fee: Amount<_Units>, memo?: string): Promise; fetchTotalReward(delegatorAddress: Address): Promise>; fetchRewardForDelegation(delegatorAddress: Address, validatorAddress: Address): Promise>; fetchDelegations(address: Address): Promise; fetchTotalDelegatedAmount(address: Address): Promise>; fetchValidator(address: Address): Promise; fetchValidators(): Promise; fetchUnbondingDelegations(delegatorAddress: Address): Promise; fetchTotalUnbondingAmount(address: Address): Promise>; fetchSelfDelegation(address: Address): Promise; } export declare abstract class CosmosBaseProtocolImpl<_Units extends string> implements CosmosBaseStakingProtocol<_Units> { protected readonly options: CosmosProtocolOptions<_Units>; private readonly nodeClient; private readonly cryptoClient; private readonly cryptoConfiguration; constructor(options: CosmosProtocolOptions<_Units>); getKeyPairFromSecretKey(secretKey: SecretKey): Promise; getCryptoConfiguration(): Promise; getKeyPairFromDerivative(derivative: CryptoDerivative): Promise; signTransactionWithSecretKey(transaction: CosmosUnsignedTransaction, secretKey: SecretKey): Promise; abstract getMetadata(): Promise>; getAddressFromPublicKey(publicKey: PublicKey): Promise; getDetailsFromTransaction(transaction: CosmosSignedTransaction | CosmosUnsignedTransaction, publicKey: PublicKey): Promise[]>; private getDetailsFromSignedTransaction; private getDetailsFromUnsignedTransaction; getNetwork(): Promise; getTransactionsForPublicKey(publicKey: PublicKey, limit: number, cursor?: CosmosTransactionCursor | undefined): Promise>; getBalanceOfPublicKey(publicKey: PublicKey, configuration?: undefined): Promise>; getTransactionMaxAmountWithPublicKey(publicKey: PublicKey, to: string[], configuration?: TransactionFullConfiguration<_Units> | undefined): Promise>; abstract getTransactionFeeWithPublicKey(publicKey: PublicKey, details: TransactionDetails<_Units>[]): Promise>; prepareTransactionWithPublicKey(publicKey: PublicKey, details: TransactionDetails<_Units>[], configuration?: TransactionFullConfiguration<_Units> | undefined): Promise; broadcastTransaction(transaction: CosmosSignedTransaction): Promise; signMessageWithKeyPair(message: string, keyPair: KeyPair): Promise; verifyMessageWithPublicKey(message: string, signature: Signature, publicKey: PublicKey): Promise; decryptAsymmetricWithKeyPair(payload: string, keyPair: KeyPair): Promise; encryptAsymmetricWithPublicKey(payload: string, publicKey: PublicKey): Promise; encryptAESWithSecretKey(payload: string, secretKey: SecretKey): Promise; decryptAESWithSecretKey(payload: string, secretKey: SecretKey): Promise; getTransactionsForAddress(address: string, limit: number, cursor?: CosmosTransactionCursor | undefined): Promise>; getBalanceOfAddress(address: string, _configuration?: undefined): Promise>; getDefaultDelegatee(): Promise; getCurrentDelegateesForPublicKey(publicKey: PublicKey): Promise; getCurrentDelegateesForAddress(address: string): Promise; getDelegateeDetails(address: string): Promise; isPublicKeyDelegating(publicKey: PublicKey): Promise; isAddressDelegating(address: string): Promise; getDelegatorDetailsFromPublicKey(publicKey: PublicKey): Promise; getDelegatorDetailsFromAddress(address: string): Promise; private getDelegatorDetails; private getAvailableDelegatorActions; getDelegationDetailsFromPublicKey(publicKey: PublicKey, delegatees: string[]): Promise; getDelegationDetailsFromAddress(address: string, delegatees: string[]): Promise; prepareDelegatorActionFromPublicKey(publicKey: PublicKey, type: CosmosDelegationActionType, data?: { validator: string; amount?: string; } | undefined): Promise; undelegate(publicKey: PublicKey, validatorAddress: string, amount: Amount<_Units>, memo?: string | undefined): Promise; delegate(publicKey: PublicKey, validatorAddress: string | string[], amount: Amount<_Units>, undelegate: boolean, memo?: string | undefined): Promise; withdrawDelegationRewards(publicKey: PublicKey, _validatorAddresses: string[], memo?: string | undefined): Promise; withdrawAllDelegationRewards(delegatorAddress: string, fee: Amount<_Units>, memo?: string | undefined): Promise; fetchTotalReward(delegatorAddress: string): Promise>; fetchRewardForDelegation(delegatorAddress: string, validatorAddress: string): Promise>; fetchDelegations(address: string): Promise; fetchTotalDelegatedAmount(address: string): Promise>; fetchValidator(address: string): Promise; fetchValidators(): Promise; fetchUnbondingDelegations(delegatorAddress: string): Promise; fetchTotalUnbondingAmount(address: string): Promise>; fetchSelfDelegation(address: string): Promise; }