wallet

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

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

Account contains private key of the account that allows to sign transactions to broadcast to the blockchain.

func NewAccount

func NewAccount(password string) (*Account, error)

NewAccount creates new account with random mnemonic.

func NewAccountFromMnemonicWords

func NewAccountFromMnemonicWords(words string, password string) (*Account, error)

NewAccountFromMnemonicWords creates account from mnemonic presented as set of words.

func (*Account) AccountNumber

func (acc *Account) AccountNumber() uint64

AccountNumber returns accounts's number.

func (*Account) Address

func (acc *Account) Address() string

Address returns accounts's address in bech32 format.

func (*Account) ChainID

func (acc *Account) ChainID() string

ChainID returns chain ID of network.

func (*Account) IncrementSequence

func (acc *Account) IncrementSequence()

func (*Account) LegacyAddress

func (acc *Account) LegacyAddress() string

Address returns accounts's address in bech32 format.

func (*Account) PubKey

func (acc *Account) PubKey() cryptoTypes.PubKey

Sequence returns accounts's sequence (last used nonce).

func (*Account) SdkAddress

func (acc *Account) SdkAddress() sdk.AccAddress

SdkAddress returns accounts's cosmos AccAddress ([]byte)

func (*Account) Sequence

func (acc *Account) Sequence() uint64

Sequence returns accounts's sequence (last used nonce).

func (*Account) Sign

func (acc *Account) Sign(bytesToSign []byte) ([]byte, error)

Sign data by private key and returns signature

func (*Account) WithAccountNumber

func (acc *Account) WithAccountNumber(accountNumber uint64) *Account

WithAccountNumber sets accounts's number.

func (*Account) WithChainID

func (acc *Account) WithChainID(chainID string) *Account

WithChainID sets chain ID of network.

func (*Account) WithSequence

func (acc *Account) WithSequence(sequence uint64) *Account

WithSequence sets accounts's sequence (last used nonce).

type Mnemonic

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

Mnemonic contains entropy, seed and mnemonic words array which can be used for hierarchical deterministic extended keys.

func NewMnemonic

func NewMnemonic(password string) (*Mnemonic, error)

NewMnemonic creates a new random (crypto safe) Mnemonic. Use 128 bits for a 12 words code or 256 bits for a 24 words.

func NewMnemonicFromEntropy

func NewMnemonicFromEntropy(entropy []byte, password string) (*Mnemonic, error)

NewMnemonicFromEntropy creates a Mnemonic based on a known entropy.

func NewMnemonicFromWords

func NewMnemonicFromWords(words string, password string) (*Mnemonic, error)

NewMnemonicFromWords creates a Mnemonic based on a known list of words.

func (*Mnemonic) Entropy

func (m *Mnemonic) Entropy() []byte

Entropy returns the entropy of the Mnemonic.

func (*Mnemonic) Seed

func (m *Mnemonic) Seed() []byte

Seed returns the seed of the Mnemonic.

func (*Mnemonic) Words

func (m *Mnemonic) Words() string

Words returns the words from the Mnemonic.

Jump to

Keyboard shortcuts

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