client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0, BSD-2-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WaspClient

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

WaspClient allows to make requests to the Wasp web API.

func NewWaspClient

func NewWaspClient(baseURL string, httpClient ...http.Client) *WaspClient

NewWaspClient returns a new *WaspClient with the given baseURL and httpClient.

func (*WaspClient) ActivateChain

func (c *WaspClient) ActivateChain(chainid coretypes.ChainID) error

ActivateChain sends a request to activate a chain in the wasp node

func (*WaspClient) BaseURL

func (c *WaspClient) BaseURL() string

BaseURL returns the baseURL of the client.

func (*WaspClient) CallView

func (c *WaspClient) CallView(contractID coretypes.ContractID, fname string, arguments dict.Dict) (dict.Dict, error)

CallView sends a request to call a view function of a given contract, and returns the result of the call

func (*WaspClient) DKSharesGet

func (c *WaspClient) DKSharesGet(sharedAddress *address.Address) (*model.DKSharesInfo, error)

DKSharesGet retrieves the representation of an existing DKShare.

func (*WaspClient) DKSharesPost

func (c *WaspClient) DKSharesPost(request *model.DKSharesPostRequest) (*model.DKSharesInfo, error)

DKSharesPost creates a new DKShare and returns its state.

func (*WaspClient) DeactivateChain

func (c *WaspClient) DeactivateChain(chainid coretypes.ChainID) error

DeactivateChain sends a request to deactivate a chain in the wasp node

func (*WaspClient) DumpSCState

func (c *WaspClient) DumpSCState(scid *coretypes.ContractID) (*model.SCStateDump, error)

func (*WaspClient) GetBlob

func (c *WaspClient) GetBlob(hash hashing.HashValue) ([]byte, error)

GetBlob fetches a blob by its hash

func (*WaspClient) GetChainRecord

func (c *WaspClient) GetChainRecord(chainid coretypes.ChainID) (*registry.ChainRecord, error)

GetChainRecord fetches a ChainRecord by address

func (*WaspClient) GetChainRecordList

func (c *WaspClient) GetChainRecordList() ([]*registry.ChainRecord, error)

GetChainRecordList fetches the list of all chains in the node

func (*WaspClient) HasBlob

func (c *WaspClient) HasBlob(hash hashing.HashValue) (bool, error)

HasBlob returns whether or not a blob exists

func (*WaspClient) Info

func (c *WaspClient) Info() (*model.InfoResponse, error)

Info fetches general information about the node.

func (*WaspClient) PutBlob

func (c *WaspClient) PutBlob(data []byte) (hashing.HashValue, error)

PutBlob uploads a blob to the registry

func (*WaspClient) PutChainRecord

func (c *WaspClient) PutChainRecord(bd *registry.ChainRecord) error

PutChainRecord sends a request to write a ChainRecord

func (*WaspClient) RequestStatus

func (c *WaspClient) RequestStatus(chainId *coretypes.ChainID, reqId *coretypes.RequestID) (*model.RequestStatusResponse, error)

RequestStatus fetches the processing status of a request.

func (*WaspClient) Shutdown

func (c *WaspClient) Shutdown() error

Shutdown shuts down the node

func (*WaspClient) WaitUntilAllRequestsProcessed

func (c *WaspClient) WaitUntilAllRequestsProcessed(tx *sctransaction.Transaction, timeout time.Duration) error

WaitUntilAllRequestsProcessed blocks until all requests in the given transaction have been processed by the node

func (*WaspClient) WaitUntilRequestProcessed

func (c *WaspClient) WaitUntilRequestProcessed(chainId *coretypes.ChainID, reqId *coretypes.RequestID, timeout time.Duration) error

WaitUntilRequestProcessed blocks until the request has been processed by the node

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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