@secondlayer/stacks 6.3.0 → 6.4.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.
Files changed (75) hide show
  1. package/dist/shared/{stacks-esm-tdrdye4y.js → stacks-esm-4ja7b0px.js} +2 -2
  2. package/dist/shared/{stacks-esm-t88hc019.js → stacks-esm-5qdnx2q9.js} +3 -3
  3. package/dist/shared/{stacks-esm-b54n1jdx.js → stacks-esm-6qv8gjes.js} +6 -6
  4. package/dist/shared/stacks-esm-6qv8gjes.js.map +12 -0
  5. package/dist/shared/{stacks-esm-8f5catbf.js → stacks-esm-7kb3t7ve.js} +63 -62
  6. package/dist/shared/{stacks-esm-8f5catbf.js.map → stacks-esm-7kb3t7ve.js.map} +5 -5
  7. package/dist/shared/{stacks-esm-a20wyky3.js → stacks-esm-896kv9yv.js} +2 -2
  8. package/dist/shared/{stacks-esm-exgw8j2j.js → stacks-esm-bragecm9.js} +7 -7
  9. package/dist/shared/{stacks-esm-hkw1kvd4.js → stacks-esm-gs60rd15.js} +7 -4
  10. package/dist/shared/{stacks-esm-hkw1kvd4.js.map → stacks-esm-gs60rd15.js.map} +3 -3
  11. package/dist/shared/{stacks-esm-xcd4sv1h.js → stacks-esm-hcjqgrtm.js} +5 -5
  12. package/dist/shared/{stacks-esm-pq0e379d.js → stacks-esm-hv11fdgy.js} +3 -3
  13. package/dist/shared/{stacks-esm-1b2rhv6y.js → stacks-esm-w36fvdxx.js} +2 -2
  14. package/dist/shared/{stacks-esm-7n5wd5md.js → stacks-esm-w8kswk0r.js} +5 -5
  15. package/dist/shared/{stacks-esm-0pc6tmf0.js → stacks-esm-x8gjr2v6.js} +2 -2
  16. package/dist/shared/{stacks-esm-p3zypwsw.js → stacks-esm-zwbhghxb.js} +2 -2
  17. package/dist/src/actions/index.cjs +6 -3
  18. package/dist/src/actions/index.cjs.map +3 -3
  19. package/dist/src/actions/index.js +10 -10
  20. package/dist/src/bitcoin/index.cjs +65 -61
  21. package/dist/src/bitcoin/index.cjs.map +5 -5
  22. package/dist/src/bitcoin/index.js +5 -5
  23. package/dist/src/bns/index.cjs +65 -61
  24. package/dist/src/bns/index.cjs.map +5 -5
  25. package/dist/src/bns/index.js +10 -10
  26. package/dist/src/clarity/index.cjs +65 -61
  27. package/dist/src/clarity/index.cjs.map +5 -5
  28. package/dist/src/clarity/index.d.cts +2 -2
  29. package/dist/src/clarity/index.d.ts +2 -2
  30. package/dist/src/clarity/index.js +9 -9
  31. package/dist/src/clarity/index.js.map +1 -1
  32. package/dist/src/filters/index.cjs +5 -5
  33. package/dist/src/filters/index.cjs.map +3 -3
  34. package/dist/src/filters/index.d.cts +6 -0
  35. package/dist/src/filters/index.d.ts +6 -0
  36. package/dist/src/filters/index.js +1 -1
  37. package/dist/src/index.cjs +10 -7
  38. package/dist/src/index.cjs.map +4 -4
  39. package/dist/src/index.d.cts +6 -0
  40. package/dist/src/index.d.ts +6 -0
  41. package/dist/src/index.js +9 -9
  42. package/dist/src/postconditions/index.cjs +6 -3
  43. package/dist/src/postconditions/index.cjs.map +3 -3
  44. package/dist/src/postconditions/index.js +3 -3
  45. package/dist/src/pox/index.cjs +6 -3
  46. package/dist/src/pox/index.cjs.map +3 -3
  47. package/dist/src/pox/index.js +8 -8
  48. package/dist/src/pox5/index.cjs +6 -3
  49. package/dist/src/pox5/index.cjs.map +3 -3
  50. package/dist/src/pox5/index.js +9 -9
  51. package/dist/src/sbtc/index.cjs +6 -3
  52. package/dist/src/sbtc/index.cjs.map +3 -3
  53. package/dist/src/sbtc/index.js +7 -7
  54. package/dist/src/simnet/index.cjs +6 -16
  55. package/dist/src/simnet/index.cjs.map +4 -4
  56. package/dist/src/simnet/index.js +6 -16
  57. package/dist/src/simnet/index.js.map +4 -4
  58. package/dist/src/stackingdao/index.cjs +6 -3
  59. package/dist/src/stackingdao/index.cjs.map +3 -3
  60. package/dist/src/stackingdao/index.js +8 -8
  61. package/dist/src/transactions/index.cjs +6 -3
  62. package/dist/src/transactions/index.cjs.map +3 -3
  63. package/dist/src/transactions/index.js +3 -3
  64. package/package.json +1 -1
  65. package/dist/shared/stacks-esm-b54n1jdx.js.map +0 -12
  66. /package/dist/shared/{stacks-esm-tdrdye4y.js.map → stacks-esm-4ja7b0px.js.map} +0 -0
  67. /package/dist/shared/{stacks-esm-t88hc019.js.map → stacks-esm-5qdnx2q9.js.map} +0 -0
  68. /package/dist/shared/{stacks-esm-a20wyky3.js.map → stacks-esm-896kv9yv.js.map} +0 -0
  69. /package/dist/shared/{stacks-esm-exgw8j2j.js.map → stacks-esm-bragecm9.js.map} +0 -0
  70. /package/dist/shared/{stacks-esm-xcd4sv1h.js.map → stacks-esm-hcjqgrtm.js.map} +0 -0
  71. /package/dist/shared/{stacks-esm-pq0e379d.js.map → stacks-esm-hv11fdgy.js.map} +0 -0
  72. /package/dist/shared/{stacks-esm-1b2rhv6y.js.map → stacks-esm-w36fvdxx.js.map} +0 -0
  73. /package/dist/shared/{stacks-esm-7n5wd5md.js.map → stacks-esm-w8kswk0r.js.map} +0 -0
  74. /package/dist/shared/{stacks-esm-0pc6tmf0.js.map → stacks-esm-x8gjr2v6.js.map} +0 -0
  75. /package/dist/shared/{stacks-esm-p3zypwsw.js.map → stacks-esm-zwbhghxb.js.map} +0 -0
@@ -4,22 +4,22 @@ import {
4
4
  import"../../shared/stacks-esm-kbz5s6v8.js";
5
5
  import {
6
6
  Cl2
7
- } from "../../shared/stacks-esm-hkw1kvd4.js";
8
- import"../../shared/stacks-esm-a20wyky3.js";
9
- import"../../shared/stacks-esm-p3zypwsw.js";
10
- import"../../shared/stacks-esm-pq0e379d.js";
11
- import"../../shared/stacks-esm-tdrdye4y.js";
12
- import"../../shared/stacks-esm-8f5catbf.js";
7
+ } from "../../shared/stacks-esm-gs60rd15.js";
8
+ import"../../shared/stacks-esm-896kv9yv.js";
9
+ import"../../shared/stacks-esm-zwbhghxb.js";
10
+ import"../../shared/stacks-esm-hv11fdgy.js";
11
+ import"../../shared/stacks-esm-4ja7b0px.js";
12
+ import"../../shared/stacks-esm-7kb3t7ve.js";
13
13
  import {
14
14
  Pc2
15
- } from "../../shared/stacks-esm-1b2rhv6y.js";
15
+ } from "../../shared/stacks-esm-w36fvdxx.js";
16
16
  import {
17
17
  getContract2,
18
18
  resolveNetworkContract,
19
19
  ContractResponseError2
20
- } from "../../shared/stacks-esm-7n5wd5md.js";
21
- import"../../shared/stacks-esm-xcd4sv1h.js";
22
- import"../../shared/stacks-esm-0pc6tmf0.js";
20
+ } from "../../shared/stacks-esm-w8kswk0r.js";
21
+ import"../../shared/stacks-esm-hcjqgrtm.js";
22
+ import"../../shared/stacks-esm-x8gjr2v6.js";
23
23
 
24
24
  // src/bns/abi.ts
25
25
  var BNS_ABI = {
@@ -692,11 +692,14 @@ function readCV(reader, depth = 0) {
692
692
  case "err":
693
693
  return responseErrorCV(readCV(reader, depth + 1));
694
694
  case "address":
695
- return standardPrincipalCV(readAddress(reader));
695
+ return { type: "address", value: readAddress(reader) };
696
696
  case "contract": {
697
697
  const addr = readAddress(reader);
698
698
  const name = readLPString(reader);
699
- return contractPrincipalCV(addr, name);
699
+ if (new TextEncoder().encode(name).byteLength >= 128) {
700
+ throw new Error("Contract name must be less than 128 bytes");
701
+ }
702
+ return { type: "contract", value: `${addr}.${name}` };
700
703
  }
701
704
  case "list": {
702
705
  const len = reader.readUInt32BE();
@@ -1576,64 +1579,6 @@ var SIP013_ABI = {
1576
1579
  var sip010Abi = SIP010_ABI;
1577
1580
  var sip009Abi = SIP009_ABI;
1578
1581
  var sip013Abi = SIP013_ABI;
1579
- // src/clarity/abi/classify.ts
1580
- var TRAIT_STANDARDS = ["sip-009", "sip-010", "sip-013"];
1581
- var STANDARDS = [
1582
- { id: "sip-010", abi: SIP010_ABI, optional: new Set(["get-token-uri"]) },
1583
- { id: "sip-009", abi: SIP009_ABI, optional: new Set(["get-token-uri"]) },
1584
- {
1585
- id: "sip-013",
1586
- abi: SIP013_ABI,
1587
- optional: new Set([
1588
- "transfer-memo",
1589
- "transfer-many",
1590
- "transfer-many-memo",
1591
- "get-token-uri",
1592
- "get-overall-balance",
1593
- "get-overall-supply"
1594
- ])
1595
- }
1596
- ];
1597
- function indexByName(abi) {
1598
- const m = new Map;
1599
- for (const f of abi.functions)
1600
- m.set(f.name, f);
1601
- return m;
1602
- }
1603
- function conformsTo(candidate, spec) {
1604
- const fns = indexByName(candidate);
1605
- for (const required of spec.abi.functions) {
1606
- if (spec.optional.has(required.name))
1607
- continue;
1608
- const got = fns.get(required.name);
1609
- if (!got)
1610
- return false;
1611
- if (got.access !== required.access)
1612
- return false;
1613
- if (got.args.length !== required.args.length)
1614
- return false;
1615
- }
1616
- return true;
1617
- }
1618
- function classifyContract(abi) {
1619
- if (!abi || !Array.isArray(abi.functions))
1620
- return [];
1621
- return STANDARDS.filter((s) => conformsTo(abi, s)).map((s) => s.id);
1622
- }
1623
- function parseDeclaredStandards(claritySource) {
1624
- const out = new Set;
1625
- const matches = claritySource.matchAll(/\(impl-trait\s+[^)]+\)/gi);
1626
- for (const m of matches) {
1627
- const ref = m[0].toLowerCase();
1628
- if (ref.includes("sip-010") || ref.includes(".ft-trait"))
1629
- out.add("sip-010");
1630
- if (ref.includes("sip-009") || ref.includes("nft-trait"))
1631
- out.add("sip-009");
1632
- if (ref.includes("sip-013") || ref.includes("semi-fungible"))
1633
- out.add("sip-013");
1634
- }
1635
- return [...out];
1636
- }
1637
1582
  // src/clarity/abi/normalize.ts
1638
1583
  function normalizeAccess(access) {
1639
1584
  if (access === "read_only")
@@ -1840,6 +1785,65 @@ function normalizeAbi(abi) {
1840
1785
  defined_traits: definedTraits.length > 0 ? definedTraits : undefined
1841
1786
  };
1842
1787
  }
1788
+
1789
+ // src/clarity/abi/classify.ts
1790
+ var TRAIT_STANDARDS = ["sip-009", "sip-010", "sip-013"];
1791
+ var STANDARDS = [
1792
+ { id: "sip-010", abi: SIP010_ABI, optional: new Set(["get-token-uri"]) },
1793
+ { id: "sip-009", abi: SIP009_ABI, optional: new Set(["get-token-uri"]) },
1794
+ {
1795
+ id: "sip-013",
1796
+ abi: SIP013_ABI,
1797
+ optional: new Set([
1798
+ "transfer-memo",
1799
+ "transfer-many",
1800
+ "transfer-many-memo",
1801
+ "get-token-uri",
1802
+ "get-overall-balance",
1803
+ "get-overall-supply"
1804
+ ])
1805
+ }
1806
+ ];
1807
+ function indexByName(abi) {
1808
+ const m = new Map;
1809
+ for (const f of abi.functions)
1810
+ m.set(f.name, f);
1811
+ return m;
1812
+ }
1813
+ function conformsTo(candidate, spec) {
1814
+ const fns = indexByName(candidate);
1815
+ for (const required of spec.abi.functions) {
1816
+ if (spec.optional.has(required.name))
1817
+ continue;
1818
+ const got = fns.get(required.name);
1819
+ if (!got)
1820
+ return false;
1821
+ if (normalizeAccess(got.access) !== required.access)
1822
+ return false;
1823
+ if (got.args.length !== required.args.length)
1824
+ return false;
1825
+ }
1826
+ return true;
1827
+ }
1828
+ function classifyContract(abi) {
1829
+ if (!abi || !Array.isArray(abi.functions))
1830
+ return [];
1831
+ return STANDARDS.filter((s) => conformsTo(abi, s)).map((s) => s.id);
1832
+ }
1833
+ function parseDeclaredStandards(claritySource) {
1834
+ const out = new Set;
1835
+ const matches = claritySource.matchAll(/\(impl-trait\s+[^)]+\)/gi);
1836
+ for (const m of matches) {
1837
+ const ref = m[0].toLowerCase();
1838
+ if (ref.includes("sip-010") || ref.includes(".ft-trait"))
1839
+ out.add("sip-010");
1840
+ if (ref.includes("sip-009") || ref.includes("nft-trait"))
1841
+ out.add("sip-009");
1842
+ if (ref.includes("sip-013") || ref.includes("semi-fungible"))
1843
+ out.add("sip-013");
1844
+ }
1845
+ return [...out];
1846
+ }
1843
1847
  // src/clarity/bridge.ts
1844
1848
  var CV_TYPE_TAGS = new Set([
1845
1849
  "int",
@@ -2019,5 +2023,5 @@ function clarityValueToJSInner(abiType, cv) {
2019
2023
  throw new Error(`Unknown ABI type: ${JSON.stringify(abiType)}`);
2020
2024
  }
2021
2025
 
2022
- //# debugId=6928F0553B6E61DA64756E2164756E21
2026
+ //# debugId=8620321C2698D0EB64756E2164756E21
2023
2027
  //# sourceMappingURL=index.cjs.map