Skip to content

add stablecoin issuance cli#8

Merged
gitteri merged 4 commits intomainfrom
cli-stablecoin-mint
Jul 29, 2025
Merged

add stablecoin issuance cli#8
gitteri merged 4 commits intomainfrom
cli-stablecoin-mint

Conversation

@gitteri
Copy link
Copy Markdown
Collaborator

@gitteri gitteri commented Jul 29, 2025

Add Stablecoin Issuance CLI

Overview

This PR introduces a comprehensive command-line interface for creating stablecoins with Token-2022 extensions, making it easy for developers and users to deploy production-ready stablecoins on Solana.

Features Added

📟 New CLI Package (@mosaic/cli)

  • Interactive Command Interface: Built with Commander.js for intuitive command structure
  • Rich Terminal Experience: Loading spinners (ora), colored output (chalk), and clear progress indicators
  • Error Handling: Comprehensive error handling with user-friendly messages
  • Flexible Configuration: Support for custom RPC URLs and keypair paths

Stablecoin Creation Command

mosaic create stablecoin --name "USD Coin" --symbol "USDC" --decimals 6

Key Features:

  • Token-2022 Extensions: Automatic setup of all essential stablecoin extensions
    • Metadata extension for token information
    • Pausable extension for emergency stops
    • Default Account State (blocklist) for compliance
    • Confidential Balances for privacy
    • Permanent Delegate for advanced control
  • Authority Management: Flexible authority assignment with sensible defaults
  • Keypair Handling: Generate new mint keypairs or use existing ones
  • Transaction Management: Full transaction building, signing, and confirmation

SDK Enhancements

  • Improved Type Safety: Enhanced transaction typing with TransactionWithBlockhashLifetime
  • Flexible Signer Support: Updated to accept both Address and TransactionSigner types
  • Better CLI Integration: Optimized for command-line usage patterns

🏗️ Technical Implementation

CLI Architecture

packages/cli/
├── src/
│   ├── commands/create/stablecoin.ts    # Stablecoin creation command
│   ├── utils/
│   │   ├── rpc.ts                       # RPC client utilities
│   │   └── solana.ts                    # Keypair loading utilities
│   └── index.ts                         # Main CLI entry point
├── package.json                         # CLI dependencies and scripts
└── README.md                           # Comprehensive documentation

Command Options

  • Required: --name, --symbol
  • Optional: --decimals (default: 6), --uri, authority addresses, keypair paths
  • Global: --rpc-url, --keypair

Dependencies

  • commander - CLI framework
  • chalk - Terminal styling
  • ora - Loading indicators
  • gill - Solana web3 library
  • @mosaic/sdk - Core token functionality

🎨 UI Package Updates

  • Code Formatting: Consistent code style across UI components
  • ESLint Compliance: Fixed linting issues for better code quality

📝 Usage Example

# Create a stablecoin on devnet
mosaic create stablecoin \
  --name "My Stablecoin" \
  --symbol "MSC" \
  --decimals 6 \
  --uri "https://example.com/metadata.json" \
  --rpc-url "https://api.devnet.solana.com"

# Output includes:
# ✅ Transaction signature
# 🏷️  Mint address
# 🔐 All authority addresses
# 🛡️  Enabled extensions list

🚀 Future Enhancements

The CLI is architected to support additional commands:

  • Token management (mint, transfer, freeze, pause)
  • SRFC list management (allowlist/blocklist)
  • Token information queries
  • Interactive creation workflows

🧪 Testing

  • Successful stablecoin creation on devnet
  • All Token-2022 extensions properly enabled
  • Authority assignment working correctly
  • Error handling for invalid inputs
  • Transaction confirmation and display

📋 Breaking Changes

None - this is a purely additive change that introduces new functionality without modifying existing APIs.


Important

Add @mosaic/cli package for stablecoin issuance on Solana with Token-2022 extensions, enhancing CLI, SDK, and UI components.

  • CLI Features:
    • New package @mosaic/cli for stablecoin issuance.
    • Command create stablecoin added in stablecoin.ts for creating stablecoins with Token-2022 extensions.
    • Supports options for token name, symbol, decimals, URI, and authority addresses.
    • Utilizes Commander.js, chalk, and ora for CLI structure, styling, and loading indicators.
    • Error handling and flexible configuration for RPC URLs and keypair paths.
  • SDK Enhancements:
    • Improved type safety with TransactionWithBlockhashLifetime in createMint.ts and stablecoin.ts.
    • Support for Address and TransactionSigner types in transactions.
  • UI Updates:
    • Code formatting and ESLint compliance improvements in eslint.config.js and other UI files.
    • Updated next.config.js and package.json for Next.js 15 compatibility.

This description was created by Ellipsis for 87520e3. You can customize this summary. It will automatically update as commits are pushed.

Copy link
Copy Markdown
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to 3cf3d6b in 1 minute and 56 seconds. Click for details.
  • Reviewed 1309 lines of code in 23 files
  • Skipped 3 files when reviewing.
  • Skipped posting 4 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. packages/ui/src/app/globals.css:53
  • Draft comment:
    Using a universal selector (*) to apply 'border-border' might unintentionally style all elements; consider targeting specific elements.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. packages/cli/src/index.ts:22
  • Draft comment:
    Global options are defined after subcommands are added. It’s best to define them before subcommand creation to ensure proper inheritance.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% Looking at Commander.js documentation and common patterns, while it's technically possible to define options before or after subcommands, the order doesn't actually affect option inheritance in Commander.js. Global options defined on the root command are always inherited by subcommands regardless of definition order. This seems like a style preference rather than a functional issue. The comment might be based on experience with other CLI frameworks where order matters more. Also, there could be subtle Commander.js behaviors I'm not aware of. Even if there are edge cases, the current code is functionally correct and follows a clear, readable pattern. The comment suggests a change without clear benefits. The comment should be deleted as it suggests a change that doesn't provide clear value and the current implementation is functionally correct.
3. packages/cli/src/commands/create/stablecoin.ts:85
  • Draft comment:
    Verify that restricting decimals to 0-9 meets your requirements; the SPL token standard supports 0-9 decimals, but ensure this aligns with your stablecoin design.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
4. packages/cli/src/commands/create/stablecoin.ts:169
  • Draft comment:
    Similarly, the string \n❌ Error: might be accidentally escaping the newline. Consider using for a newline if that's the intended effect.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_OEYLR3yrvcBSg5c8

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Copy Markdown
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 9793b80 in 59 seconds. Click for details.
  • Reviewed 136 lines of code in 4 files
  • Skipped 1 files when reviewing.
  • Skipped posting 4 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. packages/ui/eslint.config.js:16
  • Draft comment:
    Good use of FlatCompat and Next.js ESLint configs; consider adding overrides for test files if needed.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
2. packages/ui/next-env.d.ts:4
  • Draft comment:
    Documentation reference updated correctly for Next.js app directory.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
3. packages/ui/next.config.js:9
  • Draft comment:
    Switching to ESM export (export default) aligns with the 'type': 'module' setup.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
4. packages/ui/package.json:4
  • Draft comment:
    Setting 'type': 'module' ensures consistency with ESM usage; Next.js and ESLint versions are up-to-date.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_g0ISEaAuLnRuyrXS

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Copy Markdown
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 93263e4 in 46 seconds. Click for details.
  • Reviewed 65 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. packages/cli/src/commands/create/stablecoin.ts:163
  • Draft comment:
    Removed the leading newline in the metadata URI log. Confirm that removing '\n' improves output readability.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. packages/cli/src/commands/create/stablecoin.ts:169
  • Draft comment:
    Removed the newline character in the error output for consistency. Ensure this change maintains clear error messaging.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
3. packages/ui/eslint.config.js:60
  • Draft comment:
    Formatting cleanup: Removed extra whitespace and consolidated the ignores array. This change is purely stylistic.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_F969KLfuCIlpYp98

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Copy Markdown
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 87520e3 in 1 minute and 15 seconds. Click for details.
  • Reviewed 23 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. packages/ui/next.config.js:2
  • Draft comment:
    Verify that removing the experimental appDir config is intentional and doesn't break UI components relying on it.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to verify their intention and ensure that the change doesn't break anything, which violates the rules. It doesn't provide a specific suggestion or ask for a specific test to be written.
2. packages/ui/postcss.config.js:1
  • Draft comment:
    Ensure switching from module.exports to export default is intentional; confirm the project is set up to use ES Modules for config files.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% This comment violates several rules: 1) It asks for verification/confirmation which is explicitly discouraged 2) It's about build configuration which would immediately fail if incorrect 3) If ES Modules weren't supported, the build would break immediately making this a non-issue 4) The comment doesn't suggest any specific action, just asks for confirmation. Perhaps build failures aren't always immediately obvious and this could cause subtle issues in some environments? No - PostCSS is a build tool that would fail immediately and clearly if the module syntax was incorrect. There's no scenario where this would silently fail. Delete this comment. It asks for verification rather than pointing out a specific issue, and any module syntax problems would be caught by the build system immediately.

Workflow ID: wflow_boRCRT1zhcRlqCoN

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@gitteri gitteri merged commit 5fe4f11 into main Jul 29, 2025
2 checks passed
@gitteri gitteri deleted the cli-stablecoin-mint branch July 29, 2025 21:48
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.

1 participant