Move.

Post

Share your knowledge.

mssoni.
Feb 17, 2025
Expert Q&A

How to resolve CommandArgumentError with tx failed issue?

I've been trying to execute a transaction using the CommandArgumentError { arg_idx: 1, kind: InvalidBCSBytes } error. Here's the snippet I used:

const tx = new Transaction();
const [newCoin] = tx.splitCoins(
tx.object(coinObjectId),
[1000]
);

tx.transferObjects([newCoin], tx.pure.string(wallet.address || ""));

tx.setGasBudget(750000);
const result = await wallet.signAndExecuteTransaction({ transaction: tx, });

I've tried using tx.pure.u64 but it didn't help. Any solutions?

  • Move CLI
1
1
Share
Comments
.

Answers

1
Grizzly.
Feb 17 2025, 15:38

You may want to check whether you're using the correct intent for your transaction. Try using the CoinWithBalance intent as described in the official Mysten Labs documentation here: Mysten Labs SDK. This might help in resolving the CommandArgumentError.

0
Comments
.

Do you know the answer?

Please log in and share it.

We use cookies to ensure you get the best experience on our website.
More info