# Messages

# MsgSend

Copy // MsgSend represents a message to send coins from one account to another. message MsgSend { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""]; string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""]; repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; }

handleMsgSend just runs inputOutputCoins.

Copy handleMsgSend(msg MsgSend) inputSum = 0 for input in inputs inputSum += input.Amount outputSum = 0 for output in outputs outputSum += output.Amount if inputSum != outputSum: fail with "input/output amount mismatch" return inputOutputCoins(msg.Inputs, msg.Outputs)