Sui.

Post

Share your knowledge.

elfDani.
Feb 17, 2025
Expert Q&A

How to monitor Sui transactions in a wallet app?

I'm adding Sui support to an existing wallet app and need to track blockchain transactions for wallet accounts to detect deposits and update balances. Is there a straightforward method to achieve this without implementing a complex indexer? Is there an event I can monitor using the Sui SDK?

  • Sui
  • Architecture
1
6
Share
Comments
.

Answers

6
McMMoKing.
Feb 17 2025, 15:38

You can refetch the query according to your specific requirements. For instance, using useSuiClientQuery, you can query transaction blocks while filtering based on certain conditions like account addresses or specific module functions:

const { data, isPending, error, refetch, isFetched } = useSuiClientQuery(
    "queryTransactionBlocks",
    {
      order: "descending",
      options: QUERY_OPTIONS,
      filter: QUERY_FILTER({
        FromAddress: account?.address || "",
        MoveFunction: {
          function: "your_package_function",
          module: "your_module",
          package: process.env.NEXT_PUBLIC_PACKAGE_ID!,
        },
      }),
    },
  );
2
Best Answer
Comments
.
Kenshi.
Sep 6 2025, 18:03

Absolutely! The Sui SDK provides WebSocket subscriptions that are ideal for this. You can use sui_subscribeEvent and filter for Transfer events, specifically by the recipient address matching your wallet accounts. This will give you real-time notifications for incoming coins and objects, allowing you to detect deposits and update balances efficiently without needing a full-blown indexer. For balance accuracy, you can then call sui_getBalances after an event.

3
Comments
.
fomo on Sui.
Sep 7 2025, 11:45

You can periodically use the sui_queryTransactions RPC method, filtering by your wallet's ToAddress and FromAddress to find relevant transactions since your last check. This is generally the most robust approach without a full indexer. While sui_subscribeTransaction exists for live updates, it's less reliable for critical balance tracking due to potential missed events on disconnects. For specific contract-based deposits that emit events, you could monitor those using sui_queryEvents or sui_subscribeEvent.

3
Comments
.
kryptoschain.
Feb 17 2025, 15:38

You can query any SUI package by events or by transactions using methods like getEvents or getTransactionBlocks with the SUI SDK. This approach allows you to filter events by parameters such as FromAddress, SenderAddress, or MoveFunction.

1
Comments
.

Do you know the answer?

Please log in and share it.