Documentation ¶
Index ¶
- Constants
- Variables
- func AddressStoreKey(addr types.AccAddress) []byte
- func ProtoBaseAccount() exported.Account
- func RegisterCodec(cdc *codec.Codec)
- func SetGenesisStateInAppState(cdc *codec.Codec, appState map[string]json.RawMessage, ...) map[string]json.RawMessage
- type BaseAccount
- func (acc *BaseAccount) GetAccountNumber() uint64
- func (acc *BaseAccount) GetAddress() types.AccAddress
- func (acc *BaseAccount) GetCodeHash() []byte
- func (acc *BaseAccount) GetCoins() types.Coins
- func (acc *BaseAccount) GetContractType() string
- func (acc *BaseAccount) GetIsModule() bool
- func (acc *BaseAccount) GetPubKey() crypto.PubKey
- func (acc *BaseAccount) GetSequence() uint64
- func (acc *BaseAccount) SetAccountNumber(accNumber uint64) error
- func (acc *BaseAccount) SetAddress(addr types.AccAddress) error
- func (acc *BaseAccount) SetCodeHash(bz []byte)
- func (acc *BaseAccount) SetCoins(coin types.Coins) error
- func (acc *BaseAccount) SetContractType(contractType string) error
- func (acc *BaseAccount) SetIsModule(flag bool) error
- func (acc *BaseAccount) SetPubKey(pubKey crypto.PubKey) error
- func (acc *BaseAccount) SetSequence(seq uint64) error
- func (acc *BaseAccount) SpendableCoins(_ time.Time) types.Coins
- func (acc *BaseAccount) String() string
- type CodeType
- type GenesisAccounts
- type GenesisState
Constants ¶
const ( EvmContractType string = "evm" WasmContractType string = "wasm" )
const ModuleName = "accounts"
const QueryAccount = "queryAccount"
const QueryAccountNonce = "queryAccountNonce"
const RouteKey = "accounts"
const StoreKey = "accounts"
Variables ¶
var ( ErrAccountNotExisted = sdkerrors.Register(string(DefaultCodespace), uint32(CodeAccountNotExisted), "account not exist") ErrInsufficientFunds = sdkerrors.Register(string(DefaultCodespace), uint32(CodeInsufficientFunds), "insufficient funds") ErrInvalidParam = sdkerrors.Register(string(DefaultCodespace), uint32(CodeInvalidParam), "invalid params") ErrInvalidEndPoint = sdkerrors.Register(string(DefaultCodespace), uint32(CodeInvalidEndPoint), "invalid endpoint") ErrCdcMarshalFailed = sdkerrors.Register(string(DefaultCodespace), uint32(CodeCdcMarshalFailed), "cdc marshal failed") ErrCdcUnmarshalFailed = sdkerrors.Register(string(DefaultCodespace), uint32(CodeCdcUnmarshalFailed), "cdc unmarshal failed") )
var ( // AddressStoreKeyPrefix prefix for account-by-address store AddressStoreKeyPrefix = []byte{0x01} HeightUpdateKeyPrefix = []byte{0x02} HeightsUpdateKeyPrefix = []byte{0x03} GlobalAccountNumberKey = []byte("globalAccountNumber") BalancesPrefix = []byte("balances") EventTypeTransfer = "transfer" AttributeKeyRecipient = "recipient" AttributeKeySender = "sender" )
var ModuleCdc *codec.Codec
Functions ¶
func AddressStoreKey ¶
func AddressStoreKey(addr types.AccAddress) []byte
AddressStoreKey turn an address to types used to get it from the account store
func ProtoBaseAccount ¶
func RegisterCodec ¶
func SetGenesisStateInAppState ¶
func SetGenesisStateInAppState(cdc *codec.Codec, appState map[string]json.RawMessage, genesisState GenesisState) map[string]json.RawMessage
Types ¶
type BaseAccount ¶
type BaseAccount struct { Address types.AccAddress `json:"address" yaml:"address"` Coins types.Coins `json:"coins" yaml:"coins"` Sequence uint64 `json:"sequence_number" yaml:"sequence_number"` AccountNumber uint64 `json:"account_number" yaml:"account_number"` PubKey crypto.PubKey `json:"pub_key" yaml:"pub_key"` ContractList []string `json:"contract_list" yaml:"contract_list"` ContractType string `json:"contract_type" yaml:"contract_type"` CodeHash []byte `json:"code_hash" yaml:"code_hash"` IsModule bool `json:"is_module"` }
func NewBaseAccount ¶
func NewBaseAccount(address types.AccAddress, coin types.Coins, pubKey crypto.PubKey, accountNumber uint64, sequence uint64) *BaseAccount
NewBaseAccount creates a new BaseAccount object
func NewBaseAccountFromExportAccount ¶ added in v1.5.53
func NewBaseAccountFromExportAccount(exportAcc exported.Account) *BaseAccount
func NewBaseAccountWithAddress ¶
func NewBaseAccountWithAddress(addr types.AccAddress) BaseAccount
NewBaseAccountWithAddress - returns a new base account with a given address
func (*BaseAccount) GetAccountNumber ¶
func (acc *BaseAccount) GetAccountNumber() uint64
GetAccountNumber - Implements Account
func (*BaseAccount) GetAddress ¶
func (acc *BaseAccount) GetAddress() types.AccAddress
GetAddress - Implements sdk.Account.
func (*BaseAccount) GetCodeHash ¶ added in v1.5.53
func (acc *BaseAccount) GetCodeHash() []byte
func (*BaseAccount) GetCoins ¶
func (acc *BaseAccount) GetCoins() types.Coins
GetCoins - Implements sdk.Account.
func (*BaseAccount) GetContractType ¶
func (acc *BaseAccount) GetContractType() string
func (*BaseAccount) GetIsModule ¶ added in v1.5.53
func (acc *BaseAccount) GetIsModule() bool
func (*BaseAccount) GetPubKey ¶
func (acc *BaseAccount) GetPubKey() crypto.PubKey
GetPubKey - Implements sdk.Account.
func (*BaseAccount) GetSequence ¶
func (acc *BaseAccount) GetSequence() uint64
GetSequence - Implements sdk.Account.
func (*BaseAccount) SetAccountNumber ¶
func (acc *BaseAccount) SetAccountNumber(accNumber uint64) error
SetAccountNumber - Implements Account
func (*BaseAccount) SetAddress ¶
func (acc *BaseAccount) SetAddress(addr types.AccAddress) error
SetAddress - Implements sdk.Account.
func (*BaseAccount) SetCodeHash ¶ added in v1.5.53
func (acc *BaseAccount) SetCodeHash(bz []byte)
func (*BaseAccount) SetCoins ¶
func (acc *BaseAccount) SetCoins(coin types.Coins) error
SetCoins - Implements sdk.Account.
func (*BaseAccount) SetContractType ¶
func (acc *BaseAccount) SetContractType(contractType string) error
func (*BaseAccount) SetIsModule ¶ added in v1.5.53
func (acc *BaseAccount) SetIsModule(flag bool) error
func (*BaseAccount) SetPubKey ¶
func (acc *BaseAccount) SetPubKey(pubKey crypto.PubKey) error
SetPubKey - Implements sdk.Account.
func (*BaseAccount) SetSequence ¶
func (acc *BaseAccount) SetSequence(seq uint64) error
SetSequence - Implements sdk.Account.
func (*BaseAccount) SpendableCoins ¶
func (acc *BaseAccount) SpendableCoins(_ time.Time) types.Coins
SpendableCoins returns the total set of spendable coins. For a base account, this is simply the base coins.
func (*BaseAccount) String ¶
func (acc *BaseAccount) String() string
type GenesisAccounts ¶
GenesisAccounts defines a set of genesis account
func (GenesisAccounts) Contains ¶
func (gaccs GenesisAccounts) Contains(acc types.AccAddress) bool
type GenesisState ¶
type GenesisState GenesisAccounts
func NewGenesisState ¶ added in v1.5.23
func NewGenesisState(accounts GenesisAccounts) GenesisState