Documentation ¶
Index ¶
- Variables
- func ParseUint64(s string) (uint64, error)
- type Address
- type CardanoCli
- type Client
- func (c *Client) Close()
- func (c *Client) CreateWallet(name, password string) (*Wallet, string, error)
- func (c *Client) DeleteWallet(id string) error
- func (c *Client) RestoreWallet(name, password, mnemonic string) (*Wallet, error)
- func (c *Client) SaveWallet(w *Wallet) error
- func (c *Client) Wallet(id string) (*Wallet, error)
- func (c *Client) Wallets() ([]*Wallet, error)
- type DB
- type Network
- type NodeTip
- type Options
- type RpcNode
- type Utxo
- type Wallet
- func (w *Wallet) AddAddress() Address
- func (w *Wallet) AddressIndex(idx int) (Address, error)
- func (w *Wallet) Addresses() []Address
- func (w *Wallet) Balance() (uint64, error)
- func (w *Wallet) GenAddress(idx int) (addr Address, pri string, err error)
- func (w *Wallet) SetKey(key string) error
- func (w *Wallet) SetNetwork(net Network)
- func (w *Wallet) SetUtxos(utxos []Utxo)
- func (w *Wallet) Transfer(receiver Address, amount uint64, changeAddress Address) (tx *transaction, err error)
Constants ¶
This section is empty.
Variables ¶
var NewEntropy = func(bitSize int) []byte {
entropy, _ := bip39.NewEntropy(bitSize)
return entropy
}
Functions ¶
func ParseUint64 ¶
Types ¶
type Address ¶
type Address string
Address is the bech32 representation of a cardano address
func Bech32ToAddress ¶
Bech32ToAddress creates an Address from a bech32 encoded string.
func BytesToAddress ¶
BytesToAddress creates an Address from a byte slice.
type CardanoCli ¶ added in v1.0.2
type CardanoCli struct {
SocketPath string
}
func (*CardanoCli) QueryTip ¶ added in v1.0.2
func (cli *CardanoCli) QueryTip() (NodeTip, error)
TODO: add ability to use mainnet and testnet
func (*CardanoCli) QueryUtxos ¶ added in v1.0.2
func (cli *CardanoCli) QueryUtxos(address Address) ([]Utxo, error)
TODO: add ability to use mainnet and testnet
func (*CardanoCli) SubmitTx ¶ added in v1.0.2
func (cli *CardanoCli) SubmitTx(tx transaction) error
TODO: add ability to use mainnet and testnet
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a clean interface for creating, saving and deleting Wallets.
func NewClient ¶
NewClient builds a new Client using cardano-cli as the default connection to the Blockhain.
It uses BadgerDB as the default Wallet storage.
func (*Client) CreateWallet ¶
CreateWallet creates a new Wallet using a secure entropy and password, returning a Wallet with its corresponding 24 word mnemonic
func (*Client) DeleteWallet ¶
DeleteWallet removes a Wallet with the given id from the Client's storage.
func (*Client) RestoreWallet ¶
RestoreWallet restores a Wallet from a mnemonic and password.
func (*Client) SaveWallet ¶
SaveWallet saves a Wallet in the Client's storage.
type Options ¶
type Options interface {
// contains filtered or unexported methods
}
func WithSocket ¶
type Wallet ¶
type Wallet struct { ID string Name string Keys map[string]crypto.ExtendedSigningKey Skeys []crypto.ExtendedSigningKey Utxos []Utxo Tip NodeTip // contains filtered or unexported fields }
func (*Wallet) AddAddress ¶
AddAddress generates a new payment address and adds it to the wallet.