Skip to content

feat: implement gasless transaction support#114

Merged
nikdim03 merged 11 commits into
mainfrom
feature/ton-1663-support-gasless
Jun 18, 2026
Merged

feat: implement gasless transaction support#114
nikdim03 merged 11 commits into
mainfrom
feature/ton-1663-support-gasless

Conversation

@nikdim03

@nikdim03 nikdim03 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

Release Notes

  • New Features
    • Added support for sending USDT tokens in addition to TON
    • Introduced gasless transfers for USDT utilizing relay providers
    • Enhanced send transaction UI with improved input validation, inline error messages, and conditional fields based on asset selection
    • New gasless provider management interface for relay configuration and operations

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a gasless relay provider API and USDT multi-currency send to the Android WalletKit SDK and demo app. The TONWalletAdapter interface is renamed to ITONWalletAdapter with publicKey made suspend and identity/signing methods moved into it. ITONGaslessManager and ITONGaslessProvider interfaces are introduced alongside a full bridge RPC layer. Provider registration methods across staking, streaming, and swap are also renamed for consistency. The bundled JS bridge is updated to include a gasless defi module and TONConnect protocol v3.0.0.

Changes

Gasless and currency-aware transaction flow

Layer / File(s) Summary
Public API contracts for gasless, signing, and adapter rename
TONWalletKit-Android/api/src/main/java/io/ton/walletkit/TONProviderType.kt, ...gasless/TONGaslessProviderIdentifier.kt, ...gasless/tonapi/TONApiGaslessProviderIdentifier.kt, ...gasless/ITONGaslessProvider.kt, ...gasless/ITONGaslessManager.kt, ...model/ITONWalletAdapter.kt, TONWalletKit-Android/api/src/main/java/io/ton/walletkit/ITONWallet.kt, ...ITONWalletKit.kt, ...staking/ITONStakingManager.kt, ...streaming/ITONStreamingManager.kt, ...streaming/ITONStreamingProvider.kt, ...swap/ITONSwapProvider.kt, ...request/TONWalletConnectionRequest.kt
Adds Gasless enum variant, TONGaslessProviderIdentifier, ITONGaslessProvider, and ITONGaslessManager interfaces. Renames TONWalletAdapterITONWalletAdapter with suspend publicKey, adds client(). ITONWallet extends ITONWalletAdapter, removes id/address/client properties, makes nft nullable. Adds tonApiGaslessProvider/gasless to ITONWalletKit. Renames registerregisterProvider, ididentifier, and quotegetQuote across provider interfaces.
Engine interface contracts and bridge method constants
TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/WalletKitEngine.kt, ...internal/constants/BridgeMethodConstants.kt
Extends WalletKitEngine with per-wallet signing bridge methods and a full gasless provider lifecycle section. Adds JS bridge method name constants for signing helpers and all gasless operations. Updates adapter API parameters to ITONWalletAdapter.
Bridge RPC request DTOs and BridgeRpcClient wrappers
...engine/operations/requests/WalletRequests.kt, ...engine/operations/requests/GaslessRequests.kt, ...engine/operations/WalletOperations.kt, ...engine/operations/GaslessOperations.kt
Adds @Serializable request DTOs for signed-wallet and gasless bridge calls. Implements BridgeRpcClient extension functions that serialize inputs as JsonElement and invoke the bridge for public key, signed artifacts, and all gasless provider lifecycle/query/send operations.
WebView engine delegation for signing and gasless operations
TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/WebViewWalletKitEngine.kt
Adds override methods delegating all new signing and gasless provider operations to rpcClient, updates addWallet/createAdapter to use ITONWalletAdapter.
Core SDK wallet, gasless manager, and provider-manager implementations
...core/TONWallet.kt, ...core/TONWalletKit.kt, ...gasless/BuiltInGaslessProvider.kt, ...gasless/TONGaslessManager.kt, ...engine/adapter/BridgeWalletAdapter.kt, ...engine/state/AdapterManager.kt, ...engine/state/KotlinSwapProviderManager.kt, ...core/streaming/TONStreamingManager.kt, ...core/streaming/TONStreamingProviderImpl.kt, ...staking/TONStakingManager.kt, ...swap/BuiltInSwapProvider.kt, TONWalletKit-Android/impl/src/test/java/io/ton/walletkit/*
Implements adapter overrides in TONWallet, wires gaslessManager in TONWalletKit, adds BuiltInGaslessProvider and TONGaslessManager. Migrates all internal manager types to ITONWalletAdapter and renames provider registration methods. Updates tests to runTest and ITONWalletAdapter.
Bundled JS bridge with gasless module
TONWalletKit-Android/impl/src/main/assets/walletkit/walletkit-android-bridge.mjs
Updates to TONConnect protocol v3.0.0, integrates GaslessProvider/GaslessManager/GaslessError defi modules, adds hasSignMessageSupport utility, adds optional featureName to getMaxOutgoingMessages, switches module init wiring to init_errors$4, enriches lifecycle logging, and exposes get gasless() on NetworkManager.
Demo TON/USDT and gasless send ViewModel logic
AndroidDemo/.../viewmodel/WalletOperationsViewModel.kt, AndroidDemo/.../viewmodel/WalletKitViewModel.kt
Adds SendCurrency enum, extends sendLocalTransaction to branch on TON vs USDT and gasless flag, adds sendUsdtGasless helper (register provider → getConfig → getQuote → signMessage → sendTransaction), toUsdtRawUnits, and USDT constants. WalletKitViewModel forwards new parameters and migrates identifier()/address() accessors.
SendTransactionScreen redesign with currency and gasless controls
AndroidDemo/.../ui/screen/SendTransactionScreen.kt
Replaces Material3 scaffold with TonConnectSheetScaffold, adds currency and gasless state, asset picker, USDT-only gasless toggle, conditional comment field, inline error display, generalized SendField composable, and updated onSend callback signature.
Currency and gasless callback propagation through demo layers
AndroidDemo/.../ui/screen/WalletScreen.kt, ...LegacyWalletScreen.kt, ...actions/WalletActions.kt, ...actions/WalletActionsImpl.kt
Propagates currency and gasless through onSend lambdas in WalletScreen and LegacyWalletScreen, updates WalletActions interface, and WalletActionsImpl override forwarding to WalletKitViewModel.
Demo address/identifier accessor migrations
AndroidDemo/.../core/WalletKitDemoApp.kt, AndroidDemo/.../ui/screen/NFTDetailsScreen.kt, AndroidDemo/.../ui/sheet/StakingSheet.kt, AndroidDemo/.../viewmodel/JettonsListViewModel.kt, ...NFTsListViewModel.kt, ...SessionsViewModel.kt, ...StakingViewModel.kt, ...SwapViewModel.kt, ...TransactionHistoryViewModel.kt, ...WalletLifecycleManager.kt
Migrates all demo usages of wallet.address property to wallet.address().value method call, wallet.id to wallet.identifier(), and provider registration calls from register/remove to registerProvider/removeProvider across screens, sheets, and ViewModels.

Sequence Diagram

sequenceDiagram
  participant SendTransactionScreen
  participant WalletOperationsViewModel
  participant ITONGaslessManager
  participant ITONWallet
  rect rgba(100, 180, 255, 0.5)
    note over SendTransactionScreen,WalletOperationsViewModel: USDT + gasless=true path
  end
  SendTransactionScreen->>WalletOperationsViewModel: onSend(recipient, amount, USDT, gasless=true)
  WalletOperationsViewModel->>ITONGaslessManager: registerProvider / setDefaultProvider
  WalletOperationsViewModel->>ITONGaslessManager: getConfig() → responseDestination
  WalletOperationsViewModel->>ITONGaslessManager: getQuote(TONGaslessQuoteParams) → quote
  WalletOperationsViewModel->>ITONWallet: signedSignMessage(quote.messages, validUntil) → TONBase64
  WalletOperationsViewModel->>ITONGaslessManager: sendTransaction(TONGaslessSendParams) → response
  WalletOperationsViewModel-->>SendTransactionScreen: success/error state
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Suggested reviewers

  • ProudOfZiggy

Poem

🐇 Hop, hop, no gas to pay today,
USDT flows the gasless way!
The bridge now speaks v3's tongue,
Provider APIs freshly sprung.
With ITONWalletAdapter renamed right,
This bunny ships clean code tonight! 🚀

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/ton-1663-support-gasless

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (2)
TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/core/TONWalletKit.kt (1)

494-495: ⚡ Quick win

Guard gasless() with lifecycle check.

gasless() currently skips checkNotDestroyed(), so callers can obtain a manager from a destroyed kit instance and only fail later in deeper engine calls.

Suggested patch
-    override suspend fun gasless(): ITONGaslessManager = gaslessManager
+    override suspend fun gasless(): ITONGaslessManager {
+        checkNotDestroyed()
+        return gaslessManager
+    }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/core/TONWalletKit.kt`
around lines 494 - 495, The gasless() accessor in TONWalletKit returns
gaslessManager without ensuring the kit isn't destroyed; add a lifecycle guard
by invoking checkNotDestroyed() at the start of the override suspend fun
gasless() before returning gaslessManager so callers cannot obtain the manager
from a destroyed TONWalletKit instance.
AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/actions/WalletActions.kt (1)

33-33: ⚡ Quick win

Decouple action contracts from the ViewModel package.

WalletActions now imports SendCurrency from presentation.viewmodel, which couples this interface to an implementation-oriented package. Please move SendCurrency to a neutral contract/model location (e.g., presentation.model) and update imports in actions/UI/viewmodels.

Also applies to: 73-80

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/actions/WalletActions.kt`
at line 33, Move the SendCurrency type out of the implementation-specific
presentation.viewmodel package into a neutral contract package (e.g.,
presentation.model) and update all imports that reference it: change import
occurrences in WalletActions (symbol: WalletActions) and in the UI and viewmodel
files mentioned (symbols: any ViewModel classes or UI components that import
SendCurrency) to the new package; ensure the SendCurrency file/class is
relocated (or re-exported) under presentation.model and update package
declarations so compilation and CI import resolution succeed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/ui/screen/SendTransactionScreen.kt`:
- Around line 184-212: The current UI hides the comment field whenever currency
== SendCurrency.USDT, which allows a stale comment to be submitted when
switching to a non-gasless USDT path; instead, show the comment input based on
the gasless flag. Update SendTransactionScreen.kt so the SendField for comment
is rendered when !gasless (regardless of SendCurrency), and keep the gasless
toggle only when currency == SendCurrency.USDT; ensure you reference the
existing gasless boolean, the SendField(component) and comment state, and that
WalletOperationsViewModel.kt continues to receive comment only from the
visible/comment-bound input.

In
`@AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/viewmodel/WalletOperationsViewModel.kt`:
- Around line 161-166: The gasless provider obtained via val provider =
walletKit().tonApiGaslessProvider() is registered and maybe set as default, but
subsequent calls to quote/send are not passing this resolved provider so
ITONGaslessManager may use a different default; update the code paths that call
the gasless quote and send methods (the calls that currently rely on the
manager's default) to pass the explicit provider variable instead (i.e., when
invoking the gasless manager's quote and send helpers, supply provider as the
provider argument) while keeping the existing
hasProvider/registerProvider/setDefaultProvider logic intact.
- Line 194: The current toUsdtRawUnits(amount: String) silently truncates
fractional USDT digits because toBigInteger() is used after shifting, so amounts
with more than USDT_DECIMALS are floored; change to validate and reject inputs
with scale > USDT_DECIMALS or use an exact conversion to fail fast: in
toUsdtRawUnits, create val bd = BigDecimal(amount), check bd.scale() <=
USDT_DECIMALS and bd > BigDecimal.ZERO, then return
bd.movePointRight(USDT_DECIMALS).toBigIntegerExact().toString() (or throw an
IllegalArgumentException with a clear message if the scale check fails) so
inputs with >6 decimals are rejected instead of truncated.

In
`@TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/operations/GaslessOperations.kt`:
- Around line 48-53: The createTonApiGaslessProvider function is using the
global Json encoder instead of the BridgeRpcClient's configured json; update the
call inside BridgeRpcClient.createTonApiGaslessProvider to use the client's
json.encodeToJsonElement(...) for serializing TONTonApiGaslessProviderConfig
(same style as the other gasless ops), i.e. replace
Json.encodeToJsonElement(...) with json.encodeToJsonElement(...) so the Bridge
payload uses the configured encoder on the BridgeRpcClient instance.

---

Nitpick comments:
In
`@AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/actions/WalletActions.kt`:
- Line 33: Move the SendCurrency type out of the implementation-specific
presentation.viewmodel package into a neutral contract package (e.g.,
presentation.model) and update all imports that reference it: change import
occurrences in WalletActions (symbol: WalletActions) and in the UI and viewmodel
files mentioned (symbols: any ViewModel classes or UI components that import
SendCurrency) to the new package; ensure the SendCurrency file/class is
relocated (or re-exported) under presentation.model and update package
declarations so compilation and CI import resolution succeed.

In
`@TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/core/TONWalletKit.kt`:
- Around line 494-495: The gasless() accessor in TONWalletKit returns
gaslessManager without ensuring the kit isn't destroyed; add a lifecycle guard
by invoking checkNotDestroyed() at the start of the override suspend fun
gasless() before returning gaslessManager so callers cannot obtain the manager
from a destroyed TONWalletKit instance.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 13f7e042-ce8f-4d84-9c75-036f25e34238

📥 Commits

Reviewing files that changed from the base of the PR and between 3ecd2bd and 50f533a.

⛔ Files ignored due to path filters (14)
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONConnectionRequestEvent.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONDefiProviderType.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONGaslessConfig.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONGaslessProviderMetadata.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONGaslessProviderMetadataOverride.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONGaslessQuote.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONGaslessQuoteParams.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONGaslessSendParams.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONGaslessSendResponse.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONGaslessSupportedAsset.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONSwapParams.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONSwapQuoteParams.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONTonApiGaslessChainConfig.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONTonApiGaslessProviderConfig.kt is excluded by !**/generated/**
📒 Files selected for processing (24)
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/actions/WalletActions.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/actions/WalletActionsImpl.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/ui/screen/LegacyWalletScreen.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/ui/screen/SendTransactionScreen.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/ui/screen/WalletScreen.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/viewmodel/SwapViewModel.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/viewmodel/WalletKitViewModel.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/viewmodel/WalletOperationsViewModel.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/ITONWallet.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/ITONWalletKit.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/gasless/ITONGaslessManager.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/gasless/TONGaslessProvider.kt
  • TONWalletKit-Android/impl/src/main/assets/walletkit/walletkit-android-bridge.mjs
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/core/TONWallet.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/core/TONWalletKit.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/WalletKitEngine.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/WebViewWalletKitEngine.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/operations/GaslessOperations.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/operations/WalletOperations.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/operations/requests/GaslessRequests.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/operations/requests/WalletRequests.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/gasless/TONGaslessManager.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/internal/constants/BridgeMethodConstants.kt
  • TONWalletKit-Android/impl/src/test/java/io/ton/walletkit/engine/operations/SwapOperationsTest.kt

@nikdim03

Copy link
Copy Markdown
Contributor Author
Screenshot_20260615_121319

Comment thread TONWalletKit-Android/api/src/main/java/io/ton/walletkit/ITONWallet.kt Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
TONWalletKit-Android/api/src/main/java/io/ton/walletkit/ITONWallet.kt (1)

51-52: ⚠️ Potential issue | 🟠 Major

Remove the duplicate val network property from ITONWallet.

TONWalletAdapter already defines fun network(): TONNetwork, and ITONWallet duplicates this by adding val network: TONNetwork. Implementations must satisfy both surfaces, creating two paths to the same value and risking divergence. Use the single adapter method and remove the property from the interface.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@TONWalletKit-Android/api/src/main/java/io/ton/walletkit/ITONWallet.kt` around
lines 51 - 52, Remove the duplicate val network property from the ITONWallet
interface (lines 51-52). Since TONWalletAdapter already provides the same
functionality through the fun network(): TONNetwork method, having both creates
redundancy and potential inconsistency between implementations. Delete the
network property definition entirely from ITONWallet to maintain a single source
of truth for this value.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@TONWalletKit-Android/api/src/main/java/io/ton/walletkit/gasless/ITONGaslessManager.kt`:
- Around line 59-60: The `provider()` method in the ITONGaslessManager interface
is declared with a nullable return type (ITONGaslessProvider?) but the actual
implementation in TONGaslessManager always returns a provider and never null,
creating a contract mismatch. Choose one approach: (1) update the implementation
of the `provider()` method to return null when the provider with the given
TONGaslessProviderIdentifier is not registered, ensuring the nullable return
type matches actual behavior, or (2) change the return type of `provider()` in
both the interface and implementation from nullable to non-nullable
(ITONGaslessProvider) and add documentation to the method stating that callers
should use `hasProvider()` to validate provider registration before calling this
method. Ensure consistency between the interface contract and implementation
behavior.

In `@TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/core/TONWallet.kt`:
- Around line 244-248: The fakeSignature parameter in the signedSignMessage
function is accepted but not passed to the engine call, making fake-signature
mode unreachable. Update the signedSignMessage method to pass the fakeSignature
parameter to engine.getSignedSignMessage(). Then propagate this parameter
through the entire call chain by adding fakeSignature to the method signatures
of WalletKitEngine.getSignedSignMessage(),
WebViewWalletKitEngine.getSignedSignMessage(), and
BridgeRpcClient.getSignedSignMessage(). Also add the fakeSignature field to
GetSignedSignMessageRequest and ensure the matching JS bridge handler receives
and processes this parameter.

---

Outside diff comments:
In `@TONWalletKit-Android/api/src/main/java/io/ton/walletkit/ITONWallet.kt`:
- Around line 51-52: Remove the duplicate val network property from the
ITONWallet interface (lines 51-52). Since TONWalletAdapter already provides the
same functionality through the fun network(): TONNetwork method, having both
creates redundancy and potential inconsistency between implementations. Delete
the network property definition entirely from ITONWallet to maintain a single
source of truth for this value.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1bfbfccc-5f30-4805-b899-a0204f0da7dc

📥 Commits

Reviewing files that changed from the base of the PR and between 61da9f8 and c0f5aaa.

⛔ Files ignored due to path filters (36)
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONAccountState.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONConnectionApprovalProof.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONEmulationMessageContent.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONGaslessConfig.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONGaslessProviderMetadata.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONGaslessProviderMetadataOverride.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONGaslessQuote.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONGaslessQuoteParams.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONGaslessSendParams.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONGaslessSendResponse.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONGaslessSupportedAsset.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONJettonTransferItem.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONJettonsTransferRequest.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONNFTRawTransferRequestMessage.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONNftTransferItem.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONProofMessage.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONSendTransactionApprovalResponse.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONSendTransactionResponse.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONSignDataBinary.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONSignDataCell.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONSignDataPreviewBinary.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONSignDataPreviewCell.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONSignMessageApprovalResponse.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONStakingProviderInfo.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONStakingProviderMetadata.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONStakingQuoteParams.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONStakingTokenInfo.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONSwapParams.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONSwapQuoteParams.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONTokenInfo.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONTonApiGaslessChainConfig.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONTonApiGaslessProviderConfig.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONTonTransferItem.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONTransactionMessageContent.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONTransactionRequestMessage.kt is excluded by !**/generated/**
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/api/generated/TONTransferRequest.kt is excluded by !**/generated/**
📒 Files selected for processing (22)
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/viewmodel/WalletOperationsViewModel.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/ITONWallet.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/ITONWalletKit.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/TONProviderType.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/gasless/ITONGaslessManager.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/gasless/ITONGaslessProvider.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/gasless/TONGaslessProviderIdentifier.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/gasless/tonapi/TONApiGaslessProviderIdentifier.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/model/TONWalletAdapter.kt
  • TONWalletKit-Android/impl/src/main/assets/walletkit/walletkit-android-bridge.mjs
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/core/TONWallet.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/core/TONWalletKit.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/WalletKitEngine.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/WebViewWalletKitEngine.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/adapter/BridgeWalletAdapter.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/operations/WalletOperations.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/operations/requests/WalletRequests.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/gasless/BuiltInGaslessProvider.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/gasless/TONGaslessManager.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/internal/constants/BridgeMethodConstants.kt
  • TONWalletKit-Android/impl/src/test/java/io/ton/walletkit/CustomWalletAdapterTest.kt
  • TONWalletKit-Android/impl/src/test/java/io/ton/walletkit/mockbridge/infra/MockScenario.kt
🚧 Files skipped from review as they are similar to previous changes (4)
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/gasless/TONGaslessManager.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/ITONWalletKit.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/viewmodel/WalletOperationsViewModel.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/core/TONWalletKit.kt

@nikdim03 nikdim03 force-pushed the feature/ton-1663-support-gasless branch from 7811a36 to 7cb8e82 Compare June 16, 2026 09:54

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
TONWalletKit-Android/api/src/main/java/io/ton/walletkit/swap/ITONSwapProvider.kt (1)

37-38: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix stale KDoc reference after method rename.

KDoc still points to [quote], but the interface now defines getQuote. Please update the reference to avoid broken/incorrect API docs.

🛠 Suggested fix
- * [TQuoteOptions] is the provider-specific options type for [quote];
+ * [TQuoteOptions] is the provider-specific options type for [getQuote];
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@TONWalletKit-Android/api/src/main/java/io/ton/walletkit/swap/ITONSwapProvider.kt`
around lines 37 - 38, The KDoc comment for the ITONSwapProvider interface
contains a stale method reference. Update the documentation reference from
[quote] to [getQuote] to match the actual method name in the interface. This
will ensure the generated API documentation correctly links to the renamed
method instead of a non-existent reference.
TONWalletKit-Android/api/src/main/java/io/ton/walletkit/ITONWalletKit.kt (1)

227-227: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update stale KDoc method reference.

The docs still reference ITONStakingManager.register, but the API now exposes registerProvider. This leaves public docs inconsistent with the current interface.

🛠 Suggested fix
- * Call [ITONStakingManager.register] with the returned provider to make it available for quotes.
+ * Call [ITONStakingManager.registerProvider] with the returned provider to make it available for quotes.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@TONWalletKit-Android/api/src/main/java/io/ton/walletkit/ITONWalletKit.kt` at
line 227, Update the KDoc comment that references ITONStakingManager.register to
instead reference registerProvider, which is the current method name exposed by
the API. Replace the outdated method reference in the documentation with the
correct method name to ensure consistency between the public docs and the actual
interface implementation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@TONWalletKit-Android/api/src/main/java/io/ton/walletkit/ITONWalletKit.kt`:
- Line 227: Update the KDoc comment that references ITONStakingManager.register
to instead reference registerProvider, which is the current method name exposed
by the API. Replace the outdated method reference in the documentation with the
correct method name to ensure consistency between the public docs and the actual
interface implementation.

In
`@TONWalletKit-Android/api/src/main/java/io/ton/walletkit/swap/ITONSwapProvider.kt`:
- Around line 37-38: The KDoc comment for the ITONSwapProvider interface
contains a stale method reference. Update the documentation reference from
[quote] to [getQuote] to match the actual method name in the interface. This
will ensure the generated API documentation correctly links to the renamed
method instead of a non-existent reference.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9388dede-32e6-42b0-8039-cb48efdaa639

📥 Commits

Reviewing files that changed from the base of the PR and between c0f5aaa and ee64232.

📒 Files selected for processing (45)
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/core/WalletKitDemoApp.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/ui/screen/NFTDetailsScreen.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/ui/sheet/StakingSheet.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/viewmodel/JettonsListViewModel.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/viewmodel/NFTsListViewModel.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/viewmodel/SessionsViewModel.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/viewmodel/StakingViewModel.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/viewmodel/SwapViewModel.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/viewmodel/TransactionHistoryViewModel.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/viewmodel/WalletKitViewModel.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/viewmodel/WalletLifecycleManager.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/viewmodel/WalletOperationsViewModel.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/ITONWallet.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/ITONWalletKit.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/gasless/ITONGaslessManager.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/gasless/ITONGaslessProvider.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/model/ITONWalletAdapter.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/request/TONWalletConnectionRequest.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/staking/ITONStakingManager.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/streaming/ITONStreamingManager.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/streaming/ITONStreamingProvider.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/swap/ITONSwapProvider.kt
  • TONWalletKit-Android/impl/src/main/assets/walletkit/walletkit-android-bridge.mjs
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/core/TONWallet.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/core/TONWalletKit.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/core/streaming/TONStreamingManager.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/core/streaming/TONStreamingProviderImpl.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/WalletKitEngine.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/WebViewWalletKitEngine.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/adapter/BridgeWalletAdapter.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/operations/GaslessOperations.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/operations/requests/GaslessRequests.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/state/AdapterManager.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/state/KotlinSwapProviderManager.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/gasless/BuiltInGaslessProvider.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/gasless/TONGaslessManager.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/internal/constants/BridgeMethodConstants.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/staking/TONStakingManager.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/swap/BuiltInSwapProvider.kt
  • TONWalletKit-Android/impl/src/test/java/io/ton/walletkit/CustomWalletAdapterTest.kt
  • TONWalletKit-Android/impl/src/test/java/io/ton/walletkit/WalletManagementTest.kt
  • TONWalletKit-Android/impl/src/test/java/io/ton/walletkit/mockbridge/DelayedReadyMockTest.kt
  • TONWalletKit-Android/impl/src/test/java/io/ton/walletkit/mockbridge/EngineMethodEfficiencyTests.kt
  • TONWalletKit-Android/impl/src/test/java/io/ton/walletkit/mockbridge/infra/MockScenario.kt
  • TONWalletKit-Android/impl/src/test/java/io/ton/walletkit/mockbridge/infra/TestWalletKitFactory.kt
✅ Files skipped from review due to trivial changes (2)
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/viewmodel/JettonsListViewModel.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/viewmodel/NFTsListViewModel.kt
🚧 Files skipped from review as they are similar to previous changes (8)
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/operations/requests/GaslessRequests.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/internal/constants/BridgeMethodConstants.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/gasless/BuiltInGaslessProvider.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/adapter/BridgeWalletAdapter.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/gasless/TONGaslessManager.kt
  • TONWalletKit-Android/api/src/main/java/io/ton/walletkit/gasless/ITONGaslessProvider.kt
  • TONWalletKit-Android/impl/src/main/java/io/ton/walletkit/engine/operations/GaslessOperations.kt
  • AndroidDemo/app/src/main/java/io/ton/walletkit/demo/presentation/viewmodel/WalletOperationsViewModel.kt

@nikdim03 nikdim03 merged commit 4420b3a into main Jun 18, 2026
36 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants