Messages

MsgSend

Send coins from one address to another.

// MsgSend represents a message to send coins from one account to another.
message MsgSend {
  option (cosmos.msg.v1.signer) = "from_address";

  option (gogoproto.equal)           = false;
  option (gogoproto.goproto_getters) = false;

  string   from_address                    = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  string   to_address                      = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  repeated cosmos.base.v1beta1.Coin amount = 3
      [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
}

The message will fail under the following conditions:

  • The coins do not have sending enabled

  • The to address is restricted

MsgMultiSend

Send coins from and to a series of different address. If any of the receiving addresses do not correspond to an existing account, a new account is created.

// MsgMultiSend represents an arbitrary multi-in, multi-out send message.
message MsgMultiSend {
  option (cosmos.msg.v1.signer) = "inputs";

  option (gogoproto.equal) = false;

  repeated Input  inputs  = 1 [(gogoproto.nullable) = false];
  repeated Output outputs = 2 [(gogoproto.nullable) = false];
}

The message will fail under the following conditions:

  • Any of the coins do not have sending enabled

  • Any of the to addresses are restricted

  • Any of the coins are locked

  • The inputs and outputs do not correctly correspond to one another

MsgUpdateParams

The bank module params can be updated through MsgUpdateParams, which can be done using governance proposal. The signer will always be the gov module account address.

// MsgUpdateParams is the Msg/UpdateParams request type.
//
// Since: cosmos-sdk 0.47
message MsgUpdateParams {
  option (cosmos.msg.v1.signer) = "authority";

  // authority is the address of the governance account.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

  // params defines the x/bank parameters to update.
  //
  // NOTE: All parameters must be supplied.
  Params params = 2 [(gogoproto.nullable) = false];
}

The message handling can fail if:

  • signer is not the gov module account address.

Last updated