Skip to content

Refactor the project#19

Merged
volovyks merged 40 commits intomainfrom
serhii/rewrite-in-ts
Jun 2, 2025
Merged

Refactor the project#19
volovyks merged 40 commits intomainfrom
serhii/rewrite-in-ts

Conversation

@volovyks
Copy link
Copy Markdown
Contributor

  • Project is rewritten in TS
  • Added integration tests
  • Added CI
  • Finalized prettier setup
  • Added setup instructions
  • Refactored and cleaned up ENV setup
  • Added load tests (Ethereum is still unstable)

Please, review, but do not merge yet, it has a lot of breaking changes. @auto-mausx, let's deploy this branch on a VM, sent traffic there, remove CloudRun deployment and merge this PR.

Copy link
Copy Markdown
Contributor

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

A comprehensive refactor migrating the project to TypeScript, adding CI, tests, and improving formatting and environment setup

  • Rewrote core utilities and handlers in TypeScript, removing old JavaScript versions
  • Added integration/load tests and a GitHub Actions CI pipeline
  • Standardized prettier setup, updated package.json scripts, and expanded README with setup instructions

Reviewed Changes

Copilot reviewed 37 out of 37 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/utils/initNear.js Removed legacy JavaScript NEAR initializer in favor of TS rewrite
src/utils/initEvm.ts New TypeScript EVM initialization supporting multiple environments
src/utils/evmTransactions.ts Refactored and typed EVM transaction helpers
src/index.ts Main server entrypoint migrated to TS with enhanced validation
src/handlers/**/*.ts Converted all blockchain handlers (Solana, Ethereum, NEAR) to TS
package.json Updated scripts for build, test, and formatting; adjusted main
README.md Expanded install, build, run, test, and environment instructions
.github/workflows/ci.yml Added CI for build, tests, and prettier checks
.prettierignore Ignored dist/ folder for formatting
.gitattributes Marked dist/ files as generated
.env.example Updated sample environment variables for new TS setup
Comments suppressed due to low confidence (6)

src/utils/initEvm.ts:45

  • The error refers to evmPrivateKeyMainnet/evmPrivateKeySepolia but useEnv() returns a single evmSk. Align the environment variable names or adjust useEnv() to match.
          ? 'evmPrivateKeyMainnet' : 'evmPrivateKeySepolia'

src/utils/evmTransactions.ts:55

  • Leftover debug console.log may expose sensitive data; consider removing or replacing with a proper logger at debug level.
    console.log({ rsvSignature });

src/utils/evmTransactions.ts:80

  • Debug logging of the signature request could leak internal details; remove or replace with structured logging if needed.
    console.log({ signatureRequest });

src/index.ts:8

  • Falling back to a hardcoded default API secret is insecure. Require API_SECRET to be explicitly set and fail startup if missing.
const API_SECRET = process.env.API_SECRET || 'default-secret-key';

src/handlers/ethereum.ts:31

  • [nitpick] Use cannot instead of can not for grammatical correctness in the error message.
      `Ethereum can not be called with check=true due to long finalization time`

src/utils/initEvm.ts:7

  • Consider adding unit tests for initEthereum to verify behavior across dev, testnet, and mainnet configurations.
export const initEthereum = ({

volovyks and others added 8 commits May 29, 2025 18:23
@volovyks volovyks temporarily deployed to Pinger Test ENV May 30, 2025 08:24 — with GitHub Actions Inactive
@volovyks volovyks temporarily deployed to Pinger Test ENV May 30, 2025 08:31 — with GitHub Actions Inactive
@volovyks
Copy link
Copy Markdown
Contributor Author

Ok
@esaminu , please, review

@volovyks volovyks temporarily deployed to Pinger Test ENV May 30, 2025 22:24 — with GitHub Actions Inactive
@volovyks volovyks temporarily deployed to Pinger Test ENV June 2, 2025 12:37 — with GitHub Actions Inactive
volovyks and others added 3 commits June 2, 2025 17:36
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@auto-mausx auto-mausx self-requested a review June 2, 2025 16:34
auto-mausx
auto-mausx previously approved these changes Jun 2, 2025
@volovyks volovyks temporarily deployed to Pinger Test ENV June 2, 2025 17:01 — with GitHub Actions Inactive
@volovyks volovyks temporarily deployed to Pinger Test ENV June 2, 2025 17:08 — with GitHub Actions Inactive
@volovyks
Copy link
Copy Markdown
Contributor Author

volovyks commented Jun 2, 2025

@esaminu me and @auto-mausx want to experiment with deployment, please, review, I will address all comments

@volovyks volovyks merged commit c167239 into main Jun 2, 2025
3 checks passed
Copy link
Copy Markdown
Collaborator

@esaminu esaminu left a comment

Choose a reason for hiding this comment

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

Tests look awesome, left some minor comments

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.

4 participants