cosmos-sdk/x/accounts
mergify[bot] 8b70c6caf7
refactor: remove viper as a direct dependency (backport #21635) (#21672)
Co-authored-by: Matt Kocubinski <mkocubinski@gmail.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
2024-09-12 08:41:25 +00:00
..
accountstd refactor(core,stf,x)!: remove InvokeTyped from router (backport #21224) (#21392) 2024-08-23 21:59:49 +00:00
cli refactor: decouple comet from modules (backport #21382) (#21650) 2024-09-11 14:06:15 +02:00
defaults refactor: remove viper as a direct dependency (backport #21635) (#21672) 2024-09-12 08:41:25 +00:00
interfaces/account_abstraction/v1 perf!: Make slashing not write sign info every block (#19458) 2024-02-20 16:51:02 +00:00
internal refactor(core,stf,x)!: remove InvokeTyped from router (backport #21224) (#21392) 2024-08-23 21:59:49 +00:00
proto fix(x/accounts/lockup): prevent double withdraw (backport #21619) (#21641) 2024-09-11 08:13:55 +00:00
testing chore: migrate sdk.Msg to transaction.type (#20273) 2024-05-10 10:23:22 +00:00
v1 build(deps): bump proto-builder and regen protos (backport #21215) (#21216) 2024-08-08 09:47:10 +00:00
account_test.go refactor(core,stf,x)!: remove InvokeTyped from router (backport #21224) (#21392) 2024-08-23 21:59:49 +00:00
CHANGELOG.md feat(x/accounts): On-chain multisig (#19988) 2024-05-06 11:26:49 +00:00
coin_transfer.go refactor(core,stf,x)!: remove InvokeTyped from router (backport #21224) (#21392) 2024-08-23 21:59:49 +00:00
depinject.go feat(accounts/base): give chains the possibility to pick their chosen pubkey types for the base accounts (backport #21466) (#21524) 2024-09-03 22:11:25 +00:00
genesis_test.go fix (x/accounts): Fix genesis condition check (#20645) 2024-06-12 16:25:02 +00:00
genesis.go fix (x/accounts): Fix genesis condition check (#20645) 2024-06-12 16:25:02 +00:00
go.mod refactor: remove viper as a direct dependency (backport #21635) (#21672) 2024-09-12 08:41:25 +00:00
go.sum refactor: remove viper as a direct dependency (backport #21635) (#21672) 2024-09-12 08:41:25 +00:00
keeper_account_abstraction.go refactor(auth): decouple auth from x/accounts account abstraction types (#20875) 2024-07-08 14:15:17 +00:00
keeper_test.go feat(x/accounts): use router service from env (#20003) 2024-04-15 15:41:11 +00:00
keeper.go refactor(core,stf,x)!: remove InvokeTyped from router (backport #21224) (#21392) 2024-08-23 21:59:49 +00:00
module.go refactor(x): update to latest core (partial backport #21166) (#21214) 2024-08-08 08:28:19 +00:00
msg_server_test.go feat(x/accounts): use router service from env (#20003) 2024-04-15 15:41:11 +00:00
msg_server.go feat(accounts): add genesis account initialization (#20642) 2024-06-12 14:19:13 +00:00
query_server_test.go feat(x/accounts): Add schema caching feature and corresponding test case (#20055) 2024-05-17 05:11:45 +00:00
query_server.go feat(x/accounts): Add schema caching feature and corresponding test case (#20055) 2024-05-17 05:11:45 +00:00
README.md feat(accounts): add genesis account initialization (#20642) 2024-06-12 14:19:13 +00:00
sonar-project.properties chore: force reload sonar cloud (#20480) 2024-05-29 11:12:09 +00:00
utils_test.go refactor(core,types,runtime,x): make HasName not mandatory (#20984) 2024-07-19 08:58:47 +00:00

x/accounts

The x/accounts module provides module and facilities for writing smart cosmos-sdk accounts.

Genesis

Creating accounts on genesis

In order to create accounts at genesis, the x/accounts module allows developers to provide a list of genesis MsgInit messages that will be executed in the x/accounts genesis flow.

The init messages are generated offline. You can also use the following CLI command to generate the json messages: simd accounts tx init [account type] [msg] --from me --genesis. This will generate a jsonified init message wrapped in an x/accounts MsgInit.

This follows the same initialization flow and rules that would happen if the chain is running. The only concrete difference is that this is happening at the genesis block.

For example, given the following genesis.json file:

{
  "app_state": {
    "accounts": {
      "init_account_msgs": [
        {
          "sender": "account_creator_address",
          "account_type": "lockup",
          "message": {
            "@type": "cosmos.accounts.defaults.lockup.MsgInitLockupAccount",
            "owner": "some_owner",
            "end_time": "..",
            "start_time": ".."
          },
          "funds": [
            {
              "denom": "stake",
              "amount": "1000"
            }
          ]
        }
      ]
    }
  }
}

The accounts module will run the lockup account initialization message.