Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class WithdrawRequest
final WithdrawalSource? from;
final String? memo;
final bool max;
final String? ibcSourceChannel;
final int? ibcSourceChannel;

@override
Map<String, dynamic> toJson() => {
Expand All @@ -52,9 +52,6 @@ class WithdrawRequest
if (fee != null) 'fee': fee!.toJson(),
if (from != null) 'from': from!.toRpcParams(),
if (memo != null) 'memo': memo,
//TODO! Migrate breaking changes when the ibc_source_channel is
// changed to a numeric type in KDF.
// https://github.com/KomodoPlatform/komodo-defi-framework/pull/2298#discussion_r2034825504
if (ibcSourceChannel != null) 'ibc_source_channel': ibcSourceChannel,
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class WithdrawMethodsNamespace extends BaseRpcMethodNamespace {
from: params.from,
memo: params.memo,
max: params.isMax ?? false,
ibcSourceChannel: params.ibcSourceChannel,
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ class _WithdrawalScreenState extends State<WithdrawalScreen> {
memo: _memoController.text.isEmpty ? null : _memoController.text,
isMax: _isMaxAmount,
ibcTransfer: _isIbcTransfer ? true : null,
ibcSourceChannel: _isIbcTransfer
? int.tryParse(_ibcChannelController.text)
: null,
);

final preview = await _sdk.withdrawals.previewWithdrawal(params);
Expand Down Expand Up @@ -326,6 +329,7 @@ class _WithdrawalScreenState extends State<WithdrawalScreen> {
labelText: 'IBC Channel',
hintText: 'Enter IBC channel ID',
),
keyboardType: TextInputType.number,
validator:
(value) =>
value?.isEmpty == true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class WithdrawParameters extends Equatable {
this.from,
this.memo,
this.ibcTransfer,
this.ibcSourceChannel,
this.isMax,
}) : assert(
amount != null || (isMax ?? false),
Expand All @@ -166,6 +167,7 @@ class WithdrawParameters extends Equatable {
final WithdrawalSource? from;
final String? memo;
final bool? ibcTransfer;
final int? ibcSourceChannel;
final bool? isMax;

JsonMap toJson() => {
Expand All @@ -177,6 +179,7 @@ class WithdrawParameters extends Equatable {
if (from != null) 'from': from!.toRpcParams(),
if (memo != null) 'memo': memo,
if (ibcTransfer != null) 'ibc_transfer': ibcTransfer,
if (ibcSourceChannel != null) 'ibc_source_channel': ibcSourceChannel,
};

@override
Expand All @@ -188,6 +191,7 @@ class WithdrawParameters extends Equatable {
from,
memo,
ibcTransfer,
ibcSourceChannel,
isMax,
];
}
Expand Down
Loading