Documentation
¶
Overview ¶
Package fairy provides a Go client for Neo Fairy RPC.
Index ¶
- Constants
- type Client
- func (c *Client) DeleteSession(sessionID string) error
- func (c *Client) FundTEEAccount(sessionID, teeAccountHash string, gasAmount int64) error
- func (c *Client) HelloFairy() (map[string]interface{}, error)
- func (c *Client) InvokeFunctionWithSession(sessionID string, writeSnapshot bool, contractAddress, method string, ...) (*chain.InvokeResult, error)
- func (c *Client) IsAvailable() bool
- func (c *Client) NewSession() (string, error)
- func (c *Client) SetGasBalance(sessionID, account string, balance int64) error
- func (c *Client) SetTime(sessionID string, timestamp uint64) error
- func (c *Client) SetupSessionWithGas(gasAmount int64) (sessionID, accountHash string, err error)
- func (c *Client) VirtualDeploy(sessionID, nefPath, manifestPath string) (*VirtualDeployResult, error)
- type VirtualDeployResult
Constants ¶
const ( DefaultRPCURL = "http://127.0.0.1:16868" DefaultTimeout = 30 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Neo Fairy RPC client.
func (*Client) DeleteSession ¶
DeleteSession deletes a session.
func (*Client) FundTEEAccount ¶
FundTEEAccount funds a TEE account with GAS in the session. teeAccount is the script hash of the TEE account.
func (*Client) HelloFairy ¶
HelloFairy tests connectivity to Fairy.
func (*Client) InvokeFunctionWithSession ¶
func (c *Client) InvokeFunctionWithSession(sessionID string, writeSnapshot bool, contractAddress, method string, args []interface{}) (*chain.InvokeResult, error)
InvokeFunctionWithSession invokes a contract method in a session.
func (*Client) IsAvailable ¶
IsAvailable checks if Fairy is available.
func (*Client) NewSession ¶
NewSession creates a new testing session.
func (*Client) SetGasBalance ¶
SetGasBalance sets GAS balance for an account in a session.
func (*Client) SetupSessionWithGas ¶
SetupSessionWithGas creates a session and funds the wallet with GAS. Reads NEO_TESTNET_WIF from environment.
func (*Client) VirtualDeploy ¶
func (c *Client) VirtualDeploy(sessionID, nefPath, manifestPath string) (*VirtualDeployResult, error)
VirtualDeploy deploys a contract virtually in a session.
type VirtualDeployResult ¶
type VirtualDeployResult struct {
ContractAddress string `json:"contracthash"`
GasConsumed string `json:"gasconsumed"`
State string `json:"state"`
}
VirtualDeployResult represents the result of VirtualDeploy.