Conversation
| val result = rpcClient.call(BridgeMethodConstants.METHOD_SEND_TRANSACTION, json.toJSONObject(request)) | ||
| return result.getString(ResponseConstants.KEY_SIGNED_BOC) | ||
| return when { | ||
| result.has(ResponseConstants.KEY_SIGNED_BOC) -> result.getString(ResponseConstants.KEY_SIGNED_BOC) |
There was a problem hiding this comment.
These aren't arbitrary changes, they fix real pre-existing bugs in main.
transactions.ts calls wallet(walletId, 'sendTransaction', args.transactionContent) where transactionContent is a TransactionRequest object. On main, Kotlin serialized transactionContent: String as a JSON string literal, so the bridge received {"transactionContent": "{...}"}, a double-encoded string inside JSON instead of an inline object, and the JS side received a string it couldn't treat as a transaction request. parseTransactionContent() fixes this by parsing the string into a JsonElement so it serializes as a proper inline JSON object that the bridge can work with.
The signedBoc/boc fallback is needed because staking transaction flows return { boc: ... } rather than { signedBoc: ... }. Without the fallback, those flows would crash with a missing key even though the transaction succeeded.
Both bugs were always present in main.
TONWalletKit-Android/api/src/main/java/io/ton/walletkit/ITONStakingManager.kt
Outdated
Show resolved
Hide resolved
TONWalletKit-Android/api/src/main/java/io/ton/walletkit/ITONStakingManager.kt
Show resolved
Hide resolved
…kersStakingProvider internal
No description provided.