Documentation ¶
Index ¶
- Constants
- type Address
- type AddressLiquidityPool
- type AggregatedReward
- type Balance
- type BalanceUpdateData
- type Block
- type BlockAddresses
- type BlockValidator
- type BlockValidators
- type BuyCoinTxData
- type Check
- type Coin
- type CoinType
- type CreateCoinTxData
- type CreateMultisigTxData
- type DeclareCandidacyTxData
- type DelegateTxData
- type EditCandidateTxData
- type InvalidTransaction
- type LiquidityPool
- type LiquidityPoolSnapshot
- type LiquidityPoolTrade
- type MultiSendTxData
- type RedeemCheckTxData
- type Reward
- type SellAllCoinTxData
- type SellCoinTxData
- type SendTxData
- type SetCandidateTxData
- type Slash
- type Stake
- type TagLiquidityPool
- type Transaction
- type TransactionLiquidityPool
- type TransactionOutput
- type TransactionValidator
- type Unbond
- type UnbondTxData
- type Validator
- type ValidatorBan
- type ValidatorPublicKeys
Constants ¶
View Source
const LockedLiquidityVolume = 1000
View Source
const RewardEvent = "minter/RewardEvent"
View Source
const SlashEvent = "minter/SlashEvent"
View Source
const ValidatorStatusNotReady = 1
View Source
const ValidatorStatusReady = 2
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { ID uint `json:"id" pg:",pk"` Address string `json:"address" pg:"type:varchar(64)"` Balances []*Balance `json:"balances" pg:"rel:has-many"` //relation has many to Balances Rewards []*Reward `json:"rewards" pg:"rel:has-many"` //relation has many to Rewards Slashes []*Slash `json:"slashes" pg:"rel:has-many"` //relation has many to Slashes Transactions []*Transaction `json:"transactions" pg:"rel:has-many,fk:from_address_id"` //relation has many to Transactions InvalidTransactions []*InvalidTransaction `json:"invalid_transactions" pg:"rel:has-many,fk:from_address_id"` //relation has many to InvalidTransactions }
func (*Address) GetAddress ¶
GetAddress Return address with prefix
type AddressLiquidityPool ¶ added in v2.12.0
type AddressLiquidityPool struct { LiquidityPoolId uint64 `json:"liquidity_pool_id" pg:",pk"` AddressId uint64 `json:"address_id" pg:",pk"` FirstCoinVolume string `json:"first_coin_volume"` SecondCoinVolume string `json:"second_coin_volume"` Liquidity string `json:"liquidity"` Address *Address `json:"first_coin" pg:"rel:has-one,fk:address_id"` LiquidityPool *LiquidityPool `json:"liquidity_pool" pg:"rel:has-one,fk:liquidity_pool_id"` }
type AggregatedReward ¶
type AggregatedReward struct { FromBlockID uint64 `json:"from_block_id" pg:",pk"` ToBlockID uint64 `json:"to_block_id"` AddressID uint64 `json:"address_id" pg:",pk"` ValidatorID uint64 `json:"validator_id" pg:",pk"` Role string `json:"role" pg:",pk"` Amount string `json:"amount" pg:"type:numeric(70)"` TimeID time.Time `json:"time_id"` FromBlock *Block `pg:"rel:has-one,fk:from_block_id"` //Relation has one to Blocks ToBlock *Block `pg:"rel:has-one,fk:to_block_id"` //Relation has one to Blocks Address *Address `pg:"rel:has-one"` //Relation has one to Addresses Validator *Validator `pg:"rel:has-one"` //Relation has one to Validators }
type BalanceUpdateData ¶ added in v2.14.14
type BalanceUpdateData struct { Block *api_pb.BlockResponse Event *api_pb.EventsResponse }
type Block ¶
type Block struct { ID uint64 `json:"id" pg:",pk"` Size uint64 `json:"size"` ProposerValidatorID uint64 `json:"proposer_validator_id"` NumTxs uint32 `json:"num_txs" pg:"default:0"` BlockTime uint64 `json:"block_time"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` BlockReward string `json:"block_reward" pg:"type:numeric(70)"` Hash string `json:"hash"` Proposer *Validator `json:"proposer" pg:"rel:has-one,fk:proposer_validator_id"` //relation has one to Validators Validators []*Validator `json:"validators" pg:"many2many:block_validator"` //relation has many to Validators Transactions []*Transaction `json:"transactions" pg:"rel:has-many"` //relation has many to Transactions InvalidTransactions []*InvalidTransaction `json:"invalid_transactions" pg:"rel:has-many"` //relation has many to InvalidTransactions Rewards []*Reward `json:"rewards" pg:"rel:has-many"` //relation has many to Rewards Slashes []*Slash `json:"slashes" pg:"rel:has-many"` //relation has many to Slashes BlockValidators []BlockValidator `json:"block_validators" pg:"rel:has-many"` }
type BlockAddresses ¶
type BlockValidator ¶
type BlockValidators ¶
type BuyCoinTxData ¶
type Check ¶ added in v2.12.0
type Check struct { TransactionID uint64 `json:"transaction_id"` Data string `json:"data"` FromAddressId uint `json:"from_address_id"` ToAddressId uint `json:"to_address_id"` FromAddress Address `json:"from_address" pg:"rel:has-one,fk:from_address_id"` ToAddress Address `json:"to_address" pg:"rel:has-one,fk:to_address_id"` Transaction *Transaction `json:"transaction" pg:"rel:has-one,fk:transaction_id"` }
type Coin ¶
type Coin struct { ID uint `json:"id" pg:",use_zero"` Type CoinType `json:"type"` Name string `json:"name"` Symbol string `json:"symbol"` Volume string `json:"volume" pg:"type:numeric(70)"` Crr uint `json:"crr"` Reserve string `json:"reserve" pg:"type:numeric(70)"` MaxSupply string `json:"max_supply" pg:"type:numeric(70)"` Version uint `json:"version" pg:",use_zero"` OwnerAddressId uint `json:"owner_address"` CreatedAtBlockId uint `json:"created_at_block_id"` Burnable bool `json:"burnable"` Mintable bool `json:"mintable"` CreatedAt time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` DeletedAt *time.Time `pg:",soft_delete"` OwnerAddress Address `pg:"rel:has-one,rel:has-one"` }
type CoinType ¶ added in v2.12.0
type CoinType byte
const ( CoinTypeBase CoinType CoinTypeToken CoinTypePoolToken )
type CreateCoinTxData ¶
type CreateMultisigTxData ¶
type DeclareCandidacyTxData ¶
type DelegateTxData ¶
type EditCandidateTxData ¶
type InvalidTransaction ¶
type InvalidTransaction struct { ID uint64 `json:"id" pg:",pk"` FromAddressID uint64 `json:"from_address_id"` BlockID uint64 `json:"block_id"` CreatedAt time.Time `json:"created_at"` Type uint8 `json:"type"` Hash string `json:"hash"` TxData string `json:"tx_data"` Log string `json:"log"` Block *Block `pg:"rel:has-one"` //Relation has one to Blocks FromAddress *Address `pg:"rel:has-one,fk:from_address_id"` //Relation has one to Addresses }
func (InvalidTransaction) GetHash ¶
func (t InvalidTransaction) GetHash() string
GetHash Return transactions hash with prefix
type LiquidityPool ¶ added in v2.12.0
type LiquidityPool struct { Id uint64 `json:"id" pg:",pk"` TokenId uint64 `json:"token_id"` FirstCoinId uint64 `json:"first_coin_id" pg:",use_zero"` SecondCoinId uint64 `json:"second_coin_id" pg:",use_zero"` FirstCoinVolume string `json:"first_coin_volume"` SecondCoinVolume string `json:"second_coin_volume"` Liquidity string `json:"liquidity"` LiquidityBip string `json:"liquidity_bip"` UpdatedAtBlockId uint64 `json:"updated_at_block_id"` FirstCoin *Coin `json:"first_coin" pg:"rel:has-one,fk:first_coin_id"` SecondCoin *Coin `json:"second_coin" pg:"rel:has-one,fk:second_coin_id"` Token *Coin `json:"token" pg:"rel:has-one,fk:token_id"` }
func (*LiquidityPool) GetTokenSymbol ¶ added in v2.12.0
func (lp *LiquidityPool) GetTokenSymbol() string
type LiquidityPoolSnapshot ¶ added in v2.13.5
type LiquidityPoolSnapshot struct { BlockId uint64 `json:"block_id"` LiquidityPoolId uint64 `json:"liquidity_pool_id"` FirstCoinVolume string `json:"first_coin_volume"` SecondCoinVolume string `json:"second_coin_volume"` Liquidity string `json:"liquidity"` LiquidityBip string `json:"liquidity_bip"` CreatedAt time.Time `json:"created_at"` }
type LiquidityPoolTrade ¶ added in v2.12.0
type LiquidityPoolTrade struct { BlockId uint64 `json:"block_id"` LiquidityPoolId uint64 `json:"liquidity_pool_id"` TransactionId uint64 `json:"transaction_id"` FirstCoinVolume string `json:"first_coin_volume"` SecondCoinVolume string `json:"second_coin_volume"` CreatedAt time.Time `json:"created_at"` Block *Block `json:"block" pg:"rel:has-one,fk:block_id"` LiquidityPool *LiquidityPool `json:"liquidity_pool" pg:"rel:has-one,fk:liquidity_pool_id"` Transaction *Transaction `json:"transaction" pg:"rel:has-one,fk:transaction_id"` }
type MultiSendTxData ¶
type MultiSendTxData struct {
List []SendTxData `json:"list"`
}
type RedeemCheckTxData ¶
type Reward ¶
type Reward struct { BlockID uint64 `json:"block" pg:",pk"` AddressID uint `json:"address_id" pg:",pk"` ValidatorID uint64 `json:"validator_id" pg:",pk"` Role string `json:"role" pg:",pk"` Amount string `json:"amount" pg:"type:numeric(70)"` Block *Block `pg:"rel:has-one"` //Relation has one to Blocks Address *Address `pg:"rel:has-one"` //Relation has one to Addresses Validator *Validator `pg:"rel:has-one"` //Relation has one to Validators }
type SellAllCoinTxData ¶
type SellCoinTxData ¶
type SendTxData ¶
type SetCandidateTxData ¶
type SetCandidateTxData struct {
PubKey string `json:"pub_key"`
}
type Slash ¶
type Slash struct { ID uint64 `json:"id" pg:",pk"` CoinID uint `json:"coin_id" pg:",use_zero"` BlockID uint64 `json:"block_id"` AddressID uint `json:"address_id"` ValidatorID uint64 `json:"validator_id"` Amount string `json:"amount" pg:"type:numeric(70)"` Coin *Coin `pg:"rel:has-one"` //Relation has one to Coins Block *Block `pg:"rel:has-one"` //Relation has one to Blocks Address *Address `pg:"rel:has-one"` //Relation has one to Addresses Validator *Validator `pg:"rel:has-one"` //Relation has one to Validators }
type Stake ¶
type Stake struct { ID uint `json:"id" pg:",pk"` OwnerAddressID uint `json:"owner_address_id"` ValidatorID uint `json:"validator_id"` CoinID uint `json:"coin_id" pg:",use_zero"` Value string `json:"value" pg:"type:numeric(70)"` BipValue string `json:"bip_value" pg:"type:numeric(70)"` IsKicked bool `json:"is_kicked"` Coin *Coin `json:"coins" pg:"rel:has-one"` //Relation has one to Coins OwnerAddress *Address `json:"owner_address" pg:"rel:has-one,fk:owner_address_id"` //Relation has one to Addresses Validator *Validator `json:"validator" pg:"rel:has-one"` //Relation has one to Validators }
type TagLiquidityPool ¶ added in v2.12.0
type Transaction ¶
type Transaction struct { ID uint64 `json:"id" pg:",pk"` FromAddressID uint64 `json:"from_address_id"` Nonce uint64 `json:"nonce"` GasPrice uint64 `json:"gas_price"` Gas uint64 `json:"gas"` Commission string `json:"commission"` BlockID uint64 `json:"block_id"` GasCoinID uint64 `json:"gas_coin_id" pg:",use_zero"` CreatedAt time.Time `json:"created_at"` Type uint8 `json:"type"` Hash string `json:"hash"` ServiceData string `json:"service_data"` Data json.RawMessage `json:"data"` IData interface{} `json:"-" pg:"-"` Tags map[string]string `json:"tags"` Payload []byte `json:"payload"` RawTx []byte `json:"raw_tx"` CommissionPriceCoin interface{} `json:"commission_price_coin" pg:"-"` Block *Block `json:"block" pg:"rel:has-one"` //Relation has one to Blocks FromAddress *Address `json:"from_address" pg:"rel:has-one,fk:from_address_id"` //Relation has one to Address GasCoin *Coin `json:"gas_coin" pg:"rel:has-one,fk:gas_coin_id"` //Relation has one to Coin Validators []*Validator `json:"validators" pg:"many2many:transaction_validator"` //Relation has many to Validators TxOutputs []*TransactionOutput `json:"tx_outputs" pg:"rel:has-many,fk:id"` TxOutput *TransactionOutput `json:"tx_output" pg:"rel:has-one,fk:id"` }
func (*Transaction) GetHash ¶
func (t *Transaction) GetHash() string
Return transactions hash with prefix
type TransactionLiquidityPool ¶ added in v2.12.0
type TransactionOutput ¶
type TransactionOutput struct { ID uint64 `json:"id"` TransactionID uint64 `json:"transaction_id"` ToAddressID uint64 `json:"to_address_id"` CoinID uint `json:"coin_id" pg:",use_zero"` Value string `json:"value" pg:"type:numeric(70)"` Coin *Coin `json:"coin" pg:"rel:has-one"` //Relation has one to Coins ToAddress *Address `json:"to_address" pg:"rel:has-one,fk:to_address_id"` //Relation has one to Addresses Transaction *Transaction `json:"transaction" pg:"rel:has-one"` //Relation has one to Transactions }
type TransactionValidator ¶
type Unbond ¶
type Unbond struct { BlockId uint `json:"block_id"` AddressId uint `json:"address_id"` CoinId uint `json:"coin_id" pg:",use_zero"` ValidatorId uint `json:"validator_id"` Value string `json:"value"` Coin *Coin `json:"coin" pg:"rel:has-one,fk:coin_id"` Address *Address `json:"address" pg:"rel:has-one,fk:address_id"` Validator *Validator `json:"validator" pg:"rel:has-one,fk:validator_id"` }
type UnbondTxData ¶
type Validator ¶
type Validator struct { ID uint `json:"id" pg:",pk"` RewardAddressID *uint `json:"reward_address_id"` OwnerAddressID *uint `json:"owner_address_id"` ControlAddressID *uint `json:"control_address_id"` CreatedAtBlockID *uint `json:"created_at_block_id"` PublicKey string `json:"public_key" pg:"type:varchar(64)"` Status *uint8 `json:"status"` Commission *uint64 `json:"commission"` TotalStake *string `json:"total_stake" pg:"type:numeric(70)"` Name *string `json:"name"` SiteUrl *string `json:"site_url"` IconUrl *string `json:"icon_url"` Description *string `json:"description"` MetaUpdatedAtBlockID *uint64 `json:"meta_updated_at_block_id"` UpdateAt *time.Time `json:"update_at"` ControlAddress *Address `json:"control_address" pg:"rel:has-one,fk:control_address_id"` RewardAddress *Address `json:"reward_address" pg:"rel:has-one,fk:reward_address_id"` OwnerAddress *Address `json:"owner_address" pg:"rel:has-one,fk:owner_address_id"` Stakes []*Stake `json:"stakes" pg:"rel:has-many"` PublicKeys []ValidatorPublicKeys `json:"public_keys" pg:"rel:has-many"` Bans []ValidatorBan `json:"bans" pg:"rel:has-many"` }
func (Validator) GetPublicKey ¶
Return validators PK with prefix
type ValidatorBan ¶ added in v2.12.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.