bump to 0.5.1 with TupleItem fix, dual ESM/CJS build, and infra improvements#235
Open
rAndom1zeeeR wants to merge 29 commits into
Open
bump to 0.5.1 with TupleItem fix, dual ESM/CJS build, and infra improvements#235rAndom1zeeeR wants to merge 29 commits into
rAndom1zeeeR wants to merge 29 commits into
Conversation
BREAKING CHANGE: All API methods now return {data, error} instead of throwing
- Add TonApiError with type field (http_error, network_error, parsing_error)
- Rename error fields for better ergonomics (message, code, status, url)
- Fix SDK parsing errors (Address.parse, Cell.fromHex, BigInt)
- Add typecheck scripts to package.json
- Introduced a schema patching system that allows modifications to the OpenAPI schema before client generation. - Added functionality to deep merge patches from `src/schema-patches.json` into the downloaded schema. - Implemented a method to apply patches automatically during the build process. - Updated `generate.ts` to include schema patching logic, enhancing the flexibility of the API client generation process.
…port - Added `setApiKey` method to manage API key in request headers, allowing for dynamic updates. - Introduced `setCustomFetch` method to enable custom fetch implementations. - Refactored client initialization to support singleton pattern for HttpClient, ensuring a single instance is used throughout the application. - Updated API client configuration methods to allow for dynamic updates of base URL, API key, and fetch function. - Adjusted tests to utilize the new client initialization and API key management features, ensuring robust testing of the new functionality.
…PI SDK - Introduced `TonApiParsingError` class for consistent error management across parsing operations. - Updated parsing functions to throw `TonApiParsingError` for Address, Cell, BigInt, and TupleItem errors, enhancing error clarity. - Refactored error handling in response preparation to utilize centralized formatting for parsing errors. - Removed deprecated methods from `HttpClient` and streamlined client initialization. - Updated tests to validate new error handling structure and ensure robust coverage for parsing scenarios.
- Introduced a base abstract error class `TonApiErrorAbstract` for consistent error management across the SDK. - Refactored existing error classes (`TonApiHttpError`, `TonApiNetworkError`, `TonApiParsingError`, `TonApiUnknownError`) to extend from the new base class, improving code organization and maintainability. - Updated error constructors to include detailed messages and original causes for better debugging. - Enhanced the `prepareResponse` function to handle errors more effectively, returning instances of the new error classes directly. - Updated tests to validate the new error handling structure and ensure comprehensive coverage for various error scenarios.
- Replaced instances of `TonApiClient` with `initClient` for improved client initialization across multiple example files. - Updated method calls to use the new flat API structure, enhancing code clarity and maintainability. - Adjusted error handling in examples to align with the new response pattern, ensuring consistent error management. - Refactored tests to remove dependencies on `TonApiClient`, streamlining the testing process.
- Downgraded OpenAPI version from 3.1.0 to 3.0.0 for compatibility. - Updated external documentation URLs for Lite Server and added new endpoints for blockchain block BOC download and library retrieval. - Introduced new Purchase and AccountPurchases schemas to manage purchase history. - Refactored existing schemas and interfaces to improve clarity and maintainability, including updates to Jetton and NFT operations. - Removed deprecated endpoints related to inscriptions and adjusted related documentation. - Enhanced client interfaces to support new wallet and purchase functionalities. - Improved query parameters for various endpoints to ensure better usability and flexibility.
- Introduced a new instance-based approach for the TonApiClient, allowing for better encapsulation and configuration. - Updated error handling to throw specific errors directly, improving clarity and consistency in error management. - Refactored response preparation to streamline error handling and ensure proper error propagation. - Enhanced documentation and examples to reflect the new client structure and usage patterns. - Updated tests to validate the new instance-based client and error handling mechanisms, ensuring comprehensive coverage.
- Replaced `initClient` with direct instantiation of `TonApiClient` in multiple example files for improved clarity and consistency. - Updated method calls to utilize the new client instance, enhancing error handling and response management. - Refactored error handling in examples to align with the new client structure, ensuring consistent error reporting. - Adjusted tests to validate the new client usage and error handling mechanisms, ensuring comprehensive coverage.
…ient interfaces - Changed the format of address fields to 'maybe-address' across various components in the API schema and client interfaces, allowing for null values. - Updated related parsing logic to handle 'maybe-address' format, ensuring compatibility with empty strings. - Enhanced tests to validate the new 'maybe-address' handling, including scenarios for valid addresses and empty strings.
- Add TonApiValidationError for Address/Cell string validation - Fix TonApiPromise to preserve typed .catch() through .then()/.finally() chains - Add cellToString() helper that validates and converts Cell strings to expected format - Simplify addressToString() to validate without parsing (returns string as-is) - Update README with concise validation note - Add validation tests for both Address and Cell (hex/base64) - Add promise chain typing tests
…ge.json; add ScaledUI schema to API
- Added integration test command to run API tests with real calls. - Introduced new `test:integration` script in package.json for integration testing. - Updated API schema to improve documentation and support for token-or-address format. - Refactored client methods to handle Address and string types seamlessly. - Enhanced utility functions for better serialization of Address objects. - Updated tests to validate mixed usage of Address objects, cryptocurrency codes, and strings.
…m_payload and state_init
- Add parse-address and parse-bigint tests - Expand parse-tuple test coverage - Fix unhandled rejection in type-tests mock fetch - Remove duplicate migratebeta test - Add memory-leak test script
…string The code_hash field in BlockchainConfig config 45 was incorrectly typed as Address, causing parsing errors when SDK attempted to parse hex hash strings (e.g., '89468f02c78e570802e39979c8516fc38df07ea76a48357e0536f2ba7b3ee37b') as blockchain addresses. Changes: - Remove incorrect 'format: address' annotation from code_hash in api.yml - Update TypeScript type from Address to string in client.ts - Add integration test for getBlockchainConfig to prevent regression The code_hash field contains contract code hashes (64 hex characters), not addresses.
Include stack trace in TonApiParsingError console.error output to help developers identify which API method caused the parsing failure.
- Updated package version to 0.5.1 in package-lock.json and client package.json. - Enhanced API schema with new endpoints for bulk account retrieval and validator information. - Added new parameters for pagination and sorting in various API calls. - Introduced new data structures for handling blockchain accounts and wallets.
- Changed the response data structure to use 'cell' instead of 'slice' for the slice type. - Added support for a new 'builder' type in the response data structure, also using 'cell' for its value. - Updated related tests to reflect these changes in the response structure.
- Updated package version to 0.5.1 in package.json and package-lock.json. - Enhanced changelog with notable changes including fixes for tuple item slice parsing, duplicate JSDoc, and schema download validation. - Regenerated OpenAPI schema and updated client build process to use `tsup`. - Adjusted workspace configuration to include specific packages and removed stale references. - Improved error handling and build scripts for better performance and organization.
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.
release(client): bump to 0.5.1 with TupleItem fix, dual ESM/CJS build, and infra improvements
cellfield compatible with @ton/coregeneratefrom networkupdate-schemawith HTTP status validation