abi

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2019 License: MIT, MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JsonDestroy = `` /* 626-byte string literal not displayed */

	MethodNameDestroy   = "Destroy"
	VariableDestroyInfo = "destroyInfo"
	KeySize             = types.AddressSize + types.HashSize + 1
)
View Source
const (
	JsonMiner = `` /* 552-byte string literal not displayed */

	MethodNameMinerReward   = "MinerReward"
	VariableNameMinerReward = "MinerRewardInfo"
)
View Source
const (
	JsonMintage = `` /* 1233-byte string literal not displayed */

	MethodNameMintage         = "Mintage"
	MethodNameMintageWithdraw = "Withdraw"
	VariableNameToken         = "token"
	VariableNameGenesisToken  = "genesisToken"
)
View Source
const (
	JsonNEP5Pledge = `` /* 694-byte string literal not displayed */

	MethodNEP5Pledge         = "NEP5Pledge"
	MethodWithdrawNEP5Pledge = "WithdrawNEP5Pledge"
	VariableNEP5PledgeInfo   = "nep5PledgeInfo"
)
View Source
const (
	JsonRep = `` /* 547-byte string literal not displayed */

	MethodNameRepReward   = "RepReward"
	VariableNameRepReward = "RepRewardInfo"
)
View Source
const (
	JsonRewards = `` /* 1272-byte string literal not displayed */

	MethodNameUnsignedAirdropRewards   = "UnsignedAirdropRewards"
	MethodNameAirdropRewards           = "AirdropRewards"
	MethodNameUnsignedConfidantRewards = "UnsignedConfidantRewards"
	MethodNameConfidantRewards         = "ConfidantRewards"
	VariableNameRewards                = "rewardsInfo"
)
View Source
const (
	Confidant = iota
	Rewards
)

Variables

Functions

func GetConfidantKey added in v1.2.0

func GetConfidantKey(address types.Address, txId, txHeader, rxHeader []byte) []byte

func GetConfidantRewords added in v1.2.0

func GetConfidantRewords(ctx *vmstore.VMContext, confidant types.Address) (map[string]*big.Int, error)

func GetConfidantRewordsDetail added in v1.2.0

func GetConfidantRewordsDetail(ctx *vmstore.VMContext, confidant types.Address) (map[string][]*RewardsInfo, error)

func GetLastMinerRewardHeightByAccount added in v1.3.0

func GetLastMinerRewardHeightByAccount(ctx *vmstore.VMContext, coinbase types.Address) (uint64, error)

func GetLastRepRewardHeightByAccount added in v1.3.0

func GetLastRepRewardHeightByAccount(ctx *vmstore.VMContext, account types.Address) (uint64, error)

func GetPledgeBeneficialAmount added in v1.1.0

func GetPledgeBeneficialAmount(ctx *vmstore.VMContext, beneficial types.Address, pType uint8) *big.Int

func GetPledgeBeneficialTotalAmount added in v1.1.0

func GetPledgeBeneficialTotalAmount(ctx *vmstore.VMContext, beneficial types.Address) (*big.Int, error)

func GetPledgeKey

func GetPledgeKey(addr types.Address, beneficial types.Address, neoTxId string) []byte

func GetRewardsKey added in v1.2.0

func GetRewardsKey(txId, txHeader, rxHeader []byte) []byte

func GetTokenById added in v1.1.0

func GetTokenById(ctx *vmstore.VMContext, tokenId types.Hash) (*types.TokenInfo, error)

func GetTokenByName added in v1.1.0

func GetTokenByName(ctx *vmstore.VMContext, tokenName string) (*types.TokenInfo, error)

func GetTotalDestroyInfo added in v1.3.0

func GetTotalDestroyInfo(ctx *vmstore.VMContext, addr *types.Address) (types.Balance, error)

GetTotalDestroyInfo query all destroyed GQAS by account

func GetTotalPledgeAmount added in v1.2.0

func GetTotalPledgeAmount(ctx *vmstore.VMContext) *big.Int

func GetTotalRewards added in v1.2.0

func GetTotalRewards(ctx *vmstore.VMContext, txId string) (*big.Int, error)

func ListTokens added in v1.1.0

func ListTokens(ctx *vmstore.VMContext) ([]*types.TokenInfo, error)

func MinerCalcRewardEndHeight added in v1.2.3

func MinerCalcRewardEndHeight(startHeight uint64, maxEndHeight uint64) uint64

func MinerPovHeightToCount added in v1.2.3

func MinerPovHeightToCount(height uint64) uint64

height begin from 0, so height + 1 == blocks count

func MinerRoundPovHeight added in v1.2.3

func MinerRoundPovHeight(height uint64, round uint64) uint64

func NewTokenHash

func NewTokenHash(address types.Address, previous types.Hash, tokenName string) types.Hash

func PackSendBlock added in v1.3.0

func PackSendBlock(ctx *vmstore.VMContext, param *DestroyParam) (*types.StateBlock, error)

func ParseGenesisTokenInfo added in v1.1.0

func ParseGenesisTokenInfo(data []byte) (*types.TokenInfo, error)

func ParseTokenInfo

func ParseTokenInfo(data []byte) (*types.TokenInfo, error)

func RepCalcRewardEndHeight added in v1.3.0

func RepCalcRewardEndHeight(startHeight uint64, maxEndHeight uint64) uint64

func RepPovHeightToCount added in v1.3.0

func RepPovHeightToCount(height uint64) uint64

height begin from 0, so height + 1 == blocks count

func RepRoundPovHeight added in v1.3.0

func RepRoundPovHeight(height uint64, round uint64) uint64

Types

type DestroyInfo added in v1.3.0

type DestroyInfo struct {
	Owner     types.Address `json:"owner"`
	Previous  types.Hash    `json:"previous"`
	Token     types.Hash    `json:"token"`
	Amount    *big.Int      `json:"amount"`
	TimeStamp int64         `json:"timestamp"`
}

func GetDestroyInfoDetail added in v1.3.0

func GetDestroyInfoDetail(ctx *vmstore.VMContext, addr *types.Address) ([]*DestroyInfo, error)

GetDestroyInfoDetail query destroyed GQAS detail by account

func ParseDestroyInfo added in v1.3.0

func ParseDestroyInfo(data []byte) (*DestroyInfo, error)

ParseDestroyInfo decode data into `DestroyInfo`

type DestroyParam added in v1.3.0

type DestroyParam struct {
	Owner    types.Address   `json:"owner"`
	Previous types.Hash      `json:"previous"`
	Token    types.Hash      `json:"token"`
	Amount   *big.Int        `json:"amount"`
	Sign     types.Signature `json:"signature"`
}

func (*DestroyParam) Signature added in v1.3.0

func (param *DestroyParam) Signature(acc *types.Account) (types.Signature, error)

func (*DestroyParam) Verify added in v1.3.0

func (param *DestroyParam) Verify() (bool, error)

Verify destroy params

type MinerRewardInfo added in v1.2.3

type MinerRewardInfo struct {
	Beneficial   types.Address `json:"beneficial"`
	StartHeight  uint64        `json:"startHeight"`
	EndHeight    uint64        `json:"endHeight"`
	RewardBlocks uint64        `json:"rewardBlocks"`
	RewardAmount *big.Int      `json:"rewardAmount"`
	Timestamp    int64         `json:"_"`
}

type MinerRewardParam added in v1.2.3

type MinerRewardParam struct {
	Coinbase     types.Address `json:"coinbase"`
	Beneficial   types.Address `json:"beneficial"`
	StartHeight  uint64        `json:"startHeight"`
	EndHeight    uint64        `json:"endHeight"`
	RewardBlocks uint64        `json:"rewardBlocks"`
	RewardAmount *big.Int      `json:"rewardAmount"`
}

func (*MinerRewardParam) Verify added in v1.2.3

func (p *MinerRewardParam) Verify() (bool, error)

type NEP5PledgeInfo added in v1.1.0

type NEP5PledgeInfo struct {
	PType         uint8
	Amount        *big.Int
	WithdrawTime  int64
	Beneficial    types.Address
	PledgeAddress types.Address
	NEP5TxId      string
}

func GetBeneficialInfos added in v1.1.0

func GetBeneficialInfos(ctx *vmstore.VMContext, addr types.Address) ([]*NEP5PledgeInfo, *big.Int)

GetPledgeInfos get pledge info list by pledge address

func GetBeneficialPledgeInfos added in v1.1.0

func GetBeneficialPledgeInfos(ctx *vmstore.VMContext, beneficial types.Address, pType PledgeType) ([]*NEP5PledgeInfo, *big.Int)

GetBeneficialPledgeInfos get pledge info by beneficial address and pledge type

func GetPledgeInfos added in v1.1.0

func GetPledgeInfos(ctx *vmstore.VMContext, addr types.Address) ([]*NEP5PledgeInfo, *big.Int)

GetPledgeInfos get pledge info list by pledge address

func ParsePledgeInfo added in v1.1.0

func ParsePledgeInfo(data []byte) (*NEP5PledgeInfo, error)

ParsePledgeInfo convert data to NEP5PledgeInfo

func SearchAllPledgeInfos added in v1.1.0

func SearchAllPledgeInfos(ctx *vmstore.VMContext) ([]*NEP5PledgeInfo, error)

type ParamMintage

type ParamMintage struct {
	TokenId     types.Hash
	TokenName   string
	TokenSymbol string
	TotalSupply *big.Int
	Decimals    uint8
	Beneficial  types.Address
	NEP5TxId    string
}

type PledgeParam added in v1.1.0

type PledgeParam struct {
	Beneficial    types.Address
	PledgeAddress types.Address
	PType         uint8
	NEP5TxId      string
}

func ParsePledgeParam added in v1.1.0

func ParsePledgeParam(data []byte) (*PledgeParam, error)

ParsePledgeParam convert data to PledgeParam

type PledgeResult added in v1.1.0

type PledgeResult struct {
	Key        []byte
	PledgeInfo *NEP5PledgeInfo
}

func SearchBeneficialPledgeInfo added in v1.1.0

func SearchBeneficialPledgeInfo(ctx *vmstore.VMContext, param *WithdrawPledgeParam) []*PledgeResult

func SearchBeneficialPledgeInfoByTxId added in v1.1.1

func SearchBeneficialPledgeInfoByTxId(ctx *vmstore.VMContext, param *WithdrawPledgeParam) *PledgeResult

func SearchBeneficialPledgeInfoIgnoreWithdrawTime added in v1.1.0

func SearchBeneficialPledgeInfoIgnoreWithdrawTime(ctx *vmstore.VMContext, param *WithdrawPledgeParam) []*PledgeResult

func SearchPledgeInfoWithNEP5TxId added in v1.1.2

func SearchPledgeInfoWithNEP5TxId(ctx *vmstore.VMContext, param *WithdrawPledgeParam) *PledgeResult

type PledgeType added in v1.1.0

type PledgeType uint8
const (
	Network PledgeType = iota
	Vote
	Storage
	Oracle
)

func (PledgeType) String added in v1.1.0

func (i PledgeType) String() string

type RepRewardInfo added in v1.3.0

type RepRewardInfo struct {
	Beneficial   types.Address `json:"beneficial"`
	StartHeight  uint64        `json:"startHeight"`
	EndHeight    uint64        `json:"endHeight"`
	RewardBlocks uint64        `json:"rewardBlocks"`
	RewardAmount *big.Int      `json:"rewardAmount"`
	Timestamp    int64         `json:"_"`
}

type RepRewardParam added in v1.3.0

type RepRewardParam struct {
	Account      types.Address `json:"account"`
	Beneficial   types.Address `json:"beneficial"`
	StartHeight  uint64        `json:"startHeight"`
	EndHeight    uint64        `json:"endHeight"`
	RewardBlocks uint64        `json:"rewardBlocks"`
	RewardAmount *big.Int      `json:"rewardAmount"`
}

func (*RepRewardParam) Verify added in v1.3.0

func (p *RepRewardParam) Verify() (bool, error)

type RewardsInfo added in v1.2.0

type RewardsInfo struct {
	Type     uint8         `json:"type"`
	From     types.Address `json:"from"`
	To       types.Address `json:"to"`
	TxHeader types.Hash    `json:"txHeader"`
	RxHeader types.Hash    `json:"rxHeader"`
	Amount   *big.Int      `json:"amount"`
}

func GetRewardsDetail added in v1.2.0

func GetRewardsDetail(ctx *vmstore.VMContext, txId string) ([]*RewardsInfo, error)

func ParseRewardsInfo added in v1.2.0

func ParseRewardsInfo(data []byte) (*RewardsInfo, error)

type RewardsParam added in v1.2.0

type RewardsParam struct {
	Id         types.Hash      `json:"id"`
	Beneficial types.Address   `json:"beneficial"`
	TxHeader   types.Hash      `json:"txHeader"`
	RxHeader   types.Hash      `json:"rxHeader"`
	Amount     *big.Int        `json:"amount"`
	Sign       types.Signature `json:"signature"`
}

func (*RewardsParam) Verify added in v1.2.0

func (ap *RewardsParam) Verify(address types.Address, methodName string) (bool, error)

type VariablePledgeBeneficial

type VariablePledgeBeneficial struct {
	Amount *big.Int
	PType  PledgeType
}

type WithdrawPledgeParam added in v1.0.3

type WithdrawPledgeParam struct {
	Beneficial types.Address `json:"beneficial"`
	Amount     *big.Int      `json:"amount"`
	PType      uint8         `json:"pType"`
	NEP5TxId   string        `json:"nep5TxId"`
}

Jump to

Keyboard shortcuts

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