wasmclient

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: Apache-2.0, BSD-2-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IClientService

type IClientService interface {
	CallViewByHname(chainID wasmtypes.ScChainID, hContract, hFunction wasmtypes.ScHname, args []byte) ([]byte, error)
	PostRequest(chainID wasmtypes.ScChainID, hContract, hFunction wasmtypes.ScHname, args []byte, allowance *wasmlib.ScAssets, keyPair *cryptolib.KeyPair) (wasmtypes.ScRequestID, error)
	SubscribeEvents(msg chan []string, done chan bool) error
	WaitUntilRequestProcessed(chainID wasmtypes.ScChainID, reqID wasmtypes.ScRequestID, timeout time.Duration) error
}

type IEventHandler

type IEventHandler interface {
	CallHandler(topic string, params []string)
}

type WasmClientContext

type WasmClientContext struct {
	Err error

	ReqID wasmtypes.ScRequestID
	// contains filtered or unexported fields
}

func NewWasmClientContext

func NewWasmClientContext(svcClient IClientService, chainID wasmtypes.ScChainID, scName string) *WasmClientContext

func (*WasmClientContext) CurrentChainID

func (s *WasmClientContext) CurrentChainID() wasmtypes.ScChainID

func (*WasmClientContext) ExportName

func (s *WasmClientContext) ExportName(index int32, name string)

func (*WasmClientContext) InitFuncCallContext

func (s *WasmClientContext) InitFuncCallContext()

func (*WasmClientContext) InitViewCallContext

func (s *WasmClientContext) InitViewCallContext(hContract wasmtypes.ScHname) wasmtypes.ScHname

func (*WasmClientContext) Register

func (s *WasmClientContext) Register(handler IEventHandler) error

func (*WasmClientContext) Sandbox

func (s *WasmClientContext) Sandbox(funcNr int32, args []byte) []byte

func (*WasmClientContext) ServiceContractName

func (s *WasmClientContext) ServiceContractName(contractName string)

overrides default contract name

func (*WasmClientContext) SignRequests

func (s *WasmClientContext) SignRequests(keyPair *cryptolib.KeyPair)

func (*WasmClientContext) StateDelete

func (s *WasmClientContext) StateDelete(key []byte)

func (*WasmClientContext) StateExists

func (s *WasmClientContext) StateExists(key []byte) bool

func (*WasmClientContext) StateGet

func (s *WasmClientContext) StateGet(key []byte) []byte

func (*WasmClientContext) StateSet

func (s *WasmClientContext) StateSet(key, value []byte)

func (*WasmClientContext) Unregister

func (s *WasmClientContext) Unregister(handler IEventHandler)

func (*WasmClientContext) WaitEvent

func (s *WasmClientContext) WaitEvent() error

func (*WasmClientContext) WaitRequest

func (s *WasmClientContext) WaitRequest(reqID ...wasmtypes.ScRequestID) error

type WasmClientService

type WasmClientService struct {
	// contains filtered or unexported fields
}

func DefaultWasmClientService

func DefaultWasmClientService() *WasmClientService

func NewWasmClientService

func NewWasmClientService(waspAPI, eventPort string) *WasmClientService

func (*WasmClientService) CallViewByHname

func (sc *WasmClientService) CallViewByHname(chainID wasmtypes.ScChainID, hContract, hFunction wasmtypes.ScHname, args []byte) ([]byte, error)

func (*WasmClientService) PostRequest

func (sc *WasmClientService) PostRequest(chainID wasmtypes.ScChainID, hContract, hFunction wasmtypes.ScHname, args []byte, allowance *wasmlib.ScAssets, keyPair *cryptolib.KeyPair) (reqID wasmtypes.ScRequestID, err error)

func (*WasmClientService) SubscribeEvents

func (sc *WasmClientService) SubscribeEvents(msg chan []string, done chan bool) error

func (*WasmClientService) WaitUntilRequestProcessed

func (sc *WasmClientService) WaitUntilRequestProcessed(chainID wasmtypes.ScChainID, reqID wasmtypes.ScRequestID, timeout time.Duration) error

Jump to

Keyboard shortcuts

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