@inversealtruism/cairnx-core 0.1.27 → 0.1.28

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/dist/index.cjs CHANGED
@@ -1372,7 +1372,9 @@ function resolve(events, tipHeight) {
1372
1372
  for (const [id, o] of [...offers.entries()].sort(([a], [b]) => ord(a, b))) offersOut[id] = o;
1373
1373
  const bidsOut = {};
1374
1374
  for (const [id, b] of [...bids.entries()].sort(([a], [b2]) => ord(a, b2))) bidsOut[id] = b;
1375
- return { tipHeight, tokens: tokensOut, balances: balancesOut, names: namesOut, offers: offersOut, bids: bidsOut, events: log, feesPaid: feesPaid.toString() };
1375
+ const recapturesOut = {};
1376
+ for (const [nm, r] of [...recaptures.entries()].sort(([a], [b]) => ord(a, b))) recapturesOut[nm] = { owner: r.owner, effectiveHeight: r.effHeight, finalizeBy: r.finalizeBy };
1377
+ return { tipHeight, tokens: tokensOut, balances: balancesOut, names: namesOut, offers: offersOut, bids: bidsOut, recaptures: recapturesOut, events: log, feesPaid: feesPaid.toString() };
1376
1378
  }
1377
1379
  function canonicalState(s) {
1378
1380
  const sortKeys = (v) => {
@@ -1382,7 +1384,7 @@ function canonicalState(s) {
1382
1384
  }
1383
1385
  return v;
1384
1386
  };
1385
- const { events: _events, ...data } = s;
1387
+ const { events: _events, recaptures: _recaptures, ...data } = s;
1386
1388
  return JSON.stringify(sortKeys(data));
1387
1389
  }
1388
1390
 
package/dist/index.d.cts CHANGED
@@ -334,6 +334,13 @@ interface CairnXState {
334
334
  names: Record<string, NameState>;
335
335
  offers: Record<string, OfferState>;
336
336
  bids: Record<string, BidState>;
337
+ /** v2.6 pending recapture reservations (name → the current winner). DIAGNOSTIC, excluded from canonicalState
338
+ * (like `events`); exposed so a wallet/UI can confirm it is still the winner before paying the premium. */
339
+ recaptures: Record<string, {
340
+ owner: string;
341
+ effectiveHeight: number;
342
+ finalizeBy: number;
343
+ }>;
337
344
  events: AppliedEvent[];
338
345
  feesPaid: string;
339
346
  }
package/dist/index.d.ts CHANGED
@@ -334,6 +334,13 @@ interface CairnXState {
334
334
  names: Record<string, NameState>;
335
335
  offers: Record<string, OfferState>;
336
336
  bids: Record<string, BidState>;
337
+ /** v2.6 pending recapture reservations (name → the current winner). DIAGNOSTIC, excluded from canonicalState
338
+ * (like `events`); exposed so a wallet/UI can confirm it is still the winner before paying the premium. */
339
+ recaptures: Record<string, {
340
+ owner: string;
341
+ effectiveHeight: number;
342
+ finalizeBy: number;
343
+ }>;
337
344
  events: AppliedEvent[];
338
345
  feesPaid: string;
339
346
  }
package/dist/index.js CHANGED
@@ -1233,7 +1233,9 @@ function resolve(events, tipHeight) {
1233
1233
  for (const [id, o] of [...offers.entries()].sort(([a], [b]) => ord(a, b))) offersOut[id] = o;
1234
1234
  const bidsOut = {};
1235
1235
  for (const [id, b] of [...bids.entries()].sort(([a], [b2]) => ord(a, b2))) bidsOut[id] = b;
1236
- return { tipHeight, tokens: tokensOut, balances: balancesOut, names: namesOut, offers: offersOut, bids: bidsOut, events: log, feesPaid: feesPaid.toString() };
1236
+ const recapturesOut = {};
1237
+ for (const [nm, r] of [...recaptures.entries()].sort(([a], [b]) => ord(a, b))) recapturesOut[nm] = { owner: r.owner, effectiveHeight: r.effHeight, finalizeBy: r.finalizeBy };
1238
+ return { tipHeight, tokens: tokensOut, balances: balancesOut, names: namesOut, offers: offersOut, bids: bidsOut, recaptures: recapturesOut, events: log, feesPaid: feesPaid.toString() };
1237
1239
  }
1238
1240
  function canonicalState(s) {
1239
1241
  const sortKeys = (v) => {
@@ -1243,7 +1245,7 @@ function canonicalState(s) {
1243
1245
  }
1244
1246
  return v;
1245
1247
  };
1246
- const { events: _events, ...data } = s;
1248
+ const { events: _events, recaptures: _recaptures, ...data } = s;
1247
1249
  return JSON.stringify(sortKeys(data));
1248
1250
  }
1249
1251
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inversealtruism/cairnx-core",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "description": "CairnX — tokens, atomic DvP trades and leased .csd names on Compute Substrate, as a pure deterministic convention library (Ordinals/Runes class). Ships the normative CONVENTION.md and the conformance vectors.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",