jsonresult

package
v0.0.0-...-7ece11e Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 36 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeBase58Check

func EncodeBase58Check(b []byte) string

func GetTxDetailsFromMempool

func GetTxDetailsFromMempool(txMempool interface {
	MaxFee() uint64
	ListTxsDetail() ([]common.Hash, []metadata.Transaction)
	Count() int
	Size() uint64
}) []metadata.Transaction

GetTxDetailsFromMempool is to get all txs along with their detailed info from mempool

func OperationPointPtrToBase58

func OperationPointPtrToBase58(point *operation.Point) string

func OperationScalarPtrToBase58

func OperationScalarPtrToBase58(scalar *operation.Scalar) string

Types

type AccountBalanceResult

type AccountBalanceResult struct {
	Account string `json:"Account"`
	Balance uint64 `json:"Balance"`
}

type BlockInfo

type BlockInfo struct {
	Height  uint64 `json:"BlockHeight"`
	Hash    string `json:"BlockHash"`
	PreHash string `json:"PreHash"`
}

type BridgeAggEstimateFeeByBurntAmount

type BridgeAggEstimateFeeByBurntAmount struct {
	BurntAmount    uint64 `json:"BurntAmount"`
	Fee            uint64 `json:"Fee"`
	ReceivedAmount uint64 `json:"ReceivedAmount"`

	MaxFee            uint64 `json:"MaxFee"`
	MinReceivedAmount uint64 `json:"MinReceivedAmount"`
}

type BridgeAggEstimateFeeByReceivedAmount

type BridgeAggEstimateFeeByReceivedAmount struct {
	ReceivedAmount uint64 `json:"ReceivedAmount"`
	Fee            uint64 `json:"Fee"`
	BurntAmount    uint64 `json:"BurntAmount"`

	MaxFee         uint64 `json:"MaxFee"`
	MaxBurntAmount uint64 `json:"MaxBurntAmount"`
}

type BridgeAggEstimateReward

type BridgeAggEstimateReward struct {
	ReceivedAmount uint64 `json:"ReceivedAmount"`
	Reward         uint64 `json:"Reward"`
}

type BridgeAggState

type BridgeAggState struct {
	BeaconTimeStamp     int64                                                        `json:"BeaconTimeStamp"`
	UnifiedTokenVaults  map[common.Hash]map[common.Hash]*statedb.BridgeAggVaultState `json:"UnifiedTokenVaults"`
	WaitingUnshieldReqs map[common.Hash][]*statedb.BridgeAggWaitingUnshieldReq       `json:"WaitingUnshieldReqs"`
	Param               *statedb.BridgeAggParamState                                 `json:"Param"`
	BaseDecimal         uint8                                                        `json:"BaseDecimal"`
	MaxLenOfPath        uint8                                                        `json:"MaxLenOfPath"`
}

type CandidateListsResult

type CandidateListsResult struct {
	Epoch                                  uint64                            `json:"Epoch"`
	CandidateShardWaitingForCurrentRandom  []incognitokey.CommitteePublicKey `json:"CandidateShardWaitingForCurrentRandom"`
	CandidateBeaconWaitingForCurrentRandom []incognitokey.CommitteePublicKey `json:"CandidateBeaconWaitingForCurrentRandom"`
	CandidateShardWaitingForNextRandom     []incognitokey.CommitteePublicKey `json:"CandidateShardWaitingForNextRandom"`
	CandidateBeaconWaitingForNextRandom    []incognitokey.CommitteePublicKey `json:"CandidateBeaconWaitingForNextRandom"`
}

Candidate Result From Best State

type ClosedConnectionResult

type ClosedConnectionResult struct {
	Result string
}

type CoinRPC

type CoinRPC interface {
	SetInputCoin(coin.PlainCoin) CoinRPC
	SetOutputCoin(coin.Coin) CoinRPC
}

func ParseCoinRPCInput

func ParseCoinRPCInput(inputCoin coin.PlainCoin) CoinRPC

func ParseCoinRPCOutput

func ParseCoinRPCOutput(outputCoin coin.Coin) CoinRPC

type CoinRPCV1

type CoinRPCV1 struct {
	Version              uint8
	PublicKey            string
	Commitment           string
	SNDerivator          string
	KeyImage             string
	Randomness           string
	Value                uint64
	Info                 string
	CoinDetailsEncrypted string
}

func (*CoinRPCV1) SetInputCoin

func (c *CoinRPCV1) SetInputCoin(inputCoin coin.PlainCoin) CoinRPC

func (*CoinRPCV1) SetOutputCoin

func (c *CoinRPCV1) SetOutputCoin(inputCoin coin.Coin) CoinRPC

type CoinRPCV2

type CoinRPCV2 struct {
	Version    uint8
	Index      uint32
	Info       string
	PublicKey  string
	Commitment string
	KeyImage   string
	TxRandom   string
	Value      string
	Randomness string
}

func (*CoinRPCV2) SetInputCoin

func (c *CoinRPCV2) SetInputCoin(inputCoin coin.PlainCoin) CoinRPC

func (*CoinRPCV2) SetOutputCoin

func (c *CoinRPCV2) SetOutputCoin(outputCoin coin.Coin) CoinRPC

type CommitteeListsResult

type CommitteeListsResult struct {
	Epoch                       uint64            `json:"Epoch"`
	ShardCommittee              map[byte][]string `json:"ShardCommittee"`
	ShardRewardReceiver         map[byte][]string `json:"ShardRewardReceiver"`
	ShardPendingValidator       map[byte][]string `json:"ShardPendingValidator"`
	ShardPendingRewardReceiver  map[byte][]string `json:"ShardPendingRewardReceiver"`
	BeaconCommittee             []string          `json:"BeaconCommittee"`
	BeaconRewardReceiver        []string          `json:"BeaconRewardReceiver"`
	BeaconPendingValidator      []string          `json:"BeaconPendingValidator"`
	BeaconPendingRewardReceiver []string          `json:"BeaconPendingRewardReceiver"`
}

func NewCommitteeListsResult

func NewCommitteeListsResult(epoch uint64, shardComm map[byte][]incognitokey.CommitteePublicKey, shardPendingValidator map[byte][]incognitokey.CommitteePublicKey, beaconCommittee []incognitokey.CommitteePublicKey, beaconPendingValidator []incognitokey.CommitteePublicKey) *CommitteeListsResult

type CreateTransactionResult

type CreateTransactionResult struct {
	Base58CheckData string
	TxID            string
	ShardID         byte
}

func NewCreateTransactionResult

func NewCreateTransactionResult(txID *common.Hash, txIDString string, byteArrays []byte, txShardID byte) CreateTransactionResult

type CreateTransactionTokenResult

type CreateTransactionTokenResult struct {
	Base58CheckData string
	ShardID         byte   `json:"ShardID"`
	TxID            string `json:"TxID"`
	TokenID         string `json:"TokenID"`
	TokenName       string `json:"TokenName"`
	TokenAmount     uint64 `json:"TokenAmount"`
}

type CrossCustomTokenPrivacyResult

type CrossCustomTokenPrivacyResult struct {
	SenderShardID   byte   `json:"SenderShardID"`
	ReceiverShardID byte   `json:"ReceiverShardID"`
	BlockHeight     uint64 `json:"BlockHeight"`
	BlockHash       string `json:"BlockHash"`
	PaymentAddress  string `json:"PaymentAddress"`
	TokenID         string `json:"TokenID"`
	Value           uint64 `json:"Value"`
}

type CrossCustomTokenResult

type CrossCustomTokenResult struct {
	SenderShardID   byte   `json:"SenderShardID"`
	ReceiverShardID byte   `json:"ReceiverShardID"`
	BlockHeight     uint64 `json:"BlockHeight"`
	BlockHash       string `json:"BlockHash"`
	PaymentAddress  string `json:"PaymentAddress"`
	TokenID         string `json:"TokenID"`
	Value           uint64 `json:"Value"`
}

type CrossOutputCoinResult

type CrossOutputCoinResult struct {
	SenderShardID   byte   `json:"SenderShardID"`
	ReceiverShardID byte   `json:"ReceiverShardID"`
	BlockHeight     uint64 `json:"BlockHeight"`
	BlockHash       string `json:"BlockHash"`
	PaymentAddress  string `json:"PaymentAddress"`
	Value           uint64 `json:"Value"`
}

type CrossShardCSTokenBalanceResult

type CrossShardCSTokenBalanceResult struct {
	PaymentAddress string `json:"PaymentAddress"`
	Value          uint64 `json:"Value"`
}

type CrossShardCSTokenResult

type CrossShardCSTokenResult struct {
	Name                               string                           `json:"Name"`
	Symbol                             string                           `json:"Symbol"`
	Amount                             uint64                           `json:"Amount"`
	TokenID                            string                           `json:"TokenID"`
	TokenImage                         string                           `json:"TokenImage"`
	IsPrivacy                          bool                             `json:"IsPrivacy"`
	CrossShardCSTokenBalanceResultList []CrossShardCSTokenBalanceResult `json:"CrossShardCSTokenBalanceResultList"`
	CrossShardPrivacyCSTokenResultList []CrossShardPrivacyCSTokenResult `json:"CrossShardPrivacyCSTokenResultList"`
}

type CrossShardDataResult

type CrossShardDataResult struct {
	HasCrossShard                  bool                         `json:"HasCrossShard"`
	CrossShardPRVResultList        []CrossShardPRVResult        `json:"CrossShardPRVResult"`
	CrossShardPRVPrivacyResultList []CrossShardPRVPrivacyResult `json:"CrossShardPRVPrivacyResult"`
	CrossShardCSTokenResultList    []CrossShardCSTokenResult    `json:"CrossShardCSTokenResult"`
}

type CrossShardPRVPrivacyResult

type CrossShardPRVPrivacyResult struct {
	PublicKey string `json:"PublicKey"`
}

type CrossShardPRVResult

type CrossShardPRVResult struct {
	PublicKey string `json:"PublicKey"`
	Value     uint64 `json:"Value"`
}

type CrossShardPrivacyCSTokenResult

type CrossShardPrivacyCSTokenResult struct {
	PublicKey string `json:"PublicKey"`
}

type CurrentPDEState

type CurrentPDEState struct {
	WaitingPDEContributions map[string]*rawdbv2.PDEContribution `json:"WaitingPDEContributions"`
	PDEPoolPairs            map[string]*rawdbv2.PDEPoolForPair  `json:"PDEPoolPairs"`
	PDEShares               map[string]uint64                   `json:"PDEShares"`
	PDETradingFees          map[string]uint64                   `json:"PDETradingFees"`
	BeaconTimeStamp         int64                               `json:"BeaconTimeStamp"`
}

type CustomToken

type CustomToken struct {
	ID                 string   `json:"ID"`
	Name               string   `json:"Name"`
	Symbol             string   `json:"Symbol"`
	Image              string   `json:"Image"`
	Amount             uint64   `json:"Amount"`
	IsPrivacy          bool     `json:"IsPrivacy"`
	IsBridgeToken      bool     `json:"IsBridgeToken"`
	ListTxs            []string `json:"ListTxs"`
	CountTxs           int      `json:"CountTxs"`
	InitiatorPublicKey string   `json:"InitiatorPublicKey"`
	TxInfo             string   `json:"TxInfo"`
}

func NewPrivacyToken

func NewPrivacyToken(tokenState *statedb.TokenState) *CustomToken

type CustomTokenBalance

type CustomTokenBalance struct {
	Name          string `json:"Name"`
	Symbol        string `json:"Symbol"`
	Amount        uint64 `json:"Amount"`
	TokenID       string `json:"TokenID"`
	TokenImage    string `json:"TokenImage"`
	IsPrivacy     bool   `json:"IsPrivacy"`
	IsBridgeToken bool   `json:"IsBridgeToken"`
}

type EstimateFeeResult

type EstimateFeeResult struct {
	EstimateFeeCoinPerKb uint64
	EstimateTxSizeInKb   uint64
	EstimateFee          uint64
	MinFeePerTx          uint64
}

func NewEstimateFeeResult

func NewEstimateFeeResult(estimateFeeCoinPerKb, estimateTxSizeInKb, estimateFee, minFeePerTx uint64) *EstimateFeeResult

type ExchangeRatesResult

type ExchangeRatesResult struct {
	Rates map[string]uint64 `json:"Rates"`
}

type FinalExchangeRatesDetailResult

type FinalExchangeRatesDetailResult struct {
	Value uint64 `json:"Value"`
}

type FinalExchangeRatesResult

type FinalExchangeRatesResult struct {
	BeaconHeight uint64                                    `json:"BeaconHeight"`
	Rates        map[string]FinalExchangeRatesDetailResult `json:"Rates"`
}

type GetAddressesByAccount

type GetAddressesByAccount struct {
	Addresses []wallet.KeySerializedData `json:"Addresses"`
}

type GetAllConnectedPeersResult

type GetAllConnectedPeersResult struct {
	Peers []map[string]string `json:"Peers"`
}

type GetAllPeersResult

type GetAllPeersResult struct {
	Peers []string `json:"Peers"`
}

func NewGetAllPeersResult

func NewGetAllPeersResult(addrMgr addrmanager.AddrManager) *GetAllPeersResult

type GetBeaconBestState

type GetBeaconBestState struct {
	BlockVersion                           int                  `json:"BlockVersion"`
	BestBlockHash                          common.Hash          `json:"BestBlockHash"`         // The hash of the block.
	PreviousBestBlockHash                  common.Hash          `json:"PreviousBestBlockHash"` // The hash of the block.
	BestShardHash                          map[byte]common.Hash `json:"BestShardHash"`
	BestShardHeight                        map[byte]uint64      `json:"BestShardHeight"`
	Epoch                                  uint64               `json:"Epoch"`
	BeaconHeight                           uint64               `json:"BeaconHeight"`
	BeaconProposerIndex                    int                  `json:"BeaconProposerIndex"`
	BeaconCommittee                        []string             `json:"BeaconCommittee"`
	BeaconPendingValidator                 []string             `json:"BeaconPendingValidator"`
	CandidateShardWaitingForCurrentRandom  []string             `json:"CandidateShardWaitingForCurrentRandom"` // snapshot shard candidate list, waiting to be shuffled in this current epoch
	CandidateBeaconWaitingForCurrentRandom []string             `json:"CandidateBeaconWaitingForCurrentRandom"`
	CandidateBeaconWaitingForNextRandom    []string             `json:"CandidateBeaconWaitingForNextRandom"`
	BeaconWaiting                          []string             `json:"BeaconWaiting"`
	BeaconLocking                          []string             `json:"BeaconLocking"`
	CandidateShardWaitingForNextRandom     []string             `json:"CandidateShardWaitingForNextRandom"` // shard candidate list, waiting to be shuffled in next epoch

	RewardReceiver           map[string]string                            `json:"RewardReceiver"`        // key: incognito public key of committee, value: payment address reward receiver
	ShardCommittee           map[byte][]string                            `json:"ShardCommittee"`        // current committee and validator of all shard
	ShardPendingValidator    map[byte][]string                            `json:"ShardPendingValidator"` // pending candidate waiting for swap to get in committee of all shard
	SyncingValidators        map[byte][]string                            `json:"SyncingValidator"`      // current syncing validators of all shard
	AutoStaking              map[string]bool                              `json:"AutoStaking"`
	StakingTx                map[string]common.Hash                       `json:"StakingTx"`
	CurrentRandomNumber      int64                                        `json:"CurrentRandomNumber"`
	CurrentRandomTimeStamp   int64                                        `json:"CurrentRandomTimeStamp"` // random timestamp for this epoch
	IsGetRandomNumber        bool                                         `json:"IsGetRandomNumber"`
	MaxBeaconCommitteeSize   int                                          `json:"MaxBeaconCommitteeSize"`
	MinBeaconCommitteeSize   int                                          `json:"MinBeaconCommitteeSize"`
	MaxShardCommitteeSize    int                                          `json:"MaxShardCommitteeSize"`
	MinShardCommitteeSize    int                                          `json:"MinShardCommitteeSize"`
	ActiveShards             int                                          `json:"ActiveShards"`
	LastCrossShardState      map[byte]map[byte]uint64                     `json:"LastCrossShardState"`
	ShardHandle              map[byte]bool                                `json:"ShardHandle"` // lock sync.RWMutex
	CommitteeEngineVersion   int                                          `json:"CommitteeStateVersion"`
	NumberOfShardBlock       map[byte]uint                                `json:"NumberOfShardBlock"` // lock sync.RWMutex
	FinishSyncManager        map[byte][]string                            `json:"FinishSyncManager"`
	NumberOfMissingSignature map[string]signaturecounter.MissingSignature `json:"MissingSignature"`        // lock sync.RWMutex
	MissingSignaturePenalty  map[string]signaturecounter.Penalty          `json:"MissingSignaturePenalty"` // lock sync.RWMutex
	Config                   map[string]interface{}                       `json:"Config"`
	TriggeredFeature         map[string]uint64                            `json:"TriggeredFeature"`
	RewardMinted             uint64                                       `json:"RewardMinted"`
}

func NewGetBeaconBestState

func NewGetBeaconBestState(data *blockchain.BeaconBestState) *GetBeaconBestState

type GetBeaconBestStateDetail

type GetBeaconBestStateDetail struct {
	BestBlockHash                          common.Hash                                  `json:"BestBlockHash"`         // The hash of the block.
	PreviousBestBlockHash                  common.Hash                                  `json:"PreviousBestBlockHash"` // The hash of the block.
	BestShardHash                          map[byte]common.Hash                         `json:"BestShardHash"`
	BestShardHeight                        map[byte]uint64                              `json:"BestShardHeight"`
	Epoch                                  uint64                                       `json:"Epoch"`
	BeaconHeight                           uint64                                       `json:"BeaconHeight"`
	BeaconProposerIndex                    int                                          `json:"BeaconProposerIndex"`
	BeaconCommittee                        []incognitokey.CommitteeKeyString            `json:"BeaconCommittee"`
	BeaconPendingValidator                 []incognitokey.CommitteeKeyString            `json:"BeaconPendingValidator"`
	BeaconWaiting                          []incognitokey.CommitteeKeyString            `json:"BeaconWaiting"`
	BeaconLocking                          []incognitokey.CommitteeKeyString            `json:"BeaconLocking"`
	CandidateShardWaitingForCurrentRandom  []incognitokey.CommitteeKeyString            `json:"CandidateShardWaitingForCurrentRandom"` // snapshot shard candidate list, waiting to be shuffled in this current epoch
	CandidateBeaconWaitingForCurrentRandom []incognitokey.CommitteeKeyString            `json:"CandidateBeaconWaitingForCurrentRandom"`
	CandidateShardWaitingForNextRandom     []incognitokey.CommitteeKeyString            `json:"CandidateShardWaitingForNextRandom"` // shard candidate list, waiting to be shuffled in next epoch
	CandidateBeaconWaitingForNextRandom    []incognitokey.CommitteeKeyString            `json:"CandidateBeaconWaitingForNextRandom"`
	RewardReceiver                         map[string]string                            `json:"RewardReceiver"`        // key: incognito public key of committee, value: payment address reward receiver
	ShardCommittee                         map[byte][]incognitokey.CommitteeKeyString   `json:"ShardCommittee"`        // current committee and validator of all shard
	ShardPendingValidator                  map[byte][]incognitokey.CommitteeKeyString   `json:"ShardPendingValidator"` // pending candidate waiting for swap to get in committee of all shard
	SyncingValidators                      map[byte][]incognitokey.CommitteeKeyString   `json:"SyncingValidator"`      // current syncing validators of all shard
	AutoStaking                            []committeeKeySetAutoStake                   `json:"AutoStaking"`
	StakingTx                              map[string]common.Hash                       `json:"StakingTx"`
	CurrentRandomNumber                    int64                                        `json:"CurrentRandomNumber"`
	CurrentRandomTimeStamp                 int64                                        `json:"CurrentRandomTimeStamp"` // random timestamp for this epoch
	IsGetRandomNumber                      bool                                         `json:"IsGetRandomNumber"`
	MaxBeaconCommitteeSize                 int                                          `json:"MaxBeaconCommitteeSize"`
	MinBeaconCommitteeSize                 int                                          `json:"MinBeaconCommitteeSize"`
	MaxShardCommitteeSize                  int                                          `json:"MaxShardCommitteeSize"`
	MinShardCommitteeSize                  int                                          `json:"MinShardCommitteeSize"`
	ActiveShards                           int                                          `json:"ActiveShards"`
	LastCrossShardState                    map[byte]map[byte]uint64                     `json:"LastCrossShardState"`
	ShardHandle                            map[byte]bool                                `json:"ShardHandle"`             // lock sync.RWMutex
	NumberOfMissingSignature               map[string]signaturecounter.MissingSignature `json:"MissingSignature"`        // lock sync.RWMutex
	MissingSignaturePenalty                map[string]signaturecounter.Penalty          `json:"MissingSignaturePenalty"` // lock sync.RWMutex
}

func NewGetBeaconBestStateDetail

func NewGetBeaconBestStateDetail(data *blockchain.BeaconBestState) *GetBeaconBestStateDetail

type GetBeaconBlockResult

type GetBeaconBlockResult struct {
	Hash              string                 `json:"Hash"`
	Height            uint64                 `json:"Height"`
	BlockProducer     string                 `json:"BlockProducer"`
	ValidationData    string                 `json:"ValidationData"`
	ConsensusType     string                 `json:"ConsensusType"`
	Version           int                    `json:"Version"`
	Epoch             uint64                 `json:"Epoch"`
	Round             int                    `json:"Round"`
	Time              int64                  `json:"Time"`
	PreviousBlockHash string                 `json:"PreviousBlockHash"`
	NextBlockHash     string                 `json:"NextBlockHash"`
	Instructions      [][]string             `json:"Instructions"`
	Size              uint64                 `json:"Size"`
	ShardStates       interface{}            `json:"ShardStates"`
	ProposeTime       int64                  `json:"ProposeTime"`
	RootHash          map[string]interface{} `json:"RootHash"`
	FinalityHeight    uint64                 `json:"FinalityHeight"`
}

func NewGetBlocksBeaconResult

func NewGetBlocksBeaconResult(block *types.BeaconBlock, size uint64, nextBlockHash string) *GetBeaconBlockResult

type GetBestBlockHashResult

type GetBestBlockHashResult struct {
	BestBlockHashes map[int]string `json:"BestBlockHashes"`
}

type GetBestBlockItem

type GetBestBlockItem struct {
	Height              uint64 `json:"Height"`
	Hash                string `json:"Hash"`
	TotalTxs            uint64 `json:"TotalTxs"`
	BlockProducer       string `json:"BlockProducer"`
	ValidationData      string `json:"ValidationData"`
	Epoch               uint64 `json:"Epoch"`
	Time                int64  `json:"Time"`
	RemainingBlockEpoch uint64 `json:"RemainingBlockEpoch"`
	EpochBlock          uint64 `json:"EpochBlock"`
}

func NewGetBestBlockItemFromBeacon

func NewGetBestBlockItemFromBeacon(bestState *blockchain.BeaconBestState) *GetBestBlockItem

func NewGetBestBlockItemFromShard

func NewGetBestBlockItemFromShard(bestState *blockchain.ShardBestState) *GetBestBlockItem

type GetBestBlockResult

type GetBestBlockResult struct {
	BestBlocks map[int]GetBestBlockItem `json:"BestBlocks"`
}

type GetBlockChainInfoResult

type GetBlockChainInfoResult struct {
	ChainName    string                   `json:"ChainName"`
	BestBlocks   map[int]GetBestBlockItem `json:"BestBlocks"`
	ActiveShards int                      `json:"ActiveShards"`
}

GetBlockChainInfoResult models the data returned from the getblockchaininfo command.

type GetBlockTxResult

type GetBlockTxResult struct {
	Hash     string `json:"Hash"`
	Locktime int64  `json:"Locktime"`
	HexData  string `json:"HexData"`
}

type GetCustomToken

type GetCustomToken struct {
	IsExist     bool        `json:"IsExist"`
	CustomToken CustomToken `json:"CustomToken"`
}

func NewGetCustomToken

func NewGetCustomToken(isExist bool, customToken CustomToken) *GetCustomToken

type GetHeaderResult

type GetHeaderResult struct {
	BlockNum  int               `json:"Blocknum"`
	ShardID   byte              `json:"ShardID"`
	BlockHash string            `json:"Blockhash"`
	Header    types.ShardHeader `json:"Header"`
}

func NewHeaderResult

func NewHeaderResult(header types.ShardHeader, blockNum int, blockHash string, shardID byte) GetHeaderResult

type GetInOutMessageCountResult

type GetInOutMessageCountResult struct {
	InboundMessages  interface{} `json:"Inbounds"`
	OutboundMessages interface{} `json:"Outbounds"`
}

func NewGetInOutMessageCountResult

func NewGetInOutMessageCountResult(paramsArray []interface{}) (*GetInOutMessageCountResult, error)

type GetInOutMessageResult

type GetInOutMessageResult struct {
	InboundMessages  map[string]interface{} `json:"Inbounds"`
	OutboundMessages map[string]interface{} `json:"Outbounds"`
}

func NewGetInOutMessageResult

func NewGetInOutMessageResult(paramsArray []interface{}) (*GetInOutMessageResult, error)

type GetInstructionProof

type GetInstructionProof struct {
	Instruction  string // Hex-encoded swap inst
	BeaconHeight string // Hex encoded height of the block contains the inst
	BridgeHeight string

	BeaconInstPath       []string // Hex encoded path of the inst in merkle tree
	BeaconInstPathIsLeft []bool   // Indicate if it is the left or right node
	BeaconInstRoot       string   // Hex encoded root of the inst merkle tree
	BeaconBlkData        string   // Hex encoded hash of the block meta
	BeaconSigs           []string // Hex encoded signature (r, s, v)
	BeaconSigIdxs        []int    // Idxs of signer

	BridgeInstPath       []string
	BridgeInstPathIsLeft []bool
	BridgeInstRoot       string
	BridgeBlkData        string
	BridgeSigs           []string
	BridgeSigIdxs        []int
}

type GetLiquidateExchangeRates

type GetLiquidateExchangeRates struct {
	TokenId     string                        `json:"TokenId"`
	Liquidation statedb.LiquidationPoolDetail `json:"Liquidation"`
}

type GetMempoolInfo

type GetMempoolInfo struct {
	Size          int                `json:"Size"`
	Bytes         uint64             `json:"Bytes"`
	Usage         uint64             `json:"Usage"`
	MaxMempool    uint64             `json:"MaxMempool"`
	MempoolMinFee uint64             `json:"MempoolMinFee"`
	MempoolMaxFee uint64             `json:"MempoolMaxFee"`
	ListTxs       []GetMempoolInfoTx `json:"ListTxs"`
}

func NewGetMempoolInfo

func NewGetMempoolInfo(txMempool interface {
	MaxFee() uint64
	ListTxsDetail() ([]common.Hash, []metadata.Transaction)
	Count() int
	Size() uint64
}) *GetMempoolInfo

func NewGetMempoolInfoV2

func NewGetMempoolInfoV2(info txpool.MempoolInfo) *GetMempoolInfo

type GetMempoolInfoTx

type GetMempoolInfoTx struct {
	TxID     string `json:"TxID"`
	LockTime int64  `json:"LockTime"`
	TpKey    string `json:"TpKey"`
}

func NewGetMempoolInfoTx

func NewGetMempoolInfoTx(tpKey common.Hash, tx metadata.Transaction) *GetMempoolInfoTx

func NewGetMempoolInfoTxV2

func NewGetMempoolInfoTxV2(infoTx txpool.MempoolInfoTx) *GetMempoolInfoTx

type GetMiningInfoResult

type GetMiningInfoResult struct {
	ShardHeight         uint64 `json:"ShardHeight"`
	BeaconHeight        uint64 `json:"BeaconHeight"`
	CurrentShardBlockTx int    `json:"CurrentShardBlockTx"`
	PoolSize            int    `json:"PoolSize"`
	Chain               string `json:"Chain"`
	ShardID             int    `json:"ShardID"`
	Layer               string `json:"Layer"`
	Role                string `json:"Role"`
	MiningPublickey     string `json:"MiningPublickey"`
	IsEnableMining      bool   `json:"IsEnableMining"`
}

func NewGetMiningInfoResult

func NewGetMiningInfoResult(
	txMemPoolSize int,
	blChain blockchain.BlockChain,
	consensus blockchain.ConsensusEngine,
) *GetMiningInfoResult

type GetNetworkInfoResult

type GetNetworkInfoResult struct {
	Commit          string                   `json:"Commit"`
	Version         string                   `json:"Version"`
	SubVersion      string                   `json:"SubVersion"`
	ProtocolVersion string                   `json:"ProtocolVersion"`
	NetworkActive   bool                     `json:"NetworkActive"`
	Connections     int                      `json:"Connections"`
	Networks        []map[string]interface{} `json:"Networks"`
	LocalAddresses  []string                 `json:"LocalAddresses"`
	IncrementalFee  uint64                   `json:"IncrementalFee"`
	Warnings        string                   `json:"Warnings"`
	NodeTimeUnix    int64                    `json:"NodeTime"`
	NodeTimeString  string                   `json:"NodeTimeString"`
}

func NewGetNetworkInfoResult

func NewGetNetworkInfoResult(protocolVerion string, connMgr connmanager.ConnManager, wallet *wallet.Wallet) (*GetNetworkInfoResult, error)

type GetPendingTxsInBlockgenResult

type GetPendingTxsInBlockgenResult struct {
	TxHashes []string
}

func NewGetPendingTxsInBlockgenResult

func NewGetPendingTxsInBlockgenResult(txs []metadata.Transaction) GetPendingTxsInBlockgenResult

type GetPublicKeyFromPaymentAddressResult

type GetPublicKeyFromPaymentAddressResult struct {
	PublicKeyInBase58Check string
	PublicKeyInBytes       []int
	PublicKeyInHex         string
}

func NewGetPublicKeyFromPaymentAddressResult

func NewGetPublicKeyFromPaymentAddressResult(publicKeyInBytes []byte) *GetPublicKeyFromPaymentAddressResult

type GetRawMempoolResult

type GetRawMempoolResult struct {
	TxHashes []string
}

func NewGetRawMempoolResult

func NewGetRawMempoolResult(txMemPool interface{ ListTxs() []string }) *GetRawMempoolResult

type GetRecentTransactions

type GetRecentTransactions struct {
	Txs map[string]TransactionDetail
}

type GetShardBestState

type GetShardBestState struct {
	BlockVersion           int               `json:"BlockVersion"`
	BestBlockHash          common.Hash       `json:"BestBlockHash"` // hash of block.
	BestBeaconHash         common.Hash       `json:"BestBeaconHash"`
	BeaconHeight           uint64            `json:"BeaconHeight"`
	ShardID                byte              `json:"ShardID"`
	Epoch                  uint64            `json:"Epoch"`
	ShardHeight            uint64            `json:"ShardHeight"`
	MaxShardCommitteeSize  int               `json:"MaxShardCommitteeSize"`
	MinShardCommitteeSize  int               `json:"MinShardCommitteeSize"`
	ShardProposerIdx       int               `json:"ShardProposerIdx"`
	ShardCommittee         []string          `json:"ShardCommittee"`
	ShardPendingValidator  []string          `json:"ShardPendingValidator"`
	BestCrossShard         map[byte]uint64   `json:"BestCrossShard"` // Best cross shard block by heigh
	StakingTx              map[string]string `json:"StakingTx"`
	NumTxns                uint64            `json:"NumTxns"`                // The number of txns in the block.
	TotalTxns              uint64            `json:"TotalTxns"`              // The total number of txns in the chain.
	TotalTxnsExcludeSalary uint64            `json:"TotalTxnsExcludeSalary"` // for testing and benchmark
	ActiveShards           int               `json:"ActiveShards"`
	MetricBlockHeight      uint64            `json:"MetricBlockHeight"`
	CommitteeFromBlock     common.Hash       `json:"CommitteeFromBlock"`
	CommitteeEngineVersion int               `json:"CommitteeStateVersion"`
	TriggeredFeature       map[string]uint64 `json:"TriggeredFeature"`
	MaxTxsReminder         int64             `json:"MaxTxsReminder"`
}

func NewGetShardBestState

func NewGetShardBestState(data *blockchain.ShardBestState) *GetShardBestState

type GetShardBestStateDetail

type GetShardBestStateDetail struct {
	BestBlockHash          common.Hash                       `json:"BestBlockHash"` // hash of block.
	BestBeaconHash         common.Hash                       `json:"BestBeaconHash"`
	BeaconHeight           uint64                            `json:"BeaconHeight"`
	ShardID                byte                              `json:"ShardID"`
	Epoch                  uint64                            `json:"Epoch"`
	ShardHeight            uint64                            `json:"ShardHeight"`
	MaxShardCommitteeSize  int                               `json:"MaxShardCommitteeSize"`
	MinShardCommitteeSize  int                               `json:"MinShardCommitteeSize"`
	ShardProposerIdx       int                               `json:"ShardProposerIdx"`
	ShardCommittee         []incognitokey.CommitteeKeyString `json:"ShardCommittee"`
	ShardPendingValidator  []incognitokey.CommitteeKeyString `json:"ShardPendingValidator"`
	BestCrossShard         map[byte]uint64                   `json:"BestCrossShard"` // Best cross shard block by heigh
	StakingTx              map[string]string                 `json:"StakingTx"`
	NumTxns                uint64                            `json:"NumTxns"`                // The number of txns in the block.
	TotalTxns              uint64                            `json:"TotalTxns"`              // The total number of txns in the chain.
	TotalTxnsExcludeSalary uint64                            `json:"TotalTxnsExcludeSalary"` // for testing and benchmark
	ActiveShards           int                               `json:"ActiveShards"`
	MetricBlockHeight      uint64                            `json:"MetricBlockHeight"`
}

func NewGetShardBestStateDetail

func NewGetShardBestStateDetail(data *blockchain.ShardBestState) *GetShardBestStateDetail

type GetShardBlockResult

type GetShardBlockResult struct {
	Hash               string             `json:"Hash"`
	ShardID            byte               `json:"ShardID"`
	Height             uint64             `json:"Height"`
	Confirmations      int64              `json:"Confirmations"`
	Version            int                `json:"Version"`
	TxRoot             string             `json:"TxRoot"`
	Time               int64              `json:"Time"`
	PreviousBlockHash  string             `json:"PreviousBlockHash"`
	NextBlockHash      string             `json:"NextBlockHash"`
	TxHashes           []string           `json:"TxHashes"`
	Txs                []GetBlockTxResult `json:"Txs"`
	BlockProducer      string             `json:"BlockProducer"`
	ValidationData     string             `json:"ValidationData"`
	ConsensusType      string             `json:"ConsensusType"`
	Data               string             `json:"Data"`
	BeaconHeight       uint64             `json:"BeaconHeight"`
	BeaconBlockHash    string             `json:"BeaconBlockHash"`
	Round              int                `json:"Round"`
	Epoch              uint64             `json:"Epoch"`
	Reward             uint64             `json:"Reward"`
	RewardBeacon       uint64             `json:"RewardBeacon"`
	Fee                uint64             `json:"Fee"`
	Size               uint64             `json:"Size"`
	CommitteeFromBlock common.Hash        `json:"CommitteeFromBlock"`
	Instruction        [][]string         `json:"Instruction"`
	CrossShardBitMap   []int              `json:"CrossShardBitMap"`
	ProposeTime        int64              `json:"ProposeTime"`
	Proposer           string             `json:"Proposer"`
	SubsetID           int                `json:"SubsetID"`
	SigningCommittee   []string           `json:"SigningCommittee"`
	FinalityHeight     uint64             `json:"FinalityHeight"`
}

func NewGetBlockResult

func NewGetBlockResult(block *types.ShardBlock, size uint64, nextBlockHash string) *GetShardBlockResult

type GetTotalStaker

type GetTotalStaker struct {
	TotalStaker int `json:"TotalStaker"`
}

func NewGetTotalStaker

func NewGetTotalStaker(total int) *GetTotalStaker

type GetViewResult

type GetViewResult struct {
	Hash              string `json:"Hash"`
	Height            uint64 `json:"Height"`
	PreviousBlockHash string `json:"PreviousBlockHash"`
	Round             uint64 `json:"Round"`
	ProposeTime       int64
	ProduceTime       int64
}

type HashValueDetail

type HashValueDetail struct {
	IsBlock       bool `json:"IsBlock"`
	IsBeaconBlock bool `json:"IsBeaconBlock"`
	IsTransaction bool `json:"IsTransaction"`
}

type ICoinInfo

type ICoinInfo interface {
	GetVersion() uint8
	GetCommitment() *privacy.Point
	GetInfo() []byte
	GetPublicKey() *privacy.Point
	GetValue() uint64
	GetKeyImage() *privacy.Point
	GetRandomness() *privacy.Scalar
	GetShardID() (uint8, error)
	GetSNDerivator() *privacy.Scalar
	GetCoinDetailEncrypted() []byte
	IsEncrypted() bool
	GetTxRandom() *coin.TxRandom
	GetSharedRandom() *privacy.Scalar
	GetSharedConcealRandom() *privacy.Scalar
	GetAssetTag() *privacy.Point
}

func NewCoinFromJsonOutCoin

func NewCoinFromJsonOutCoin(jsonOutCoin OutCoin) (ICoinInfo, *big.Int, error)

type ListAccounts

type ListAccounts struct {
	WalletName string            `json:"WalletName"`
	Accounts   map[string]uint64 `json:"Accounts"`
}

type ListCustomToken

type ListCustomToken struct {
	ListCustomToken []CustomToken `json:"ListCustomToken"`
}

type ListCustomTokenBalance

type ListCustomTokenBalance struct {
	PaymentAddress         string               `json:"PaymentAddress"`
	ListCustomTokenBalance []CustomTokenBalance `json:"ListCustomTokenBalance"`
}

type ListOutputCoins

type ListOutputCoins struct {
	FromHeight uint64               `json:"FromHeight"`
	ToHeight   uint64               `json:"ToHeight"`
	Outputs    map[string][]OutCoin `json:"Outputs"`
}

type ListReceivedTransaction

type ListReceivedTransaction struct {
	ReceivedTransactions []ReceivedTransaction `json:"ReceivedTransactions"`
}

type ListReceivedTransactionV2

type ListReceivedTransactionV2 struct {
	ReceivedTransactions []ReceivedTransactionV2 `json:"ReceivedTransactions"`
}

type OutCoin

type OutCoin struct {
	Version              string `json:"Version"`
	Index                string `json:"Index"`
	PublicKey            string `json:"PublicKey"`
	Commitment           string `json:"Commitment"`
	SNDerivator          string `json:"SNDerivator"`
	KeyImage             string `json:"KeyImage"`
	SerialNumber         string `json:"SerialNumber"`
	Randomness           string `json:"Randomness"`
	Value                string `json:"Value"`
	Info                 string `json:"Info"`
	SharedRandom         string `json:"SharedRandom"`
	SharedConcealRandom  string `json:"SharedConcealRandom"`
	TxRandom             string `json:"TxRandom"`
	CoinDetailsEncrypted string `json:"CoinDetailsEncrypted"`
	AssetTag             string `json:"AssetTag"`
}

func NewOutCoin

func NewOutCoin(outCoin ICoinInfo) OutCoin

func NewOutcoinFromInterface

func NewOutcoinFromInterface(data interface{}) (*OutCoin, error)

type Pdexv3LPValue

type Pdexv3LPValue struct {
	PoolValue   map[string]uint64 `json:"PoolValue"`
	LPReward    map[string]uint64 `json:"LPReward"`
	OrderReward map[string]uint64 `json:"OrderReward"`
	PoolReward  map[string]uint64 `json:"PoolReward"`
}

type Pdexv3State

type Pdexv3State struct {
	BeaconTimeStamp      int64                                   `json:"BeaconTimeStamp"`
	Params               *pdex.Params                            `json:"Params,omitempty"`
	PoolPairs            *map[string]*pdex.PoolPairState         `json:"PoolPairs,omitempty"`
	WaitingContributions *map[string]*rawdbv2.Pdexv3Contribution `json:"WaitingContributions,omitempty"`
	NftIDs               *map[string]uint64                      `json:"NftIDs,omitempty"`
	StakingPools         *map[string]*pdex.StakingPoolState      `json:"StakingPools,omitempty"`
}

type PoolInfo

type PoolInfo struct {
	Info map[int][]BlockInfo `json:"Info"`
}

func NewPoolInfo

func NewPoolInfo(blks []types.BlockPoolInterface) *PoolInfo

type PortalCustodianWithdrawRequest

type PortalCustodianWithdrawRequest struct {
	CustodianWithdrawRequest metadata.CustodianWithdrawRequestStatus `json:"CustodianWithdraw"`
}

type PortalPortingRequest

type PortalPortingRequest struct {
	PortingRequest metadata.PortingRequestStatus `json:"PortingRequest"`
}

type ProofDetail

type ProofDetail struct {
	InputCoins  []CoinRPC
	OutputCoins []CoinRPC
}

func (*ProofDetail) ConvertFromProof

func (proofDetail *ProofDetail) ConvertFromProof(proof privacy.Proof)

type RandomCommitmentAndPublicKeyResult

type RandomCommitmentAndPublicKeyResult struct {
	CommitmentIndices []uint64 `json:"CommitmentIndices"`
	PublicKeys        []string `json:"PublicKeys"`
	Commitments       []string `json:"Commitments"`
	AssetTags         []string `json:"AssetTags"`
}

func NewRandomCommitmentAndPublicKeyResult

func NewRandomCommitmentAndPublicKeyResult(commitmentIndices []uint64, publicKeys, commitments, assetTags [][]byte) *RandomCommitmentAndPublicKeyResult

type RandomCommitmentResult

type RandomCommitmentResult struct {
	CommitmentIndices  []uint64 `json:"CommitmentIndices"`
	MyCommitmentIndexs []uint64 `json:"MyCommitmentIndexs"`
	Commitments        []string `json:"Commitments"`
}

func NewRandomCommitmentResult

func NewRandomCommitmentResult(commitmentIndexs []uint64, myCommitmentIndexs []uint64, commitments [][]byte) *RandomCommitmentResult

type ReceivedCoin

type ReceivedCoin struct {
	PublicKey string `json:"PublicKey"`
	Info      string `json:"Info"`
	Value     uint64 `json:"Value"`
}

type ReceivedTransaction

type ReceivedTransaction struct {
	TxDetail        *TransactionDetail     `json:"TransactionDetail"`
	ReceivedAmounts map[string]interface{} `json:"ReceivedAmounts"`
	FromShardID     byte                   `json:"FromShardID"`
}

type ReceivedTransactionV2

type ReceivedTransactionV2 struct {
	TxDetail           *TransactionDetail
	ReceivedAmounts    map[string]interface{} `json:"ReceivedAmounts"`
	InputSerialNumbers map[string][]string    `json:"InputSerialNumbers"`
	FromShardID        byte                   `json:"FromShardID"`
}

type StakeResult

type StakeResult struct {
	PublicKey string `json:"PublicKey"`
	CanStake  bool   `json:"CanStake"`
}

func NewStakeResult

func NewStakeResult(publicKey string, canStake bool) *StakeResult

type SyncStats

type SyncStats struct {
	Beacon syncker.SyncInfo
	Shard  map[int]*syncker.SyncInfo
}

func NewSyncStats

func NewSyncStats(stats syncker.SynckerStats) *SyncStats

type Temp

type Temp struct {
}

type TotalTransactionInShard

type TotalTransactionInShard struct {
	TotalTransactions                 uint64 `json:"TotalTransactions"`
	TotalTransactionsExcludeSystemTxs uint64 `json:"TotalTransactionsExcludeSystemTxs"`
	SalaryTransaction                 uint64 `json:"SalaryTransaction"`
}

func NewTotalTransactionInShard

func NewTotalTransactionInShard(shardBeststate *blockchain.ShardBestState) *TotalTransactionInShard

type TransactionDetail

type TransactionDetail struct {
	BlockHash   string `json:"BlockHash"`
	BlockHeight uint64 `json:"BlockHeight"`
	TxSize      uint64 `json:"TxSize"`
	Index       uint64 `json:"Index"`
	ShardID     byte   `json:"ShardID"`
	Hash        string `json:"Hash"`
	Version     int8   `json:"Version"`
	Type        string `json:"Type"` // Transaction type
	LockTime    string `json:"LockTime"`
	RawLockTime int64  `json:"RawLockTime,omitempty"`
	Fee         uint64 `json:"Fee"` // Fee applies: always consant
	Image       string `json:"Image"`

	IsPrivacy       bool          `json:"IsPrivacy"`
	Proof           privacy.Proof `json:"Proof"`
	ProofDetail     ProofDetail   `json:"ProofDetail"`
	InputCoinPubKey string        `json:"InputCoinPubKey"`
	SigPubKey       string        `json:"SigPubKey,omitempty"` // 64 bytes
	RawSigPubKey    []byte        `json:"RawSigPubKey,omitempty"`
	Sig             string        `json:"Sig,omitempty"` // 64 bytes

	Metadata                      string      `json:"Metadata"`
	CustomTokenData               string      `json:"CustomTokenData"`
	PrivacyCustomTokenID          string      `json:"PrivacyCustomTokenID"`
	PrivacyCustomTokenName        string      `json:"PrivacyCustomTokenName"`
	PrivacyCustomTokenSymbol      string      `json:"PrivacyCustomTokenSymbol"`
	PrivacyCustomTokenData        string      `json:"PrivacyCustomTokenData"`
	PrivacyCustomTokenProofDetail ProofDetail `json:"PrivacyCustomTokenProofDetail"`
	PrivacyCustomTokenIsPrivacy   bool        `json:"PrivacyCustomTokenIsPrivacy"`
	PrivacyCustomTokenFee         uint64      `json:"PrivacyCustomTokenFee"`

	IsInMempool bool `json:"IsInMempool"`
	IsInBlock   bool `json:"IsInBlock"`

	Info string `json:"Info"`
}

func NewTransactionDetail

func NewTransactionDetail(tx metadata.Transaction, blockHash *common.Hash, blockHeight uint64, index int, shardID byte) (*TransactionDetail, error)

type UnsubcribeResult

type UnsubcribeResult struct {
	Message string `json:"Message"`
}

Jump to

Keyboard shortcuts

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