Skip to content

cli: add token transfer#732

Merged
evgeniko merged 38 commits intowormhole-foundation:mainfrom
martin0995:cli-add-token-transfer
Dec 2, 2025
Merged

cli: add token transfer#732
evgeniko merged 38 commits intowormhole-foundation:mainfrom
martin0995:cli-add-token-transfer

Conversation

@martin0995
Copy link
Copy Markdown
Contributor

@martin0995 martin0995 commented Nov 3, 2025

This pull request introduces improvements to configuration management and error handling in the CLI, along with a new command for token transfers. The key changes are the extraction and centralization of configuration types and loading logic, enhanced error reporting for RPC issues, and the addition of a token transfer command.

Configuration Management Improvements:

  • Moved ChainConfig and Config type definitions, as well as the loadConfig function, from cli/src/index.ts to a new file cli/src/deployments.ts for better organization and modularity. Imports and exports were updated accordingly.

Error Handling Enhancements:

  • Added a new handleRpcError function to cli/src/error.ts to provide improved error reporting for RPC connection issues, including contextual information about the chain and network.

New Feature: Token Transfer Command:

  • Integrated a new token transfer command by importing createTokenTransferCommand from cli/src/tokenTransfer.ts and registering it with the CLI command parser.

Examples

# Transfer 5 tokens from Sepolia to Solana using the deployments written to deployment.json
ntt token-transfer \
  --network Testnet \
  --source-chain Sepolia \
  --destination-chain Solana \
  --amount 5 \
  --destination-address Ez6j... \
  --deployment-path ./deployment.json
# Move 0.1 tokens from Solana to Sepolia using a local payer keypair file
ntt token-transfer \
  --network Testnet \
  --source-chain Solana \
  --destination-chain Sepolia \
  --amount 0.1 \
  --destination-address 0xabc123... \
  --p ./deployment.json \
  --payer ~/.config/solana/devnet.json
# Transfer from an EVM chain to Solana with a custom msgValue to fund executor rent
ntt token-transfer \
  --network Testnet \
  --source-chain Sepolia \
  --destination-chain Solana \
  --amount 2 \
  --destination-address Ez6j... \
  --destination-msg-value 15000000 \
  --deployment-path ./deployment.json

Codebase Cleanup:

  • Removed duplicate configuration type definitions and the local loadConfig function from cli/src/index.ts after moving them to cli/src/deployments.ts.

@nik-suri nik-suri requested review from dvgui and evgeniko November 4, 2025 14:54
@evgeniko
Copy link
Copy Markdown
Contributor

evgeniko commented Nov 11, 2025

could you please adjust the Readme inside the cli repo: https://github.com/wormhole-foundation/native-token-transfers/blob/main/cli/README.md, and point to our docs:
https://wormhole.com/docs/products/token-transfers/native-token-transfers/get-started/
No need to add all the commands there, just a pointer to the docs should be enough imo

@martin0995 martin0995 requested a review from evgeniko November 13, 2025 13:58
Copy link
Copy Markdown
Contributor

@evgeniko evgeniko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, amazing work

@evgeniko evgeniko merged commit a728a82 into wormhole-foundation:main Dec 2, 2025
9 checks passed
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