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(ctx context.Context) (bool, error)
// Network information about this instance of the VM
Network(ctx context.Context) (uint32, ids.ID, ids.ID, error)
// Returns the VM genesis.
Genesis(ctx context.Context) (*chain.Genesis, error)
// Accepted fetches the ID of the last accepted block.
Accepted(ctx context.Context) (ids.ID, error)
// Returns if a space is already claimed
Claimed(ctx context.Context, space string) (bool, error)
// Returns the corresponding space information.
Info(ctx context.Context, space string) (*chain.SpaceInfo, []*chain.KeyValueMeta, error)
// Balance returns the balance of an account
Balance(ctx context.Context, addr common.Address) (bal uint64, err error)
// Resolve returns the value associated with a path
Resolve(ctx context.Context, path string) (exists bool, value []byte, valueMeta *chain.ValueMeta, err error)
// Requests the suggested price and cost from VM.
SuggestedRawFee(ctx context.Context) (uint64, uint64, error)
// Issues the transaction and returns the transaction ID.
IssueRawTx(ctx context.Context, d []byte) (ids.ID, error)
// Requests the suggested price and cost from VM, returns the input as
// TypedData.
SuggestedFee(ctx context.Context, i *chain.Input) (*tdata.TypedData, uint64, error)
// Issues a human-readable transaction and returns the transaction ID.
IssueTx(ctx context.Context, td *tdata.TypedData, sig []byte) (ids.ID, error)
// Checks the status of the transaction, and returns "true" if confirmed.
HasTx(ctx context.Context, 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(ctx context.Context) ([]*chain.Activity, error)
// All spaces owned by a given address
Owned(ctx context.Context, owner common.Address) ([]string, error)
}
Client defines spacesvm client operations.
Click to show internal directories.
Click to hide internal directories.