@@ -13,7 +13,15 @@ class Client {
13
13
Uint8List ? get privateKey => _keyPair.privateKey;
14
14
15
15
var logger = Logger (
16
- printer: PrettyPrinter (),
16
+ printer: PrettyPrinter (
17
+ methodCount: 2 ,
18
+ errorMethodCount: 8 ,
19
+ lineLength: 120 ,
20
+ colors: true ,
21
+ printEmojis: true ,
22
+ printTime: true ),
23
+ level: Level .debug,
24
+ filter: ProductionFilter (),
17
25
);
18
26
19
27
Client (this ._network, String secretSeed) {
@@ -161,12 +169,15 @@ class Client {
161
169
{required String destinationAddress,
162
170
required String amount,
163
171
required String currency,
164
- String ? memoText}) async {
172
+ String ? memoText,
173
+ Uint8List ? memoHash}) async {
165
174
try {
166
175
Transaction ? transaction = await _buildTransaction (
167
176
destinationAddress: destinationAddress,
168
177
amount: amount,
169
178
currency: currency,
179
+ memoText: memoText,
180
+ memoHash: memoHash,
170
181
funded: false );
171
182
172
183
transaction! .sign (_keyPair, _stellarNetwork);
@@ -293,6 +304,7 @@ class Client {
293
304
required String amount,
294
305
required String currency,
295
306
String ? memoText,
307
+ Uint8List ? memoHash,
296
308
required bool funded}) async {
297
309
// check if I have enough balance
298
310
final accountBalances = await this .getBalance ();
@@ -332,14 +344,22 @@ class Client {
332
344
.addOperation (
333
345
PaymentOperationBuilder (destinationAddress, tftAsset, amount)
334
346
.build ())
335
- .addMemo (memoText != null ? Memo .text (memoText) : Memo .none ())
347
+ .addMemo (memoText != null
348
+ ? Memo .text (memoText)
349
+ : memoHash != null
350
+ ? Memo .hash (memoHash)
351
+ : Memo .none ())
336
352
.build ();
337
353
} else {
338
354
transaction = TransactionBuilder (sender)
339
355
.addOperation (
340
356
PaymentOperationBuilder (destinationAddress, tftAsset, amount)
341
357
.build ())
342
- .addMemo (memoText != null ? Memo .text (memoText) : Memo .none ())
358
+ .addMemo (memoText != null
359
+ ? Memo .text (memoText)
360
+ : memoHash != null
361
+ ? Memo .hash (memoHash)
362
+ : Memo .none ())
343
363
.build ();
344
364
}
345
365
@@ -350,12 +370,14 @@ class Client {
350
370
{required String destinationAddress,
351
371
required String amount,
352
372
required String currency,
353
- String ? memoText}) async {
373
+ String ? memoText,
374
+ Uint8List ? memoHash}) async {
354
375
Transaction ? fundedTransaction = await _buildTransaction (
355
376
destinationAddress: destinationAddress,
356
377
amount: amount,
357
378
currency: currency,
358
379
memoText: memoText,
380
+ memoHash: memoHash,
359
381
funded: true );
360
382
361
383
fundedTransaction! .sign (_keyPair, _stellarNetwork);
0 commit comments