@inversealtruism/cairnx-core 0.1.44 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -0
- package/CONVENTION.md +150 -150
- package/MAKERS.md +4 -7
- package/README.md +7 -6
- package/dist/index.cjs +1025 -886
- package/dist/index.d.cts +31 -23
- package/dist/index.d.ts +31 -23
- package/dist/index.js +1026 -887
- package/package.json +4 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
- Internal split, no behaviour change: `src/resolve.ts` keeps the replay loop and dispatches each record to
|
|
6
|
+
handlers in `src/resolve/` (tokens, names, market, attest) over one shared state context. The exported names
|
|
7
|
+
and their types are unchanged, and `resolve()` returns the same state, event log included, for the same input.
|
|
8
|
+
Every consumer may stay on 0.2.0.
|
|
9
|
+
|
|
10
|
+
## 0.2.0
|
|
11
|
+
|
|
12
|
+
Breaking for callers that hand-build `ProvenOfferTerms` or rely on the old two-argument verdict; see Migration.
|
|
13
|
+
|
|
14
|
+
- `bindOfferTerms` checks the give and wantType legs by default. A served offer whose `give` (ticker, amount
|
|
15
|
+
or name) or want type differs from the merkle-proven offer now counts as a mismatch with the two-argument
|
|
16
|
+
call too. To opt out, pass `{ give: false, wantType: false }`: that returns the 0.1.44 two-argument verdict
|
|
17
|
+
on every input. Opting out of one leg leaves the other on.
|
|
18
|
+
- Type change: with a leg on, the terms must come from `provenOfferTerms` or `bindProvenOffer` (the
|
|
19
|
+
`MintedProvenOfferTerms` brand). A hand-built `ProvenOfferTerms` compiles only with both legs off (the new
|
|
20
|
+
`LegacyBindOpts` type). At runtime, hand-built terms passed without the opt-out lack the give and wantType
|
|
21
|
+
fields and are refused (the predicate returns `true`).
|
|
22
|
+
- Callers that already pass `{ give: true, wantType: true }` with minted terms get the same verdicts as before.
|
|
23
|
+
- Depends on csd-codec 0.1.18 (reject-more input canon, see `CONSENSUS_CHANGES.md`); `records.ts` imports
|
|
24
|
+
the codec's well-formed UTF-16 predicate instead of its own copy, with the same verdicts.
|
|
25
|
+
- `resolve()` and canonical state are byte-identical to 0.1.44.
|
|
26
|
+
|
|
27
|
+
Migration. Callers that already pass `{ give: true, wantType: true }` with minted terms need no change (the
|
|
28
|
+
site's `swapguard.js`, the wallet's `wallet.ts` and cairn-sdk's `fillverify.ts` production path). These move
|
|
29
|
+
together with the 0.2.0 pin:
|
|
30
|
+
- cairn-sdk `test/fillverify.test.ts`: the two-argument assertions on hand-built terms expect the old default
|
|
31
|
+
(the inflated give passing); pass `{ give: false, wantType: false }` there or expect the refusal.
|
|
32
|
+
- cairn-sdk `src/fillverify.ts`: the result's `terms` field is typed `ProvenOfferTerms`, which drops the mint
|
|
33
|
+
brand, so a dApp passing it back to `bindOfferTerms` without the opt-out no longer compiles; type it
|
|
34
|
+
`MintedProvenOfferTerms`.
|
|
35
|
+
- cairn `test/b7a-flip.test.mjs`: its two-argument call asserts the give leg is off; it now refuses.
|
|
36
|
+
- cairn-wallet `src/vendor/cairnx-spv.js` and `cairnx-spv.d.ts`: the vendored bundle keeps the 0.1.x
|
|
37
|
+
contract (legs opt-in) until it is re-vendored from 0.2.0.
|
|
38
|
+
|
|
39
|
+
## 0.1.44
|
|
40
|
+
|
|
41
|
+
- `rfqFillAllIn(n, feeBps?)` (`cairnx-core/mm`) takes the offer's fee rate; omitted or null keeps
|
|
42
|
+
`FEE_BPS_V16`, so every existing one-argument call returns the same number.
|
|
43
|
+
- `epochOf` now lives in `csd-codec` next to `EPOCH_LEN` and is re-exported from the root unchanged.
|
|
44
|
+
- New root exports, none read by `resolve()`: `ptAmt` (the resolver's own paidTo amount reader),
|
|
45
|
+
`burnedPayment` (what a refused record paid to the treasury, and for a fill to the offer's seller and payto,
|
|
46
|
+
never counting the payer) and `myProvenFillClosedOffer` (whether a buyer's own merkle-proven full fill closed
|
|
47
|
+
the offer behind one of its fclaim holds, for the V29 cross-offer hold count).
|
|
48
|
+
- `resolve()` and canonical state are byte-identical to 0.1.43.
|
|
49
|
+
|
|
50
|
+
## 0.1.43
|
|
51
|
+
|
|
52
|
+
- New subpath `@inversealtruism/cairnx-core/mm` (ESM and CJS, built to `dist/mm/`). The root export, the
|
|
53
|
+
resolver and every consensus file are unchanged; `dist/index.*` is byte-identical to 0.1.42.
|
|
54
|
+
- `mm` holds the market maker's non-consensus math in one place for the maker service and the site:
|
|
55
|
+
`sizeBid`, `acceptBid`, `tierFor` (bid sizing against the indicative ladder), `tradeNotional` (contractual
|
|
56
|
+
volume of a fill), `expScaled`, `sunriseTimeMult` and `sunriseCurve` (the Sunrise spot curve), and the
|
|
57
|
+
RFQ all-in sums `rfqBuyAllIn` and `rfqFillAllIn`, and `priorBuyers` (the returning-buyer rule: buyers of fills
|
|
58
|
+
of offers the maker sold) (built from `tradeFee`, `makerRebate`, `FEE_BPS_V16` and the
|
|
59
|
+
codec's minimum fees).
|
|
60
|
+
- New Sunrise order pricing: `sunriseOrderCost` is the integral of the spot curve over an order, rounded up;
|
|
61
|
+
`sunriseAnswerPrice` adds a flat margin and a per-token floor; `sunriseTokensFor` inverts it for a budget.
|
|
62
|
+
`expm1Scaled` is the fixed-point e^z - 1 behind it (scale 1e18).
|