acct

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: AGPL-3.0 Imports: 8 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
}

func NewAccount

func NewAccount(id ids.Address) *Account

func ParseAccount

func ParseAccount(id ids.Address, data []byte) (a *Account, err error)

func (*Account) AccountChanged

func (a *Account) AccountChanged(data []byte) bool

func (*Account) Add

func (a *Account) Add(token ids.TokenSymbol, amount *big.Int) error

func (*Account) Balance

func (a *Account) Balance() *big.Int

func (*Account) BalanceOf

func (a *Account) BalanceOf(token ids.TokenSymbol) *big.Int

func (*Account) BalanceOfAll

func (a *Account) BalanceOfAll(token ids.TokenSymbol) *big.Int

func (*Account) Borrow

func (a *Account) Borrow(
	token ids.TokenSymbol,
	from ids.Address,
	amount *big.Int,
	dueTime uint64,
) error

func (*Account) CheckBalance

func (a *Account) CheckBalance(token ids.TokenSymbol, amount *big.Int, checkNTB bool) error

func (*Account) CloseLending

func (a *Account) CloseLending() error

func (*Account) CreateStake

func (a *Account) CreateStake(
	from ids.Address,
	pledge *big.Int,
	acc *ld.TxAccounter,
	cfg *ld.StakeConfig,
) error

func (*Account) CreateToken

func (a *Account) CreateToken(data *ld.TxAccounter) error

func (*Account) DestroyStake

func (a *Account) DestroyStake(recipient *Account) error

func (*Account) DestroyToken

func (a *Account) DestroyToken(recipient *Account) error

func (*Account) GetStakeAmount

func (a *Account) GetStakeAmount(token ids.TokenSymbol, from ids.Address) *big.Int

func (*Account) ID

func (a *Account) ID() ids.Address

func (*Account) IDKey

func (a *Account) IDKey() signer.Key

func (*Account) Init

func (a *Account) Init(nonTransferableBalance, pledge *big.Int, height, timestamp uint64) *Account

func (*Account) IsEmpty

func (a *Account) IsEmpty() bool

func (*Account) Keepers

func (a *Account) Keepers() signer.Keys

func (*Account) LD

func (a *Account) LD() *ld.Account

func (*Account) Ledger

func (a *Account) Ledger() *ld.AccountLedger

func (*Account) LedgerChanged

func (a *Account) LedgerChanged(data []byte) bool

func (*Account) LoadLedger

func (a *Account) LoadLedger(force bool, fn func() ([]byte, error)) error

func (*Account) Marshal

func (a *Account) Marshal() ([]byte, []byte, error)

func (*Account) Nonce

func (a *Account) Nonce() uint64

func (*Account) OpenLending

func (a *Account) OpenLending(cfg *ld.LendingConfig) error

func (*Account) Repay

func (a *Account) Repay(
	token ids.TokenSymbol,
	from ids.Address,
	amount *big.Int,
) (*big.Int, error)

func (*Account) ResetPledge

func (a *Account) ResetPledge()

func (*Account) ResetStake

func (a *Account) ResetStake(cfg *ld.StakeConfig) error

func (*Account) Sub

func (a *Account) Sub(token ids.TokenSymbol, amount *big.Int) error

func (*Account) SubByNonceTable

func (a *Account) SubByNonceTable(token ids.TokenSymbol, expire, nonce uint64, amount *big.Int) error

func (*Account) SubGasByNonce

func (a *Account) SubGasByNonce(token ids.TokenSymbol, nonce uint64, amount *big.Int) error

func (*Account) TakeStake

func (a *Account) TakeStake(
	token ids.TokenSymbol,
	from ids.Address,
	amount *big.Int,
	lockTime uint64) error

func (*Account) Threshold

func (a *Account) Threshold() uint16

func (*Account) TotalSupply

func (a *Account) TotalSupply() *big.Int

func (*Account) Type

func (a *Account) Type() ld.AccountType

func (*Account) UpdateKeepers

func (a *Account) UpdateKeepers(
	threshold *uint16,
	keepers *signer.Keys,
	approver *signer.Key,
	approveList *ld.TxTypes,
) error

func (*Account) UpdateNonceTable

func (a *Account) UpdateNonceTable(expire uint64, ns []uint64) error

func (*Account) UpdateStakeApprover

func (a *Account) UpdateStakeApprover(
	from ids.Address,
	approver signer.Key,
	txIsApprovedFn ld.TxIsApprovedFn,
) error

func (*Account) Valid

func (a *Account) Valid(t ld.AccountType) bool

func (*Account) ValidValidator

func (a *Account) ValidValidator() bool

func (*Account) Verify

func (a *Account) Verify(digestHash []byte, sigs signer.Sigs, accountKey signer.Key) bool

func (*Account) VerifyPlus

func (a *Account) VerifyPlus(digestHash []byte, sigs signer.Sigs, accountKey signer.Key) bool

func (*Account) WithdrawStake

func (a *Account) WithdrawStake(
	token ids.TokenSymbol,
	from ids.Address,
	amount *big.Int,
	txIsApprovedFn ld.TxIsApprovedFn,
) (*big.Int, error)

type ActiveAccounts

type ActiveAccounts map[ids.Address]*Account

Jump to

Keyboard shortcuts

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