Documentation
¶
Index ¶
- Constants
- type DEXClient
- func (dc *DEXClient) AddWallet(assetID uint32, settings map[string]string, appPW, walletPW []byte) error
- func (dc *DEXClient) BondsFeeBuffer(assetID uint32) uint64
- func (dc *DEXClient) DBPath() string
- func (dc *DEXClient) HasWallet(assetID int32) bool
- func (dc *DEXClient) InitWithPassword(pw []byte, seed []byte) error
- func (dc *DEXClient) InitializedWithPassword() bool
- func (dc *DEXClient) IsInitialized() bool
- func (dc *DEXClient) IsLoggedIn() bool
- func (dc *DEXClient) Login(pw []byte) error
- func (dc *DEXClient) Shutdown()
- func (dc *DEXClient) WaitForShutdown() <-chan struct{}
- func (dc *DEXClient) WalletIDForAsset(assetID uint32) (*int, error)
Constants ¶
const ( // CustomDexWalletType is a keyword that identifies a custom Cryptopower // wallet used by the DEX client. CustomDexWalletType = "cryptopowerwallet" // WalletIDConfigKey is the key that holds the wallet ID value in the // settings map used to connect an existing Cryptopower wallet to the DEX // client. WalletIDConfigKey = "walletid" // WalletAccountNumberConfigKey is the key that holds the wallet account // number in the settings map used to connect an existing Cryptopower wallet // to the DEX client. WalletAccountNumberConfigKey = "accountnumber" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DEXClient ¶
DEXClient represents the Decred DEX client and embeds *core.Core.
func Start ¶
func Start(ctx context.Context, root, lang, logDir, logLvl string, net libutils.NetworkType, maxLogZips int) (*DEXClient, error)
Start prepares and starts the DEX client.
NOTE: "lang" will be changed to the default language (en) if the the DEX client does not have support for it.
func (*DEXClient) AddWallet ¶
func (dc *DEXClient) AddWallet(assetID uint32, settings map[string]string, appPW, walletPW []byte) error
AddWallet attempts to connect or create the wallet with the provided details to the DEX client. NOTE: Before connecting a dcr wallet, dcr ExchangeWallet must have been configured to use a custom wallet. See: libwallet.AssetManager.PrepareDexSupportForDcrWallet() and libwallet.AssetManager.prepareDexSupportForBTCCloneWallets.
func (*DEXClient) BondsFeeBuffer ¶
BondsFeeBuffer is a caching helper for the bonds fee buffer to assist the frontend by stabilizing this value for up to 45 minutes from the last request for a given asset and because (*Core).BondsFeeBuffer returns a fresh fee buffer based on a current (but padded) fee rate estimate. Values for a given asset are cached for 45 minutes. These values are meant to provide a sensible but well-padded fee buffer for bond transactions now and well into the future, so a long expiry is appropriate.
func (*DEXClient) HasWallet ¶
HasWallet is true if a wallet has been added to the DEX client for the specified asset.
func (*DEXClient) InitWithPassword ¶
func (*DEXClient) InitializedWithPassword ¶
func (*DEXClient) IsInitialized ¶
func (*DEXClient) IsLoggedIn ¶
func (*DEXClient) WaitForShutdown ¶
func (dc *DEXClient) WaitForShutdown() <-chan struct{}
WaitForShutdown returns a chan that will be closed if core exits.