Documentation ¶
Index ¶
- type Client
- func (c *Client) CallView(hContract iscp.Hname, functionName string, args dict.Dict, ...) (dict.Dict, error)
- func (c *Client) CheckRequestResult(reqID iscp.RequestID) error
- func (c *Client) DepositFunds(n uint64) (*ledgerstate.Transaction, error)
- func (c *Client) GetChainRecord() (*registry.ChainRecord, error)
- func (c *Client) Post1Request(contractHname iscp.Hname, entryPoint iscp.Hname, params ...PostRequestParams) (*ledgerstate.Transaction, error)
- func (c *Client) PostOffLedgerRequest(contractHname iscp.Hname, entrypoint iscp.Hname, params ...PostRequestParams) (*request.OffLedger, error)
- func (c *Client) StateGet(key string) ([]byte, error)
- func (c *Client) UploadBlob(fields dict.Dict) (hashing.HashValue, *request.OffLedger, error)
- type PostRequestParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { GoshimmerClient *goshimmer.Client WaspClient *client.WaspClient ChainID *iscp.ChainID KeyPair *ed25519.KeyPair // contains filtered or unexported fields }
Client allows to interact with a specific chain in the node, for example to send on-ledger or off-ledger requests
func New ¶
func New( goshimmerClient *goshimmer.Client, waspClient *client.WaspClient, chainID *iscp.ChainID, keyPair *ed25519.KeyPair, ) *Client
New creates a new chainclient.Client
func (*Client) CallView ¶
func (c *Client) CallView(hContract iscp.Hname, functionName string, args dict.Dict, optimisticReadTimeout ...time.Duration) (dict.Dict, error)
CallView sends a request to call a view function of a given contract, and returns the result of the call
func (*Client) CheckRequestResult ¶ added in v0.2.0
CheckRequestResult fetches the receipt for the given request ID, and returns an error indicating whether the request was processed successfully.
func (*Client) DepositFunds ¶ added in v0.2.0
func (c *Client) DepositFunds(n uint64) (*ledgerstate.Transaction, error)
func (*Client) GetChainRecord ¶
func (c *Client) GetChainRecord() (*registry.ChainRecord, error)
GetChainRecord fetches the chain's Record
func (*Client) Post1Request ¶ added in v0.2.0
func (c *Client) Post1Request( contractHname iscp.Hname, entryPoint iscp.Hname, params ...PostRequestParams, ) (*ledgerstate.Transaction, error)
Post1Request sends an on-ledger transaction with one request on it to the chain
func (*Client) PostOffLedgerRequest ¶ added in v0.2.0
func (c *Client) PostOffLedgerRequest( contractHname iscp.Hname, entrypoint iscp.Hname, params ...PostRequestParams, ) (*request.OffLedger, error)
PostOffLedgerRequest sends an off-ledger tx via the wasp node web api
type PostRequestParams ¶
type PostRequestParams struct { Transfer colored.Balances Args requestargs.RequestArgs Nonce uint64 }
func NewPostRequestParams ¶ added in v0.2.0
func NewPostRequestParams(p ...interface{}) *PostRequestParams
NewPostRequestParams simplifies encoding of request parameters
func (*PostRequestParams) WithIotas ¶ added in v0.2.0
func (par *PostRequestParams) WithIotas(i uint64) *PostRequestParams
func (*PostRequestParams) WithTransfer ¶ added in v0.2.0
func (par *PostRequestParams) WithTransfer(transfer colored.Balances) *PostRequestParams
func (*PostRequestParams) WithTransferEncoded ¶ added in v0.2.0
func (par *PostRequestParams) WithTransferEncoded(colval ...interface{}) *PostRequestParams