Skip to content

Better node demo#1369

Merged
chakra-guy merged 2 commits into
mainfrom
ts/multichain/node-demo
Oct 15, 2025
Merged

Better node demo#1369
chakra-guy merged 2 commits into
mainfrom
ts/multichain/node-demo

Conversation

@chakra-guy

@chakra-guy chakra-guy commented Oct 14, 2025

Copy link
Copy Markdown
Collaborator

Explanation

Screen.Recording.2025-10-14.at.16.09.38.mov

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

Note

Replaces the simple script with an interactive Node.js CLI (inquirer/ora/chalk) that connects via the Multichain SDK, manages session/accounts, signs messages on Ethereum and Solana, and supports disconnect; updates deps and ignores /temp.

  • Playground: playground/multichain-node
    • Interactive CLI: Replace single-command script with a menu-driven CLI using inquirer, ora, and chalk.
      • State machine: DISCONNECTEDCONNECTINGCONNECTEDSIGNING.
      • Connect flow: requests accounts for eip155:1 and solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp.
      • Session handling: listens to wallet_sessionChanged, groups accounts by chain, updates app state.
      • Actions: personal_sign on Ethereum and signMessage on Solana; displays signatures; supports disconnect.
      • Main loop: continuously renders menu; improved console UX.
    • Dependencies: add chalk, inquirer, ora; add @types/inquirer; remove @metamask/sdk.
  • .gitignore: add /temp.

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

@chakra-guy
chakra-guy requested a review from a team as a code owner October 14, 2025 14:22
cursor[bot]

This comment was marked as outdated.

@socket-security

socket-security Bot commented Oct 14, 2025

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​types/​inquirer@​8.2.121001007781100
Addednpm/​inquirer@​8.2.79910010097100

View full report

@socket-security

socket-security Bot commented Oct 14, 2025

Copy link
Copy Markdown

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring alerts on:

  • npm/cli-width@3.0.0
  • npm/figures@3.2.0
  • npm/mute-stream@0.0.8
  • npm/@types/through@0.0.33
  • npm/chardet@2.1.0
  • npm/@types/inquirer@8.2.12
  • npm/inquirer@8.2.7
  • npm/iconv-lite@0.7.0
  • npm/@inquirer/external-editor@1.0.2

View full report

@chakra-guy

Copy link
Copy Markdown
Collaborator Author

@SocketSecurity ignore-all

@codecov

codecov Bot commented Oct 14, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.99%. Comparing base (74f90c1) to head (8197d65).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1369   +/-   ##
=======================================
  Coverage   74.99%   74.99%           
=======================================
  Files         184      184           
  Lines        4519     4519           
  Branches     1108     1108           
=======================================
  Hits         3389     3389           
  Misses       1130     1130           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown


const validCommands = ['connect'];
// Define the states our application can be in
type AppState = 'DISCONNECTED' | 'CONNECTING' | 'CONNECTED' | 'SIGNING';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor suggestion: You can use enums to define types, allowing later to use the enum directly instead of hardcoding strings.

Suggested change
type AppState = 'DISCONNECTED' | 'CONNECTING' | 'CONNECTED' | 'SIGNING';
enum AppStatus {
DISCONNECTED: "disconnected",
CONNECTING: "connecting",
CONNECTED: "connected",
SIGNING: "signing",
}
type AppState = `${AppStatus}`

choices: ['Connect', 'Exit'],
},
]);
if (action === 'Connect') {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[nit]: qWould also use an enum for actions here

@chakra-guy
chakra-guy merged commit 07036cd into main Oct 15, 2025
44 checks passed
@chakra-guy
chakra-guy deleted the ts/multichain/node-demo branch October 15, 2025 08:43
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