Move.

Post

Share your knowledge.

jogador_1.
Feb 05, 2025
Expert Q&A

How to get remaining balance after a transaction using TypeScript?

I'm working on a project using the TypeScript SDK and need to fetch the recipient and balance left after a transaction. I tried using the showBalanceChanges option, but it's giving me the amount used in the transaction. How can I obtain the remaining balance after the transaction is completed?

  • Move CLI
2
2
Share
Comments
.

Answers

2
dudley_smith.
Feb 5 2025, 16:49

If the showBalanceChanges option only gives you the amount used, try using the getBalance method. You can find more details here: getBalance Method. This method should help you fetch the remaining balance after the transaction.

1
Comments
.
Theoremus.
Feb 5 2025, 17:29

You have to pass the showBalanceChanges option in your request like this: options: { showBalanceChanges: true }.

1
Comments
.

Do you know the answer?

Please log in and share it.

Move is an executable bytecode language used to implement custom transactions and smart contracts.

148Posts231Answers
Sui.X.Peera.

Earn Your Share of 1000 Sui

Gain Reputation Points & Get Rewards for Helping the Sui Community Grow.

Reward CampaignJuly