@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
@@ -5,11 +5,11 @@ import {
5
5
  uintCV2,
6
6
  bufferCV2,
7
7
  listCV2
8
- } from "../../shared/stacks-esm-hkw1kvd4.js";
8
+ } from "../../shared/stacks-esm-gs60rd15.js";
9
9
  import"../../shared/stacks-esm-kbz5s6v8.js";
10
- import"../../shared/stacks-esm-tdrdye4y.js";
11
- import"../../shared/stacks-esm-8f5catbf.js";
12
- import"../../shared/stacks-esm-a20wyky3.js";
10
+ import"../../shared/stacks-esm-4ja7b0px.js";
11
+ import"../../shared/stacks-esm-7kb3t7ve.js";
12
+ import"../../shared/stacks-esm-896kv9yv.js";
13
13
  import {
14
14
  doubleSha2562,
15
15
  reverseBytes2,
@@ -38,7 +38,7 @@ import {
38
38
  import {
39
39
  MalformedResponseError2,
40
40
  readContract2
41
- } from "../../shared/stacks-esm-0pc6tmf0.js";
41
+ } from "../../shared/stacks-esm-x8gjr2v6.js";
42
42
  // src/bitcoin/codec.ts
43
43
  function merkleDepth(txCount) {
44
44
  let depth = 0;
@@ -707,11 +707,14 @@ function readCV(reader, depth = 0) {
707
707
  case "err":
708
708
  return responseErrorCV(readCV(reader, depth + 1));
709
709
  case "address":
710
- return standardPrincipalCV(readAddress(reader));
710
+ return { type: "address", value: readAddress(reader) };
711
711
  case "contract": {
712
712
  const addr = readAddress(reader);
713
713
  const name = readLPString(reader);
714
- return contractPrincipalCV(addr, name);
714
+ if (new TextEncoder().encode(name).byteLength >= 128) {
715
+ throw new Error("Contract name must be less than 128 bytes");
716
+ }
717
+ return { type: "contract", value: `${addr}.${name}` };
715
718
  }
716
719
  case "list": {
717
720
  const len = reader.readUInt32BE();
@@ -4035,64 +4038,6 @@ var SIP013_ABI = {
4035
4038
  var sip010Abi = SIP010_ABI;
4036
4039
  var sip009Abi = SIP009_ABI;
4037
4040
  var sip013Abi = SIP013_ABI;
4038
- // src/clarity/abi/classify.ts
4039
- var TRAIT_STANDARDS = ["sip-009", "sip-010", "sip-013"];
4040
- var STANDARDS = [
4041
- { id: "sip-010", abi: SIP010_ABI, optional: new Set(["get-token-uri"]) },
4042
- { id: "sip-009", abi: SIP009_ABI, optional: new Set(["get-token-uri"]) },
4043
- {
4044
- id: "sip-013",
4045
- abi: SIP013_ABI,
4046
- optional: new Set([
4047
- "transfer-memo",
4048
- "transfer-many",
4049
- "transfer-many-memo",
4050
- "get-token-uri",
4051
- "get-overall-balance",
4052
- "get-overall-supply"
4053
- ])
4054
- }
4055
- ];
4056
- function indexByName(abi) {
4057
- const m = new Map;
4058
- for (const f of abi.functions)
4059
- m.set(f.name, f);
4060
- return m;
4061
- }
4062
- function conformsTo(candidate, spec) {
4063
- const fns = indexByName(candidate);
4064
- for (const required of spec.abi.functions) {
4065
- if (spec.optional.has(required.name))
4066
- continue;
4067
- const got = fns.get(required.name);
4068
- if (!got)
4069
- return false;
4070
- if (got.access !== required.access)
4071
- return false;
4072
- if (got.args.length !== required.args.length)
4073
- return false;
4074
- }
4075
- return true;
4076
- }
4077
- function classifyContract(abi) {
4078
- if (!abi || !Array.isArray(abi.functions))
4079
- return [];
4080
- return STANDARDS.filter((s) => conformsTo(abi, s)).map((s) => s.id);
4081
- }
4082
- function parseDeclaredStandards(claritySource) {
4083
- const out = new Set;
4084
- const matches = claritySource.matchAll(/\(impl-trait\s+[^)]+\)/gi);
4085
- for (const m of matches) {
4086
- const ref = m[0].toLowerCase();
4087
- if (ref.includes("sip-010") || ref.includes(".ft-trait"))
4088
- out.add("sip-010");
4089
- if (ref.includes("sip-009") || ref.includes("nft-trait"))
4090
- out.add("sip-009");
4091
- if (ref.includes("sip-013") || ref.includes("semi-fungible"))
4092
- out.add("sip-013");
4093
- }
4094
- return [...out];
4095
- }
4096
4041
  // src/clarity/abi/normalize.ts
4097
4042
  function normalizeAccess(access) {
4098
4043
  if (access === "read_only")
@@ -4299,6 +4244,65 @@ function normalizeAbi(abi) {
4299
4244
  defined_traits: definedTraits.length > 0 ? definedTraits : undefined
4300
4245
  };
4301
4246
  }
4247
+
4248
+ // src/clarity/abi/classify.ts
4249
+ var TRAIT_STANDARDS = ["sip-009", "sip-010", "sip-013"];
4250
+ var STANDARDS = [
4251
+ { id: "sip-010", abi: SIP010_ABI, optional: new Set(["get-token-uri"]) },
4252
+ { id: "sip-009", abi: SIP009_ABI, optional: new Set(["get-token-uri"]) },
4253
+ {
4254
+ id: "sip-013",
4255
+ abi: SIP013_ABI,
4256
+ optional: new Set([
4257
+ "transfer-memo",
4258
+ "transfer-many",
4259
+ "transfer-many-memo",
4260
+ "get-token-uri",
4261
+ "get-overall-balance",
4262
+ "get-overall-supply"
4263
+ ])
4264
+ }
4265
+ ];
4266
+ function indexByName(abi) {
4267
+ const m = new Map;
4268
+ for (const f of abi.functions)
4269
+ m.set(f.name, f);
4270
+ return m;
4271
+ }
4272
+ function conformsTo(candidate, spec) {
4273
+ const fns = indexByName(candidate);
4274
+ for (const required of spec.abi.functions) {
4275
+ if (spec.optional.has(required.name))
4276
+ continue;
4277
+ const got = fns.get(required.name);
4278
+ if (!got)
4279
+ return false;
4280
+ if (normalizeAccess(got.access) !== required.access)
4281
+ return false;
4282
+ if (got.args.length !== required.args.length)
4283
+ return false;
4284
+ }
4285
+ return true;
4286
+ }
4287
+ function classifyContract(abi) {
4288
+ if (!abi || !Array.isArray(abi.functions))
4289
+ return [];
4290
+ return STANDARDS.filter((s) => conformsTo(abi, s)).map((s) => s.id);
4291
+ }
4292
+ function parseDeclaredStandards(claritySource) {
4293
+ const out = new Set;
4294
+ const matches = claritySource.matchAll(/\(impl-trait\s+[^)]+\)/gi);
4295
+ for (const m of matches) {
4296
+ const ref = m[0].toLowerCase();
4297
+ if (ref.includes("sip-010") || ref.includes(".ft-trait"))
4298
+ out.add("sip-010");
4299
+ if (ref.includes("sip-009") || ref.includes("nft-trait"))
4300
+ out.add("sip-009");
4301
+ if (ref.includes("sip-013") || ref.includes("semi-fungible"))
4302
+ out.add("sip-013");
4303
+ }
4304
+ return [...out];
4305
+ }
4302
4306
  // src/postconditions/index.ts
4303
4307
  var exports_postconditions = {};
4304
4308
  __export(exports_postconditions, {
@@ -5042,5 +5046,5 @@ function bns() {
5042
5046
  });
5043
5047
  }
5044
5048
 
5045
- //# debugId=5DC8299B2C972CCE64756E2164756E21
5049
+ //# debugId=A5427995C638B39164756E2164756E21
5046
5050
  //# sourceMappingURL=index.cjs.map