Soneso / stellar_flutter_sdk

Stellar SDK for flutter - dart, Stellar, Horizon, Soneso
MIT License
71 stars 33 forks source link

ChangeTrustOperationBuilder(asset, '922337203685.4775807') fails on web #96

Open rinat-enikeev opened 5 days ago

rinat-enikeev commented 5 days ago

Web. The following code.

AccountResponse account =
        await stellarSDK.accounts.account(keyPair.accountId);

    Transaction transaction = TransactionBuilder(account)
        .addOperation(
            ChangeTrustOperationBuilder(predefinedAsset, '922337203685.4775807')
                .build())
        .build();

    transaction.sign(keyPair, kDebugMode ? Network.TESTNET : Network.PUBLIC);

    SubmitTransactionResponse response =
        await stellarSDK.submitTransaction(transaction);

Produces the folowing transaction:

Screenshot 2024-06-23 at 22 26 27

Note: limit: -922,337,203,685.4775808 (raw: -9223372036854775808)

christian-rogobete commented 3 days ago

Hello @rinat-enikeev, the sdk is not tested on web. It supports, Android, iOS, Linux, MacOs and Windows. Screenshot 2024-06-25 at 15 54 51 Nevertheless, I will try to reproduce and fix this.

rinat-enikeev commented 19 hours ago

Hey @christian-rogobete, thank you!

Just in case you need an example, you can clone this repository and run on web (chrome).

The code is simple.

christian-rogobete commented 5 hours ago

Hey @rinat-enikeev, thank you for providing example code. I already fixed the issue in this commit and the fix will be available in the next release. This improvement will also allow large amounts on web for many other operations such as, create_account, payment, path_payment_strict_send, path_payment_strict_receive, manage_sell_offer, manage_buy_offer, create_passive_sell_offer, clawback, create_claimable_balance, liquidity_pool_deposit, liquidity_pool_withdraw. However, the sdk will still not officially support web. I am planning another release for official web support in the coming months.