2020-07-21 09:56:14 -07:00
|
|
|
<!--
|
|
|
|
order: 4
|
|
|
|
-->
|
|
|
|
|
|
|
|
# Messages
|
2020-08-01 02:16:22 -07:00
|
|
|
|
2020-08-14 14:46:26 -07:00
|
|
|
## MsgTransfer
|
2020-08-01 02:16:22 -07:00
|
|
|
|
|
|
|
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
|
2020-09-03 13:23:20 -07:00
|
|
|
TimeoutHeight ibcexported.Height
|
2020-08-01 02:16:22 -07:00
|
|
|
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
|
2020-08-14 14:46:26 -07:00
|
|
|
- `Token.Denom` is not a valid IBC denomination as per [ADR 001 - Coin Source Tracing](./../../../docs/architecture/adr-001-coin-source-tracing.md).
|
2020-08-01 02:16:22 -07:00
|
|
|
|
|
|
|
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.
|