Gas budget bigger than all Coins

The GasBalanceTooLowToCoverGasBudget error means that the Coin used to pay for gas has a lower balance than the budget, it can be fixed in the following ways:

  1. If you explicitly selected a gas coin by supplying its ID, try selecting one with a bigger balance (use sui client gas for a list of coins owned by your address).
  2. If you can control the budget, try setting it to a lower value (but note that the transaction may still fail if that budget is lower than the actual gas needed by the transaction).
  3. If neither of these techniques work, or all of your gas coins have a lower balance than the budget you need to set, then you will need to merge coins together.

The PaySui transaction (see sui_paySui) can be used to merge coins:

Pass the coins to merge as input_coins and set no recipients or amounts. The transaction will merge all the input coins into one, use it to pay for gas and leave the remainder (Note that you need to merge coins with enough balance to cover your future needs and the gas cost of the PaySui transaction as well).

See this topic for how to do the opposite (split coins) with the same transaction type.

11 Likes