Skip to content

feat: detect the usdt network when sending #1573

Description

@jvsena42

Problem or use case

Sending USDT makes the user choose the recipient's network, and the app ignores any network a request names:

  • isUsdtPaymentInput (AppViewModel.kt) only recognises ethereum: URIs and 42-character 0x addresses. Tron and Solana addresses fall through to coreService.decode from the scanner, clipboard and manual entry, and fail there.
  • handleUsdtPaymentInput navigates with Routes.UsdtPayment(recipient, amount). The route has no destination field.
  • UsdtWalletScreen.kt starts on UsdtDestination.ARBITRUM and sets ARBITRUM again whenever a parsed request has a chainId.
  • The USDT send sheet's own scan and paste validate against the currently selected network instead of switching to the request's network.
  • Scanning a Polygon request today shows "Unable To Read QR", because core rejects every chain except Arbitrum.

UX goal: the user scans or pastes a USDT request and Bitkit picks the network. This applies to sending only. Receive and the Paykit endpoints the user publishes stay Arbitrum-only.

Proposed solution

Depends on synonymdev/bitkit-core#176, which returns the detected destination from usdtParsePaymentRequest.

  1. Recognise Tron and Solana addresses as USDT input in the scanner, clipboard (canDecodeClipboard, onClipboardAutoRead) and manual entry (validateUsdtAddressWithFeedback).
  2. Add the destination to Routes.UsdtPayment and set it in handleUsdtPaymentInput.
  3. Start UsdtWalletScreen on the detected destination, and stop forcing ARBITRUM when a chainId is present.
  4. Make scan and paste inside the USDT send sheet switch to the detected network.
  5. Keep Arbitrum selected and the picker available for a bare 0x address, which carries no network.
  6. Show a clear error when the detected network is not available, separate from "invalid address".
  7. Show usdt__network_warning only when the network was not detected.
  8. Update the journeys that assert today's Arbitrum-only behaviour: usdt-payment-links-and-scans.xml and usdt-send-review-and-details.xml. Port them to iOS.

Alternatives considered

None.

Additional context

Merge before starting:

Coordinate with #1454, which changes the same scan validation entry points in AppViewModel.

Paykit contact payments stay on MethodId.UsdtArbitrum and are out of scope.

iOS: synonymdev/bitkit-ios#1011.

Design: the Send (USDT) note says "Try to recognize network from address, if not possible user can select other network." The file has no frames for a detected-network state, an unsupported-network error or a scanned non-Arbitrum QR. The network sheet lists Arbitrum One, Polygon and Tron, while Confirm Details shows "Binance Chain" as the recipient network. Until the design covers these, build from the existing frames.

Activity

  1. added theissue type on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions