Beitrag
Teile dein Wissen.
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
Antworten
2Sie können die Abfrage gemäß Ihren spezifischen Anforderungen erneut abrufen. So useSuiClientQuery
können Sie beispielsweise Transaktionsblöcke abfragen und gleichzeitig anhand bestimmter Bedingungen wie Kontoadressen oder bestimmter Modulfunktionen filtern:
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!,
},
}),
},
);
Sie können jedes SUI-Paket nach Ereignissen oder Transaktionen abfragen, indem Sie Methoden wie getEvents
oder getTransactionBlocks
mit dem SUI-SDK verwenden. FromAddress
Dieser Ansatz ermöglicht es Ihnen, Ereignisse nach Parametern wie SenderAddress``MoveFunction
, oder zu filtern.
Weißt du die Antwort?
Bitte melde dich an und teile sie.
Sui is a Layer 1 protocol blockchain designed as the first internet-scale programmable blockchain platform.