@@ -138,27 +138,26 @@ class Client {
138
138
}
139
139
140
140
Future <bool > addTrustLine () async {
141
- try {
142
- for (var entry in _currencies.currencies.entries) {
143
- String currencyCode = entry.key;
144
- currency.Currency currentCurrency = entry.value;
141
+ for (var entry in _currencies.currencies.entries) {
142
+ String currencyCode = entry.key;
143
+ currency.Currency currentCurrency = entry.value;
145
144
146
- String issuerAccountId = currentCurrency.issuer;
147
- Asset currencyAsset = AssetTypeCreditAlphaNum4 (
148
- currentCurrency.assetCode, issuerAccountId);
145
+ String issuerAccountId = currentCurrency.issuer;
146
+ Asset currencyAsset =
147
+ AssetTypeCreditAlphaNum4 ( currentCurrency.assetCode, issuerAccountId);
149
148
150
- ChangeTrustOperationBuilder changeTrustOperation =
151
- ChangeTrustOperationBuilder (currencyAsset, "300000" );
149
+ ChangeTrustOperationBuilder changeTrustOperation =
150
+ ChangeTrustOperationBuilder (currencyAsset, "300000" );
152
151
153
- final account = await _sdk.accounts.account (accountId);
152
+ final account = await _sdk.accounts.account (accountId);
154
153
155
- Transaction transaction = TransactionBuilder (account)
156
- .addOperation (changeTrustOperation.build ())
157
- .build ();
158
- transaction.sign (_keyPair, _stellarNetwork);
154
+ Transaction transaction = TransactionBuilder (account)
155
+ .addOperation (changeTrustOperation.build ())
156
+ .build ();
157
+ transaction.sign (_keyPair, _stellarNetwork);
159
158
160
- SubmitTransactionResponse response =
161
- await _sdk.submitTransaction (transaction);
159
+ SubmitTransactionResponse response =
160
+ await _sdk.submitTransaction (transaction);
162
161
163
162
if (! response.success) {
164
163
logger.e ("Failed to add trustline for $currencyCode " );
@@ -167,6 +166,7 @@ class Client {
167
166
logger.i ("trustline for $currencyCode was added successfully" );
168
167
return true ;
169
168
}
169
+ }
170
170
171
171
logger.i ("No trustlines were processed" );
172
172
return false ;
0 commit comments