Skip to content

Conversation

@ftheirs
Copy link
Contributor

@ftheirs ftheirs commented Nov 6, 2025

This PR addresses three main issues:

  • Standardized all hex value responses to use the 0x${string} format.
  • Removed the incorrect name field from the FileInfo type (the backend response does not include a name field).
  • Converted the size field in backend FileInfo responses from u64 to a string to avoid precision loss.

⚠️ Breaking Changes ⚠️

Backend API Changes

  • FileInfo.size field: Changed from u64 to String in JSON responses to prevent precision loss in JavaScript
    • Impact: Any direct consumers of the backend API expecting numeric size values will need to parse the string
    • Migration: Parse size field as string: parseInt(fileInfo.size) or BigInt(fileInfo.size)

SDK Type Changes

  • Removed name field: Eliminated incorrect name field from StorageFileInfo interface

    • Impact: Code accessing fileInfo.name will break
    • Migration: Use fileInfo.location instead, or import FileInfo from @storagehub-sdk/core
  • Hex string format: All hex fields now consistently return 0x${string} format

    • Impact: Code expecting hex without 0x prefix may break
    • Migration: This is actually a fix - no migration needed

@ftheirs ftheirs added B3-backendnoteworthy Changes should be mentioned in SH backend related release notes breaking Needs to be mentioned in breaking changes D2-noauditneeded🙈 PR doesn't need to be audited B1-sdknoteworthy Changes should be mentioned in SH SDK related release notes labels Nov 6, 2025
@ftheirs ftheirs force-pushed the feat/sdk_improvements branch from 9e7bc9e to 5e68ea9 Compare November 6, 2025 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B1-sdknoteworthy Changes should be mentioned in SH SDK related release notes B3-backendnoteworthy Changes should be mentioned in SH backend related release notes breaking Needs to be mentioned in breaking changes D2-noauditneeded🙈 PR doesn't need to be audited

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants