Skip to content

Conversation

drewstaylor
Copy link
Member

@drewstaylor drewstaylor commented Sep 30, 2025

The code for Sui scripts, particularly sui/its.js and sui/its-example.js, has gone through rapid changes in the past week. This PR refactors those iterations to be cleaner. Additionally, as some cli arguments are moved to options, the help screen for sui/its.js will be readable again.

This PR is a WIP, and not ready yet to be merged.


Note

Simplifies Sui ITS CLI by deriving coin type from token ID and reducing args, adds sui/tokens mint-coins, refines token deployment options, and updates docs, examples, and workflow to match.

  • CLI (ITS):
    • Simplify sui/its interchain-transfer to interchain-transfer <tokenId> <destinationChain> <destinationAddress> <amount> with optional --channel; auto-derives coinType, fetches decimals, and handles balance/coin merges.
    • Simplify sui/its deploy-remote-coin to deploy-remote-coin <tokenId> <destinationChain> (coin type resolved on-chain).
    • Replace balance check with smarter senderHasSufficientBalance (merges coins when needed); remove legacy mint-coins from sui/its.
  • CLI (Examples/Tokens):
    • sui/its-example deploy-token now requires --tokenManagerMode (no default) and streamlines mint/registration paths.
    • Add sui/tokens mint-coins <symbol> <amount> <recipient> (supports config-less coins via options).
  • Utils:
    • Add tokenIdToCoinType (dev inspect) and extractCoinTypeFromDevInspect; export and use across commands.
  • Docs:
    • Update README and release guide to new command shapes (shorter ITS interchain-transfer, deploy-remote-coin); adjust trusted-chain, deploy, and mint examples; remove EVM --gasValue in return transfer.
  • CI/Workflow:
    • Tests deploy tokens with explicit --tokenManagerMode lock_unlock.

Written by Cursor Bugbot for commit dd6cd57. This will update automatically on new commits. Configure here.

@drewstaylor drewstaylor self-assigned this Sep 30, 2025
@drewstaylor drewstaylor requested a review from a team as a code owner September 30, 2025 17:28
@drewstaylor drewstaylor marked this pull request as draft September 30, 2025 17:28
greptile-apps[bot]

This comment was marked as spam.

@drewstaylor
Copy link
Member Author

I'd like to wait for #1059 to be merged before merging this PR (#1062), so I can remove the defaulting to tokenManagerType from the config save

cursor[bot]

This comment was marked as outdated.

…d, and fetch the object id instead from the user's wallet balances
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@axelarnetwork axelarnetwork deleted a comment from cursor bot Oct 14, 2025
@drewstaylor
Copy link
Member Author

Auto merging coins is now working for cmd interchain-transfer

$ ts-node sui/its interchain-transfer 0x4b7fa7d0d6b12b17f20769c342b0817afdc3a7f53b966e16c98e883e3a4327f8 flow 0x13f8C723AeB8CA762c652c553a11a11483846d8B 10
Wallet address: 0x76f89a9b56dc580aed9f97e2b3bd03d8d24464e38522da9464c15103761c6707

Wallet balance: 1.941829811 SUI

Confirm Merge Coins Tx? (y/n) y

Merge Coins: Byk2nfA4C3vNMUybGxxhqapc4R3XUC3QCHbiexLz4Qxt

Confirm Interchain Transfer Tx? (y/n) y

Interchain Transfer: 99vx6qdvFMeikFYLuTrwVbRrtEKxtV8ZeuozMYs9WNDQ

@drewstaylor drewstaylor merged commit ef47ce6 into main Oct 16, 2025
12 checks passed
@drewstaylor drewstaylor deleted the chore/sui-clean-up branch October 16, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants