Documentation ¶
Index ¶
- type Event
- type IClientService
- type ISCEvent
- type WasmClientContext
- func (s *WasmClientContext) ClientContract(hContract wasmtypes.ScHname) wasmtypes.ScHname
- func (s *WasmClientContext) CurrentChainID() wasmtypes.ScChainID
- func (s *WasmClientContext) CurrentKeyPair() *iscclient.Keypair
- func (s *WasmClientContext) CurrentSvcClient() IClientService
- func (s *WasmClientContext) FnCall(req *wasmrequests.CallRequest) []byte
- func (s *WasmClientContext) FnChainID() wasmtypes.ScChainID
- func (s *WasmClientContext) FnPost(req *wasmrequests.PostRequest) []byte
- func (s *WasmClientContext) Register(handler wasmlib.IEventHandlers)
- func (s *WasmClientContext) ServiceContractName(contractName string)
- func (s *WasmClientContext) SignRequests(keyPair *iscclient.Keypair)
- func (s *WasmClientContext) Unregister(eventsID uint32)
- func (s *WasmClientContext) WaitRequest(reqID ...wasmtypes.ScRequestID)
- type WasmClientEvents
- type WasmClientService
- func (svc *WasmClientService) CallViewByHname(hContract, hFunction wasmtypes.ScHname, args []byte) ([]byte, error)
- func (svc *WasmClientService) CurrentChainID() wasmtypes.ScChainID
- func (svc *WasmClientService) IsHealthy() bool
- func (svc *WasmClientService) PostRequest(chainID wasmtypes.ScChainID, hContract, hFunction wasmtypes.ScHname, ...) (reqID wasmtypes.ScRequestID, err error)
- func (svc *WasmClientService) SetCurrentChainID(chainID string) error
- func (svc *WasmClientService) SetDefaultChainID() error
- func (svc *WasmClientService) SubscribeEvents(eventHandler *WasmClientEvents) error
- func (svc *WasmClientService) UnsubscribeEvents(eventsID uint32)
- func (svc *WasmClientService) WaitUntilRequestProcessed(reqID wasmtypes.ScRequestID, timeout time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶ added in v1.0.3
type Event struct { ChainID wasmtypes.ScChainID ContractID wasmtypes.ScHname `json:"contractID"` Payload []byte `json:"payload"` Timestamp uint64 `json:"timestamp"` Topic string `json:"topic"` }
func NewContractEvent ¶ added in v1.0.3
type IClientService ¶
type IClientService interface { CallViewByHname(hContract, hFunction wasmtypes.ScHname, args []byte) ([]byte, error) CurrentChainID() wasmtypes.ScChainID PostRequest(chainID wasmtypes.ScChainID, hContract, hFunction wasmtypes.ScHname, args []byte, allowance *wasmlib.ScAssets, keyPair *iscclient.Keypair) (wasmtypes.ScRequestID, error) SubscribeEvents(eventHandler *WasmClientEvents) error UnsubscribeEvents(eventsID uint32) WaitUntilRequestProcessed(reqID wasmtypes.ScRequestID, timeout time.Duration) error }
type WasmClientContext ¶
type WasmClientContext struct { Err error ReqID wasmtypes.ScRequestID // contains filtered or unexported fields }
func NewWasmClientContext ¶
func NewWasmClientContext(svcClient IClientService, scName string) *WasmClientContext
NewWasmClientContext uses IClientService instead of WasmClientService because this could also be a SoloClientService
func (*WasmClientContext) ClientContract ¶ added in v1.0.3
func (s *WasmClientContext) ClientContract(hContract wasmtypes.ScHname) wasmtypes.ScHname
func (*WasmClientContext) CurrentChainID ¶
func (s *WasmClientContext) CurrentChainID() wasmtypes.ScChainID
func (*WasmClientContext) CurrentKeyPair ¶ added in v1.0.3
func (s *WasmClientContext) CurrentKeyPair() *iscclient.Keypair
func (*WasmClientContext) CurrentSvcClient ¶ added in v1.0.3
func (s *WasmClientContext) CurrentSvcClient() IClientService
func (*WasmClientContext) FnCall ¶ added in v1.0.3
func (s *WasmClientContext) FnCall(req *wasmrequests.CallRequest) []byte
func (*WasmClientContext) FnChainID ¶ added in v1.0.3
func (s *WasmClientContext) FnChainID() wasmtypes.ScChainID
func (*WasmClientContext) FnPost ¶ added in v1.0.3
func (s *WasmClientContext) FnPost(req *wasmrequests.PostRequest) []byte
func (*WasmClientContext) Register ¶
func (s *WasmClientContext) Register(handler wasmlib.IEventHandlers)
Register the event handler. So the corresponding incoming events will be handled by this event handler
func (*WasmClientContext) ServiceContractName ¶
func (s *WasmClientContext) ServiceContractName(contractName string)
func (*WasmClientContext) SignRequests ¶
func (s *WasmClientContext) SignRequests(keyPair *iscclient.Keypair)
func (*WasmClientContext) Unregister ¶
func (s *WasmClientContext) Unregister(eventsID uint32)
func (*WasmClientContext) WaitRequest ¶
func (s *WasmClientContext) WaitRequest(reqID ...wasmtypes.ScRequestID)
type WasmClientEvents ¶ added in v1.0.3
type WasmClientEvents struct {
// contains filtered or unexported fields
}
func RemoveHandler ¶ added in v1.0.3
func RemoveHandler(eventHandlers []*WasmClientEvents, eventsID uint32) []*WasmClientEvents
func (WasmClientEvents) ProcessEvent ¶ added in v1.0.3
func (h WasmClientEvents) ProcessEvent(event *Event)
type WasmClientService ¶
type WasmClientService struct {
// contains filtered or unexported fields
}
func NewWasmClientService ¶
func NewWasmClientService(waspAPI string) *WasmClientService
func (*WasmClientService) CallViewByHname ¶
func (*WasmClientService) CurrentChainID ¶ added in v1.0.3
func (svc *WasmClientService) CurrentChainID() wasmtypes.ScChainID
func (*WasmClientService) IsHealthy ¶ added in v1.0.3
func (svc *WasmClientService) IsHealthy() bool
func (*WasmClientService) PostRequest ¶
func (*WasmClientService) SetCurrentChainID ¶ added in v1.0.3
func (svc *WasmClientService) SetCurrentChainID(chainID string) error
func (*WasmClientService) SetDefaultChainID ¶ added in v1.0.3
func (svc *WasmClientService) SetDefaultChainID() error
func (*WasmClientService) SubscribeEvents ¶
func (svc *WasmClientService) SubscribeEvents(eventHandler *WasmClientEvents) error
func (*WasmClientService) UnsubscribeEvents ¶ added in v1.0.3
func (svc *WasmClientService) UnsubscribeEvents(eventsID uint32)
func (*WasmClientService) WaitUntilRequestProcessed ¶
func (svc *WasmClientService) WaitUntilRequestProcessed(reqID wasmtypes.ScRequestID, timeout time.Duration) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.