@firmachain/firma-js
Version:
The Official FirmaChain Javascript SDK written in Typescript
56 lines (55 loc) • 3.53 kB
TypeScript
import { StakingTxClient, TxMisc, ValidatorDataType, PoolDataType, ParamsDataType, DelegationInfo, RedelegationInfo, UndelegationInfo, Pagination } from "./firmachain/staking";
import { FirmaWalletService } from "./FirmaWalletService";
import { FirmaConfig } from "./FirmaConfig";
import { Description } from "cosmjs-types/cosmos/staking/v1beta1/staking";
import { MsgCreateValidator } from "cosmjs-types/cosmos/staking/v1beta1/tx";
import { DeliverTxResponse } from "@cosmjs/stargate";
import { Params as StakingParams } from "@kintsugi-tech/cosmjs-types/cosmos/staking/v1beta1/staking";
export declare enum StakingValidatorStatus {
ALL = "",
BONDED = "BOND_STATUS_BONDED",
UNBONDED = "BOND_STATUS_UNBONDED",
UNBONDING = "BOND_STATUS_UNBONDING"
}
export declare class FirmaStakingService {
private readonly config;
constructor(config: FirmaConfig);
getTxClient(wallet: FirmaWalletService): StakingTxClient;
getGasEstimationDelegate(wallet: FirmaWalletService, validatorAddres: string, amount: number, txMisc?: TxMisc): Promise<number>;
getGasEstimationUndelegate(wallet: FirmaWalletService, validatorAddres: string, amount: number, txMisc?: TxMisc): Promise<number>;
getGasEstimationRedelegate(wallet: FirmaWalletService, validatorSrcAddress: string, validatorDstAddress: string, amount: number, txMisc?: TxMisc): Promise<number>;
private getSignedTxDelegate;
private getSignedTxUndelegate;
private getSignedTxRedelegate;
private getSignedTxCreateValidator;
private getSignedTxEditValidator;
createValidator(wallet: FirmaWalletService, validatorInfo: MsgCreateValidator, txMisc?: TxMisc): Promise<DeliverTxResponse>;
editValidator(wallet: FirmaWalletService, validatorAddress: string, description: Description, commissionRate: string, minSelfDelegation: string, txMisc?: TxMisc): Promise<DeliverTxResponse>;
redelegate(wallet: FirmaWalletService, validatorSrcAddress: string, validatorDstAddress: string, amount: number, txMisc?: TxMisc): Promise<DeliverTxResponse>;
undelegate(wallet: FirmaWalletService, targetAddress: string, amount: number, txMisc?: TxMisc): Promise<DeliverTxResponse>;
delegate(wallet: FirmaWalletService, targetAddress: string, amount: number, txMisc?: TxMisc): Promise<DeliverTxResponse>;
getUndelegationInfoFromValidator(address: string, validatorAddress: string): Promise<UndelegationInfo>;
getDelegationInfoFromValidator(address: string, validatorAddress: string): Promise<DelegationInfo>;
getTotalUndelegateInfo(address: string): Promise<UndelegationInfo[]>;
getTotalRedelegationInfo(address: string): Promise<RedelegationInfo[]>;
getUndelegationListFromValidator(valoperAddress: string, paginationKey?: string): Promise<{
dataList: UndelegationInfo[];
pagination: Pagination;
}>;
getDelegationListFromValidator(valoperAddress: string, paginationKey?: string): Promise<{
dataList: DelegationInfo[];
pagination: Pagination;
}>;
getTotalDelegationInfo(address: string, paginationKey?: string): Promise<{
dataList: DelegationInfo[];
pagination: Pagination;
}>;
getParams(): Promise<ParamsDataType>;
getParamsAsStakingParams(): Promise<StakingParams>;
getPool(): Promise<PoolDataType>;
getValidator(valoperAddress: string): Promise<ValidatorDataType>;
getValidatorList(status?: StakingValidatorStatus, paginationKey?: string): Promise<{
dataList: ValidatorDataType[];
pagination: Pagination;
}>;
}