jsonresult

package
v0.0.0-...-6729ccb Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PDE
	WaitingPDEContributionPrefix = []byte("waitingpdecontribution-")
	PDEPoolPrefix                = []byte("pdepool-")
	PDESharePrefix               = []byte("pdeshare-")
	PDETradingFeePrefix          = []byte("pdetradingfee-")
	PDETradeFeePrefix            = []byte("pdetradefee-")
	PDEContributionStatusPrefix  = []byte("pdecontributionstatus-")
	PDETradeStatusPrefix         = []byte("pdetradestatus-")
	PDEWithdrawalStatusPrefix    = []byte("pdewithdrawalstatus-")
	PDEFeeWithdrawalStatusPrefix = []byte("pdefeewithdrawalstatus-")
)

key prefix

Functions

func BuildPDEPoolForPairKey

func BuildPDEPoolForPairKey(
	beaconHeight uint64,
	token1IDStr string,
	token2IDStr string,
) []byte

func EncodeBase58Check

func EncodeBase58Check(b []byte) string

Types

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 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 CurrentPDEState

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

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"`
}

type GetBestBlockResult

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

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 ListOutputCoins

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

type OutCoin

type OutCoin struct {
	Version              string `json:"Version"`
	Index                string `json:"Index"`
	PublicKey            string `json:"PublicKey"`
	Commitment           string `json:"Commitment"`
	CoinCommitment       string `json:"CoinCommitment"`
	SNDerivator          string `json:"SNDerivator"`
	KeyImage             string `json:"KeyImage"`
	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 PDEContribution

type PDEContribution struct {
	ContributorAddressStr string
	TokenIDStr            string
	Amount                uint64
	TxReqID               common.Hash
}

type PDEPoolForPair

type PDEPoolForPair struct {
	Token1IDStr     string
	Token1PoolValue uint64
	Token2IDStr     string
	Token2PoolValue uint64
}

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 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"`
	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
	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"`
}

Jump to

Keyboard shortcuts

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