abi

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2019 License: MIT, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodNameMintage         = "Mintage"
	MethodNameMintageWithdraw = "Withdraw"
	VariableNameToken         = "token"
	VariableNameGenesisToken  = "genesisToken"
)
View Source
const (
	MethodNEP5Pledge         = "NEP5Pledge"
	MethodWithdrawNEP5Pledge = "WithdrawNEP5Pledge"
	VariableNEP5PledgeInfo   = "nep5PledgeInfo"
)

Variables

View Source
var (
	MintageABI, _ = abi.JSONToABIContract(strings.NewReader(jsonMintage))
)
View Source
var (
	NEP5PledgeABI, _ = abi.JSONToABIContract(strings.NewReader(jsonNEP5Pledge))
)

Functions

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 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 ListTokens added in v1.1.0

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

func NewTokenHash

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

func ParseGenesisTokenInfo added in v1.1.0

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

func ParseTokenInfo

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

Types

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 SearchBeneficialPledgeInfoIgnoreWithdrawTime added in v1.1.0

func SearchBeneficialPledgeInfoIgnoreWithdrawTime(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 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"`
}

Jump to

Keyboard shortcuts

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