Move.

Post

Share your knowledge.

DuAn.
Mar 14, 2025
Expert Q&A

Understanding `tx.gas` in ts-sdk transactions

I'm trying to understand what tx.gas represents in the ts-sdk. Specifically, is tx.gas related to the coin set when using the setGasPayment() function while working with a Transaction object in TypeScript?

  • Move CLI
1
1
Share
Comments
.

Answers

1
Forever_A-gator.
Mar 14 2025, 18:24

tx.gas is indeed the gas payment coin used for the transaction. If you employ something like:

const [coin] = tx.splitCoins(
    tx.gas,
    [100000000]
);

It will automatically take the gas coin, typically referred to as SUI.

1
Best Answer
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