wasmclient

package
v0.5.0-alpha.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HrpForClient = iotago.NetworkPrefix("")
)

Functions

func ClientBech32Decode

func ClientBech32Decode(bech32 string) wasmtypes.ScAddress

func ClientBech32Encode

func ClientBech32Encode(scAddress wasmtypes.ScAddress) string

func ClientHashName

func ClientHashName(name string) wasmtypes.ScHname

Types

type ContractEvent

type ContractEvent struct {
	ChainID    string
	ContractID string
	Data       string
}

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, nonce uint64) (wasmtypes.ScRequestID, error)
	SubscribeEvents(msg chan ContractEvent, done chan bool) error
	WaitUntilRequestProcessed(chainID wasmtypes.ScChainID, 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, chain string, scName string) *WasmClientContext

func (*WasmClientContext) CurrentChainID

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

func (*WasmClientContext) CurrentKeyPair added in v1.0.3

func (s *WasmClientContext) CurrentKeyPair() *cryptolib.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) 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 wasmlib.IEventHandlers) error

func (*WasmClientContext) ServiceContractName

func (s *WasmClientContext) ServiceContractName(contractName string)

func (*WasmClientContext) SignRequests

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

func (*WasmClientContext) Unregister

func (s *WasmClientContext) Unregister(handler wasmlib.IEventHandlers)

func (*WasmClientContext) WaitRequest

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

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, nonce uint64) (reqID wasmtypes.ScRequestID, err error)

func (*WasmClientService) SubscribeEvents

func (sc *WasmClientService) SubscribeEvents(msg chan ContractEvent, 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