Skip to main content
logo

transfer

The transfer module is responsible for the implementation of the ICS-20 protocol, which enables cross-chain fungible token transfers.

For more information, visit: https://ibc.cosmos.network/main/apps/transfer/overview.html

Message Types

Msg defines the ibc/transfer Msg service.

tx.proto
Copy

_4
service Msg {
_4
// Transfer defines a rpc handler method for MsgTransfer.
_4
rpc Transfer(MsgTransfer) returns (MsgTransferResponse);
_4
}

MsgTransfer

MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains.

See ICS Spec here: https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures

tx.proto
Copy

_22
message MsgTransfer {
_22
option (gogoproto.equal) = false;
_22
option (gogoproto.goproto_getters) = false;
_22
_22
// the port on which the packet will be sent
_22
string source_port = 1 [(gogoproto.moretags) = "yaml:\"source_port\""];
_22
// the channel by which the packet will be sent
_22
string source_channel = 2 [(gogoproto.moretags) = "yaml:\"source_channel\""];
_22
// the tokens to be transferred
_22
cosmos.base.v1beta1.Coin token = 3 [(gogoproto.nullable) = false];
_22
// the sender address
_22
string sender = 4;
_22
// the recipient address on the destination chain
_22
string receiver = 5;
_22
// Timeout height relative to the current block height.
_22
// The timeout is disabled when set to 0.
_22
ibc.core.client.v1.Height timeout_height = 6
_22
[(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false];
_22
// Timeout timestamp in absolute nanoseconds since unix epoch.
_22
// The timeout is disabled when set to 0.
_22
uint64 timeout_timestamp = 7 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""];
_22
}

MsgTransferResponse

MsgTransferResponse defines the Msg/Transfer response type.

tx.proto
Copy

_1
message MsgTransferResponse {}

Queries

Query provides defines the gRPC querier service.

query.proto
Copy

_21
service Query {
_21
// DenomTrace queries a denomination trace information.
_21
rpc DenomTrace(QueryDenomTraceRequest) returns (QueryDenomTraceResponse) {
_21
option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces/{hash}";
_21
}
_21
_21
// DenomTraces queries all denomination traces.
_21
rpc DenomTraces(QueryDenomTracesRequest) returns (QueryDenomTracesResponse) {
_21
option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces";
_21
}
_21
_21
// Params queries all parameters of the ibc-transfer module.
_21
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
_21
option (google.api.http).get = "/ibc/apps/transfer/v1/params";
_21
}
_21
_21
// DenomHash queries a denomination hash information.
_21
rpc DenomHash(QueryDenomHashRequest) returns (QueryDenomHashResponse) {
_21
option (google.api.http).get = "/ibc/apps/transfer/v1/denom_hashes/{trace}";
_21
}
_21
}

QueryDenomTraceRequest

QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC method.

query.proto
Copy

_4
message QueryDenomTraceRequest {
_4
// hash (in hex format) of the denomination trace information.
_4
string hash = 1;
_4
}

QueryDenomTraceResponse

QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC method.

query.proto
Copy

_4
message QueryDenomTraceResponse {
_4
// denom_trace returns the requested denomination trace information.
_4
DenomTrace denom_trace = 1;
_4
}

QueryDenomTracesRequest

QueryDenomTracesRequest is the request type for the Query/DenomTraces RPC method.

query.proto
Copy

_4
message QueryDenomTracesRequest {
_4
// pagination defines an optional pagination for the request.
_4
cosmos.base.query.v1beta1.PageRequest pagination = 1;
_4
}

QueryDenomTracesResponse

QueryDenomTracesResponse is the response type for the Query/DenomTraces RPC method.

query.proto
Copy

_6
message QueryDenomTracesResponse {
_6
// denom_traces returns all denominations trace information.
_6
repeated DenomTrace denom_traces = 1 [(gogoproto.castrepeated) = "Traces", (gogoproto.nullable) = false];
_6
// pagination defines the pagination in the response.
_6
cosmos.base.query.v1beta1.PageResponse pagination = 2;
_6
}

QueryParamsRequest

QueryParamsRequest is the request type for the Query/Params RPC method.

query.proto
Copy

_1
message QueryParamsRequest {}

QueryParamsResponse

QueryParamsResponse is the response type for the Query/Params RPC method.

query.proto
Copy

_4
message QueryParamsResponse {
_4
// params defines the parameters of the module.
_4
Params params = 1;
_4
}

QueryDenomHashRequest

QueryDenomHashRequest is the request type for the Query/DenomHash RPC method.

query.proto
Copy

_4
message QueryDenomHashRequest {
_4
// The denomination trace ([port_id]/[channel_id])+/[denom]
_4
string trace = 1;
_4
}

QueryDenomHashResponse

QueryDenomHashResponse is the response type for the Query/DenomHash RPC method.

query.proto
Copy

_4
message QueryDenomHashResponse {
_4
// hash (in hex format) of the denomination trace information.
_4
string hash = 1;
_4
}