hashgraph / hashgraph/asset-tokenization-studio

ControlList port is not exported, so control lists cannot be used from a published import

Open
#1,401 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
33
Forks
28
Avg merge
15h 36m
Merged PRs (30d)
8

Description

**Description:**

`ControlListRequest` is exported from the package barrel. The `ControlList` port that
consumes it is not exported from anywhere, is not re-exported from the package index, and
is not mixed into `Security` — so a consumer can construct the request and then find
nothing to pass it to.

**Expected:** having constructed a `ControlListRequest`, there is something to pass it to.

**Actual:** there is not. Allow and deny lists are listed among the compliance controls ATS
provides, but cannot be reached from a published import.

Because `ControlListRequest` *is* in the barrel's export list, the feature reads as
supported right up until the call site is written.

**Step to Reproduce:**

1. `npm i @hashgraph/asset-tokenization-sdk`
2. The port exists — `port/in/security/controlList/ControlList.d.ts`:

```ts
addToControlList(request: ControlListRequest): Promise<{ ... }>;
removeFromControlList(request: ControlListRequest): Promise<{ ... }>;
isAccountInControlList(request: ControlListRequest): Promise;
```

3. `port/in/index.d.ts` exports these ports, and `ControlList` is not among them:

```
Security, Equity, Dividend, Bond, Coupon, Account, Role, Event, Network, Factory,
Management, SsiManagement, Kyc, ExternalPausesManagement,
ExternalControlListsManagement, ExternalKycListsManagement, FixedRate,
KpiLinkedRate, Amortization
```

4. `Security.d.ts` does not declare the three methods:

```sh
grep -n "addToControlList\|removeFromControlList\|isAccountInControlList" \
node_modules/@hashgraph/asset-tokenization-sdk/build/esm/src/port/in/security/Security.d.ts
# no output
```

5. Neither does the package index:

```sh
grep -n "ControlList" \
node_modules/@hashgraph/asset-tokenization-sdk/build/esm/src/index.d.ts
# no output
```

`ExternalControlListsManagement` is exported but is a different feature — it manages
external list contracts rather than the security's own list.

**Additional Context:**

### The same shape, three more times

| Missing | Needed for | Workaround |
|---|---|---|
| `SecurityRole` | `grantRole`, `revokeRole`, `hasRole` | copy the role hashes out of `node_modules` by hand |
| `SetConfigurationRequest` | `Network.setConfig()` | none — `package.json` `exports` blocks the deep path |
| `UnpauseRequest` | `Security.unpause()` | pass a `PauseRequest`, which happens to have the same shape |
| `ControlList` | control lists | none |

### Suggested fix

The individual exports are each a one-line change, but four features unreachable for the
same reason suggests nothing checks the barrel against the API surface.

A test that imports the package the way a consumer does — from the published entry point,
not by deep path — and constructs one request and one port per feature would have caught
all four, and would catch the fifth.

That test cannot run today: the ESM build is not importable by Node (#1400 ), which may be
why it does not exist.

**Version:**

@hashgraph/asset-tokenization-sdk 8.0.0

**OS:**

Windows 11, Node.js 22.23.2

Contributor guide

Open the contributing guide

Research direction

Start by comparing port/in/security/controlList/ControlList.d.ts with port/in/index.d.ts and Security.d.ts, then check the published build/esm/src/index.d.ts entry point. Reproduce the consumer import described in the issue; done means a published import exposes ControlList and Security provides the three control-list operations for a ControlListRequest. Note that the proposed ESM test is blocked by #1400.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.