Move.

Post

Share your knowledge.

Tawhid.
Jan 23, 2025
Expert Q&A

How can I merge Sui coins for a move call without gas issues?

I'm trying to make a move call where one argument requires a mutable Coin. My account holds two Sui tokens with balances of .29 and .71. I want to merge these coins first in the transaction and then use the resulting coin to make the move call. However, I'm encountering an issue where the transaction complains it can't find a coin for gas after the merge. Is it because I'm using both tokens in the transaction, so they're unavailable for gas? Any ideas on how to resolve this?

  • Move CLI
  • Move
1
2
Share
Comments
.

Answers

2
Michelle .
Jan 23 2025, 00:00

Have you tried using merge coins functionality? It could potentially merge your coins without causing any conflicts with gas requirements. This feature was added to reduce the hassle of manual coin management. The process is designed to represent what you want in the transaction while deferring the source of the coins until you build and sign the transaction.

1
Comments
.
kryptoschain.
Jan 23 2025, 00:00

You don't need to manage coins manually. You can simply use coinWithBalance, and the SDK will handle finding and merging the coins for you automatically. Try specifying the coin you want to use for paying the fees separately, as this might resolve the issue with the gas. Here's the SDK documentation link for more information: Gas Payment.

0
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 CampaignJune
We use cookies to ensure you get the best experience on our website.
More info