Skip to content

fix(sdk): restore the build — undefined event type names - #1005

Merged
Jaydbrown merged 1 commit into
conduit-protocol:mainfrom
arkhindi12:fix/build-broken-event-types
Oct 20, 2026
Merged

Jaydbrown merged 1 commit into
conduit-protocol:mainfrom
arkhindi12:fix/build-broken-event-types

Conversation

@arkhindi12

Copy link
Copy Markdown
Contributor

main does not compile.

$ npx tsc --noEmit
src/events.ts(569,32): error TS2552: Cannot find name 'TopUpEvent'.
src/events.ts(573,32): error TS2304: Cannot find name 'ClawbackEvent'.

$ npm run build
src/events.ts(569,32): error TS2552 ...

StreamHistoryEntry references TopUpEvent and ClawbackEvent, but
events.ts imports neither. Both names exist in types/index.ts only as
deprecated aliases of StreamTopUpEvent / StreamClawbackedEvent, so this
uses the current names directly rather than importing the deprecated ones.

No runtime change — the aliases are the same types, and the kind
discriminants are untouched.

Knock-on effect

npm ci fails too, because the prepare script runs npm run build:

npm error command sh -c npm run build
npm error code 2

So every contributor hitting a fresh clone, and every PR's CI, is red on
main for a reason unrelated to their change.

Verification

$ npx tsc --noEmit            # before: 2 errors   after: rc=0
$ npm run build               # before: fails      after: rc=0
  created dist/esm in 3.3s
  created dist/cjs in 2.7s

main does not compile: StreamHistoryEntry references TopUpEvent and
ClawbackEvent, but events.ts imports neither. Both names exist only as
deprecated aliases of StreamTopUpEvent / StreamClawbackedEvent, so use the
current names directly.

Effect on main before this commit:
  tsc --noEmit       2 errors
  npm run build      fails (tsc -p tsconfig.build.json)
  npm ci             fails too — prepare runs build

No runtime change: the aliases are the same types.
@arkhindi12

Copy link
Copy Markdown
Contributor Author

@Jaydbrown — one ordering question before you spend time reviewing, since CONTRIBUTING requires CI green.

main does not build at 1e46b52: src/events.ts references TopUpEvent and ClawbackEvent, which it never imports (they exist only as deprecated aliases in types/index.ts). This PR is the two-line fix, and with it applied locally:

npx tsc --noEmit   → rc=0
npm run build      → rc=0 (dist/esm, dist/cjs, dist/types)

The other three PRs I opened (#1006, #1007, #1008) branch from main, so their npm run build stays red until this lands. Their own test suites pass (8, 10 and 7 tests respectively) and nothing in them touches events.ts — the failure is purely the pre-existing one.

Two ways to sequence it, whichever suits you:

  1. Merge this first, then re-run CI on the other three — once main carries the fix, their merge commits should go green without further changes from me.
  2. I rebase fix(sdk): retry transient 5xx on read-only RPC calls #1006–feat(sdk): add futurenet and standalone network config #1008 onto this branch so each one is self-contained and green on its own. Say the word and it is a few minutes' work.

Also worth flagging: all four CI runs are sitting at action_required (first contribution from this fork), so they need an approve-and-run before they report anything at all.

@Jaydbrown
Jaydbrown merged commit bcb5656 into conduit-protocol:main Oct 20, 2026
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.

2 participants