wallet

package
v0.0.0-...-9c37315 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BalanceEth

func BalanceEth(balance float64) *big.Int

func BalanceHuman

func BalanceHuman(balance *big.Int) float64

Types

type Wallet

type Wallet struct {
	SavePath        string
	RemoteEthServer string
	// contains filtered or unexported fields
}

func (*Wallet) AccountString

func (w *Wallet) AccountString() string

func (*Wallet) Address

func (w *Wallet) Address() common.Address

func (*Wallet) AesKey

func (w *Wallet) AesKey(peerPub ed25519.PublicKey) (key []byte, err error)

func (*Wallet) AesKey2

func (w *Wallet) AesKey2(peerId account.BeatleAddress) (key []byte, err error)

func (*Wallet) BalanceOf

func (w *Wallet) BalanceOf(force bool) (float64, error)

func (*Wallet) BalanceOfGas

func (w *Wallet) BalanceOfGas(accPoint string) (float64, error)

func (*Wallet) BtlAddress

func (w *Wallet) BtlAddress() account.BeatleAddress

func (*Wallet) BtlPeerDecrypt

func (w *Wallet) BtlPeerDecrypt(peerPub ed25519.PublicKey, cipherBytes []byte) (plainBytes []byte, err error)

func (*Wallet) BtlPeerDecrypt2

func (w *Wallet) BtlPeerDecrypt2(peerId account.BeatleAddress, cipherBytes []byte) (plainBytes []byte, err error)

func (*Wallet) BtlPeerEncrypt

func (w *Wallet) BtlPeerEncrypt(peerPub ed25519.PublicKey, plainBytes []byte) (cipherBytes []byte, err error)

func (*Wallet) BtlPeerEncrypt2

func (w *Wallet) BtlPeerEncrypt2(peerId account.BeatleAddress, plainBytes []byte) (cipherBytes []byte, err error)

func (*Wallet) BtlSign

func (w *Wallet) BtlSign(data []byte) []byte

func (*Wallet) BtlVerifySig

func (w *Wallet) BtlVerifySig(data, sig []byte) bool

func (*Wallet) CheckReceipt

func (w *Wallet) CheckReceipt(sendMeAddr common.Address, txHash common.Hash) (float64, error)

func (*Wallet) CheckReceiptWithNonce

func (w *Wallet) CheckReceiptWithNonce(sendMeAddr common.Address, txHash common.Hash, nonce uint64) (float64, error)

func (*Wallet) ExportWallet

func (w *Wallet) ExportWallet() (string, error)

func (*Wallet) Gas

func (w *Wallet) Gas() (float64, float64, error)

func (*Wallet) Load

func (w *Wallet) Load(auth string) error

func (*Wallet) Nonce

func (w *Wallet) Nonce() (uint64, error)

func (*Wallet) PrivKey

func (w *Wallet) PrivKey() *ecdsa.PrivateKey

func (*Wallet) RecoverEthAccount

func (w *Wallet) RecoverEthAccount(hexString, auth string) error

func (*Wallet) RecoverWallet

func (w *Wallet) RecoverWallet(walletString, auth string) error

func (*Wallet) Save

func (w *Wallet) Save(auth string) error

func (*Wallet) SendTo

func (w *Wallet) SendTo(to common.Address, balance float64) (*common.Hash, error)

func (*Wallet) SendToWithNonce

func (w *Wallet) SendToWithNonce(to common.Address, balance float64, nonce uint64, gas float64) (*common.Hash, error)

func (*Wallet) String

func (w *Wallet) String(auth string) (string, error)

type WalletIntf

type WalletIntf interface {
	BalanceOf(force bool) (float64, error)
	BalanceOfGas(accPoint string) (float64, error)
	SendTo(to common.Address, balance float64) (*common.Hash, error)
	SendToWithNonce(to common.Address, balance float64, nonce uint64, gas float64) (*common.Hash, error)
	Nonce() (uint64, error)
	Gas() (float64, float64, error)
	Address() common.Address
	AccountString() string
	BtlAddress() account.BeatleAddress
	CheckReceipt(sendMeAddr common.Address, txHash common.Hash) (float64, error)
	CheckReceiptWithNonce(sendMeAddr common.Address, txHash common.Hash, nonce uint64) (float64, error)
	Save(auth string) error
	Load(auth string) error
	BtlSign(data []byte) []byte
	BtlVerifySig(data, sig []byte) bool
	BtlPeerEncrypt(peerPub ed25519.PublicKey, plainBytes []byte) (cipherBytes []byte, err error)
	BtlPeerEncrypt2(peerId account.BeatleAddress, plainBytes []byte) (cipherBytes []byte, err error)
	BtlPeerDecrypt(peerPub ed25519.PublicKey, cipherBytes []byte) (plainBytes []byte, err error)
	BtlPeerDecrypt2(peerId account.BeatleAddress, cipherBytes []byte) (plainBytes []byte, err error)
	AesKey(peerPub ed25519.PublicKey) (key []byte, err error)
	AesKey2(peerId account.BeatleAddress) (key []byte, err error)
	RecoverEthAccount(hexString, auth string) error
	ExportWallet() (string, error)
	RecoverWallet(walletString, auth string) error
	String(auth string) (string, error)
	PrivKey() *ecdsa.PrivateKey
}

func CreateProtectWallet

func CreateProtectWallet(walletSavePath string, remoteEthServer string, protect func(fd int32) bool, dialTO, connTO int) WalletIntf

func CreateWallet

func CreateWallet(walletSavePath string, remoteEthServer string) WalletIntf

func NewWallet

func NewWallet(walletSavePath string, remoteEthServer string) WalletIntf

func RecoverWallet

func RecoverWallet(walletSavePath, remoteEthServer, auth string) (WalletIntf, error)

type WalletSaveJson

type WalletSaveJson struct {
	EthAcct string `json:"eth_acct"`
	BtlAcct string `json:"btl_acct"`
}

Jump to

Keyboard shortcuts

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