cosmos-sdk/x/ibc-transfer/spec/04_messages.md

41 lines
1.1 KiB
Markdown
Raw Normal View History

<!--
order: 4
-->
# Messages
### MsgTransfer
A fungible token cross chain transfer is achieved by using the `MsgTransfer`:
```go
type MsgTransfer struct {
SourcePort string
SourceChannel string
Token sdk.Coin
Sender sdk.AccAddress
Receiver string
TimeoutHeight uint64
TimeoutTimestamp uint64
}
```
This message is expected to fail if:
- `SourcePort` is invalid (see 24-host naming requirements)
- `SourceChannel` is invalid (see 24-host naming requirements)
- `Token` is invalid (denom is invalid or amount is negative)
- `Token.Amount` is not positive
- `Sender` is empty
- `Receiver` is empty
- `TimeoutHeight` and `TimeoutTimestamp` are both zero
This message will send a fungible token to the counterparty chain represented
by the counterparty Channel End connected to the Channel End with the identifiers
`SourcePort` and `SourceChannel`.
The denomination provided for transfer should correspond to the same denomination
represented on this chain. The prefixes will be added as necessary upon by the
receiving chain.