Skip to content

Conversation

@tuna1207
Copy link
Member

@tuna1207 tuna1207 commented Nov 6, 2025

Explanation

Fix subscription crypto approval amount calculation by using bignumber.js

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Note

Switches subscription price and token approval calculations to bignumber.js for precision; adds dependency and updates changelog.

  • Subscription Controller:
    • Replace float/BigInt math with bignumber.js in src/SubscriptionController.ts:
      • #getSubscriptionPriceAmount now uses BigNumber for price computation.
      • getTokenApproveAmount now uses BigNumber and returns toFixed(0).
  • Dependencies:
    • Add bignumber.js to packages/subscription-controller/package.json and yarn.lock.
  • Changelog:
    • Note precision fix for getTokenApproveAmount using bignumber.js in CHANGELOG.md.

Written by Cursor Bugbot for commit 70df1a3. This will update automatically on new commits. Configure here.

@tuna1207 tuna1207 marked this pull request as ready for review November 6, 2025 07:03
@tuna1207 tuna1207 requested review from a team as code owners November 6, 2025 07:03
@chaitanyapotti chaitanyapotti merged commit 658d5dd into main Nov 6, 2025
262 checks passed
@chaitanyapotti chaitanyapotti deleted the fix/subscription-price-calculation branch November 6, 2025 07:16
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.

3 participants