Sui.

Bài viết

Chia sẻ kiến thức của bạn.

elfDani.
Feb 17, 2025
Hỏi đáp Chuyên Gia

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
0
2
Chia sẻ
Bình luận
.

Câu trả lời

2
McMMoKing.
Feb 17 2025, 15:38

Bạn có thể tìm lại truy vấn theo yêu cầu cụ thể của bạn. Ví dụ: sử dụnguseSuiClientQuery, bạn có thể truy vấn các khối giao dịch trong khi lọc dựa trên các điều kiện nhất định như địa chỉ tài khoản hoặc chức năng mô-đun cụ thể:

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!,
        },
      }),
    },
  );
1
Bình luận
.
kryptoschain.
Feb 17 2025, 15:38

Bạn có thể truy vấn bất kỳ gói SUI nào theo sự kiện hoặc giao dịch bằng các phương pháp như getEventshoặc getTransactionBlocksvới SDK SUI. Cách tiếp cận này cho phép bạn lọc các sự kiện theo các tham số như FromAddress``SenderAddress,, hoặcMoveFunction.

0
Bình luận
.

Bạn có biết câu trả lời không?

Hãy đăng nhập và chia sẻ nó.

Chúng tôi sử dụng cookie để đảm bảo bạn có trải nghiệm tốt nhất trên trang web của chúng tôi.
Thêm thông tin