Skip to content

Conversation

@netbonus
Copy link
Contributor

📝 Summary

🔧 Context / Implementation

🧪 Test Plan

  1. First step
  2. Second step
  3. Expected result

🖼️ Screenshots (if applicable)

Before After

- Commander-based CLI with gridplus/gp commands
- Placeholder commands: setup, address, pubkey, eth2
- ETH2 staking subcommands: deposit-data, bls-change
- Build config following packages/btc patterns
- Fix biome.json schema version for subpackage lint
Session infrastructure:
- session.ts - ~/.gridplus/ persistence with SDK callbacks
- config.ts - CLI configuration management
- output.ts - JSON/human formatting with chalk colors
- prompts.ts - Inquirer prompts with ora spinners

Commands implemented:
- setup - Interactive device setup
- connect - Connect to saved device
- pair <code> - Pair with pairing code
- address [path] - ETH/BTC/Solana addresses with --type
- pubkey [path] - secp256k1/ed25519/BLS keys
- sign <tx> - Ethereum transaction signing
- sign-message <msg> - Personal sign and EIP-712
- eth2 deposit-data - Validator deposit data export
- eth2 bls-change - BLS withdrawal credential migration

All commands support -j/--json output flag.
- Fix ETH multi-address fetch (use fetchAddress loop)
- Strip "m/" prefix from derivation paths (SDK doesn't handle it)
- Convert pubkey Buffer responses to hex strings
- Convert Solana address Buffer responses to base58
- Add bs58 dependency for Solana encoding
- Add `gridplus simulator setup` - one-shot setup + pair
- Add `gridplus simulator info` - show simulator defaults
- Add `--simulator` flag to setup and pair commands
- Add SIMULATOR_DEFAULTS config (localhost:3000, SD0001, etc.)
- Track `isSimulator` in session for auto-detection

Simulator defaults match CI workflow:
- URL: http://127.0.0.1:3000
- Device ID: SD0001
- Password/Pairing: 12345678
Run CLI tests in parallel with SDK e2e tests:
- gridplus simulator setup
- gridplus address (ETH, BTC, Solana)
- gridplus pubkey
- JSON output verification

CLI tests run concurrently while e2e tests execute.
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 22, 2026

Open in StackBlitz

npm i https://pkg.pr.new/GridPlus/gridplus-sdk@698

commit: df6623f

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9d00ab9c05

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +109 to +110
// Set network configuration
depositOpts.network = eth2.Constants.NETWORKS.MAINNET_GENESIS;

Choose a reason for hiding this comment

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

P2 Badge Honor --network when building ETH2 deposit data

The command advertises --network mainnet|goerli|holesky, but the implementation always sets depositOpts.network to MAINNET_GENESIS. As a result, users who pass --network goerli or --network holesky still get mainnet fork/version roots, which produces invalid deposit data for testnets. This is a functional correctness bug for any non-mainnet use case and should select the network based on options.network instead of hardcoding mainnet.

Useful? React with 👍 / 👎.

Comment on lines +101 to +104
const pathParts = cleanPath(derivationPath).split('/');
const lastPart = pathParts[pathParts.length - 1];
if (!lastPart?.toLowerCase().includes('x')) {
pathParts[pathParts.length - 1] = 'x';

Choose a reason for hiding this comment

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

P2 Badge Preserve hardened wildcard for multi-key pubkey paths

When --count > 1, the code replaces the last derivation path component with 'x' unconditionally. For hardened paths such as the default Solana path m/44'/501'/0'/0', this drops the hardened marker (') and changes the derivation to a non‑hardened branch. That yields different keys than intended (or can be rejected by the device), so gp pubkey --type ed25519 --count N won’t return keys from the documented path. The replacement should preserve hardened paths by using "x'" when the last component is hardened.

Useful? React with 👍 / 👎.

- Add full CLI documentation with all commands and options
- Cover device setup, addresses, pubkeys, signing, and ETH2 commands
- Include simulator quick start and CI integration examples
- Add troubleshooting section and JSON output examples
The simulator only supports one pairing at a time. Running SDK e2e
tests (as 'lattice-manager') and CLI tests (as 'GridPlus CLI') in
parallel caused pairing conflicts where one would fail with
"Pairing failed".
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.

2 participants