Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateMnemonic() (string, error)
- func Init(walletConfig Config) error
- func Initialized() bool
- func UpdateConfig(walletConfig Config)
- type AuthHandler
- type Config
- type Credentials
- type Json
- type Notification
- type Session
- type Subaccount
- type TransactionNotification
- type Wallet
- func (wallet *Wallet) Connect() error
- func (wallet *Wallet) CurrentSubaccount() (uint64, error)
- func (wallet *Wallet) Disconnect() error
- func (wallet *Wallet) GetBalance() (*onchain.Balance, error)
- func (wallet *Wallet) GetOutputs(address string) ([]*onchain.Output, error)
- func (wallet *Wallet) GetSendFee(address string, amount uint64, satPerVbyte float64, sendAll bool) (send uint64, fee uint64, err error)
- func (wallet *Wallet) GetSubaccount(pointer uint64) (*Subaccount, error)
- func (wallet *Wallet) GetSubaccountBalance(subaccount uint64) (*onchain.Balance, error)
- func (wallet *Wallet) GetSubaccounts(refresh bool) ([]*Subaccount, error)
- func (wallet *Wallet) GetTransactions(limit, offset uint64) ([]*onchain.WalletTransaction, error)
- func (wallet *Wallet) GetWalletInfo() onchain.WalletInfo
- func (wallet *Wallet) NewAddress() (string, error)
- func (wallet *Wallet) Ready() bool
- func (wallet *Wallet) SendToAddress(address string, amount uint64, satPerVbyte float64, sendAll bool) (tx string, err error)
- func (wallet *Wallet) SetSpentOutputs(outputs []string)
- func (wallet *Wallet) SetSubaccount(subaccount *uint64) (*uint64, error)
- func (wallet *Wallet) SetTxProvider(txProvider onchain.TxProvider)
Constants ¶
View Source
const DefaultAutoConsolidateThreshold = uint64(200)
View Source
const GapLimit = 100
View Source
const MaxInputs = uint64(255) // TODO: change back to 256 when gdk is fixed
View Source
const MinFeeRate = 0.01
Variables ¶
View Source
var ErrSubAccountNotSet = errors.New("subaccount not set")
View Source
var TransactionNotifier = utils.ForwardChannel(make(chan TransactionNotification), 0, false)
Functions ¶
func GenerateMnemonic ¶
func Initialized ¶
func Initialized() bool
func UpdateConfig ¶
func UpdateConfig(walletConfig Config)
Types ¶
type AuthHandler ¶
type AuthHandler = *C.struct_GA_auth_handler
type Config ¶
type Credentials ¶
type Credentials struct { onchain.WalletInfo Mnemonic string `json:"mnemonic"` Subaccount *uint64 `json:"subaccount"` Xpub string `json:"xpub"` CoreDescriptor string `json:"core_descriptor"` Salt string }
func (*Credentials) Decrypt ¶
func (c *Credentials) Decrypt(password string) (*Credentials, error)
func (*Credentials) Encrypt ¶
func (c *Credentials) Encrypt(password string) (*Credentials, error)
func (*Credentials) Encrypted ¶
func (c *Credentials) Encrypted() bool
type Notification ¶
type Notification string
type Session ¶
type Session = *C.struct_GA_session
type Subaccount ¶
type TransactionNotification ¶
type Wallet ¶
type Wallet struct { onchain.WalletInfo // contains filtered or unexported fields }
func Login ¶
func Login(credentials *Credentials) (*Wallet, error)
func (*Wallet) CurrentSubaccount ¶
func (*Wallet) Disconnect ¶
func (*Wallet) GetOutputs ¶
func (*Wallet) GetSendFee ¶
func (*Wallet) GetSubaccount ¶
func (wallet *Wallet) GetSubaccount(pointer uint64) (*Subaccount, error)
func (*Wallet) GetSubaccountBalance ¶
func (*Wallet) GetSubaccounts ¶
func (wallet *Wallet) GetSubaccounts(refresh bool) ([]*Subaccount, error)
func (*Wallet) GetTransactions ¶
func (wallet *Wallet) GetTransactions(limit, offset uint64) ([]*onchain.WalletTransaction, error)
func (*Wallet) GetWalletInfo ¶
func (wallet *Wallet) GetWalletInfo() onchain.WalletInfo
func (*Wallet) NewAddress ¶
func (*Wallet) SendToAddress ¶
func (*Wallet) SetSpentOutputs ¶
func (*Wallet) SetSubaccount ¶
func (*Wallet) SetTxProvider ¶
func (wallet *Wallet) SetTxProvider(txProvider onchain.TxProvider)
Click to show internal directories.
Click to hide internal directories.