Documentation ¶
Index ¶
- Constants
- Variables
- func NewMsgServer(k Keeper) v1.MsgServer
- func NewQueryServer(k Keeper) v1.QueryServer
- type AppModule
- func (AppModule) ConsensusVersion() uint64
- func (am AppModule) DefaultGenesis() json.RawMessage
- func (am AppModule) ExportGenesis(ctx context.Context) (json.RawMessage, error)
- func (AppModule) GetQueryCmd() *cobra.Command
- func (AppModule) GetTxCmd() *cobra.Command
- func (am AppModule) InitGenesis(ctx context.Context, message json.RawMessage) error
- func (m AppModule) IsAppModule()
- func (am AppModule) IsOnePerModuleType()
- func (AppModule) Name() string
- func (m AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar)
- func (m AppModule) RegisterServices(registar grpc.ServiceRegistrar) error
- func (am AppModule) ValidateGenesis(message json.RawMessage) error
- type InterfaceRegistry
- type Keeper
- func (k Keeper) AuthenticateAccount(ctx context.Context, addr []byte, msg *aa_interface_v1.MsgAuthenticate) error
- func (k Keeper) Execute(ctx context.Context, accountAddr []byte, sender []byte, ...) (implementation.ProtoMsg, error)
- func (k Keeper) ExportState(ctx context.Context) (*v1.GenesisState, error)
- func (k Keeper) ImportState(ctx context.Context, genState *v1.GenesisState) error
- func (k Keeper) Init(ctx context.Context, accountType string, creator []byte, ...) (implementation.ProtoMsg, []byte, error)
- func (k Keeper) IsAbstractedAccount(ctx context.Context, addr []byte) (bool, error)
- func (k Keeper) IsAccountsModuleAccount(ctx context.Context, accountAddr []byte) bool
- func (k Keeper) MigrateLegacyAccount(ctx context.Context, addr []byte, accNum uint64, accType string, ...) (implementation.ProtoMsg, error)
- func (k Keeper) Query(ctx context.Context, accountAddr []byte, queryRequest implementation.ProtoMsg) (implementation.ProtoMsg, error)
- func (k Keeper) SendModuleMessageUntyped(ctx context.Context, sender []byte, msg implementation.ProtoMsg) (implementation.ProtoMsg, error)
- type ModuleInputs
- type ModuleOutputs
Constants ¶
const ( ModuleName = "accounts" StoreKey = "_" + ModuleName // unfortunately accounts collides with auth store key ConsensusVersion = 1 )
const ( // TODO(tip): evaluate if the following numbers should be parametrised over state, or over the node. SimulateAuthenticateGasLimit = 1_000_000 SimulateBundlerPaymentGasLimit = SimulateAuthenticateGasLimit ExecuteGasLimit = SimulateAuthenticateGasLimit )
Variables ¶
var ( // AccountTypeKeyPrefix is the prefix for the account type key. AccountTypeKeyPrefix = collections.NewPrefix(0) // AccountNumberKey is the key for the account number. AccountNumberKey = collections.NewPrefix(1) // AccountByNumber is the key for the accounts by number. AccountByNumber = collections.NewPrefix(2) )
var ( // ErrAuthentication is returned when the authentication fails. ErrAuthentication = errors.New("authentication failed") // ErrBundlerPayment is returned when the bundler payment fails. ErrBundlerPayment = errors.New("bundler payment failed") // ErrExecution is returned when the execution fails. ErrExecution = errors.New("execution failed") )
var ModuleAccountAddress = address.Module(ModuleName)
ModuleAccountAddress defines the x/accounts module address.
Functions ¶
func NewQueryServer ¶
func NewQueryServer(k Keeper) v1.QueryServer
Types ¶
type AppModule ¶
type AppModule struct {
// contains filtered or unexported fields
}
func (AppModule) DefaultGenesis ¶
func (am AppModule) DefaultGenesis() json.RawMessage
func (AppModule) ExportGenesis ¶
func (AppModule) InitGenesis ¶
func (AppModule) IsOnePerModuleType ¶
func (am AppModule) IsOnePerModuleType()
IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (AppModule) RegisterInterfaces ¶
func (m AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar)
func (AppModule) RegisterServices ¶
func (m AppModule) RegisterServices(registar grpc.ServiceRegistrar) error
func (AppModule) ValidateGenesis ¶
func (am AppModule) ValidateGenesis(message json.RawMessage) error
type InterfaceRegistry ¶
type InterfaceRegistry interface { RegisterInterface(name string, iface any, impls ...protoiface.MessageV1) RegisterImplementations(iface any, impls ...protoiface.MessageV1) }
type Keeper ¶
type Keeper struct { appmodule.Environment // Schema is the schema for the module. Schema collections.Schema // AccountNumber is the last global account number. AccountNumber collections.Sequence // AccountsByType maps account address to their implementation. AccountsByType collections.Map[[]byte, string] // AccountByNumber maps account number to their address. AccountByNumber collections.Map[[]byte, uint64] // AccountsState keeps track of the state of each account. // NOTE: this is only used for genesis import and export. // Account set and get their own state but this helps providing a nice mapping // between: (account number, account state key) => account state value. AccountsState collections.Map[collections.Pair[uint64, []byte], []byte] // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, env appmodule.Environment, addressCodec address.Codec, ir InterfaceRegistry, accounts ...accountstd.AccountCreatorFunc, ) (Keeper, error)
func (Keeper) AuthenticateAccount ¶
func (k Keeper) AuthenticateAccount(ctx context.Context, addr []byte, msg *aa_interface_v1.MsgAuthenticate) error
func (Keeper) Execute ¶
func (k Keeper) Execute( ctx context.Context, accountAddr []byte, sender []byte, execRequest implementation.ProtoMsg, funds sdk.Coins, ) (implementation.ProtoMsg, error)
Execute executes a state transition on the given account.
func (Keeper) ExportState ¶
func (Keeper) ImportState ¶
func (Keeper) Init ¶
func (k Keeper) Init( ctx context.Context, accountType string, creator []byte, initRequest implementation.ProtoMsg, funds sdk.Coins, ) (implementation.ProtoMsg, []byte, error)
Init creates a new account of the given type.
func (Keeper) IsAbstractedAccount ¶
IsAbstractedAccount returns if the provided address is an abstracted account or not.
func (Keeper) IsAccountsModuleAccount ¶
IsAccountsModuleAccount check if an address belong to a smart account.
func (Keeper) MigrateLegacyAccount ¶
func (k Keeper) MigrateLegacyAccount( ctx context.Context, addr []byte, accNum uint64, accType string, msg implementation.ProtoMsg, ) (implementation.ProtoMsg, error)
MigrateLegacyAccount is used to migrate a legacy account to x/accounts. Concretely speaking this works like Init, but with a custom account number provided, Where the creator is the account itself. This can be used by the x/auth module to gradually migrate base accounts to x/accounts. NOTE: this assumes the calling module checks for account overrides.
func (Keeper) Query ¶
func (k Keeper) Query( ctx context.Context, accountAddr []byte, queryRequest implementation.ProtoMsg, ) (implementation.ProtoMsg, error)
Query queries the given account.
func (Keeper) SendModuleMessageUntyped ¶
func (k Keeper) SendModuleMessageUntyped(ctx context.Context, sender []byte, msg implementation.ProtoMsg) (implementation.ProtoMsg, error)
SendModuleMessageUntyped can be used to send a message towards a module. It should be used when the response type is not known by the caller.
type ModuleInputs ¶
type ModuleInputs struct { depinject.In Cdc codec.Codec Environment appmodule.Environment AddressCodec address.Codec Registry cdctypes.InterfaceRegistry }
type ModuleOutputs ¶
func ProvideModule ¶
func ProvideModule(in ModuleInputs) ModuleOutputs
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package accountstd exports the types and functions that are used by developers to implement smart accounts.
|
Package accountstd exports the types and functions that are used by developers to implement smart accounts. |
defaults
|
|
lockup
Module
|
|
interfaces
|
|
internal
|
|
prefixstore
Package prefixstore provides a store that prefixes all keys with a given prefix.
|
Package prefixstore provides a store that prefixes all keys with a given prefix. |
testing
|
|