Documentation
¶
Index ¶
- Constants
- type WalletBackend
- func (c WalletBackend) AccountRewards(address gosmtypes.Address, offset uint32, maxResults uint32) ([]*apitypes.Reward, uint32, error)
- func (c WalletBackend) AccountRewardsStream(address gosmtypes.Address) (apitypes.GlobalStateService_AccountDataStreamClient, error)
- func (c WalletBackend) AccountState(address gosmtypes.Address) (*apitypes.Account, error)
- func (c WalletBackend) AccountTransactionsReceipts(address gosmtypes.Address, offset uint32, maxResults uint32) ([]*apitypes.TransactionReceipt, uint32, error)
- func (c WalletBackend) AccountUpdatesStream(address gosmtypes.Address) (apitypes.GlobalStateService_AccountDataStreamClient, error)
- func (c WalletBackend) Close() error
- func (w *WalletBackend) CloseWallet()
- func (c WalletBackend) Config() (*apitypes.PostConfigResponse, error)
- func (c WalletBackend) Connect() error
- func (w *WalletBackend) CreateAccount(displayName string) (la *common.LocalAccount, err error)
- func (w *WalletBackend) CurrentAccount() (*common.LocalAccount, error)
- func (c WalletBackend) DebugAllAccounts() ([]*apitypes.Account, error)
- func (c WalletBackend) Echo() error
- func (w *WalletBackend) GetAccount(accountName string) (*common.LocalAccount, error)
- func (c WalletBackend) GetMeshActivations(address gosmtypes.Address, offset uint32, maxResults uint32) ([]*apitypes.Activation, uint32, error)
- func (c WalletBackend) GetMeshInfo() (*common.NetInfo, error)
- func (c WalletBackend) GetMeshTransactions(address gosmtypes.Address, offset uint32, maxResults uint32) ([]*apitypes.MeshTransaction, uint32, error)
- func (c WalletBackend) GetPostComputeProviders(benchmark bool) ([]*apitypes.PostSetupComputeProvider, error)
- func (c WalletBackend) GetRewardsAddress() (*gosmtypes.Address, error)
- func (c WalletBackend) GetSmesherId() ([]byte, error)
- func (c WalletBackend) GlobalStateHash() (*apitypes.GlobalStateHash, error)
- func (w *WalletBackend) IsOpen() bool
- func (c WalletBackend) IsSmeshing() (*apitypes.IsSmeshingResponse, error)
- func (w *WalletBackend) ListAccounts() (res []string, err error)
- func (w *WalletBackend) NewWallet() bool
- func (c WalletBackend) NodeInfo() (*common.NodeInfo, error)
- func (c WalletBackend) NodeStatus() (*apitypes.NodeStatus, error)
- func (w *WalletBackend) OpenWallet() bool
- func (c WalletBackend) PostDataCreationProgressStream() (apitypes.SmesherService_PostSetupStatusStreamClient, error)
- func (c WalletBackend) PostStatus() (*apitypes.PostSetupStatusResponse, error)
- func (w *WalletBackend) PrintWalletMnemonic()
- func (c WalletBackend) ServerInfo() string
- func (w *WalletBackend) SetCurrentAccount(accountNumber int) error
- func (c WalletBackend) SetRewardsAddress(address gosmtypes.Address) (*status.Status, error)
- func (c WalletBackend) SmesherRewards(smesherId []byte, offset uint32, maxResults uint32) ([]*apitypes.Reward, uint32, error)
- func (c WalletBackend) StartSmeshing(request *apitypes.StartSmeshingRequest) (*status.Status, error)
- func (c WalletBackend) StopSmeshing(deleteFiles bool) (*status.Status, error)
- func (w *WalletBackend) StoreAccounts() error
- func (c WalletBackend) SubmitCoinTransaction(tx []byte) (*apitypes.TransactionState, error)
- func (c WalletBackend) TransactionState(txId []byte, includeTx bool) (*apitypes.TransactionState, *apitypes.Transaction, error)
- func (w *WalletBackend) Transfer(recipient gosmtypes.Address, nonce, amount, gasPrice, gasLimit uint64, ...) (*pb.TransactionState, error)
- func (w *WalletBackend) WalletInfo()
Constants ¶
const DefaultGRPCServer = "localhost:9092"
const DefaultSecureConnection = false
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WalletBackend ¶
type WalletBackend struct {
// contains filtered or unexported fields
}
WalletBackend wallet holder
func OpenConnection ¶
func OpenConnection(grpcServer string, secureConnection bool, wd string) (wbx *WalletBackend, err error)
OpenConnection opens a connection but not the wallet
func OpenWalletBackend ¶
func OpenWalletBackend(wallet string, grpcServer string, secureConnection bool) (wbx *WalletBackend, err error)
OpenWalletBackend opens an existing wallet
func (WalletBackend) AccountRewards ¶
func (c WalletBackend) AccountRewards(address gosmtypes.Address, offset uint32, maxResults uint32) ([]*apitypes.Reward, uint32, error)
AccountRewards returns rewards for an account
func (WalletBackend) AccountRewardsStream ¶
func (c WalletBackend) AccountRewardsStream(address gosmtypes.Address) (apitypes.GlobalStateService_AccountDataStreamClient, error)
AccountRewardsStream returns a stream of account rewards
func (WalletBackend) AccountState ¶
AccountState returns basic account data such as balance and nonce from the global state
func (WalletBackend) AccountTransactionsReceipts ¶
func (c WalletBackend) AccountTransactionsReceipts(address gosmtypes.Address, offset uint32, maxResults uint32) ([]*apitypes.TransactionReceipt, uint32, error)
AccountTransactionsReceipts returns transaction receipts for an account
func (WalletBackend) AccountUpdatesStream ¶
func (c WalletBackend) AccountUpdatesStream(address gosmtypes.Address) (apitypes.GlobalStateService_AccountDataStreamClient, error)
AccountUpdatesStream returns a stream of account changes
func (*WalletBackend) CloseWallet ¶
func (w *WalletBackend) CloseWallet()
func (WalletBackend) Config ¶ added in v0.1.30
func (c WalletBackend) Config() (*apitypes.PostConfigResponse, error)
Config returns the current smesher configuration
func (*WalletBackend) CreateAccount ¶
func (w *WalletBackend) CreateAccount(displayName string) (la *common.LocalAccount, err error)
func (*WalletBackend) CurrentAccount ¶
func (w *WalletBackend) CurrentAccount() (*common.LocalAccount, error)
CurrentAccount - get the latest account into cli-wallet format
func (WalletBackend) DebugAllAccounts ¶
func (WalletBackend) Echo ¶
func (c WalletBackend) Echo() error
Echo is a basic api sanity test. It verifies that the client can connect to the node service and get a response from it to an echo request. todo: change this to api health-check service as node service might not be available
func (*WalletBackend) GetAccount ¶
func (w *WalletBackend) GetAccount(accountName string) (*common.LocalAccount, error)
func (WalletBackend) GetMeshActivations ¶
func (c WalletBackend) GetMeshActivations(address gosmtypes.Address, offset uint32, maxResults uint32) ([]*apitypes.Activation, uint32, error)
GetMeshActivations returns activations where the address is the coinbase
func (WalletBackend) GetMeshInfo ¶
GetMeshInfo returns basic mesh data
func (WalletBackend) GetMeshTransactions ¶
func (c WalletBackend) GetMeshTransactions(address gosmtypes.Address, offset uint32, maxResults uint32) ([]*apitypes.MeshTransaction, uint32, error)
GetMeshTransactions returns the MeshTransactions on the mesh to or from an address.
func (WalletBackend) GetPostComputeProviders ¶
func (c WalletBackend) GetPostComputeProviders(benchmark bool) ([]*apitypes.PostSetupComputeProvider, error)
GetPostComputeProviders returns the proof of space generators available on the system
func (WalletBackend) GetRewardsAddress ¶
GetRewardsAddress get the smesher's current rewards address
func (WalletBackend) GetSmesherId ¶
GetSmesherId returns the current smesher id configured in the node
func (WalletBackend) GlobalStateHash ¶
func (c WalletBackend) GlobalStateHash() (*apitypes.GlobalStateHash, error)
GlobalStateHash returns the current global state hash
func (*WalletBackend) IsOpen ¶
func (w *WalletBackend) IsOpen() bool
func (WalletBackend) IsSmeshing ¶
func (c WalletBackend) IsSmeshing() (*apitypes.IsSmeshingResponse, error)
IsSmeshing returns true iff the node is currently setup to smesh
func (*WalletBackend) ListAccounts ¶
func (w *WalletBackend) ListAccounts() (res []string, err error)
func (*WalletBackend) NewWallet ¶
func (w *WalletBackend) NewWallet() bool
func (WalletBackend) NodeInfo ¶
NodeInfo returns static node info such as build, version and api server url
func (WalletBackend) NodeStatus ¶
func (c WalletBackend) NodeStatus() (*apitypes.NodeStatus, error)
NodeStatus returns dynamic node status such as sync status and number of connected peers
func (*WalletBackend) OpenWallet ¶
func (w *WalletBackend) OpenWallet() bool
OpenWallet opens a wallet from file
func (WalletBackend) PostDataCreationProgressStream ¶ added in v0.1.30
func (c WalletBackend) PostDataCreationProgressStream() (apitypes.SmesherService_PostSetupStatusStreamClient, error)
PostDataCreationProgressStream returns a stram client for post status updates
func (WalletBackend) PostStatus ¶ added in v0.1.30
func (c WalletBackend) PostStatus() (*apitypes.PostSetupStatusResponse, error)
PostStatus returns the current proof of space time status
func (*WalletBackend) PrintWalletMnemonic ¶ added in v0.1.29
func (w *WalletBackend) PrintWalletMnemonic()
func (WalletBackend) ServerInfo ¶
func (c WalletBackend) ServerInfo() string
ServerInfo returns basic api server and connection info
func (*WalletBackend) SetCurrentAccount ¶
func (w *WalletBackend) SetCurrentAccount(accountNumber int) error
func (WalletBackend) SetRewardsAddress ¶
SetRewardsAddress sets the smesher's rewards address
func (WalletBackend) SmesherRewards ¶
func (c WalletBackend) SmesherRewards(smesherId []byte, offset uint32, maxResults uint32) ([]*apitypes.Reward, uint32, error)
SmesherRewards returns rewards for a smesher identified by a smesher id
func (WalletBackend) StartSmeshing ¶
func (c WalletBackend) StartSmeshing(request *apitypes.StartSmeshingRequest) (*status.Status, error)
StartSmeshing instructs the node to start smeshing using user's provider params
func (WalletBackend) StopSmeshing ¶
StopSmeshing instructs the node to stop smeshing and optionally delete smeshing data file(s)
func (*WalletBackend) StoreAccounts ¶
func (w *WalletBackend) StoreAccounts() error
func (WalletBackend) SubmitCoinTransaction ¶
func (c WalletBackend) SubmitCoinTransaction(tx []byte) (*apitypes.TransactionState, error)
SubmitCoinTransaction submits a signed binary transaction to the node.
func (WalletBackend) TransactionState ¶
func (c WalletBackend) TransactionState(txId []byte, includeTx bool) (*apitypes.TransactionState, *apitypes.Transaction, error)
TransactionState returns the state and optionally the transaction for a single transaction based on tx id
func (*WalletBackend) Transfer ¶
func (w *WalletBackend) Transfer(recipient gosmtypes.Address, nonce, amount, gasPrice, gasLimit uint64, key ed25519.PrivateKey) (*pb.TransactionState, error)
Transfer creates a sign coin transaction and submits it
func (*WalletBackend) WalletInfo ¶
func (w *WalletBackend) WalletInfo()