Skip to content

Commit

Permalink
feat: support memmo field in ibc transfer (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszjasiuk authored Mar 27, 2024
1 parent c4e5413 commit a6e3a68
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const submitIbcTransfer = async (
portId,
channelId,
nativeToken,
memo,
} = ibcArgs;
const integration = getIntegration(chainKey);

Expand All @@ -72,6 +73,7 @@ export const submitIbcTransfer = async (
amount,
portId,
channelId,
memo,
},
txProps: {
token: nativeToken || tokenAddress,
Expand Down
4 changes: 3 additions & 1 deletion packages/shared/lib/src/sdk/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ pub struct SubmitIbcTransferMsg {
channel_id: String,
timeout_height: Option<u64>,
timeout_sec_offset: Option<u64>,
memo: Option<String>,
}

/// Maps serialized tx_msg into IbcTransferTx args.
Expand All @@ -310,6 +311,7 @@ pub fn ibc_transfer_tx_args(
channel_id,
timeout_height,
timeout_sec_offset,
memo,
} = ibc_transfer_msg;

let source_address = Address::from_str(&source)?;
Expand All @@ -323,7 +325,7 @@ pub fn ibc_transfer_tx_args(

let args = args::TxIbcTransfer {
tx,
memo: None,
memo,
source,
receiver,
token,
Expand Down
3 changes: 3 additions & 0 deletions packages/types/src/tx/schema/ibcTransfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export class IbcTransferMsgValue {
@field({ type: option("u64") })
timeoutSecOffset?: bigint;

@field({ type: option("string") })
memo?: string;

constructor(data: IbcTransferProps) {
Object.assign(this, data);
}
Expand Down

0 comments on commit a6e3a68

Please sign in to comment.