Skip to content

fix(web): accept auth scheme aliases - #227

Open
skyc1e wants to merge 1 commit into
0xMiden:mainfrom
skyc1e:fix/auth-scheme-new-wallet
Open

fix(web): accept auth scheme aliases#227
skyc1e wants to merge 1 commit into
0xMiden:mainfrom
skyc1e:fix/auth-scheme-new-wallet

Conversation

@skyc1e

@skyc1e skyc1e commented Jul 6, 2026

Copy link
Copy Markdown

Fixes #223.

The public AuthScheme object only exposed the friendly string values, while the lower-level wallet/faucet methods still expect the WASM enum values. That left AuthScheme.AuthRpoFalcon512 undefined and let React defaults pass an invalid auth scheme into newWallet.

This adds the numeric compatibility aliases back to the browser and Node exports, updates the public types, and routes browser newWallet / newFaucet auth inputs through resolveAuthScheme so both friendly strings and enum values reach WASM as the expected numeric enum.

Checked with:

  • cmd /c ..\..\node_modules\.bin\vitest.cmd run --config vitest.config.js js/__tests__/utils.test.js
  • cmd /c ..\..\node_modules\.bin\vitest.cmd run --config vitest.config.ts src/__tests__/hooks/useCreateWallet.test.tsx
  • cmd /c node_modules\.bin\prettier.cmd --check crates/web-client/js/index.js crates/web-client/js/node-index.js crates/web-client/js/utils.js crates/web-client/js/types/api-types.d.ts crates/web-client/js/__tests__/utils.test.js
  • git diff --check

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.

AuthScheme.AuthRpoFalcon512 is undefined, so newWallet() / useCreateWallet() hang with "invalid enum value passed"

1 participant