Documentation
¶
Overview ¶
Package client implements "spacesvm" client SDK.
Index ¶
- Variables
- func PPActivity(a []*chain.Activity) error
- func PPInfo(info *chain.SpaceInfo)
- func SignIssueRawTx(ctx context.Context, cli Client, utx chain.UnsignedTransaction, ...) (txID ids.ID, cost uint64, err error)
- func SignIssueTx(ctx context.Context, cli Client, input *chain.Input, priv *ecdsa.PrivateKey, ...) (txID ids.ID, cost uint64, err error)
- type Client
- type Op
- type OpOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIntegrityFailure = errors.New("received file that does not match hash")
Functions ¶
func PPActivity ¶
func SignIssueRawTx ¶
func SignIssueRawTx( ctx context.Context, cli Client, utx chain.UnsignedTransaction, priv *ecdsa.PrivateKey, opts ...OpOption, ) (txID ids.ID, cost uint64, err error)
Signs and issues the transaction (local construction).
Types ¶
type Client ¶
type Client interface {
// Pings the VM.
Ping() (bool, error)
// Network information about this instance of the VM
Network() (uint32, ids.ID, ids.ID, error)
// Returns the VM genesis.
Genesis() (*chain.Genesis, error)
// Accepted fetches the ID of the last accepted block.
Accepted() (ids.ID, error)
// Returns if a space is already claimed
Claimed(space string) (bool, error)
// Returns the corresponding space information.
Info(space string) (*chain.SpaceInfo, []*chain.KeyValueMeta, error)
// Balance returns the balance of an account
Balance(addr common.Address) (bal uint64, err error)
// Resolve returns the value associated with a path
Resolve(path string) (exists bool, value []byte, valueMeta *chain.ValueMeta, err error)
// Requests the suggested price and cost from VM.
SuggestedRawFee() (uint64, uint64, error)
// Issues the transaction and returns the transaction ID.
IssueRawTx(d []byte) (ids.ID, error)
// Requests the suggested price and cost from VM, returns the input as
// TypedData.
SuggestedFee(i *chain.Input) (*tdata.TypedData, uint64, error)
// Issues a human-readable transaction and returns the transaction ID.
IssueTx(td *tdata.TypedData, sig []byte) (ids.ID, error)
// Checks the status of the transaction, and returns "true" if confirmed.
HasTx(id ids.ID) (bool, error)
// Polls the transactions until its status is confirmed.
PollTx(ctx context.Context, txID ids.ID) (confirmed bool, err error)
// Recent actions on the network (sorted from recent to oldest)
RecentActivity() ([]*chain.Activity, error)
// All spaces owned by a given address
Owned(owner common.Address) ([]string, error)
}
Client defines spacesvm client operations.
Click to show internal directories.
Click to hide internal directories.