rpc

package
v0.0.0-...-f705c6e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset interface {
	sdk.Module
	QueryTokens() (sdk.Tokens, error)
	QueryTokenDenom(denom string) (sdk.TokenData, error)
	QueryToken(symbol string) (sdk.Token, error)
}

type Bank

type Bank interface {
	sdk.Module
	QueryBalances(address, denom string) (sdk.Balances, sdk.Error)
	QueryAccount(address string) (sdk.BaseAccount, sdk.Error)
	QueryTokenStats(tokenID string) (TokenStats, sdk.Error)
	QueryTotalSupply() (sdk.Coins, sdk.Error)
	Send(to string, amount sdk.Coins, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)
	MultiSend(receipts Receipts, baseTx sdk.BaseTx) ([]sdk.ResultTx, sdk.Error)
	Burn(amount sdk.DecCoins, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)
	SetMemoRegexp(memoRegexp string, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)
	SubscribeSendTx(from, to string, callback EventMsgSendCallback) sdk.Subscription
}

expose bank module api for user

type BasicProposal

type BasicProposal struct {
	ProposalID      string      `json:"proposal_id"` //  ID of the proposal
	Status          string      `json:"status"`
	TallyResult     TallyResult `json:"tally_result"`      // Result of Tallys
	SubmitTime      time.Time   `json:"submit_time"`       // Time of the block where TxGovSubmitProposal was included
	DepositEndTime  time.Time   `json:"deposit_end_time"`  // Time that the Proposal would expire if deposit amount isn't met
	TotalDeposit    sdk.Coins   `json:"total_deposit"`     // Current deposit on this proposal. Initial value is set at InitialDeposit
	VotingStartTime time.Time   `json:"voting_start_time"` // Time of the block where MinDeposit was reached. -1 if MinDeposit is not reached
	VotingEndTime   time.Time   `json:"voting_end_time"`
}

func (BasicProposal) GetDepositEndTime

func (b BasicProposal) GetDepositEndTime() time.Time

func (BasicProposal) GetProposalID

func (b BasicProposal) GetProposalID() string

func (BasicProposal) GetStatus

func (b BasicProposal) GetStatus() string

func (BasicProposal) GetSubmitTime

func (b BasicProposal) GetSubmitTime() time.Time

func (BasicProposal) GetTallyResult

func (b BasicProposal) GetTallyResult() TallyResult

func (BasicProposal) GetTotalDeposit

func (b BasicProposal) GetTotalDeposit() sdk.Coins

func (BasicProposal) GetVotingEndTime

func (b BasicProposal) GetVotingEndTime() time.Time

func (BasicProposal) GetVotingStartTime

func (b BasicProposal) GetVotingStartTime() time.Time

type Commission

type Commission struct {
	CommissionRates `json:"commission_rates"`
	UpdateTime      string `json:"update_time"`
}

type CommissionRates

type CommissionRates struct {
	Rate          string `json:"rate"`
	MaxRate       string `json:"max_rate"`
	MaxChangeRate string `json:"max_change_rate"`
}

type CommunityTaxUsageProposal

type CommunityTaxUsageProposal struct {
	Proposal
	TaxUsage TaxUsage `json:"tax_usage"`
}

type Delegation

type Delegation struct {
	DelegatorAddress string `json:"delegator_address"`
	ValidatorAddress string `json:"validator_address"`
	Shares           string `json:"shares"`
}

type DelegationResponse

type DelegationResponse struct {
	Delegation Delegation `json:"delegation"`
	Balance    sdk.Coin   `json:"balance"`
}

type DelegationResponses

type DelegationResponses []DelegationResponse

type DelegationsRewards

type DelegationsRewards struct {
	Validator string       `json:"validator"`
	Reward    sdk.DecCoins `json:"reward"`
}

type Deposit

type Deposit struct {
	Depositor  string
	ProposalID uint64
	Amount     sdk.Coins
}

type Description

type Description struct {
	Moniker  string `json:"moniker"`
	Identity string `json:"identity"`
	Website  string `json:"website"`
	Details  string `json:"details"`
}

type Distribution

type Distribution interface {
	sdk.Module
	QueryRewards(delAddrOrValAddr string) (Rewards, sdk.Error)
	QueryWithdrawAddr(delAddrOrValAddr string) (string, sdk.Error)
	QueryCommission(validator string) (ValidatorAccumulatedCommission, sdk.Error)
	SetWithdrawAddr(withdrawAddr string, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)
	WithdrawRewards(isValidator bool, onlyFromValidator string, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)
}

type EarnedFees

type EarnedFees struct {
	Address sdk.AccAddress `json:"address"`
	Coins   sdk.Coins      `json:"coins"`
}

EarnedFees defines a struct for the fees earned by the provider

type EventDataMsgEditValidator

type EventDataMsgEditValidator struct {
	Height         int64       `json:"height"`
	Hash           string      `json:"hash"`
	Description    Description `json:"description"`
	Address        string      `json:"address"`
	CommissionRate string      `json:"commission_rate"`
}

type EventDataMsgSend

type EventDataMsgSend struct {
	Height int64      `json:"height"`
	Hash   string     `json:"hash"`
	From   string     `json:"from"`
	To     string     `json:"to"`
	Amount []sdk.Coin `json:"amount"`
}

type EventMsgSendCallback

type EventMsgSendCallback func(EventDataMsgSend)

type EventRequestRandomCallback

type EventRequestRandomCallback func(reqID, randomNum string, err sdk.Error)

type Feed

type Feed struct {
	FeedName         string `json:"feed_name"`
	Description      string `json:"description"`
	AggregateFunc    string `json:"aggregate_func"`
	ValueJsonPath    string `json:"value_json_path"`
	LatestHistory    uint64 `json:"latest_history"`
	RequestContextID string `json:"request_context_id"`
	Creator          string `json:"creator"`
}

type FeedContext

type FeedContext struct {
	Feed              Feed      `json:"feed"`
	ServiceName       string    `json:"service_name"`
	Providers         []string  `json:"providers"`
	Input             string    `json:"input"`
	Timeout           int64     `json:"timeout"`
	ServiceFeeCap     sdk.Coins `json:"service_fee_cap"`
	RepeatedFrequency uint64    `json:"repeated_frequency"`
	ResponseThreshold uint16    `json:"response_threshold"`
	State             string    `json:"state"`
}

type FeedCreateRequest

type FeedCreateRequest struct {
	sdk.BaseTx
	FeedName          string       `json:"feed_name"`
	LatestHistory     uint64       `json:"latest_history"`
	Description       string       `json:"description"`
	ServiceName       string       `json:"service_name"`
	Providers         []string     `json:"providers"`
	Input             string       `json:"input"`
	Timeout           int64        `json:"timeout"`
	ServiceFeeCap     sdk.DecCoins `json:"service_fee_cap"`
	RepeatedFrequency uint64       `json:"repeated_frequency"`
	AggregateFunc     string       `json:"aggregate_func"`
	ValueJsonPath     string       `json:"value_json_path"`
	ResponseThreshold uint16       `json:"response_threshold"`
}

FeedCreateRequest - struct for create a feed

type FeedEditRequest

type FeedEditRequest struct {
	sdk.BaseTx
	FeedName          string       `json:"feed_name"`
	Description       string       `json:"description"`
	LatestHistory     uint64       `json:"latest_history"`
	Providers         []string     `json:"providers"`
	Timeout           int64        `json:"timeout"`
	ServiceFeeCap     sdk.DecCoins `json:"service_fee_cap"`
	RepeatedFrequency uint64       `json:"repeated_frequency"`
	ResponseThreshold uint16       `json:"response_threshold"`
}

FeedEditRequest - struct for edit a existed feed

type FeedValue

type FeedValue struct {
	Data      string    `json:"data"`
	Timestamp time.Time `json:"timestamp"`
}

type Gov

type Gov interface {
	sdk.Module
	Deposit(proposalID uint64, amount sdk.DecCoins, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)
	Vote(proposalID uint64, option VoteOption, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)

	QueryProposal(proposalID uint64) (Proposal, sdk.Error)
	QueryProposals(request ProposalRequest) ([]Proposal, sdk.Error)

	QueryVote(proposalID uint64, voter string) (Vote, sdk.Error)
	QueryVotes(proposalID uint64) ([]Vote, sdk.Error)

	QueryDeposit(proposalID uint64, depositor string) (Deposit, sdk.Error)
	QueryDeposits(proposalID uint64) ([]Deposit, sdk.Error)

	QueryTally(proposalID uint64) (TallyResult, sdk.Error)
}

type HTLC

type HTLC struct {
	Sender           string
	To               string
	Amount           sdk.Coins
	Secret           string
	ExpirationHeight uint64
	State            int32
}

type Htlc

type Htlc interface {
	sdk.Module
	QueryHtlc(hashLock string) (HTLC, sdk.Error)
}

type Keys

type Keys interface {
	sdk.Module
	Add(name, password string) (address string, mnemonic string, err sdk.Error)
	Recover(name, password, mnemonic string) (address string, err sdk.Error)
	Import(name, password, keystore string) (address string, err sdk.Error)
	Export(name, password, encryptKeystorePwd string) (keystore string, err sdk.Error)
	Delete(name string) sdk.Error
	Show(name string) (string, sdk.Error)
}

type Oracle

type Oracle interface {
	sdk.Module
	OracleTx
	OracleQuery
}

type OracleQuery

type OracleQuery interface {
	QueryFeed(feedName string) (feed FeedContext, err sdk.Error)
	QueryFeeds(state string) (feed []FeedContext, err sdk.Error)
	QueryFeedValue(feedName string) (value []FeedValue, err sdk.Error)
}

type OracleTx

type OracleTx interface {
	CreateFeed(request FeedCreateRequest) (result sdk.ResultTx, err sdk.Error)
	StartFeed(feedName string, baseTx sdk.BaseTx) (result sdk.ResultTx, err sdk.Error)
	CreateAndStartFeed(request FeedCreateRequest) (result sdk.ResultTx, err sdk.Error)
	PauseFeed(feedName string, baseTx sdk.BaseTx) (result sdk.ResultTx, err sdk.Error)
	EditFeed(request FeedEditRequest) (result sdk.ResultTx, err sdk.Error)
	SubscribeFeedValue(feedName string, callback func(value FeedValue)) sdk.Error
}

type Param

type Param struct {
	Subspace string `json:"subspace"`
	Key      string `json:"key"`
	SubKey   string `json:"sub_key,omitempty"`
	Value    string `json:"value"`
}

type ParameterProposal

type ParameterProposal struct {
	Proposal
	Params []Param `json:"params"`
}

type Params

type Params interface {
	sdk.Module
	QueryParams(subspace, key string) (SubspaceParamsResponse, sdk.Error)
}

type PlainTextProposal

type PlainTextProposal struct {
	Proposal
}

type Proposal

type Proposal interface {
	GetProposalID() string
	GetStatus() string
	GetTallyResult() TallyResult
	GetSubmitTime() time.Time
	GetDepositEndTime() time.Time
	GetTotalDeposit() sdk.Coins
	GetVotingStartTime() time.Time
	GetVotingEndTime() time.Time
}

type ProposalRequest

type ProposalRequest struct {
	Voter          string
	Depositor      string
	ProposalStatus string
	Limit          uint64
}

type ProtocolDefinition

type ProtocolDefinition struct {
	Version   uint64 `json:"version"`
	Software  string `json:"software"`
	Height    uint64 `json:"height"`
	Threshold string `json:"threshold"`
}

type Random

type Random interface {
	sdk.Module
	Request(request RandomRequest, baseTx sdk.BaseTx) (reqID string, err sdk.Error)
	QueryRandom(reqID string) (ResponseRandom, sdk.Error)
	QueryRequests(height int64) ([]RequestRandom, sdk.Error)
	SubscribeRandom(requestID string, callback EventRequestRandomCallback) (sdk.Subscription, sdk.Error)
}

type RandomRequest

type RandomRequest struct {
	BlockInterval uint64       `json:"block_interval"`  // block interval after which the requested random number will be generated
	Oracle        bool         `json:"oracle"`          // oracle method
	ServiceFeeCap sdk.DecCoins `json:"service_fee_cap"` // service fee cap
	Callback      EventRequestRandomCallback
}

type Receipt

type Receipt struct {
	Address string       `json:"address"`
	Amount  sdk.DecCoins `json:"amount"`
}

type Receipts

type Receipts []Receipt

func (Receipts) Len

func (r Receipts) Len() int

func (Receipts) Sub

func (r Receipts) Sub(begin, end int) sdk.SplitAble

type Redelegation

type Redelegation struct {
	DelegatorAddress    string              `json:"delegator_address"`
	ValidatorSrcAddress string              `json:"validator_src_address,omitempty"`
	ValidatorDstAddress string              `json:"validator_dst_address"`
	Entries             []RedelegationEntry `json:"entries"`
}

type RedelegationEntry

type RedelegationEntry struct {
	CreationHeight int32     `json:"creation_height"`
	CompletionTime time.Time `json:"completion_time"`
	InitialBalance sdk.Int   `json:"initial_balance"`
	SharesDst      sdk.Dec   `json:"shares_dst"`
}

type RedelegationEntryResponse

type RedelegationEntryResponse struct {
	RedelegationEntry RedelegationEntry `json:"redelegation_entry"`
	Balance           sdk.Int           `json:"balance"`
}

type RedelegationResponse

type RedelegationResponse struct {
	Redelegation Redelegation                `json:"redelegation"`
	Entries      []RedelegationEntryResponse `json:"entries"`
}

type RedelegationResponses

type RedelegationResponses []RedelegationResponse

type RequestContext

type RequestContext struct {
	ServiceName        string           `json:"service_name"`
	Providers          []sdk.AccAddress `json:"providers"`
	Consumer           sdk.AccAddress   `json:"consumer"`
	Input              string           `json:"input"`
	ServiceFeeCap      sdk.Coins        `json:"service_fee_cap"`
	ModuleName         string           `json:"module_name"`
	Timeout            int64            `json:"timeout"`
	SuperMode          bool             `json:"super_mode"`
	Repeated           bool             `json:"repeated"`
	RepeatedFrequency  uint64           `json:"repeated_frequency"`
	RepeatedTotal      int64            `json:"repeated_total"`
	BatchCounter       uint64           `json:"batch_counter"`
	BatchRequestCount  uint32           `json:"batch_request_count"`
	BatchResponseCount uint32           `json:"batch_response_count"`
	ResponseThreshold  uint32           `json:"response_threshold"`
	BatchState         int32            `json:"batch_state"`
	State              int32            `json:"state"`
}

RequestContext defines a context which holds request-related data

type RequestRandom

type RequestRandom struct {
	Height        int64     `json:"height"`          // the height of the block in which the request tx is included
	Consumer      string    `json:"consumer"`        // the request address
	TxHash        string    `json:"tx_hash"`         // the request tx hash
	Oracle        bool      `json:"oracle"`          // oracle method
	ServiceFeeCap sdk.Coins `json:"service_fee_cap"` // service fee cap
}

RequestRandom represents a request for a random number

type ResponseRandom

type ResponseRandom struct {
	RequestTxHash string `json:"request_tx_hash"` // the original request tx hash
	Height        int64  `json:"height"`          // the height of the block used to generate the random number
	Value         string `json:"value"`           // the actual random number
}

ResponseRandom represents a random number with related data

type ResultValidators

type ResultValidators struct {
	BlockHeight int64           `json:"block_height"`
	Validators  []sdk.Validator `json:"validators"`
	Count       int             `json:"count"`
	Total       int             `json:"total"`
}

Validators for a height.

type Rewards

type Rewards struct {
	Rewards []DelegationsRewards `json:"rewards"`
	Total   sdk.DecCoins         `json:"total"`
}

type Service

type Service interface {
	sdk.Module
	ServiceTx
	ServiceQuery
}

type ServiceBinding

type ServiceBinding struct {
	ServiceName  string    `json:"service_name"`
	Provider     string    `json:"provider"`
	Deposit      sdk.Coins `json:"deposit"`
	Pricing      string    `json:"pricing"`
	Qos          uint64    `json:"qos"`
	Available    bool      `json:"available"`
	DisabledTime time.Time `json:"disabled_time"`
	Owner        string    `json:"owner"`
}

ServiceBinding defines a struct for service binding

type ServiceBindingRequest

type ServiceBindingRequest struct {
	ServiceName string       `json:"service_name"`
	Deposit     sdk.DecCoins `json:"deposit"`
	Pricing     string       `json:"pricing"`
	MinRespTime uint64       `json:"min_resp_time"`
}

type ServiceBindingUpdateRequest

type ServiceBindingUpdateRequest struct {
	ServiceName string       `json:"service_name"`
	Deposit     sdk.DecCoins `json:"deposit"`
	Pricing     string       `json:"pricing"`
}

ServiceBindingUpdateRequest defines a message to update a service binding

type ServiceDefinition

type ServiceDefinition struct {
	Name              string         `json:"name"`
	Description       string         `json:"description"`
	Tags              []string       `json:"tags"`
	Author            sdk.AccAddress `json:"author"`
	AuthorDescription string         `json:"author_description"`
	Schemas           string         `json:"schemas"`
}

ServiceDefinition represents a service definition

type ServiceDefinitionRequest

type ServiceDefinitionRequest struct {
	ServiceName       string   `json:"service_name"`
	Description       string   `json:"description"`
	Tags              []string `json:"tags"`
	AuthorDescription string   `json:"author_description"`
	Schemas           string   `json:"schemas"`
}

type ServiceInvocationRequest

type ServiceInvocationRequest struct {
	ServiceName       string       `json:"service_name"`
	Providers         []string     `json:"providers"`
	Input             string       `json:"input"`
	ServiceFeeCap     sdk.DecCoins `json:"service_fee_cap"`
	Timeout           int64        `json:"timeout"`
	SuperMode         bool         `json:"super_mode"`
	Repeated          bool         `json:"repeated"`
	RepeatedFrequency uint64       `json:"repeated_frequency"`
	RepeatedTotal     int64        `json:"repeated_total"`
	Callback          ServiceInvokeCallback
}

type ServiceInvokeCallback

type ServiceInvokeCallback func(reqCtxID, reqID, responses string)

type ServiceQuery

type ServiceQuery interface {
	QueryDefinition(serviceName string) (ServiceDefinition, sdk.Error)

	QueryBinding(serviceName string, provider sdk.AccAddress) (ServiceBinding, sdk.Error)
	QueryBindings(serviceName string) ([]ServiceBinding, sdk.Error)

	QueryRequest(requestID string) (ServiceRequest, sdk.Error)
	QueryRequests(serviceName string, provider sdk.AccAddress) ([]ServiceRequest, sdk.Error)
	QueryRequestsByReqCtx(requestContextID string, batchCounter uint64) ([]ServiceRequest, sdk.Error)

	QueryResponse(requestID string) (ServiceResponse, sdk.Error)
	QueryResponses(requestContextID string, batchCounter uint64) ([]ServiceResponse, sdk.Error)

	QueryRequestContext(requestContextID string) (RequestContext, sdk.Error)
	QueryFees(provider string) (EarnedFees, sdk.Error)
}

type ServiceRegistry

type ServiceRegistry map[string]ServiceRespondCallback

type ServiceRequest

type ServiceRequest struct {
	ID                         string         `json:"id"`
	ServiceName                string         `json:"service_name"`
	Provider                   sdk.AccAddress `json:"provider"`
	Consumer                   sdk.AccAddress `json:"consumer"`
	Input                      string         `json:"input"`
	ServiceFee                 sdk.Coins      `json:"service_fee"`
	SuperMode                  bool           `json:"super_mode"`
	RequestHeight              int64          `json:"request_height"`
	ExpirationHeight           int64          `json:"expiration_height"`
	RequestContextID           string         `json:"request_context_id"`
	RequestContextBatchCounter uint64         `json:"request_context_batch_counter"`
}

ServiceRequest defines a request which contains the detailed request data

type ServiceRespondCallback

type ServiceRespondCallback func(reqCtxID, reqID, input string) (output string, result string)

type ServiceResponse

type ServiceResponse struct {
	Provider                   sdk.AccAddress `json:"provider"`
	Consumer                   sdk.AccAddress `json:"consumer"`
	Output                     string         `json:"output"`
	Result                     string         `json:"error"`
	RequestContextID           string         `json:"request_context_id"`
	RequestContextBatchCounter uint64         `json:"request_context_batch_counter"`
}

ServiceResponse defines a response

type ServiceTx

type ServiceTx interface {
	DefineService(request ServiceDefinitionRequest, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)

	BindService(request ServiceBindingRequest, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)

	UpdateServiceBinding(request ServiceBindingUpdateRequest, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)

	InvokeService(request ServiceInvocationRequest, baseTx sdk.BaseTx) (requestContextID string, err sdk.Error)

	SetWithdrawAddress(withdrawAddress string, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)

	DisableServiceBinding(serviceName string, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)

	EnableServiceBinding(serviceName string,
		deposit sdk.DecCoins, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)

	RefundServiceDeposit(serviceName string, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)

	PauseRequestContext(requestContextID string, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)

	StartRequestContext(requestContextID string, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)

	KillRequestContext(requestContextID string, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)

	UpdateRequestContext(request UpdateContextRequest, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)

	WithdrawEarnedFees(baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)

	WithdrawTax(destAddress string,
		amount sdk.DecCoins, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)

	SubscribeServiceRequest(serviceRegistry ServiceRegistry, baseTx sdk.BaseTx) (sdk.Subscription, sdk.Error)

	SubscribeSingleServiceRequest(serviceName string,
		callback ServiceRespondCallback,
		baseTx sdk.BaseTx) (sdk.Subscription, sdk.Error)

	SubscribeServiceResponse(reqCtxID string,
		callback ServiceInvokeCallback) (sdk.Subscription, sdk.Error)
}

type Slashing

type Slashing interface {
	sdk.Module
	QueryParams() (SlashingParams, sdk.Error)
	QueryValidatorSigningInfo(validatorConPubKey string) (ValidatorSigningInfo, sdk.Error)
}

type SlashingParams

type SlashingParams struct {
	MaxEvidenceAge          string `json:"max_evidence_age"`
	SignedBlocksWindow      int64  `json:"signed_blocks_window"`
	MinSignedPerWindow      string `json:"min_signed_per_window"`
	DoubleSignJailDuration  string `json:"double_sign_jail_duration"`
	DowntimeJailDuration    string `json:"downtime_jail_duration"`
	SlashFractionDoubleSign string `json:"slash_fraction_double_sign"`
	SlashFractionDowntime   string `json:"slash_fraction_downtime"`
}

type SoftwareUpgradeProposal

type SoftwareUpgradeProposal struct {
	Proposal
	ProtocolDefinition
}

type StakeParams

type StakeParams struct {
	UnbondingTime string `json:"unbonding_time"`
	MaxValidators int    `json:"max_validators"`
}

type StakePool

type StakePool struct {
	NotBondedTokens string `json:"not_bonded_tokens"`
	BondedTokens    string `json:"bonded_tokens"`
}

type Staking

type Staking interface {
	sdk.Module
	StakingTx
	StakingQueries
	StakingSubscriber
}

type StakingQueries

type StakingQueries interface {
	QueryDelegation(delAddr, valAddr string) (Delegation, sdk.Error)
	QueryDelegations(delAddr string) (DelegationResponses, sdk.Error)
	QueryDelegationsTo(valAddr string) (DelegationResponses, sdk.Error)

	QueryUnbondingDelegations(delAddr string) (UnbondingDelegations, sdk.Error)
	QueryUnbondingDelegationsFrom(valAddr string) (UnbondingDelegations, sdk.Error)

	QueryRedelegationsFrom(valAddr string) (RedelegationResponses, sdk.Error)

	QueryValidator(address string) (Validator, sdk.Error)
	QueryValidators(status string, page, size int) (Validators, sdk.Error)

	QueryPool() (StakePool, sdk.Error)
	QueryParams() (StakeParams, sdk.Error)
}

type StakingSubscriber

type StakingSubscriber interface {
	SubscribeValidatorInfoUpdates(validator string,
		handler func(data EventDataMsgEditValidator)) (sdk.Subscription, sdk.Error)
}

type StakingTx

type StakingTx interface {
	Delegate(valAddr string, amount sdk.DecCoin, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)
	Undelegate(valAddr string, amount sdk.DecCoin, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)
	Redelegate(srcValAddr,
		dstValAddr string,
		amount sdk.DecCoin,
		baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error)
}

type SubspaceParamsResponse

type SubspaceParamsResponse struct {
	Subspace string
	Key      string
	Value    string
}

type TallyResult

type TallyResult struct {
	Yes               string `json:"yes"`
	Abstain           string `json:"abstain"`
	No                string `json:"no"`
	NoWithVeto        string `json:"no_with_veto"`
	SystemVotingPower string `json:"system_voting_power,omitempty"`
}

TallyResult defines a standard tally for a proposal

type TaxUsage

type TaxUsage struct {
	Usage       string `json:"usage"`
	DestAddress string `json:"dest_address"`
	Percent     string `json:"percent"`
}

type Tendermint

type Tendermint interface {
	sdk.Module
	QueryBlock(height int64) (sdk.Block, sdk.Error)
	QueryBlockLatest() (sdk.Block, sdk.Error)
	QueryBlockResult(height int64) (sdk.BlockResult, sdk.Error)
	QueryTx(hash string) (sdk.ResultQueryTx, sdk.Error)
	SearchTxs(builder *sdk.EventQueryBuilder, page, size int) (sdk.ResultSearchTxs, sdk.Error)
	QueryValidators(height int64) (ResultValidators, sdk.Error)
	QueryValidatorsLatest() (ResultValidators, sdk.Error)
	QueryNodeInfo() (sdk.ResultStatus, sdk.Error)
	QueryNodeVersion() (string, sdk.Error)
	QueryGenesis() (sdk.GenesisDoc, sdk.Error)
}

type TokenFees

type TokenFees struct {
	Exist    bool     `json:"exist"`     // indicate if the token has existed
	IssueFee sdk.Coin `json:"issue_fee"` // issue fee
	MintFee  sdk.Coin `json:"mint_fee"`  // mint fee
}

TokenFees is for the token fees query output

type TokenStats

type TokenStats struct {
	LooseTokens  sdk.Coins `json:"loose_tokens"`
	BondedTokens sdk.Coins `json:"bonded_tokens"`
	BurnedTokens sdk.Coins `json:"burned_tokens"`
	TotalSupply  sdk.Coins `json:"total_supply"`
}

type UnbondingDelegation

type UnbondingDelegation struct {
	DelegatorAddress string                     `json:"delegator_address"`
	ValidatorAddress string                     `json:"validator_address"`
	Entries          []UnbondingDelegationEntry `json:"entries"`
}

type UnbondingDelegationEntry

type UnbondingDelegationEntry struct {
	CreationHeight int64     `json:"creation_height,omitempty"`
	CompletionTime time.Time `json:"completion_time"`
	InitialBalance sdk.Int   `json:"initial_balance"`
	Balance        sdk.Int   `json:"balance"`
}

type UnbondingDelegations

type UnbondingDelegations []UnbondingDelegation

type UpdateContextRequest

type UpdateContextRequest struct {
	RequestContextID  string       `json:"request_context_id"`
	Providers         []string     `json:"providers"`
	ServiceFeeCap     sdk.DecCoins `json:"service_fee_cap"`
	Timeout           int64        `json:"timeout"`
	RepeatedFrequency uint64       `json:"repeated_frequency"`
	RepeatedTotal     int64        `json:"repeated_total"`
}

UpdateContextRequest defines a message to update a request context

type Validator

type Validator struct {
	OperatorAddress   string      `json:"operator_address"`
	ConsensusPubkey   string      `json:"consensus_pubkey"`
	Jailed            bool        `json:"jailed"`
	Status            string      `json:"status"`
	Tokens            string      `json:"tokens"`
	DelegatorShares   string      `json:"delegator_shares"`
	Description       Description `json:"description"`
	UnbondingHeight   int64       `json:"unbonding_height"`
	UnbondingTime     string      `json:"unbonding_time"`
	Commission        Commission  `json:"commission"`
	MinSelfDelegation string      `json:"min_self_delegation"`
}

func (Validator) DelegatorShareExRate

func (v Validator) DelegatorShareExRate() sdk.Dec

DelegatorShareExRate gets the exchange rate of tokens over delegator shares. UNITS: tokens/delegator-shares

type ValidatorAccumulatedCommission

type ValidatorAccumulatedCommission struct {
	Commission sdk.DecCoins `json:"commission"`
}

type ValidatorSigningInfo

type ValidatorSigningInfo struct {
	Address             string    `json:"address"`               // validator consensus address
	StartHeight         int64     `json:"start_height"`          // height at which validator was first a candidate OR was unjailed
	IndexOffset         int64     `json:"index_offset"`          // index offset into signed block bit array
	JailedUntil         time.Time `json:"jailed_until"`          // timestamp validator cannot be unjailed until
	Tombstoned          bool      `json:"tombstoned"`            // whether or not a validator has been tombstoned (killed out of validator set)
	MissedBlocksCounter int64     `json:"missed_blocks_counter"` // missed blocks counter (to avoid scanning the array every time)
}

ValidatorSigningInfo defines the signing info for a validator

type Validators

type Validators []Validator

type Vote

type Vote struct {
	Voter      string
	ProposalID uint64
	Option     string
}

type VoteOption

type VoteOption string
const (
	Yes        VoteOption = "Yes"
	No         VoteOption = "No"
	NoWithVeto VoteOption = "NoWithVeto"
	Abstain    VoteOption = "Abstain"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL