Skip to main content

Messages

The abstractaccount module provides messages for managing abstract accounts and their associated actors, authenticators, and proxies.

MsgUpdateParams

MsgUpdateParams allows the module authority (typically the governance module) to update the abstractaccount module parameters.

message MsgUpdateParams {
option (cosmos.msg.v1.signer) = "sender";

string sender = 1;
Params params = 2;
}

1. Fields

1. Sender

The address authorized to update parameters. This is typically the governance module address.

  • Type: string
  • Validation: Must match the module's configured authority address

Params

The complete set of new parameters to apply.

  • Type: Params
  • Validation: All parameter validation rules apply

1. Response

message MsgUpdateParamsResponse {}

An empty response is returned on success.

MsgRegisterAccount

MsgRegisterAccount registers a new abstract account by instantiating a CosmWasm contract that acts as the account's proxy.

message MsgRegisterAccount {
option (cosmos.msg.v1.signer) = "sender";

// Sender is the actor who signs the message
string sender = 1;

// CodeID indicates which wasm binary code is to be used for this contract
uint64 code_id = 2;

// Msg is the JSON-encoded instantiate message for the contract
bytes msg = 3;

// Funds are coins to be deposited to the contract on instantiation
repeated cosmos.base.v1beta1.Coin funds = 4;

// Salt is an arbitrary value to be used in deriving the account address.
// Max 64 bytes.
bytes salt = 5;
}

2. Fields

2. Sender

The address of the actor registering the account.

  • Type: string
  • Required: Yes

CodeID

The CosmWasm code ID of the proxy contract to instantiate.

  • Type: uint64
  • Validation: Must be a supported proxy code ID

Msg

The JSON-encoded instantiation message for the contract.

  • Type: bytes (RawContractMessage)
  • Required: Yes
  • Format: Valid JSON that matches the contract's instantiate schema

Funds

Coins to be deposited to the contract on instantiation.

  • Type: repeated Coin
  • Required: No (can be empty)

Salt

An arbitrary value used to derive the account address, enabling predictable addresses.

  • Type: bytes
  • Max length: 64 bytes
  • Required: No

2. Response

message MsgRegisterAccountResponse {
string address = 1;
bytes data = 2;
}

Returns the address of the newly created account and any data returned by the contract's instantiation.

Usage

Example:

{
"sender": "dchain1...",
"code_id": 1,
"msg": "eyJvd25lciI6ImRjaGFpbjEuLi4ifQ==",
"funds": [],
"salt": "bXlzYWx0"
}

MsgUpdateActor

MsgUpdateActor allows the module authority to update the address associated with a specific actor role.

message MsgUpdateActor {
option (cosmos.msg.v1.signer) = "sender";

string sender = 1;

// The DChainActor role in string
string actor = 2;

// The address of the actor
string address = 3;
}

3. Fields

3. Sender

The address authorized to update actors. This is typically the governance module address.

  • Type: string
  • Validation: Must match the module's configured authority address

Actor

The actor role identifier (e.g., "validator", "operator").

  • Type: string
  • Required: Yes

1. Address

The new address to associate with this actor role.

  • Type: string (cosmos.AddressString)
  • Validation: Must be a valid cosmos address

3. Response

message MsgUpdateActorResponse {}

An empty response is returned on success.

MsgUpdateAuthenticator

MsgUpdateAuthenticator allows the module authority to update the address associated with a specific authenticator role.

message MsgUpdateAuthenticator {
option (cosmos.msg.v1.signer) = "sender";

string sender = 1;

// The DChainAuthenticator role in string
string authenticator = 2;

// The address of the authenticator
string address = 3;
}

4. Fields

4. Sender

The address authorized to update authenticators. This is typically the governance module address.

  • Type: string
  • Validation: Must match the module's configured authority address

Authenticator

The authenticator role identifier.

  • Type: string
  • Required: Yes

2. Address

The new address to associate with this authenticator role.

  • Type: string (cosmos.AddressString)
  • Validation: Must be a valid cosmos address

4. Response

message MsgUpdateAuthenticatorResponse {}

An empty response is returned on success.

MsgUpdateSupportedProxies

MsgUpdateSupportedProxies allows the module authority to add or remove proxy code IDs from the set of supported proxies.

message MsgUpdateSupportedProxies {
option (cosmos.msg.v1.signer) = "sender";

string sender = 1;

// Proxies are the map of proxy code ID to boolean value, which indicates
// whether proxy should be supported or not. (if true, proxy will be added, if
// false, proxy will be removed)
map<uint64, bool> proxies = 2;
}

5. Fields

5. Sender

The address authorized to update supported proxies. This is typically the governance module address.

  • Type: string
  • Validation: Must match the module's configured authority address

Proxies

A map of code IDs to boolean values indicating whether to add (true) or remove (false) each proxy from the supported set.

  • Type: map<uint64, bool>
  • Required: Yes

Example:

{
"sender": "dchain10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn",
"proxies": {
"1": true,
"2": true,
"3": false
}
}

This would add proxies with code IDs 1 and 2, and remove proxy with code ID 3.

5. Response

message MsgUpdateSupportedProxiesResponse {}

An empty response is returned on success.

Authority-Only Messages

All messages except MsgRegisterAccount can only be executed by the module authority (typically the governance module). These messages are typically submitted through governance proposals.

Example governance proposal:

d tx gov submit-proposal /path/to/proposal.json --from=<key>

Where proposal.json contains:

{
"messages": [
{
"@type": "/d.abstractaccount.v1.MsgUpdateSupportedProxies",
"sender": "dchain10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn",
"proxies": {
"1": true
}
}
],
"metadata": "ipfs://CID",
"deposit": "10000000udt",
"title": "Add New Proxy Support",
"summary": "Enable support for proxy code ID 1"
}