Skip to content

fix: update quoteClosePosition return type, bump to v0.4.1#36

Merged
koko1123 merged 1 commit intomainfrom
koko/fix-quote-close-position-041
Feb 10, 2026
Merged

fix: update quoteClosePosition return type, bump to v0.4.1#36
koko1123 merged 1 commit intomainfrom
koko/fix-quote-close-position-041

Conversation

@koko1123
Copy link
Contributor

Summary

  • Fix stale quoteClosePosition return type in getPositionLiveDetailsFromContract (position.ts). The ABI changed the first return value from bool success to bytes unexpectedReason, but this exported function was not updated (unlike context.ts and open-position.ts which were).
  • At runtime, viem returns a Hex string for bytes, which is always truthy when cast to boolean, causing error detection to silently fail for partial closes.
  • Bumps version to 0.4.1.

Test plan

  • All 187 SDK unit tests pass
  • Verify partial close error handling works correctly on testnet

…romContract

The quoteClosePosition contract function's first return value changed
from bool to bytes in the updated ABI. Two of three call sites were
updated (context.ts, open-position.ts) but the exported
getPositionLiveDetailsFromContract in position.ts was missed.

This caused error detection to silently fail for partial closes since
viem returns a Hex string for bytes, which is always truthy when cast
to boolean.

Bumps version to 0.4.1.
@koko1123 koko1123 force-pushed the koko/fix-quote-close-position-041 branch from ea43921 to 7d572be Compare February 10, 2026 22:21
@koko1123 koko1123 merged commit ff05adb into main Feb 10, 2026
2 of 3 checks passed
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