abi

package
v2.6.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Method names and variable names of consensus group
	VariableNameConsensusGroupInfo        = "consensusGroupInfo"
	VariableNameConditionRegisterOfPledge = "registerOfPledge"

	// Method names and variable names of register
	MethodNameRegister             = "Register"
	MethodNameCancelRegister       = "CancelRegister"
	MethodNameCancelRegisterV2     = "Revoke"
	MethodNameReward               = "Reward"
	MethodNameRewardV2             = "WithdrawReward"
	MethodNameUpdateRegistration   = "UpdateRegistration"
	MethodNameUpdateRegistrationV2 = "UpdateBlockProducingAddress"
	VariableNameRegistration       = "registration"
	VariableNameHisName            = "hisName"

	// Method names and variable names of vote
	MethodNameVote         = "Vote"
	MethodNameCancelVote   = "CancelVote"
	VariableNameVoteStatus = "voteStatus"
)
View Source
const (

	// deprecated version
	MethodNameDexFundUserDeposit          = "DexFundUserDeposit"
	MethodNameDexFundUserWithdraw         = "DexFundUserWithdraw"
	MethodNameDexFundNewMarket            = "DexFundNewMarket"
	MethodNameDexFundNewOrder             = "DexFundNewOrder"
	MethodNameDexFundSettleOrders         = "DexFundSettleOrders"
	MethodNameDexFundPeriodJob            = "DexFundPeriodJob"
	MethodNameDexFundPledgeForVx          = "DexFundPledgeForVx"
	MethodNameDexFundPledgeForVip         = "DexFundPledgeForVip"
	MethodNameDexFundPledgeCallback       = "AgentPledgeCallback"
	MethodNameDexFundCancelPledgeCallback = "AgentCancelPledgeCallback"
	MethodNameDexFundOwnerConfig          = "DexFundOwnerConfig"
	MethodNameDexFundOwnerConfigTrade     = "DexFundOwnerConfigTrade"
	MethodNameDexFundMarketOwnerConfig    = "DexFundMarketOwnerConfig"
	MethodNameDexFundTransferTokenOwner   = "DexFundTransferTokenOwner"
	MethodNameDexFundNewInviter           = "DexFundNewInviter"
	MethodNameDexFundBindInviteCode       = "DexFundBindInviteCode"
	MethodNameDexFundEndorseVxMinePool    = "DexFundEndorseVx"
	MethodNameDexFundSettleMakerMinedVx   = "DexFundSettleMakerMinedVx"

	MethodNameDexFundStakeForSuperVip   = "DexFundPledgeForSuperVip"
	MethodNameDexFundConfigMarketsAgent = "DexFundConfigMarketsAgent"
	MethodNameDexFundNewAgentOrder      = "DexFundNewAgentOrder"

	// reused
	MethodNameDexFundGetTokenInfoCallback = "GetTokenInfoCallback"
	MethodNameDexFundNotifyTime           = "NotifyTime"

	// new version
	MethodNameDexFundDeposit                     = "Deposit"
	MethodNameDexFundWithdraw                    = "Withdraw"
	MethodNameDexFundOpenNewMarket               = "OpenNewMarket"
	MethodNameDexFundPlaceOrder                  = "PlaceOrder"
	MethodNameDexFundSettleOrdersV2              = "SettleOrders"
	MethodNameDexFundTriggerPeriodJob            = "TriggerPeriodJob"
	MethodNameDexFundStakeForMining              = "StakeForMining"
	MethodNameDexFundStakeForVIP                 = "StakeForVIP"
	MethodNameDexFundDelegateStakeCallback       = "DelegateStakeCallback"
	MethodNameDexFundCancelDelegateStakeCallback = "CancelDelegateStakeCallback"
	MethodNameDexFundDexAdminConfig              = "DexAdminConfig"
	MethodNameDexFundTradeAdminConfig            = "TradeAdminConfig"
	MethodNameDexFundMarketAdminConfig           = "MarketAdminConfig"
	MethodNameDexFundTransferTokenOwnership      = "TransferTokenOwnership"
	MethodNameDexFundCreateNewInviter            = "CreateNewInviter"
	MethodNameDexFundBindInviteCodeV2            = "BindInviteCode"
	MethodNameDexFundEndorseVxV2                 = "EndorseVx"
	MethodNameDexFundSettleMakerMinedVxV2        = "SettleMakerMinedVx"

	MethodNameDexFundStakeForSVIP       = "StakeForSVIP"
	MethodNameDexFundConfigMarketAgents = "ConfigMarketAgents"
	MethodNameDexFundPlaceAgentOrder    = "PlaceAgentOrder"
)
View Source
const (
	MethodNameDexTradeNewOrder          = "DexTradeNewOrder"
	MethodNameDexTradeCancelOrder       = "DexTradeCancelOrder"
	MethodNameDexTradeNotifyNewMarket   = "DexTradeNotifyNewMarket"
	MethodNameDexTradeCleanExpireOrders = "DexTradeCleanExpireOrders"
	MethodNameDexTradeCancelOrderByHash = "DexTradeCancelOrderByHash"

	MethodNameDexTradePlaceOrder                   = "PlaceOrder"
	MethodNameDexTradeCancelOrderV2                = "CancelOrder"
	MethodNameDexTradeSyncNewMarket                = "SyncNewMarket"
	MethodNameDexTradeClearExpiredOrders           = "ClearExpiredOrders"
	MethodNameDexTradeCancelOrderByTransactionHash = "CancelOrderByTransactionHash"
)
View Source
const (
	MethodNameMint              = "Mint"
	MethodNameMintV2            = "IssueToken"
	MethodNameIssue             = "Issue"
	MethodNameIssueV2           = "ReIssue"
	MethodNameBurn              = "Burn"
	MethodNameTransferOwner     = "TransferOwner"
	MethodNameTransferOwnerV2   = "TransferOwnership"
	MethodNameChangeTokenType   = "ChangeTokenType"
	MethodNameChangeTokenTypeV2 = "DisableReIssue"
	MethodNameGetTokenInfo      = "GetTokenInfo"
	VariableNameTokenInfo       = "tokenInfo"
	VariableNameTokenNameIndex  = "tokenNameIndex"
	EventNameMint               = "mint"
	EventNameIssue              = "issue"
	EventNameBurn               = "burn"
	EventNameTransferOwner      = "transferOwner"
	EventNameChangeTokenType    = "changeTokenType"
)
View Source
const (
	MethodNamePledge              = "Pledge"
	MethodNamePledgeV2            = "Stake"
	MethodNameCancelPledge        = "CancelPledge"
	MethodNameCancelPledgeV2      = "CancelStake"
	MethodNameAgentPledge         = "AgentPledge"
	MethodNameAgentPledgeV2       = "DelegateStake"
	MethodNameAgentCancelPledge   = "AgentCancelPledge"
	MethodNameAgentCancelPledgeV2 = "CancelDelegateStake"
	VariableNamePledgeInfo        = "pledgeInfo"
	VariableNamePledgeBeneficial  = "pledgeBeneficial"
)

Variables

View Source
var (
	ABIConsensusGroup, _ = abi.JSONToABIContract(strings.NewReader(jsonConsensusGroup))
)
View Source
var (
	ABIDexFund, _ = abi.JSONToABIContract(strings.NewReader(jsonDexFund))
)
View Source
var (
	ABIDexTrade, _ = abi.JSONToABIContract(strings.NewReader(jsonDexTrade))
)
View Source
var (
	ABIMintage, _ = abi.JSONToABIContract(strings.NewReader(jsonMintage))
)
View Source
var (
	ABIPledge, _ = abi.JSONToABIContract(strings.NewReader(jsonPledge))
)

Functions

func AppendTokenId added in v1.3.0

func AppendTokenId(oldIdList []byte, tokenId types.TokenTypeId) []byte

func DeleteTokenId added in v1.3.0

func DeleteTokenId(oldIdList []byte, tokenId types.TokenTypeId) []byte

func GetActiveConsensusGroupList

func GetActiveConsensusGroupList(db StorageDatabase) ([]*types.ConsensusGroupInfo, error)

func GetAddrFromVoteKey

func GetAddrFromVoteKey(key []byte) types.Address

func GetAllRegistrationList

func GetAllRegistrationList(db StorageDatabase, gid types.Gid) ([]*types.Registration, error)

func GetCandidateList

func GetCandidateList(db StorageDatabase, gid types.Gid) ([]*types.Registration, error)

func GetConsensusGroup

func GetConsensusGroup(db StorageDatabase, gid types.Gid) (*types.ConsensusGroupInfo, error)

func GetConsensusGroupKey

func GetConsensusGroupKey(gid types.Gid) []byte

Consensus group variable keys

func GetGidFromConsensusGroupKey

func GetGidFromConsensusGroupKey(key []byte) types.Gid

func GetHisNameKey

func GetHisNameKey(addr types.Address, gid types.Gid) []byte

func GetIndexFromPledgeKey

func GetIndexFromPledgeKey(key []byte) uint64

func GetMintageKey

func GetMintageKey(tokenId types.TokenTypeId) []byte

func GetNextIndexKey

func GetNextIndexKey(tokenSymbol string) []byte

func GetOwnerTokenIdListKey added in v1.3.0

func GetOwnerTokenIdListKey(owner types.Address) []byte

func GetPledgeAddrFromPledgeKey added in v1.3.2

func GetPledgeAddrFromPledgeKey(key []byte) types.Address

func GetPledgeBeneficialAmount

func GetPledgeBeneficialAmount(db StorageDatabase, beneficialAddr types.Address) (*big.Int, error)

func GetPledgeBeneficialKey

func GetPledgeBeneficialKey(beneficial types.Address) []byte

func GetPledgeInfo

func GetPledgeInfo(db StorageDatabase, pledgeAddr, beneficialAddr, agentAddr types.Address, agent bool, bid uint8) (*types.PledgeInfo, error)

func GetPledgeInfoList

func GetPledgeInfoList(db StorageDatabase, pledgeAddr types.Address) ([]*types.PledgeInfo, *big.Int, error)

func GetPledgeKey

func GetPledgeKey(addr types.Address, index uint64) []byte

func GetPledgeKeyPrefix

func GetPledgeKeyPrefix(addr types.Address) []byte

func GetPledgeListByPage

func GetPledgeListByPage(db StorageDatabase, lastKey []byte, count uint64) ([]*types.PledgeInfo, []byte, error)

func GetRegisterKey

func GetRegisterKey(name string, gid types.Gid) []byte

Register variable keys

func GetRegistration

func GetRegistration(db StorageDatabase, gid types.Gid, name string) (*types.Registration, error)

func GetRegistrationList

func GetRegistrationList(db StorageDatabase, gid types.Gid, pledgeAddr types.Address) ([]*types.Registration, error)

func GetTokenById

func GetTokenById(db StorageDatabase, tokenId types.TokenTypeId) (*types.TokenInfo, error)

func GetTokenIdFromMintageKey

func GetTokenIdFromMintageKey(key []byte) types.TokenTypeId

func GetTokenMap

func GetTokenMap(db StorageDatabase) (map[types.TokenTypeId]*types.TokenInfo, error)

func GetTokenMapByOwner added in v1.3.0

func GetTokenMapByOwner(db StorageDatabase, owner types.Address) (tokenInfoMap map[types.TokenTypeId]*types.TokenInfo, err error)

func GetVote

func GetVote(db StorageDatabase, gid types.Gid, addr types.Address) (*types.VoteInfo, error)

Vote readers

func GetVoteKey

func GetVoteKey(addr types.Address, gid types.Gid) []byte

Vote variable keys

func GetVoteKeyPerfixByGid

func GetVoteKeyPerfixByGid(gid types.Gid) []byte

func GetVoteList

func GetVoteList(db StorageDatabase, gid types.Gid) ([]*types.VoteInfo, error)

func IsActiveRegistration

func IsActiveRegistration(db StorageDatabase, name string, gid types.Gid) (bool, error)

Register readers

func IsMintageKey added in v1.3.0

func IsMintageKey(key []byte) bool

func IsPledgeKey

func IsPledgeKey(key []byte) bool

func IsRegisterKey

func IsRegisterKey(key []byte) bool

func NewGid

func NewGid(accountAddress types.Address, accountBlockHeight uint64, prevBlockHash types.Hash, snapshotHash types.Hash) types.Gid

Consensus group readers

func NewTokenId

func NewTokenId(accountAddress types.Address, accountBlockHeight uint64, prevBlockHash types.Hash) types.TokenTypeId

func ParseTokenInfo added in v1.3.0

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

Types

type ConditionCode

type ConditionCode uint8
const (
	RegisterConditionPrefix   ConditionCode = 10
	VoteConditionPrefix       ConditionCode = 20
	RegisterConditionOfPledge ConditionCode = 11
	VoteConditionOfDefault    ConditionCode = 21
)

type ParamAgentCancelPledge

type ParamAgentCancelPledge struct {
	StakeAddress types.Address
	Beneficiary  types.Address
	Amount       *big.Int
	Bid          uint8
}

type ParamAgentPledge

type ParamAgentPledge struct {
	StakeAddress types.Address
	Beneficiary  types.Address
	Bid          uint8
	StakeHeight  uint64
}

type ParamCancelPledge

type ParamCancelPledge struct {
	Beneficiary types.Address
	Amount      *big.Int
}

type ParamCancelRegister

type ParamCancelRegister struct {
	Gid     types.Gid
	SbpName string
}

type ParamGetTokenInfo

type ParamGetTokenInfo struct {
	TokenId types.TokenTypeId
	Bid     uint8
}

type ParamIssue added in v1.3.0

type ParamIssue struct {
	TokenId        types.TokenTypeId
	Amount         *big.Int
	ReceiveAddress types.Address
}

type ParamMintage

type ParamMintage struct {
	TokenName       string
	TokenSymbol     string
	TotalSupply     *big.Int
	Decimals        uint8
	MaxSupply       *big.Int
	IsOwnerBurnOnly bool
	IsReIssuable    bool
}

type ParamRegister

type ParamRegister struct {
	Gid                   types.Gid
	SbpName               string
	BlockProducingAddress types.Address
}

Structs of register

type ParamReward

type ParamReward struct {
	Gid            types.Gid
	SbpName        string
	ReceiveAddress types.Address
}

type ParamTransferOwner added in v1.3.0

type ParamTransferOwner struct {
	TokenId  types.TokenTypeId
	NewOwner types.Address
}

type ParamVote

type ParamVote struct {
	Gid     types.Gid
	SbpName string
}

Structs of vote

type StorageDatabase

type StorageDatabase interface {
	GetValue(key []byte) ([]byte, error)
	NewStorageIterator(prefix []byte) (interfaces.StorageIterator, error)
	Address() *types.Address
}

type VariableConditionRegisterOfPledge

type VariableConditionRegisterOfPledge struct {
	PledgeAmount *big.Int
	PledgeToken  types.TokenTypeId
	PledgeHeight uint64
}

Structs of consensus group

func GetRegisterOfPledgeInfo

func GetRegisterOfPledgeInfo(data []byte) (*VariableConditionRegisterOfPledge, error)

type VariableConditionVoteOfKeepToken

type VariableConditionVoteOfKeepToken struct {
	KeepAmount *big.Int
	KeepToken  types.TokenTypeId
}

type VariablePledgeBeneficial

type VariablePledgeBeneficial struct {
	Amount *big.Int
}

Jump to

Keyboard shortcuts

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