diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c45838..9a2dd34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [0.8.0] - 26.Jun.2020. +- Extend documentation and tests, extend orders result. + ## [0.7.9] - 25.Jun.2020. - Added examples, documentation, tests and bugfixes. diff --git a/README.md b/README.md index a4761b3..ce4c626 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # [Stellar SDK for Flutter](https://github.com/Soneso/stellar_flutter_sdk) -![Beta Version](https://img.shields.io/badge/Beta-v0.7.9-yellow.svg) +![Beta Version](https://img.shields.io/badge/Beta-v0.8.0-yellow.svg) ![Dart](https://img.shields.io/badge/Dart-green.svg) ![Flutter](https://img.shields.io/badge/Flutter-blue.svg) ![Supports Stellar Horizon v1.4.0](https://img.shields.io/badge/Horizon-v1.4.0-blue.svg) @@ -8,7 +8,7 @@ The Soneso open source Stellar SDK for Flutter is build with Dart and provides APIs to build and sign transactions, connect and query [Horizon](https://github.com/stellar/horizon). -The SDK is currently in beta stage - v. 0.7.9. +The SDK is currently in beta stage - v. 0.8.0. ## Installation @@ -16,7 +16,7 @@ The SDK is currently in beta stage - v. 0.7.9. 1. Add the dependency to your pubspec.yaml file: ``` dependencies: - stellar_flutter_sdk: ^0.7.9 + stellar_flutter_sdk: ^0.8.0 ``` 2. Install it (command line or IDE): ``` diff --git a/lib/src/stellar_sdk.dart b/lib/src/stellar_sdk.dart index 3a59ff8..d41a5b9 100644 --- a/lib/src/stellar_sdk.dart +++ b/lib/src/stellar_sdk.dart @@ -27,7 +27,7 @@ import 'requests/trades_request_builder.dart'; /// Main class of the flutter stellar sdk. class StellarSDK { - static const versionNumber = "0.7.9"; + static const versionNumber = "0.8.0"; static final StellarSDK PUBLIC = new StellarSDK("https://horizon.stellar.org"); diff --git a/pubspec.yaml b/pubspec.yaml index 8cdf73d..39e8d6d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: stellar_flutter_sdk description: A stellar blockchain sdk that query's horizon, build, signs and submits transactions to the stellar netweok. -version: 0.7.9 +version: 0.8.0 homepage: https://github.com/Soneso/stellar_flutter_sdk environment: diff --git a/sdk_api_doc.zip b/sdk_api_doc.zip index 117e469..de50d8f 100644 Binary files a/sdk_api_doc.zip and b/sdk_api_doc.zip differ diff --git a/test/trading_test.dart b/test/trading_test.dart index 8714a8c..ad004cc 100644 --- a/test/trading_test.dart +++ b/test/trading_test.dart @@ -16,16 +16,23 @@ void main() { await FriendBot.fundTestAccount(buyerAccountId); AccountResponse buyerAccount = await sdk.accounts.account(buyerAccountId); - CreateAccountOperationBuilder caob = CreateAccountOperationBuilder(issuerAccountId, "10"); - Transaction transaction = TransactionBuilder(buyerAccount, Network.TESTNET).addOperation(caob.build()).build(); + CreateAccountOperationBuilder caob = + CreateAccountOperationBuilder(issuerAccountId, "10"); + Transaction transaction = TransactionBuilder(buyerAccount, Network.TESTNET) + .addOperation(caob.build()) + .build(); transaction.sign(buyerKeipair); - SubmitTransactionResponse response = await sdk.submitTransaction(transaction); + SubmitTransactionResponse response = + await sdk.submitTransaction(transaction); assert(response.success); Asset astroDollar = AssetTypeCreditAlphaNum12("ASTRO", issuerAccountId); - ChangeTrustOperationBuilder ctob = ChangeTrustOperationBuilder(astroDollar,"10000"); - transaction = TransactionBuilder(buyerAccount, Network.TESTNET).addOperation(ctob.build()).build(); + ChangeTrustOperationBuilder ctob = + ChangeTrustOperationBuilder(astroDollar, "10000"); + transaction = TransactionBuilder(buyerAccount, Network.TESTNET) + .addOperation(ctob.build()) + .build(); transaction.sign(buyerKeipair); response = await sdk.submitTransaction(transaction); @@ -34,13 +41,18 @@ void main() { String amountBuying = "100"; String price = "0.5"; - ManageBuyOfferOperation ms = ManageBuyOfferOperationBuilder(Asset.NATIVE, astroDollar, amountBuying, price).build(); - transaction = TransactionBuilder(buyerAccount, Network.TESTNET).addOperation(ms).build(); + ManageBuyOfferOperation ms = ManageBuyOfferOperationBuilder( + Asset.NATIVE, astroDollar, amountBuying, price) + .build(); + transaction = TransactionBuilder(buyerAccount, Network.TESTNET) + .addOperation(ms) + .build(); transaction.sign(buyerKeipair); response = await sdk.submitTransaction(transaction); assert(response.success); - List offers = (await sdk.offers.forAccount(buyerAccountId).execute()).records; + List offers = + (await sdk.offers.forAccount(buyerAccountId).execute()).records; assert(offers.length == 1); OfferResponse offer = offers.first; assert(offer.buying == astroDollar); @@ -59,8 +71,13 @@ void main() { // update offer amountBuying = "150"; price = "0.3"; - ms = ManageBuyOfferOperationBuilder(Asset.NATIVE, astroDollar, amountBuying, price).setOfferId(offerId).build(); - transaction = TransactionBuilder(buyerAccount, Network.TESTNET).addOperation(ms).build(); + ms = ManageBuyOfferOperationBuilder( + Asset.NATIVE, astroDollar, amountBuying, price) + .setOfferId(offerId) + .build(); + transaction = TransactionBuilder(buyerAccount, Network.TESTNET) + .addOperation(ms) + .build(); transaction.sign(buyerKeipair); response = await sdk.submitTransaction(transaction); assert(response.success); @@ -81,19 +98,22 @@ void main() { // delete offer amountBuying = "0"; - ms = ManageBuyOfferOperationBuilder(Asset.NATIVE, astroDollar, amountBuying, price).setOfferId(offerId).build(); - transaction = TransactionBuilder(buyerAccount, Network.TESTNET).addOperation(ms).build(); + ms = ManageBuyOfferOperationBuilder( + Asset.NATIVE, astroDollar, amountBuying, price) + .setOfferId(offerId) + .build(); + transaction = TransactionBuilder(buyerAccount, Network.TESTNET) + .addOperation(ms) + .build(); transaction.sign(buyerKeipair); response = await sdk.submitTransaction(transaction); assert(response.success); offers = (await sdk.offers.forAccount(buyerAccountId).execute()).records; assert(offers.length == 0); - }); test('manage sell offer', () async { - KeyPair issuerKeipair = KeyPair.random(); KeyPair sellerKeipair = KeyPair.random(); @@ -103,25 +123,35 @@ void main() { await FriendBot.fundTestAccount(sellerAccountId); AccountResponse sellerAccount = await sdk.accounts.account(sellerAccountId); - CreateAccountOperation co = CreateAccountOperationBuilder(issuerAccountId, "10").build(); - Transaction transaction = TransactionBuilder(sellerAccount, Network.TESTNET).addOperation(co).build(); + CreateAccountOperation co = + CreateAccountOperationBuilder(issuerAccountId, "10").build(); + Transaction transaction = TransactionBuilder(sellerAccount, Network.TESTNET) + .addOperation(co) + .build(); transaction.sign(sellerKeipair); - SubmitTransactionResponse response = await sdk.submitTransaction(transaction); + SubmitTransactionResponse response = + await sdk.submitTransaction(transaction); assert(response.success); AccountResponse issuerAccount = await sdk.accounts.account(issuerAccountId); Asset moonDollar = AssetTypeCreditAlphaNum4("MOON", issuerAccountId); - ChangeTrustOperationBuilder ctob = ChangeTrustOperationBuilder(moonDollar,"10000"); - transaction = TransactionBuilder(sellerAccount, Network.TESTNET).addOperation(ctob.build()).build(); + ChangeTrustOperationBuilder ctob = + ChangeTrustOperationBuilder(moonDollar, "10000"); + transaction = TransactionBuilder(sellerAccount, Network.TESTNET) + .addOperation(ctob.build()) + .build(); transaction.sign(sellerKeipair); response = await sdk.submitTransaction(transaction); assert(response.success); - PaymentOperation po = PaymentOperationBuilder(sellerAccountId, moonDollar, "2000").build(); - transaction = TransactionBuilder(issuerAccount, Network.TESTNET).addOperation(po).build(); + PaymentOperation po = + PaymentOperationBuilder(sellerAccountId, moonDollar, "2000").build(); + transaction = TransactionBuilder(issuerAccount, Network.TESTNET) + .addOperation(po) + .build(); transaction.sign(issuerKeipair); response = await sdk.submitTransaction(transaction); @@ -130,13 +160,18 @@ void main() { String amountSelling = "100"; String price = "0.5"; - ManageSellOfferOperation ms = ManageSellOfferOperationBuilder(moonDollar, Asset.NATIVE, amountSelling, price).build(); - transaction = TransactionBuilder(sellerAccount, Network.TESTNET).addOperation(ms).build(); + ManageSellOfferOperation ms = ManageSellOfferOperationBuilder( + moonDollar, Asset.NATIVE, amountSelling, price) + .build(); + transaction = TransactionBuilder(sellerAccount, Network.TESTNET) + .addOperation(ms) + .build(); transaction.sign(sellerKeipair); response = await sdk.submitTransaction(transaction); assert(response.success); - List offers = (await sdk.offers.forAccount(sellerAccountId).execute()).records; + List offers = + (await sdk.offers.forAccount(sellerAccountId).execute()).records; assert(offers.length == 1); OfferResponse offer = offers.first; assert(offer.buying == Asset.NATIVE); @@ -157,8 +192,13 @@ void main() { // update offer amountSelling = "150"; price = "0.3"; - ms = ManageSellOfferOperationBuilder(moonDollar, Asset.NATIVE, amountSelling, price).setOfferId(offerId).build(); - transaction = TransactionBuilder(sellerAccount, Network.TESTNET).addOperation(ms).build(); + ms = ManageSellOfferOperationBuilder( + moonDollar, Asset.NATIVE, amountSelling, price) + .setOfferId(offerId) + .build(); + transaction = TransactionBuilder(sellerAccount, Network.TESTNET) + .addOperation(ms) + .build(); transaction.sign(sellerKeipair); response = await sdk.submitTransaction(transaction); assert(response.success); @@ -182,19 +222,22 @@ void main() { // delete offer amountSelling = "0"; - ms = ManageSellOfferOperationBuilder(moonDollar, Asset.NATIVE, amountSelling, price).setOfferId(offerId).build(); - transaction = TransactionBuilder(sellerAccount, Network.TESTNET).addOperation(ms).build(); + ms = ManageSellOfferOperationBuilder( + moonDollar, Asset.NATIVE, amountSelling, price) + .setOfferId(offerId) + .build(); + transaction = TransactionBuilder(sellerAccount, Network.TESTNET) + .addOperation(ms) + .build(); transaction.sign(sellerKeipair); response = await sdk.submitTransaction(transaction); assert(response.success); offers = (await sdk.offers.forAccount(sellerAccountId).execute()).records; assert(offers.length == 0); - }); test('create passive sell offer', () async { - KeyPair issuerKeipair = KeyPair.random(); KeyPair sellerKeipair = KeyPair.random(); @@ -204,25 +247,35 @@ void main() { await FriendBot.fundTestAccount(sellerAccountId); AccountResponse sellerAccount = await sdk.accounts.account(sellerAccountId); - CreateAccountOperation co = CreateAccountOperationBuilder(issuerAccountId, "10").build(); - Transaction transaction = TransactionBuilder(sellerAccount, Network.TESTNET).addOperation(co).build(); + CreateAccountOperation co = + CreateAccountOperationBuilder(issuerAccountId, "10").build(); + Transaction transaction = TransactionBuilder(sellerAccount, Network.TESTNET) + .addOperation(co) + .build(); transaction.sign(sellerKeipair); - SubmitTransactionResponse response = await sdk.submitTransaction(transaction); + SubmitTransactionResponse response = + await sdk.submitTransaction(transaction); assert(response.success); AccountResponse issuerAccount = await sdk.accounts.account(issuerAccountId); Asset marsDollar = AssetTypeCreditAlphaNum4("MARS", issuerAccountId); - ChangeTrustOperationBuilder ctob = ChangeTrustOperationBuilder(marsDollar,"10000"); - transaction = TransactionBuilder(sellerAccount, Network.TESTNET).addOperation(ctob.build()).build(); + ChangeTrustOperationBuilder ctob = + ChangeTrustOperationBuilder(marsDollar, "10000"); + transaction = TransactionBuilder(sellerAccount, Network.TESTNET) + .addOperation(ctob.build()) + .build(); transaction.sign(sellerKeipair); response = await sdk.submitTransaction(transaction); assert(response.success); - PaymentOperation po = PaymentOperationBuilder(sellerAccountId, marsDollar, "2000").build(); - transaction = TransactionBuilder(issuerAccount, Network.TESTNET).addOperation(po).build(); + PaymentOperation po = + PaymentOperationBuilder(sellerAccountId, marsDollar, "2000").build(); + transaction = TransactionBuilder(issuerAccount, Network.TESTNET) + .addOperation(po) + .build(); transaction.sign(issuerKeipair); response = await sdk.submitTransaction(transaction); @@ -231,13 +284,19 @@ void main() { String amountSelling = "100"; String price = "0.5"; - CreatePassiveSellOfferOperation cpso = CreatePassiveSellOfferOperationBuilder(marsDollar, Asset.NATIVE, amountSelling, price).build(); - transaction = TransactionBuilder(sellerAccount, Network.TESTNET).addOperation(cpso).build(); + CreatePassiveSellOfferOperation cpso = + CreatePassiveSellOfferOperationBuilder( + marsDollar, Asset.NATIVE, amountSelling, price) + .build(); + transaction = TransactionBuilder(sellerAccount, Network.TESTNET) + .addOperation(cpso) + .build(); transaction.sign(sellerKeipair); response = await sdk.submitTransaction(transaction); assert(response.success); - List offers = (await sdk.offers.forAccount(sellerAccountId).execute()).records; + List offers = + (await sdk.offers.forAccount(sellerAccountId).execute()).records; assert(offers.length == 1); OfferResponse offer = offers.first; assert(offer.buying == Asset.NATIVE); @@ -258,8 +317,13 @@ void main() { // update offer amountSelling = "150"; price = "0.3"; - ManageSellOfferOperation ms = ManageSellOfferOperationBuilder(marsDollar, Asset.NATIVE, amountSelling, price).setOfferId(offerId).build(); - transaction = TransactionBuilder(sellerAccount, Network.TESTNET).addOperation(ms).build(); + ManageSellOfferOperation ms = ManageSellOfferOperationBuilder( + marsDollar, Asset.NATIVE, amountSelling, price) + .setOfferId(offerId) + .build(); + transaction = TransactionBuilder(sellerAccount, Network.TESTNET) + .addOperation(ms) + .build(); transaction.sign(sellerKeipair); response = await sdk.submitTransaction(transaction); assert(response.success); @@ -283,15 +347,18 @@ void main() { // delete offer amountSelling = "0"; - ms = ManageSellOfferOperationBuilder(marsDollar, Asset.NATIVE, amountSelling, price).setOfferId(offerId).build(); - transaction = TransactionBuilder(sellerAccount, Network.TESTNET).addOperation(ms).build(); + ms = ManageSellOfferOperationBuilder( + marsDollar, Asset.NATIVE, amountSelling, price) + .setOfferId(offerId) + .build(); + transaction = TransactionBuilder(sellerAccount, Network.TESTNET) + .addOperation(ms) + .build(); transaction.sign(sellerKeipair); response = await sdk.submitTransaction(transaction); assert(response.success); offers = (await sdk.offers.forAccount(sellerAccountId).execute()).records; assert(offers.length == 0); - }); - } diff --git a/test/trust_test.dart b/test/trust_test.dart index 145ef8e..c0eb722 100644 --- a/test/trust_test.dart +++ b/test/trust_test.dart @@ -15,19 +15,28 @@ void main() { await FriendBot.fundTestAccount(trustorAccountId); - AccountResponse trustorAccount = await sdk.accounts.account(trustorAccountId); - CreateAccountOperationBuilder caob = CreateAccountOperationBuilder(issuerAccountId, "10"); - Transaction transaction = TransactionBuilder(trustorAccount, Network.TESTNET).addOperation(caob.build()).build(); + AccountResponse trustorAccount = + await sdk.accounts.account(trustorAccountId); + CreateAccountOperationBuilder caob = + CreateAccountOperationBuilder(issuerAccountId, "10"); + Transaction transaction = + TransactionBuilder(trustorAccount, Network.TESTNET) + .addOperation(caob.build()) + .build(); transaction.sign(trustorKeipair); - SubmitTransactionResponse response = await sdk.submitTransaction(transaction); + SubmitTransactionResponse response = + await sdk.submitTransaction(transaction); assert(response.success); String assetCode = "ASTRO"; Asset astroDollar = AssetTypeCreditAlphaNum12(assetCode, issuerAccountId); String limit = "10000"; - ChangeTrustOperationBuilder ctob = ChangeTrustOperationBuilder(astroDollar, limit); - transaction = TransactionBuilder(trustorAccount, Network.TESTNET).addOperation(ctob.build()).build(); + ChangeTrustOperationBuilder ctob = + ChangeTrustOperationBuilder(astroDollar, limit); + transaction = TransactionBuilder(trustorAccount, Network.TESTNET) + .addOperation(ctob.build()) + .build(); transaction.sign(trustorKeipair); response = await sdk.submitTransaction(transaction); @@ -47,7 +56,9 @@ void main() { // update trustline, change limit. limit = "40000"; ctob = ChangeTrustOperationBuilder(astroDollar, limit); - transaction = TransactionBuilder(trustorAccount, Network.TESTNET).addOperation(ctob.build()).build(); + transaction = TransactionBuilder(trustorAccount, Network.TESTNET) + .addOperation(ctob.build()) + .build(); transaction.sign(trustorKeipair); response = await sdk.submitTransaction(transaction); @@ -67,7 +78,9 @@ void main() { // delete trustline. limit = "0"; ctob = ChangeTrustOperationBuilder(astroDollar, limit); - transaction = TransactionBuilder(trustorAccount, Network.TESTNET).addOperation(ctob.build()).build(); + transaction = TransactionBuilder(trustorAccount, Network.TESTNET) + .addOperation(ctob.build()) + .build(); transaction.sign(trustorKeipair); response = await sdk.submitTransaction(transaction); @@ -93,17 +106,25 @@ void main() { await FriendBot.fundTestAccount(trustorAccountId); - AccountResponse trustorAccount = await sdk.accounts.account(trustorAccountId); - CreateAccountOperationBuilder caob = CreateAccountOperationBuilder(issuerAccountId, "10"); - Transaction transaction = TransactionBuilder(trustorAccount, Network.TESTNET).addOperation(caob.build()).build(); + AccountResponse trustorAccount = + await sdk.accounts.account(trustorAccountId); + CreateAccountOperationBuilder caob = + CreateAccountOperationBuilder(issuerAccountId, "10"); + Transaction transaction = + TransactionBuilder(trustorAccount, Network.TESTNET) + .addOperation(caob.build()) + .build(); transaction.sign(trustorKeipair); - SubmitTransactionResponse response = await sdk.submitTransaction(transaction); + SubmitTransactionResponse response = + await sdk.submitTransaction(transaction); assert(response.success); AccountResponse issuerAccount = await sdk.accounts.account(issuerAccountId); SetOptionsOperationBuilder sopb = SetOptionsOperationBuilder(); sopb.setSetFlags(3); // Auth required, auth revocable - transaction = TransactionBuilder(issuerAccount, Network.TESTNET).addOperation(sopb.build()).build(); + transaction = TransactionBuilder(issuerAccount, Network.TESTNET) + .addOperation(sopb.build()) + .build(); transaction.sign(issuerKeipair); response = await sdk.submitTransaction(transaction); assert(response.success); @@ -116,8 +137,11 @@ void main() { Asset astroDollar = AssetTypeCreditAlphaNum12(assetCode, issuerAccountId); String limit = "10000"; - ChangeTrustOperationBuilder ctob = ChangeTrustOperationBuilder(astroDollar, limit); - transaction = TransactionBuilder(trustorAccount, Network.TESTNET).addOperation(ctob.build()).build(); + ChangeTrustOperationBuilder ctob = + ChangeTrustOperationBuilder(astroDollar, limit); + transaction = TransactionBuilder(trustorAccount, Network.TESTNET) + .addOperation(ctob.build()) + .build(); transaction.sign(trustorKeipair); response = await sdk.submitTransaction(transaction); @@ -134,23 +158,31 @@ void main() { } assert(found); - - PaymentOperation po = PaymentOperationBuilder(trustorAccountId, astroDollar, "100").build(); - transaction = TransactionBuilder(issuerAccount, Network.TESTNET).addOperation(po).build(); + PaymentOperation po = + PaymentOperationBuilder(trustorAccountId, astroDollar, "100").build(); + transaction = TransactionBuilder(issuerAccount, Network.TESTNET) + .addOperation(po) + .build(); transaction.sign(issuerKeipair); response = await sdk.submitTransaction(transaction); assert(!response.success); // not authorized. - AllowTrustOperation aop = AllowTrustOperationBuilder(trustorAccountId, assetCode, 1).build(); // authorize - transaction = TransactionBuilder(issuerAccount, Network.TESTNET).addOperation(aop).build(); + AllowTrustOperation aop = + AllowTrustOperationBuilder(trustorAccountId, assetCode, 1) + .build(); // authorize + transaction = TransactionBuilder(issuerAccount, Network.TESTNET) + .addOperation(aop) + .build(); transaction.sign(issuerKeipair); response = await sdk.submitTransaction(transaction); assert(response.success); po = PaymentOperationBuilder(trustorAccountId, astroDollar, "100").build(); - transaction = TransactionBuilder(issuerAccount, Network.TESTNET).addOperation(po).build(); + transaction = TransactionBuilder(issuerAccount, Network.TESTNET) + .addOperation(po) + .build(); transaction.sign(issuerKeipair); response = await sdk.submitTransaction(transaction); @@ -159,20 +191,29 @@ void main() { String amountSelling = "100"; String price = "0.5"; - CreatePassiveSellOfferOperation cpso = CreatePassiveSellOfferOperationBuilder(astroDollar, Asset.NATIVE, amountSelling, price).build(); - transaction = TransactionBuilder(trustorAccount, Network.TESTNET).addOperation(cpso).build(); + CreatePassiveSellOfferOperation cpso = + CreatePassiveSellOfferOperationBuilder( + astroDollar, Asset.NATIVE, amountSelling, price) + .build(); + transaction = TransactionBuilder(trustorAccount, Network.TESTNET) + .addOperation(cpso) + .build(); transaction.sign(trustorKeipair); response = await sdk.submitTransaction(transaction); assert(response.success); - List offers = (await sdk.offers.forAccount(trustorAccountId).execute()).records; + List offers = + (await sdk.offers.forAccount(trustorAccountId).execute()).records; assert(offers.length == 1); OfferResponse offer = offers.first; assert(offer.buying == Asset.NATIVE); assert(offer.selling == astroDollar); - aop = AllowTrustOperationBuilder(trustorAccountId, assetCode, 0).build(); // authorize - transaction = TransactionBuilder(issuerAccount, Network.TESTNET).addOperation(aop).build(); + aop = AllowTrustOperationBuilder(trustorAccountId, assetCode, 0) + .build(); // authorize + transaction = TransactionBuilder(issuerAccount, Network.TESTNET) + .addOperation(aop) + .build(); transaction.sign(issuerKeipair); response = await sdk.submitTransaction(transaction); @@ -186,20 +227,27 @@ void main() { for (Balance balance in trustorAccount.balances) { if (balance.assetCode == assetCode) { found = true; - assert(double.parse(balance.balance) == 100.0); + assert(double.parse(balance.balance) == 100.0); break; } } assert(found); - aop = AllowTrustOperationBuilder(trustorAccountId, assetCode, 1).build(); // authorize - transaction = TransactionBuilder(issuerAccount, Network.TESTNET).addOperation(aop).build(); + aop = AllowTrustOperationBuilder(trustorAccountId, assetCode, 1) + .build(); // authorize + transaction = TransactionBuilder(issuerAccount, Network.TESTNET) + .addOperation(aop) + .build(); transaction.sign(issuerKeipair); response = await sdk.submitTransaction(transaction); assert(response.success); - cpso = CreatePassiveSellOfferOperationBuilder(astroDollar, Asset.NATIVE, amountSelling, price).build(); - transaction = TransactionBuilder(trustorAccount, Network.TESTNET).addOperation(cpso).build(); + cpso = CreatePassiveSellOfferOperationBuilder( + astroDollar, Asset.NATIVE, amountSelling, price) + .build(); + transaction = TransactionBuilder(trustorAccount, Network.TESTNET) + .addOperation(cpso) + .build(); transaction.sign(trustorKeipair); response = await sdk.submitTransaction(transaction); assert(response.success); @@ -207,8 +255,11 @@ void main() { offers = (await sdk.offers.forAccount(trustorAccountId).execute()).records; assert(offers.length == 1); - aop = AllowTrustOperationBuilder(trustorAccountId, assetCode, 2).build(); // authorized to maintain liabilities. - transaction = TransactionBuilder(issuerAccount, Network.TESTNET).addOperation(aop).build(); + aop = AllowTrustOperationBuilder(trustorAccountId, assetCode, 2) + .build(); // authorized to maintain liabilities. + transaction = TransactionBuilder(issuerAccount, Network.TESTNET) + .addOperation(aop) + .build(); transaction.sign(issuerKeipair); response = await sdk.submitTransaction(transaction); assert(response.success); @@ -217,11 +268,12 @@ void main() { assert(offers.length == 1); po = PaymentOperationBuilder(trustorAccountId, astroDollar, "100").build(); - transaction = TransactionBuilder(issuerAccount, Network.TESTNET).addOperation(po).build(); + transaction = TransactionBuilder(issuerAccount, Network.TESTNET) + .addOperation(po) + .build(); transaction.sign(issuerKeipair); response = await sdk.submitTransaction(transaction); assert(!response.success); // is not authorized for new funds - }); }