Documentation ¶
Index ¶
- func CreateFunctionInvocationScript(contract util.Uint160, method string, param *Param) ([]byte, error)
- func ExpandArrayIntoScript(script *io.BinWriter, slice []Param) error
- func ExpandArrayIntoScriptAndPack(script *io.BinWriter, slice []Param) error
- type Batch
- type FuncParam
- type In
- type Param
- 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) GetFuncParam() (FuncParam, error)
- func (p *Param) GetInt() (int, error)
- func (p *Param) GetIntStrict() (int, error)
- func (p *Param) GetSignerWithWitness() (neorpc.SignerWithWitness, error)
- func (p Param) GetSignersWithWitnesses() ([]transaction.Signer, []transaction.Witness, error)
- func (p *Param) GetString() (string, error)
- func (p *Param) GetStringStrict() (string, error)
- func (p *Param) GetUUID() (uuid.UUID, error)
- func (p *Param) GetUint160FromAddress() (util.Uint160, error)
- func (p *Param) GetUint160FromAddressOrHex() (util.Uint160, error)
- func (p *Param) GetUint160FromHex() (util.Uint160, error)
- func (p *Param) GetUint256() (util.Uint256, error)
- func (p *Param) IsNull() bool
- func (p Param) String() string
- type Params
- type Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFunctionInvocationScript ¶
func CreateFunctionInvocationScript(contract util.Uint160, method string, param *Param) ([]byte, error)
CreateFunctionInvocationScript creates a script to invoke the given contract with the given parameters.
func ExpandArrayIntoScript ¶
ExpandArrayIntoScript pushes all FuncParam parameters from the given array into the given buffer in the reverse order.
Types ¶
type Batch ¶
type Batch []In
Batch represents a standard JSON-RPC 2.0 batch: https://www.jsonrpc.org/specification#batch.
type FuncParam ¶
type FuncParam struct { Type smartcontract.ParamType `json:"type"` Value Param `json:"value"` }
FuncParam represents a function argument parameter used in the invokefunction RPC method.
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 Param ¶
type Param struct { json.RawMessage // contains filtered or unexported fields }
Param represents a param either passed to the server or to be sent to a server using the client.
func (*Param) GetBoolean ¶
GetBoolean returns a boolean value of the parameter or tries to cast the parameter to a bool value.
func (*Param) GetBooleanStrict ¶
GetBooleanStrict returns boolean value of the parameter.
func (*Param) GetBytesBase64 ¶
GetBytesBase64 returns a []byte value of the parameter if it is a base64-encoded string.
func (*Param) GetBytesHex ¶
GetBytesHex returns a []byte value of the parameter if it is a hex-encoded string.
func (*Param) GetFuncParam ¶
GetFuncParam returns the current parameter as a function call parameter.
func (*Param) GetInt ¶
GetInt returns an int value of the parameter or tries to cast the parameter to an int value.
func (*Param) GetIntStrict ¶
GetIntStrict returns an int value of the parameter if the parameter is an integer.
func (*Param) GetSignerWithWitness ¶
func (p *Param) GetSignerWithWitness() (neorpc.SignerWithWitness, error)
GetSignerWithWitness returns a neorpc.SignerWithWitness value of the parameter.
func (Param) GetSignersWithWitnesses ¶
func (p Param) GetSignersWithWitnesses() ([]transaction.Signer, []transaction.Witness, error)
GetSignersWithWitnesses returns a slice of SignerWithWitness with CalledByEntry scope from an array of Uint160 or an array of serialized transaction.Signer stored in the parameter.
func (*Param) GetString ¶
GetString returns a string value of the parameter or tries to cast the parameter to a string value.
func (*Param) GetStringStrict ¶
GetStringStrict returns a string value of the parameter.
func (*Param) GetUint160FromAddress ¶
GetUint160FromAddress returns a Uint160 value of the parameter that was supplied as an address.
func (*Param) GetUint160FromAddressOrHex ¶
GetUint160FromAddressOrHex returns a Uint160 value of the parameter that was supplied either as raw hex or as an address.
func (*Param) GetUint160FromHex ¶
GetUint160FromHex returns a Uint160 value of the parameter encoded in hex.
func (*Param) GetUint256 ¶
GetUint256 returns a Uint256 value of the parameter.
type Params ¶
type Params []Param
Params represents the JSON-RPC params.
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 the json.Marshaler interface.
func (*Request) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.