Documentation ¶
Index ¶
- Constants
- Variables
- func NewRandomKey() (*keystore.Key, error)
- func NewRandomMnemonic() (string, error)
- func Sign(msg []byte, privKey *ecdsa.PrivateKey) (sig []byte, err error)
- func SignMessage(msg []byte, privKey *ecdsa.PrivateKey) (sig []byte, err error)
- func Verify(msg, sig []byte) (*ecdsa.PublicKey, error)
- type Manager
- func (m *Manager) AddWallet(key *keystore.Key, auth string) (*Wallet, error)
- func (m *Manager) DbSize() (int64, int64)
- func (m *Manager) Exists(ctx context.Context, address common.Address) error
- func (m *Manager) GetAllAddresses() ([]common.Address, error)
- func (m *Manager) GetWallet(address common.Address, auth string) (*Wallet, error)
- func (m *Manager) Shutdown()
- type Wallet
- func (w *Wallet) Address() common.Address
- func (w *Wallet) Deserialize(data []byte) error
- func (w *Wallet) EncryptKey() error
- func (w *Wallet) GetKey() *keystore.Key
- func (w *Wallet) Open() error
- func (w *Wallet) Serialize() ([]byte, error)
- func (w *Wallet) SignTx(tx *types.Transaction) (*types.Transaction, error)
- func (w *Wallet) Status() string
Constants ¶
View Source
const ( WalletStatusLocked = "Locked" WalletStatusUnlocked = "Unlocked" )
View Source
const DbWalletFile = "wallets.db"
Variables ¶
Functions ¶
func NewRandomKey ¶
func NewRandomMnemonic ¶
func SignMessage ¶
func SignMessage(msg []byte, privKey *ecdsa.PrivateKey) (sig []byte, err error)
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
type Wallet ¶
type Wallet struct { Auth string `json:"auth" yaml:"auth"` KeyData []byte `json:"-" yaml:"-"` // stores encrypted key // contains filtered or unexported fields }
func (*Wallet) Deserialize ¶
func (*Wallet) EncryptKey ¶
func (*Wallet) SignTx ¶
func (w *Wallet) SignTx(tx *types.Transaction) (*types.Transaction, error)
Click to show internal directories.
Click to hide internal directories.