wasmclient

package
v1.0.1-rc.13 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: Apache-2.0, Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

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

func NewContractEvent(chainID string, eventData []byte) Event

func (*Event) Bytes added in v1.0.3

func (e *Event) Bytes() []byte

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 ISCEvent added in v1.0.3

type ISCEvent struct {
	Kind      string   `json:"kind"`
	Issuer    string   `json:"issuer"`    // (isc.AgentID) nil means issued by the VM
	RequestID string   `json:"requestID"` // (isc.RequestID)
	ChainID   string   `json:"chainID"`   // (isc.ChainID)
	Payload   []*Event `json:"payload"`
}

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 (svc *WasmClientService) CallViewByHname(hContract, hFunction wasmtypes.ScHname, args []byte) ([]byte, error)

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 (svc *WasmClientService) PostRequest(chainID wasmtypes.ScChainID, hContract, hFunction wasmtypes.ScHname, args []byte, allowance *wasmlib.ScAssets, keyPair *iscclient.Keypair) (reqID wasmtypes.ScRequestID, err error)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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