accounts

package
v1.2.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMultisigAddress added in v1.2.0

func CreateMultisigAddress(owner types.Address, nonce uint64) types.Address

Types

type Accounts

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

func NewAccounts

func NewAccounts(stateBus *bus.Bus, iavl tree.MTree) (*Accounts, error)

func (*Accounts) AddBalance

func (a *Accounts) AddBalance(address types.Address, coin types.CoinID, amount *big.Int)

func (*Accounts) Commit

func (a *Accounts) Commit() error

func (*Accounts) CreateMultisig

func (a *Accounts) CreateMultisig(weights []uint32, addresses []types.Address, threshold uint32, address types.Address) types.Address

func (*Accounts) EditMultisig added in v1.2.0

func (a *Accounts) EditMultisig(threshold uint32, weights []uint32, addresses []types.Address, address types.Address) types.Address

func (*Accounts) ExistsMultisig

func (a *Accounts) ExistsMultisig(msigAddress types.Address) bool

func (*Accounts) Export

func (a *Accounts) Export(state *types.AppState)

func (*Accounts) GetAccount

func (a *Accounts) GetAccount(address types.Address) *Model

func (*Accounts) GetBalance

func (a *Accounts) GetBalance(address types.Address, coin types.CoinID) *big.Int

func (*Accounts) GetBalances

func (a *Accounts) GetBalances(address types.Address) []Balance

func (*Accounts) GetNonce

func (a *Accounts) GetNonce(address types.Address) uint64

func (*Accounts) SetBalance

func (a *Accounts) SetBalance(address types.Address, coin types.CoinID, amount *big.Int)

func (*Accounts) SetNonce

func (a *Accounts) SetNonce(address types.Address, nonce uint64)

func (*Accounts) SubBalance

func (a *Accounts) SubBalance(address types.Address, coin types.CoinID, amount *big.Int)

type Balance added in v1.2.0

type Balance struct {
	Coin  bus.Coin
	Value *big.Int
}

type Bus

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

func NewBus

func NewBus(accounts *Accounts) *Bus

func (*Bus) AddBalance

func (b *Bus) AddBalance(address types.Address, coin types.CoinID, value *big.Int)

type Model

type Model struct {
	Nonce        uint64
	MultisigData Multisig
	// contains filtered or unexported fields
}

func (*Model) IsMultisig

func (model *Model) IsMultisig() bool

func (*Model) Multisig

func (model *Model) Multisig() Multisig

type Multisig

type Multisig struct {
	Threshold uint32
	Weights   []uint32
	Addresses []types.Address
}

func (*Multisig) GetWeight

func (m *Multisig) GetWeight(address types.Address) uint32

type RAccounts added in v1.2.0

type RAccounts interface {
	Export(state *types.AppState)
	GetAccount(address types.Address) *Model
	GetNonce(address types.Address) uint64
	GetBalance(address types.Address, coin types.CoinID) *big.Int
	GetBalances(address types.Address) []Balance
	ExistsMultisig(msigAddress types.Address) bool
}

Jump to

Keyboard shortcuts

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