dto

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2019 License: MIT Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

type RequestResult

type RequestResult struct {
	ID      int         `json:"id"`
	Version string      `json:"jsonrpc"`
	Result  interface{} `json:"result"`
	Error   *Error      `json:"error,omitempty"`
	Data    string      `json:"data,omitempty"`
}

func NewRequestResult

func NewRequestResult(result interface{}) *RequestResult

func (*RequestResult) GetResult

func (pointer *RequestResult) GetResult() (interface{}, error)

func (*RequestResult) ToBigInt

func (pointer *RequestResult) ToBigInt() (*big.Int, error)

func (*RequestResult) ToBoolean

func (pointer *RequestResult) ToBoolean() (bool, error)

func (*RequestResult) ToInt

func (pointer *RequestResult) ToInt() (int64, error)

func (*RequestResult) ToSignTransactionResponse

func (pointer *RequestResult) ToSignTransactionResponse() (*SignTransactionResponse, error)

func (*RequestResult) ToString

func (pointer *RequestResult) ToString() (string, error)

func (*RequestResult) ToStringArray

func (pointer *RequestResult) ToStringArray() ([]string, error)

func (*RequestResult) ToSyncingResponse

func (pointer *RequestResult) ToSyncingResponse() (*SyncingResponse, error)

func (*RequestResult) ToTransactionReceipt

func (pointer *RequestResult) ToTransactionReceipt() (*TransactionReceipt, error)

type RequestResult1

type RequestResult1 struct {
	ID      int             `json:"id"`
	Version string          `json:"jsonrpc"`
	Result  json.RawMessage `json:"result"`
	Error   *Error          `json:"error,omitempty"`
	Data    string          `json:"data,omitempty"`
}

func (*RequestResult1) ToBigInt

func (pointer *RequestResult1) ToBigInt() (*big.Int, error)

func (*RequestResult1) UnMarshalResult

func (pointer *RequestResult1) UnMarshalResult(result interface{}) error

type RequestTransactionParameters

type RequestTransactionParameters struct {
	From     string `json:"from"`
	To       string `json:"to,omitempty"`
	Nonce    string `json:"nonce,omitempty"`
	Gas      string `json:"gas,omitempty"`
	GasPrice string `json:"gasPrice,omitempty"`
	Value    string `json:"value,omitempty"`
	Data     string `json:"data,omitempty"`
}

RequestTransactionParameters JSON

type SHHPostParameters

type SHHPostParameters struct {
	From     string   `json:"from"`
	To       string   `json:"to"`
	Topics   []string `json:"topics"`
	Payload  string   `json:"payload"`
	Priority string   `json:"priority"`
	TTL      string   `json:"ttl"`
}

type SignTransactionResponse

type SignTransactionResponse struct {
	Raw         types.ComplexString     `json:"raw"`
	Transaction SignedTransactionParams `json:"tx"`
}

type SignedTransactionParams

type SignedTransactionParams struct {
	Gas      *big.Int `json:gas`
	GasPrice *big.Int `json:gasPrice`
	Hash     string   `json:hash`
	Input    string   `json:input`
	Nonce    *big.Int `json:nonce`
	S        string   `json:s`
	R        string   `json:r`
	V        *big.Int `json:v`
	To       string   `json:to`
	Value    *big.Int `json:value`
}

func (*SignedTransactionParams) UnmarshalJSON

func (sp *SignedTransactionParams) UnmarshalJSON(data []byte) error

type SyncingResponse

type SyncingResponse struct {
	StartingBlock *big.Int `json:"startingBlock"`
	CurrentBlock  *big.Int `json:"currentBlock"`
	HighestBlock  *big.Int `json:"highestBlock"`
}

type TransactionLogs

type TransactionLogs struct {
	Address          string   `json:"address"`
	Topics           []string `json:"topics"`
	Data             string   `json:"data"`
	BlockNumber      *big.Int `json:"blockNumber"`
	TransactionHash  string   `json:"transactionHash"`
	TransactionIndex *big.Int `json:"transactionIndex"`
	BlockHash        string   `json:"blockHash"`
	LogIndex         *big.Int `json:"logIndex"`
	Removed          bool     `json:"removed"`
}

func (*TransactionLogs) UnmarshalJSON

func (r *TransactionLogs) UnmarshalJSON(data []byte) error

type TransactionParameters

type TransactionParameters struct {
	From     string
	To       string
	Nonce    *big.Int
	Gas      *big.Int
	GasPrice *big.Int
	Value    *big.Int
	Data     types.ComplexString
}

TransactionParameters GO transaction to make more easy controll the parameters

func (*TransactionParameters) Transform

Transform the GO transactions parameters to json style

type TransactionReceipt

type TransactionReceipt struct {
	TransactionHash   string            `json:"transactionHash"`
	TransactionIndex  *big.Int          `json:"transactionIndex"`
	BlockHash         string            `json:"blockHash"`
	BlockNumber       *big.Int          `json:"blockNumber"`
	From              string            `json:"from"`
	To                string            `json:"to"`
	CumulativeGasUsed *big.Int          `json:"cumulativeGasUsed"`
	GasUsed           *big.Int          `json:"gasUsed"`
	ContractAddress   string            `json:"contractAddress"`
	Logs              []TransactionLogs `json:"logs"`
	LogsBloom         string            `json:"logsBloom"`
	Root              string            `json:"string"`
	Status            bool              `json:"status"`
}

func (*TransactionReceipt) UnmarshalJSON

func (r *TransactionReceipt) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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