Documentation ¶
Index ¶
- Variables
- func AddWallet(uid int) (*ljsonrpc.Wallet, error)
- func CreateAccount(UID int) (*ljsonrpc.Account, error)
- func CreateWallet(uid int) (*ljsonrpc.Wallet, error)
- func GetAccount(uid int) (*ljsonrpc.Account, error)
- func InitializeWallet(uid int) (string, error)
- func MakeAccountName(uid int) string
- func MakeWalletID(uid int) string
- func NewWalletError(uid int, err error) error
- func RemoveAccount(UID int) (*ljsonrpc.Account, error)
- func Resolve(url string) (*ljsonrpc.Claim, error)
- func WalletRemove(uid int) (*ljsonrpc.Wallet, error)
- type AccountConflict
- type AccountNotFound
- type WalletAlreadyLoaded
- type WalletError
- type WalletExists
- type WalletNeedsLoading
- type WalletNotFound
- type WalletNotLoaded
Constants ¶
This section is empty.
Variables ¶
var Client = ljsonrpc.NewClient(config.GetLbrynet())
Client is a LBRY SDK jsonrpc client instance
var ExampleStreamCreateRequest = `` /* 482-byte string literal not displayed */
var ExampleStreamCreateResponse = `` /* 4723-byte string literal not displayed */
var Logger = monitor.NewModuleLogger("lbrynet")
Functions ¶
func AddWallet ¶ added in v0.9.0
AddWallet loads an existing wallet in the SDK. May return errors:
WalletAlreadyLoaded - wallet is already loaded and operational WalletNotFound - wallet file does not exist and won't be loaded.
func CreateAccount ¶
CreateAccount creates a new account with the SDK. Will return an error if account with this UID already exists.
func CreateWallet ¶ added in v0.9.0
CreateWallet creates a new wallet with the SDK. Returned error doesn't necessarily mean that the wallet is not operational:
if errors.Is(err, lbrynet.WalletExists) { // Okay to proceed with the account } if errors.Is(err, lbrynet.WalletNeedsLoading) { // AddWallet() needs to be called before the wallet can be used }
func GetAccount ¶
GetAccount finds account in account_list by UID
func InitializeWallet ¶ added in v0.9.0
InitializeWallet creates a wallet that can be immediately used in subsequent commands. It can recover from errors like existing wallets, but if a wallet is known to exist (eg. a wallet ID stored in the database already), AddWallet should be called instead.
func MakeAccountName ¶
MakeAccountName formats user ID to use as an SDK account name.
func MakeWalletID ¶ added in v0.9.0
MakeWalletID formats user ID to use as an SDK wallet ID.
func NewWalletError ¶ added in v0.9.0
NewWalletError converts plain SDK error to the typed one
func RemoveAccount ¶
RemoveAccount removes an account from the SDK by uid
Types ¶
type AccountConflict ¶
func (AccountConflict) Error ¶
func (e AccountConflict) Error() string
type AccountNotFound ¶
func (AccountNotFound) Error ¶
func (e AccountNotFound) Error() string
type WalletAlreadyLoaded ¶ added in v0.9.0
type WalletAlreadyLoaded struct {
WalletError
}
func (WalletAlreadyLoaded) Error ¶ added in v0.9.0
func (e WalletAlreadyLoaded) Error() string
type WalletError ¶ added in v0.9.0
func (WalletError) Error ¶ added in v0.9.0
func (e WalletError) Error() string
func (WalletError) Unwrap ¶ added in v0.9.0
func (e WalletError) Unwrap() error
type WalletExists ¶ added in v0.9.0
type WalletExists struct {
WalletError
}
func (WalletExists) Error ¶ added in v0.9.0
func (e WalletExists) Error() string
type WalletNeedsLoading ¶ added in v0.9.0
type WalletNeedsLoading struct {
WalletError
}
func (WalletNeedsLoading) Error ¶ added in v0.9.0
func (e WalletNeedsLoading) Error() string
type WalletNotFound ¶ added in v0.9.0
type WalletNotFound struct {
WalletError
}
type WalletNotLoaded ¶ added in v0.9.0
type WalletNotLoaded struct {
WalletError
}
func (WalletNotLoaded) Error ¶ added in v0.9.0
func (e WalletNotLoaded) Error() string