Skip to content

feat(backend): add asset amount clamp helper module (#369) - #478

Open
jdjioe5-cpu wants to merge 1 commit into
Kitewell-lab:mainfrom
jdjioe5-cpu:feat/issue-369-asset-amount-clamp
Open

jdjioe5-cpu wants to merge 1 commit into
Kitewell-lab:mainfrom
jdjioe5-cpu:feat/issue-369-asset-amount-clamp

Conversation

@jdjioe5-cpu

Copy link
Copy Markdown

Goal

Resolves #369

Adds the standalone backend module backend/src/assetAmountClamp.js with focused unit tests and technical documentation, implementing the decimal asset amount clamp helper with BigInt-safe stroop precision comparison.

Changes

  • backend/src/assetAmountClamp.js: Exports clampAssetAmount and stroop-precision comparison helpers.
  • docs/features/assetAmountClamp.md: Feature overview, parameters, and public API reference.
  • 8 focused test files covering happy path, boundary range, invalid types, reversed bounds error, precision preservation, and stroop conversion.

Verification

  • npm test passed cleanly in backend/ (276 tests passed).
  • Zero modifications to existing files or other namespaces.

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.

New backend module: backend/src/assetAmountClamp.js — Asset amount clamp helper

1 participant