File tree 1 file changed +10
-3
lines changed
packages/stellar_client/lib/src
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -364,10 +364,17 @@ class Client {
364
364
}
365
365
throw Exception ('Balance with asset code ${currency } not found.' );
366
366
});
367
- // check that receiver account exists
368
- final receiver = await _sdk.accounts.account (accountId);
367
+ List <BalanceInfo > receiverBalance = [];
368
+ try {
369
+ // check that receiver account exists
370
+ receiverBalance = await getBalanceByAccountID (
371
+ network: _network, accountId: destinationAddress);
372
+ } catch (e) {
373
+ throw Exception ('Receiver account does not exist.' );
374
+ }
375
+
369
376
// check that asset exists
370
- var specificBalance = receiver.balances .firstWhere (
377
+ var specificBalance = receiverBalance .firstWhere (
371
378
(balance) => balance.assetCode == currency,
372
379
orElse: () {
373
380
throw Exception ('Balance with asset code ${currency } not found.' );
You can’t perform that action at this time.
0 commit comments