types

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2019 License: Apache-2.0 Imports: 3 Imported by: 11

Documentation

Index

Constants

View Source
const (
	// AppName is the name of the Cosmos app
	AppName = "TruChain"
	// StakeDenom is the name of the main staking currency
	StakeDenom = "utru"
	// Hostname is the address the app's HTTP server will bind to
	Hostname = "0.0.0.0"
	// Portname is the port the app's HTTP server will bind to
	Portname = "1337"
)
View Source
const (
	Preethi = 1
	Shanev  = 1000000 * Preethi
)

Coin units

Variables

View Source
var InitialStake = sdk.Coin{Amount: sdk.NewInt(300 * Shanev), Denom: StakeDenom}

InitialStake is an `sdk.Coins` representing the balance a new user is granted upon registration

View Source
var RegistrationFee = auth.StdFee{
	Amount: sdk.Coins{sdk.Coin{Amount: sdk.NewInt(1), Denom: StakeDenom}},
	Gas:    20000,
}

RegistrationFee is an `auth.StdFee` representing the coin and gas cost of registering a new account TODO: Use more accurate gas estimate [notduncansmith]

Functions

func KVGasConfig added in v0.3.1

func KVGasConfig() stypes.GasConfig

func NewShanevCoin

func NewShanevCoin(amount int64) sdk.Coin

NewShanevCoin returns the desired amount in shanevs

Types

type CompletedStoriesNotificationResult

type CompletedStoriesNotificationResult struct {
	Stories []CompletedStory `json:"stories"`
}

CompletedStoriesNotificationResult defines the notification result of completed stories in a new Block.

type CompletedStory

type CompletedStory struct {
	ID                          int64                       `json:"id"`
	Creator                     sdk.AccAddress              `json:"creator"`
	Backers                     []Staker                    `json:"backers"`
	Challengers                 []Staker                    `json:"challengers"`
	StakeDistributionResults    StakeDistributionResults    `json:"stake_destribution_results"`
	InterestDistributionResults InterestDistributionResults `json:"interest_destribution_results"`
}

CompletedStory defines a story result.

type Interest

type Interest struct {
	Account sdk.AccAddress `json:"account"`
	Amount  sdk.Coin       `json:"amount"`
	Rate    sdk.Int        `json:"rate"`
}

Interest represents the amount of interest earned by an user in trustake

type InterestDistributionResults

type InterestDistributionResults struct {
	TotalAmount sdk.Coin   `json:"total_amount"`
	Interests   []Interest `json:"interests"`
}

InterestDistributionResults contains how the interest was applied after a story completes.

type MsgResult

type MsgResult struct {
	ID int64 `json:"id"`
}

MsgResult is the default success response for a chain request

type StakeDistributionResults

type StakeDistributionResults struct {
	Type        StakeDistributionResultsType `json:"type"`
	TotalAmount sdk.Coin                     `json:"total_amount"`
	Rewards     []StakeReward                `json:"rewards"`
}

StakeDistributionResults contains how the stake was distributed after a story completes.

type StakeDistributionResultsType

type StakeDistributionResultsType int64

StakeDistributionResultsType indicates who wins the pool.

const (
	DistributionMajorityNotReached StakeDistributionResultsType = iota
	DistributionBackersWin
	DistributionChallengersWin
)

Distribution result constants

type StakeNotificationResult

type StakeNotificationResult struct {
	MsgResult
	StoryID int64          `json:"story_id"`
	From    sdk.AccAddress `json:"from,omitempty"`
	To      sdk.AccAddress `json:"to,omitempty"`
	Amount  sdk.Coin       `json:"amount"`
	Cred    *sdk.Coin      `json:"cred,omitempty"`
}

StakeNotificationResult defines data for a stake push notification

type StakeReward

type StakeReward struct {
	Account sdk.AccAddress `json:"account"`
	Amount  sdk.Coin       `json:"amount"`
}

StakeReward represents the amount of stake earned by an user.

type Staker

type Staker struct {
	Address sdk.AccAddress
	Amount  sdk.Coin
}

Staker represents a backer or challenger with the amount staked.

Jump to

Keyboard shortcuts

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