account

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: Apache-2.0 Imports: 12 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) *getDetailsHttpHandler

func NewGetDetailsUseCase

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

Types

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"`

	*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, 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 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(bondedEvents []model.EventSeqWithTxHash) ([]*Withdrawn, error)

Jump to

Keyboard shortcuts

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