Skip to content

Commit 4ef4d3b

Browse files
authored
add helper function to retrieve account (#151)
1 parent faf00a8 commit 4ef4d3b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packages/stellar_client/lib/src/helpers.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,22 @@ Future<List<BalanceInfo>> getBalanceByAccountID({
4040
}
4141
}
4242

43+
Future<AccountResponse> getAccount({
44+
required NetworkType network,
45+
required String accountId,
46+
}) async {
47+
late StellarSDK _sdk;
48+
switch (network) {
49+
case NetworkType.TESTNET:
50+
_sdk = StellarSDK.TESTNET;
51+
break;
52+
case NetworkType.PUBLIC:
53+
_sdk = StellarSDK.PUBLIC;
54+
break;
55+
}
56+
return await _sdk.accounts.account(accountId);
57+
}
58+
4359
class _TempTx {
4460
final String href;
4561
final PaymentOperationResponse response;

0 commit comments

Comments
 (0)