wallet

package
v0.0.0-...-bc7c564 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLocked = errors.New("Wallet is locked")
)

Functions

This section is empty.

Types

type Account

type Account struct {
	*Public
	Name   string
	CanUse bool `json:"can_use"`
}

type Key

type Key struct {
	// contains filtered or unexported fields
}

func NewKey

func NewKey(encrypted []byte) *Key

func (*Key) Empty

func (k *Key) Empty() bool

func (*Key) GetEncryptedHex

func (k *Key) GetEncryptedHex() string

func (*Key) Lock

func (k *Key) Lock()

func (*Key) Unlock

func (k *Key) Unlock(passphrase []byte) error

func (*Key) Update

func (k *Key) Update(encrypted []byte)

func (*Key) With

func (k *Key) With(fn func(*crypto.Key) error) error

type Operation

type Operation struct {
	Account        uint32  `json:"account"`
	Amount         float64 `json:"amount"`
	Block          uint32  `json:"block"`
	Dest_account   uint32  `json:"dest_account"`
	Fee            float64 `json:"fee"`
	Opblock        uint32  `json:"opblock"`
	Ophash         string  `json:"ophash"`
	Optxt          *string `json:"optxt"`
	Optype         uint8   `json:"optype"`
	Payload        string  `json:"payload"`
	Sender_account uint32  `json:"sender_account"`
	Time           uint32  `json:"time"`
}

type Public

type Public struct {
	TypeID    uint16 `json:"ec_nid"`
	X         string `json:"x"`
	Y         string `json:"y"`
	EncPubkey string `json:"enc_pubkey"`
	B58Pubkey string `json:"b58_pubkey"`
}

type SecureBuffer

type SecureBuffer struct {
	Data      []byte
	Encrypted bool
}

func NewSecureBuffer

func NewSecureBuffer(data []byte) SecureBuffer

func (*SecureBuffer) With

func (s *SecureBuffer) With(fn func(data []byte))

type Storage

type Storage struct {
	PrivateKey string `json:"private"`
}

type Wallet

type Wallet struct {
	// contains filtered or unexported fields
}

func NewWallet

func NewWallet(contents []byte, passphrase []byte, write func([]byte) error, coreRPCAddress string) (*Wallet, error)

func (*Wallet) ChangeKey

func (w *Wallet) ChangeKey(_ context.Context, params *struct {
	Account        uint32
	New_enc_pubkey string
	New_b58_pubkey string
	Fee            float64
	Payload        string
	Payload_method string
}) (*Operation, error)

func (*Wallet) Close

func (w *Wallet) Close() error

func (*Wallet) CreateWallet

func (w *Wallet) CreateWallet(_ context.Context, params *struct {
	Password       string
	AllowOverwrite bool
}) (bool, error)

func (*Wallet) GetHandlers

func (w *Wallet) GetHandlers() map[string]interface{}

func (*Wallet) GetPrivateKeyEncrypted

func (w *Wallet) GetPrivateKeyEncrypted(context.Context, *struct{}) (encryptedHex string, err error)

func (*Wallet) GetWalletAccounts

func (w *Wallet) GetWalletAccounts(context.Context, *struct{}) ([]Account, error)

func (*Wallet) GetWalletAccountsCount

func (w *Wallet) GetWalletAccountsCount(context.Context, *struct{}) (uint, error)

func (*Wallet) GetWalletPubKey

func (w *Wallet) GetWalletPubKey(context.Context, *struct{}) (*Public, error)

func (*Wallet) GetWalletPubKeys

func (w *Wallet) GetWalletPubKeys(context.Context, *struct{}) ([]*Public, error)

func (*Wallet) PayloadDecrypt

func (w *Wallet) PayloadDecrypt(_ context.Context, params *struct {
	Payload string
	Pwds    []string
}) (string, error)

func (*Wallet) PayloadEncrypt

func (w *Wallet) PayloadEncrypt(_ context.Context, params *struct {
	Payload        string
	Payload_method string
	B58_pubkey     string
	Enc_pubkey     string
}) (result string, err error)

func (*Wallet) SendTo

func (w *Wallet) SendTo(_ context.Context, params *struct {
	Sender         uint32
	Target         uint32
	Amount         float64
	Fee            float64
	Payload        string
	Payload_method string
}) (*Operation, error)

func (*Wallet) SetPrivateKey

func (w *Wallet) SetPrivateKey(_ context.Context, params *struct {
	EncryptedHex   string
	AllowOverwrite bool
}) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL