@secondlayer/stacks 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/shared/stacks-2ar4prfz.cjs +328 -0
  2. package/dist/shared/stacks-2ar4prfz.cjs.map +11 -0
  3. package/dist/shared/stacks-61rvzkz1.cjs.map +1 -1
  4. package/dist/shared/{stacks-d1fmkv3p.js → stacks-9avax1yf.js} +2 -2
  5. package/dist/shared/{stacks-ph4a6322.js → stacks-9mdk86wp.js} +16 -18
  6. package/dist/shared/{stacks-ph4a6322.js.map → stacks-9mdk86wp.js.map} +2 -2
  7. package/dist/shared/stacks-an5k8n4t.cjs.map +2 -2
  8. package/dist/shared/stacks-dr5en54r.cjs +119 -0
  9. package/dist/shared/stacks-dr5en54r.cjs.map +10 -0
  10. package/dist/shared/{stacks-b008c3w8.cjs → stacks-fedzr2ka.js} +134 -2
  11. package/dist/shared/stacks-fedzr2ka.js.map +13 -0
  12. package/dist/shared/{stacks-j2cy7qtt.js → stacks-ky14tdf6.cjs} +109 -24
  13. package/dist/shared/stacks-ky14tdf6.cjs.map +13 -0
  14. package/dist/shared/stacks-mrk6tkkh.cjs +41 -0
  15. package/dist/shared/{stacks-2gdt3aqj.cjs.map → stacks-mrk6tkkh.cjs.map} +1 -1
  16. package/dist/shared/{stacks-1ddg6mbv.js → stacks-qcx67vqa.js} +3 -3
  17. package/dist/shared/stacks-qcx67vqa.js.map +10 -0
  18. package/dist/shared/stacks-qyt8m5v0.js +282 -0
  19. package/dist/shared/stacks-qyt8m5v0.js.map +11 -0
  20. package/dist/shared/{stacks-hfem9dck.cjs → stacks-vbke9mqw.cjs} +328 -87
  21. package/dist/shared/stacks-vbke9mqw.cjs.map +15 -0
  22. package/dist/shared/{stacks-md6e5ta0.js → stacks-vd9jcp0b.js} +13 -17
  23. package/dist/shared/{stacks-md6e5ta0.js.map → stacks-vd9jcp0b.js.map} +3 -3
  24. package/dist/shared/stacks-vdfag81a.cjs.map +2 -2
  25. package/dist/shared/{stacks-xtz0n62y.js → stacks-vyb9rx8q.js} +341 -106
  26. package/dist/shared/stacks-vyb9rx8q.js.map +15 -0
  27. package/dist/shared/{stacks-m2dc5xwg.js → stacks-wrb1es85.js} +7 -11
  28. package/dist/shared/{stacks-m2dc5xwg.js.map → stacks-wrb1es85.js.map} +3 -3
  29. package/dist/shared/stacks-yfveb68e.js +121 -0
  30. package/dist/shared/stacks-yfveb68e.js.map +10 -0
  31. package/dist/src/accounts/index.js +1 -2
  32. package/dist/src/accounts/index.js.map +2 -2
  33. package/dist/src/actions/index.d.cts +3 -5
  34. package/dist/src/actions/index.d.ts +3 -5
  35. package/dist/src/actions/index.js +8 -11
  36. package/dist/src/actions/index.js.map +1 -1
  37. package/dist/src/bns/index.cjs +13 -13
  38. package/dist/src/bns/index.cjs.map +3 -3
  39. package/dist/src/bns/index.js +22 -25
  40. package/dist/src/bns/index.js.map +3 -3
  41. package/dist/src/chains/index.js +1 -2
  42. package/dist/src/chains/index.js.map +1 -1
  43. package/dist/src/clarity/index.cjs +1 -326
  44. package/dist/src/clarity/index.cjs.map +3 -5
  45. package/dist/src/clarity/index.js +18 -272
  46. package/dist/src/clarity/index.js.map +3 -5
  47. package/dist/src/connect/index.cjs +19 -9
  48. package/dist/src/connect/index.cjs.map +2 -2
  49. package/dist/src/connect/walletconnect/index.cjs +19 -9
  50. package/dist/src/connect/walletconnect/index.cjs.map +4 -4
  51. package/dist/src/connect/walletconnect/index.js +1 -1
  52. package/dist/src/connect/walletconnect/index.js.map +4 -4
  53. package/dist/src/index.cjs +1 -2
  54. package/dist/src/index.cjs.map +5 -5
  55. package/dist/src/index.js +9 -16
  56. package/dist/src/index.js.map +5 -5
  57. package/dist/src/postconditions/index.cjs +1 -117
  58. package/dist/src/postconditions/index.cjs.map +3 -4
  59. package/dist/src/postconditions/index.js +5 -119
  60. package/dist/src/postconditions/index.js.map +3 -4
  61. package/dist/src/pox/index.cjs +9 -9
  62. package/dist/src/pox/index.cjs.map +4 -4
  63. package/dist/src/pox/index.js +17 -20
  64. package/dist/src/pox/index.js.map +4 -4
  65. package/dist/src/stackingdao/index.cjs +13 -13
  66. package/dist/src/stackingdao/index.cjs.map +3 -3
  67. package/dist/src/stackingdao/index.js +21 -24
  68. package/dist/src/stackingdao/index.js.map +3 -3
  69. package/dist/src/subscriptions/index.js +1 -2
  70. package/dist/src/subscriptions/index.js.map +1 -1
  71. package/dist/src/transactions/index.js +18 -22
  72. package/dist/src/transactions/index.js.map +1 -1
  73. package/dist/src/utils/index.cjs.map +2 -2
  74. package/dist/src/utils/index.js +4 -5
  75. package/dist/src/utils/index.js.map +3 -3
  76. package/package.json +1 -1
  77. package/dist/shared/stacks-1aqm7c2h.cjs +0 -110
  78. package/dist/shared/stacks-1aqm7c2h.cjs.map +0 -11
  79. package/dist/shared/stacks-1ddg6mbv.js.map +0 -10
  80. package/dist/shared/stacks-2gdt3aqj.cjs +0 -44
  81. package/dist/shared/stacks-8yykgdww.js +0 -125
  82. package/dist/shared/stacks-8yykgdww.js.map +0 -11
  83. package/dist/shared/stacks-b008c3w8.cjs.map +0 -11
  84. package/dist/shared/stacks-hfem9dck.cjs.map +0 -13
  85. package/dist/shared/stacks-j2cy7qtt.js.map +0 -11
  86. package/dist/shared/stacks-njvyj3ab.js +0 -23
  87. package/dist/shared/stacks-njvyj3ab.js.map +0 -9
  88. package/dist/shared/stacks-pz73cn97.js +0 -285
  89. package/dist/shared/stacks-pz73cn97.js.map +0 -11
  90. package/dist/shared/stacks-xtz0n62y.js.map +0 -13
  91. package/dist/shared/stacks-zyv9qqme.cjs +0 -249
  92. package/dist/shared/stacks-zyv9qqme.cjs.map +0 -11
  93. /package/dist/shared/{stacks-d1fmkv3p.js.map → stacks-9avax1yf.js.map} +0 -0
@@ -1,125 +0,0 @@
1
- import {
2
- asciiToBytes,
3
- bigIntToBytes,
4
- bytesToHex,
5
- c32addressDecode,
6
- concatBytes,
7
- hexToBytes,
8
- intToHex,
9
- toTwos,
10
- utf8ToBytes,
11
- writeUInt32BE
12
- } from "./stacks-nqytwfcc.js";
13
-
14
- // src/clarity/types.ts
15
- var ClarityWireType = {
16
- int: 0,
17
- uint: 1,
18
- buffer: 2,
19
- true: 3,
20
- false: 4,
21
- address: 5,
22
- contract: 6,
23
- ok: 7,
24
- err: 8,
25
- none: 9,
26
- some: 10,
27
- list: 11,
28
- tuple: 12,
29
- ascii: 13,
30
- utf8: 14
31
- };
32
- var wireTypeToClarity = Object.fromEntries(Object.entries(ClarityWireType).map(([k, v]) => [v, k]));
33
- function clarityTypeFromByte(byte) {
34
- const type = wireTypeToClarity[byte];
35
- if (!type)
36
- throw new Error(`Unknown clarity wire type: ${byte}`);
37
- return type;
38
- }
39
-
40
- // src/clarity/serialize.ts
41
- var CLARITY_INT_SIZE = 128n;
42
- var CLARITY_INT_BYTE_SIZE = 16;
43
- function typeIdByte(type) {
44
- return ClarityWireType[type];
45
- }
46
- function withTypeId(type, bytes) {
47
- return concatBytes(new Uint8Array([typeIdByte(type)]), bytes);
48
- }
49
- function serializeAddress(c32Address) {
50
- const [version, hash160] = c32addressDecode(c32Address);
51
- return concatBytes(new Uint8Array([version]), hexToBytes(hash160));
52
- }
53
- function serializeLPString(str, prefixBytes = 1) {
54
- const content = utf8ToBytes(str);
55
- const lengthPrefix = hexToBytes(intToHex(content.byteLength, prefixBytes));
56
- return concatBytes(lengthPrefix, content);
57
- }
58
- function serializeCVBytes(value) {
59
- switch (value.type) {
60
- case "true":
61
- case "false":
62
- return new Uint8Array([typeIdByte(value.type)]);
63
- case "int": {
64
- const bytes = bigIntToBytes(toTwos(BigInt(value.value), CLARITY_INT_SIZE), CLARITY_INT_BYTE_SIZE);
65
- return withTypeId(value.type, bytes);
66
- }
67
- case "uint": {
68
- const bytes = bigIntToBytes(BigInt(value.value), CLARITY_INT_BYTE_SIZE);
69
- return withTypeId(value.type, bytes);
70
- }
71
- case "buffer": {
72
- const bufBytes = hexToBytes(value.value);
73
- return withTypeId(value.type, concatBytes(writeUInt32BE(bufBytes.length), bufBytes));
74
- }
75
- case "none":
76
- return new Uint8Array([typeIdByte(value.type)]);
77
- case "some":
78
- return withTypeId(value.type, serializeCVBytes(value.value));
79
- case "ok":
80
- case "err":
81
- return withTypeId(value.type, serializeCVBytes(value.value));
82
- case "address":
83
- return withTypeId(value.type, serializeAddress(value.value));
84
- case "contract": {
85
- const [addr, name] = value.value.split(".");
86
- if (!addr || !name)
87
- throw new Error(`Invalid contract principal: ${value.value}`);
88
- return withTypeId(value.type, concatBytes(serializeAddress(addr), serializeLPString(name)));
89
- }
90
- case "list": {
91
- const parts = [writeUInt32BE(value.value.length)];
92
- for (const item of value.value) {
93
- parts.push(serializeCVBytes(item));
94
- }
95
- return withTypeId(value.type, concatBytes(...parts));
96
- }
97
- case "tuple": {
98
- const keys = Object.keys(value.value).sort((a, b) => a.localeCompare(b));
99
- const parts = [writeUInt32BE(keys.length)];
100
- for (const key of keys) {
101
- parts.push(serializeLPString(key));
102
- parts.push(serializeCVBytes(value.value[key]));
103
- }
104
- return withTypeId(value.type, concatBytes(...parts));
105
- }
106
- case "ascii": {
107
- const strBytes = asciiToBytes(value.value);
108
- return withTypeId(value.type, concatBytes(writeUInt32BE(strBytes.length), strBytes));
109
- }
110
- case "utf8": {
111
- const strBytes = utf8ToBytes(value.value);
112
- return withTypeId(value.type, concatBytes(writeUInt32BE(strBytes.length), strBytes));
113
- }
114
- default:
115
- throw new Error(`Cannot serialize unknown clarity type`);
116
- }
117
- }
118
- function serializeCV(value) {
119
- return bytesToHex(serializeCVBytes(value));
120
- }
121
-
122
- export { ClarityWireType, clarityTypeFromByte, serializeCVBytes, serializeCV };
123
-
124
- //# debugId=D83E478FA3033F0964756E2164756E21
125
- //# sourceMappingURL=stacks-8yykgdww.js.map
@@ -1,11 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/clarity/types.ts", "../src/clarity/serialize.ts"],
4
- "sourcesContent": [
5
- "export type ClarityType =\n | \"int\"\n | \"uint\"\n | \"buffer\"\n | \"true\"\n | \"false\"\n | \"address\"\n | \"contract\"\n | \"ok\"\n | \"err\"\n | \"none\"\n | \"some\"\n | \"list\"\n | \"tuple\"\n | \"ascii\"\n | \"utf8\";\n\n/** Wire type IDs matching the Stacks binary format (SIP-005) */\nexport const ClarityWireType = {\n int: 0x00,\n uint: 0x01,\n buffer: 0x02,\n true: 0x03,\n false: 0x04,\n address: 0x05,\n contract: 0x06,\n ok: 0x07,\n err: 0x08,\n none: 0x09,\n some: 0x0a,\n list: 0x0b,\n tuple: 0x0c,\n ascii: 0x0d,\n utf8: 0x0e,\n} as const satisfies Record<ClarityType, number>;\n\n/** Reverse lookup: wire byte → ClarityType string */\nconst wireTypeToClarity = Object.fromEntries(\n Object.entries(ClarityWireType).map(([k, v]) => [v, k])\n) as Record<number, ClarityType>;\n\nexport function clarityTypeFromByte(byte: number): ClarityType {\n const type = wireTypeToClarity[byte];\n if (!type) throw new Error(`Unknown clarity wire type: ${byte}`);\n return type;\n}\n\n// CV types\n\nexport type IntCV = { readonly type: \"int\"; readonly value: bigint };\nexport type UIntCV = { readonly type: \"uint\"; readonly value: bigint };\nexport type BooleanCV = TrueCV | FalseCV;\nexport type TrueCV = { readonly type: \"true\" };\nexport type FalseCV = { readonly type: \"false\" };\nexport type BufferCV = { readonly type: \"buffer\"; readonly value: string }; // hex\nexport type NoneCV = { readonly type: \"none\" };\nexport type SomeCV = {\n readonly type: \"some\";\n readonly value: ClarityValue;\n};\nexport type OptionalCV = NoneCV | SomeCV;\nexport type ResponseOkCV = {\n readonly type: \"ok\";\n readonly value: ClarityValue;\n};\nexport type ResponseErrorCV = {\n readonly type: \"err\";\n readonly value: ClarityValue;\n};\nexport type ResponseCV = ResponseOkCV | ResponseErrorCV;\nexport type StandardPrincipalCV = {\n readonly type: \"address\";\n readonly value: string;\n};\nexport type ContractPrincipalCV = {\n readonly type: \"contract\";\n readonly value: string; // \"address.name\"\n};\nexport type PrincipalCV = StandardPrincipalCV | ContractPrincipalCV;\nexport type ListCV = {\n type: \"list\";\n value: ClarityValue[];\n};\nexport type TupleData = {\n [key: string]: ClarityValue;\n};\nexport type TupleCV = {\n type: \"tuple\";\n value: TupleData;\n};\nexport type StringAsciiCV = {\n readonly type: \"ascii\";\n readonly value: string;\n};\nexport type StringUtf8CV = {\n readonly type: \"utf8\";\n readonly value: string;\n};\n\nexport type ClarityValue =\n | IntCV\n | UIntCV\n | BooleanCV\n | BufferCV\n | NoneCV\n | SomeCV\n | ResponseOkCV\n | ResponseErrorCV\n | StandardPrincipalCV\n | ContractPrincipalCV\n | ListCV\n | TupleCV\n | StringAsciiCV\n | StringUtf8CV;\n",
6
- "import {\n bytesToHex,\n hexToBytes,\n concatBytes,\n bigIntToBytes,\n toTwos,\n asciiToBytes,\n utf8ToBytes,\n writeUInt32BE,\n intToHex,\n} from \"../utils/encoding.ts\";\nimport { c32addressDecode } from \"../utils/c32.ts\";\nimport { ClarityWireType, type ClarityValue, type ClarityType } from \"./types.ts\";\n\nconst CLARITY_INT_SIZE = 128n;\nconst CLARITY_INT_BYTE_SIZE = 16;\n\nfunction typeIdByte(type: ClarityType): number {\n return ClarityWireType[type];\n}\n\nfunction withTypeId(type: ClarityType, bytes: Uint8Array): Uint8Array {\n return concatBytes(new Uint8Array([typeIdByte(type)]), bytes);\n}\n\nfunction serializeAddress(c32Address: string): Uint8Array {\n const [version, hash160] = c32addressDecode(c32Address);\n return concatBytes(new Uint8Array([version]), hexToBytes(hash160));\n}\n\nfunction serializeLPString(str: string, prefixBytes = 1): Uint8Array {\n const content = utf8ToBytes(str);\n const lengthPrefix = hexToBytes(intToHex(content.byteLength, prefixBytes));\n return concatBytes(lengthPrefix, content);\n}\n\nexport function serializeCVBytes(value: ClarityValue): Uint8Array {\n switch (value.type) {\n case \"true\":\n case \"false\":\n return new Uint8Array([typeIdByte(value.type)]);\n\n case \"int\": {\n const bytes = bigIntToBytes(\n toTwos(BigInt(value.value), CLARITY_INT_SIZE),\n CLARITY_INT_BYTE_SIZE\n );\n return withTypeId(value.type, bytes);\n }\n\n case \"uint\": {\n const bytes = bigIntToBytes(BigInt(value.value), CLARITY_INT_BYTE_SIZE);\n return withTypeId(value.type, bytes);\n }\n\n case \"buffer\": {\n const bufBytes = hexToBytes(value.value);\n return withTypeId(\n value.type,\n concatBytes(writeUInt32BE(bufBytes.length), bufBytes)\n );\n }\n\n case \"none\":\n return new Uint8Array([typeIdByte(value.type)]);\n\n case \"some\":\n return withTypeId(value.type, serializeCVBytes(value.value));\n\n case \"ok\":\n case \"err\":\n return withTypeId(value.type, serializeCVBytes(value.value));\n\n case \"address\":\n return withTypeId(value.type, serializeAddress(value.value));\n\n case \"contract\": {\n const [addr, name] = value.value.split(\".\");\n if (!addr || !name) throw new Error(`Invalid contract principal: ${value.value}`);\n return withTypeId(\n value.type,\n concatBytes(serializeAddress(addr), serializeLPString(name))\n );\n }\n\n case \"list\": {\n const parts: Uint8Array[] = [writeUInt32BE(value.value.length)];\n for (const item of value.value) {\n parts.push(serializeCVBytes(item));\n }\n return withTypeId(value.type, concatBytes(...parts));\n }\n\n case \"tuple\": {\n const keys = Object.keys(value.value).sort((a, b) => a.localeCompare(b));\n const parts: Uint8Array[] = [writeUInt32BE(keys.length)];\n for (const key of keys) {\n parts.push(serializeLPString(key));\n parts.push(serializeCVBytes(value.value[key]!));\n }\n return withTypeId(value.type, concatBytes(...parts));\n }\n\n case \"ascii\": {\n const strBytes = asciiToBytes(value.value);\n return withTypeId(\n value.type,\n concatBytes(writeUInt32BE(strBytes.length), strBytes)\n );\n }\n\n case \"utf8\": {\n const strBytes = utf8ToBytes(value.value);\n return withTypeId(\n value.type,\n concatBytes(writeUInt32BE(strBytes.length), strBytes)\n );\n }\n\n default:\n throw new Error(`Cannot serialize unknown clarity type`);\n }\n}\n\nexport function serializeCV(value: ClarityValue): string {\n return bytesToHex(serializeCVBytes(value));\n}\n"
7
- ],
8
- "mappings": ";;;;;;;;;;;;;;AA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MACnC;AAAA,MACA,OAAO,WAAW,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC;AAAA,IACrD;AAAA,SAEK,SAAS;AAAA,MACZ,MAAM,OAAO,OAAO,KAAK,MAAM,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC;AAAA,MACvE,MAAM,QAAsB,CAAC,cAAc,KAAK,MAAM,CAAC;AAAA,MACvD,WAAW,OAAO,MAAM;AAAA,QACtB,MAAM,KAAK,kBAAkB,GAAG,CAAC;AAAA,QACjC,MAAM,KAAK,iBAAiB,MAAM,MAAM,IAAK,CAAC;AAAA,MAChD;AAAA,MACA,OAAO,WAAW,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC;AAAA,IACrD;AAAA,SAEK,SAAS;AAAA,MACZ,MAAM,WAAW,aAAa,MAAM,KAAK;AAAA,MACzC,OAAO,WACL,MAAM,MACN,YAAY,cAAc,SAAS,MAAM,GAAG,QAAQ,CACtD;AAAA,IACF;AAAA,SAEK,QAAQ;AAAA,MACX,MAAM,WAAW,YAAY,MAAM,KAAK;AAAA,MACxC,OAAO,WACL,MAAM,MACN,YAAY,cAAc,SAAS,MAAM,GAAG,QAAQ,CACtD;AAAA,IACF;AAAA;AAAA,MAGE,MAAM,IAAI,MAAM,uCAAuC;AAAA;AAAA;AAItD,SAAS,WAAW,CAAC,OAA6B;AAAA,EACvD,OAAO,WAAW,iBAAiB,KAAK,CAAC;AAAA;",
9
- "debugId": "D83E478FA3033F0964756E2164756E21",
10
- "names": []
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/clarity/deserialize.ts", "../src/clarity/values.ts"],
4
- "sourcesContent": [
5
- "import {\n hexToBytes,\n bytesToHex,\n bytesToAscii,\n bytesToUtf8,\n bytesToTwosBigInt,\n without0x,\n} from \"../utils/encoding.ts\";\nimport { c32address } from \"../utils/c32.ts\";\nimport {\n clarityTypeFromByte,\n type ClarityValue,\n} from \"./types.ts\";\nimport {\n intCV,\n uintCV,\n trueCV,\n falseCV,\n bufferCV,\n noneCV,\n someCV,\n responseOkCV,\n responseErrorCV,\n standardPrincipalCV,\n contractPrincipalCV,\n listCV,\n tupleCV,\n stringAsciiCV,\n stringUtf8CV,\n} from \"./values.ts\";\n\nclass BytesReader {\n private data: Uint8Array;\n private offset = 0;\n\n constructor(data: Uint8Array) {\n this.data = data;\n }\n\n readUInt8(): number {\n const value = this.data[this.offset]!;\n this.offset += 1;\n return value;\n }\n\n readUInt32BE(): number {\n const value =\n ((this.data[this.offset]! << 24) |\n (this.data[this.offset + 1]! << 16) |\n (this.data[this.offset + 2]! << 8) |\n this.data[this.offset + 3]!) >>>\n 0;\n this.offset += 4;\n return value;\n }\n\n readBytes(length: number): Uint8Array {\n const slice = this.data.slice(this.offset, this.offset + length);\n this.offset += length;\n return slice;\n }\n}\n\nfunction readAddress(reader: BytesReader): string {\n const version = reader.readUInt8();\n const hash160 = bytesToHex(reader.readBytes(20));\n return c32address(version, hash160);\n}\n\nfunction readLPString(reader: BytesReader, prefixBytes = 1): string {\n let length = 0;\n for (let i = 0; i < prefixBytes; i++) {\n length = (length << 8) | reader.readUInt8();\n }\n return bytesToUtf8(reader.readBytes(length));\n}\n\nfunction readCV(reader: BytesReader): ClarityValue {\n const typeByte = reader.readUInt8();\n const type = clarityTypeFromByte(typeByte);\n\n switch (type) {\n case \"int\":\n return intCV(bytesToTwosBigInt(reader.readBytes(16)));\n\n case \"uint\":\n return uintCV(reader.readBytes(16));\n\n case \"true\":\n return trueCV();\n\n case \"false\":\n return falseCV();\n\n case \"buffer\": {\n const len = reader.readUInt32BE();\n return bufferCV(reader.readBytes(len));\n }\n\n case \"none\":\n return noneCV();\n\n case \"some\":\n return someCV(readCV(reader));\n\n case \"ok\":\n return responseOkCV(readCV(reader));\n\n case \"err\":\n return responseErrorCV(readCV(reader));\n\n case \"address\":\n return standardPrincipalCV(readAddress(reader));\n\n case \"contract\": {\n const addr = readAddress(reader);\n const name = readLPString(reader);\n return contractPrincipalCV(addr, name);\n }\n\n case \"list\": {\n const len = reader.readUInt32BE();\n const items: ClarityValue[] = [];\n for (let i = 0; i < len; i++) {\n items.push(readCV(reader));\n }\n return listCV(items);\n }\n\n case \"tuple\": {\n const len = reader.readUInt32BE();\n const data: Record<string, ClarityValue> = {};\n for (let i = 0; i < len; i++) {\n const key = readLPString(reader);\n data[key] = readCV(reader);\n }\n return tupleCV(data);\n }\n\n case \"ascii\": {\n const len = reader.readUInt32BE();\n return stringAsciiCV(bytesToAscii(reader.readBytes(len)));\n }\n\n case \"utf8\": {\n const len = reader.readUInt32BE();\n return stringUtf8CV(bytesToUtf8(reader.readBytes(len)));\n }\n\n default:\n throw new Error(`Cannot deserialize unknown clarity type: ${type}`);\n }\n}\n\nexport function deserializeCVBytes<T extends ClarityValue = ClarityValue>(\n input: Uint8Array | string\n): T {\n const bytes =\n typeof input === \"string\" ? hexToBytes(without0x(input)) : input;\n return readCV(new BytesReader(bytes)) as T;\n}\n\nexport function deserializeCV<T extends ClarityValue = ClarityValue>(\n input: Uint8Array | string\n): T {\n return deserializeCVBytes(input);\n}\n",
6
- "import { c32address, c32addressDecode } from \"../utils/c32.ts\";\nimport {\n bytesToHex,\n hexToBytes,\n asciiToBytes,\n utf8ToBytes,\n intToBigInt,\n bytesToTwosBigInt,\n type IntegerType,\n} from \"../utils/encoding.ts\";\nimport { isClarityName } from \"../utils/address.ts\";\nimport type {\n IntCV,\n UIntCV,\n BooleanCV,\n TrueCV,\n FalseCV,\n BufferCV,\n NoneCV,\n SomeCV,\n OptionalCV,\n ResponseOkCV,\n ResponseErrorCV,\n StandardPrincipalCV,\n ContractPrincipalCV,\n ListCV,\n TupleCV,\n TupleData,\n StringAsciiCV,\n StringUtf8CV,\n ClarityValue,\n} from \"./types.ts\";\nimport { serializeCVBytes } from \"./serialize.ts\";\nimport { deserializeCVBytes } from \"./deserialize.ts\";\n\nconst MAX_U128 = BigInt(\"0xffffffffffffffffffffffffffffffff\");\nconst MIN_I128 = BigInt(\"-170141183460469231731687303715884105728\");\nconst MAX_I128 = BigInt(\"0x7fffffffffffffffffffffffffffffff\");\n\n// Primitives\n\nexport function intCV(value: IntegerType): IntCV {\n if (typeof value === \"string\" && value.toLowerCase().startsWith(\"0x\")) {\n value = bytesToTwosBigInt(hexToBytes(value));\n }\n if (value instanceof Uint8Array) value = bytesToTwosBigInt(value);\n const n = intToBigInt(value);\n if (n > MAX_I128) throw new RangeError(`Int exceeds max i128: ${MAX_I128}`);\n if (n < MIN_I128) throw new RangeError(`Int below min i128: ${MIN_I128}`);\n return { type: \"int\", value: n };\n}\n\nexport function uintCV(value: IntegerType): UIntCV {\n const n = intToBigInt(value);\n if (n < 0n) throw new RangeError(\"Cannot construct unsigned int from negative value\");\n if (n > MAX_U128) throw new RangeError(`UInt exceeds max u128: ${MAX_U128}`);\n return { type: \"uint\", value: n };\n}\n\nexport const trueCV = (): TrueCV => ({ type: \"true\" });\nexport const falseCV = (): FalseCV => ({ type: \"false\" });\nexport const boolCV = (v: boolean): BooleanCV => (v ? trueCV() : falseCV());\n\nexport function bufferCV(buffer: Uint8Array): BufferCV {\n if (buffer.byteLength > 1_048_576) {\n throw new Error(\"Buffer exceeds max size of 1MB\");\n }\n return { type: \"buffer\", value: bytesToHex(buffer) };\n}\n\nexport function standardPrincipalCV(address: string): StandardPrincipalCV {\n // Validate by decoding\n const [version, hash160] = c32addressDecode(address);\n const normalized = c32address(version, hash160);\n return { type: \"address\", value: normalized };\n}\n\nexport function contractPrincipalCV(\n address: string,\n contractName: string\n): ContractPrincipalCV {\n const [version, hash160] = c32addressDecode(address);\n const normalized = c32address(version, hash160);\n if (utf8ToBytes(contractName).byteLength >= 128) {\n throw new Error(\"Contract name must be less than 128 bytes\");\n }\n return { type: \"contract\", value: `${normalized}.${contractName}` };\n}\n\nexport function noneCV(): NoneCV {\n return { type: \"none\" };\n}\n\nexport function someCV(value: ClarityValue): SomeCV {\n return { type: \"some\", value };\n}\n\nexport function responseOkCV(value: ClarityValue): ResponseOkCV {\n return { type: \"ok\", value };\n}\n\nexport function responseErrorCV(value: ClarityValue): ResponseErrorCV {\n return { type: \"err\", value };\n}\n\nexport function listCV(values: ClarityValue[]): ListCV {\n return { type: \"list\", value: values };\n}\n\nexport function tupleCV(data: TupleData): TupleCV {\n for (const key in data) {\n if (!isClarityName(key)) {\n throw new Error(`\"${key}\" is not a valid Clarity name`);\n }\n }\n return { type: \"tuple\", value: data };\n}\n\nexport function stringAsciiCV(value: string): StringAsciiCV {\n return { type: \"ascii\", value };\n}\n\nexport function stringUtf8CV(value: string): StringUtf8CV {\n return { type: \"utf8\", value };\n}\n\n// Cl namespace — clean API\n\nexport const Cl: {\n readonly int: (value: IntegerType) => IntCV;\n readonly uint: (value: IntegerType) => UIntCV;\n readonly bool: (v: boolean) => BooleanCV;\n principal(address: string): StandardPrincipalCV | ContractPrincipalCV;\n address(address: string): StandardPrincipalCV | ContractPrincipalCV;\n readonly contractPrincipal: (address: string, contractName: string) => ContractPrincipalCV;\n readonly standardPrincipal: (address: string) => StandardPrincipalCV;\n readonly buffer: (buffer: Uint8Array) => BufferCV;\n readonly bufferFromHex: (hex: string) => BufferCV;\n readonly bufferFromAscii: (ascii: string) => BufferCV;\n readonly bufferFromUtf8: (utf8: string) => BufferCV;\n readonly none: () => NoneCV;\n readonly some: (value: ClarityValue) => SomeCV;\n readonly ok: (value: ClarityValue) => ResponseOkCV;\n readonly error: (value: ClarityValue) => ResponseErrorCV;\n readonly list: (values: ClarityValue[]) => ListCV;\n readonly tuple: (data: TupleData) => TupleCV;\n readonly stringAscii: (value: string) => StringAsciiCV;\n readonly stringUtf8: (value: string) => StringUtf8CV;\n serialize(value: ClarityValue): string;\n readonly deserialize: (bytes: Uint8Array) => ClarityValue;\n} = {\n int: intCV,\n uint: uintCV,\n bool: boolCV,\n principal(address: string): StandardPrincipalCV | ContractPrincipalCV {\n const [addr, name] = address.split(\".\");\n if (!addr) throw new Error(\"Invalid principal address\");\n return name ? contractPrincipalCV(addr, name) : standardPrincipalCV(addr);\n },\n address(address: string): StandardPrincipalCV | ContractPrincipalCV {\n return Cl.principal(address);\n },\n contractPrincipal: contractPrincipalCV,\n standardPrincipal: standardPrincipalCV,\n buffer: bufferCV,\n bufferFromHex: (hex: string): BufferCV => bufferCV(hexToBytes(hex)),\n bufferFromAscii: (ascii: string): BufferCV => bufferCV(asciiToBytes(ascii)),\n bufferFromUtf8: (utf8: string): BufferCV => bufferCV(utf8ToBytes(utf8)),\n none: noneCV,\n some: someCV,\n ok: responseOkCV,\n error: responseErrorCV,\n list: listCV,\n tuple: tupleCV,\n stringAscii: stringAsciiCV,\n stringUtf8: stringUtf8CV,\n serialize(value: ClarityValue): string {\n return bytesToHex(serializeCVBytes(value));\n },\n deserialize: deserializeCVBytes,\n} as const;\n"
7
- ],
8
- "mappings": ";AA+BA,MAAM,YAAY;AAAA,EACR;AAAA,EACA,SAAS;AAAA,EAEjB,WAAW,CAAC,MAAkB;AAAA,IAC5B,KAAK,OAAO;AAAA;AAAA,EAGd,SAAS,GAAW;AAAA,IAClB,MAAM,QAAQ,KAAK,KAAK,KAAK;AAAA,IAC7B,KAAK,UAAU;AAAA,IACf,OAAO;AAAA;AAAA,EAGT,YAAY,GAAW;AAAA,IACrB,MAAM,SACF,KAAK,KAAK,KAAK,WAAY,KAC1B,KAAK,KAAK,KAAK,SAAS,MAAO,KAC/B,KAAK,KAAK,KAAK,SAAS,MAAO,IAChC,KAAK,KAAK,KAAK,SAAS,QAC1B;AAAA,IACF,KAAK,UAAU;AAAA,IACf,OAAO;AAAA;AAAA,EAGT,SAAS,CAAC,QAA4B;AAAA,IACpC,MAAM,QAAQ,KAAK,KAAK,MAAM,KAAK,QAAQ,KAAK,SAAS,MAAM;AAAA,IAC/D,KAAK,UAAU;AAAA,IACf,OAAO;AAAA;AAEX;AAEA,SAAS,WAAW,CAAC,QAA6B;AAAA,EAChD,MAAM,UAAU,OAAO,UAAU;AAAA,EACjC,MAAM,UAAU,WAA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AAO;AAAA;AAAA,EAE7B,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,QAAQ;AAAA,EACR,eAAe,CAAC,QAA0B,SAAS,WAAW,GAAG,CAAC;AAAA,EAClE,iBAAiB,CAAC,UAA4B,SAAS,aAAa,KAAK,CAAC;AAAA,EAC1E,gBAAgB,CAAC,SAA2B,SAAS,YAAY,IAAI,CAAC;AAAA,EACtE,MAAM;AAAA,EACN,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,SAAS,CAAC,OAA6B;AAAA,IACrC,OAAO,WAAW,iBAAiB,KAAK,CAAC;AAAA;AAAA,EAE3C,aAAa;AACf;",
9
- "debugId": "9E0A409BD71E7ABA64756E2164756E21",
10
- "names": []
11
- }
@@ -1,13 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/transactions/multisig.ts", "../src/transactions/authorization.ts", "../src/transactions/types.ts", "../src/transactions/wire/serialize.ts"],
4
- "sourcesContent": [
5
- "import {\n getPublicKey as nobleGetPublicKey,\n sign as nobleSign,\n} from \"@noble/secp256k1\";\nimport { c32address } from \"../utils/c32.ts\";\nimport { bytesToHex, hexToBytes, intToHex, concatBytes } from \"../utils/encoding.ts\";\nimport { hash160 } from \"../utils/hash.ts\";\nimport {\n sigHashPreSign,\n sigHashPostSign,\n intoInitialSighashAuth,\n nextSignature,\n} from \"./authorization.ts\";\nimport { txidFromBytes } from \"../utils/hash.ts\";\nimport { serializeTransaction } from \"./wire/serialize.ts\";\nimport {\n AuthType,\n AddressHashMode,\n PubKeyEncoding,\n type MultiSigSpendingCondition,\n type MultiSigHashMode,\n type TransactionAuthField,\n type StacksTransaction,\n} from \"./types.ts\";\nimport type { StacksChain } from \"../chains/types.ts\";\nimport type { LocalAccount, CustomAccount } from \"../accounts/types.ts\";\n\n// OP codes for redeem script\nconst OP_CHECKMULTISIG = 0xae;\n\n/** Check if hash mode is non-sequential (SIP-027) */\nexport function isNonSequential(hashMode: number): boolean {\n return (hashMode & 0x04) !== 0;\n}\n\n/** Build a Bitcoin-style redeem script for m-of-n multi-sig */\nfunction makeRedeemScript(publicKeys: string[], signaturesRequired: number): Uint8Array {\n const parts: Uint8Array[] = [];\n parts.push(new Uint8Array([0x50 + signaturesRequired])); // OP_n\n for (const pk of publicKeys) {\n const pkBytes = hexToBytes(pk);\n parts.push(new Uint8Array([pkBytes.length])); // length prefix (0x21 for compressed)\n parts.push(pkBytes);\n }\n parts.push(new Uint8Array([0x50 + publicKeys.length])); // OP_m\n parts.push(new Uint8Array([OP_CHECKMULTISIG]));\n return concatBytes(...parts);\n}\n\n/** Derive a multi-sig address from public keys */\nexport function makeMultiSigAddress(\n publicKeys: string[],\n signaturesRequired: number,\n chain?: StacksChain\n): string {\n if (signaturesRequired < 1 || signaturesRequired > publicKeys.length) {\n throw new Error(`signaturesRequired must be between 1 and ${publicKeys.length}`);\n }\n const redeemScript = makeRedeemScript(publicKeys, signaturesRequired);\n const signer = hash160(redeemScript);\n const version = chain?.addressVersion?.multiSig ?? 20; // mainnet default\n return c32address(version, bytesToHex(signer));\n}\n\n/** Create an empty multi-sig spending condition */\nexport function createMultiSigSpendingCondition(\n publicKeys: string[],\n signaturesRequired: number,\n nonce: bigint,\n fee: bigint,\n hashMode: MultiSigHashMode = AddressHashMode.P2SH\n): MultiSigSpendingCondition {\n const redeemScript = makeRedeemScript(publicKeys, signaturesRequired);\n const signer = bytesToHex(hash160(redeemScript));\n\n return {\n hashMode,\n signer,\n nonce,\n fee,\n fields: [],\n signaturesRequired,\n };\n}\n\n/** Compute the initial sighash for a transaction (same as signBegin) */\nfunction initialSigHash(tx: StacksTransaction): string {\n const cleared: StacksTransaction = {\n ...tx,\n auth: intoInitialSighashAuth(tx.auth),\n };\n return txidFromBytes(serializeTransaction(cleared));\n}\n\n/** Compute the presign-sighash used by all non-sequential signers */\nfunction nonSequentialPreSignHash(tx: StacksTransaction): string {\n const condition = tx.auth.spendingCondition as MultiSigSpendingCondition;\n const initHash = initialSigHash(tx);\n return sigHashPreSign(initHash, AuthType.Standard, condition.fee, condition.nonce);\n}\n\n/** Replay sighash through existing auth fields of a multi-sig tx */\nexport function replayMultiSigSigHash(tx: StacksTransaction): string {\n const condition = tx.auth.spendingCondition as MultiSigSpendingCondition;\n\n // Non-sequential: all signers sign the same presign-sighash, no field chaining\n if (isNonSequential(condition.hashMode)) {\n const preSign = nonSequentialPreSignHash(tx);\n // Chain through all fields to get the final sighash\n let curSigHash = preSign;\n for (const field of condition.fields) {\n curSigHash = sigHashPostSign(curSigHash, field.pubKeyEncoding, field.data);\n }\n return curSigHash;\n }\n\n // Sequential: chain through all fields\n let curSigHash = initialSigHash(tx);\n for (const field of condition.fields) {\n const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);\n curSigHash = sigHashPostSign(preSign, field.pubKeyEncoding, field.data);\n }\n return curSigHash;\n}\n\n/** Sign one position of a multi-sig transaction with a private key */\nexport function signMultiSig(\n tx: StacksTransaction,\n privateKey: string,\n publicKeys: string[]\n): StacksTransaction {\n const keyBytes = hexToBytes(privateKey).slice(0, 32);\n const signerPubKey = bytesToHex(nobleGetPublicKey(keyBytes, true));\n\n const signerIndex = publicKeys.findIndex((pk) => pk === signerPubKey);\n if (signerIndex === -1) {\n throw new Error(\"Private key does not correspond to any signer in the multi-sig\");\n }\n\n const condition = { ...(tx.auth.spendingCondition as MultiSigSpendingCondition) };\n\n // Non-sequential: all signers sign the same presign-sighash independently\n if (isNonSequential(condition.hashMode)) {\n return signNonSequential(tx, condition, privateKey);\n }\n\n // Sequential: existing P2SH behavior\n return signSequential(tx, condition, privateKey, publicKeys, signerIndex);\n}\n\n/** Non-sequential signing: compute presign-sighash from initial tx, sign, append */\nfunction signNonSequential(\n tx: StacksTransaction,\n condition: MultiSigSpendingCondition,\n privateKey: string\n): StacksTransaction {\n const fields = [...condition.fields];\n const preSignHash = nonSequentialPreSignHash(tx);\n\n // Sign the presign-sighash directly\n const keyBytes = hexToBytes(privateKey).slice(0, 32);\n const sig = nobleSign(preSignHash, keyBytes, { lowS: true });\n const recoveryIdHex = intToHex(sig.recovery, 1);\n const nextSig = recoveryIdHex + sig.toCompactHex();\n\n fields.push({\n type: \"signature\",\n pubKeyEncoding: PubKeyEncoding.Compressed,\n data: nextSig,\n });\n\n const newCondition: MultiSigSpendingCondition = { ...condition, fields };\n const sigCount = fields.filter((f) => f.type === \"signature\").length;\n\n // Auto-finalize: non-sequential needs no pubkey gap-filling\n if (sigCount >= condition.signaturesRequired) {\n return {\n ...tx,\n auth: { ...tx.auth, spendingCondition: newCondition },\n };\n }\n\n return {\n ...tx,\n auth: { ...tx.auth, spendingCondition: newCondition },\n };\n}\n\n/** Sequential signing: existing P2SH behavior */\nfunction signSequential(\n tx: StacksTransaction,\n condition: MultiSigSpendingCondition,\n privateKey: string,\n publicKeys: string[],\n signerIndex: number\n): StacksTransaction {\n const fields = [...condition.fields];\n\n // Replay sighash through existing fields\n let curSigHash = initialSigHash(tx);\n for (const field of fields) {\n const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);\n curSigHash = sigHashPostSign(preSign, field.pubKeyEncoding, field.data);\n }\n\n // Fill intervening positions with pubkey fields\n for (let i = fields.length; i < signerIndex; i++) {\n const pubKeyField: TransactionAuthField = {\n type: \"publicKey\",\n pubKeyEncoding: PubKeyEncoding.Compressed,\n data: publicKeys[i]!,\n };\n fields.push(pubKeyField);\n const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);\n curSigHash = sigHashPostSign(preSign, pubKeyField.pubKeyEncoding, pubKeyField.data);\n }\n\n // Sign at signerIndex\n const { nextSig, nextSigHash } = nextSignature(\n curSigHash,\n AuthType.Standard,\n condition.fee,\n condition.nonce,\n privateKey\n );\n\n fields.push({\n type: \"signature\",\n pubKeyEncoding: PubKeyEncoding.Compressed,\n data: nextSig,\n });\n curSigHash = nextSigHash;\n\n const newCondition: MultiSigSpendingCondition = { ...condition, fields };\n\n // Count signatures so far\n const sigCount = fields.filter((f) => f.type === \"signature\").length;\n let finalCondition = newCondition;\n\n // Auto-finalize if enough signatures collected\n if (sigCount >= condition.signaturesRequired) {\n finalCondition = finalizeMultiSigCondition(newCondition, publicKeys, curSigHash);\n }\n\n return {\n ...tx,\n auth: {\n ...tx.auth,\n spendingCondition: finalCondition,\n },\n };\n}\n\n/** Sign one position of a multi-sig transaction with an account */\nexport async function signMultiSigWithAccount(\n tx: StacksTransaction,\n account: LocalAccount | CustomAccount,\n publicKeys: string[]\n): Promise<StacksTransaction> {\n const signerPubKey = account.publicKey;\n\n const signerIndex = publicKeys.findIndex((pk) => pk === signerPubKey);\n if (signerIndex === -1) {\n throw new Error(\"Account does not correspond to any signer in the multi-sig\");\n }\n\n const condition = { ...(tx.auth.spendingCondition as MultiSigSpendingCondition) };\n\n // Non-sequential: all signers sign the same presign-sighash independently\n if (isNonSequential(condition.hashMode)) {\n return signNonSequentialWithAccount(tx, condition, account);\n }\n\n // Sequential: existing behavior\n return signSequentialWithAccount(tx, condition, account, publicKeys, signerIndex);\n}\n\n/** Non-sequential signing with account */\nasync function signNonSequentialWithAccount(\n tx: StacksTransaction,\n condition: MultiSigSpendingCondition,\n account: LocalAccount | CustomAccount\n): Promise<StacksTransaction> {\n const fields = [...condition.fields];\n const preSignHash = nonSequentialPreSignHash(tx);\n\n const sigBytes = await account.sign(hexToBytes(preSignHash));\n const nextSig = bytesToHex(sigBytes);\n\n fields.push({\n type: \"signature\",\n pubKeyEncoding: PubKeyEncoding.Compressed,\n data: nextSig,\n });\n\n const newCondition: MultiSigSpendingCondition = { ...condition, fields };\n\n return {\n ...tx,\n auth: { ...tx.auth, spendingCondition: newCondition },\n };\n}\n\n/** Sequential signing with account */\nasync function signSequentialWithAccount(\n tx: StacksTransaction,\n condition: MultiSigSpendingCondition,\n account: LocalAccount | CustomAccount,\n publicKeys: string[],\n signerIndex: number\n): Promise<StacksTransaction> {\n const fields = [...condition.fields];\n\n // Replay sighash through existing fields\n let curSigHash = initialSigHash(tx);\n for (const field of fields) {\n const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);\n curSigHash = sigHashPostSign(preSign, field.pubKeyEncoding, field.data);\n }\n\n // Fill intervening positions with pubkey fields\n for (let i = fields.length; i < signerIndex; i++) {\n const pubKeyField: TransactionAuthField = {\n type: \"publicKey\",\n pubKeyEncoding: PubKeyEncoding.Compressed,\n data: publicKeys[i]!,\n };\n fields.push(pubKeyField);\n const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);\n curSigHash = sigHashPostSign(preSign, pubKeyField.pubKeyEncoding, pubKeyField.data);\n }\n\n // Sign at signerIndex\n const preSign = sigHashPreSign(curSigHash, AuthType.Standard, condition.fee, condition.nonce);\n const sigBytes = await account.sign(hexToBytes(preSign));\n const nextSig = bytesToHex(sigBytes);\n const nextSigHash = sigHashPostSign(preSign, PubKeyEncoding.Compressed, nextSig);\n\n fields.push({\n type: \"signature\",\n pubKeyEncoding: PubKeyEncoding.Compressed,\n data: nextSig,\n });\n curSigHash = nextSigHash;\n\n const newCondition: MultiSigSpendingCondition = { ...condition, fields };\n\n // Count signatures so far\n const sigCount = fields.filter((f) => f.type === \"signature\").length;\n let finalCondition = newCondition;\n\n // Auto-finalize if enough signatures collected\n if (sigCount >= condition.signaturesRequired) {\n finalCondition = finalizeMultiSigCondition(newCondition, publicKeys, curSigHash);\n }\n\n return {\n ...tx,\n auth: {\n ...tx.auth,\n spendingCondition: finalCondition,\n },\n };\n}\n\n/** Fill remaining slots with pubkey fields after all signatures are collected */\nexport function finalizeMultiSig(\n tx: StacksTransaction,\n publicKeys: string[]\n): StacksTransaction {\n const condition = tx.auth.spendingCondition as MultiSigSpendingCondition;\n\n // Non-sequential: no pubkey gap-filling needed\n if (isNonSequential(condition.hashMode)) {\n return tx;\n }\n\n const curSigHash = replayMultiSigSigHash(tx);\n const finalCondition = finalizeMultiSigCondition(condition, publicKeys, curSigHash);\n\n return {\n ...tx,\n auth: {\n ...tx.auth,\n spendingCondition: finalCondition,\n },\n };\n}\n\n/** Internal: finalize remaining pubkey slots (sequential only) */\nfunction finalizeMultiSigCondition(\n condition: MultiSigSpendingCondition,\n publicKeys: string[],\n curSigHash: string\n): MultiSigSpendingCondition {\n const fields = [...condition.fields];\n let sigHash = curSigHash;\n\n // Fill remaining positions\n for (let i = fields.length; i < publicKeys.length; i++) {\n const pubKeyField: TransactionAuthField = {\n type: \"publicKey\",\n pubKeyEncoding: PubKeyEncoding.Compressed,\n data: publicKeys[i]!,\n };\n fields.push(pubKeyField);\n const preSign = sigHashPreSign(sigHash, AuthType.Standard, condition.fee, condition.nonce);\n sigHash = sigHashPostSign(preSign, pubKeyField.pubKeyEncoding, pubKeyField.data);\n }\n\n return { ...condition, fields };\n}\n\n/** Combine independently-signed non-sequential multi-sig transactions */\nexport function combineMultiSigSignatures(\n baseTx: StacksTransaction,\n signedTxs: StacksTransaction[]\n): StacksTransaction {\n const condition = baseTx.auth.spendingCondition as MultiSigSpendingCondition;\n\n if (!isNonSequential(condition.hashMode)) {\n throw new Error(\"combineMultiSigSignatures only works with non-sequential hash modes (SIP-027)\");\n }\n\n // Collect all signature fields from each signed tx\n const seenSigs = new Set<string>();\n const signatures: TransactionAuthField[] = [];\n\n for (const stx of signedTxs) {\n const stxCondition = stx.auth.spendingCondition as MultiSigSpendingCondition;\n for (const field of stxCondition.fields) {\n if (field.type === \"signature\" && !seenSigs.has(field.data)) {\n seenSigs.add(field.data);\n signatures.push(field);\n }\n }\n }\n\n if (signatures.length === 0) {\n throw new Error(\"No signatures found in the provided transactions\");\n }\n\n const newCondition: MultiSigSpendingCondition = {\n ...condition,\n fields: signatures,\n };\n\n return {\n ...baseTx,\n auth: { ...baseTx.auth, spendingCondition: newCondition },\n };\n}\n",
6
- "import {\n getPublicKey as nobleGetPublicKey,\n sign,\n etc,\n} from \"@noble/secp256k1\";\nimport { hmac } from \"@noble/hashes/hmac.js\";\nimport { sha256 } from \"@noble/hashes/sha2.js\";\nimport {\n bytesToHex,\n hexToBytes,\n intToBytes,\n intToHex,\n concatBytes,\n} from \"../utils/encoding.ts\";\nimport { hashP2PKH, txidFromBytes } from \"../utils/hash.ts\";\nimport {\n AuthType,\n AddressHashMode,\n PubKeyEncoding,\n RECOVERABLE_ECDSA_SIG_LENGTH_BYTES,\n type SingleSigSpendingCondition,\n type SpendingCondition,\n type Authorization,\n type StandardAuthorization,\n type SponsoredAuthorization,\n} from \"./types.ts\";\n\n// Ensure sync signing is available\netc.hmacSha256Sync = (key: Uint8Array, ...msgs: Uint8Array[]) => {\n const h = hmac.create(sha256, key);\n msgs.forEach((msg) => h.update(msg));\n return h.digest();\n};\n\nconst EMPTY_SIG = bytesToHex(new Uint8Array(RECOVERABLE_ECDSA_SIG_LENGTH_BYTES));\n\nexport function createSingleSigSpendingCondition(\n publicKey: string,\n nonce: bigint,\n fee: bigint\n): SingleSigSpendingCondition {\n const pubKeyBytes = hexToBytes(publicKey);\n const signer = hashP2PKH(pubKeyBytes);\n const isCompressed = pubKeyBytes.length === 33;\n\n return {\n hashMode: AddressHashMode.P2PKH,\n signer,\n nonce,\n fee,\n keyEncoding: isCompressed ? PubKeyEncoding.Compressed : PubKeyEncoding.Uncompressed,\n signature: EMPTY_SIG,\n };\n}\n\nexport function createStandardAuth(\n spendingCondition: SpendingCondition\n): StandardAuthorization {\n return { authType: AuthType.Standard, spendingCondition };\n}\n\nexport function createSponsoredAuth(\n spendingCondition: SpendingCondition,\n sponsorSpendingCondition?: SpendingCondition\n): SponsoredAuthorization {\n return {\n authType: AuthType.Sponsored,\n spendingCondition,\n sponsorSpendingCondition: sponsorSpendingCondition ?? createSingleSigSpendingCondition(\n \"0\".repeat(66),\n 0n,\n 0n\n ),\n };\n}\n\nfunction clearCondition(condition: SpendingCondition): SpendingCondition {\n if (\"signature\" in condition) {\n return {\n ...condition,\n nonce: 0n,\n fee: 0n,\n signature: EMPTY_SIG,\n };\n }\n return {\n ...condition,\n nonce: 0n,\n fee: 0n,\n fields: [],\n };\n}\n\nexport function intoInitialSighashAuth(auth: Authorization): Authorization {\n if (auth.authType === AuthType.Standard) {\n return createStandardAuth(clearCondition(auth.spendingCondition));\n }\n return createSponsoredAuth(\n clearCondition(auth.spendingCondition),\n clearCondition(createSingleSigSpendingCondition(\"0\".repeat(66), 0n, 0n))\n );\n}\n\n/** Compute pre-sign sighash = sha512/256(prevSigHash + authType + fee + nonce) */\nexport function sigHashPreSign(\n curSigHash: string,\n authType: number,\n fee: bigint,\n nonce: bigint\n): string {\n const data = concatBytes(\n hexToBytes(curSigHash),\n new Uint8Array([authType]),\n intToBytes(fee, 8),\n intToBytes(nonce, 8)\n );\n return txidFromBytes(data);\n}\n\n/** Compute post-sign sighash = sha512/256(preSigHash + pubKeyEncoding + signature) */\nexport function sigHashPostSign(\n curSigHash: string,\n pubKeyEncoding: number,\n signature: string\n): string {\n const data = concatBytes(\n hexToBytes(curSigHash),\n new Uint8Array([pubKeyEncoding]),\n hexToBytes(signature)\n );\n return txidFromBytes(data);\n}\n\n/** Sign with private key and return VRS signature (recoveryId + r + s) */\nfunction signWithKey(privateKey: string, messageHash: string): string {\n const keyBytes = hexToBytes(privateKey).slice(0, 32);\n const sig = sign(messageHash, keyBytes, { lowS: true });\n const recoveryIdHex = intToHex(sig.recovery, 1);\n return recoveryIdHex + sig.toCompactHex();\n}\n\nexport function nextSignature(\n curSigHash: string,\n authType: number,\n fee: bigint,\n nonce: bigint,\n privateKey: string\n): { nextSig: string; nextSigHash: string } {\n const sigHashPre = sigHashPreSign(curSigHash, authType, fee, nonce);\n\n const keyBytes = hexToBytes(privateKey).slice(0, 32);\n const pubKey = nobleGetPublicKey(keyBytes, true);\n const isCompressed = pubKey.length === 33;\n const pubKeyEncoding = isCompressed\n ? PubKeyEncoding.Compressed\n : PubKeyEncoding.Uncompressed;\n\n const nextSig = signWithKey(privateKey, sigHashPre);\n const nextSigHash = sigHashPostSign(sigHashPre, pubKeyEncoding, nextSig);\n\n return { nextSig, nextSigHash };\n}\n",
7
- "import type { ClarityValue } from \"../clarity/types.ts\";\n\n// Auth types\nexport const AuthType = {\n Standard: 0x04,\n Sponsored: 0x05,\n} as const;\nexport type AuthType = (typeof AuthType)[keyof typeof AuthType];\n\n// Payload types\nexport const PayloadType = {\n TokenTransfer: 0x00,\n SmartContract: 0x01,\n ContractCall: 0x02,\n PoisonMicroblock: 0x03,\n Coinbase: 0x04,\n CoinbaseToAltRecipient: 0x05,\n VersionedSmartContract: 0x06,\n TenureChange: 0x07,\n NakamotoCoinbase: 0x08,\n} as const;\nexport type PayloadType = (typeof PayloadType)[keyof typeof PayloadType];\n\n// Clarity version\nexport const ClarityVersion = {\n Clarity1: 1,\n Clarity2: 2,\n Clarity3: 3,\n} as const;\nexport type ClarityVersion = (typeof ClarityVersion)[keyof typeof ClarityVersion];\n\n// Anchor mode (deprecated post-Nakamoto, but needed for wire format)\nexport const AnchorMode = {\n OnChainOnly: 0x01,\n OffChainOnly: 0x02,\n Any: 0x03,\n} as const;\nexport type AnchorMode = (typeof AnchorMode)[keyof typeof AnchorMode];\n\n// Post condition mode\nexport const PostConditionModeWire = {\n Allow: 0x01,\n Deny: 0x02,\n} as const;\nexport type PostConditionModeWire =\n (typeof PostConditionModeWire)[keyof typeof PostConditionModeWire];\n\n// Address hash modes\nexport const AddressHashMode = {\n P2PKH: 0x00,\n P2SH: 0x01,\n P2WPKH: 0x02,\n P2WSH: 0x03,\n P2SH_NonSequential: 0x05, // SIP-027\n P2WSH_P2SH_NonSequential: 0x07, // SIP-027\n} as const;\nexport type AddressHashMode = (typeof AddressHashMode)[keyof typeof AddressHashMode];\n\n// Pub key encoding\nexport const PubKeyEncoding = {\n Compressed: 0x00,\n Uncompressed: 0x01,\n} as const;\nexport type PubKeyEncoding = (typeof PubKeyEncoding)[keyof typeof PubKeyEncoding];\n\n// Fungible condition codes (wire format)\nexport const FungibleConditionCode = {\n Equal: 0x01,\n Greater: 0x02,\n GreaterEqual: 0x03,\n Less: 0x04,\n LessEqual: 0x05,\n} as const;\n\n// Non-fungible condition codes (wire format)\nexport const NonFungibleConditionCode = {\n Sends: 0x10,\n DoesNotSend: 0x11,\n} as const;\n\n// Post condition principal types\nexport const PostConditionPrincipalId = {\n Origin: 0x01,\n Standard: 0x02,\n Contract: 0x03,\n} as const;\n\n// Post condition asset types\nexport const AssetType = {\n STX: 0x00,\n Fungible: 0x01,\n NonFungible: 0x02,\n} as const;\n\n// Auth field types\nexport const AuthFieldType = {\n PublicKeyCompressed: 0x00,\n PublicKeyUncompressed: 0x01,\n SignatureCompressed: 0x02,\n SignatureUncompressed: 0x03,\n} as const;\n\nexport const RECOVERABLE_ECDSA_SIG_LENGTH_BYTES = 65;\nexport const MEMO_MAX_LENGTH_BYTES = 34;\nexport const MAX_STRING_LENGTH_BYTES = 128;\nexport const COINBASE_BYTES_LENGTH = 32;\nexport const VRF_PROOF_BYTES_LENGTH = 80;\nexport const MICROBLOCK_HEADER_BYTES_LENGTH = 132; // 1 + 2 + 32 + 32 + 65\n\n// Tenure change cause\nexport const TenureChangeCause = {\n BlockFound: 0x00,\n Extended: 0x01,\n} as const;\nexport type TenureChangeCause = (typeof TenureChangeCause)[keyof typeof TenureChangeCause];\n\n// Token transfer payload\nexport type TokenTransferPayload = {\n payloadType: typeof PayloadType.TokenTransfer;\n recipient: ClarityValue; // PrincipalCV\n amount: bigint;\n memo: string;\n};\n\n// Contract call payload\nexport type ContractCallPayload = {\n payloadType: typeof PayloadType.ContractCall;\n contractAddress: string;\n contractName: string;\n functionName: string;\n functionArgs: ClarityValue[];\n};\n\n// Smart contract deploy payload\nexport type SmartContractPayload = {\n payloadType: typeof PayloadType.SmartContract | typeof PayloadType.VersionedSmartContract;\n clarityVersion?: ClarityVersion;\n contractName: string;\n codeBody: string;\n};\n\n// Coinbase payload (appears in every pre-Nakamoto block)\nexport type CoinbasePayload = {\n payloadType: typeof PayloadType.Coinbase;\n coinbaseBuffer: string; // 32 bytes hex\n};\n\n// Coinbase to alt recipient payload\nexport type CoinbaseToAltRecipientPayload = {\n payloadType: typeof PayloadType.CoinbaseToAltRecipient;\n coinbaseBuffer: string; // 32 bytes hex\n recipient: ClarityValue; // PrincipalCV\n};\n\n// Poison microblock payload\nexport type PoisonMicroblockPayload = {\n payloadType: typeof PayloadType.PoisonMicroblock;\n header1: string; // 132 bytes hex (raw microblock header)\n header2: string; // 132 bytes hex (raw microblock header)\n};\n\n// Tenure change payload (Nakamoto)\nexport type TenureChangePayload = {\n payloadType: typeof PayloadType.TenureChange;\n tenureConsensusHash: string; // 20 bytes hex\n prevTenureConsensusHash: string; // 20 bytes hex\n burnViewConsensusHash: string; // 20 bytes hex\n previousTenureEnd: string; // 32 bytes hex\n previousTenureBlocks: number; // u32\n cause: TenureChangeCause;\n pubkeyHash: string; // 20 bytes hex\n};\n\n// Nakamoto coinbase payload\nexport type NakamotoCoinbasePayload = {\n payloadType: typeof PayloadType.NakamotoCoinbase;\n coinbaseBuffer: string; // 32 bytes hex\n recipient: ClarityValue | null; // Optional PrincipalCV\n vrfProof: string; // 80 bytes hex\n};\n\nexport type TransactionPayload =\n | TokenTransferPayload\n | ContractCallPayload\n | SmartContractPayload\n | CoinbasePayload\n | CoinbaseToAltRecipientPayload\n | PoisonMicroblockPayload\n | TenureChangePayload\n | NakamotoCoinbasePayload;\n\n// Spending condition\nexport type SingleSigSpendingCondition = {\n hashMode: typeof AddressHashMode.P2PKH | typeof AddressHashMode.P2WPKH;\n signer: string; // hash160 hex\n nonce: bigint;\n fee: bigint;\n keyEncoding: PubKeyEncoding;\n signature: string; // 65-byte recoverable sig hex\n};\n\nexport type TransactionAuthField = {\n pubKeyEncoding: PubKeyEncoding;\n type: \"publicKey\" | \"signature\";\n data: string; // hex\n};\n\nexport type MultiSigHashMode =\n | typeof AddressHashMode.P2SH\n | typeof AddressHashMode.P2WSH\n | typeof AddressHashMode.P2SH_NonSequential\n | typeof AddressHashMode.P2WSH_P2SH_NonSequential;\n\nexport type MultiSigSpendingCondition = {\n hashMode: MultiSigHashMode;\n signer: string;\n nonce: bigint;\n fee: bigint;\n fields: TransactionAuthField[];\n signaturesRequired: number;\n};\n\nexport type SpendingCondition = SingleSigSpendingCondition | MultiSigSpendingCondition;\n\nexport type StandardAuthorization = {\n authType: typeof AuthType.Standard;\n spendingCondition: SpendingCondition;\n};\n\nexport type SponsoredAuthorization = {\n authType: typeof AuthType.Sponsored;\n spendingCondition: SpendingCondition;\n sponsorSpendingCondition: SpendingCondition;\n};\n\nexport type Authorization = StandardAuthorization | SponsoredAuthorization;\n\n// Full transaction\nexport type StacksTransaction = {\n version: number;\n chainId: number;\n auth: Authorization;\n anchorMode: AnchorMode;\n postConditionMode: PostConditionModeWire;\n postConditions: PostConditionWire[];\n payload: TransactionPayload;\n};\n\n// Wire post condition types\nexport type PostConditionWire = StxPostConditionWire | FtPostConditionWire | NftPostConditionWire;\n\nexport type StxPostConditionWire = {\n type: \"stx\";\n principal: PostConditionPrincipalWire;\n conditionCode: number;\n amount: bigint;\n};\n\nexport type FtPostConditionWire = {\n type: \"ft\";\n principal: PostConditionPrincipalWire;\n asset: AssetInfoWire;\n conditionCode: number;\n amount: bigint;\n};\n\nexport type NftPostConditionWire = {\n type: \"nft\";\n principal: PostConditionPrincipalWire;\n asset: AssetInfoWire;\n conditionCode: number;\n assetId: ClarityValue;\n};\n\nexport type PostConditionPrincipalWire =\n | { type: \"origin\" }\n | { type: \"standard\"; address: string }\n | { type: \"contract\"; address: string; contractName: string };\n\nexport type AssetInfoWire = {\n address: string;\n contractName: string;\n assetName: string;\n};\n",
8
- "import {\n bytesToHex,\n hexToBytes,\n concatBytes,\n intToBytes,\n intToHex,\n utf8ToBytes,\n asciiToBytes,\n writeUInt32BE,\n writeUInt16BE,\n writeUInt8,\n} from \"../../utils/encoding.ts\";\nimport { c32addressDecode } from \"../../utils/c32.ts\";\nimport { serializeCVBytes } from \"../../clarity/serialize.ts\";\nimport {\n AuthType,\n PayloadType,\n PostConditionPrincipalId,\n AssetType,\n RECOVERABLE_ECDSA_SIG_LENGTH_BYTES,\n MEMO_MAX_LENGTH_BYTES,\n type StacksTransaction,\n type Authorization,\n type SpendingCondition,\n type SingleSigSpendingCondition,\n type MultiSigSpendingCondition,\n type TransactionPayload,\n type PostConditionWire,\n type PostConditionPrincipalWire,\n type AssetInfoWire,\n type TransactionAuthField,\n type AuthFieldType,\n type CoinbasePayload,\n type CoinbaseToAltRecipientPayload,\n type PoisonMicroblockPayload,\n type TenureChangePayload as TenureChangePayloadType,\n type NakamotoCoinbasePayload,\n} from \"../types.ts\";\n\n// Address serialization: version (1 byte) + hash160 (20 bytes)\nfunction serializeAddress(c32Address: string): Uint8Array {\n const [version, hash160] = c32addressDecode(c32Address);\n return concatBytes(new Uint8Array([version]), hexToBytes(hash160));\n}\n\n// LP string: length prefix (n bytes) + content bytes\nfunction serializeLPString(str: string, prefixBytes = 1): Uint8Array {\n const content = utf8ToBytes(str);\n const prefix = hexToBytes(intToHex(content.byteLength, prefixBytes));\n return concatBytes(prefix, content);\n}\n\n// LP string for code body (4-byte prefix)\nfunction serializeLPStringLong(str: string): Uint8Array {\n return serializeLPString(str, 4);\n}\n\n// Memo: padded to MEMO_MAX_LENGTH_BYTES\nfunction serializeMemo(memo: string): Uint8Array {\n const content = asciiToBytes(memo);\n const padded = new Uint8Array(MEMO_MAX_LENGTH_BYTES);\n padded.set(content.slice(0, MEMO_MAX_LENGTH_BYTES));\n return concatBytes(writeUInt8(content.length), padded);\n}\n\nfunction serializeSpendingCondition(condition: SpendingCondition): Uint8Array {\n const parts: Uint8Array[] = [\n writeUInt8(condition.hashMode),\n hexToBytes(condition.signer), // 20 bytes\n intToBytes(condition.nonce, 8),\n intToBytes(condition.fee, 8),\n ];\n\n if (\"signature\" in condition) {\n // Single sig\n const sc = condition as SingleSigSpendingCondition;\n parts.push(writeUInt8(sc.keyEncoding));\n parts.push(hexToBytes(sc.signature)); // 65 bytes\n } else {\n // Multi sig\n const mc = condition as MultiSigSpendingCondition;\n // Fields as LP list\n parts.push(writeUInt32BE(mc.fields.length));\n for (const field of mc.fields) {\n parts.push(serializeAuthField(field));\n }\n parts.push(writeUInt16BE(mc.signaturesRequired));\n }\n\n return concatBytes(...parts);\n}\n\nfunction serializeAuthField(field: TransactionAuthField): Uint8Array {\n if (field.type === \"publicKey\") {\n const typeId = field.pubKeyEncoding === 0x00 ? 0x00 : 0x01;\n return concatBytes(writeUInt8(typeId), hexToBytes(field.data));\n } else {\n const typeId = field.pubKeyEncoding === 0x00 ? 0x02 : 0x03;\n return concatBytes(writeUInt8(typeId), hexToBytes(field.data));\n }\n}\n\nfunction serializeAuthorization(auth: Authorization): Uint8Array {\n const parts: Uint8Array[] = [writeUInt8(auth.authType)];\n parts.push(serializeSpendingCondition(auth.spendingCondition));\n if (auth.authType === AuthType.Sponsored) {\n parts.push(serializeSpendingCondition(auth.sponsorSpendingCondition));\n }\n return concatBytes(...parts);\n}\n\nfunction serializePrincipal(principal: PostConditionPrincipalWire): Uint8Array {\n switch (principal.type) {\n case \"origin\":\n return writeUInt8(PostConditionPrincipalId.Origin);\n case \"standard\":\n return concatBytes(\n writeUInt8(PostConditionPrincipalId.Standard),\n serializeAddress(principal.address)\n );\n case \"contract\":\n return concatBytes(\n writeUInt8(PostConditionPrincipalId.Contract),\n serializeAddress(principal.address),\n serializeLPString(principal.contractName)\n );\n }\n}\n\nfunction serializeAssetInfo(asset: AssetInfoWire): Uint8Array {\n return concatBytes(\n serializeAddress(asset.address),\n serializeLPString(asset.contractName),\n serializeLPString(asset.assetName)\n );\n}\n\nfunction serializePostCondition(pc: PostConditionWire): Uint8Array {\n const parts: Uint8Array[] = [serializePrincipal(pc.principal)];\n\n switch (pc.type) {\n case \"stx\":\n parts.push(writeUInt8(AssetType.STX));\n parts.push(writeUInt8(pc.conditionCode));\n parts.push(intToBytes(pc.amount, 8));\n break;\n case \"ft\":\n parts.push(writeUInt8(AssetType.Fungible));\n parts.push(serializeAssetInfo(pc.asset));\n parts.push(writeUInt8(pc.conditionCode));\n parts.push(intToBytes(pc.amount, 8));\n break;\n case \"nft\":\n parts.push(writeUInt8(AssetType.NonFungible));\n parts.push(serializeAssetInfo(pc.asset));\n parts.push(serializeCVBytes(pc.assetId));\n parts.push(writeUInt8(pc.conditionCode));\n break;\n }\n\n return concatBytes(...parts);\n}\n\nfunction serializePostConditions(pcs: PostConditionWire[]): Uint8Array {\n const parts: Uint8Array[] = [writeUInt32BE(pcs.length)];\n for (const pc of pcs) {\n parts.push(serializePostCondition(pc));\n }\n return concatBytes(...parts);\n}\n\nexport function serializePayload(payload: TransactionPayload): Uint8Array {\n const parts: Uint8Array[] = [writeUInt8(payload.payloadType)];\n\n switch (payload.payloadType) {\n case PayloadType.TokenTransfer:\n parts.push(serializeCVBytes(payload.recipient));\n parts.push(intToBytes(payload.amount, 8));\n parts.push(serializeMemo(payload.memo));\n break;\n\n case PayloadType.ContractCall:\n parts.push(serializeAddress(payload.contractAddress));\n parts.push(serializeLPString(payload.contractName));\n parts.push(serializeLPString(payload.functionName));\n parts.push(writeUInt32BE(payload.functionArgs.length));\n for (const arg of payload.functionArgs) {\n parts.push(serializeCVBytes(arg));\n }\n break;\n\n case PayloadType.SmartContract:\n parts.push(serializeLPString(payload.contractName));\n parts.push(serializeLPStringLong(payload.codeBody));\n break;\n\n case PayloadType.VersionedSmartContract:\n parts.push(writeUInt8(payload.clarityVersion ?? 2));\n parts.push(serializeLPString(payload.contractName));\n parts.push(serializeLPStringLong(payload.codeBody));\n break;\n\n case PayloadType.Coinbase:\n parts.push(hexToBytes((payload as CoinbasePayload).coinbaseBuffer));\n break;\n\n case PayloadType.CoinbaseToAltRecipient: {\n const cbAlt = payload as CoinbaseToAltRecipientPayload;\n parts.push(hexToBytes(cbAlt.coinbaseBuffer));\n parts.push(serializeCVBytes(cbAlt.recipient));\n break;\n }\n\n case PayloadType.PoisonMicroblock: {\n const pm = payload as PoisonMicroblockPayload;\n parts.push(hexToBytes(pm.header1));\n parts.push(hexToBytes(pm.header2));\n break;\n }\n\n case PayloadType.TenureChange: {\n const tc = payload as TenureChangePayloadType;\n parts.push(hexToBytes(tc.tenureConsensusHash));\n parts.push(hexToBytes(tc.prevTenureConsensusHash));\n parts.push(hexToBytes(tc.burnViewConsensusHash));\n parts.push(hexToBytes(tc.previousTenureEnd));\n parts.push(writeUInt32BE(tc.previousTenureBlocks));\n parts.push(writeUInt8(tc.cause));\n parts.push(hexToBytes(tc.pubkeyHash));\n break;\n }\n\n case PayloadType.NakamotoCoinbase: {\n const nc = payload as NakamotoCoinbasePayload;\n parts.push(hexToBytes(nc.coinbaseBuffer));\n if (nc.recipient) {\n parts.push(serializeCVBytes({ type: \"some\", value: nc.recipient }));\n } else {\n parts.push(serializeCVBytes({ type: \"none\" }));\n }\n parts.push(hexToBytes(nc.vrfProof));\n break;\n }\n }\n\n return concatBytes(...parts);\n}\n\nexport function serializeTransaction(tx: StacksTransaction): Uint8Array {\n return concatBytes(\n writeUInt8(tx.version),\n writeUInt32BE(tx.chainId),\n serializeAuthorization(tx.auth),\n writeUInt8(tx.anchorMode),\n writeUInt8(tx.postConditionMode),\n serializePostConditions(tx.postConditions),\n serializePayload(tx.payload)\n );\n}\n\nexport function serializeTransactionHex(tx: StacksTransaction): string {\n return bytesToHex(serializeTransaction(tx));\n}\n"
9
- ],
10
- "mappings": ";AAGO,IAHP;;;ACIO,IAJP;AAKqB,IAArB;AACuB,IAAvB;;;ACHO,IAAM,WAAW;AAAA,EACtB,UAAU;AAAA,EACV,WAAW;AACb;AAIO,IAAM,cAAc;AAAA,EACzB,eAAe;AAAA,EACf,eAAe;AAAA,EACf,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB,cAAc;AAAA,EACd,kBAAkB;AACpB;AAIO,IAAM,iBAAiB;AAAA,EAC5B,UAAU;AAAA,EACV,U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EACnB,MAAM,YAAY,OAAO,KAAK;AAAA,EAE9B,IAAI,CAAC,gBAAgB,UAAU,QAAQ,GAAG;AAAA,IACxC,MAAM,IAAI,MAAM,+EAA+E;AAAA,EACjG;AAAA,EAGA,MAAM,WAAW,IAAI;AAAA,EACrB,MAAM,aAAqC,CAAC;AAAA,EAE5C,WAAW,OAAO,WAAW;AAAA,IAC3B,MAAM,eAAe,IAAI,KAAK;AAAA,IAC9B,WAAW,SAAS,aAAa,QAAQ;AAAA,MACvC,IAAI,MAAM,SAAS,eAAe,CAAC,SAAS,IAAI,MAAM,IAAI,GAAG;AAAA,QAC3D,SAAS,IAAI,MAAM,IAAI;AAAA,QACvB,WAAW,KAAK,KAAK;AAAA,MACvB;AAAA,IACF;AAAA,EACF;AAAA,EAEA,IAAI,WAAW,WAAW,GAAG;AAAA,IAC3B,MAAM,IAAI,MAAM,kDAAkD;AAAA,EACpE;AAAA,EAEA,MAAM,eAA0C;AAAA,OAC3C;AAAA,IACH,QAAQ;AAAA,EACV;AAAA,EAEA,OAAO;AAAA,OACF;AAAA,IACH,MAAM,KAAK,OAAO,MAAM,mBAAmB,aAAa;AAAA,EAC1D;AAAA;",
11
- "debugId": "5A8F9D28AE3FE53E64756E2164756E21",
12
- "names": []
13
- }
@@ -1,11 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/clarity/deserialize.ts", "../src/clarity/values.ts"],
4
- "sourcesContent": [
5
- "import {\n hexToBytes,\n bytesToHex,\n bytesToAscii,\n bytesToUtf8,\n bytesToTwosBigInt,\n without0x,\n} from \"../utils/encoding.ts\";\nimport { c32address } from \"../utils/c32.ts\";\nimport {\n clarityTypeFromByte,\n type ClarityValue,\n} from \"./types.ts\";\nimport {\n intCV,\n uintCV,\n trueCV,\n falseCV,\n bufferCV,\n noneCV,\n someCV,\n responseOkCV,\n responseErrorCV,\n standardPrincipalCV,\n contractPrincipalCV,\n listCV,\n tupleCV,\n stringAsciiCV,\n stringUtf8CV,\n} from \"./values.ts\";\n\nclass BytesReader {\n private data: Uint8Array;\n private offset = 0;\n\n constructor(data: Uint8Array) {\n this.data = data;\n }\n\n readUInt8(): number {\n const value = this.data[this.offset]!;\n this.offset += 1;\n return value;\n }\n\n readUInt32BE(): number {\n const value =\n ((this.data[this.offset]! << 24) |\n (this.data[this.offset + 1]! << 16) |\n (this.data[this.offset + 2]! << 8) |\n this.data[this.offset + 3]!) >>>\n 0;\n this.offset += 4;\n return value;\n }\n\n readBytes(length: number): Uint8Array {\n const slice = this.data.slice(this.offset, this.offset + length);\n this.offset += length;\n return slice;\n }\n}\n\nfunction readAddress(reader: BytesReader): string {\n const version = reader.readUInt8();\n const hash160 = bytesToHex(reader.readBytes(20));\n return c32address(version, hash160);\n}\n\nfunction readLPString(reader: BytesReader, prefixBytes = 1): string {\n let length = 0;\n for (let i = 0; i < prefixBytes; i++) {\n length = (length << 8) | reader.readUInt8();\n }\n return bytesToUtf8(reader.readBytes(length));\n}\n\nfunction readCV(reader: BytesReader): ClarityValue {\n const typeByte = reader.readUInt8();\n const type = clarityTypeFromByte(typeByte);\n\n switch (type) {\n case \"int\":\n return intCV(bytesToTwosBigInt(reader.readBytes(16)));\n\n case \"uint\":\n return uintCV(reader.readBytes(16));\n\n case \"true\":\n return trueCV();\n\n case \"false\":\n return falseCV();\n\n case \"buffer\": {\n const len = reader.readUInt32BE();\n return bufferCV(reader.readBytes(len));\n }\n\n case \"none\":\n return noneCV();\n\n case \"some\":\n return someCV(readCV(reader));\n\n case \"ok\":\n return responseOkCV(readCV(reader));\n\n case \"err\":\n return responseErrorCV(readCV(reader));\n\n case \"address\":\n return standardPrincipalCV(readAddress(reader));\n\n case \"contract\": {\n const addr = readAddress(reader);\n const name = readLPString(reader);\n return contractPrincipalCV(addr, name);\n }\n\n case \"list\": {\n const len = reader.readUInt32BE();\n const items: ClarityValue[] = [];\n for (let i = 0; i < len; i++) {\n items.push(readCV(reader));\n }\n return listCV(items);\n }\n\n case \"tuple\": {\n const len = reader.readUInt32BE();\n const data: Record<string, ClarityValue> = {};\n for (let i = 0; i < len; i++) {\n const key = readLPString(reader);\n data[key] = readCV(reader);\n }\n return tupleCV(data);\n }\n\n case \"ascii\": {\n const len = reader.readUInt32BE();\n return stringAsciiCV(bytesToAscii(reader.readBytes(len)));\n }\n\n case \"utf8\": {\n const len = reader.readUInt32BE();\n return stringUtf8CV(bytesToUtf8(reader.readBytes(len)));\n }\n\n default:\n throw new Error(`Cannot deserialize unknown clarity type: ${type}`);\n }\n}\n\nexport function deserializeCVBytes<T extends ClarityValue = ClarityValue>(\n input: Uint8Array | string\n): T {\n const bytes =\n typeof input === \"string\" ? hexToBytes(without0x(input)) : input;\n return readCV(new BytesReader(bytes)) as T;\n}\n\nexport function deserializeCV<T extends ClarityValue = ClarityValue>(\n input: Uint8Array | string\n): T {\n return deserializeCVBytes(input);\n}\n",
6
- "import { c32address, c32addressDecode } from \"../utils/c32.ts\";\nimport {\n bytesToHex,\n hexToBytes,\n asciiToBytes,\n utf8ToBytes,\n intToBigInt,\n bytesToTwosBigInt,\n type IntegerType,\n} from \"../utils/encoding.ts\";\nimport { isClarityName } from \"../utils/address.ts\";\nimport type {\n IntCV,\n UIntCV,\n BooleanCV,\n TrueCV,\n FalseCV,\n BufferCV,\n NoneCV,\n SomeCV,\n OptionalCV,\n ResponseOkCV,\n ResponseErrorCV,\n StandardPrincipalCV,\n ContractPrincipalCV,\n ListCV,\n TupleCV,\n TupleData,\n StringAsciiCV,\n StringUtf8CV,\n ClarityValue,\n} from \"./types.ts\";\nimport { serializeCVBytes } from \"./serialize.ts\";\nimport { deserializeCVBytes } from \"./deserialize.ts\";\n\nconst MAX_U128 = BigInt(\"0xffffffffffffffffffffffffffffffff\");\nconst MIN_I128 = BigInt(\"-170141183460469231731687303715884105728\");\nconst MAX_I128 = BigInt(\"0x7fffffffffffffffffffffffffffffff\");\n\n// Primitives\n\nexport function intCV(value: IntegerType): IntCV {\n if (typeof value === \"string\" && value.toLowerCase().startsWith(\"0x\")) {\n value = bytesToTwosBigInt(hexToBytes(value));\n }\n if (value instanceof Uint8Array) value = bytesToTwosBigInt(value);\n const n = intToBigInt(value);\n if (n > MAX_I128) throw new RangeError(`Int exceeds max i128: ${MAX_I128}`);\n if (n < MIN_I128) throw new RangeError(`Int below min i128: ${MIN_I128}`);\n return { type: \"int\", value: n };\n}\n\nexport function uintCV(value: IntegerType): UIntCV {\n const n = intToBigInt(value);\n if (n < 0n) throw new RangeError(\"Cannot construct unsigned int from negative value\");\n if (n > MAX_U128) throw new RangeError(`UInt exceeds max u128: ${MAX_U128}`);\n return { type: \"uint\", value: n };\n}\n\nexport const trueCV = (): TrueCV => ({ type: \"true\" });\nexport const falseCV = (): FalseCV => ({ type: \"false\" });\nexport const boolCV = (v: boolean): BooleanCV => (v ? trueCV() : falseCV());\n\nexport function bufferCV(buffer: Uint8Array): BufferCV {\n if (buffer.byteLength > 1_048_576) {\n throw new Error(\"Buffer exceeds max size of 1MB\");\n }\n return { type: \"buffer\", value: bytesToHex(buffer) };\n}\n\nexport function standardPrincipalCV(address: string): StandardPrincipalCV {\n // Validate by decoding\n const [version, hash160] = c32addressDecode(address);\n const normalized = c32address(version, hash160);\n return { type: \"address\", value: normalized };\n}\n\nexport function contractPrincipalCV(\n address: string,\n contractName: string\n): ContractPrincipalCV {\n const [version, hash160] = c32addressDecode(address);\n const normalized = c32address(version, hash160);\n if (utf8ToBytes(contractName).byteLength >= 128) {\n throw new Error(\"Contract name must be less than 128 bytes\");\n }\n return { type: \"contract\", value: `${normalized}.${contractName}` };\n}\n\nexport function noneCV(): NoneCV {\n return { type: \"none\" };\n}\n\nexport function someCV(value: ClarityValue): SomeCV {\n return { type: \"some\", value };\n}\n\nexport function responseOkCV(value: ClarityValue): ResponseOkCV {\n return { type: \"ok\", value };\n}\n\nexport function responseErrorCV(value: ClarityValue): ResponseErrorCV {\n return { type: \"err\", value };\n}\n\nexport function listCV(values: ClarityValue[]): ListCV {\n return { type: \"list\", value: values };\n}\n\nexport function tupleCV(data: TupleData): TupleCV {\n for (const key in data) {\n if (!isClarityName(key)) {\n throw new Error(`\"${key}\" is not a valid Clarity name`);\n }\n }\n return { type: \"tuple\", value: data };\n}\n\nexport function stringAsciiCV(value: string): StringAsciiCV {\n return { type: \"ascii\", value };\n}\n\nexport function stringUtf8CV(value: string): StringUtf8CV {\n return { type: \"utf8\", value };\n}\n\n// Cl namespace — clean API\n\nexport const Cl: {\n readonly int: (value: IntegerType) => IntCV;\n readonly uint: (value: IntegerType) => UIntCV;\n readonly bool: (v: boolean) => BooleanCV;\n principal(address: string): StandardPrincipalCV | ContractPrincipalCV;\n address(address: string): StandardPrincipalCV | ContractPrincipalCV;\n readonly contractPrincipal: (address: string, contractName: string) => ContractPrincipalCV;\n readonly standardPrincipal: (address: string) => StandardPrincipalCV;\n readonly buffer: (buffer: Uint8Array) => BufferCV;\n readonly bufferFromHex: (hex: string) => BufferCV;\n readonly bufferFromAscii: (ascii: string) => BufferCV;\n readonly bufferFromUtf8: (utf8: string) => BufferCV;\n readonly none: () => NoneCV;\n readonly some: (value: ClarityValue) => SomeCV;\n readonly ok: (value: ClarityValue) => ResponseOkCV;\n readonly error: (value: ClarityValue) => ResponseErrorCV;\n readonly list: (values: ClarityValue[]) => ListCV;\n readonly tuple: (data: TupleData) => TupleCV;\n readonly stringAscii: (value: string) => StringAsciiCV;\n readonly stringUtf8: (value: string) => StringUtf8CV;\n serialize(value: ClarityValue): string;\n readonly deserialize: (bytes: Uint8Array) => ClarityValue;\n} = {\n int: intCV,\n uint: uintCV,\n bool: boolCV,\n principal(address: string): StandardPrincipalCV | ContractPrincipalCV {\n const [addr, name] = address.split(\".\");\n if (!addr) throw new Error(\"Invalid principal address\");\n return name ? contractPrincipalCV(addr, name) : standardPrincipalCV(addr);\n },\n address(address: string): StandardPrincipalCV | ContractPrincipalCV {\n return Cl.principal(address);\n },\n contractPrincipal: contractPrincipalCV,\n standardPrincipal: standardPrincipalCV,\n buffer: bufferCV,\n bufferFromHex: (hex: string): BufferCV => bufferCV(hexToBytes(hex)),\n bufferFromAscii: (ascii: string): BufferCV => bufferCV(asciiToBytes(ascii)),\n bufferFromUtf8: (utf8: string): BufferCV => bufferCV(utf8ToBytes(utf8)),\n none: noneCV,\n some: someCV,\n ok: responseOkCV,\n error: responseErrorCV,\n list: listCV,\n tuple: tupleCV,\n stringAscii: stringAsciiCV,\n stringUtf8: stringUtf8CV,\n serialize(value: ClarityValue): string {\n return bytesToHex(serializeCVBytes(value));\n },\n deserialize: deserializeCVBytes,\n} as const;\n"
7
- ],
8
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,YAAY;AAAA,EACR;AAAA,EACA,SAAS;AAAA,EAEjB,WAAW,CAAC,MAAkB;AAAA,IAC5B,KAAK,OAAO;AAAA;AAAA,EAGd,SAAS,GAAW;AAAA,IAClB,MAAM,QAAQ,KAAK,KAAK,KAAK;AAAA,IAC7B,KAAK,UAAU;AAAA,IACf,OAAO;AAAA;AAAA,EAGT,YAAY,GAAW;AAAA,IACrB,MAAM,SACF,KAAK,KAAK,KAAK,WAAY,KAC1B,KAAK,KAAK,KAAK,SAAS,MAAO,KAC/B,KAAK,KAAK,KAAK,SAAS,MAAO,IAChC,KAAK,KAAK,KAAK,SAAS,QAC1B;AAAA,IACF,KAAK,UAAU;AAAA,IACf,OAAO;AAAA;AAAA,EAGT,SAAS,CAAC,QAA4B;AAAA,IACpC,MAAM,QAAQ,KAAK,KAAK,MAAM,KAAK,QAAQ,KAAK,SAAS,MAAM;AAAA,IAC/D,KAAK,UAAU;AAAA,IACf,OAAO;AAAA;AAEX;AAEA,SAAS,WAAW,CAAC,QAA6B;AAAA,EAChD,MAAM,UAAU,OAAO,UAAU;AAAA,EACjC,MAAM,UAAU,WAAW,OAAO,UAAU,EAAE,CAAC;AAAA,EAC/C,OAAO,WAAW,SAAS,OAAO;AAAA;AAGpC,SAAS,YAAY,CAAC,QAAqB,cAAc,GAAW;AAAA,EAClE,IAAI,SAAS;AAAA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iB,CAAC,UAA4B,SAAS,aAAa,KAAK,CAAC;AAAA,EAC1E,gBAAgB,CAAC,SAA2B,SAAS,YAAY,IAAI,CAAC;AAAA,EACtE,MAAM;AAAA,EACN,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,SAAS,CAAC,OAA6B;AAAA,IACrC,OAAO,WAAW,iBAAiB,KAAK,CAAC;AAAA;AAAA,EAE3C,aAAa;AACf;",
9
- "debugId": "DB2BCD6778DE48E964756E2164756E21",
10
- "names": []
11
- }
@@ -1,23 +0,0 @@
1
- import { createRequire } from "node:module";
2
- var __create = Object.create;
3
- var __getProtoOf = Object.getPrototypeOf;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __toESM = (mod, isNodeMode, target) => {
8
- target = mod != null ? __create(__getProtoOf(mod)) : {};
9
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
- for (let key of __getOwnPropNames(mod))
11
- if (!__hasOwnProp.call(to, key))
12
- __defProp(to, key, {
13
- get: () => mod[key],
14
- enumerable: true
15
- });
16
- return to;
17
- };
18
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
19
-
20
- export { __toESM, __require };
21
-
22
- //# debugId=3D8B6E2927A7752164756E2164756E21
23
- //# sourceMappingURL=stacks-njvyj3ab.js.map
@@ -1,9 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [
5
- ],
6
- "mappings": "",
7
- "debugId": "3D8B6E2927A7752164756E2164756E21",
8
- "names": []
9
- }