File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
packages/stellar_client/lib/src Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -308,6 +308,14 @@ class Client {
308
308
required bool funded}) async {
309
309
// check if I have enough balance
310
310
final accountBalances = await this .getBalance ();
311
+ Memo memo = Memo .none ();
312
+
313
+ if (memoText != null ) {
314
+ memo = Memo .text (memoText);
315
+ } else if (memoHash != null ) {
316
+ memo = Memo .hash (memoHash);
317
+ }
318
+
311
319
accountBalances.firstWhere (
312
320
(b) =>
313
321
b.assetCode == currency &&
@@ -344,22 +352,14 @@ class Client {
344
352
.addOperation (
345
353
PaymentOperationBuilder (destinationAddress, tftAsset, amount)
346
354
.build ())
347
- .addMemo (memoText != null
348
- ? Memo .text (memoText)
349
- : memoHash != null
350
- ? Memo .hash (memoHash)
351
- : Memo .none ())
355
+ .addMemo (memo)
352
356
.build ();
353
357
} else {
354
358
transaction = TransactionBuilder (sender)
355
359
.addOperation (
356
360
PaymentOperationBuilder (destinationAddress, tftAsset, amount)
357
361
.build ())
358
- .addMemo (memoText != null
359
- ? Memo .text (memoText)
360
- : memoHash != null
361
- ? Memo .hash (memoHash)
362
- : Memo .none ())
362
+ .addMemo (memo)
363
363
.build ();
364
364
}
365
365
You can’t perform that action at this time.
0 commit comments