Skip to content

TonConnect sendTransaction fails with Object.getClass() on a null object #22

@jobman

Description

@jobman

Describe the bug

A TON Connect transaction fails in Tonkeeper Android after it is confirmed by the user.

Tonkeeper correctly displays the transaction confirmation screen, including the destination, amount, and network fee. After confirmation, Tonkeeper shows an error and the dApp receives:

[TON_CONNECT_SDK_ERROR] UnknownError
Attempt to invoke virtual method
'java.lang.Class java.lang.Object.getClass()'
on a null object reference

The exact same transaction works successfully with MyTonWallet. It is broadcast to TON Testnet and processed by the smart contract.

A possibly related issue was previously closed:
ton-connect/sdk#317

Steps to reproduce

  1. Open the Solomon Deal Telegram Mini App.
  2. Connect a Tonkeeper Testnet wallet.
  3. Create and accept a deal.
  4. Press Register.
  5. Confirm the transaction in Tonkeeper.
  6. Tonkeeper displays an error.
  7. Repeat using MyTonWallet.
  8. The transaction completes successfully.

TON Connect request

The transaction is sent using:

await tonConnectUI.sendTransaction({
  validUntil: Math.floor(Date.now() / 1000) + 600,
  network: "-3",
  messages: [
    {
      address: "kQBlSJPQnH5g8m0F9p0bbAreeyAmPqs-Ll4uNZx10cralXSJ",
      amount: "1030000000",
      payload:
        "te6ccgEBAQEATQAAlbag5c/YbfhCvktP+5789X2bcDgegAXe/+OgLyu5NPnuyPC0o3dy4rl5qPSU9DpqytU9DBOf6BfXhAAAAAAA1GdSgIdzWUAIAmJaAQ=="
    }
  ]
});
TON Connect manifest:

https://raw.githubusercontent.com/jobman/usercontent/refs/heads/master/solomon-manifest.json

Payload structure
The payload is a standard TON cell containing:

Operation code: 0xb6a0e5cf
Deal ID as uint128: d86df842-be4b-4ffb-9efc-f57d9b70381e
Producer address
Producer responsibility: 200000000 nanotons
Expiration timestamp: 1781770560
Deal amount: 1000000000 nanotons
Contract fee: 20000000 nanotons
The attached message amount is 1030000000 nanotons:

Deal amount: 1 TON
Contract fee: 0.02 TON
Gas reserve: 0.01 TON
The payload was successfully processed by the contract when sent through MyTonWallet.

Expected behavior
Tonkeeper should sign and broadcast the transaction after confirmation.

Current behavior
Tonkeeper displays an error after confirmation and the transaction is not broadcast:

text


[TON_CONNECT_SDK_ERROR] UnknownError
Attempt to invoke virtual method
'java.lang.Class java.lang.Object.getClass()'
on a null object reference
Environment
Platform: Telegram Mini App
Network: TON Testnet (-3)
Wallet: Tonkeeper Android 26.5.2
@tonconnect/ui-react: 3.0.0
@tonconnect/ui: 3.0.0
@tonconnect/sdk: 4.0.0
@tonconnect/protocol: 3.0.0
Device: [add device model]
Android version: [12]
Additional context
The smart-contract payload was tested locally and successfully emulated against the deployed Testnet contract.

MyTonWallet successfully signs and broadcasts the exact same transaction. The dApp then detects that the deal was registered on-chain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions