cosmpy.staking package — cosmpy documentation

# cosmpy.staking package

## Submodules

## cosmpy.staking.interface module

Interface for the Staking functionality of CosmosSDK.

class cosmpy.staking.interface.Staking

  Bases: `abc.ABC`

  Staking abstract class.

  abstract Delegation(request: cosmos.staking.v1beta1.query_pb2.QueryDelegationRequest) → cosmos.staking.v1beta1.query_pb2.QueryDelegationResponse

    Delegation queries delegate info for given validator delegator pair.

  abstract DelegatorDelegations(request: cosmos.staking.v1beta1.query_pb2.QueryDelegatorDelegationsRequest) → cosmos.staking.v1beta1.query_pb2.QueryDelegatorDelegationsResponse

    DelegatorDelegations queries all delegations of a given delegator address.

  abstract DelegatorUnbondingDelegations(request: cosmos.staking.v1beta1.query_pb2.QueryDelegatorUnbondingDelegationsRequest) → cosmos.staking.v1beta1.query_pb2.QueryDelegatorUnbondingDelegationsResponse

    DelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.

  abstract DelegatorValidator(request: cosmos.staking.v1beta1.query_pb2.QueryDelegatorValidatorRequest) → cosmos.staking.v1beta1.query_pb2.QueryDelegatorValidatorResponse

    DelegatorValidator queries validator info for given delegator validator pair.

  abstract DelegatorValidators(request: cosmos.staking.v1beta1.query_pb2.QueryDelegatorValidatorsRequest) → cosmos.staking.v1beta1.query_pb2.QueryDelegatorValidatorsResponse

    DelegatorValidators queries all validators info for given delegator address.

  abstract HistoricalInfo(request: cosmos.staking.v1beta1.query_pb2.QueryHistoricalInfoRequest) → cosmos.staking.v1beta1.query_pb2.QueryHistoricalInfoResponse

    HistoricalInfo queries the historical info for given height.

  abstract Params(request: cosmos.staking.v1beta1.query_pb2.QueryParamsRequest) → cosmos.staking.v1beta1.query_pb2.QueryParamsResponse

    Parameters queries the staking parameters.

  abstract Pool(request: cosmos.staking.v1beta1.query_pb2.QueryPoolRequest) → cosmos.staking.v1beta1.query_pb2.QueryPoolResponse

    Pool queries the pool info.

  abstract Redelegations(request: cosmos.staking.v1beta1.query_pb2.QueryRedelegationsRequest) → cosmos.staking.v1beta1.query_pb2.QueryRedelegationsResponse

    Redelegations queries redelegations of given address.

  abstract UnbondingDelegation(request: cosmos.staking.v1beta1.query_pb2.QueryUnbondingDelegationRequest) → cosmos.staking.v1beta1.query_pb2.QueryUnbondingDelegationResponse

    UnbondingDelegation queries unbonding info for given validator delegator pair.

  abstract Validator(request: cosmos.staking.v1beta1.query_pb2.QueryValidatorRequest) → cosmos.staking.v1beta1.query_pb2.QueryValidatorResponse

    Validator queries validator info for given validator address.

  abstract ValidatorDelegations(request: cosmos.staking.v1beta1.query_pb2.QueryValidatorDelegationsRequest) → cosmos.staking.v1beta1.query_pb2.QueryValidatorDelegationsResponse

    ValidatorDelegations queries delegate info for given validator.

  abstract ValidatorUnbondingDelegations(request: cosmos.staking.v1beta1.query_pb2.QueryValidatorUnbondingDelegationsRequest) → cosmos.staking.v1beta1.query_pb2.QueryValidatorUnbondingDelegationsResponse

    ValidatorUnbondingDelegations queries unbonding delegations of a validator.

  abstract Validators(request: cosmos.staking.v1beta1.query_pb2.QueryValidatorsRequest) → cosmos.staking.v1beta1.query_pb2.QueryValidatorsResponse

    Validators queries all validators that match the given status.

## cosmpy.staking.rest_client module

Implementation of Staking interface using REST.

class cosmpy.staking.rest_client.StakingRestClient(rest_api: cosmpy.common.rest_client.RestClient)

  Bases: `cosmpy.staking.interface.Staking`

  Staking REST client.

  API_URL = '/cosmos/staking/v1beta1'
  Delegation(request: cosmos.staking.v1beta1.query_pb2.QueryDelegationRequest) → cosmos.staking.v1beta1.query_pb2.QueryDelegationResponse

    Delegation queries delegate info for given validator delegator pair.

  DelegatorDelegations(request: cosmos.staking.v1beta1.query_pb2.QueryDelegatorDelegationsRequest) → cosmos.staking.v1beta1.query_pb2.QueryDelegatorDelegationsResponse

    DelegatorDelegations queries all delegations of a given delegator address.

  DelegatorUnbondingDelegations(request: cosmos.staking.v1beta1.query_pb2.QueryDelegatorUnbondingDelegationsRequest) → cosmos.staking.v1beta1.query_pb2.QueryDelegatorUnbondingDelegationsResponse

    DelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.

  DelegatorValidator(request: cosmos.staking.v1beta1.query_pb2.QueryDelegatorValidatorRequest) → cosmos.staking.v1beta1.query_pb2.QueryDelegatorValidatorResponse

    DelegatorValidator queries validator info for given delegator validator pair.

  DelegatorValidators(request: cosmos.staking.v1beta1.query_pb2.QueryDelegatorValidatorsRequest) → cosmos.staking.v1beta1.query_pb2.QueryDelegatorValidatorsResponse

    DelegatorValidators queries all validators info for given delegator address.

  HistoricalInfo(request: cosmos.staking.v1beta1.query_pb2.QueryHistoricalInfoRequest) → cosmos.staking.v1beta1.query_pb2.QueryHistoricalInfoResponse

    HistoricalInfo queries the historical info for given height.

  Params(request: cosmos.staking.v1beta1.query_pb2.QueryParamsRequest) → cosmos.staking.v1beta1.query_pb2.QueryParamsResponse

    Parameters queries the staking parameters.

  Pool(request: cosmos.staking.v1beta1.query_pb2.QueryPoolRequest) → cosmos.staking.v1beta1.query_pb2.QueryPoolResponse

    Pool queries the pool info.

  Redelegations(request: cosmos.staking.v1beta1.query_pb2.QueryRedelegationsRequest) → cosmos.staking.v1beta1.query_pb2.QueryRedelegationsResponse

    Redelegations queries redelegations of given address.

  UnbondingDelegation(request: cosmos.staking.v1beta1.query_pb2.QueryUnbondingDelegationRequest) → cosmos.staking.v1beta1.query_pb2.QueryUnbondingDelegationResponse

    UnbondingDelegation queries unbonding info for given validator delegator pair.

  Validator(request: cosmos.staking.v1beta1.query_pb2.QueryValidatorRequest) → cosmos.staking.v1beta1.query_pb2.QueryValidatorResponse

    Validator queries validator info for given validator address.

  ValidatorDelegations(request: cosmos.staking.v1beta1.query_pb2.QueryValidatorDelegationsRequest) → cosmos.staking.v1beta1.query_pb2.QueryValidatorDelegationsResponse

    ValidatorDelegations queries delegate info for given validator.

  ValidatorUnbondingDelegations(request: cosmos.staking.v1beta1.query_pb2.QueryValidatorUnbondingDelegationsRequest) → cosmos.staking.v1beta1.query_pb2.QueryValidatorUnbondingDelegationsResponse

    ValidatorUnbondingDelegations queries unbonding delegations of a validator.

  Validators(request: cosmos.staking.v1beta1.query_pb2.QueryValidatorsRequest) → cosmos.staking.v1beta1.query_pb2.QueryValidatorsResponse

    Validators queries all validators that match the given status.

## Module contents

This package contains the Staking modules.