Skip to content

Conversation

@stalniy
Copy link
Contributor

@stalniy stalniy commented Feb 12, 2026

Why

Closes #4

What

  1. Declarative validation of env vars with zod
  2. Adds support to specify private key instead of wallet mnemonic

@stalniy stalniy requested a review from Copilot February 12, 2026 11:51
@stalniy stalniy changed the title feat: adds support to specify private key feat: adds support for private key Feb 12, 2026
Copy link

Copilot AI left a 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 walletSecret support (mnemonic or private key) with validation and wallet creation logic.
  • Reworked CLI env parsing around a Zod schema and replaced MNEMONIC with WALLET_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.

Copy link

Copilot AI left a 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 using MNEMONIC and wording like "Create wallet from mnemonic" later in the document. To avoid confusing users, update the remaining occurrences to the new WALLET_SECRET format (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.

@stalniy stalniy requested a review from troian February 12, 2026 13:29
@stalniy stalniy merged commit 238d1d3 into main Feb 12, 2026
1 check 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.

support for private key

2 participants