Documentation ¶
Index ¶
- Constants
- Variables
- func KVGasConfig() stypes.GasConfig
- func NewShanevCoin(amount int64) sdk.Coin
- type CompletedStoriesNotificationResult
- type CompletedStory
- type Interest
- type InterestDistributionResults
- type MsgResult
- type StakeDistributionResults
- type StakeDistributionResultsType
- type StakeNotificationResult
- type StakeReward
- type Staker
Constants ¶
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" )
const ( Preethi = 1 Shanev = 1000000 * Preethi )
Coin units
Variables ¶
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
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 NewShanevCoin ¶
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.