Conversation
BREAKING CHANGES: - Remove @ethersproject/bignumber dependency in favor of native bigint - Update package manager from yarn to pnpm - Bump version to 0.6.0 due to breaking API changes - Convert to ES modules with "type": "module" in package.json Major Updates: - **BigNumber Migration**: Replace BigNumber with native bigint throughout codebase - Router.getBestRoute() now accepts bigint instead of BigNumber - Router.getBestRouteBatch() now accepts bigint[] instead of BigNumber[] - All amount calculations use bigint for better performance and accuracy - **Package Manager**: Migrate from yarn to pnpm - Remove package-lock.json and yarn.lock - Add pnpm-lock.yaml for faster installs and better dependency management - Update all example projects to use pnpm - **ESLint Modernization**: - Replace legacy .eslintrc.json with modern eslint.config.js - Update to ESLint 9.x with typescript-eslint 8.x - Implement flat config pattern for better performance - **Enhanced Type Safety**: - Improve Token interface with more precise types - Add EvmTransactionData type for better type checking - Update decimals field to handle string values from API - Add optional fields for better API compatibility - **Testing Infrastructure**: - Split monolithic test file into modular unit tests - Add comprehensive test setup with proper mocking - Organize tests by feature area (api-key, batch, constructor, etc.) - Add dedicated tsconfig.json for test environment - **Code Quality Improvements**: - Use URLSearchParams for safer URL construction - Improve error handling in route building - Add format:check script for CI/CD - Add lint and type-check scripts - **Dependency Updates**: - Update ethers to 6.14.4 - Update starknet to 6.24.1 - Update all dev dependencies to latest stable versions - Remove circular dependency (fibrous-router-sdk self-reference) - **Documentation & Examples**: - Update all example code to use bigint instead of BigNumber - Add .env.example for environment configuration - Improve README documentation - Update all example READMEs with new patterns This release provides better performance, improved type safety, and aligns with modern JavaScript standards while maintaining full functionality for all supported chains (Base, Scroll, Starknet).
This document outlines breaking changes and migration steps from v0.5.x to v0.6.0, including the transition from BigNumber to native bigint, updates to the Token interface, and package installation instructions. It also highlights the benefits of the new version, such as improved performance and modern JavaScript standards.
…of single call - Fix buildBatchTransaction to return all swapCalls array instead of just first call (swapCalls[0]) - Update return type from 'Call | EvmTransactionData' to 'Call[] | EvmTransactionData' - Update tests to expect array of calls for proper batch execution - Fixes batch transaction functionality that was only executing first transaction Resolves batch execution bug where subsequent calls were dropped.
- Bump SDK version in README files to v0.6.0 across examples. - Introduce a comprehensive migration guide detailing breaking changes, including the transition from BigNumber to native bigint, updates to the Token interface, and installation instructions. - Highlight benefits of the new version, such as improved performance and modern JavaScript standards.
…e safety - Deleted .prettierignore file to streamline formatting configuration. - Updated ESLint configuration to warn on usage of 'any' type instead of allowing it, enhancing type safety. - Modified package.json scripts to use .gitignore for prettier formatting checks. - Refactored router code to simplify handling of optional parameters and improve type definitions for EvmTransactionData.
…ditional value assignment
- Changed input token address to a placeholder for better clarity. - Updated output token retrieval to improve error handling and added comments for using unverified tokens. - Adjusted input amounts in buildTransaction examples for consistency across different chains. - Enhanced type definitions in the router to support various amount types, improving flexibility in transaction handling.
- Introduced human-readable logging for swap call data to improve transaction traceability. - Updated input and output token handling to use specific tokens for better clarity. - Adjusted gas price calculations based on token type (native vs non-native). - Improved console output for transaction hash and link for easier access to transaction details.
- Deleted unused .env.example files and example scripts for account, buildTransaction, protocols, route, and tokens across Base, Scroll, and Starknet examples to streamline the codebase. - Updated ethers dependency version in package.json for improved compatibility. - Added new HYPER_EVM_RPC_URL to examples/.env.example for enhanced configuration options. - Refactored example scripts to utilize chain IDs instead of chain names for better clarity and future-proofing.
- Deleted the hyperContract ABI file and the CHAIN_ID_MAP constants file to streamline the codebase and eliminate deprecated references. - Updated import paths in the router to reflect the removal of the constants file, ensuring continued functionality.
- Removed unused imports from humanReadableStarknetLog.ts to streamline the code and improve clarity. - Retained necessary imports for functionality while enhancing code maintainability.
…rity - Replaced deprecated buildTransaction method with buildRouteAndCalldata in both EVM and Starknet transaction examples for improved clarity and future-proofing. - Adjusted token handling to use specific tokens and updated input amounts for consistency across different chains. - Enhanced type definitions in the router to support various amount types, improving flexibility in transaction handling. - Added deprecation notice for the old buildTransaction method to guide future development.
- Replaced buildTransaction method with buildRouteAndCalldata in EVM and Starknet examples for improved clarity and consistency. - Enhanced error handling for token retrieval and added comments for better understanding of the code flow. - Updated input amounts and token addresses to align with new transaction building methods, ensuring future-proofing and clarity in examples. - Improved logging for swap call data to facilitate better transaction traceability.
- Updated package version from 0.6.0-rc.2 to 0.6.0 for release. - Enhanced example documentation in EVM and Starknet to include detailed function descriptions for fetching tokens and protocols. - Improved code clarity by removing deprecated references and ensuring consistent error handling across examples.
- Fixed a typo in the README.md file for the EVM examples, changing "verifed" to "verified" for improved clarity and accuracy in the documentation.
…g-and-codebase Refactor/modernize tooling and codebase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(evm)!: dynamic chain functions via chainId; switch to bigint; add buildRouteAndCalldata + humanReadable
BREAKING CHANGES:
Migration: