Crate sonic_callreq

Source
Expand description

Request (or transaction request) is a specification on constructing a transaction for a SONARE contract.

§URL Representation

contract:[//USER@NODE:PORT/]CONTRACT_ID[/API][/METHOD[/STATE]]/[VALUE][?ARGS]

A contract calls are URIs and URLS, which may have multiple forms (depending on the backend). Here are the examples for the castVote call for the DAO contract from the examples directory:

  • Using SONARE runtime: contract:DAO.indsc.org/castVote?voting=id&with=(id,preimage)&next=(id,hash)&vote=pro
  • Using a server providing SONIC API: contract://any.sonicapi.node/DAO.indsc.org/castVote?voting=id&with=(id,preimage)&next=(id, hash)&vote=pro
  • Using a server providing HTTP REST SONIC API: https://contract@any.sonicapi.node/DAO.indsc.org/castVote?voting=id&with=(id,preimage)&next=(id,hash)&vote=pro
  • Using a websocket connection: wws://contract@any.sonicapi.node/DAO.indsc.org/castVote?voting=id&with=(id,preimage)& next=(id,hash)&vote=pro
  • Using a Storm node server which contains SONARE runtime: storm://any.storm.node/contract:DAO.indsc.org/castVote?voting=id&with=(id,preimage)&next=(id, hash)&vote=pro

Modules§

uriuri

Structs§

CallRequest
Call request provides information for constructing [hypersonic::CallParams].
CallState
Combination of a method name and an optional state name used in API requests.
Layer1
ParseLayer1Error

Enums§

CallScope
Endpoint

Constants§

LIB_NAME_SONIC

Type Aliases§

MethodName
StateName