account

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCouldNotMarshalJSON   = errors.New("could not marshal data to JSON")
	ErrUnmarshalingEventData = errors.New("error when trying to unmarshal event data")
)

Functions

func NewGetByHeightHttpHandler

func NewGetByHeightHttpHandler(c *client.Client, syncablesDb store.FindMostRecenter) *getByHeightHttpHandler

func NewGetByHeightUseCase

func NewGetByHeightUseCase(c *client.Client, syncablesDb store.FindMostRecenter) *getByHeightUseCase

func NewGetDetailsHttpHandler

func NewGetDetailsHttpHandler(c *client.Client, accountEraSeqDb store.AccountEraSeq, eventSeqDb store.EventSeq, syncablesDb store.Syncables) *getDetailsHttpHandler

func NewGetDetailsUseCase

func NewGetDetailsUseCase(c *client.Client, accountEraSeqDb store.AccountEraSeq, eventSeqDb store.EventSeq, syncablesDb store.Syncables) *getDetailsUseCase

func NewGetRewardsHttpHandler added in v0.7.0

func NewGetRewardsHttpHandler(eventSeqDb store.EventSeq, syncablesDb store.Syncables) *getRewardsHttpHandler

func NewGetRewardsUseCase added in v0.7.0

func NewGetRewardsUseCase(eventSeqDb store.EventSeq, syncablesDb store.Syncables) *getRewardsUseCase

Types

type Account added in v0.5.0

type Account struct {
	Free       string `json:"free"`
	Reserved   string `json:"reserved"`
	MiscFrozen string `json:"misc_frozen"`
	FeeFrozen  string `json:"fee_frozen"`
}

func ToAccount added in v0.5.0

func ToAccount(rawAccount *accountpb.Account) *Account

type BalanceDeposit

type BalanceDeposit struct {
	Amount string `json:"amount"`
	Hash   string `json:"transaction_hash"`
	Height int64  `json:"height"`
}

func ToBalanceDeposits

func ToBalanceDeposits(balanceDepositsEvents []model.EventSeqWithTxHash) ([]*BalanceDeposit, error)

type BalanceTransfer

type BalanceTransfer struct {
	Hash        string `json:"transaction_hash"`
	Height      int64  `json:"height"`
	Amount      string `json:"amount"`
	Kind        string `json:"kind"`
	Participant string `json:"participant"`
}

func ToBalanceTransfers

func ToBalanceTransfers(forAddress string, balanceTransferEvents []model.EventSeqWithTxHash) ([]*BalanceTransfer, error)

type Bonded

type Bonded struct {
	Amount   string `json:"amount"`
	Receiver string `json:"receiver"`
	Hash     string `json:"transaction_hash"`
	Height   int64  `json:"height"`
}

func ToBondedList

func ToBondedList(bondedEvents []model.EventSeqWithTxHash) ([]*Bonded, error)

type DetailsView

type DetailsView struct {
	Address string   `json:"address"`
	Account *Account `json:"account"`
	*Identity

	Transfers   []*BalanceTransfer   `json:"transfers"`
	Deposits    []*BalanceDeposit    `json:"deposits"`
	Bonded      []*Bonded            `json:"bonded"`
	Unbonded    []*Unbonded          `json:"unbonded"`
	Withdrawn   []*Withdrawn         `json:"withdrawn"`
	Delegations []*common.Delegation `json:"delegations"`
}

func ToDetailsView

func ToDetailsView(address string, rawAccountIdentity *accountpb.AccountIdentity, rawAccount *accountpb.Account, accountEraSeqs []model.AccountEraSeq, balanceTransferModels, balanceDepositModels, bondedModels, unbondedModels, withdrawnModels []model.EventSeqWithTxHash) (DetailsView, error)

type EventData

type EventData struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type GetByHeightRequest added in v0.2.0

type GetByHeightRequest struct {
	StashAccount string `uri:"stash_account" binding:"required"`
	Height       *int64 `form:"height" binding:"-"`
}

type GetDetailsRequest

type GetDetailsRequest struct {
	StashAccount string `uri:"stash_account" binding:"required"`
}

type HeightDetailsView

type HeightDetailsView struct {
	Nonce           int64  `json:"nonce"`
	ReferendumCount int64  `json:"referendum_count"`
	Free            string `json:"free"`
	Reserved        string `json:"reserved"`
	MiscFrozen      string `json:"misc_frozen"`
	FeeFrozen       string `json:"fee_frozen"`
}

func ToHeightDetailsView

func ToHeightDetailsView(rawAccount *accountpb.Account) *HeightDetailsView

type Identity

type Identity struct {
	Deposit     string `json:"deposit"`
	DisplayName string `json:"display_name"`
	LegalName   string `json:"legal_name"`
	WebName     string `json:"web_name"`
	RiotName    string `json:"riot_name"`
	EmailName   string `json:"email_name"`
	TwitterName string `json:"twitter_name"`
	Image       string `json:"image"`
}

func ToIdentity

func ToIdentity(rawAccountIdentity *accountpb.AccountIdentity) *Identity

type Reward added in v0.7.0

type Reward struct {
	Height int64     `json:"height"`
	Time   time.Time `json:"time"`
	Amount string    `json:"amount"`
}

type RewardsView added in v0.7.0

type RewardsView struct {
	Account     string    `json:"account"`
	Start       time.Time `json:"start_time"`
	End         time.Time `json:"end_time"`
	TotalAmount string    `json:"total_amount"`
	Rewards     []Reward  `json:"rewards"`
}

type Unbonded

type Unbonded struct {
	Amount string `json:"amount"`
	Hash   string `json:"transaction_hash"`
	Height int64  `json:"height"`
}

func ToUnbondedList

func ToUnbondedList(bondedEvents []model.EventSeqWithTxHash) ([]*Unbonded, error)

type Withdrawn

type Withdrawn struct {
	Amount string `json:"amount"`
	Hash   string `json:"transaction_hash"`
	Height int64  `json:"height"`
}

func ToWithdrawnList

func ToWithdrawnList(withdrawnEvents []model.EventSeqWithTxHash) ([]*Withdrawn, error)

Jump to

Keyboard shortcuts

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