Fix ensureSafeNumber throwing on large Soroban Stream IDs - #604
Conversation
createStream() threw an unhandled error whenever a Soroban stream ID exceeded Number.MAX_SAFE_INTEGER (2^53 - 1). Replaced ensureSafeNumber with serializeStreamId, which serializes the bigint to a string instead of forcing a lossy/unsafe number cast. createStream() now returns Promise<string>. Confirmed via tsc --noEmit with no downstream type errors.
📝 WalkthroughWalkthrough
ChangesStream ID serialization
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@Richkid2 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
dont forget to offramp using https://stellar.fundable.finance/offramp its fast, free and p2p rates |
Closes #372
createStream() threw an unhandled error whenever a Soroban stream ID exceeded Number.MAX_SAFE_INTEGER (2^53 - 1). Replaced ensureSafeNumber with serializeStreamId, which serializes the bigint to a string instead of forcing a lossy/unsafe number cast. createStream() now returns Promise.
Confirmed via tsc --noEmit with no downstream type errors. issue #372
Summary by CodeRabbit