Documentation ¶
Index ¶
- Constants
- Variables
- func AppendTokenId(oldIdList []byte, tokenId types.TokenTypeId) []byte
- func DeleteTokenId(oldIdList []byte, tokenId types.TokenTypeId) []byte
- func GetActiveConsensusGroupList(db StorageDatabase) ([]*types.ConsensusGroupInfo, error)
- func GetAddrFromVoteKey(key []byte) types.Address
- func GetAllRegistrationList(db StorageDatabase, gid types.Gid) ([]*types.Registration, error)
- func GetCandidateList(db StorageDatabase, gid types.Gid) ([]*types.Registration, error)
- func GetConsensusGroup(db StorageDatabase, gid types.Gid) (*types.ConsensusGroupInfo, error)
- func GetConsensusGroupKey(gid types.Gid) []byte
- func GetGidFromConsensusGroupKey(key []byte) types.Gid
- func GetHisNameKey(addr types.Address, gid types.Gid) []byte
- func GetIndexFromPledgeKey(key []byte) uint64
- func GetMintageKey(tokenId types.TokenTypeId) []byte
- func GetNextIndexKey(tokenSymbol string) []byte
- func GetOwnerTokenIdListKey(owner types.Address) []byte
- func GetPledgeAddrFromPledgeKey(key []byte) types.Address
- func GetPledgeBeneficialAmount(db StorageDatabase, beneficialAddr types.Address) (*big.Int, error)
- func GetPledgeBeneficialKey(beneficial types.Address) []byte
- func GetPledgeInfo(db StorageDatabase, pledgeAddr, beneficialAddr, agentAddr types.Address, ...) (*types.PledgeInfo, error)
- func GetPledgeInfoList(db StorageDatabase, pledgeAddr types.Address) ([]*types.PledgeInfo, *big.Int, error)
- func GetPledgeKey(addr types.Address, index uint64) []byte
- func GetPledgeKeyPrefix(addr types.Address) []byte
- func GetPledgeListByPage(db StorageDatabase, lastKey []byte, count uint64) ([]*types.PledgeInfo, []byte, error)
- func GetRegisterKey(name string, gid types.Gid) []byte
- func GetRegistration(db StorageDatabase, gid types.Gid, name string) (*types.Registration, error)
- func GetRegistrationList(db StorageDatabase, gid types.Gid, pledgeAddr types.Address) ([]*types.Registration, error)
- func GetTokenById(db StorageDatabase, tokenId types.TokenTypeId) (*types.TokenInfo, error)
- func GetTokenIdFromMintageKey(key []byte) types.TokenTypeId
- func GetTokenMap(db StorageDatabase) (map[types.TokenTypeId]*types.TokenInfo, error)
- func GetTokenMapByOwner(db StorageDatabase, owner types.Address) (tokenInfoMap map[types.TokenTypeId]*types.TokenInfo, err error)
- func GetVote(db StorageDatabase, gid types.Gid, addr types.Address) (*types.VoteInfo, error)
- func GetVoteKey(addr types.Address, gid types.Gid) []byte
- func GetVoteKeyPerfixByGid(gid types.Gid) []byte
- func GetVoteList(db StorageDatabase, gid types.Gid) ([]*types.VoteInfo, error)
- func IsActiveRegistration(db StorageDatabase, name string, gid types.Gid) (bool, error)
- func IsMintageKey(key []byte) bool
- func IsPledgeKey(key []byte) bool
- func IsRegisterKey(key []byte) bool
- func NewGid(accountAddress types.Address, accountBlockHeight uint64, ...) types.Gid
- func NewTokenId(accountAddress types.Address, accountBlockHeight uint64, ...) types.TokenTypeId
- func ParseTokenInfo(data []byte) (*types.TokenInfo, error)
- type ConditionCode
- type ParamAgentCancelPledge
- type ParamAgentPledge
- type ParamCancelPledge
- type ParamCancelRegister
- type ParamGetTokenInfo
- type ParamIssue
- type ParamMintage
- type ParamRegister
- type ParamReward
- type ParamTransferOwner
- type ParamVote
- type StorageDatabase
- type VariableConditionRegisterOfPledge
- type VariableConditionVoteOfKeepToken
- type VariablePledgeBeneficial
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 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 ¶
Consensus group variable keys
func GetMintageKey ¶
func GetMintageKey(tokenId types.TokenTypeId) []byte
func GetOwnerTokenIdListKey ¶ added in v1.3.0
func GetPledgeAddrFromPledgeKey ¶ added in v1.3.2
func GetPledgeBeneficialAmount ¶
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 GetPledgeListByPage ¶
func GetPledgeListByPage(db StorageDatabase, lastKey []byte, count uint64) ([]*types.PledgeInfo, []byte, error)
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 ¶
Vote readers
func IsActiveRegistration ¶
Register readers
func NewGid ¶
func NewGid(accountAddress types.Address, accountBlockHeight uint64, prevBlockHash types.Hash, snapshotHash types.Hash) types.Gid
Consensus group readers
func NewTokenId ¶
Types ¶
type ConditionCode ¶
type ConditionCode uint8
const ( RegisterConditionPrefix ConditionCode = 10 VoteConditionPrefix ConditionCode = 20 RegisterConditionOfPledge ConditionCode = 11 VoteConditionOfDefault ConditionCode = 21 )
type ParamAgentCancelPledge ¶
type ParamAgentPledge ¶
type ParamCancelPledge ¶
type ParamGetTokenInfo ¶
type ParamGetTokenInfo struct { TokenId types.TokenTypeId Bid uint8 }
type ParamIssue ¶ added in v1.3.0
type ParamMintage ¶
type ParamRegister ¶
Structs of register
type ParamReward ¶
type ParamTransferOwner ¶ added in v1.3.0
type ParamTransferOwner struct { TokenId types.TokenTypeId NewOwner types.Address }
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 }
Click to show internal directories.
Click to hide internal directories.