Repository navigation
Phase 2: core logic - #109
Merged
Merged
Conversation
- money: bigint base-unit conversion, formatting, scaled decimals - cost: cost_bps from the quote's USD values (rounded up, null when unknown) and checkCost against the plan limit - planMatch: last off-chain guard before execute_buy (recipient, asset, origin, refundTo = vault, amount, dry, paused/plan) - address: checksummed BTC (bech32/bech32m, base58check), EVM (EIP-55) and NEAR account validation - assets: KD-6 target ids; schemas: plan form, funding quote, session - 33 tests; adds @noble/hashes and @scure/base
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pure, tested domain logic in
lib/core(ARCHITECTURE §3–4, ESSENTIALS rules).What changed
money.ts: bigint base-unit conversion/formatting; never floats.cost.ts: cost in bps from the quote's own USD values, rounded up; unknown cost is never treated as free.planMatch.ts: a buy quote must match the on-chain plan (recipient, asset, origin USDC, refunds to the vault, amount ≤ per-run, not dry, has a deposit address).address.ts: checksummed validation — BTC bech32/bech32m + base58check, EVM EIP-55, NEAR accounts — so typos can't send savings to the wrong address.assets.ts: decided target ids (KD-6);schemas.ts: plan form (address typed twice + checksum + on-chain limits), funding quote, session.QuoteSummarynow echoesoriginAsset,refundTo,minAmountOut,timeEstimateS.Closes #33
Closes #34
Closes #35
Closes #36
Closes #37
Closes #38
Roadmap
Checks
pnpm test),pnpm typecheck,pnpm lintNEAR HACKATHON rules
@noble/hashes,@scure/baseto be listed in the README (K10.3)