github.com/lino-network/lino@v0.6.11/x/account/model/ir.go (about)

     1  package model
     2  
     3  import (
     4  	sdk "github.com/cosmos/cosmos-sdk/types"
     5  	crypto "github.com/tendermint/tendermint/crypto"
     6  
     7  	"github.com/lino-network/lino/types"
     8  )
     9  
    10  // AccountIR account related information when migrate, pk: Username
    11  type AccountIR struct {
    12  	Username       types.AccountKey `json:"username"`
    13  	CreatedAt      int64            `json:"created_at"`
    14  	SigningKey     crypto.PubKey    `json:"signing_key"`
    15  	TransactionKey crypto.PubKey    `json:"transaction_key"`
    16  	Address        sdk.AccAddress   `json:"address"`
    17  }
    18  
    19  // AccountBankIR - user balance
    20  type AccountBankIR struct {
    21  	Address         []byte           `json:"address"` // pk
    22  	Saving          types.Coin       `json:"saving"`
    23  	FrozenMoneyList []FrozenMoneyIR  `json:"frozen_money_list"`
    24  	PubKey          crypto.PubKey    `json:"public_key"`
    25  	Sequence        uint64           `json:"sequence"`
    26  	Username        types.AccountKey `json:"username"`
    27  }
    28  
    29  // FrozenMoneyIR - frozen money
    30  type FrozenMoneyIR struct {
    31  	Amount   types.Coin `json:"amount"`
    32  	StartAt  int64      `json:"start_at"`
    33  	Times    int64      `json:"times"`
    34  	Interval int64      `json:"interval"`
    35  }
    36  
    37  // AccountMetaIR - stores optional fields.
    38  type AccountMetaIR struct {
    39  	Username types.AccountKey `json:"username"`
    40  	JSONMeta string           `json:"json_meta"`
    41  }
    42  
    43  // PoolIR - the module account.
    44  type PoolIR struct {
    45  	Name    types.PoolName `json:"name"`
    46  	Balance types.Coin     `json:"balance"`
    47  }
    48  
    49  // SupplyIR - stats of lino supply.
    50  type SupplyIR struct {
    51  	LastYearTotal     types.Coin `json:"last_year_total"`
    52  	Total             types.Coin `json:"total"`
    53  	ChainStartTime    int64      `json:"chain_start_time"`
    54  	LastInflationTime int64      `json:"last_inflation_time"`
    55  }
    56  
    57  // AccountTablesIR -
    58  type AccountTablesIR struct {
    59  	Version  int             `json:"version"`
    60  	Accounts []AccountIR     `json:"accounts"`
    61  	Banks    []AccountBankIR `json:"banks"`
    62  	Metas    []AccountMetaIR `json:"metas"`
    63  	Pools    []PoolIR        `json:"pools"`
    64  	Supply   SupplyIR        `json:"supply"`
    65  }