definition

package
v0.0.7-alphanet Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: GPL-3.0 Imports: 18 Imported by: 5

Documentation

Index

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 GetNetworkInfoKey(networkClass uint32, chainId uint32) []byte

func GetPillarInfoKey

func GetPillarInfoKey(name string) []byte

func GetProducingPillarKey

func GetProducingPillarKey(producing types.Address) []byte

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

func IterateStakeEntries

func IterateStakeEntries(context db.DB, f func(*StakeInfo) error) error

Types

type AcceleratorParam

type AcceleratorParam struct {
	Id             types.Hash
	Name           string
	Description    string
	Url            string
	ZnnFundsNeeded *big.Int
	QsrFundsNeeded *big.Int
}

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)

func (*BridgeInfoVariable) Save

func (b *BridgeInfoVariable) Save(context db.DB) error

type BurnParam

type BurnParam struct {
	BurnAmount *big.Int
}

type ChangeECDSAPubKeyParam

type ChangeECDSAPubKeyParam struct {
	PubKey             string
	OldPubKeySignature string
	NewPubKeySignature string
}

type CreateHtlcParam

type CreateHtlcParam struct {
	HashLocked     types.Address `json:"hashLocked"`
	ExpirationTime int64         `json:"expirationTime"`
	HashType       uint8         `json:"hashType"`
	KeyMaxSize     uint8         `json:"keyMaxSize"`
	HashLock       []byte        `json:"hashLock"`
}

type DelegationInfo

type DelegationInfo struct {
	Backer types.Address
	Name   string
}

func GetDelegationInfo

func GetDelegationInfo(context db.DB, address types.Address) (*DelegationInfo, error)

func GetDelegationsList

func GetDelegationsList(context db.DB) ([]*DelegationInfo, error)

func (*DelegationInfo) Delete

func (delegation *DelegationInfo) Delete(context db.DB) error

func (*DelegationInfo) Save

func (delegation *DelegationInfo) Save(context db.DB) error

type FundParam

type FundParam struct {
	ZnnReward *big.Int
	QsrReward *big.Int
}

type FusedAmount

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

func GetFusedAmount

func GetFusedAmount(context db.DB, beneficiary types.Address) (*FusedAmount, error)

func (*FusedAmount) Delete

func (entry *FusedAmount) Delete(context db.DB) error

func (*FusedAmount) Save

func (entry *FusedAmount) Save(context db.DB) error

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

func GetFusionInfo(context db.DB, owner types.Address, id types.Hash) (*FusionInfo, error)

func GetFusionInfoListByOwner

func GetFusionInfoListByOwner(context db.DB, owner types.Address) ([]*FusionInfo, *big.Int, error)

func (*FusionInfo) Delete

func (entry *FusionInfo) Delete(context db.DB) error

func (*FusionInfo) Save

func (entry *FusionInfo) Save(context db.DB) error

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 GetHtlcInfo

func GetHtlcInfo(context db.DB, id types.Hash) (*HtlcInfo, error)

func (*HtlcInfo) Delete

func (h *HtlcInfo) Delete(context db.DB) error

func (*HtlcInfo) MarshalJSON

func (h *HtlcInfo) MarshalJSON() ([]byte, error)

func (*HtlcInfo) Save

func (h *HtlcInfo) Save(context db.DB) error

func (*HtlcInfo) String

func (h *HtlcInfo) String() string

func (*HtlcInfo) ToHtlcInfoMarshal

func (h *HtlcInfo) ToHtlcInfoMarshal() *HtlcInfoMarshal

func (*HtlcInfo) UnmarshalJSON

func (h *HtlcInfo) UnmarshalJSON(data []byte) error

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

type HtlcProxyUnlockInfo struct {
	Address types.Address
	Allowed bool
}

func GetHtlcProxyUnlockInfo

func GetHtlcProxyUnlockInfo(context db.DB, address types.Address) (*HtlcProxyUnlockInfo, error)

func (*HtlcProxyUnlockInfo) Delete

func (entry *HtlcProxyUnlockInfo) Delete(context db.DB) error

func (*HtlcProxyUnlockInfo) Save

func (entry *HtlcProxyUnlockInfo) Save(context db.DB) error

type IssueParam

type IssueParam struct {
	TokenName   string
	TokenSymbol string
	TokenDomain string
	TotalSupply *big.Int
	MaxSupply   *big.Int
	Decimals    uint8
	IsMintable  bool
	IsBurnable  bool
	IsUtility   bool
}

type LastEpochUpdate

type LastEpochUpdate struct {
	LastEpoch int64
}

func GetLastEpochUpdate

func GetLastEpochUpdate(context db.DB) (*LastEpochUpdate, error)

func (*LastEpochUpdate) Save

func (epoch *LastEpochUpdate) Save(context db.DB) error

type LastUpdateVariable

type LastUpdateVariable struct {
	Height uint64
}

func GetLastUpdate

func GetLastUpdate(context db.DB) (*LastUpdateVariable, error)

func (*LastUpdateVariable) Save

func (upd *LastUpdateVariable) Save(context db.DB) error

type LegacyPillarEntry

type LegacyPillarEntry struct {
	PillarCount uint8      `json:"pillarCount"`
	KeyIdHash   types.Hash `json:"keyIdHash"`
}

func GetLegacyPillarEntry

func GetLegacyPillarEntry(context db.DB, keyIdHash types.Hash) (*LegacyPillarEntry, error)

func GetLegacyPillarList

func GetLegacyPillarList(context db.DB) ([]*LegacyPillarEntry, error)

func (*LegacyPillarEntry) Delete

func (legacy *LegacyPillarEntry) Delete(context db.DB) error

func (*LegacyPillarEntry) Save

func (legacy *LegacyPillarEntry) Save(context db.DB) 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 LiquidityInfoMarshal struct {
	Administrator types.Address `json:"administrator"`
	IsHalted      bool          `json:"isHalted"`
	ZnnReward     string        `json:"znnReward"`
	QsrReward     string        `json:"qsrReward"`
	TokenTuples   []TokenTuple  `json:"tokenTuples"`
}

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)

func (*LiquidityInfoVariable) Save

func (liq *LiquidityInfoVariable) Save(context db.DB) error

type LiquidityStakeByExpirationTime

type LiquidityStakeByExpirationTime []*LiquidityStakeEntry

func (LiquidityStakeByExpirationTime) Len

func (LiquidityStakeByExpirationTime) Less

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 GetLiquidityStakeEntry(context db.DB, id types.Hash, address types.Address) (*LiquidityStakeEntry, error)

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) Delete

func (stake *LiquidityStakeEntry) Delete(context db.DB) error

func (*LiquidityStakeEntry) MarshalJSON

func (stake *LiquidityStakeEntry) MarshalJSON() ([]byte, error)

func (*LiquidityStakeEntry) Save

func (stake *LiquidityStakeEntry) Save(context db.DB) 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 MintParam

type MintParam struct {
	TokenStandard  types.ZenonTokenStandard
	Amount         *big.Int
	ReceiveAddress types.Address
}

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 GetNetworkInfoVariable(context db.DB, networkClass uint32, chainId uint32) (*NetworkInfo, error)

func GetNetworkList

func GetNetworkList(context db.DB) ([]*NetworkInfo, error)

type NetworkInfoParam

type NetworkInfoParam struct {
	NetworkClass    uint32
	ChainId         uint32
	Name            string
	ContractAddress string
	Metadata        string
}

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) Delete

func (nI *NetworkInfoVariable) Delete(context db.DB) error

func (*NetworkInfoVariable) Key

func (nI *NetworkInfoVariable) Key() []byte

func (*NetworkInfoVariable) Save

func (nI *NetworkInfoVariable) Save(context db.DB) error

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) Delete

func (oI *OrchestratorInfo) Delete(context db.DB) error

func (*OrchestratorInfo) Key

func (oI *OrchestratorInfo) Key() []byte

func (*OrchestratorInfo) Save

func (oI *OrchestratorInfo) Save(context db.DB) error

type OrchestratorInfoParam

type OrchestratorInfoParam struct {
	WindowSize              uint64
	KeyGenThreshold         uint32
	ConfirmationsToFinality uint32
	EstimatedMomentumTime   uint32
}

type ParamRetrieveAssets

type ParamRetrieveAssets struct {
	PublicKey string
	Signature string
}

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 GetPhaseEntry

func GetPhaseEntry(context db.DB, id types.Hash) (*Phase, error)

func (*Phase) Data

func (phase *Phase) Data() []byte

func (*Phase) Delete

func (phase *Phase) Delete(context db.DB)

func (*Phase) Key

func (phase *Phase) Key() []byte

func (*Phase) MarshalJSON

func (phase *Phase) MarshalJSON() ([]byte, error)

func (*Phase) Save

func (phase *Phase) Save(context db.DB)

func (*Phase) ToProjectMarshal

func (phase *Phase) ToProjectMarshal() *PhaseMarshal

func (*Phase) UnmarshalJSON

func (phase *Phase) UnmarshalJSON(data []byte) error

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) Save

func (peh *PillarEpochHistory) Save(context db.DB) 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 GetPillarsList(context db.DB, onlyActive bool, pillarType uint8) ([]*PillarInfo, error)

func (*PillarInfo) IsActive

func (pillar *PillarInfo) IsActive() bool

func (*PillarInfo) Save

func (pillar *PillarInfo) Save(context db.DB) error

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 GetPillarVote(context db.DB, id types.Hash, name string) (*PillarVote, error)

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

type ProducingPillar struct {
	Producing *types.Address
	Name      string
}

func GetProducingPillarName

func GetProducingPillarName(context db.DB, address types.Address) (*ProducingPillar, error)

func (*ProducingPillar) Save

func (ppName *ProducingPillar) Save(context db.DB) error

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 GetProjectEntry

func GetProjectEntry(context db.DB, id types.Hash) (*Project, error)

func GetProjectList

func GetProjectList(context db.DB) ([]*Project, error)

func (*Project) Data

func (project *Project) Data() []byte

func (*Project) Delete

func (project *Project) Delete(context db.DB)

func (*Project) GetCurrentPhase

func (project *Project) GetCurrentPhase(context db.DB) (*Phase, error)

func (*Project) Key

func (project *Project) Key() []byte

func (*Project) Save

func (project *Project) Save(context db.DB)

type QsrDeposit

type QsrDeposit struct {
	Address *types.Address
	Qsr     *big.Int
}

func GetQsrDeposit

func GetQsrDeposit(context db.DB, address *types.Address) (*QsrDeposit, error)

GetQsrDeposit returns deposited QSR for sentinel/pillar. does not return util.ErrDataNonExistent, returns valid deposit with 0 amount.

func (*QsrDeposit) Delete

func (deposit *QsrDeposit) Delete(context db.DB) error

func (*QsrDeposit) Save

func (deposit *QsrDeposit) Save(context db.DB) error

type RedeemParam

type RedeemParam struct {
	TransactionHash types.Hash
	LogIndex        uint32
}

type RegisterParam

type RegisterParam struct {
	Name                         string
	ProducerAddress              types.Address
	RewardAddress                types.Address
	GiveBlockRewardPercentage    uint8
	GiveDelegateRewardPercentage uint8
}

type RequestPair

type RequestPair struct {
	Id                     types.Hash `json:"id"`
	CreationMomentumHeight uint64     `json:"creationMomentumHeight"`
}

func GetRequestPairById

func GetRequestPairById(context db.DB, Id types.Hash) (*RequestPair, error)

func (*RequestPair) Key

func (pair *RequestPair) Key() []byte

func (*RequestPair) Save

func (pair *RequestPair) Save(context db.DB) error

type RevokeUnwrapParam

type RevokeUnwrapParam struct {
	TransactionHash types.Hash
	LogIndex        uint32
}

type RewardDeposit

type RewardDeposit struct {
	Address *types.Address `json:"address"`
	Znn     *big.Int       `json:"znnAmount"`
	Qsr     *big.Int       `json:"qsrAmount"`
}

func GetRewardDeposit

func GetRewardDeposit(context db.DB, address *types.Address) (*RewardDeposit, error)

GetRewardDeposit returns uncollected ZNN & QSR reward. does not return util.ErrDataNonExistent, returns valid deposit with 0 amount.

func (*RewardDeposit) Delete

func (deposit *RewardDeposit) Delete(context db.DB) error

func (*RewardDeposit) MarshalJSON

func (deposit *RewardDeposit) MarshalJSON() ([]byte, error)

func (*RewardDeposit) Save

func (deposit *RewardDeposit) Save(context db.DB) 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

func GetRewardDepositHistory(context db.DB, epoch uint64, address *types.Address) (*RewardDepositHistory, error)

func (*RewardDepositHistory) Save

func (rdh *RewardDepositHistory) Save(context db.DB) error

type RewardDepositMarshal

type RewardDepositMarshal struct {
	Address *types.Address `json:"address"`
	Znn     string         `json:"znnAmount"`
	Qsr     string         `json:"qsrAmount"`
}

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)

func (*SecurityInfoVariable) Save

func (s *SecurityInfoVariable) Save(context db.DB) 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

type SentinelInfoKey struct {
	Owner types.Address `json:"owner"`
}

func (*SentinelInfoKey) Key

func (sentinel *SentinelInfoKey) Key() []byte

type SetAdditionalRewardParam

type SetAdditionalRewardParam struct {
	ZnnReward *big.Int
	QsrReward *big.Int
}

type SetNetworkMetadataParam

type SetNetworkMetadataParam struct {
	NetworkClass uint32
	ChainId      uint32
	Metadata     string
}

type SetTokenPairParam

type SetTokenPairParam struct {
	NetworkClass  uint32
	ChainId       uint32
	TokenStandard types.ZenonTokenStandard
	Owned         bool
	MinAmount     *big.Int
	FeePercentage uint32
	RedeemDelay   uint32
	Metadata      string
}

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

func GetAllSporks(context db.DB) []*Spork

func GetSporkInfoById

func GetSporkInfoById(context db.DB, id types.Hash) *Spork

func (*Spork) Data

func (spork *Spork) Data() []byte

func (*Spork) Key

func (spork *Spork) Key() []byte

func (*Spork) Save

func (spork *Spork) Save(context db.DB)

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

func GetStakeInfo(context db.DB, id types.Hash, address types.Address) (*StakeInfo, error)

func GetStakeListByAddress

func GetStakeListByAddress(context db.DB, address types.Address) ([]*StakeInfo, *big.Int, *big.Int, error)

Returns all *active* stake entries for an address

func (*StakeInfo) Delete

func (stake *StakeInfo) Delete(context db.DB) error

func (*StakeInfo) Save

func (stake *StakeInfo) Save(context db.DB) error

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)

func GetSwapAssetsByKeyIdHash

func GetSwapAssetsByKeyIdHash(context db.DB, keyIdHash types.Hash) (*SwapAssets, error)

func (*SwapAssets) Save

func (assets *SwapAssets) Save(context db.DB) 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) Delete

func (t *TimeChallengeInfo) Delete(context db.DB) error

func (*TimeChallengeInfo) Key

func (t *TimeChallengeInfo) Key() []byte

func (*TimeChallengeInfo) Save

func (t *TimeChallengeInfo) Save(context db.DB) error

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

func GetTokenInfo(context db.DB, ts types.ZenonTokenStandard) (*TokenInfo, error)

func GetTokenInfoList

func GetTokenInfoList(context db.DB) ([]*TokenInfo, error)

func (*TokenInfo) Save

func (token *TokenInfo) Save(context db.DB) error

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 GetTokenPairVariable(context db.DB, networkClass uint32, chainId uint32, zts types.ZenonTokenStandard) (*TokenPair, error)

func (*TokenPair) MarshalJSON

func (t *TokenPair) MarshalJSON() ([]byte, error)

func (*TokenPair) ToMarshalJson

func (t *TokenPair) ToMarshalJson() *TokenPairMarshall

func (*TokenPair) UnmarshalJSON

func (t *TokenPair) UnmarshalJSON(data []byte) error

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 TokenTupleMarshal struct {
	TokenStandard string `json:"tokenStandard"`
	ZnnPercentage uint32 `json:"znnPercentage"`
	QsrPercentage uint32 `json:"qsrPercentage"`
	MinAmount     string `json:"minAmount"`
}

type TokenTuplesParam

type TokenTuplesParam struct {
	TokenStandards []string
	ZnnPercentages []uint32
	QsrPercentages []uint32
	MinAmounts     []*big.Int
}

type UnlockHtlcParam

type UnlockHtlcParam struct {
	Id       types.Hash
	Preimage []byte
}

type UnwrapTokenParam

type UnwrapTokenParam struct {
	NetworkClass    uint32
	ChainId         uint32
	TransactionHash types.Hash
	LogIndex        uint32
	ToAddress       types.Address
	TokenAddress    string
	Amount          *big.Int
	Signature       string
}

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 GetUnwrapTokenRequestByTxHashAndLog

func GetUnwrapTokenRequestByTxHashAndLog(context db.DB, txHash types.Hash, logIndex uint32) (*UnwrapTokenRequest, error)

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 UpdateTokenParam struct {
	TokenStandard types.ZenonTokenStandard
	Owner         types.Address
	IsMintable    bool
	IsBurnable    bool
}

type UpdateWrapRequestParam

type UpdateWrapRequestParam struct {
	Id        types.Hash
	Signature string
}

type VotableHash

type VotableHash struct {
	Id     types.Hash
	Exists bool
}

func GetVotableHash

func GetVotableHash(context db.DB, id types.Hash) (*VotableHash, error)

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 WrapTokenParam struct {
	NetworkClass uint32
	ChainId      uint32
	ToAddress    string
}

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 GetWrapTokenRequestById(context db.DB, Id types.Hash) (*WrapTokenRequest, error)

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) Save

func (wrapRequest *WrapTokenRequest) Save(context db.DB) 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) Delete

func (zfi *ZtsFeesInfo) Delete(context db.DB) error

func (*ZtsFeesInfo) Key

func (zfi *ZtsFeesInfo) Key() ([]byte, error)

func (*ZtsFeesInfo) MarshalJSON

func (zfi *ZtsFeesInfo) MarshalJSON() ([]byte, error)

func (*ZtsFeesInfo) Save

func (zfi *ZtsFeesInfo) Save(context db.DB) 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"`
}

Jump to

Keyboard shortcuts

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