Skip to content

fix(web-client): keep Buffer args for Node deserialize - #368

Open
kutluhaneth46 wants to merge 1 commit into
0xMiden:nextfrom
kutluhaneth46:fix/nodejs-buffer-deserialize-364
Open

fix(web-client): keep Buffer args for Node deserialize#368
kutluhaneth46 wants to merge 1 commit into
0xMiden:nextfrom
kutluhaneth46:fix/nodejs-buffer-deserialize-364

Conversation

@kutluhaneth46

Copy link
Copy Markdown

Summary

  • The Node napi compat wrapper no longer converts Buffer / Uint8Array arguments into plain arrays.
  • Binary inputs stay as Buffer, which napi Buffer / JsBytes APIs (AuthSecretKey.deserialize, Word.deserialize, etc.) require.
  • Vec<u8> parameters still accept Buffer, so constructors like rpoFalconWithRNG keep working.

Fixes #364

Test plan

  • pnpm --filter @miden-sdk/miden-sdk run test:unit -- js/__tests__/napi-compat.test.js
  • On Node with a built native module: round-trip AuthSecretKey.serialize()Buffer.from(..., "base64")AuthSecretKey.deserialize(...) via the public package export (not getNativeModule())
  • Same for Word.deserialize
  • Confirm Uint8Array seeds still work for AuthSecretKey.rpoFalconWithRNG

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant