Documentation
¶
Index ¶
- Constants
- Variables
- func GetNetworkInfoKey(networkClass uint32, chainId uint32) []byte
- func GetPillarInfoKey(name string) []byte
- func GetProducingPillarKey(producing types.Address) []byte
- func IterateLiquidityStakeEntries(context db.DB, f func(entry *LiquidityStakeEntry) error) error
- func IterateSentinelEntries(context db.DB, f func(*SentinelInfo) error) error
- func IterateStakeEntries(context db.DB, f func(*StakeInfo) error) error
- type AcceleratorParam
- type BridgeInfoVariable
- type BurnParam
- type ChangeECDSAPubKeyParam
- type CreateHtlcParam
- type DelegationInfo
- type FundParam
- type FusedAmount
- type FusionInfo
- type HtlcInfo
- type HtlcInfoMarshal
- type HtlcProxyUnlockInfo
- type IssueParam
- type LastEpochUpdate
- type LastUpdateVariable
- type LegacyPillarEntry
- type LegacyRegisterParam
- type LiquidityInfo
- type LiquidityInfoMarshal
- type LiquidityInfoVariable
- type LiquidityStakeByExpirationTime
- type LiquidityStakeEntry
- func GetAllLiquidityStakeEntries(context db.DB) []*LiquidityStakeEntry
- func GetLiquidityStakeEntry(context db.DB, id types.Hash, address types.Address) (*LiquidityStakeEntry, error)
- func GetLiquidityStakeListByAddress(context db.DB, address types.Address) ([]*LiquidityStakeEntry, *big.Int, *big.Int, error)
- func (stake *LiquidityStakeEntry) Delete(context db.DB) error
- func (stake *LiquidityStakeEntry) MarshalJSON() ([]byte, error)
- func (stake *LiquidityStakeEntry) Save(context db.DB) error
- func (stake *LiquidityStakeEntry) ToLiquidityStakeEntry() *LiquidityStakeEntryMarshal
- func (stake *LiquidityStakeEntry) UnmarshalJSON(data []byte) error
- type LiquidityStakeEntryMarshal
- type MintParam
- type NetworkInfo
- type NetworkInfoParam
- type NetworkInfoVariable
- type OrchestratorInfo
- type OrchestratorInfoParam
- type ParamRetrieveAssets
- type Phase
- func (phase *Phase) Data() []byte
- func (phase *Phase) Delete(context db.DB)
- func (phase *Phase) Key() []byte
- func (phase *Phase) MarshalJSON() ([]byte, error)
- func (phase *Phase) Save(context db.DB)
- func (phase *Phase) ToProjectMarshal() *PhaseMarshal
- func (phase *Phase) UnmarshalJSON(data []byte) error
- type PhaseMarshal
- type PillarEpochHistory
- type PillarEpochHistoryMarshal
- type PillarInfo
- type PillarVote
- type ProducingPillar
- type Project
- type QsrDeposit
- type RedeemParam
- type RegisterParam
- type RequestPair
- type RevokeUnwrapParam
- type RewardDeposit
- func (deposit *RewardDeposit) Delete(context db.DB) error
- func (deposit *RewardDeposit) MarshalJSON() ([]byte, error)
- func (deposit *RewardDeposit) Save(context db.DB) error
- func (deposit *RewardDeposit) ToRewardDepositMarshal() *RewardDepositMarshal
- func (deposit *RewardDeposit) UnmarshalJSON(data []byte) error
- type RewardDepositHistory
- type RewardDepositMarshal
- type SecurityInfoVariable
- type SentinelInfo
- type SentinelInfoKey
- type SetAdditionalRewardParam
- type SetNetworkMetadataParam
- type SetTokenPairParam
- type Spork
- type StakeByExpirationTime
- type StakeInfo
- type SwapAssets
- type TimeChallengeInfo
- type TokenInfo
- type TokenPair
- type TokenPairMarshall
- type TokenPairParam
- type TokenTuple
- type TokenTupleMarshal
- type TokenTuplesParam
- type UnlockHtlcParam
- type UnwrapTokenParam
- type UnwrapTokenRequest
- func (unwrapRequest *UnwrapTokenRequest) Delete(context db.DB) error
- func (unwrapRequest *UnwrapTokenRequest) Key() []byte
- func (unwrapRequest *UnwrapTokenRequest) MarshalJSON() ([]byte, error)
- func (unwrapRequest *UnwrapTokenRequest) Save(context db.DB) error
- func (unwrapRequest *UnwrapTokenRequest) ToMarshalJson() *UnwrapTokenRequestMarshal
- func (unwrapRequest *UnwrapTokenRequest) UnmarshalJSON(data []byte) error
- type UnwrapTokenRequestMarshal
- type UpdateTokenParam
- type UpdateWrapRequestParam
- type VotableHash
- type VoteBreakdown
- type WrapTokenParam
- type WrapTokenRequest
- func (wrapRequest *WrapTokenRequest) Key() []byte
- func (wrapRequest *WrapTokenRequest) MarshalJSON() ([]byte, error)
- func (wrapRequest *WrapTokenRequest) Save(context db.DB) error
- func (wrapRequest *WrapTokenRequest) ToMarshalJson() *WrapTokenRequestMarshal
- func (wrapRequest *WrapTokenRequest) UnmarshalJSON(data []byte) error
- type WrapTokenRequestMarshal
- type ZtsFeesInfo
- func (zfi *ZtsFeesInfo) Delete(context db.DB) error
- func (zfi *ZtsFeesInfo) Key() ([]byte, error)
- func (zfi *ZtsFeesInfo) MarshalJSON() ([]byte, error)
- func (zfi *ZtsFeesInfo) Save(context db.DB) error
- func (zfi *ZtsFeesInfo) ToZtsFeesInfoMarshal() *ZtsFeesInfoMarshal
- func (zfi *ZtsFeesInfo) UnmarshalJSON(data []byte) error
- type ZtsFeesInfoMarshal
Constants ¶
View Source
const ( VotingStatus uint8 = iota ActiveStatus PaidStatus ClosedStatus CompletedStatus CreateProjectMethodName = "CreateProject" AddPhaseMethodName = "AddPhase" UpdatePhaseMethodName = "UpdatePhase" ProjectVariableName = "project" PhaseVariableName = "phase" )
View Source
const ( WrapTokenMethodName = "WrapToken" UpdateWrapRequestMethodName = "UpdateWrapRequest" UnwrapTokenMethodName = "UnwrapToken" RevokeUnwrapRequestMethodName = "RevokeUnwrapRequest" RedeemUnwrapMethodName = "Redeem" SetNetworkMethodName = "SetNetwork" RemoveNetworkMethodName = "RemoveNetwork" SetTokenPairMethod = "SetTokenPair" RemoveTokenPairMethodName = "RemoveTokenPair" HaltMethodName = "Halt" UnhaltMethodName = "Unhalt" SetAllowKeygenMethodName = "SetAllowKeyGen" ChangeTssECDSAPubKeyMethodName = "ChangeTssECDSAPubKey" SetOrchestratorInfoMethodName = "SetOrchestratorInfo" SetNetworkMetadataMethodName = "SetNetworkMetadata" SetBridgeMetadataMethodName = "SetBridgeMetadata" )
View Source
const ( VoteYes uint8 = iota VoteNo VoteAbstain VoteNotValid RewardDepositVariableName = "rewardDeposit" RewardDepositHistoryVariableName = "rewardDepositHistory" LastUpdateVariableName = "lastUpdate" QsrDepositVariableName = "qsrDeposit" LastEpochUpdateVariableName = "lastEpochUpdate" PillarVoteVariableName = "pillarVote" VotableHashVariableName = "votableHash" UpdateMethodName = "Update" CollectRewardMethodName = "CollectReward" DepositQsrMethodName = "DepositQsr" WithdrawQsrMethodName = "WithdrawQsr" DonateMethodName = "Donate" VoteByNameMethodName = "VoteByName" VoteByProdAddressMethodName = "VoteByProdAddress" ChangeAdministratorMethodName = "ChangeAdministrator" EmergencyMethodName = "Emergency" NominateGuardiansMethodName = "NominateGuardians" ProposeAdministratorMethodName = "ProposeAdministrator" )
View Source
const ( CreateHtlcMethodName = "Create" ReclaimHtlcMethodName = "Reclaim" UnlockHtlcMethodName = "Unlock" DenyHtlcProxyUnlockMethodName = "DenyProxyUnlock" AllowHtlcProxyUnlockMethodName = "AllowProxyUnlock" )
View Source
const ( HashTypeSHA3 uint8 = iota HashTypeSHA256 )
View Source
const ( FundMethodName = "Fund" BurnZnnMethodName = "BurnZnn" SetTokenTupleMethodName = "SetTokenTuple" LiquidityStakeMethodName = "LiquidityStake" CancelLiquidityStakeMethodName = "CancelLiquidityStake" UnlockLiquidityStakeEntriesMethodName = "UnlockLiquidityStakeEntries" SetAdditionalRewardMethodName = "SetAdditionalReward" SetIsHaltedMethodName = "SetIsHalted" )
View Source
const ( RegisterMethodName = "Register" LegacyRegisterMethodName = "RegisterLegacy" UpdatePillarMethodName = "UpdatePillar" RevokeMethodName = "Revoke" DelegateMethodName = "Delegate" UndelegateMethodName = "Undelegate" )
View Source
const ( FuseMethodName = "Fuse" CancelFuseMethodName = "CancelFuse" )
View Source
const ( RegisterSentinelMethodName = "Register" RevokeSentinelMethodName = "Revoke" )
View Source
const ( SporkCreateMethodName = "CreateSpork" SporkActivateMethodName = "ActivateSpork" )
View Source
const ( StakeMethodName = "Stake" CancelStakeMethodName = "Cancel" )
View Source
const ( IssueMethodName = "IssueToken" MintMethodName = "Mint" BurnMethodName = "Burn" UpdateTokenMethodName = "UpdateToken" )
View Source
const (
RetrieveAssetsMethodName = "RetrieveAssets"
)
Variables ¶
View Source
var ( ABIBridge = abi.JSONToABIContract(strings.NewReader(jsonBridge)) BridgeInfoKeyPrefix = []byte{3} OrchestratorInfoKeyPrefix = []byte{4} NetworkInfoKeyPrefix = []byte{5} RequestPairKeyPrefix = []byte{6} FeeTokenPairKeyPrefix = []byte{7} NoMClass = uint32(1) EvmClass = uint32(2) Uint256Ty, _ = eabi.NewType("uint256", "uint256", nil) AddressTy, _ = eabi.NewType("address", "address", nil) StringTy, _ = eabi.NewType("string", "string", nil) )
View Source
var ( ABICommon = abi.JSONToABIContract(strings.NewReader(jsonCommon)) TimeChallengeKeyPrefix = []byte{135} SecurityInfoKeyPrefix = []byte{136} )
View Source
var ( ABILiquidity = abi.JSONToABIContract(strings.NewReader(jsonLiquidity)) LiquidityInfoKeyPrefix = []byte{1} LiquidityStakeEntryKeyPrefix = []byte{2} )
View Source
var ( // ABIPillars is abi definition of pillar contract ABIPillars = abi.JSONToABIContract(strings.NewReader(jsonPillars)) AnyPillarType = uint8(0) LegacyPillarType = uint8(1) NormalPillarType = uint8(2) )
View Source
var (
ABIAccelerator = abi.JSONToABIContract(strings.NewReader(jsonAccelerator))
)
View Source
var (
ABIHtlc = abi.JSONToABIContract(strings.NewReader(jsonHtlc))
)
View Source
var ( // ABIPlasma is abi definition of the plasma contract ABIPlasma = abi.JSONToABIContract(strings.NewReader(jsonPlasma)) )
View Source
var (
ABISentinel = abi.JSONToABIContract(strings.NewReader(jsonSentinel))
)
View Source
var ( // ABISpork is abi definition of token contract ABISpork = abi.JSONToABIContract(strings.NewReader(jsonSpork)) )
View Source
var (
ABIStake = abi.JSONToABIContract(strings.NewReader(jsonStake))
)
View Source
var (
ABISwap = abi.JSONToABIContract(strings.NewReader(jsonSwap))
)
View Source
var ( // ABIToken is abi definition of token contract ABIToken = abi.JSONToABIContract(strings.NewReader(jsonToken)) )
View Source
var HashTypeDigestSizes = map[uint8]uint8{ HashTypeSHA3: 32, HashTypeSHA256: 32, }
Functions ¶
func GetNetworkInfoKey ¶
func GetPillarInfoKey ¶
func GetProducingPillarKey ¶
func IterateLiquidityStakeEntries ¶
func IterateLiquidityStakeEntries(context db.DB, f func(entry *LiquidityStakeEntry) error) error
func IterateSentinelEntries ¶
func IterateSentinelEntries(context db.DB, f func(*SentinelInfo) error) error
Types ¶
type AcceleratorParam ¶
type BridgeInfoVariable ¶
type BridgeInfoVariable struct { // Administrator address Administrator types.Address `json:"administrator"` // ECDSA pub key generated by the orchestrator from key gen ceremony CompressedTssECDSAPubKey string `json:"compressedTssECDSAPubKey"` DecompressedTssECDSAPubKey string `json:"decompressedTssECDSAPubKey"` // This specifies whether the orchestrator should key gen or not AllowKeyGen bool `json:"allowKeyGen"` // This specifies whether the bridge is halted or not Halted bool `json:"halted"` // Height at which the administrator called unhalt method, UnhaltDurationInMomentums starts from here UnhaltedAt uint64 `json:"unhaltedAt"` // After we call the unhalt embedded method, the bridge will still be halted for UnhaltDurationInMomentums momentums UnhaltDurationInMomentums uint64 `json:"unhaltDurationInMomentums"` // An incremental nonce used for signing messages TssNonce uint64 `json:"tssNonce"` // Additional metadata Metadata string `json:"metadata"` }
func GetBridgeInfoVariable ¶
func GetBridgeInfoVariable(context db.DB) (*BridgeInfoVariable, error)
type ChangeECDSAPubKeyParam ¶
type CreateHtlcParam ¶
type DelegationInfo ¶
func GetDelegationInfo ¶
func GetDelegationsList ¶
func GetDelegationsList(context db.DB) ([]*DelegationInfo, error)
type FusedAmount ¶
func GetFusedAmount ¶
type FusionInfo ¶
type FusionInfo struct { Owner types.Address `json:"owner"` Id types.Hash `json:"id"` Amount *big.Int `json:"amount"` ExpirationHeight uint64 `json:"withdrawHeight"` Beneficiary types.Address `json:"beneficiaryAddress"` }
func GetFusionInfo ¶
type HtlcInfo ¶
type HtlcInfo struct { Id types.Hash `json:"id"` TimeLocked types.Address `json:"timeLocked"` HashLocked types.Address `json:"hashLocked"` TokenStandard types.ZenonTokenStandard `json:"tokenStandard"` Amount *big.Int `json:"amount"` ExpirationTime int64 `json:"expirationTime"` HashType uint8 `json:"hashType"` KeyMaxSize uint8 `json:"keyMaxSize"` HashLock []byte `json:"hashLock"` }
func (*HtlcInfo) MarshalJSON ¶
func (*HtlcInfo) ToHtlcInfoMarshal ¶
func (h *HtlcInfo) ToHtlcInfoMarshal() *HtlcInfoMarshal
func (*HtlcInfo) UnmarshalJSON ¶
type HtlcInfoMarshal ¶
type HtlcInfoMarshal struct { Id types.Hash `json:"id"` TimeLocked types.Address `json:"timeLocked"` HashLocked types.Address `json:"hashLocked"` TokenStandard types.ZenonTokenStandard `json:"tokenStandard"` Amount string `json:"amount"` ExpirationTime int64 `json:"expirationTime"` HashType uint8 `json:"hashType"` KeyMaxSize uint8 `json:"keyMaxSize"` HashLock []byte `json:"hashLock"` }
type HtlcProxyUnlockInfo ¶
func GetHtlcProxyUnlockInfo ¶
type IssueParam ¶
type LastEpochUpdate ¶
type LastEpochUpdate struct {
LastEpoch int64
}
func GetLastEpochUpdate ¶
func GetLastEpochUpdate(context db.DB) (*LastEpochUpdate, error)
type LastUpdateVariable ¶
type LastUpdateVariable struct {
Height uint64
}
func GetLastUpdate ¶
func GetLastUpdate(context db.DB) (*LastUpdateVariable, error)
type LegacyPillarEntry ¶
type LegacyPillarEntry struct { PillarCount uint8 `json:"pillarCount"` KeyIdHash types.Hash `json:"keyIdHash"` }
func GetLegacyPillarEntry ¶
func GetLegacyPillarList ¶
func GetLegacyPillarList(context db.DB) ([]*LegacyPillarEntry, error)
type LegacyRegisterParam ¶
type LegacyRegisterParam struct { RegisterParam PublicKey string Signature string }
type LiquidityInfo ¶
type LiquidityInfo struct { Administrator types.Address `json:"administrator"` IsHalted bool `json:"isHalted"` ZnnReward *big.Int `json:"znnReward"` QsrReward *big.Int `json:"qsrReward"` TokenTuples []TokenTuple `json:"tokenTuples"` }
func GetLiquidityInfo ¶
func GetLiquidityInfo(context db.DB) (*LiquidityInfo, error)
func (*LiquidityInfo) MarshalJSON ¶
func (l *LiquidityInfo) MarshalJSON() ([]byte, error)
func (*LiquidityInfo) ToLiquidityInfoMarshal ¶
func (l *LiquidityInfo) ToLiquidityInfoMarshal() LiquidityInfoMarshal
func (*LiquidityInfo) UnmarshalJSON ¶
func (l *LiquidityInfo) UnmarshalJSON(data []byte) error
type LiquidityInfoMarshal ¶
type LiquidityInfoVariable ¶
type LiquidityInfoVariable struct { Administrator types.Address `json:"administrator"` IsHalted bool `json:"isHalted"` ZnnReward *big.Int `json:"znnReward"` QsrReward *big.Int `json:"qsrReward"` TokenTuples [][]byte `json:"tokenTuples"` }
func EncodeLiquidityInfo ¶
func EncodeLiquidityInfo(liquidityInfo *LiquidityInfo) (*LiquidityInfoVariable, error)
type LiquidityStakeByExpirationTime ¶
type LiquidityStakeByExpirationTime []*LiquidityStakeEntry
func (LiquidityStakeByExpirationTime) Len ¶
func (a LiquidityStakeByExpirationTime) Len() int
func (LiquidityStakeByExpirationTime) Less ¶
func (a LiquidityStakeByExpirationTime) Less(i, j int) bool
func (LiquidityStakeByExpirationTime) Swap ¶
func (a LiquidityStakeByExpirationTime) Swap(i, j int)
type LiquidityStakeEntry ¶
type LiquidityStakeEntry struct { Amount *big.Int `json:"amount"` TokenStandard types.ZenonTokenStandard `json:"tokenStandard"` WeightedAmount *big.Int `json:"weightedAmount"` StartTime int64 `json:"startTime"` RevokeTime int64 `json:"revokeTime"` ExpirationTime int64 `json:"expirationTime"` StakeAddress types.Address `json:"stakeAddress"` Id types.Hash `json:"id"` }
func GetAllLiquidityStakeEntries ¶
func GetAllLiquidityStakeEntries(context db.DB) []*LiquidityStakeEntry
func GetLiquidityStakeEntry ¶
func GetLiquidityStakeListByAddress ¶
func GetLiquidityStakeListByAddress(context db.DB, address types.Address) ([]*LiquidityStakeEntry, *big.Int, *big.Int, error)
Returns all *active* stake entries for an address
func (*LiquidityStakeEntry) MarshalJSON ¶
func (stake *LiquidityStakeEntry) MarshalJSON() ([]byte, error)
func (*LiquidityStakeEntry) ToLiquidityStakeEntry ¶
func (stake *LiquidityStakeEntry) ToLiquidityStakeEntry() *LiquidityStakeEntryMarshal
func (*LiquidityStakeEntry) UnmarshalJSON ¶
func (stake *LiquidityStakeEntry) UnmarshalJSON(data []byte) error
type LiquidityStakeEntryMarshal ¶
type LiquidityStakeEntryMarshal struct { Amount string `json:"amount"` TokenStandard types.ZenonTokenStandard `json:"tokenStandard"` WeightedAmount string `json:"weightedAmount"` StartTime int64 `json:"startTime"` RevokeTime int64 `json:"revokeTime"` ExpirationTime int64 `json:"expirationTime"` StakeAddress types.Address `json:"stakeAddress"` Id types.Hash `json:"id"` }
type NetworkInfo ¶
type NetworkInfo struct { NetworkClass uint32 `json:"networkClass"` Id uint32 `json:"chainId"` Name string `json:"name"` ContractAddress string `json:"contractAddress"` Metadata string `json:"metadata"` TokenPairs []TokenPair `json:"tokenPairs"` }
func GetNetworkInfoVariable ¶
func GetNetworkList ¶
func GetNetworkList(context db.DB) ([]*NetworkInfo, error)
type NetworkInfoParam ¶
type NetworkInfoVariable ¶
type NetworkInfoVariable struct { NetworkClass uint32 `json:"networkClass"` Id uint32 `json:"chainId"` Name string `json:"name"` ContractAddress string `json:"contractAddress"` Metadata string `json:"metadata"` TokenPairs [][]byte `json:"tokenPairs"` }
NetworkInfoVariable One network will always be znn, so we just need the other one
func EncodeNetworkInfo ¶
func EncodeNetworkInfo(networkInfo *NetworkInfo) (*NetworkInfoVariable, error)
func (*NetworkInfoVariable) Key ¶
func (nI *NetworkInfoVariable) Key() []byte
type OrchestratorInfo ¶
type OrchestratorInfo struct { // Momentums period in which only one signing ceremony (wrap or unwrap) can occur in the orchestrator WindowSize uint64 `json:"windowSize"` // This variable is used in the orchestrator to wait for at least KeyGenThreshold participants for a key gen ceremony KeyGenThreshold uint32 `json:"keyGenThreshold"` // Momentums until orchestrator can process wrap requests ConfirmationsToFinality uint32 `json:"confirmationsToFinality"` // Momentum time EstimatedMomentumTime uint32 `json:"estimatedMomentumTime"` // This variable is a reference for the orchestrator to check the last 24h of momentums for producing pillars AllowKeyGenHeight uint64 `json:"allowKeyGenHeight"` }
func GetOrchestratorInfoVariable ¶
func GetOrchestratorInfoVariable(context db.DB) (*OrchestratorInfo, error)
func (*OrchestratorInfo) Key ¶
func (oI *OrchestratorInfo) Key() []byte
type OrchestratorInfoParam ¶
type ParamRetrieveAssets ¶
type Phase ¶
type Phase struct { Id types.Hash `json:"id"` ProjectId types.Hash `json:"projectID"` Name string `json:"name"` Description string `json:"description"` Url string `json:"url"` ZnnFundsNeeded *big.Int `json:"znnFundsNeeded"` QsrFundsNeeded *big.Int `json:"qsrFundsNeeded"` CreationTimestamp int64 `json:"creationTimestamp"` AcceptedTimestamp int64 `json:"acceptedTimestamp"` Status uint8 `json:"status"` }
func (*Phase) MarshalJSON ¶
func (*Phase) ToProjectMarshal ¶
func (phase *Phase) ToProjectMarshal() *PhaseMarshal
func (*Phase) UnmarshalJSON ¶
type PhaseMarshal ¶
type PhaseMarshal struct { Id types.Hash `json:"id"` ProjectId types.Hash `json:"projectID"` Name string `json:"name"` Description string `json:"description"` Url string `json:"url"` ZnnFundsNeeded string `json:"znnFundsNeeded"` QsrFundsNeeded string `json:"qsrFundsNeeded"` CreationTimestamp int64 `json:"creationTimestamp"` AcceptedTimestamp int64 `json:"acceptedTimestamp"` Status uint8 `json:"status"` }
type PillarEpochHistory ¶
type PillarEpochHistory struct { Name string `json:"name"` Epoch uint64 `json:"epoch"` GiveBlockRewardPercentage uint8 `json:"giveBlockRewardPercentage"` GiveDelegateRewardPercentage uint8 `json:"giveDelegateRewardPercentage"` ProducedBlockNum int32 `json:"producedBlockNum"` ExpectedBlockNum int32 `json:"expectedBlockNum"` Weight *big.Int `json:"weight"` }
func GetPillarEpochHistoryList ¶
func GetPillarEpochHistoryList(context db.DB, epoch uint64) ([]*PillarEpochHistory, error)
func (*PillarEpochHistory) MarshalJSON ¶
func (g *PillarEpochHistory) MarshalJSON() ([]byte, error)
func (*PillarEpochHistory) ToPillarEpochHistoryMarshal ¶
func (g *PillarEpochHistory) ToPillarEpochHistoryMarshal() *PillarEpochHistoryMarshal
func (*PillarEpochHistory) UnmarshalJSON ¶
func (g *PillarEpochHistory) UnmarshalJSON(data []byte) error
type PillarEpochHistoryMarshal ¶
type PillarEpochHistoryMarshal struct { Name string `json:"name"` Epoch uint64 `json:"epoch"` GiveBlockRewardPercentage uint8 `json:"giveBlockRewardPercentage"` GiveDelegateRewardPercentage uint8 `json:"giveDelegateRewardPercentage"` ProducedBlockNum int32 `json:"producedBlockNum"` ExpectedBlockNum int32 `json:"expectedBlockNum"` Weight string `json:"weight"` }
type PillarInfo ¶
type PillarInfo struct { Name string BlockProducingAddress types.Address RewardWithdrawAddress types.Address StakeAddress types.Address Amount *big.Int RegistrationTime int64 RevokeTime int64 GiveBlockRewardPercentage uint8 GiveDelegateRewardPercentage uint8 PillarType uint8 }
func GetPillarInfo ¶
func GetPillarInfo(context db.DB, name string) (*PillarInfo, error)
func GetPillarsList ¶
func (*PillarInfo) IsActive ¶
func (pillar *PillarInfo) IsActive() bool
type PillarVote ¶
type PillarVote struct { Id types.Hash `json:"id"` Name string `json:"name"` Vote uint8 `json:"vote"` }
func GetAllPillarVotes ¶
func GetAllPillarVotes(context db.DB, id types.Hash) []*PillarVote
func GetPillarVote ¶
func (*PillarVote) Data ¶
func (vote *PillarVote) Data() []byte
func (*PillarVote) Delete ¶
func (vote *PillarVote) Delete(context db.DB)
func (*PillarVote) Key ¶
func (vote *PillarVote) Key() []byte
func (*PillarVote) Save ¶
func (vote *PillarVote) Save(context db.DB)
type ProducingPillar ¶
func GetProducingPillarName ¶
type Project ¶
type Project struct { Id types.Hash `json:"id"` Owner types.Address `json:"owner"` Name string `json:"name"` Description string `json:"description"` Url string `json:"url"` ZnnFundsNeeded *big.Int `json:"znnFundsNeeded"` QsrFundsNeeded *big.Int `json:"qsrFundsNeeded"` CreationTimestamp int64 `json:"creationTimestamp"` LastUpdateTimestamp int64 `json:"lastUpdateTimestamp"` Status uint8 `json:"status"` PhaseIds []types.Hash }
func (*Project) GetCurrentPhase ¶
type QsrDeposit ¶
func GetQsrDeposit ¶
GetQsrDeposit returns deposited QSR for sentinel/pillar. does not return util.ErrDataNonExistent, returns valid deposit with 0 amount.
type RedeemParam ¶
type RegisterParam ¶
type RequestPair ¶
type RequestPair struct { Id types.Hash `json:"id"` CreationMomentumHeight uint64 `json:"creationMomentumHeight"` }
func GetRequestPairById ¶
func (*RequestPair) Key ¶
func (pair *RequestPair) Key() []byte
type RevokeUnwrapParam ¶
type RewardDeposit ¶
type RewardDeposit struct { Address *types.Address `json:"address"` Znn *big.Int `json:"znnAmount"` Qsr *big.Int `json:"qsrAmount"` }
func GetRewardDeposit ¶
GetRewardDeposit returns uncollected ZNN & QSR reward. does not return util.ErrDataNonExistent, returns valid deposit with 0 amount.
func (*RewardDeposit) MarshalJSON ¶
func (deposit *RewardDeposit) MarshalJSON() ([]byte, error)
func (*RewardDeposit) ToRewardDepositMarshal ¶
func (deposit *RewardDeposit) ToRewardDepositMarshal() *RewardDepositMarshal
func (*RewardDeposit) UnmarshalJSON ¶
func (deposit *RewardDeposit) UnmarshalJSON(data []byte) error
type RewardDepositHistory ¶
type RewardDepositHistory struct { Epoch uint64 Address *types.Address `json:"address"` Znn *big.Int `json:"znnAmount"` Qsr *big.Int `json:"qsrAmount"` }
func GetRewardDepositHistory ¶
type RewardDepositMarshal ¶
type SecurityInfoVariable ¶
type SecurityInfoVariable struct { // addresses that can vote for the new administrator once the bridge is in emergency Guardians []types.Address `json:"guardians"` // votes of the active guardians GuardiansVotes []types.Address `json:"guardiansVotes"` // delay upon which the new administrator or guardians will be active AdministratorDelay uint64 `json:"administratorDelay"` // delay upon which all other time challenges will expire SoftDelay uint64 `json:"softDelay"` }
SecurityInfoVariable This refers to time challenge security
func GetSecurityInfoVariable ¶
func GetSecurityInfoVariable(context db.DB) (*SecurityInfoVariable, error)
type SentinelInfo ¶
type SentinelInfo struct { SentinelInfoKey RegistrationTimestamp int64 `json:"registrationTimestamp"` RevokeTimestamp int64 `json:"revokeTimestamp"` ZnnAmount *big.Int `json:"znnAmount"` QsrAmount *big.Int `json:"qsrAmount"` }
func GetAllSentinelInfo ¶
func GetAllSentinelInfo(context db.DB) []*SentinelInfo
func GetSentinelInfoByOwner ¶
func GetSentinelInfoByOwner(context db.DB, address types.Address) *SentinelInfo
func (*SentinelInfo) Data ¶
func (sentinel *SentinelInfo) Data() []byte
func (*SentinelInfo) Delete ¶
func (sentinel *SentinelInfo) Delete(context db.DB)
func (*SentinelInfo) Save ¶
func (sentinel *SentinelInfo) Save(context db.DB)
type SentinelInfoKey ¶
func (*SentinelInfoKey) Key ¶
func (sentinel *SentinelInfoKey) Key() []byte
type SetNetworkMetadataParam ¶
type SetTokenPairParam ¶
type Spork ¶
type Spork struct { Id types.Hash `json:"id"` Name string `json:"name"` Description string `json:"description"` // If the spork is active, Activated = true and EnforcementHeight = activation momentum height + HeightDelay Activated bool `json:"activated"` EnforcementHeight uint64 `json:"enforcementHeight"` }
func GetAllSporks ¶
type StakeByExpirationTime ¶
type StakeByExpirationTime []*StakeInfo
func (StakeByExpirationTime) Len ¶
func (a StakeByExpirationTime) Len() int
func (StakeByExpirationTime) Less ¶
func (a StakeByExpirationTime) Less(i, j int) bool
func (StakeByExpirationTime) Swap ¶
func (a StakeByExpirationTime) Swap(i, j int)
type StakeInfo ¶
type StakeInfo struct { Amount *big.Int `json:"amount"` WeightedAmount *big.Int `json:"weightedAmount"` StartTime int64 `json:"startTime"` RevokeTime int64 `json:"revokeTime"` ExpirationTime int64 `json:"expirationTime"` StakeAddress types.Address `json:"stakeAddress"` Id types.Hash `json:"id"` }
func GetStakeInfo ¶
type SwapAssets ¶
type SwapAssets struct { KeyIdHash types.Hash `json:"keyIdHash"` Znn *big.Int `json:"znn"` Qsr *big.Int `json:"qsr"` }
func GetSwapAssets ¶
func GetSwapAssets(context db.DB) ([]*SwapAssets, error)
type TimeChallengeInfo ¶
type TimeChallengeInfo struct { MethodName string ParamsHash types.Hash ChallengeStartHeight uint64 }
func GetTimeChallengeInfoVariable ¶
func GetTimeChallengeInfoVariable(context db.DB, methodName string) (*TimeChallengeInfo, error)
func (*TimeChallengeInfo) Key ¶
func (t *TimeChallengeInfo) Key() []byte
type TokenInfo ¶
type TokenInfo struct { Owner types.Address `json:"owner"` TokenName string `json:"tokenName"` TokenSymbol string `json:"tokenSymbol"` TokenDomain string `json:"tokenDomain"` TotalSupply *big.Int `json:"totalSupply"` MaxSupply *big.Int `json:"maxSupply"` Decimals uint8 `json:"decimals"` IsMintable bool `json:"isMintable"` // IsBurnable = true implies that anyone can burn the token. // The Owner can burn the token even if IsBurnable = false. IsBurnable bool `json:"isBurnable"` IsUtility bool `json:"isUtility"` TokenStandard types.ZenonTokenStandard `json:"tokenStandard"` }
func GetTokenInfo ¶
type TokenPair ¶
type TokenPair struct { TokenStandard types.ZenonTokenStandard `json:"tokenStandard"` TokenAddress string `json:"tokenAddress"` Bridgeable bool `json:"bridgeable"` Redeemable bool `json:"redeemable"` Owned bool `json:"owned"` MinAmount *big.Int `json:"minAmount"` FeePercentage uint32 `json:"feePercentage"` RedeemDelay uint32 `json:"redeemDelay"` Metadata string `json:"metadata"` }
func GetTokenPairVariable ¶
func (*TokenPair) MarshalJSON ¶
func (*TokenPair) ToMarshalJson ¶
func (t *TokenPair) ToMarshalJson() *TokenPairMarshall
func (*TokenPair) UnmarshalJSON ¶
type TokenPairMarshall ¶
type TokenPairMarshall struct { TokenStandard types.ZenonTokenStandard `json:"tokenStandard"` TokenAddress string `json:"tokenAddress"` Bridgeable bool `json:"bridgeable"` Redeemable bool `json:"redeemable"` Owned bool `json:"owned"` MinAmount string `json:"minAmount"` FeePercentage uint32 `json:"feePercentage"` RedeemDelay uint32 `json:"redeemDelay"` Metadata string `json:"metadata"` }
type TokenPairParam ¶
type TokenPairParam struct { NetworkClass uint32 ChainId uint32 TokenStandard types.ZenonTokenStandard TokenAddress string Bridgeable bool Redeemable bool Owned bool MinAmount *big.Int FeePercentage uint32 RedeemDelay uint32 Metadata string }
func (*TokenPairParam) Hash ¶
func (p *TokenPairParam) Hash() []byte
type TokenTuple ¶
type TokenTuple struct { TokenStandard string `json:"tokenStandard"` ZnnPercentage uint32 `json:"znnPercentage"` QsrPercentage uint32 `json:"qsrPercentage"` MinAmount *big.Int `json:"minAmount"` }
func (*TokenTuple) MarshalJSON ¶
func (s *TokenTuple) MarshalJSON() ([]byte, error)
func (*TokenTuple) ToTokenTupleMarshal ¶
func (s *TokenTuple) ToTokenTupleMarshal() *TokenTupleMarshal
func (*TokenTuple) UnmarshalJSON ¶
func (s *TokenTuple) UnmarshalJSON(data []byte) error
type TokenTupleMarshal ¶
type TokenTuplesParam ¶
type UnlockHtlcParam ¶
type UnwrapTokenParam ¶
type UnwrapTokenRequest ¶
type UnwrapTokenRequest struct { RegistrationMomentumHeight uint64 `json:"registrationMomentumHeight"` NetworkClass uint32 `json:"networkClass"` ChainId uint32 `json:"chainId"` TransactionHash types.Hash `json:"transactionHash"` LogIndex uint32 `json:"logIndex"` ToAddress types.Address `json:"toAddress"` TokenAddress string `json:"tokenAddress"` TokenStandard types.ZenonTokenStandard `json:"tokenStandard"` Amount *big.Int `json:"amount"` Signature string `json:"signature"` Redeemed uint8 `json:"redeemed"` Revoked uint8 `json:"revoked"` }
func GetUnwrapTokenRequests ¶
func GetUnwrapTokenRequests(context db.DB) ([]*UnwrapTokenRequest, error)
func (*UnwrapTokenRequest) Delete ¶
func (unwrapRequest *UnwrapTokenRequest) Delete(context db.DB) error
func (*UnwrapTokenRequest) Key ¶
func (unwrapRequest *UnwrapTokenRequest) Key() []byte
func (*UnwrapTokenRequest) MarshalJSON ¶
func (unwrapRequest *UnwrapTokenRequest) MarshalJSON() ([]byte, error)
func (*UnwrapTokenRequest) Save ¶
func (unwrapRequest *UnwrapTokenRequest) Save(context db.DB) error
func (*UnwrapTokenRequest) ToMarshalJson ¶
func (unwrapRequest *UnwrapTokenRequest) ToMarshalJson() *UnwrapTokenRequestMarshal
func (*UnwrapTokenRequest) UnmarshalJSON ¶
func (unwrapRequest *UnwrapTokenRequest) UnmarshalJSON(data []byte) error
type UnwrapTokenRequestMarshal ¶
type UnwrapTokenRequestMarshal struct { RegistrationMomentumHeight uint64 `json:"registrationMomentumHeight"` NetworkClass uint32 `json:"networkClass"` ChainId uint32 `json:"chainId"` TransactionHash types.Hash `json:"transactionHash"` LogIndex uint32 `json:"logIndex"` ToAddress types.Address `json:"toAddress"` TokenAddress string `json:"tokenAddress"` TokenStandard types.ZenonTokenStandard `json:"tokenStandard"` Amount string `json:"amount"` Signature string `json:"signature"` Redeemed uint8 `json:"redeemed"` Revoked uint8 `json:"revoked"` }
type UpdateTokenParam ¶
type UpdateWrapRequestParam ¶
type VotableHash ¶
func GetVotableHash ¶
func (*VotableHash) Data ¶
func (votable *VotableHash) Data() []byte
func (*VotableHash) Delete ¶
func (votable *VotableHash) Delete(context db.DB)
func (*VotableHash) Key ¶
func (votable *VotableHash) Key() []byte
func (*VotableHash) Save ¶
func (votable *VotableHash) Save(context db.DB)
type VoteBreakdown ¶
type VoteBreakdown struct { Id types.Hash `json:"id"` Total uint32 `json:"total"` Yes uint32 `json:"yes"` No uint32 `json:"no"` }
func GetVoteBreakdown ¶
func GetVoteBreakdown(context db.DB, id types.Hash) *VoteBreakdown
type WrapTokenParam ¶
type WrapTokenRequest ¶
type WrapTokenRequest struct { NetworkClass uint32 `json:"networkClass"` ChainId uint32 `json:"chainId"` Id types.Hash `json:"id"` ToAddress string `json:"toAddress"` TokenStandard types.ZenonTokenStandard `json:"tokenStandard"` TokenAddress string `json:"tokenAddress"` Amount *big.Int `json:"amount"` Fee *big.Int `json:"fee"` Signature string `json:"signature"` CreationMomentumHeight uint64 `json:"creationMomentumHeight"` }
func GetWrapTokenRequestById ¶
func GetWrapTokenRequests ¶
func GetWrapTokenRequests(context db.DB) ([]*WrapTokenRequest, error)
func (*WrapTokenRequest) Key ¶
func (wrapRequest *WrapTokenRequest) Key() []byte
func (*WrapTokenRequest) MarshalJSON ¶
func (wrapRequest *WrapTokenRequest) MarshalJSON() ([]byte, error)
func (*WrapTokenRequest) ToMarshalJson ¶
func (wrapRequest *WrapTokenRequest) ToMarshalJson() *WrapTokenRequestMarshal
func (*WrapTokenRequest) UnmarshalJSON ¶
func (wrapRequest *WrapTokenRequest) UnmarshalJSON(data []byte) error
type WrapTokenRequestMarshal ¶
type WrapTokenRequestMarshal struct { NetworkClass uint32 `json:"networkClass"` ChainId uint32 `json:"chainId"` Id types.Hash `json:"id"` ToAddress string `json:"toAddress"` TokenStandard types.ZenonTokenStandard `json:"tokenStandard"` TokenAddress string `json:"tokenAddress"` Amount string `json:"amount"` Fee string `json:"fee"` Signature string `json:"signature"` CreationMomentumHeight uint64 `json:"creationMomentumHeight"` }
type ZtsFeesInfo ¶
type ZtsFeesInfo struct { TokenStandard types.ZenonTokenStandard `json:"tokenStandard"` AccumulatedFee *big.Int `json:"accumulatedFee"` }
func GetZtsFeesInfoVariable ¶
func GetZtsFeesInfoVariable(context db.DB, tokenStandard types.ZenonTokenStandard) (*ZtsFeesInfo, error)
func (*ZtsFeesInfo) Key ¶
func (zfi *ZtsFeesInfo) Key() ([]byte, error)
func (*ZtsFeesInfo) MarshalJSON ¶
func (zfi *ZtsFeesInfo) MarshalJSON() ([]byte, error)
func (*ZtsFeesInfo) ToZtsFeesInfoMarshal ¶
func (zfi *ZtsFeesInfo) ToZtsFeesInfoMarshal() *ZtsFeesInfoMarshal
func (*ZtsFeesInfo) UnmarshalJSON ¶
func (zfi *ZtsFeesInfo) UnmarshalJSON(data []byte) error
type ZtsFeesInfoMarshal ¶
type ZtsFeesInfoMarshal struct { TokenStandard types.ZenonTokenStandard `json:"tokenStandard"` AccumulatedFee string `json:"accumulatedFee"` }
Click to show internal directories.
Click to hide internal directories.