rtypes

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2019 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAmino

func RegisterAmino()

Types

type Backend

type Backend interface {
	SuggestPrice(ctx context.Context) (*big.Int, error)
	AccountManager() *accounts.Manager
	GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error)
}

type BalanceRecordsWithBlockHeight

type BalanceRecordsWithBlockHeight struct {
	BlockHeight         uint64                     `json:"height"`
	BlockBalanceRecords *types.BlockBalanceRecords `json:"block_balance_records"`
}

func NewBalanceRecordsWithBlockMsg

func NewBalanceRecordsWithBlockMsg(blockHeight uint64, bbr *types.BlockBalanceRecords) *BalanceRecordsWithBlockHeight

type ITX

type ITX interface{}

type Node added in v0.1.1

type Node struct {
	IP       string       `json:"ip"`       // len 4 for IPv4 or 16 for IPv6
	UDP_Port uint16       `json:"udp_port"` // port numbers
	TCP_Port uint16       `json:"tcp_port"` // port numbers
	ID       pcomm.NodeID `json:"id"`       // the node's public key
}

type Peer

type Peer struct {
	p2p.NodeInfo     `json:"node_info"`
	IsOutbound       bool                 `json:"is_outbound"`
	ConnectionStatus p2p.ConnectionStatus `json:"connection_status"`
}

type PeerStateInfo

type PeerStateInfo struct {
	NodeAddress string          `json:"node_address"`
	PeerState   json.RawMessage `json:"peer_state"`
}

type QuickRPCBlock added in v0.1.1

type QuickRPCBlock struct {
	Block      *RPCBlock    `json:"block,omitempty"`
	NextHeight *hexutil.Big `json:"next_height"`
	MaxHeight  *hexutil.Big `json:"max_height"`
}

type RPCBalanceRecord

type RPCBalanceRecord struct {
	From            common.Address `json:"from"`
	To              common.Address `json:"to"`
	FromAddressType hexutil.Uint   `json:"from_address_type"`
	ToAddressType   hexutil.Uint   `json:"to_address_type"`
	Type            string         `json:"type"`
	TokenID         common.Address `json:"token_id"`
	Amount          *hexutil.Big   `json:"amount"`
}

type RPCBlock

type RPCBlock struct {
	Height          *hexutil.Big     `json:"number"`
	Hash            *common.Hash     `json:"hash"`
	Coinbase        *common.Address  `json:"miner"`
	Time            *hexutil.Big     `json:"timestamp"`
	ParentHash      common.Hash      `json:"parentHash"`
	DataHash        common.Hash      `json:"transactionsRoot"`
	StateHash       common.Hash      `json:"stateRoot"`
	ReceiptHash     common.Hash      `json:"receiptsRoot"`
	GasLimit        hexutil.Uint64   `json:"gasLimit"`
	GasUsed         hexutil.Uint64   `json:"gasUsed"`
	Bloom           types.Bloom      `json:"logsBloom"`
	Txs             Txs              `json:"transactions"`
	TokenOutputSeqs map[string]int64 `json:"token_output_seqs"`
}

func NewRPCBlock

func NewRPCBlock(b *types.Block, inclTx bool, fullTx bool) *RPCBlock

NewRPCBlock converts the given block to the RPC output which depends on fullTx. If inclTx is true transactions are returned. When fullTx is true the returned block contains full transaction details, otherwise it will only contain transaction hashes.

type RPCBlockBalanceRecords

type RPCBlockBalanceRecords struct {
	BlockTime hexutil.Uint64         `json:"block_time"`
	BlockHash common.Hash            `json:"block_hash"`
	TxRecords []*RPCTxBalanceRecords `json:"tx_records"`
}

func NewRPCBlockBalanceRecord

func NewRPCBlockBalanceRecord(bbr *types.BlockBalanceRecords) *RPCBlockBalanceRecords

type RPCBlockUTXO added in v0.1.2

type RPCBlockUTXO struct {
	Height          hexutil.Uint64   `json:"number"`
	Hash            *common.Hash     `json:"hash"`
	Time            hexutil.Uint64   `json:"timestamp"`
	ParentHash      common.Hash      `json:"parentHash"`
	Txs             Txs              `json:"transactions"`
	TokenOutputSeqs map[string]int64 `json:"token_output_seqs"`
}

func NewRPCBlockUTXO

func NewRPCBlockUTXO(b *types.Block, inclTx bool, fullTx bool, tokenOutputSeqs map[string]int64) *RPCBlockUTXO

NewRPCBlockUTXO converts the given block to the RPC output which depends on fullTx. If inclTx is true transactions are returned. When fullTx is true the returned block contains full transaction details, otherwise it will only contain transaction hashes. only return utxo txs.

type RPCKey

type RPCKey cptypes.Key

func (RPCKey) MarshalJSON

func (k RPCKey) MarshalJSON() ([]byte, error)

func (*RPCKey) UnmarshalJSON

func (k *RPCKey) UnmarshalJSON(input []byte) error

type RPCOutput

type RPCOutput struct {
	Out RPCKey `json:"out"`
	//UnlockTime uint64         `json:"unlock_time"`
	Height  uint64         `json:"height"`
	Commit  RPCKey         `json:"commit"`
	TokenID common.Address `json:"token"`
}

type RPCTx

type RPCTx struct {
	TxType   string          `json:"txType"`
	TxHash   common.Hash     `json:"txHash"`
	SignHash *common.Hash    `json:"signHash,omitempty"`
	From     *common.Address `json:"from,omitempty"`
	Tx       types.Tx        `json:"tx"`
	TxEntry  *types.TxEntry  `json:"txEntry,omitempty"`
}

func NewRPCTx

func NewRPCTx(tx types.Tx, entry *types.TxEntry) *RPCTx

NewRPCTx returns a tx that will serialize to the RPC representation, with the given location metadata set (if available).

func (RPCTx) MarshalJSON

func (t RPCTx) MarshalJSON() ([]byte, error)

func (*RPCTx) UnmarshalJSON

func (t *RPCTx) UnmarshalJSON(input []byte) error

type RPCTxBalanceRecords

type RPCTxBalanceRecords struct {
	Hash     common.Hash        `json:"hash"`
	Type     string             `json:"type"`
	Records  []RPCBalanceRecord `json:"records"`
	Payloads []*hexutil.Bytes   `json:"payloads"`
	Nonce    hexutil.Uint64     `json:"nonce"`
	GasLimit hexutil.Uint64     `json:"gas_limit"`
	GasPrice *hexutil.Big       `json:"gas_price"`
	From     common.Address     `json:"from"`
	To       common.Address     `json:"to"`
	TokenId  common.Address     `json:"token_id"`
}

type ReceiptsWithBlockHeight

type ReceiptsWithBlockHeight struct {
	BlockHeight uint64         `json:"height"`
	Receipts    types.Receipts `json:"receipts"`
}

func NewReceiptsWithBlockHeight

func NewReceiptsWithBlockHeight(blockHeight uint64, receipts types.Receipts) *ReceiptsWithBlockHeight

type ResultBlock

type ResultBlock struct {
	BlockMeta *types.BlockMeta `json:"block_meta"`
	Block     *types.Block     `json:"block"`
}

Single block (with meta)

func (ResultBlock) MarshalJSON

func (r ResultBlock) MarshalJSON() ([]byte, error)

func (*ResultBlock) UnmarshalJSON

func (r *ResultBlock) UnmarshalJSON(input []byte) error

type ResultBlockHeader

type ResultBlockHeader struct {
	*types.Header
}

func (ResultBlockHeader) MarshalJSON

func (b ResultBlockHeader) MarshalJSON() ([]byte, error)

type ResultConsensusState

type ResultConsensusState struct {
	RoundState json.RawMessage `json:"round_state"`
}

UNSTABLE

type ResultDumpConsensusState

type ResultDumpConsensusState struct {
	RoundState json.RawMessage `json:"round_state"`
	Peers      []PeerStateInfo `json:"peers"`
}

type ResultNetInfo

type ResultNetInfo struct {
	Listening bool     `json:"listening"`
	Listeners []string `json:"listeners"`
	NPeers    int      `json:"n_peers"`
	Peers     []Peer   `json:"peers"`
	DHTPeers  []Node   `json:"dht_peers"`
}

Info about peer connections

func (ResultNetInfo) MarshalJSON

func (r ResultNetInfo) MarshalJSON() ([]byte, error)

type ResultStatus

type ResultStatus struct {
	NodeInfo      p2p.NodeInfo  `json:"node_info"`
	SyncInfo      SyncInfo      `json:"sync_info"`
	ValidatorInfo ValidatorInfo `json:"validator_info"`
}

Node Status

func (ResultStatus) MarshalJSON

func (s ResultStatus) MarshalJSON() ([]byte, error)

func (*ResultStatus) TxIndexEnabled

func (s *ResultStatus) TxIndexEnabled() bool

Is TxIndexing enabled

type ResultValidators

type ResultValidators struct {
	BlockHeight       uint64             `json:"block_height"`
	LastHeightChanged uint64             `json:"last_changed_height"`
	Validators        []*types.Validator `json:"validators"`
}

func (ResultValidators) MarshalJSON

func (r ResultValidators) MarshalJSON() ([]byte, error)

func (*ResultValidators) UnmarshalJSON

func (r *ResultValidators) UnmarshalJSON(input []byte) error

type SendSpecTxArgs

type SendSpecTxArgs struct {
	Args    json.RawMessage  `json:"args"`
	TxType  string           `json:"type"`
	Signers []common.Address `json:"signers"`
}

func (SendSpecTxArgs) ToTransaction

func (args SendSpecTxArgs) ToTransaction() (types.Tx, error)

type SendTxArgs

type SendTxArgs struct {
	From         common.Address  `json:"from"`
	TokenAddress common.Address  `json:"tokenAddress"`
	To           *common.Address `json:"to"`
	Gas          *hexutil.Uint64 `json:"gas"`
	GasPrice     *hexutil.Big    `json:"gasPrice"`
	Value        *hexutil.Big    `json:"value"`
	Nonce        *hexutil.Uint64 `json:"nonce"`
	// We accept "data" and "input" for backwards-compatibility reasons. "input" is the
	// newer name and should be preferred by clients.
	Data  *hexutil.Bytes `json:"data"`
	Input *hexutil.Bytes `json:"input"`
}

SendTxArgs represents the arguments to sumbit a new transaction into the transaction pool.

func (*SendTxArgs) SetDefaults

func (args *SendTxArgs) SetDefaults(ctx context.Context, b Backend) error

setDefaults is a helper function that fills in default values for unspecified tx fields.

func (*SendTxArgs) ToTransaction

func (args *SendTxArgs) ToTransaction() types.Tx

type SignTransactionResult

type SignTransactionResult struct {
	Raw hexutil.Bytes `json:"raw"`
	Tx  types.Tx      `json:"tx"`
}

SignTransactionResult represents a RLP encoded signed transaction.

type SyncInfo

type SyncInfo struct {
	LatestBlockHash   cmn.HexBytes `json:"latest_block_hash"`
	LatestAppHash     cmn.HexBytes `json:"latest_app_hash"`
	LatestBlockHeight uint64       `json:"latest_block_height"`
	LatestBlockTime   time.Time    `json:"latest_block_time"`
	CatchingUp        bool         `json:"catching_up"`
}

Info about the node's syncing state

type TxRecordReq

type TxRecordReq struct {
	TxHash string `json:"tx_hash"`
	Type   string `json:"type"`
}

type Txs

type Txs []ITX

func (Txs) MarshalJSON

func (t Txs) MarshalJSON() ([]byte, error)

func (*Txs) UnmarshalJSON

func (t *Txs) UnmarshalJSON(input []byte) error

type ValidatorInfo

type ValidatorInfo struct {
	Address     cmn.HexBytes  `json:"address"`
	PubKey      crypto.PubKey `json:"pub_key"`
	VotingPower int64         `json:"voting_power"`
}

Info about the node's validator

type WholeBlock

type WholeBlock struct {
	Block    *RPCBlock      `json:"block"`
	Receipts types.Receipts `json:"receipts"`
}

func NewWholeBlock

func NewWholeBlock(block *types.Block, receipts types.Receipts) *WholeBlock

Jump to

Keyboard shortcuts

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