-
Notifications
You must be signed in to change notification settings - Fork 0
feat: adds support for private key #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a unified “wallet secret” configuration that supports either a mnemonic or a raw secp256k1 private key, and updates the CLI env parsing to use Zod-based declarative validation.
Changes:
- Added
walletSecretsupport (mnemonic or private key) with validation and wallet creation logic. - Reworked CLI env parsing around a Zod schema and replaced
MNEMONICwithWALLET_SECRET. - Updated tests, README, and dependencies to reflect the new configuration model.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/validation.ts | Adds validateWalletSecret and imports secp256k1 key validation helper. |
| src/validation.test.ts | Replaces integer parsing tests with wallet secret validation tests. |
| src/hermes-client.ts | Switches from mnemonic-only wallet creation to mnemonic/privateKey signer creation; renames endpoint security flag. |
| src/hermes-client.test.ts | Updates config shape and adds private-key initialization test coverage; removes interval parsing tests. |
| src/cli-commands/create-command-builder.ts | Improves CLI config error formatting (multi-line output). |
| src/cli-commands/create-command-builder.test.ts | Updates expectations for new WALLET_SECRET parsing shape. |
| src/cli-commands/command-config.ts | Replaces manual env parsing with a Zod schema and parses WALLET_SECRET. |
| src/cli-commands/command-config.test.ts | Updates env parsing tests for WALLET_SECRET and new defaulting behavior. |
| package.json | Adds zod dependency. |
| package-lock.json | Locks zod and updates some dev dependency resolutions. |
| README.md | Documents WALLET_SECRET env var in place of MNEMONIC. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1e9051b to
5ef6fbc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
README.md:179
- The env var table is updated to
WALLET_SECRET, but the README still contains other references/examples usingMNEMONICand wording like "Create wallet from mnemonic" later in the document. To avoid confusing users, update the remaining occurrences to the newWALLET_SECRETformat (and document the privateKey option consistently).
| `WALLET_SECRET` | Yes | - | Either `privateKey:<private key in hex format>` or `mnemonic:<12/24 words>` |
| `HERMES_ENDPOINT` | No | `https://hermes.pyth.network` | Pyth Hermes API |
| `UPDATE_INTERVAL_MS` | No | `300000` | Update interval (5 min) |
| `GAS_PRICE` | No | `0.025uakt` | Gas price |
| `DENOM` | No | `uakt` | Token denomination |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5ef6fbc to
9e5d607
Compare
9e5d607 to
f1eeea2
Compare
Why
Closes #4
What