Documentation ¶
Index ¶
- Constants
- func CreateFunctionInvocationScript(contract common.Address, method string, param *Param) ([]byte, error)
- func ExpandArrayIntoScript(script *io.BinWriter, slice []Param) error
- type Batch
- type BlockFilter
- type ExecutionFilter
- type In
- type NotificationFilter
- type Param
- func (p *Param) GetAddressFromHex() (common.Address, error)
- func (p *Param) GetArray() ([]Param, error)
- func (p *Param) GetBigInt() (*big.Int, error)
- func (p *Param) GetBoolean() (bool, error)
- func (p *Param) GetBooleanStrict() (bool, error)
- func (p *Param) GetBytesBase64() ([]byte, error)
- func (p *Param) GetBytesHex() ([]byte, error)
- func (p *Param) GetHash() (common.Hash, error)
- func (p *Param) GetInt() (int, error)
- func (p *Param) GetIntStrict() (int, error)
- func (p *Param) GetString() (string, error)
- func (p *Param) GetStringStrict() (string, error)
- func (p *Param) IsNull() bool
- func (p Param) String() string
- type Params
- type Raw
- type RawParams
- type Request
- type SignerWithWitness
- type TxFilter
Constants ¶
const (
// JSONRPCVersion is the only JSON-RPC protocol version supported.
JSONRPCVersion = "2.0"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Batch ¶
type Batch []In
Batch represents a standard JSON-RPC 2.0 batch: https://www.jsonrpc.org/specification#batch.
type BlockFilter ¶
type BlockFilter struct {
Primary int `json:"primary"`
}
BlockFilter is a wrapper structure for block event filter. The only allowed filter is primary index.
type ExecutionFilter ¶
type ExecutionFilter struct {
State uint64 `json:"state"`
}
ExecutionFilter is a wrapper structure used for transaction execution events. It allows to choose failing or successful transactions based on their VM state.
type In ¶
type In struct { JSONRPC string `json:"jsonrpc"` Method string `json:"method"` RawParams []Param `json:"params,omitempty"` RawID json.RawMessage `json:"id,omitempty"` }
In represents a standard JSON-RPC 2.0 request: http://www.jsonrpc.org/specification#request_object.
type NotificationFilter ¶
NotificationFilter is a wrapper structure representing filter used for notifications generated during transaction execution. Notifications can be filtered by contract hash and by name.
type Param ¶
type Param struct { json.RawMessage // contains filtered or unexported fields }
Param represents a param either passed to the server or to send to a server using the client.
func (*Param) GetAddressFromHex ¶
GetUint160FromHex returns Uint160 value of the parameter encoded in hex.
func (*Param) GetBoolean ¶
GetBoolean returns boolean value of the parameter or tries to cast parameter to a bool value.
func (*Param) GetBooleanStrict ¶
GetBooleanStrict returns boolean value of the parameter.
func (*Param) GetBytesBase64 ¶
func (*Param) GetBytesHex ¶
GetBytesHex returns []byte value of the parameter if it is a hex-encoded string.
func (*Param) GetInt ¶
GetInt returns int value of the parameter or tries to cast parameter to an int value.
func (*Param) GetIntStrict ¶
GetIntStrict returns int value of the parameter if the parameter is integer.
func (*Param) GetString ¶
GetString returns string value of the parameter or tries to cast parameter to a string value.
func (*Param) GetStringStrict ¶
GetStringStrict returns string value of the parameter.
type Raw ¶
type Raw struct { JSONRPC string `json:"jsonrpc"` Method string `json:"method"` RawParams []interface{} `json:"params"` ID uint64 `json:"id"` }
Raw represents JSON-RPC request on the Client side.
type RawParams ¶
type RawParams struct {
Values []interface{}
}
RawParams is just a slice of abstract values, used to represent parameters passed from client to server.
func NewRawParams ¶
func NewRawParams(vals ...interface{}) RawParams
NewRawParams creates RawParams from its parameters.
type Request ¶
Request contains standard JSON-RPC 2.0 request and batch of requests: http://www.jsonrpc.org/specification. It's used in server to represent incoming queries.
func (*Request) DecodeData ¶
func (r *Request) DecodeData(data io.ReadCloser) error
DecodeData decodes the given reader into the the request struct.
func (Request) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*Request) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler interface.
type SignerWithWitness ¶
type SignerWithWitness struct { Signer common.Address transaction.Witness }
SignerWithWitness represents transaction's signer with the corresponding witness.