-
Notifications
You must be signed in to change notification settings - Fork 170
Description
Description
TypeScript 5.9.3 introduced stricter type definitions for TypedArray and Buffer.
This change breaks compatibility with certain libraries (e.g., hashgraph/proto), resulting in errors like:
Type 'Buffer' is not assignable to type 'Uint8Array'
In TS 5.9.3, Uint8Array now defaults to Uint8Array, while Node’s Buffer is typed as Uint8Array.
Since these types are no longer compatible, encoding transactions fails in Node.js environments (Not sure If happens the same in FrontEnd Environments).
💡 Potential fix
A possible solution would be to introduce a dual type definition inside of proto.encode() (Might it applies to more methods) that supports both Node and browser environments, e.g.:
Buffer | Uint8Array
This would make the SDK Node-friendly without requiring us to refactor all our existing DApps.
reference: microsoft/TypeScript#62240
possible solution: paulmillr/scure-base#53 (comment)
Steps to reproduce
Additional context
No response
Hedera network
No response
Version
latest
Operating system
None
Metadata
Metadata
Assignees
Labels
Type
Projects
Status