Skip to content

refactor(subscription)!: replace the onError callback with an options object#148

Merged
nktkas merged 1 commit into
mainfrom
refactor/subscription-options
Jun 17, 2026
Merged

refactor(subscription)!: replace the onError callback with an options object#148
nktkas merged 1 commit into
mainfrom
refactor/subscription-options

Conversation

@nktkas

@nktkas nktkas commented Jun 17, 2026

Copy link
Copy Markdown
Owner

What & why

Follow-up to #137, which reworked WebSocketTransport.subscribe to take an options object.
This brings every subscription method's last argument to the same shape — replacing the positional onError? callback with an options object that also carries a new signal to abort waiting for the confirmation.

Type of change

  • Bug fix
  • New API method / feature
  • Schema/type update to match the Hyperliquid API
  • Breaking change

… object

- Replace the trailing `onError?` callback of every subscription method with an `options` object: `{ signal?, onError? }`
- Add `signal` to abort waiting for the confirmation and detach the listener

BREAKING CHANGE: subscription methods take `options?: SubscriptionOptions` as the last argument instead of a positional `onError?` callback.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@nktkas
nktkas merged commit e430eaf into main Jun 17, 2026
4 checks passed
@nktkas
nktkas deleted the refactor/subscription-options branch June 17, 2026 21:07
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.

1 participant