Skip to content

Commit 7f40a4f

Browse files
committed
Add docs to TransferMsgBuilder
1 parent bbc86ce commit 7f40a4f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

packages/std/src/ibc/transfer_msg_builder.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ pub struct TransferMsgBuilder<MemoData> {
7676
}
7777

7878
impl TransferMsgBuilder<EmptyMemo> {
79+
/// Creates a new transfer message with the given parameters and no memo.
7980
pub fn new(
8081
channel_id: impl Into<String>,
8182
to_address: impl Into<String>,
@@ -91,6 +92,7 @@ impl TransferMsgBuilder<EmptyMemo> {
9192
}
9293
}
9394

95+
/// Adds a memo text to the transfer message.
9496
pub fn with_memo(self, memo: impl Into<String>) -> TransferMsgBuilder<WithMemo> {
9597
TransferMsgBuilder {
9698
channel_id: self.channel_id,
@@ -101,6 +103,10 @@ impl TransferMsgBuilder<EmptyMemo> {
101103
}
102104
}
103105

106+
/// Adds an IBC source callback entry to the memo field.
107+
/// Use this if you want to receive IBC callbacks on the source chain.
108+
///
109+
/// For more info check out [`crate::IbcSourceCallbackMsg`].
104110
pub fn with_src_callback(
105111
self,
106112
src_callback: IbcSrcCallback,
@@ -114,6 +120,10 @@ impl TransferMsgBuilder<EmptyMemo> {
114120
}
115121
}
116122

123+
/// Adds an IBC destination callback entry to the memo field.
124+
/// Use this if you want to receive IBC callbacks on the destination chain.
125+
///
126+
/// For more info check out [`crate::IbcDestinationCallbackMsg`].
117127
pub fn with_dst_callback(
118128
self,
119129
dst_callback: IbcDstCallback,
@@ -129,6 +139,10 @@ impl TransferMsgBuilder<EmptyMemo> {
129139
}
130140

131141
impl TransferMsgBuilder<WithSrcCallback> {
142+
/// Adds an IBC destination callback entry to the memo field.
143+
/// Use this if you want to receive IBC callbacks on the destination chain.
144+
///
145+
/// For more info check out [`crate::IbcDestinationCallbackMsg`].
132146
pub fn with_dst_callback(
133147
self,
134148
dst_callback: IbcDstCallback,
@@ -147,6 +161,10 @@ impl TransferMsgBuilder<WithSrcCallback> {
147161
}
148162

149163
impl TransferMsgBuilder<WithDstCallback> {
164+
/// Adds an IBC source callback entry to the memo field.
165+
/// Use this if you want to receive IBC callbacks on the source chain.
166+
///
167+
/// For more info check out [`crate::IbcSourceCallbackMsg`].
150168
pub fn with_src_callback(
151169
self,
152170
src_callback: IbcSrcCallback,

0 commit comments

Comments
 (0)