consensusaccounts

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: Apache-2.0 Imports: 4 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDepositTx

func NewDepositTx(fee *types.Fee, body *Deposit) *types.Transaction

NewDepositTx generates a new consensus.Deposit transaction.

func NewWithdrawTx

func NewWithdrawTx(fee *types.Fee, body *Withdraw) *types.Transaction

NewWithdrawTx generates a new consensus.Withdraw transaction.

Types

type AccountBalance

type AccountBalance struct {
	Balance types.Quantity `json:"balance"`
}

AccountBalance is the consensus balance in an account.

type AccountQuery

type AccountQuery struct {
	Address types.Address `json:"address"`
}

AccountQuery are the arguments for consensus.Account method.

type BalanceQuery

type BalanceQuery struct {
	Address types.Address `json:"address"`
}

BalanceQuery are the arguments for consensus.Balance method.

type Deposit

type Deposit struct {
	Amount types.BaseUnits `json:"amount"`
}

Deposit are the arguments for consensus.Deposit method.

type V1

type V1 interface {
	// Deposit generates a consensus.Deposit transaction.
	Deposit(amount types.BaseUnits) *client.TransactionBuilder

	// Withdraw generates a consensus.Withdraw transaction.
	Withdraw(amount types.BaseUnits) *client.TransactionBuilder

	// Balance queries the given account's balance of consensus denomination tokens.
	Balance(ctx context.Context, round uint64, query *BalanceQuery) (*AccountBalance, error)

	// ConsensusAccount queries the given consensus layer account.
	ConsensusAccount(ctx context.Context, round uint64, query *AccountQuery) (*staking.Account, error)
}

V1 is the v1 consensus accounts module interface.

func NewV1

func NewV1(rc client.RuntimeClient) V1

NewV1 generates a V1 client helper for the consensus accounts module.

type Withdraw

type Withdraw struct {
	Amount types.BaseUnits `json:"amount"`
}

Withdraw are the arguments for consensus.Deposit method.

Jump to

Keyboard shortcuts

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