0xMiden / 0xMiden/web-sdk

AccountType.Public is undefined because AccountType is shadowed

Open Beginner friendly
#361 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1
Forks
21
Avg merge
12h 14m
Merged PRs (30d)
41

Description

### Packages versions

@miden-sdk/miden-sdk@0.16.0-rc.5

### Bug description

The exported `AccountType` contains `FungibleFaucet` and `NonFungibleFaucet` instead of the native `Private` and `Public` values. Because of this, `AccountType.Public` is undefined.
The faucet enum should be renamed to `FaucetType`, allowing the native `AccountType` to be exported.

`storageMode(AccountStorageMode.public())` works as a workaround.

### How can this be reproduced?

```javascript
import { AccountBuilder, AccountType } from "@miden-sdk/miden-sdk";

const seed = new Uint8Array(32);
new AccountBuilder(seed).accountType(AccountType.Public);
```

### Relevant log output

```shell
Failed to convert napi value into enum `AccountType`. NumberExpected, Failed to convert napi value Undefined into rust type `i32`
```

Contributor guide

Open the contributing guide

Research direction

Look for the exported AccountType enum in the SDK source, likely in a file like src/account.ts or src/types.ts. Identify where the FaucetType values are incorrectly placed. Rename the faucet enum to FaucetType and ensure the native AccountType with Private and Public is correctly exported. Verify the fix by running the provided reproduction code.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
75/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.