account

package
v0.0.0-...-044d410 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: LGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNewLocalAccount

func CreateNewLocalAccount(candidate *Creation) error

CreateNewLocalAccount assumes all the inputs are valid, legitmate

func ExportKeystore

func ExportKeystore(address, path, passphrase string) (string, error)

ExportKeystore to file

func ExportPrivateKey

func ExportPrivateKey(address, passphrase string) error

ExportPrivateKey from account

func ImportFromPrivateKey

func ImportFromPrivateKey(privateKey, name, passphrase string) (string, error)

ImportFromPrivateKey allows import of an ECDSA private key

func ImportKeyStore

func ImportKeyStore(keyPath, name, passphrase string) (string, error)

ImportKeyStore imports a keystore along with a password

func IsValidPassphrase

func IsValidPassphrase(pass string) bool

IsValidPassphrase check if strong

func New

func New() string

New create new name

func RemoveAccount

func RemoveAccount(name string) error

RemoveAccount - removes an account from the keystore

Types

type Account

type Account struct {
	Address         string           `json:"address"`
	Type            string           `json:"type"`
	Name            string           `json:"name"`
	ID              string           `json:"id"`
	Balance         int64            `json:"balance"`
	Allowance       int64            `json:"allowance"`
	LastWithdraw    int64            `json:"lastWithdraw"`
	IsWitness       bool             `json:"isWitness"`
	IsElected       bool             `json:"isElected"`
	Assets          map[string]int64 `json:"assetList"`
	TronPower       int64            `json:"tronPower"`
	TronPowerUsed   int64            `json:"tronPowerUsed"`
	FrozenBalance   int64            `json:"frozenBalance"`
	FrozenResources []FrozenResource `json:"frozenList"`
	Votes           map[string]int64 `json:"voteList"`
	BWTotal         int64            `json:"bandwidthTotal"`
	BWUsed          int64            `json:"bandwidthUsed"`
	EnergyTotal     int64            `json:"energyTotal"`
	EnergyUsed      int64            `json:"energyUsed"`
}

Account detailed view

type Creation

type Creation struct {
	Name               string
	Passphrase         string
	Mnemonic           string
	MnemonicPassphrase string
	HdAccountNumber    *uint32
	HdIndexNumber      *uint32
}

Creation struct for account

type FrozenResource

type FrozenResource struct {
	Type       core.ResourceCode
	Amount     int64
	DelegateTo string
	Expire     int64
}

FrozenResource by account

Jump to

Keyboard shortcuts

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