You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 30, 2025. It is now read-only.
Besides SDK, you can also directly use aptos node's [balance API endpoint](../../build/apis/fullnode-rest-api-reference#tag/accounts/GET/accounts/{address}/balance/{asset_type}) to get the balance of a migrated coin or fungible asset.
215
+
214
216
## Tracking Balance Changes
215
217
216
218
Balance changes can be queried in one of two ways:
@@ -331,48 +333,80 @@ In this case, we only care about coin store changes.
331
333
</details>
332
334
333
335
3. Events are the events that were emitted by the transaction. In this case, we
334
-
only care about the `0x1::coin::deposit` and `0x1::coin::withdraw` events.
336
+
only care about the `0x1::coin::Withdraw` and `0x1::coin::Deposit` events.
335
337
336
-
The Coin deposit event is emitted when coins are deposited into an account. The
337
-
account's balance will increase by that amount in the field `data.amoount`. To
338
-
determine the matching asset, you must match the `guid` in the `deposit_events`
339
-
to the `guid` in the `changes` section for a `CoinStore`.
338
+
The Coin withdraw event is emitted when coins are withdrawn from an account. The
339
+
account's balance will decrease by that amount in the field `data.amount`. To
340
+
determine the matching asset, you must match the `guid` in the `withdraw_events`
341
+
to the `guid` in the `changes` section for a `CoinStore`. But if the `CoinStore`
342
+
is not found in the `changes`, it means it got deleted, and a `CoinStoreDeleteEvent`
343
+
must be present instead. Then you can match the `guid` with
344
+
`deleted_withdraw_event_handle_creation_number` and `event_handle_creation_address`.
0 commit comments