@inversealtruism/cairnx-core 0.1.23 → 0.1.25
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 +146 -7
- package/dist/index.d.cts +25 -2
- package/dist/index.d.ts +25 -2
- package/dist/index.js +134 -7
- package/package.json +1 -1
- package/test/vectors/cases.json +242 -22
package/dist/index.cjs
CHANGED
|
@@ -39,16 +39,22 @@ __export(index_exports, {
|
|
|
39
39
|
EPOCH_LEN: () => import_csd_codec4.EPOCH_LEN,
|
|
40
40
|
FEE_BPS: () => FEE_BPS,
|
|
41
41
|
FEE_BPS_V16: () => FEE_BPS_V16,
|
|
42
|
+
FINALIZE_TIP_MARGIN: () => FINALIZE_TIP_MARGIN,
|
|
42
43
|
HALVING_INTERVAL: () => import_csd_codec4.HALVING_INTERVAL,
|
|
43
44
|
HASH_RE: () => HASH_RE,
|
|
44
45
|
INITIAL_REWARD: () => import_csd_codec4.INITIAL_REWARD,
|
|
45
46
|
MAX_ACTIVE_CLAIMS: () => MAX_ACTIVE_CLAIMS,
|
|
46
47
|
MAX_AMOUNT: () => MAX_AMOUNT,
|
|
47
48
|
MAX_OFFER_EPOCHS: () => MAX_OFFER_EPOCHS,
|
|
49
|
+
MAX_PENDING_REG: () => MAX_PENDING_REG,
|
|
48
50
|
MAX_RECORD_BYTES: () => MAX_RECORD_BYTES,
|
|
49
51
|
MINT_KEYS: () => MINT_KEYS,
|
|
50
52
|
MIN_FEE_ATTEST: () => import_csd_codec4.MIN_FEE_ATTEST,
|
|
51
53
|
MIN_FEE_PROPOSE: () => import_csd_codec4.MIN_FEE_PROPOSE,
|
|
54
|
+
NAME_FEE_LEN3_V24: () => NAME_FEE_LEN3_V24,
|
|
55
|
+
NAME_FEE_LEN4_V24: () => NAME_FEE_LEN4_V24,
|
|
56
|
+
NAME_FEE_LONG_V24: () => NAME_FEE_LONG_V24,
|
|
57
|
+
NAME_FEE_MID_V24: () => NAME_FEE_MID_V24,
|
|
52
58
|
NAME_FEE_SHORT_V18: () => NAME_FEE_SHORT_V18,
|
|
53
59
|
NAME_FEE_V18: () => NAME_FEE_V18,
|
|
54
60
|
NAME_GRACE_EPOCHS: () => NAME_GRACE_EPOCHS,
|
|
@@ -57,6 +63,7 @@ __export(index_exports, {
|
|
|
57
63
|
NAME_PREMIUM_START: () => NAME_PREMIUM_START,
|
|
58
64
|
NAME_RE: () => NAME_RE,
|
|
59
65
|
NAME_TERM_EPOCHS: () => NAME_TERM_EPOCHS,
|
|
66
|
+
NFINALIZE_KEYS: () => NFINALIZE_KEYS,
|
|
60
67
|
NPROFILE_KEYS: () => NPROFILE_KEYS,
|
|
61
68
|
OFFER_KEYS: () => OFFER_KEYS,
|
|
62
69
|
PKEY: () => PKEY,
|
|
@@ -64,6 +71,8 @@ __export(index_exports, {
|
|
|
64
71
|
PROFILE_MAX_VALUE_BYTES: () => PROFILE_MAX_VALUE_BYTES,
|
|
65
72
|
REBATE_BPS: () => REBATE_BPS,
|
|
66
73
|
REBATE_FLAT: () => REBATE_FLAT,
|
|
74
|
+
REG_COMMIT_MAX_BLOCKS: () => REG_COMMIT_MAX_BLOCKS,
|
|
75
|
+
REG_FINALIZE_GRACE_BLOCKS: () => REG_FINALIZE_GRACE_BLOCKS,
|
|
67
76
|
RESERVED_NAMES: () => RESERVED_NAMES,
|
|
68
77
|
SALT_RE: () => SALT_RE,
|
|
69
78
|
SCORE_CANCEL: () => SCORE_CANCEL,
|
|
@@ -85,6 +94,8 @@ __export(index_exports, {
|
|
|
85
94
|
V21_HEIGHT: () => V21_HEIGHT,
|
|
86
95
|
V22_HEIGHT: () => V22_HEIGHT,
|
|
87
96
|
V23_HEIGHT: () => V23_HEIGHT,
|
|
97
|
+
V24_HEIGHT: () => V24_HEIGHT,
|
|
98
|
+
V25_HEIGHT: () => V25_HEIGHT,
|
|
88
99
|
ZERO_ADDR: () => ZERO_ADDR,
|
|
89
100
|
bid: () => bid,
|
|
90
101
|
blockReward: () => import_csd_codec4.blockReward,
|
|
@@ -105,6 +116,7 @@ __export(index_exports, {
|
|
|
105
116
|
nameClaim: () => nameClaim,
|
|
106
117
|
nameCommit: () => nameCommit,
|
|
107
118
|
nameCommitRecord: () => nameCommitRecord,
|
|
119
|
+
nameFinalize: () => nameFinalize,
|
|
108
120
|
nameProfile: () => nameProfile,
|
|
109
121
|
nameRegFee: () => nameRegFee,
|
|
110
122
|
nameRenew: () => nameRenew,
|
|
@@ -166,6 +178,11 @@ var DEPLOY_FEE = 1e8;
|
|
|
166
178
|
var V18_HEIGHT = 4e4;
|
|
167
179
|
var NAME_FEE_SHORT_V18 = 670000000n;
|
|
168
180
|
var NAME_FEE_V18 = 300000000n;
|
|
181
|
+
var V24_HEIGHT = 49200;
|
|
182
|
+
var NAME_FEE_LEN3_V24 = 1500000000n;
|
|
183
|
+
var NAME_FEE_LEN4_V24 = 1000000000n;
|
|
184
|
+
var NAME_FEE_MID_V24 = 500000000n;
|
|
185
|
+
var NAME_FEE_LONG_V24 = 300000000n;
|
|
169
186
|
var V19_HEIGHT = 36700;
|
|
170
187
|
var V20_HEIGHT = 38400;
|
|
171
188
|
var V21_HEIGHT = 40100;
|
|
@@ -177,6 +194,13 @@ var PKEY = /^[a-z0-9](?:[a-z0-9.-]{0,30}[a-z0-9])?$/;
|
|
|
177
194
|
var PROFILE_MAX_KEYS = 16;
|
|
178
195
|
var PROFILE_MAX_VALUE_BYTES = 256;
|
|
179
196
|
function nameRegFee(name, height) {
|
|
197
|
+
if (height >= V24_HEIGHT) {
|
|
198
|
+
const ln = name.length;
|
|
199
|
+
if (ln <= 3) return NAME_FEE_LEN3_V24;
|
|
200
|
+
if (ln === 4) return NAME_FEE_LEN4_V24;
|
|
201
|
+
if (ln <= 9) return NAME_FEE_MID_V24;
|
|
202
|
+
return NAME_FEE_LONG_V24;
|
|
203
|
+
}
|
|
180
204
|
if (height >= V18_HEIGHT) return name.length <= 4 ? NAME_FEE_SHORT_V18 : NAME_FEE_V18;
|
|
181
205
|
const n = name.length;
|
|
182
206
|
if (n <= 3) return 500000000n;
|
|
@@ -195,6 +219,11 @@ var HASH_RE = /^0x[0-9a-f]{64}$/;
|
|
|
195
219
|
var SALT_RE = /^[0-9a-fA-F]{16,128}$/;
|
|
196
220
|
var RESERVED_NAMES = /* @__PURE__ */ new Set(["csd", "treasury", "admin", "official", "root", "www", "support"]);
|
|
197
221
|
var COMMIT_MAX_BLOCKS = 8 * import_csd_codec.EPOCH_LEN;
|
|
222
|
+
var V25_HEIGHT = 1e7;
|
|
223
|
+
var REG_COMMIT_MAX_BLOCKS = 8;
|
|
224
|
+
var REG_FINALIZE_GRACE_BLOCKS = 12;
|
|
225
|
+
var MAX_PENDING_REG = 3;
|
|
226
|
+
var FINALIZE_TIP_MARGIN = 2;
|
|
198
227
|
var epochOf = (height) => Math.floor(height / import_csd_codec.EPOCH_LEN);
|
|
199
228
|
var claimWindowAt = (height) => height >= V20_HEIGHT ? CLAIM_WINDOW_BLOCKS_V20 : CLAIM_WINDOW_BLOCKS;
|
|
200
229
|
var claimWindowOf = (claimUntilHeight) => claimUntilHeight - CLAIM_WINDOW_BLOCKS_V20 >= V20_HEIGHT ? CLAIM_WINDOW_BLOCKS_V20 : CLAIM_WINDOW_BLOCKS;
|
|
@@ -257,6 +286,7 @@ var TRANSFER_KEYS = /* @__PURE__ */ new Set(["v", "t", "ticker", "to", "amount",
|
|
|
257
286
|
var OFFER_KEYS = /* @__PURE__ */ new Set(["v", "t", "give", "want", "min", "bid", "taker", "memo", "ts"]);
|
|
258
287
|
var BID_KEYS = /* @__PURE__ */ new Set(["v", "t", "want", "give", "memo", "ts"]);
|
|
259
288
|
var NAME_KEYS = /* @__PURE__ */ new Set(["v", "t", "name", "salt"]);
|
|
289
|
+
var NFINALIZE_KEYS = /* @__PURE__ */ new Set(["v", "t", "name", "salt"]);
|
|
260
290
|
var NPROFILE_KEYS = /* @__PURE__ */ new Set(["v", "t", "name", "p"]);
|
|
261
291
|
function parseRecord(uri, payloadHashHex) {
|
|
262
292
|
if (new TextEncoder().encode(uri).length > MAX_RECORD_BYTES) return null;
|
|
@@ -368,6 +398,12 @@ function parseRecord(uri, payloadHashHex) {
|
|
|
368
398
|
if (r.salt !== void 0 && (typeof r.salt !== "string" || !SALT_RE.test(r.salt))) return null;
|
|
369
399
|
return r;
|
|
370
400
|
}
|
|
401
|
+
case "nfinalize": {
|
|
402
|
+
if (!onlyKeys(r, NFINALIZE_KEYS)) return null;
|
|
403
|
+
if (!isName(r.name)) return null;
|
|
404
|
+
if (typeof r.salt !== "string" || !SALT_RE.test(r.salt)) return null;
|
|
405
|
+
return r;
|
|
406
|
+
}
|
|
371
407
|
case "nxfer": {
|
|
372
408
|
if (!isName(r.name) || !isAddr(r.to)) return null;
|
|
373
409
|
if (Object.keys(r).length !== 4) return null;
|
|
@@ -424,6 +460,7 @@ var bid = (r) => buildRecord({ v: 1, t: "bid", ...r });
|
|
|
424
460
|
var offerCancelAll = (r = {}) => buildRecord({ v: 1, t: "ocancel", ...r });
|
|
425
461
|
var nameCommitRecord = (r) => buildRecord({ v: 1, t: "ncommit", ...r });
|
|
426
462
|
var nameClaim = (r) => buildRecord({ v: 1, t: "name", ...r });
|
|
463
|
+
var nameFinalize = (r) => buildRecord({ v: 1, t: "nfinalize", ...r });
|
|
427
464
|
var nameXfer = (r) => buildRecord({ v: 1, t: "nxfer", ...r });
|
|
428
465
|
var nameSet = (r) => buildRecord({ v: 1, t: "nset", ...r });
|
|
429
466
|
var nameRenew = (r) => buildRecord({ v: 1, t: "nrenew", ...r });
|
|
@@ -494,6 +531,10 @@ function resolve(events, tipHeight) {
|
|
|
494
531
|
for (const b of bids.values()) {
|
|
495
532
|
if (b.status === "open" && ep > effExpiry(b, height)) b.status = "expired";
|
|
496
533
|
}
|
|
534
|
+
for (const nm of [...names.keys()]) {
|
|
535
|
+
const n = names.get(nm);
|
|
536
|
+
if (n.pending && n.finalizeBy !== void 0 && height > n.finalizeBy) names.delete(nm);
|
|
537
|
+
}
|
|
497
538
|
};
|
|
498
539
|
const V15_EPOCH = epochOf(V15_HEIGHT);
|
|
499
540
|
const paidThrough = (n) => n.paidThroughEpoch ?? V15_EPOCH + NAME_TERM_EPOCHS;
|
|
@@ -544,6 +585,7 @@ function resolve(events, tipHeight) {
|
|
|
544
585
|
const v16 = ev.height >= V16_HEIGHT;
|
|
545
586
|
const v19 = ev.height >= V19_HEIGHT;
|
|
546
587
|
const v23 = ev.height >= V23_HEIGHT;
|
|
588
|
+
const v25 = ev.height >= V25_HEIGHT;
|
|
547
589
|
const feeToTreasury = ev.kind === "propose" ? ptAmt((ev.paidTo ?? {})[TREASURY_ADDR]) : 0n;
|
|
548
590
|
if (ev.kind === "propose") {
|
|
549
591
|
const rec = parseRecord(ev.uri, ev.payloadHash);
|
|
@@ -629,11 +671,12 @@ function resolve(events, tipHeight) {
|
|
|
629
671
|
note(ev, ev.id, "name", false, "before v1.1 activation");
|
|
630
672
|
continue;
|
|
631
673
|
}
|
|
674
|
+
const regWindow = v25 ? REG_COMMIT_MAX_BLOCKS : COMMIT_MAX_BLOCKS;
|
|
632
675
|
let effHeight = ev.height;
|
|
633
676
|
if (rec.salt !== void 0) {
|
|
634
677
|
const ch = nameCommit(rec.name, rec.salt, who);
|
|
635
678
|
const cH = commits.get(ch);
|
|
636
|
-
if (cH === void 0 || cH >= ev.height || ev.height - cH >
|
|
679
|
+
if (cH === void 0 || cH >= ev.height || ev.height - cH > regWindow) {
|
|
637
680
|
note(ev, ev.id, "name", false, "no valid in-window commit for this reveal");
|
|
638
681
|
continue;
|
|
639
682
|
}
|
|
@@ -641,8 +684,9 @@ function resolve(events, tipHeight) {
|
|
|
641
684
|
}
|
|
642
685
|
const cur = names.get(rec.name);
|
|
643
686
|
const epClaim = epochOf(ev.height);
|
|
644
|
-
|
|
645
|
-
|
|
687
|
+
const curActive = cur && cur.pending && cur.finalizeBy !== void 0 && ev.height > cur.finalizeBy ? void 0 : cur;
|
|
688
|
+
if (curActive && !curActive.pending && v15 && lapsed(curActive, epClaim)) {
|
|
689
|
+
const fee = expiredClaimFee(rec.name, epClaim - (paidThrough(curActive) + NAME_GRACE_EPOCHS), ev.height);
|
|
646
690
|
if (feeToTreasury < fee) {
|
|
647
691
|
note(ev, ev.id, "name", false, "lapsed-name claim fee unpaid (decaying premium)");
|
|
648
692
|
continue;
|
|
@@ -656,6 +700,32 @@ function resolve(events, tipHeight) {
|
|
|
656
700
|
note(ev, ev.id, "name", true, "lapsed lease re-claimed (premium)");
|
|
657
701
|
continue;
|
|
658
702
|
}
|
|
703
|
+
if (v25) {
|
|
704
|
+
if (rec.salt === void 0) {
|
|
705
|
+
note(ev, ev.id, "name", false, "v2.5: registration requires a commit-reveal (salt)");
|
|
706
|
+
continue;
|
|
707
|
+
}
|
|
708
|
+
const better2 = !curActive || !curActive.viaFill && (effHeight < curActive.effHeight || effHeight === curActive.effHeight && (ev.pos < curActive.pos || ev.pos === curActive.pos && ev.id < curActive.id));
|
|
709
|
+
if (!better2) {
|
|
710
|
+
note(ev, ev.id, "name", false, curActive?.viaFill ? "name taken (purchased \u2014 not displaceable)" : "name taken (earlier anchor wins)");
|
|
711
|
+
continue;
|
|
712
|
+
}
|
|
713
|
+
let myPending = 0;
|
|
714
|
+
for (const [nm, n] of names) if (n.pending && n.owner === who && nm !== rec.name && n.finalizeBy !== void 0 && ev.height <= n.finalizeBy) myPending++;
|
|
715
|
+
if (myPending >= MAX_PENDING_REG) {
|
|
716
|
+
note(ev, ev.id, "name", false, "too many pending reservations (max reached)");
|
|
717
|
+
continue;
|
|
718
|
+
}
|
|
719
|
+
if (curActive) {
|
|
720
|
+
for (const o of offers.values()) if (o.status === "open" && isNameGive(o.give) && o.give.name === rec.name) {
|
|
721
|
+
releaseGive(o);
|
|
722
|
+
o.status = "cancelled";
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
names.set(rec.name, { owner: who, effHeight, pos: ev.pos, id: ev.id, height: ev.height, locked: false, pending: true, finalizeBy: effHeight + REG_COMMIT_MAX_BLOCKS + REG_FINALIZE_GRACE_BLOCKS });
|
|
726
|
+
note(ev, ev.id, "name", true, curActive ? "reserved (displaced prior reservation)" : "reserved (pending finalize)");
|
|
727
|
+
continue;
|
|
728
|
+
}
|
|
659
729
|
if (feeToTreasury < nameRegFee(rec.name, ev.height)) {
|
|
660
730
|
note(ev, ev.id, "name", false, "name registration fee unpaid");
|
|
661
731
|
continue;
|
|
@@ -669,12 +739,12 @@ function resolve(events, tipHeight) {
|
|
|
669
739
|
locked: false,
|
|
670
740
|
...v15 ? { paidThroughEpoch: epClaim + NAME_TERM_EPOCHS } : {}
|
|
671
741
|
};
|
|
672
|
-
const better = !
|
|
742
|
+
const better = !curActive || !curActive.viaFill && (effHeight < curActive.effHeight || effHeight === curActive.effHeight && (ev.pos < curActive.pos || ev.pos === curActive.pos && ev.id < curActive.id));
|
|
673
743
|
if (!better) {
|
|
674
|
-
note(ev, ev.id, "name", false,
|
|
744
|
+
note(ev, ev.id, "name", false, curActive?.viaFill ? "name taken (purchased \u2014 not displaceable)" : "name taken (earlier anchor wins)");
|
|
675
745
|
continue;
|
|
676
746
|
}
|
|
677
|
-
if (
|
|
747
|
+
if (curActive) {
|
|
678
748
|
for (const o of offers.values()) if (o.status === "open" && isNameGive(o.give) && o.give.name === rec.name) {
|
|
679
749
|
releaseGive(o);
|
|
680
750
|
o.status = "cancelled";
|
|
@@ -682,13 +752,49 @@ function resolve(events, tipHeight) {
|
|
|
682
752
|
}
|
|
683
753
|
names.set(rec.name, cand);
|
|
684
754
|
feesPaid += nameRegFee(rec.name, ev.height);
|
|
685
|
-
note(ev, ev.id, "name", true,
|
|
755
|
+
note(ev, ev.id, "name", true, curActive ? "displaced prior holder" : void 0);
|
|
756
|
+
} else if (rec.t === "nfinalize") {
|
|
757
|
+
if (!v25) {
|
|
758
|
+
note(ev, ev.id, "nfinalize", false, "before v2.5 activation");
|
|
759
|
+
continue;
|
|
760
|
+
}
|
|
761
|
+
const n = names.get(rec.name);
|
|
762
|
+
if (!n || !n.pending || n.owner !== who) {
|
|
763
|
+
note(ev, ev.id, "nfinalize", false, "no matching pending reservation you own");
|
|
764
|
+
continue;
|
|
765
|
+
}
|
|
766
|
+
const cH = commits.get(nameCommit(rec.name, rec.salt, who));
|
|
767
|
+
if (cH === void 0 || cH !== n.effHeight) {
|
|
768
|
+
note(ev, ev.id, "nfinalize", false, "salt does not match the reservation commit");
|
|
769
|
+
continue;
|
|
770
|
+
}
|
|
771
|
+
if (!(ev.height > n.effHeight + REG_COMMIT_MAX_BLOCKS)) {
|
|
772
|
+
note(ev, ev.id, "nfinalize", false, "too early \u2014 displacement contest not yet frozen");
|
|
773
|
+
continue;
|
|
774
|
+
}
|
|
775
|
+
if (n.finalizeBy !== void 0 && ev.height > n.finalizeBy) {
|
|
776
|
+
note(ev, ev.id, "nfinalize", false, "reservation expired");
|
|
777
|
+
continue;
|
|
778
|
+
}
|
|
779
|
+
if (feeToTreasury < nameRegFee(rec.name, ev.height)) {
|
|
780
|
+
note(ev, ev.id, "nfinalize", false, "name registration fee unpaid");
|
|
781
|
+
continue;
|
|
782
|
+
}
|
|
783
|
+
n.pending = void 0;
|
|
784
|
+
n.finalizeBy = void 0;
|
|
785
|
+
n.paidThroughEpoch = epochOf(ev.height) + NAME_TERM_EPOCHS;
|
|
786
|
+
feesPaid += nameRegFee(rec.name, ev.height);
|
|
787
|
+
note(ev, ev.id, "nfinalize", true);
|
|
686
788
|
} else if (rec.t === "nxfer") {
|
|
687
789
|
const n = names.get(rec.name);
|
|
688
790
|
if (!n || n.owner !== who) {
|
|
689
791
|
note(ev, ev.id, "nxfer", false, "not the name owner");
|
|
690
792
|
continue;
|
|
691
793
|
}
|
|
794
|
+
if (n.pending) {
|
|
795
|
+
note(ev, ev.id, "nxfer", false, "name reservation not yet finalized");
|
|
796
|
+
continue;
|
|
797
|
+
}
|
|
692
798
|
if (v15 && lapsed(n, epochOf(ev.height))) {
|
|
693
799
|
note(ev, ev.id, "nxfer", false, "lease lapsed \u2014 claim it instead");
|
|
694
800
|
continue;
|
|
@@ -707,6 +813,10 @@ function resolve(events, tipHeight) {
|
|
|
707
813
|
note(ev, ev.id, "nset", false, "not the name owner");
|
|
708
814
|
continue;
|
|
709
815
|
}
|
|
816
|
+
if (n.pending) {
|
|
817
|
+
note(ev, ev.id, "nset", false, "name reservation not yet finalized");
|
|
818
|
+
continue;
|
|
819
|
+
}
|
|
710
820
|
if (v15 && lapsed(n, epochOf(ev.height))) {
|
|
711
821
|
note(ev, ev.id, "nset", false, "lease lapsed \u2014 claim it instead");
|
|
712
822
|
continue;
|
|
@@ -724,6 +834,10 @@ function resolve(events, tipHeight) {
|
|
|
724
834
|
note(ev, ev.id, "nprofile", false, "not the name owner");
|
|
725
835
|
continue;
|
|
726
836
|
}
|
|
837
|
+
if (n.pending) {
|
|
838
|
+
note(ev, ev.id, "nprofile", false, "name reservation not yet finalized");
|
|
839
|
+
continue;
|
|
840
|
+
}
|
|
727
841
|
if (v15 && lapsed(n, epochOf(ev.height))) {
|
|
728
842
|
note(ev, ev.id, "nprofile", false, "lease lapsed \u2014 claim it instead");
|
|
729
843
|
continue;
|
|
@@ -768,6 +882,10 @@ function resolve(events, tipHeight) {
|
|
|
768
882
|
note(ev, ev.id, "offer", false, "you don't own this name");
|
|
769
883
|
continue;
|
|
770
884
|
}
|
|
885
|
+
if (n.pending) {
|
|
886
|
+
note(ev, ev.id, "offer", false, "name reservation not yet finalized");
|
|
887
|
+
continue;
|
|
888
|
+
}
|
|
771
889
|
if (n.locked) {
|
|
772
890
|
note(ev, ev.id, "offer", false, "name already locked by another offer");
|
|
773
891
|
continue;
|
|
@@ -877,6 +995,10 @@ function resolve(events, tipHeight) {
|
|
|
877
995
|
}
|
|
878
996
|
const n = names.get(rec.name);
|
|
879
997
|
const ep = epochOf(ev.height);
|
|
998
|
+
if (n && n.pending) {
|
|
999
|
+
note(ev, ev.id, "nrenew", false, "name reservation not yet finalized");
|
|
1000
|
+
continue;
|
|
1001
|
+
}
|
|
880
1002
|
if (!n || lapsed(n, ep)) {
|
|
881
1003
|
note(ev, ev.id, "nrenew", false, "no live lease (lapsed names are claimed, not renewed)");
|
|
882
1004
|
continue;
|
|
@@ -1156,8 +1278,13 @@ function resolve(events, tipHeight) {
|
|
|
1156
1278
|
const namesOut = {};
|
|
1157
1279
|
const tipV15 = tipHeight >= V15_HEIGHT;
|
|
1158
1280
|
const tipV19 = tipHeight >= V19_HEIGHT;
|
|
1281
|
+
const tipV25 = tipHeight >= V25_HEIGHT;
|
|
1159
1282
|
const tipEpoch = epochOf(tipHeight);
|
|
1160
1283
|
for (const [nm, n] of [...names.entries()].sort(([a], [b]) => ord(a, b))) {
|
|
1284
|
+
if (tipV25 && n.pending) {
|
|
1285
|
+
namesOut[nm] = { name: nm, owner: n.owner, claimId: n.id, height: n.height, effectiveHeight: n.effHeight, locked: n.locked, pending: true, finalizeBy: n.finalizeBy };
|
|
1286
|
+
continue;
|
|
1287
|
+
}
|
|
1161
1288
|
namesOut[nm] = {
|
|
1162
1289
|
name: nm,
|
|
1163
1290
|
owner: n.owner,
|
|
@@ -1231,16 +1358,22 @@ var import_csd_codec4 = require("@inversealtruism/csd-codec");
|
|
|
1231
1358
|
EPOCH_LEN,
|
|
1232
1359
|
FEE_BPS,
|
|
1233
1360
|
FEE_BPS_V16,
|
|
1361
|
+
FINALIZE_TIP_MARGIN,
|
|
1234
1362
|
HALVING_INTERVAL,
|
|
1235
1363
|
HASH_RE,
|
|
1236
1364
|
INITIAL_REWARD,
|
|
1237
1365
|
MAX_ACTIVE_CLAIMS,
|
|
1238
1366
|
MAX_AMOUNT,
|
|
1239
1367
|
MAX_OFFER_EPOCHS,
|
|
1368
|
+
MAX_PENDING_REG,
|
|
1240
1369
|
MAX_RECORD_BYTES,
|
|
1241
1370
|
MINT_KEYS,
|
|
1242
1371
|
MIN_FEE_ATTEST,
|
|
1243
1372
|
MIN_FEE_PROPOSE,
|
|
1373
|
+
NAME_FEE_LEN3_V24,
|
|
1374
|
+
NAME_FEE_LEN4_V24,
|
|
1375
|
+
NAME_FEE_LONG_V24,
|
|
1376
|
+
NAME_FEE_MID_V24,
|
|
1244
1377
|
NAME_FEE_SHORT_V18,
|
|
1245
1378
|
NAME_FEE_V18,
|
|
1246
1379
|
NAME_GRACE_EPOCHS,
|
|
@@ -1249,6 +1382,7 @@ var import_csd_codec4 = require("@inversealtruism/csd-codec");
|
|
|
1249
1382
|
NAME_PREMIUM_START,
|
|
1250
1383
|
NAME_RE,
|
|
1251
1384
|
NAME_TERM_EPOCHS,
|
|
1385
|
+
NFINALIZE_KEYS,
|
|
1252
1386
|
NPROFILE_KEYS,
|
|
1253
1387
|
OFFER_KEYS,
|
|
1254
1388
|
PKEY,
|
|
@@ -1256,6 +1390,8 @@ var import_csd_codec4 = require("@inversealtruism/csd-codec");
|
|
|
1256
1390
|
PROFILE_MAX_VALUE_BYTES,
|
|
1257
1391
|
REBATE_BPS,
|
|
1258
1392
|
REBATE_FLAT,
|
|
1393
|
+
REG_COMMIT_MAX_BLOCKS,
|
|
1394
|
+
REG_FINALIZE_GRACE_BLOCKS,
|
|
1259
1395
|
RESERVED_NAMES,
|
|
1260
1396
|
SALT_RE,
|
|
1261
1397
|
SCORE_CANCEL,
|
|
@@ -1277,6 +1413,8 @@ var import_csd_codec4 = require("@inversealtruism/csd-codec");
|
|
|
1277
1413
|
V21_HEIGHT,
|
|
1278
1414
|
V22_HEIGHT,
|
|
1279
1415
|
V23_HEIGHT,
|
|
1416
|
+
V24_HEIGHT,
|
|
1417
|
+
V25_HEIGHT,
|
|
1280
1418
|
ZERO_ADDR,
|
|
1281
1419
|
bid,
|
|
1282
1420
|
blockReward,
|
|
@@ -1297,6 +1435,7 @@ var import_csd_codec4 = require("@inversealtruism/csd-codec");
|
|
|
1297
1435
|
nameClaim,
|
|
1298
1436
|
nameCommit,
|
|
1299
1437
|
nameCommitRecord,
|
|
1438
|
+
nameFinalize,
|
|
1300
1439
|
nameProfile,
|
|
1301
1440
|
nameRegFee,
|
|
1302
1441
|
nameRenew,
|
package/dist/index.d.cts
CHANGED
|
@@ -37,6 +37,11 @@ declare const DEPLOY_FEE = 100000000;
|
|
|
37
37
|
declare const V18_HEIGHT = 40000;
|
|
38
38
|
declare const NAME_FEE_SHORT_V18 = 670000000n;
|
|
39
39
|
declare const NAME_FEE_V18 = 300000000n;
|
|
40
|
+
declare const V24_HEIGHT = 49200;
|
|
41
|
+
declare const NAME_FEE_LEN3_V24 = 1500000000n;
|
|
42
|
+
declare const NAME_FEE_LEN4_V24 = 1000000000n;
|
|
43
|
+
declare const NAME_FEE_MID_V24 = 500000000n;
|
|
44
|
+
declare const NAME_FEE_LONG_V24 = 300000000n;
|
|
40
45
|
declare const V19_HEIGHT = 36700;
|
|
41
46
|
declare const V20_HEIGHT = 38400;
|
|
42
47
|
declare const V21_HEIGHT = 40100;
|
|
@@ -58,6 +63,11 @@ declare const HASH_RE: RegExp;
|
|
|
58
63
|
declare const SALT_RE: RegExp;
|
|
59
64
|
declare const RESERVED_NAMES: Set<string>;
|
|
60
65
|
declare const COMMIT_MAX_BLOCKS: number;
|
|
66
|
+
declare const V25_HEIGHT = 10000000;
|
|
67
|
+
declare const REG_COMMIT_MAX_BLOCKS = 8;
|
|
68
|
+
declare const REG_FINALIZE_GRACE_BLOCKS = 12;
|
|
69
|
+
declare const MAX_PENDING_REG = 3;
|
|
70
|
+
declare const FINALIZE_TIP_MARGIN = 2;
|
|
61
71
|
declare const epochOf: (height: number) => number;
|
|
62
72
|
declare const claimWindowAt: (height: number) => number;
|
|
63
73
|
declare const claimWindowOf: (claimUntilHeight: number) => number;
|
|
@@ -147,6 +157,12 @@ interface NameRecord {
|
|
|
147
157
|
name: string;
|
|
148
158
|
salt?: string;
|
|
149
159
|
}
|
|
160
|
+
interface NameFinalizeRecord {
|
|
161
|
+
v: 1;
|
|
162
|
+
t: "nfinalize";
|
|
163
|
+
name: string;
|
|
164
|
+
salt: string;
|
|
165
|
+
}
|
|
150
166
|
interface NameXferRecord {
|
|
151
167
|
v: 1;
|
|
152
168
|
t: "nxfer";
|
|
@@ -176,7 +192,7 @@ interface NameProfileRecord {
|
|
|
176
192
|
name: string;
|
|
177
193
|
p: Record<string, string>;
|
|
178
194
|
}
|
|
179
|
-
type CairnXRecord = DeployRecord | MintRecord | TransferRecord | OfferRecord | BidRecord | OfferCancelAllRecord | NameCommitRecord | NameRecord | NameXferRecord | NameSetRecord | NameRenewRecord | TokenMetaRecord | NameProfileRecord;
|
|
195
|
+
type CairnXRecord = DeployRecord | MintRecord | TransferRecord | OfferRecord | BidRecord | OfferCancelAllRecord | NameCommitRecord | NameRecord | NameFinalizeRecord | NameXferRecord | NameSetRecord | NameRenewRecord | TokenMetaRecord | NameProfileRecord;
|
|
180
196
|
interface ProposeEvent {
|
|
181
197
|
kind: "propose";
|
|
182
198
|
id: string;
|
|
@@ -232,6 +248,11 @@ interface NameState {
|
|
|
232
248
|
paidThroughEpoch?: number;
|
|
233
249
|
/** v1.5: true once the lease + grace lapsed (record kept for history; name is claimable) */
|
|
234
250
|
expired?: true;
|
|
251
|
+
/** v2.5: a payment-free registration reservation awaiting nfinalize. NOT resolvable (confers no address)
|
|
252
|
+
* and not actionable by the owner until finalized; auto-expires at finalizeBy. Materialized at v2.5+ tips
|
|
253
|
+
* only, so every pre-v2.5 canonical hash stays byte-identical. */
|
|
254
|
+
pending?: true;
|
|
255
|
+
finalizeBy?: number;
|
|
235
256
|
/** v1.9: ENS-class identity — a charset-locked string→string map (doc 36). INERT cosmetic metadata
|
|
236
257
|
* (NOT a send target; the verified address is `addr`). Materialized at v1.9+ tips only, cleared on
|
|
237
258
|
* every ownership change, absent when empty. */
|
|
@@ -342,6 +363,7 @@ declare const TRANSFER_KEYS: Set<string>;
|
|
|
342
363
|
declare const OFFER_KEYS: Set<string>;
|
|
343
364
|
declare const BID_KEYS: Set<string>;
|
|
344
365
|
declare const NAME_KEYS: Set<string>;
|
|
366
|
+
declare const NFINALIZE_KEYS: Set<string>;
|
|
345
367
|
declare const NPROFILE_KEYS: Set<string>;
|
|
346
368
|
/**
|
|
347
369
|
* Parse + validate a record from an anchored `uri`. Returns null for anything invalid —
|
|
@@ -360,6 +382,7 @@ declare const bid: (r: Omit<BidRecord, "v" | "t">) => BuiltRecord;
|
|
|
360
382
|
declare const offerCancelAll: (r?: Omit<OfferCancelAllRecord, "v" | "t">) => BuiltRecord;
|
|
361
383
|
declare const nameCommitRecord: (r: Omit<NameCommitRecord, "v" | "t">) => BuiltRecord;
|
|
362
384
|
declare const nameClaim: (r: Omit<NameRecord, "v" | "t">) => BuiltRecord;
|
|
385
|
+
declare const nameFinalize: (r: Omit<NameFinalizeRecord, "v" | "t">) => BuiltRecord;
|
|
363
386
|
declare const nameXfer: (r: Omit<NameXferRecord, "v" | "t">) => BuiltRecord;
|
|
364
387
|
declare const nameSet: (r: Omit<NameSetRecord, "v" | "t">) => BuiltRecord;
|
|
365
388
|
declare const nameRenew: (r: Omit<NameRenewRecord, "v" | "t">) => BuiltRecord;
|
|
@@ -397,4 +420,4 @@ declare function requiredClaimDepth(valueSats: number | bigint, height: number):
|
|
|
397
420
|
capped: boolean;
|
|
398
421
|
};
|
|
399
422
|
|
|
400
|
-
export { ACTIVATION_HEIGHT, ADDR_RE, AMOUNT_RE, type AppliedEvent, type AttestEvent, BID_KEYS, type BalanceState, type BidRecord, type BidState, type BidStatus, type BuiltRecord, CLAIM_ATTACKER_Q, CLAIM_COOLDOWN_BLOCKS, CLAIM_FILL_GRACE_BLOCKS, CLAIM_MIN_DEPTH, CLAIM_WINDOW_BLOCKS, CLAIM_WINDOW_BLOCKS_V20, COMMIT_MAX_BLOCKS, COMMIT_REVEAL_MIN_DEPTH, CONF_TOKEN_FILL, type CairnXRecord, type CairnXState, type ChainEvent, DEPLOY_FEE, DEPLOY_KEYS, DOMAIN, type DeployRecord, FEE_BPS, FEE_BPS_V16, type FillEntry, type Give, HASH_RE, MAX_ACTIVE_CLAIMS, MAX_AMOUNT, MAX_OFFER_EPOCHS, MAX_RECORD_BYTES, MINT_KEYS, type MintRecord, NAME_FEE_SHORT_V18, NAME_FEE_V18, NAME_GRACE_EPOCHS, NAME_KEYS, NAME_PREMIUM_DECAY_EPOCHS, NAME_PREMIUM_START, NAME_RE, NAME_TERM_EPOCHS, NPROFILE_KEYS, type NameCommitRecord, type NameProfileRecord, type NameRecord, type NameRenewRecord, type NameSetRecord, type NameState, type NameXferRecord, OFFER_KEYS, type OfferCancelAllRecord, type OfferRecord, type OfferState, type OfferStatus, PKEY, PROFILE_MAX_KEYS, PROFILE_MAX_VALUE_BYTES, type ProposeEvent, REBATE_BPS, REBATE_FLAT, RESERVED_NAMES, SALT_RE, SCORE_CANCEL, SCORE_CLAIM, SCORE_FILL, TICKER_RE, TRANSFER_KEYS, TREASURY_ADDR, type TokenMetaRecord, type TokenState, type TransferRecord, V11_HEIGHT, V12_HEIGHT, V13_HEIGHT, V14_HEIGHT, V15_HEIGHT, V16_HEIGHT, V17_HEIGHT, V18_HEIGHT, V19_HEIGHT, V20_HEIGHT, V21_HEIGHT, V22_HEIGHT, V23_HEIGHT, type Want, ZERO_ADDR, bid, buildRecord, canonicalState, claimGraceOf, claimWindowAt, claimWindowOf, deploy, epochOf, expiredClaimFee, isName, isNameGive, isTokenWant, makerRebate, mint, nameClaim, nameCommit, nameCommitRecord, nameProfile, nameRegFee, nameRenew, nameSet, nameXfer, offer, offerCancelAll, offerExpiryHeightOf, parseAmount, parseRecord, requiredClaimDepth, resolve, tokenMeta, tradeFee, transfer };
|
|
423
|
+
export { ACTIVATION_HEIGHT, ADDR_RE, AMOUNT_RE, type AppliedEvent, type AttestEvent, BID_KEYS, type BalanceState, type BidRecord, type BidState, type BidStatus, type BuiltRecord, CLAIM_ATTACKER_Q, CLAIM_COOLDOWN_BLOCKS, CLAIM_FILL_GRACE_BLOCKS, CLAIM_MIN_DEPTH, CLAIM_WINDOW_BLOCKS, CLAIM_WINDOW_BLOCKS_V20, COMMIT_MAX_BLOCKS, COMMIT_REVEAL_MIN_DEPTH, CONF_TOKEN_FILL, type CairnXRecord, type CairnXState, type ChainEvent, DEPLOY_FEE, DEPLOY_KEYS, DOMAIN, type DeployRecord, FEE_BPS, FEE_BPS_V16, FINALIZE_TIP_MARGIN, type FillEntry, type Give, HASH_RE, MAX_ACTIVE_CLAIMS, MAX_AMOUNT, MAX_OFFER_EPOCHS, MAX_PENDING_REG, MAX_RECORD_BYTES, MINT_KEYS, type MintRecord, NAME_FEE_LEN3_V24, NAME_FEE_LEN4_V24, NAME_FEE_LONG_V24, NAME_FEE_MID_V24, NAME_FEE_SHORT_V18, NAME_FEE_V18, NAME_GRACE_EPOCHS, NAME_KEYS, NAME_PREMIUM_DECAY_EPOCHS, NAME_PREMIUM_START, NAME_RE, NAME_TERM_EPOCHS, NFINALIZE_KEYS, NPROFILE_KEYS, type NameCommitRecord, type NameFinalizeRecord, type NameProfileRecord, type NameRecord, type NameRenewRecord, type NameSetRecord, type NameState, type NameXferRecord, OFFER_KEYS, type OfferCancelAllRecord, type OfferRecord, type OfferState, type OfferStatus, PKEY, PROFILE_MAX_KEYS, PROFILE_MAX_VALUE_BYTES, type ProposeEvent, REBATE_BPS, REBATE_FLAT, REG_COMMIT_MAX_BLOCKS, REG_FINALIZE_GRACE_BLOCKS, RESERVED_NAMES, SALT_RE, SCORE_CANCEL, SCORE_CLAIM, SCORE_FILL, TICKER_RE, TRANSFER_KEYS, TREASURY_ADDR, type TokenMetaRecord, type TokenState, type TransferRecord, V11_HEIGHT, V12_HEIGHT, V13_HEIGHT, V14_HEIGHT, V15_HEIGHT, V16_HEIGHT, V17_HEIGHT, V18_HEIGHT, V19_HEIGHT, V20_HEIGHT, V21_HEIGHT, V22_HEIGHT, V23_HEIGHT, V24_HEIGHT, V25_HEIGHT, type Want, ZERO_ADDR, bid, buildRecord, canonicalState, claimGraceOf, claimWindowAt, claimWindowOf, deploy, epochOf, expiredClaimFee, isName, isNameGive, isTokenWant, makerRebate, mint, nameClaim, nameCommit, nameCommitRecord, nameFinalize, nameProfile, nameRegFee, nameRenew, nameSet, nameXfer, offer, offerCancelAll, offerExpiryHeightOf, parseAmount, parseRecord, requiredClaimDepth, resolve, tokenMeta, tradeFee, transfer };
|
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,11 @@ declare const DEPLOY_FEE = 100000000;
|
|
|
37
37
|
declare const V18_HEIGHT = 40000;
|
|
38
38
|
declare const NAME_FEE_SHORT_V18 = 670000000n;
|
|
39
39
|
declare const NAME_FEE_V18 = 300000000n;
|
|
40
|
+
declare const V24_HEIGHT = 49200;
|
|
41
|
+
declare const NAME_FEE_LEN3_V24 = 1500000000n;
|
|
42
|
+
declare const NAME_FEE_LEN4_V24 = 1000000000n;
|
|
43
|
+
declare const NAME_FEE_MID_V24 = 500000000n;
|
|
44
|
+
declare const NAME_FEE_LONG_V24 = 300000000n;
|
|
40
45
|
declare const V19_HEIGHT = 36700;
|
|
41
46
|
declare const V20_HEIGHT = 38400;
|
|
42
47
|
declare const V21_HEIGHT = 40100;
|
|
@@ -58,6 +63,11 @@ declare const HASH_RE: RegExp;
|
|
|
58
63
|
declare const SALT_RE: RegExp;
|
|
59
64
|
declare const RESERVED_NAMES: Set<string>;
|
|
60
65
|
declare const COMMIT_MAX_BLOCKS: number;
|
|
66
|
+
declare const V25_HEIGHT = 10000000;
|
|
67
|
+
declare const REG_COMMIT_MAX_BLOCKS = 8;
|
|
68
|
+
declare const REG_FINALIZE_GRACE_BLOCKS = 12;
|
|
69
|
+
declare const MAX_PENDING_REG = 3;
|
|
70
|
+
declare const FINALIZE_TIP_MARGIN = 2;
|
|
61
71
|
declare const epochOf: (height: number) => number;
|
|
62
72
|
declare const claimWindowAt: (height: number) => number;
|
|
63
73
|
declare const claimWindowOf: (claimUntilHeight: number) => number;
|
|
@@ -147,6 +157,12 @@ interface NameRecord {
|
|
|
147
157
|
name: string;
|
|
148
158
|
salt?: string;
|
|
149
159
|
}
|
|
160
|
+
interface NameFinalizeRecord {
|
|
161
|
+
v: 1;
|
|
162
|
+
t: "nfinalize";
|
|
163
|
+
name: string;
|
|
164
|
+
salt: string;
|
|
165
|
+
}
|
|
150
166
|
interface NameXferRecord {
|
|
151
167
|
v: 1;
|
|
152
168
|
t: "nxfer";
|
|
@@ -176,7 +192,7 @@ interface NameProfileRecord {
|
|
|
176
192
|
name: string;
|
|
177
193
|
p: Record<string, string>;
|
|
178
194
|
}
|
|
179
|
-
type CairnXRecord = DeployRecord | MintRecord | TransferRecord | OfferRecord | BidRecord | OfferCancelAllRecord | NameCommitRecord | NameRecord | NameXferRecord | NameSetRecord | NameRenewRecord | TokenMetaRecord | NameProfileRecord;
|
|
195
|
+
type CairnXRecord = DeployRecord | MintRecord | TransferRecord | OfferRecord | BidRecord | OfferCancelAllRecord | NameCommitRecord | NameRecord | NameFinalizeRecord | NameXferRecord | NameSetRecord | NameRenewRecord | TokenMetaRecord | NameProfileRecord;
|
|
180
196
|
interface ProposeEvent {
|
|
181
197
|
kind: "propose";
|
|
182
198
|
id: string;
|
|
@@ -232,6 +248,11 @@ interface NameState {
|
|
|
232
248
|
paidThroughEpoch?: number;
|
|
233
249
|
/** v1.5: true once the lease + grace lapsed (record kept for history; name is claimable) */
|
|
234
250
|
expired?: true;
|
|
251
|
+
/** v2.5: a payment-free registration reservation awaiting nfinalize. NOT resolvable (confers no address)
|
|
252
|
+
* and not actionable by the owner until finalized; auto-expires at finalizeBy. Materialized at v2.5+ tips
|
|
253
|
+
* only, so every pre-v2.5 canonical hash stays byte-identical. */
|
|
254
|
+
pending?: true;
|
|
255
|
+
finalizeBy?: number;
|
|
235
256
|
/** v1.9: ENS-class identity — a charset-locked string→string map (doc 36). INERT cosmetic metadata
|
|
236
257
|
* (NOT a send target; the verified address is `addr`). Materialized at v1.9+ tips only, cleared on
|
|
237
258
|
* every ownership change, absent when empty. */
|
|
@@ -342,6 +363,7 @@ declare const TRANSFER_KEYS: Set<string>;
|
|
|
342
363
|
declare const OFFER_KEYS: Set<string>;
|
|
343
364
|
declare const BID_KEYS: Set<string>;
|
|
344
365
|
declare const NAME_KEYS: Set<string>;
|
|
366
|
+
declare const NFINALIZE_KEYS: Set<string>;
|
|
345
367
|
declare const NPROFILE_KEYS: Set<string>;
|
|
346
368
|
/**
|
|
347
369
|
* Parse + validate a record from an anchored `uri`. Returns null for anything invalid —
|
|
@@ -360,6 +382,7 @@ declare const bid: (r: Omit<BidRecord, "v" | "t">) => BuiltRecord;
|
|
|
360
382
|
declare const offerCancelAll: (r?: Omit<OfferCancelAllRecord, "v" | "t">) => BuiltRecord;
|
|
361
383
|
declare const nameCommitRecord: (r: Omit<NameCommitRecord, "v" | "t">) => BuiltRecord;
|
|
362
384
|
declare const nameClaim: (r: Omit<NameRecord, "v" | "t">) => BuiltRecord;
|
|
385
|
+
declare const nameFinalize: (r: Omit<NameFinalizeRecord, "v" | "t">) => BuiltRecord;
|
|
363
386
|
declare const nameXfer: (r: Omit<NameXferRecord, "v" | "t">) => BuiltRecord;
|
|
364
387
|
declare const nameSet: (r: Omit<NameSetRecord, "v" | "t">) => BuiltRecord;
|
|
365
388
|
declare const nameRenew: (r: Omit<NameRenewRecord, "v" | "t">) => BuiltRecord;
|
|
@@ -397,4 +420,4 @@ declare function requiredClaimDepth(valueSats: number | bigint, height: number):
|
|
|
397
420
|
capped: boolean;
|
|
398
421
|
};
|
|
399
422
|
|
|
400
|
-
export { ACTIVATION_HEIGHT, ADDR_RE, AMOUNT_RE, type AppliedEvent, type AttestEvent, BID_KEYS, type BalanceState, type BidRecord, type BidState, type BidStatus, type BuiltRecord, CLAIM_ATTACKER_Q, CLAIM_COOLDOWN_BLOCKS, CLAIM_FILL_GRACE_BLOCKS, CLAIM_MIN_DEPTH, CLAIM_WINDOW_BLOCKS, CLAIM_WINDOW_BLOCKS_V20, COMMIT_MAX_BLOCKS, COMMIT_REVEAL_MIN_DEPTH, CONF_TOKEN_FILL, type CairnXRecord, type CairnXState, type ChainEvent, DEPLOY_FEE, DEPLOY_KEYS, DOMAIN, type DeployRecord, FEE_BPS, FEE_BPS_V16, type FillEntry, type Give, HASH_RE, MAX_ACTIVE_CLAIMS, MAX_AMOUNT, MAX_OFFER_EPOCHS, MAX_RECORD_BYTES, MINT_KEYS, type MintRecord, NAME_FEE_SHORT_V18, NAME_FEE_V18, NAME_GRACE_EPOCHS, NAME_KEYS, NAME_PREMIUM_DECAY_EPOCHS, NAME_PREMIUM_START, NAME_RE, NAME_TERM_EPOCHS, NPROFILE_KEYS, type NameCommitRecord, type NameProfileRecord, type NameRecord, type NameRenewRecord, type NameSetRecord, type NameState, type NameXferRecord, OFFER_KEYS, type OfferCancelAllRecord, type OfferRecord, type OfferState, type OfferStatus, PKEY, PROFILE_MAX_KEYS, PROFILE_MAX_VALUE_BYTES, type ProposeEvent, REBATE_BPS, REBATE_FLAT, RESERVED_NAMES, SALT_RE, SCORE_CANCEL, SCORE_CLAIM, SCORE_FILL, TICKER_RE, TRANSFER_KEYS, TREASURY_ADDR, type TokenMetaRecord, type TokenState, type TransferRecord, V11_HEIGHT, V12_HEIGHT, V13_HEIGHT, V14_HEIGHT, V15_HEIGHT, V16_HEIGHT, V17_HEIGHT, V18_HEIGHT, V19_HEIGHT, V20_HEIGHT, V21_HEIGHT, V22_HEIGHT, V23_HEIGHT, type Want, ZERO_ADDR, bid, buildRecord, canonicalState, claimGraceOf, claimWindowAt, claimWindowOf, deploy, epochOf, expiredClaimFee, isName, isNameGive, isTokenWant, makerRebate, mint, nameClaim, nameCommit, nameCommitRecord, nameProfile, nameRegFee, nameRenew, nameSet, nameXfer, offer, offerCancelAll, offerExpiryHeightOf, parseAmount, parseRecord, requiredClaimDepth, resolve, tokenMeta, tradeFee, transfer };
|
|
423
|
+
export { ACTIVATION_HEIGHT, ADDR_RE, AMOUNT_RE, type AppliedEvent, type AttestEvent, BID_KEYS, type BalanceState, type BidRecord, type BidState, type BidStatus, type BuiltRecord, CLAIM_ATTACKER_Q, CLAIM_COOLDOWN_BLOCKS, CLAIM_FILL_GRACE_BLOCKS, CLAIM_MIN_DEPTH, CLAIM_WINDOW_BLOCKS, CLAIM_WINDOW_BLOCKS_V20, COMMIT_MAX_BLOCKS, COMMIT_REVEAL_MIN_DEPTH, CONF_TOKEN_FILL, type CairnXRecord, type CairnXState, type ChainEvent, DEPLOY_FEE, DEPLOY_KEYS, DOMAIN, type DeployRecord, FEE_BPS, FEE_BPS_V16, FINALIZE_TIP_MARGIN, type FillEntry, type Give, HASH_RE, MAX_ACTIVE_CLAIMS, MAX_AMOUNT, MAX_OFFER_EPOCHS, MAX_PENDING_REG, MAX_RECORD_BYTES, MINT_KEYS, type MintRecord, NAME_FEE_LEN3_V24, NAME_FEE_LEN4_V24, NAME_FEE_LONG_V24, NAME_FEE_MID_V24, NAME_FEE_SHORT_V18, NAME_FEE_V18, NAME_GRACE_EPOCHS, NAME_KEYS, NAME_PREMIUM_DECAY_EPOCHS, NAME_PREMIUM_START, NAME_RE, NAME_TERM_EPOCHS, NFINALIZE_KEYS, NPROFILE_KEYS, type NameCommitRecord, type NameFinalizeRecord, type NameProfileRecord, type NameRecord, type NameRenewRecord, type NameSetRecord, type NameState, type NameXferRecord, OFFER_KEYS, type OfferCancelAllRecord, type OfferRecord, type OfferState, type OfferStatus, PKEY, PROFILE_MAX_KEYS, PROFILE_MAX_VALUE_BYTES, type ProposeEvent, REBATE_BPS, REBATE_FLAT, REG_COMMIT_MAX_BLOCKS, REG_FINALIZE_GRACE_BLOCKS, RESERVED_NAMES, SALT_RE, SCORE_CANCEL, SCORE_CLAIM, SCORE_FILL, TICKER_RE, TRANSFER_KEYS, TREASURY_ADDR, type TokenMetaRecord, type TokenState, type TransferRecord, V11_HEIGHT, V12_HEIGHT, V13_HEIGHT, V14_HEIGHT, V15_HEIGHT, V16_HEIGHT, V17_HEIGHT, V18_HEIGHT, V19_HEIGHT, V20_HEIGHT, V21_HEIGHT, V22_HEIGHT, V23_HEIGHT, V24_HEIGHT, V25_HEIGHT, type Want, ZERO_ADDR, bid, buildRecord, canonicalState, claimGraceOf, claimWindowAt, claimWindowOf, deploy, epochOf, expiredClaimFee, isName, isNameGive, isTokenWant, makerRebate, mint, nameClaim, nameCommit, nameCommitRecord, nameFinalize, nameProfile, nameRegFee, nameRenew, nameSet, nameXfer, offer, offerCancelAll, offerExpiryHeightOf, parseAmount, parseRecord, requiredClaimDepth, resolve, tokenMeta, tradeFee, transfer };
|
package/dist/index.js
CHANGED
|
@@ -40,6 +40,11 @@ var DEPLOY_FEE = 1e8;
|
|
|
40
40
|
var V18_HEIGHT = 4e4;
|
|
41
41
|
var NAME_FEE_SHORT_V18 = 670000000n;
|
|
42
42
|
var NAME_FEE_V18 = 300000000n;
|
|
43
|
+
var V24_HEIGHT = 49200;
|
|
44
|
+
var NAME_FEE_LEN3_V24 = 1500000000n;
|
|
45
|
+
var NAME_FEE_LEN4_V24 = 1000000000n;
|
|
46
|
+
var NAME_FEE_MID_V24 = 500000000n;
|
|
47
|
+
var NAME_FEE_LONG_V24 = 300000000n;
|
|
43
48
|
var V19_HEIGHT = 36700;
|
|
44
49
|
var V20_HEIGHT = 38400;
|
|
45
50
|
var V21_HEIGHT = 40100;
|
|
@@ -51,6 +56,13 @@ var PKEY = /^[a-z0-9](?:[a-z0-9.-]{0,30}[a-z0-9])?$/;
|
|
|
51
56
|
var PROFILE_MAX_KEYS = 16;
|
|
52
57
|
var PROFILE_MAX_VALUE_BYTES = 256;
|
|
53
58
|
function nameRegFee(name, height) {
|
|
59
|
+
if (height >= V24_HEIGHT) {
|
|
60
|
+
const ln = name.length;
|
|
61
|
+
if (ln <= 3) return NAME_FEE_LEN3_V24;
|
|
62
|
+
if (ln === 4) return NAME_FEE_LEN4_V24;
|
|
63
|
+
if (ln <= 9) return NAME_FEE_MID_V24;
|
|
64
|
+
return NAME_FEE_LONG_V24;
|
|
65
|
+
}
|
|
54
66
|
if (height >= V18_HEIGHT) return name.length <= 4 ? NAME_FEE_SHORT_V18 : NAME_FEE_V18;
|
|
55
67
|
const n = name.length;
|
|
56
68
|
if (n <= 3) return 500000000n;
|
|
@@ -69,6 +81,11 @@ var HASH_RE = /^0x[0-9a-f]{64}$/;
|
|
|
69
81
|
var SALT_RE = /^[0-9a-fA-F]{16,128}$/;
|
|
70
82
|
var RESERVED_NAMES = /* @__PURE__ */ new Set(["csd", "treasury", "admin", "official", "root", "www", "support"]);
|
|
71
83
|
var COMMIT_MAX_BLOCKS = 8 * EPOCH_LEN;
|
|
84
|
+
var V25_HEIGHT = 1e7;
|
|
85
|
+
var REG_COMMIT_MAX_BLOCKS = 8;
|
|
86
|
+
var REG_FINALIZE_GRACE_BLOCKS = 12;
|
|
87
|
+
var MAX_PENDING_REG = 3;
|
|
88
|
+
var FINALIZE_TIP_MARGIN = 2;
|
|
72
89
|
var epochOf = (height) => Math.floor(height / EPOCH_LEN);
|
|
73
90
|
var claimWindowAt = (height) => height >= V20_HEIGHT ? CLAIM_WINDOW_BLOCKS_V20 : CLAIM_WINDOW_BLOCKS;
|
|
74
91
|
var claimWindowOf = (claimUntilHeight) => claimUntilHeight - CLAIM_WINDOW_BLOCKS_V20 >= V20_HEIGHT ? CLAIM_WINDOW_BLOCKS_V20 : CLAIM_WINDOW_BLOCKS;
|
|
@@ -131,6 +148,7 @@ var TRANSFER_KEYS = /* @__PURE__ */ new Set(["v", "t", "ticker", "to", "amount",
|
|
|
131
148
|
var OFFER_KEYS = /* @__PURE__ */ new Set(["v", "t", "give", "want", "min", "bid", "taker", "memo", "ts"]);
|
|
132
149
|
var BID_KEYS = /* @__PURE__ */ new Set(["v", "t", "want", "give", "memo", "ts"]);
|
|
133
150
|
var NAME_KEYS = /* @__PURE__ */ new Set(["v", "t", "name", "salt"]);
|
|
151
|
+
var NFINALIZE_KEYS = /* @__PURE__ */ new Set(["v", "t", "name", "salt"]);
|
|
134
152
|
var NPROFILE_KEYS = /* @__PURE__ */ new Set(["v", "t", "name", "p"]);
|
|
135
153
|
function parseRecord(uri, payloadHashHex) {
|
|
136
154
|
if (new TextEncoder().encode(uri).length > MAX_RECORD_BYTES) return null;
|
|
@@ -242,6 +260,12 @@ function parseRecord(uri, payloadHashHex) {
|
|
|
242
260
|
if (r.salt !== void 0 && (typeof r.salt !== "string" || !SALT_RE.test(r.salt))) return null;
|
|
243
261
|
return r;
|
|
244
262
|
}
|
|
263
|
+
case "nfinalize": {
|
|
264
|
+
if (!onlyKeys(r, NFINALIZE_KEYS)) return null;
|
|
265
|
+
if (!isName(r.name)) return null;
|
|
266
|
+
if (typeof r.salt !== "string" || !SALT_RE.test(r.salt)) return null;
|
|
267
|
+
return r;
|
|
268
|
+
}
|
|
245
269
|
case "nxfer": {
|
|
246
270
|
if (!isName(r.name) || !isAddr(r.to)) return null;
|
|
247
271
|
if (Object.keys(r).length !== 4) return null;
|
|
@@ -298,6 +322,7 @@ var bid = (r) => buildRecord({ v: 1, t: "bid", ...r });
|
|
|
298
322
|
var offerCancelAll = (r = {}) => buildRecord({ v: 1, t: "ocancel", ...r });
|
|
299
323
|
var nameCommitRecord = (r) => buildRecord({ v: 1, t: "ncommit", ...r });
|
|
300
324
|
var nameClaim = (r) => buildRecord({ v: 1, t: "name", ...r });
|
|
325
|
+
var nameFinalize = (r) => buildRecord({ v: 1, t: "nfinalize", ...r });
|
|
301
326
|
var nameXfer = (r) => buildRecord({ v: 1, t: "nxfer", ...r });
|
|
302
327
|
var nameSet = (r) => buildRecord({ v: 1, t: "nset", ...r });
|
|
303
328
|
var nameRenew = (r) => buildRecord({ v: 1, t: "nrenew", ...r });
|
|
@@ -368,6 +393,10 @@ function resolve(events, tipHeight) {
|
|
|
368
393
|
for (const b of bids.values()) {
|
|
369
394
|
if (b.status === "open" && ep > effExpiry(b, height)) b.status = "expired";
|
|
370
395
|
}
|
|
396
|
+
for (const nm of [...names.keys()]) {
|
|
397
|
+
const n = names.get(nm);
|
|
398
|
+
if (n.pending && n.finalizeBy !== void 0 && height > n.finalizeBy) names.delete(nm);
|
|
399
|
+
}
|
|
371
400
|
};
|
|
372
401
|
const V15_EPOCH = epochOf(V15_HEIGHT);
|
|
373
402
|
const paidThrough = (n) => n.paidThroughEpoch ?? V15_EPOCH + NAME_TERM_EPOCHS;
|
|
@@ -418,6 +447,7 @@ function resolve(events, tipHeight) {
|
|
|
418
447
|
const v16 = ev.height >= V16_HEIGHT;
|
|
419
448
|
const v19 = ev.height >= V19_HEIGHT;
|
|
420
449
|
const v23 = ev.height >= V23_HEIGHT;
|
|
450
|
+
const v25 = ev.height >= V25_HEIGHT;
|
|
421
451
|
const feeToTreasury = ev.kind === "propose" ? ptAmt((ev.paidTo ?? {})[TREASURY_ADDR]) : 0n;
|
|
422
452
|
if (ev.kind === "propose") {
|
|
423
453
|
const rec = parseRecord(ev.uri, ev.payloadHash);
|
|
@@ -503,11 +533,12 @@ function resolve(events, tipHeight) {
|
|
|
503
533
|
note(ev, ev.id, "name", false, "before v1.1 activation");
|
|
504
534
|
continue;
|
|
505
535
|
}
|
|
536
|
+
const regWindow = v25 ? REG_COMMIT_MAX_BLOCKS : COMMIT_MAX_BLOCKS;
|
|
506
537
|
let effHeight = ev.height;
|
|
507
538
|
if (rec.salt !== void 0) {
|
|
508
539
|
const ch = nameCommit(rec.name, rec.salt, who);
|
|
509
540
|
const cH = commits.get(ch);
|
|
510
|
-
if (cH === void 0 || cH >= ev.height || ev.height - cH >
|
|
541
|
+
if (cH === void 0 || cH >= ev.height || ev.height - cH > regWindow) {
|
|
511
542
|
note(ev, ev.id, "name", false, "no valid in-window commit for this reveal");
|
|
512
543
|
continue;
|
|
513
544
|
}
|
|
@@ -515,8 +546,9 @@ function resolve(events, tipHeight) {
|
|
|
515
546
|
}
|
|
516
547
|
const cur = names.get(rec.name);
|
|
517
548
|
const epClaim = epochOf(ev.height);
|
|
518
|
-
|
|
519
|
-
|
|
549
|
+
const curActive = cur && cur.pending && cur.finalizeBy !== void 0 && ev.height > cur.finalizeBy ? void 0 : cur;
|
|
550
|
+
if (curActive && !curActive.pending && v15 && lapsed(curActive, epClaim)) {
|
|
551
|
+
const fee = expiredClaimFee(rec.name, epClaim - (paidThrough(curActive) + NAME_GRACE_EPOCHS), ev.height);
|
|
520
552
|
if (feeToTreasury < fee) {
|
|
521
553
|
note(ev, ev.id, "name", false, "lapsed-name claim fee unpaid (decaying premium)");
|
|
522
554
|
continue;
|
|
@@ -530,6 +562,32 @@ function resolve(events, tipHeight) {
|
|
|
530
562
|
note(ev, ev.id, "name", true, "lapsed lease re-claimed (premium)");
|
|
531
563
|
continue;
|
|
532
564
|
}
|
|
565
|
+
if (v25) {
|
|
566
|
+
if (rec.salt === void 0) {
|
|
567
|
+
note(ev, ev.id, "name", false, "v2.5: registration requires a commit-reveal (salt)");
|
|
568
|
+
continue;
|
|
569
|
+
}
|
|
570
|
+
const better2 = !curActive || !curActive.viaFill && (effHeight < curActive.effHeight || effHeight === curActive.effHeight && (ev.pos < curActive.pos || ev.pos === curActive.pos && ev.id < curActive.id));
|
|
571
|
+
if (!better2) {
|
|
572
|
+
note(ev, ev.id, "name", false, curActive?.viaFill ? "name taken (purchased \u2014 not displaceable)" : "name taken (earlier anchor wins)");
|
|
573
|
+
continue;
|
|
574
|
+
}
|
|
575
|
+
let myPending = 0;
|
|
576
|
+
for (const [nm, n] of names) if (n.pending && n.owner === who && nm !== rec.name && n.finalizeBy !== void 0 && ev.height <= n.finalizeBy) myPending++;
|
|
577
|
+
if (myPending >= MAX_PENDING_REG) {
|
|
578
|
+
note(ev, ev.id, "name", false, "too many pending reservations (max reached)");
|
|
579
|
+
continue;
|
|
580
|
+
}
|
|
581
|
+
if (curActive) {
|
|
582
|
+
for (const o of offers.values()) if (o.status === "open" && isNameGive(o.give) && o.give.name === rec.name) {
|
|
583
|
+
releaseGive(o);
|
|
584
|
+
o.status = "cancelled";
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
names.set(rec.name, { owner: who, effHeight, pos: ev.pos, id: ev.id, height: ev.height, locked: false, pending: true, finalizeBy: effHeight + REG_COMMIT_MAX_BLOCKS + REG_FINALIZE_GRACE_BLOCKS });
|
|
588
|
+
note(ev, ev.id, "name", true, curActive ? "reserved (displaced prior reservation)" : "reserved (pending finalize)");
|
|
589
|
+
continue;
|
|
590
|
+
}
|
|
533
591
|
if (feeToTreasury < nameRegFee(rec.name, ev.height)) {
|
|
534
592
|
note(ev, ev.id, "name", false, "name registration fee unpaid");
|
|
535
593
|
continue;
|
|
@@ -543,12 +601,12 @@ function resolve(events, tipHeight) {
|
|
|
543
601
|
locked: false,
|
|
544
602
|
...v15 ? { paidThroughEpoch: epClaim + NAME_TERM_EPOCHS } : {}
|
|
545
603
|
};
|
|
546
|
-
const better = !
|
|
604
|
+
const better = !curActive || !curActive.viaFill && (effHeight < curActive.effHeight || effHeight === curActive.effHeight && (ev.pos < curActive.pos || ev.pos === curActive.pos && ev.id < curActive.id));
|
|
547
605
|
if (!better) {
|
|
548
|
-
note(ev, ev.id, "name", false,
|
|
606
|
+
note(ev, ev.id, "name", false, curActive?.viaFill ? "name taken (purchased \u2014 not displaceable)" : "name taken (earlier anchor wins)");
|
|
549
607
|
continue;
|
|
550
608
|
}
|
|
551
|
-
if (
|
|
609
|
+
if (curActive) {
|
|
552
610
|
for (const o of offers.values()) if (o.status === "open" && isNameGive(o.give) && o.give.name === rec.name) {
|
|
553
611
|
releaseGive(o);
|
|
554
612
|
o.status = "cancelled";
|
|
@@ -556,13 +614,49 @@ function resolve(events, tipHeight) {
|
|
|
556
614
|
}
|
|
557
615
|
names.set(rec.name, cand);
|
|
558
616
|
feesPaid += nameRegFee(rec.name, ev.height);
|
|
559
|
-
note(ev, ev.id, "name", true,
|
|
617
|
+
note(ev, ev.id, "name", true, curActive ? "displaced prior holder" : void 0);
|
|
618
|
+
} else if (rec.t === "nfinalize") {
|
|
619
|
+
if (!v25) {
|
|
620
|
+
note(ev, ev.id, "nfinalize", false, "before v2.5 activation");
|
|
621
|
+
continue;
|
|
622
|
+
}
|
|
623
|
+
const n = names.get(rec.name);
|
|
624
|
+
if (!n || !n.pending || n.owner !== who) {
|
|
625
|
+
note(ev, ev.id, "nfinalize", false, "no matching pending reservation you own");
|
|
626
|
+
continue;
|
|
627
|
+
}
|
|
628
|
+
const cH = commits.get(nameCommit(rec.name, rec.salt, who));
|
|
629
|
+
if (cH === void 0 || cH !== n.effHeight) {
|
|
630
|
+
note(ev, ev.id, "nfinalize", false, "salt does not match the reservation commit");
|
|
631
|
+
continue;
|
|
632
|
+
}
|
|
633
|
+
if (!(ev.height > n.effHeight + REG_COMMIT_MAX_BLOCKS)) {
|
|
634
|
+
note(ev, ev.id, "nfinalize", false, "too early \u2014 displacement contest not yet frozen");
|
|
635
|
+
continue;
|
|
636
|
+
}
|
|
637
|
+
if (n.finalizeBy !== void 0 && ev.height > n.finalizeBy) {
|
|
638
|
+
note(ev, ev.id, "nfinalize", false, "reservation expired");
|
|
639
|
+
continue;
|
|
640
|
+
}
|
|
641
|
+
if (feeToTreasury < nameRegFee(rec.name, ev.height)) {
|
|
642
|
+
note(ev, ev.id, "nfinalize", false, "name registration fee unpaid");
|
|
643
|
+
continue;
|
|
644
|
+
}
|
|
645
|
+
n.pending = void 0;
|
|
646
|
+
n.finalizeBy = void 0;
|
|
647
|
+
n.paidThroughEpoch = epochOf(ev.height) + NAME_TERM_EPOCHS;
|
|
648
|
+
feesPaid += nameRegFee(rec.name, ev.height);
|
|
649
|
+
note(ev, ev.id, "nfinalize", true);
|
|
560
650
|
} else if (rec.t === "nxfer") {
|
|
561
651
|
const n = names.get(rec.name);
|
|
562
652
|
if (!n || n.owner !== who) {
|
|
563
653
|
note(ev, ev.id, "nxfer", false, "not the name owner");
|
|
564
654
|
continue;
|
|
565
655
|
}
|
|
656
|
+
if (n.pending) {
|
|
657
|
+
note(ev, ev.id, "nxfer", false, "name reservation not yet finalized");
|
|
658
|
+
continue;
|
|
659
|
+
}
|
|
566
660
|
if (v15 && lapsed(n, epochOf(ev.height))) {
|
|
567
661
|
note(ev, ev.id, "nxfer", false, "lease lapsed \u2014 claim it instead");
|
|
568
662
|
continue;
|
|
@@ -581,6 +675,10 @@ function resolve(events, tipHeight) {
|
|
|
581
675
|
note(ev, ev.id, "nset", false, "not the name owner");
|
|
582
676
|
continue;
|
|
583
677
|
}
|
|
678
|
+
if (n.pending) {
|
|
679
|
+
note(ev, ev.id, "nset", false, "name reservation not yet finalized");
|
|
680
|
+
continue;
|
|
681
|
+
}
|
|
584
682
|
if (v15 && lapsed(n, epochOf(ev.height))) {
|
|
585
683
|
note(ev, ev.id, "nset", false, "lease lapsed \u2014 claim it instead");
|
|
586
684
|
continue;
|
|
@@ -598,6 +696,10 @@ function resolve(events, tipHeight) {
|
|
|
598
696
|
note(ev, ev.id, "nprofile", false, "not the name owner");
|
|
599
697
|
continue;
|
|
600
698
|
}
|
|
699
|
+
if (n.pending) {
|
|
700
|
+
note(ev, ev.id, "nprofile", false, "name reservation not yet finalized");
|
|
701
|
+
continue;
|
|
702
|
+
}
|
|
601
703
|
if (v15 && lapsed(n, epochOf(ev.height))) {
|
|
602
704
|
note(ev, ev.id, "nprofile", false, "lease lapsed \u2014 claim it instead");
|
|
603
705
|
continue;
|
|
@@ -642,6 +744,10 @@ function resolve(events, tipHeight) {
|
|
|
642
744
|
note(ev, ev.id, "offer", false, "you don't own this name");
|
|
643
745
|
continue;
|
|
644
746
|
}
|
|
747
|
+
if (n.pending) {
|
|
748
|
+
note(ev, ev.id, "offer", false, "name reservation not yet finalized");
|
|
749
|
+
continue;
|
|
750
|
+
}
|
|
645
751
|
if (n.locked) {
|
|
646
752
|
note(ev, ev.id, "offer", false, "name already locked by another offer");
|
|
647
753
|
continue;
|
|
@@ -751,6 +857,10 @@ function resolve(events, tipHeight) {
|
|
|
751
857
|
}
|
|
752
858
|
const n = names.get(rec.name);
|
|
753
859
|
const ep = epochOf(ev.height);
|
|
860
|
+
if (n && n.pending) {
|
|
861
|
+
note(ev, ev.id, "nrenew", false, "name reservation not yet finalized");
|
|
862
|
+
continue;
|
|
863
|
+
}
|
|
754
864
|
if (!n || lapsed(n, ep)) {
|
|
755
865
|
note(ev, ev.id, "nrenew", false, "no live lease (lapsed names are claimed, not renewed)");
|
|
756
866
|
continue;
|
|
@@ -1030,8 +1140,13 @@ function resolve(events, tipHeight) {
|
|
|
1030
1140
|
const namesOut = {};
|
|
1031
1141
|
const tipV15 = tipHeight >= V15_HEIGHT;
|
|
1032
1142
|
const tipV19 = tipHeight >= V19_HEIGHT;
|
|
1143
|
+
const tipV25 = tipHeight >= V25_HEIGHT;
|
|
1033
1144
|
const tipEpoch = epochOf(tipHeight);
|
|
1034
1145
|
for (const [nm, n] of [...names.entries()].sort(([a], [b]) => ord(a, b))) {
|
|
1146
|
+
if (tipV25 && n.pending) {
|
|
1147
|
+
namesOut[nm] = { name: nm, owner: n.owner, claimId: n.id, height: n.height, effectiveHeight: n.effHeight, locked: n.locked, pending: true, finalizeBy: n.finalizeBy };
|
|
1148
|
+
continue;
|
|
1149
|
+
}
|
|
1035
1150
|
namesOut[nm] = {
|
|
1036
1151
|
name: nm,
|
|
1037
1152
|
owner: n.owner,
|
|
@@ -1113,16 +1228,22 @@ export {
|
|
|
1113
1228
|
EPOCH_LEN2 as EPOCH_LEN,
|
|
1114
1229
|
FEE_BPS,
|
|
1115
1230
|
FEE_BPS_V16,
|
|
1231
|
+
FINALIZE_TIP_MARGIN,
|
|
1116
1232
|
HALVING_INTERVAL,
|
|
1117
1233
|
HASH_RE,
|
|
1118
1234
|
INITIAL_REWARD2 as INITIAL_REWARD,
|
|
1119
1235
|
MAX_ACTIVE_CLAIMS,
|
|
1120
1236
|
MAX_AMOUNT,
|
|
1121
1237
|
MAX_OFFER_EPOCHS,
|
|
1238
|
+
MAX_PENDING_REG,
|
|
1122
1239
|
MAX_RECORD_BYTES,
|
|
1123
1240
|
MINT_KEYS,
|
|
1124
1241
|
MIN_FEE_ATTEST,
|
|
1125
1242
|
MIN_FEE_PROPOSE,
|
|
1243
|
+
NAME_FEE_LEN3_V24,
|
|
1244
|
+
NAME_FEE_LEN4_V24,
|
|
1245
|
+
NAME_FEE_LONG_V24,
|
|
1246
|
+
NAME_FEE_MID_V24,
|
|
1126
1247
|
NAME_FEE_SHORT_V18,
|
|
1127
1248
|
NAME_FEE_V18,
|
|
1128
1249
|
NAME_GRACE_EPOCHS,
|
|
@@ -1131,6 +1252,7 @@ export {
|
|
|
1131
1252
|
NAME_PREMIUM_START,
|
|
1132
1253
|
NAME_RE,
|
|
1133
1254
|
NAME_TERM_EPOCHS,
|
|
1255
|
+
NFINALIZE_KEYS,
|
|
1134
1256
|
NPROFILE_KEYS,
|
|
1135
1257
|
OFFER_KEYS,
|
|
1136
1258
|
PKEY,
|
|
@@ -1138,6 +1260,8 @@ export {
|
|
|
1138
1260
|
PROFILE_MAX_VALUE_BYTES,
|
|
1139
1261
|
REBATE_BPS,
|
|
1140
1262
|
REBATE_FLAT,
|
|
1263
|
+
REG_COMMIT_MAX_BLOCKS,
|
|
1264
|
+
REG_FINALIZE_GRACE_BLOCKS,
|
|
1141
1265
|
RESERVED_NAMES,
|
|
1142
1266
|
SALT_RE,
|
|
1143
1267
|
SCORE_CANCEL,
|
|
@@ -1159,6 +1283,8 @@ export {
|
|
|
1159
1283
|
V21_HEIGHT,
|
|
1160
1284
|
V22_HEIGHT,
|
|
1161
1285
|
V23_HEIGHT,
|
|
1286
|
+
V24_HEIGHT,
|
|
1287
|
+
V25_HEIGHT,
|
|
1162
1288
|
ZERO_ADDR,
|
|
1163
1289
|
bid,
|
|
1164
1290
|
blockReward2 as blockReward,
|
|
@@ -1179,6 +1305,7 @@ export {
|
|
|
1179
1305
|
nameClaim,
|
|
1180
1306
|
nameCommit,
|
|
1181
1307
|
nameCommitRecord,
|
|
1308
|
+
nameFinalize,
|
|
1182
1309
|
nameProfile,
|
|
1183
1310
|
nameRegFee,
|
|
1184
1311
|
nameRenew,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inversealtruism/cairnx-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.25",
|
|
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",
|
package/test/vectors/cases.json
CHANGED
|
@@ -6122,7 +6122,7 @@
|
|
|
6122
6122
|
"expectedState": {
|
|
6123
6123
|
"balances": {},
|
|
6124
6124
|
"bids": {},
|
|
6125
|
-
"feesPaid": "
|
|
6125
|
+
"feesPaid": "19670000000",
|
|
6126
6126
|
"names": {
|
|
6127
6127
|
"erin": {
|
|
6128
6128
|
"claimId": "0x00000000000000000000000000000000000000000000000000000000f1900051",
|
|
@@ -6141,12 +6141,232 @@
|
|
|
6141
6141
|
}
|
|
6142
6142
|
},
|
|
6143
6143
|
{
|
|
6144
|
-
"name": "
|
|
6144
|
+
"name": "v24-name-fee-tiers",
|
|
6145
6145
|
"events": [
|
|
6146
6146
|
{
|
|
6147
6147
|
"kind": "propose",
|
|
6148
6148
|
"id": "0x00000000000000000000000000000000000000000000000000000000f1900052",
|
|
6149
6149
|
"proposer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6150
|
+
"uri": "{\"name\":\"abc\",\"t\":\"name\",\"v\":1}",
|
|
6151
|
+
"payloadHash": "0x285428e423409d24edd31557300182b7b8c8511322fd75cd74fbb4c19791efb7",
|
|
6152
|
+
"height": 49205,
|
|
6153
|
+
"pos": 1,
|
|
6154
|
+
"expiresEpoch": 5000,
|
|
6155
|
+
"paidTo": {
|
|
6156
|
+
"0x6b09ce74e6070ebc982ab0fb793a211c4d24f016": "1500000000"
|
|
6157
|
+
}
|
|
6158
|
+
},
|
|
6159
|
+
{
|
|
6160
|
+
"kind": "propose",
|
|
6161
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f1900053",
|
|
6162
|
+
"proposer": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
|
|
6163
|
+
"uri": "{\"name\":\"abcd\",\"t\":\"name\",\"v\":1}",
|
|
6164
|
+
"payloadHash": "0x206a13afa36185762dfba478da396cd3242b5d8a8304087b197e603c652b0241",
|
|
6165
|
+
"height": 49205,
|
|
6166
|
+
"pos": 2,
|
|
6167
|
+
"expiresEpoch": 5000,
|
|
6168
|
+
"paidTo": {
|
|
6169
|
+
"0x6b09ce74e6070ebc982ab0fb793a211c4d24f016": "1000000000"
|
|
6170
|
+
}
|
|
6171
|
+
},
|
|
6172
|
+
{
|
|
6173
|
+
"kind": "propose",
|
|
6174
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f1900054",
|
|
6175
|
+
"proposer": "0xc3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3",
|
|
6176
|
+
"uri": "{\"name\":\"abcde\",\"t\":\"name\",\"v\":1}",
|
|
6177
|
+
"payloadHash": "0xf5736c14a35671ebe20cfc4450ae6869bbc26b426f817415895570cdcd5d07ec",
|
|
6178
|
+
"height": 49205,
|
|
6179
|
+
"pos": 3,
|
|
6180
|
+
"expiresEpoch": 5000,
|
|
6181
|
+
"paidTo": {
|
|
6182
|
+
"0x6b09ce74e6070ebc982ab0fb793a211c4d24f016": "500000000"
|
|
6183
|
+
}
|
|
6184
|
+
},
|
|
6185
|
+
{
|
|
6186
|
+
"kind": "propose",
|
|
6187
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f1900055",
|
|
6188
|
+
"proposer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6189
|
+
"uri": "{\"name\":\"abcdefghi\",\"t\":\"name\",\"v\":1}",
|
|
6190
|
+
"payloadHash": "0x057db67af719f80d3cc1ccd717b08d77c6ca15a4dc220a34f7727bc8b6302c82",
|
|
6191
|
+
"height": 49205,
|
|
6192
|
+
"pos": 4,
|
|
6193
|
+
"expiresEpoch": 5000,
|
|
6194
|
+
"paidTo": {
|
|
6195
|
+
"0x6b09ce74e6070ebc982ab0fb793a211c4d24f016": "500000000"
|
|
6196
|
+
}
|
|
6197
|
+
},
|
|
6198
|
+
{
|
|
6199
|
+
"kind": "propose",
|
|
6200
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f1900056",
|
|
6201
|
+
"proposer": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
|
|
6202
|
+
"uri": "{\"name\":\"abcdefghij\",\"t\":\"name\",\"v\":1}",
|
|
6203
|
+
"payloadHash": "0x4507ec798d850b9ce3efc9747c3c07c78110f7d32df15f4709595ac3e69dfb92",
|
|
6204
|
+
"height": 49205,
|
|
6205
|
+
"pos": 5,
|
|
6206
|
+
"expiresEpoch": 5000,
|
|
6207
|
+
"paidTo": {
|
|
6208
|
+
"0x6b09ce74e6070ebc982ab0fb793a211c4d24f016": "300000000"
|
|
6209
|
+
}
|
|
6210
|
+
}
|
|
6211
|
+
],
|
|
6212
|
+
"tipHeight": 49210,
|
|
6213
|
+
"expectedState": {
|
|
6214
|
+
"balances": {},
|
|
6215
|
+
"bids": {},
|
|
6216
|
+
"feesPaid": "3800000000",
|
|
6217
|
+
"names": {
|
|
6218
|
+
"abc": {
|
|
6219
|
+
"claimId": "0x00000000000000000000000000000000000000000000000000000000f1900052",
|
|
6220
|
+
"effectiveHeight": 49205,
|
|
6221
|
+
"height": 49205,
|
|
6222
|
+
"locked": false,
|
|
6223
|
+
"name": "abc",
|
|
6224
|
+
"owner": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6225
|
+
"paidThroughEpoch": 10400
|
|
6226
|
+
},
|
|
6227
|
+
"abcd": {
|
|
6228
|
+
"claimId": "0x00000000000000000000000000000000000000000000000000000000f1900053",
|
|
6229
|
+
"effectiveHeight": 49205,
|
|
6230
|
+
"height": 49205,
|
|
6231
|
+
"locked": false,
|
|
6232
|
+
"name": "abcd",
|
|
6233
|
+
"owner": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
|
|
6234
|
+
"paidThroughEpoch": 10400
|
|
6235
|
+
},
|
|
6236
|
+
"abcde": {
|
|
6237
|
+
"claimId": "0x00000000000000000000000000000000000000000000000000000000f1900054",
|
|
6238
|
+
"effectiveHeight": 49205,
|
|
6239
|
+
"height": 49205,
|
|
6240
|
+
"locked": false,
|
|
6241
|
+
"name": "abcde",
|
|
6242
|
+
"owner": "0xc3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3",
|
|
6243
|
+
"paidThroughEpoch": 10400
|
|
6244
|
+
},
|
|
6245
|
+
"abcdefghi": {
|
|
6246
|
+
"claimId": "0x00000000000000000000000000000000000000000000000000000000f1900055",
|
|
6247
|
+
"effectiveHeight": 49205,
|
|
6248
|
+
"height": 49205,
|
|
6249
|
+
"locked": false,
|
|
6250
|
+
"name": "abcdefghi",
|
|
6251
|
+
"owner": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6252
|
+
"paidThroughEpoch": 10400
|
|
6253
|
+
},
|
|
6254
|
+
"abcdefghij": {
|
|
6255
|
+
"claimId": "0x00000000000000000000000000000000000000000000000000000000f1900056",
|
|
6256
|
+
"effectiveHeight": 49205,
|
|
6257
|
+
"height": 49205,
|
|
6258
|
+
"locked": false,
|
|
6259
|
+
"name": "abcdefghij",
|
|
6260
|
+
"owner": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
|
|
6261
|
+
"paidThroughEpoch": 10400
|
|
6262
|
+
}
|
|
6263
|
+
},
|
|
6264
|
+
"offers": {},
|
|
6265
|
+
"tipHeight": 49210,
|
|
6266
|
+
"tokens": {}
|
|
6267
|
+
}
|
|
6268
|
+
},
|
|
6269
|
+
{
|
|
6270
|
+
"name": "v24-underpay-rejected",
|
|
6271
|
+
"events": [
|
|
6272
|
+
{
|
|
6273
|
+
"kind": "propose",
|
|
6274
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f1900057",
|
|
6275
|
+
"proposer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6276
|
+
"uri": "{\"name\":\"xyz\",\"t\":\"name\",\"v\":1}",
|
|
6277
|
+
"payloadHash": "0xac6fcac8df686c9424b1cb3262515cd779fae05941d7095fcd7989524286a65c",
|
|
6278
|
+
"height": 49205,
|
|
6279
|
+
"pos": 1,
|
|
6280
|
+
"expiresEpoch": 5000,
|
|
6281
|
+
"paidTo": {
|
|
6282
|
+
"0x6b09ce74e6070ebc982ab0fb793a211c4d24f016": "670000000"
|
|
6283
|
+
}
|
|
6284
|
+
}
|
|
6285
|
+
],
|
|
6286
|
+
"tipHeight": 49210,
|
|
6287
|
+
"expectedState": {
|
|
6288
|
+
"balances": {},
|
|
6289
|
+
"bids": {},
|
|
6290
|
+
"feesPaid": "0",
|
|
6291
|
+
"names": {},
|
|
6292
|
+
"offers": {},
|
|
6293
|
+
"tipHeight": 49210,
|
|
6294
|
+
"tokens": {}
|
|
6295
|
+
}
|
|
6296
|
+
},
|
|
6297
|
+
{
|
|
6298
|
+
"name": "v24-at-gate-old-fee-rejected",
|
|
6299
|
+
"events": [
|
|
6300
|
+
{
|
|
6301
|
+
"kind": "propose",
|
|
6302
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f1900058",
|
|
6303
|
+
"proposer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6304
|
+
"uri": "{\"name\":\"xyz\",\"t\":\"name\",\"v\":1}",
|
|
6305
|
+
"payloadHash": "0xac6fcac8df686c9424b1cb3262515cd779fae05941d7095fcd7989524286a65c",
|
|
6306
|
+
"height": 49200,
|
|
6307
|
+
"pos": 1,
|
|
6308
|
+
"expiresEpoch": 5000,
|
|
6309
|
+
"paidTo": {
|
|
6310
|
+
"0x6b09ce74e6070ebc982ab0fb793a211c4d24f016": "670000000"
|
|
6311
|
+
}
|
|
6312
|
+
}
|
|
6313
|
+
],
|
|
6314
|
+
"tipHeight": 49210,
|
|
6315
|
+
"expectedState": {
|
|
6316
|
+
"balances": {},
|
|
6317
|
+
"bids": {},
|
|
6318
|
+
"feesPaid": "0",
|
|
6319
|
+
"names": {},
|
|
6320
|
+
"offers": {},
|
|
6321
|
+
"tipHeight": 49210,
|
|
6322
|
+
"tokens": {}
|
|
6323
|
+
}
|
|
6324
|
+
},
|
|
6325
|
+
{
|
|
6326
|
+
"name": "v24-below-gate-old-fee-ok",
|
|
6327
|
+
"events": [
|
|
6328
|
+
{
|
|
6329
|
+
"kind": "propose",
|
|
6330
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f1900059",
|
|
6331
|
+
"proposer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6332
|
+
"uri": "{\"name\":\"xyz\",\"t\":\"name\",\"v\":1}",
|
|
6333
|
+
"payloadHash": "0xac6fcac8df686c9424b1cb3262515cd779fae05941d7095fcd7989524286a65c",
|
|
6334
|
+
"height": 49199,
|
|
6335
|
+
"pos": 1,
|
|
6336
|
+
"expiresEpoch": 5000,
|
|
6337
|
+
"paidTo": {
|
|
6338
|
+
"0x6b09ce74e6070ebc982ab0fb793a211c4d24f016": "670000000"
|
|
6339
|
+
}
|
|
6340
|
+
}
|
|
6341
|
+
],
|
|
6342
|
+
"tipHeight": 49210,
|
|
6343
|
+
"expectedState": {
|
|
6344
|
+
"balances": {},
|
|
6345
|
+
"bids": {},
|
|
6346
|
+
"feesPaid": "670000000",
|
|
6347
|
+
"names": {
|
|
6348
|
+
"xyz": {
|
|
6349
|
+
"claimId": "0x00000000000000000000000000000000000000000000000000000000f1900059",
|
|
6350
|
+
"effectiveHeight": 49199,
|
|
6351
|
+
"height": 49199,
|
|
6352
|
+
"locked": false,
|
|
6353
|
+
"name": "xyz",
|
|
6354
|
+
"owner": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6355
|
+
"paidThroughEpoch": 10399
|
|
6356
|
+
}
|
|
6357
|
+
},
|
|
6358
|
+
"offers": {},
|
|
6359
|
+
"tipHeight": 49210,
|
|
6360
|
+
"tokens": {}
|
|
6361
|
+
}
|
|
6362
|
+
},
|
|
6363
|
+
{
|
|
6364
|
+
"name": "reject-issuer-only-mint",
|
|
6365
|
+
"events": [
|
|
6366
|
+
{
|
|
6367
|
+
"kind": "propose",
|
|
6368
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f190005a",
|
|
6369
|
+
"proposer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6150
6370
|
"uri": "{\"decimals\":0,\"mint\":\"issuer\",\"supply\":\"1000000\",\"t\":\"deploy\",\"ticker\":\"TKN\",\"v\":1}",
|
|
6151
6371
|
"payloadHash": "0x42457eb00862bedf9f2c5d6e194adefa3b64a2d7a6c0dcd8aa93d97226aea508",
|
|
6152
6372
|
"height": 40045,
|
|
@@ -6158,7 +6378,7 @@
|
|
|
6158
6378
|
},
|
|
6159
6379
|
{
|
|
6160
6380
|
"kind": "propose",
|
|
6161
|
-
"id": "
|
|
6381
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f190005b",
|
|
6162
6382
|
"proposer": "0xc3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3",
|
|
6163
6383
|
"uri": "{\"amount\":\"5\",\"t\":\"mint\",\"ticker\":\"TKN\",\"v\":1}",
|
|
6164
6384
|
"payloadHash": "0x39ee639b586f54cc0c722f3aec4f2afdc61e6e0104c32b8c18b9e8f2659c25da",
|
|
@@ -6179,7 +6399,7 @@
|
|
|
6179
6399
|
"tokens": {
|
|
6180
6400
|
"TKN": {
|
|
6181
6401
|
"decimals": 0,
|
|
6182
|
-
"deployId": "
|
|
6402
|
+
"deployId": "0x00000000000000000000000000000000000000000000000000000000f190005a",
|
|
6183
6403
|
"deployer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6184
6404
|
"height": 40045,
|
|
6185
6405
|
"mint": "issuer",
|
|
@@ -6195,7 +6415,7 @@
|
|
|
6195
6415
|
"events": [
|
|
6196
6416
|
{
|
|
6197
6417
|
"kind": "propose",
|
|
6198
|
-
"id": "
|
|
6418
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f190005c",
|
|
6199
6419
|
"proposer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6200
6420
|
"uri": "{\"decimals\":0,\"mint\":\"issuer\",\"supply\":\"10\",\"t\":\"deploy\",\"ticker\":\"TKN\",\"v\":1}",
|
|
6201
6421
|
"payloadHash": "0x00c83b55c85b5e1786d8db6fb04cae9dae6928315ad82aed65339cea194afa6d",
|
|
@@ -6208,7 +6428,7 @@
|
|
|
6208
6428
|
},
|
|
6209
6429
|
{
|
|
6210
6430
|
"kind": "propose",
|
|
6211
|
-
"id": "
|
|
6431
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f190005d",
|
|
6212
6432
|
"proposer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6213
6433
|
"uri": "{\"amount\":\"10\",\"t\":\"mint\",\"ticker\":\"TKN\",\"v\":1}",
|
|
6214
6434
|
"payloadHash": "0x71e13d0dc762c774e5878457c3a8f412fdbd0404caa351a13f1ef04151e8a741",
|
|
@@ -6219,7 +6439,7 @@
|
|
|
6219
6439
|
},
|
|
6220
6440
|
{
|
|
6221
6441
|
"kind": "propose",
|
|
6222
|
-
"id": "
|
|
6442
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f190005e",
|
|
6223
6443
|
"proposer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6224
6444
|
"uri": "{\"amount\":\"5\",\"t\":\"mint\",\"ticker\":\"TKN\",\"v\":1}",
|
|
6225
6445
|
"payloadHash": "0x39ee639b586f54cc0c722f3aec4f2afdc61e6e0104c32b8c18b9e8f2659c25da",
|
|
@@ -6247,7 +6467,7 @@
|
|
|
6247
6467
|
"tokens": {
|
|
6248
6468
|
"TKN": {
|
|
6249
6469
|
"decimals": 0,
|
|
6250
|
-
"deployId": "
|
|
6470
|
+
"deployId": "0x00000000000000000000000000000000000000000000000000000000f190005c",
|
|
6251
6471
|
"deployer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6252
6472
|
"height": 40045,
|
|
6253
6473
|
"mint": "issuer",
|
|
@@ -6263,7 +6483,7 @@
|
|
|
6263
6483
|
"events": [
|
|
6264
6484
|
{
|
|
6265
6485
|
"kind": "propose",
|
|
6266
|
-
"id": "
|
|
6486
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f190005f",
|
|
6267
6487
|
"proposer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6268
6488
|
"uri": "{\"name\":\"frank\",\"t\":\"name\",\"v\":1}",
|
|
6269
6489
|
"payloadHash": "0xa8475f9e00796e7c7752c01e9b3f8a5c35e50e22aeab82135be4a49f2dd1127e",
|
|
@@ -6276,7 +6496,7 @@
|
|
|
6276
6496
|
},
|
|
6277
6497
|
{
|
|
6278
6498
|
"kind": "propose",
|
|
6279
|
-
"id": "
|
|
6499
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f1900060",
|
|
6280
6500
|
"proposer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6281
6501
|
"uri": "{\"give\":{\"name\":\"frank\"},\"t\":\"offer\",\"taker\":\"0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2\",\"v\":1,\"want\":{\"value\":\"100000000\"}}",
|
|
6282
6502
|
"payloadHash": "0x0a5463d268b0fab9efe02114cb6f2ef87f0f894a3bab21f8d9b76705875a7769",
|
|
@@ -6293,7 +6513,7 @@
|
|
|
6293
6513
|
"feesPaid": "300000000",
|
|
6294
6514
|
"names": {
|
|
6295
6515
|
"frank": {
|
|
6296
|
-
"claimId": "
|
|
6516
|
+
"claimId": "0x00000000000000000000000000000000000000000000000000000000f190005f",
|
|
6297
6517
|
"effectiveHeight": 40050,
|
|
6298
6518
|
"height": 40050,
|
|
6299
6519
|
"locked": false,
|
|
@@ -6312,7 +6532,7 @@
|
|
|
6312
6532
|
"events": [
|
|
6313
6533
|
{
|
|
6314
6534
|
"kind": "propose",
|
|
6315
|
-
"id": "
|
|
6535
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f1900061",
|
|
6316
6536
|
"proposer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6317
6537
|
"uri": "{\"decimals\":0,\"mint\":\"issuer\",\"supply\":\"1000000\",\"t\":\"deploy\",\"ticker\":\"TKN\",\"v\":1}",
|
|
6318
6538
|
"payloadHash": "0x42457eb00862bedf9f2c5d6e194adefa3b64a2d7a6c0dcd8aa93d97226aea508",
|
|
@@ -6325,7 +6545,7 @@
|
|
|
6325
6545
|
},
|
|
6326
6546
|
{
|
|
6327
6547
|
"kind": "propose",
|
|
6328
|
-
"id": "
|
|
6548
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f1900062",
|
|
6329
6549
|
"proposer": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
|
|
6330
6550
|
"uri": "{\"decimals\":0,\"mint\":\"issuer\",\"supply\":\"1000000\",\"t\":\"deploy\",\"ticker\":\"PAY\",\"v\":1}",
|
|
6331
6551
|
"payloadHash": "0x2067092a665dac07d0abf8d063f1d1584a930cce465407859df737e7661a61fb",
|
|
@@ -6338,7 +6558,7 @@
|
|
|
6338
6558
|
},
|
|
6339
6559
|
{
|
|
6340
6560
|
"kind": "propose",
|
|
6341
|
-
"id": "
|
|
6561
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f1900063",
|
|
6342
6562
|
"proposer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6343
6563
|
"uri": "{\"amount\":\"100\",\"t\":\"mint\",\"ticker\":\"TKN\",\"v\":1}",
|
|
6344
6564
|
"payloadHash": "0x2ea0850f2c494401ee2239643c6bc886458c1b5ccc996d4cfa8e2ba801d27377",
|
|
@@ -6349,7 +6569,7 @@
|
|
|
6349
6569
|
},
|
|
6350
6570
|
{
|
|
6351
6571
|
"kind": "propose",
|
|
6352
|
-
"id": "
|
|
6572
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f1900064",
|
|
6353
6573
|
"proposer": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
|
|
6354
6574
|
"uri": "{\"amount\":\"100\",\"t\":\"mint\",\"ticker\":\"PAY\",\"v\":1}",
|
|
6355
6575
|
"payloadHash": "0xacb9eb0794a1bc8caced07630706a2e38672194c3beef198b4d9c6417f1dcc56",
|
|
@@ -6360,7 +6580,7 @@
|
|
|
6360
6580
|
},
|
|
6361
6581
|
{
|
|
6362
6582
|
"kind": "propose",
|
|
6363
|
-
"id": "
|
|
6583
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f1900065",
|
|
6364
6584
|
"proposer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6365
6585
|
"uri": "{\"give\":{\"amount\":\"10\",\"ticker\":\"TKN\"},\"t\":\"offer\",\"taker\":\"0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2\",\"v\":1,\"want\":{\"amount\":\"5\",\"ticker\":\"PAY\"}}",
|
|
6366
6586
|
"payloadHash": "0x7c69f6bb8350c89d3a5807d4d0364075b9bbd8e5149e53209ee425a036fd2b2b",
|
|
@@ -6371,8 +6591,8 @@
|
|
|
6371
6591
|
},
|
|
6372
6592
|
{
|
|
6373
6593
|
"kind": "attest",
|
|
6374
|
-
"txid": "
|
|
6375
|
-
"proposalId": "
|
|
6594
|
+
"txid": "0x00000000000000000000000000000000000000000000000000000000f1900066",
|
|
6595
|
+
"proposalId": "0x00000000000000000000000000000000000000000000000000000000f1900065",
|
|
6376
6596
|
"attester": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
|
|
6377
6597
|
"score": 100,
|
|
6378
6598
|
"confidence": 0,
|
|
@@ -6401,7 +6621,7 @@
|
|
|
6401
6621
|
"feesPaid": "200000000",
|
|
6402
6622
|
"names": {},
|
|
6403
6623
|
"offers": {
|
|
6404
|
-
"
|
|
6624
|
+
"0x00000000000000000000000000000000000000000000000000000000f1900065": {
|
|
6405
6625
|
"expiresEpoch": 5000,
|
|
6406
6626
|
"feeBps": 150,
|
|
6407
6627
|
"give": {
|
|
@@ -6409,7 +6629,7 @@
|
|
|
6409
6629
|
"ticker": "TKN"
|
|
6410
6630
|
},
|
|
6411
6631
|
"height": 40050,
|
|
6412
|
-
"id": "
|
|
6632
|
+
"id": "0x00000000000000000000000000000000000000000000000000000000f1900065",
|
|
6413
6633
|
"seller": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6414
6634
|
"status": "open",
|
|
6415
6635
|
"taker": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
|
|
@@ -6424,7 +6644,7 @@
|
|
|
6424
6644
|
"tokens": {
|
|
6425
6645
|
"PAY": {
|
|
6426
6646
|
"decimals": 0,
|
|
6427
|
-
"deployId": "
|
|
6647
|
+
"deployId": "0x00000000000000000000000000000000000000000000000000000000f1900062",
|
|
6428
6648
|
"deployer": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2",
|
|
6429
6649
|
"height": 40045,
|
|
6430
6650
|
"mint": "issuer",
|
|
@@ -6434,7 +6654,7 @@
|
|
|
6434
6654
|
},
|
|
6435
6655
|
"TKN": {
|
|
6436
6656
|
"decimals": 0,
|
|
6437
|
-
"deployId": "
|
|
6657
|
+
"deployId": "0x00000000000000000000000000000000000000000000000000000000f1900061",
|
|
6438
6658
|
"deployer": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
|
|
6439
6659
|
"height": 40045,
|
|
6440
6660
|
"mint": "issuer",
|