wallet

package
Version: v0.14.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenHeader = "X-Lbry-Auth-Token"
)

TokenHeader is the name of HTTP header which is supplied by client and should contain internal-api auth_token.

Variables

This section is empty.

Functions

func Create

func Create(serverAddress string, userID int) error

Create creates a wallet on an sdk 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), loadWallet() should be called instead.

func DisableLogger

func DisableLogger()

func GetDBUserG added in v0.14.3

func GetDBUserG(id int) (*models.User, error)

GetDBUserG returns a database user with LbrynetServer selected, using the global executor.

func GetUserWithSDKServer added in v0.13.5

func GetUserWithSDKServer(rt *sdkrouter.Router, internalAPIHost, token, metaRemoteIP string) (*models.User, error)

GetUserWithWallet gets user by internal-apis auth token. If the user does not have a wallet yet, they are assigned an SDK and a wallet is created for them on that SDK.

func LoadWallet added in v0.13.7

func LoadWallet(addr string, userID int) error

loadWallet loads an existing wallet in the LbrynetServer. May return errors:

WalletAlreadyLoaded - wallet is already loaded and operational
WalletNotFound - wallet file does not exist and won't be loaded.

func UnloadWallet

func UnloadWallet(addr string, userID int) error

UnloadWallet unloads an existing wallet from the LbrynetServer. May return errors:

WalletAlreadyLoaded - wallet is already loaded and operational
WalletNotFound - wallet file does not exist and won't be loaded.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL