AuthGuardedMultisigConfig takes the wasm AuthScheme enum, but that enum cannot be imported from the package root — a string-valued const of the same name shadows it, so every JS caller passes undefined and the constructor rejects it.
Symptom
Error: invalid enum value passed
at miden_client_web.wasm.authguardedmultisigconfig_new
at new AuthGuardedMultisigConfig
Repro
import { AuthScheme, AuthGuardedMultisigConfig } from '@miden-sdk/miden-sdk';
AuthScheme.AuthEcdsaK256Keccak; // undefined
new AuthGuardedMultisigConfig(approvers, 1, guardian, AuthScheme.AuthEcdsaK256Keccak); // throws
Cause
dist/*/index.js re-exports the wasm module first and api-types second, so the later definition wins:
|
|
crates/miden_client_web.js |
enum AuthScheme { AuthEcdsaK256Keccak = 1, AuthRpoFalcon512 = 2 } |
api-types.js |
const AuthScheme = { Falcon: "falcon", ECDSA: "ecdsa" } ← exported |
Expected
AuthGuardedMultisigConfig should take the string scheme like the rest of the friendly API — resolveAuthScheme(scheme, wasm) in js/utils.js is already the established convention for exactly this, and AuthScheme.ECDSA / AuthScheme.Falcon are what the api-types doc comment tells callers to use.
Impact
Introduced in 0.16.0-rc.7 with createAuthGuardedMultisig. Every JS consumer of guarded multisig accounts hits it. Workaround is to inline the discriminants ({ ecdsa: 1, falcon: 2 }), which is what OpenZeppelin/guardian#450 currently does.
AuthGuardedMultisigConfigtakes the wasmAuthSchemeenum, but that enum cannot be imported from the package root — a string-valued const of the same name shadows it, so every JS caller passesundefinedand the constructor rejects it.Symptom
Repro
Cause
dist/*/index.jsre-exports the wasm module first andapi-typessecond, so the later definition wins:crates/miden_client_web.jsenum AuthScheme { AuthEcdsaK256Keccak = 1, AuthRpoFalcon512 = 2 }api-types.jsconst AuthScheme = { Falcon: "falcon", ECDSA: "ecdsa" }← exportedExpected
AuthGuardedMultisigConfigshould take the string scheme like the rest of the friendly API —resolveAuthScheme(scheme, wasm)injs/utils.jsis already the established convention for exactly this, andAuthScheme.ECDSA/AuthScheme.Falconare what the api-types doc comment tells callers to use.Impact
Introduced in 0.16.0-rc.7 with
createAuthGuardedMultisig. Every JS consumer of guarded multisig accounts hits it. Workaround is to inline the discriminants ({ ecdsa: 1, falcon: 2 }), which is what OpenZeppelin/guardian#450 currently does.