Documentation
¶
Index ¶
- Variables
- func AccountDecoder(r io.Reader, n *int, err *error) interface{}
- func AccountEncoder(o interface{}, w io.Writer, n *int, err *error)
- func EncodeAccount(acc *Account) []byte
- func GenPrivKeyBytesFromSecret(secret string) []byte
- func SignBytes(chainID string, o Signable) []byte
- type Account
- type PrivAccount
- type Signable
Constants ¶
This section is empty.
Variables ¶
View Source
var AccountCodec = wire.Codec{ Encode: AccountEncoder, Decode: AccountDecoder, }
Functions ¶
func EncodeAccount ¶
func GenPrivKeyBytesFromSecret ¶
Generates 32 priv key bytes from secret
Types ¶
type Account ¶
type Account struct {
Address []byte `json:"address"`
PubKey crypto.PubKey `json:"pub_key"`
Sequence int `json:"sequence"`
Balance int64 `json:"balance"`
Code []byte `json:"code"` // VM code
StorageRoot []byte `json:"storage_root"` // VM storage merkle root.
Permissions ptypes.AccountPermissions `json:"permissions"`
}
Account resides in the application state, and is mutated by transactions on the blockchain. Serialized by wire.[read|write]Reflect
func DecodeAccount ¶
type PrivAccount ¶
type PrivAccount struct {
Address []byte `json:"address"`
PubKey crypto.PubKey `json:"pub_key"`
PrivKey crypto.PrivKey `json:"priv_key"`
}
func GenPrivAccountFromPrivKeyBytes ¶
func GenPrivAccountFromPrivKeyBytes(privKeyBytes []byte) *PrivAccount
func GenPrivAccountFromSecret ¶
func GenPrivAccountFromSecret(secret string) *PrivAccount
Generates a new account with private key from SHA256 hash of a secret
func (*PrivAccount) Generate ¶
func (pA *PrivAccount) Generate(index int) *PrivAccount
func (*PrivAccount) Sign ¶
func (pA *PrivAccount) Sign(chainID string, o Signable) crypto.Signature
func (*PrivAccount) String ¶
func (pA *PrivAccount) String() string
Click to show internal directories.
Click to hide internal directories.