@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,285 +0,0 @@
1
- import {
2
- Cl
3
- } from "./stacks-j2cy7qtt.js";
4
- import {
5
- txidFromBytes
6
- } from "./stacks-bycy6t9k.js";
7
- import {
8
- parseContractId
9
- } from "./stacks-gjvbq6w7.js";
10
- import {
11
- bytesToHex,
12
- hexToBytes,
13
- intToBigInt
14
- } from "./stacks-nqytwfcc.js";
15
- import {
16
- AnchorMode,
17
- AuthType,
18
- FungibleConditionCode,
19
- NonFungibleConditionCode,
20
- PayloadType,
21
- PostConditionModeWire,
22
- PubKeyEncoding,
23
- createMultiSigSpendingCondition,
24
- createSingleSigSpendingCondition,
25
- createSponsoredAuth,
26
- createStandardAuth,
27
- intoInitialSighashAuth,
28
- nextSignature,
29
- replayMultiSigSigHash,
30
- serializeTransaction,
31
- sigHashPostSign,
32
- sigHashPreSign
33
- } from "./stacks-xtz0n62y.js";
34
-
35
- // src/transactions/signer.ts
36
- function txid(tx) {
37
- return txidFromBytes(serializeTransaction(tx));
38
- }
39
- function signBegin(tx) {
40
- const cleared = {
41
- ...tx,
42
- auth: intoInitialSighashAuth(tx.auth)
43
- };
44
- return txid(cleared);
45
- }
46
- function signTransaction(tx, privateKey) {
47
- const sigHash = signBegin(tx);
48
- const condition = tx.auth.spendingCondition;
49
- const { nextSig, nextSigHash } = nextSignature(sigHash, AuthType.Standard, condition.fee, condition.nonce, privateKey);
50
- return {
51
- ...tx,
52
- auth: {
53
- ...tx.auth,
54
- spendingCondition: {
55
- ...condition,
56
- signature: nextSig
57
- }
58
- }
59
- };
60
- }
61
- async function signTransactionWithAccount(tx, account) {
62
- const sigHash = signBegin(tx);
63
- const condition = tx.auth.spendingCondition;
64
- const sigHashPre = sigHashPreSign(sigHash, AuthType.Standard, condition.fee, condition.nonce);
65
- const sigBytes = await account.sign(hexToBytes(sigHashPre));
66
- const nextSig = bytesToHex(sigBytes);
67
- const pubKeyBytes = hexToBytes(account.publicKey);
68
- const pubKeyEncoding = pubKeyBytes.length === 33 ? PubKeyEncoding.Compressed : PubKeyEncoding.Uncompressed;
69
- return {
70
- ...tx,
71
- auth: {
72
- ...tx.auth,
73
- spendingCondition: {
74
- ...condition,
75
- signature: nextSig
76
- }
77
- }
78
- };
79
- }
80
- function getTransactionId(tx) {
81
- return txid(tx);
82
- }
83
- function getOriginSigHash(tx) {
84
- const condition = tx.auth.spendingCondition;
85
- if ("fields" in condition) {
86
- return replayMultiSigSigHash(tx);
87
- }
88
- const initialSigHash = signBegin(tx);
89
- const sc = condition;
90
- const preSign = sigHashPreSign(initialSigHash, AuthType.Standard, sc.fee, sc.nonce);
91
- return sigHashPostSign(preSign, sc.keyEncoding, sc.signature);
92
- }
93
- function signSponsor(tx, privateKey) {
94
- if (tx.auth.authType !== AuthType.Sponsored) {
95
- throw new Error("Transaction must be sponsored");
96
- }
97
- const auth = tx.auth;
98
- const sponsorCondition = auth.sponsorSpendingCondition;
99
- const originSigHash = getOriginSigHash(tx);
100
- const { nextSig } = nextSignature(originSigHash, AuthType.Sponsored, sponsorCondition.fee, sponsorCondition.nonce, privateKey);
101
- return {
102
- ...tx,
103
- auth: {
104
- ...auth,
105
- sponsorSpendingCondition: {
106
- ...sponsorCondition,
107
- signature: nextSig
108
- }
109
- }
110
- };
111
- }
112
- async function signSponsorWithAccount(tx, account) {
113
- if (tx.auth.authType !== AuthType.Sponsored) {
114
- throw new Error("Transaction must be sponsored");
115
- }
116
- const auth = tx.auth;
117
- const sponsorCondition = auth.sponsorSpendingCondition;
118
- const originSigHash = getOriginSigHash(tx);
119
- const sigHashPre = sigHashPreSign(originSigHash, AuthType.Sponsored, sponsorCondition.fee, sponsorCondition.nonce);
120
- const sigBytes = await account.sign(hexToBytes(sigHashPre));
121
- const nextSig = bytesToHex(sigBytes);
122
- return {
123
- ...tx,
124
- auth: {
125
- ...auth,
126
- sponsorSpendingCondition: {
127
- ...sponsorCondition,
128
- signature: nextSig
129
- }
130
- }
131
- };
132
- }
133
-
134
- // src/transactions/build.ts
135
- function resolvePcMode(mode) {
136
- return mode === "allow" ? PostConditionModeWire.Allow : PostConditionModeWire.Deny;
137
- }
138
- function convertPostConditions(pcs) {
139
- if (!pcs || pcs.length === 0)
140
- return [];
141
- return pcs.map(convertPostCondition);
142
- }
143
- function resolvePrincipal(address) {
144
- if (address === "origin")
145
- return { type: "origin" };
146
- const [addr, name] = address.split(".");
147
- if (name) {
148
- return { type: "contract", address: addr, contractName: name };
149
- }
150
- return { type: "standard", address: addr };
151
- }
152
- var FUNGIBLE_CODE_MAP = {
153
- eq: FungibleConditionCode.Equal,
154
- gt: FungibleConditionCode.Greater,
155
- gte: FungibleConditionCode.GreaterEqual,
156
- lt: FungibleConditionCode.Less,
157
- lte: FungibleConditionCode.LessEqual
158
- };
159
- function convertPostCondition(pc) {
160
- switch (pc.type) {
161
- case "stx-postcondition":
162
- return {
163
- type: "stx",
164
- principal: resolvePrincipal(pc.address),
165
- conditionCode: FUNGIBLE_CODE_MAP[pc.condition],
166
- amount: intToBigInt(pc.amount)
167
- };
168
- case "ft-postcondition": {
169
- const [contractId, tokenName] = pc.asset.split("::");
170
- const [addr, name] = parseContractId(contractId);
171
- return {
172
- type: "ft",
173
- principal: resolvePrincipal(pc.address),
174
- asset: { address: addr, contractName: name, assetName: tokenName },
175
- conditionCode: FUNGIBLE_CODE_MAP[pc.condition],
176
- amount: intToBigInt(pc.amount)
177
- };
178
- }
179
- case "nft-postcondition": {
180
- const [contractId, tokenName] = pc.asset.split("::");
181
- const [addr, name] = parseContractId(contractId);
182
- return {
183
- type: "nft",
184
- principal: resolvePrincipal(pc.address),
185
- asset: { address: addr, contractName: name, assetName: tokenName },
186
- conditionCode: pc.condition === "sent" ? NonFungibleConditionCode.Sends : NonFungibleConditionCode.DoesNotSend,
187
- assetId: pc.assetId
188
- };
189
- }
190
- }
191
- }
192
- function resolveSpendingCondition(opts, nonce, fee) {
193
- if (opts.publicKeys) {
194
- return createMultiSigSpendingCondition(opts.publicKeys, opts.signaturesRequired, nonce, fee, opts.hashMode);
195
- }
196
- return createSingleSigSpendingCondition(opts.publicKey, nonce, fee);
197
- }
198
- function resolveAuth(spendingCondition, sponsored) {
199
- return sponsored ? createSponsoredAuth(spendingCondition) : createStandardAuth(spendingCondition);
200
- }
201
- function resolveVersionAndChainId(chain) {
202
- if (!chain)
203
- return { version: 0, chainId: 1 };
204
- return { version: chain.transactionVersion, chainId: chain.id };
205
- }
206
- function buildTokenTransfer(options) {
207
- const { version, chainId } = resolveVersionAndChainId(options.chain);
208
- const fee = intToBigInt(options.fee);
209
- const nonce = intToBigInt(options.nonce);
210
- const spendingCondition = resolveSpendingCondition(options, nonce, fee);
211
- const recipient = Cl.principal(options.recipient);
212
- const tx = {
213
- version,
214
- chainId,
215
- auth: resolveAuth(spendingCondition, options.sponsored),
216
- anchorMode: AnchorMode.Any,
217
- postConditionMode: resolvePcMode(options.postConditionMode),
218
- postConditions: convertPostConditions(options.postConditions),
219
- payload: {
220
- payloadType: PayloadType.TokenTransfer,
221
- recipient,
222
- amount: intToBigInt(options.amount),
223
- memo: options.memo ?? ""
224
- }
225
- };
226
- if (options.publicKeys) {
227
- tx._multisig = { publicKeys: options.publicKeys };
228
- }
229
- return tx;
230
- }
231
- function buildContractCall(options) {
232
- const { version, chainId } = resolveVersionAndChainId(options.chain);
233
- const fee = intToBigInt(options.fee);
234
- const nonce = intToBigInt(options.nonce);
235
- const spendingCondition = resolveSpendingCondition(options, nonce, fee);
236
- const tx = {
237
- version,
238
- chainId,
239
- auth: resolveAuth(spendingCondition, options.sponsored),
240
- anchorMode: AnchorMode.Any,
241
- postConditionMode: resolvePcMode(options.postConditionMode),
242
- postConditions: convertPostConditions(options.postConditions),
243
- payload: {
244
- payloadType: PayloadType.ContractCall,
245
- contractAddress: options.contractAddress,
246
- contractName: options.contractName,
247
- functionName: options.functionName,
248
- functionArgs: options.functionArgs
249
- }
250
- };
251
- if (options.publicKeys) {
252
- tx._multisig = { publicKeys: options.publicKeys };
253
- }
254
- return tx;
255
- }
256
- function buildContractDeploy(options) {
257
- const { version, chainId } = resolveVersionAndChainId(options.chain);
258
- const fee = intToBigInt(options.fee);
259
- const nonce = intToBigInt(options.nonce);
260
- const spendingCondition = resolveSpendingCondition(options, nonce, fee);
261
- const useVersioned = options.clarityVersion !== undefined;
262
- const tx = {
263
- version,
264
- chainId,
265
- auth: resolveAuth(spendingCondition, options.sponsored),
266
- anchorMode: AnchorMode.Any,
267
- postConditionMode: resolvePcMode(options.postConditionMode),
268
- postConditions: convertPostConditions(options.postConditions),
269
- payload: {
270
- payloadType: useVersioned ? PayloadType.VersionedSmartContract : PayloadType.SmartContract,
271
- clarityVersion: options.clarityVersion,
272
- contractName: options.contractName,
273
- codeBody: options.codeBody
274
- }
275
- };
276
- if (options.publicKeys) {
277
- tx._multisig = { publicKeys: options.publicKeys };
278
- }
279
- return tx;
280
- }
281
-
282
- export { signBegin, signTransaction, signTransactionWithAccount, getTransactionId, getOriginSigHash, signSponsor, signSponsorWithAccount, buildTokenTransfer, buildContractCall, buildContractDeploy };
283
-
284
- //# debugId=E1E66CCEB4972C3164756E2164756E21
285
- //# sourceMappingURL=stacks-pz73cn97.js.map
@@ -1,11 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/transactions/signer.ts", "../src/transactions/build.ts"],
4
- "sourcesContent": [
5
- "import { bytesToHex, hexToBytes } from \"../utils/encoding.ts\";\nimport { txidFromBytes } from \"../utils/hash.ts\";\nimport {\n intoInitialSighashAuth,\n nextSignature,\n sigHashPreSign,\n sigHashPostSign,\n createSingleSigSpendingCondition,\n} from \"./authorization.ts\";\nimport { replayMultiSigSigHash } from \"./multisig.ts\";\nimport { serializeTransaction } from \"./wire/serialize.ts\";\nimport {\n AuthType,\n PubKeyEncoding,\n RECOVERABLE_ECDSA_SIG_LENGTH_BYTES,\n type StacksTransaction,\n type SingleSigSpendingCondition,\n type MultiSigSpendingCondition,\n type SponsoredAuthorization,\n} from \"./types.ts\";\nimport type { LocalAccount, CustomAccount } from \"../accounts/types.ts\";\n\nfunction txid(tx: StacksTransaction): string {\n return txidFromBytes(serializeTransaction(tx));\n}\n\n/** Compute the initial sighash for a transaction */\nexport function signBegin(tx: StacksTransaction): string {\n const cleared: StacksTransaction = {\n ...tx,\n auth: intoInitialSighashAuth(tx.auth),\n };\n return txid(cleared);\n}\n\n/** Sign a single-sig transaction with a private key, returning the signed transaction */\nexport function signTransaction(\n tx: StacksTransaction,\n privateKey: string\n): StacksTransaction {\n const sigHash = signBegin(tx);\n const condition = tx.auth.spendingCondition as SingleSigSpendingCondition;\n\n // Origin always signs with AuthType.Standard (even for sponsored txs)\n const { nextSig, nextSigHash } = nextSignature(\n sigHash,\n AuthType.Standard,\n condition.fee,\n condition.nonce,\n privateKey\n );\n\n return {\n ...tx,\n auth: {\n ...tx.auth,\n spendingCondition: {\n ...condition,\n signature: nextSig,\n },\n },\n };\n}\n\n/** Sign a single-sig transaction using an account (LocalAccount or CustomAccount) */\nexport async function signTransactionWithAccount(\n tx: StacksTransaction,\n account: LocalAccount | CustomAccount\n): Promise<StacksTransaction> {\n const sigHash = signBegin(tx);\n const condition = tx.auth.spendingCondition as SingleSigSpendingCondition;\n\n // Origin always signs with AuthType.Standard (even for sponsored txs)\n const sigHashPre = sigHashPreSign(\n sigHash,\n AuthType.Standard,\n condition.fee,\n condition.nonce\n );\n\n // account.sign returns 65-byte VRS (recovery + r + s)\n const sigBytes = await account.sign(hexToBytes(sigHashPre));\n const nextSig = bytesToHex(sigBytes);\n\n const pubKeyBytes = hexToBytes(account.publicKey);\n const pubKeyEncoding =\n pubKeyBytes.length === 33\n ? PubKeyEncoding.Compressed\n : PubKeyEncoding.Uncompressed;\n\n return {\n ...tx,\n auth: {\n ...tx.auth,\n spendingCondition: {\n ...condition,\n signature: nextSig,\n },\n },\n };\n}\n\n/** Get the txid of a transaction */\nexport function getTransactionId(tx: StacksTransaction): string {\n return txid(tx);\n}\n\n/** Reconstruct the sighash after origin signing (needed for sponsor signing) */\nexport function getOriginSigHash(tx: StacksTransaction): string {\n const condition = tx.auth.spendingCondition;\n\n // Multi-sig: replay through all fields\n if (\"fields\" in condition) {\n return replayMultiSigSigHash(tx);\n }\n\n // Single-sig\n const initialSigHash = signBegin(tx);\n const sc = condition as SingleSigSpendingCondition;\n const preSign = sigHashPreSign(initialSigHash, AuthType.Standard, sc.fee, sc.nonce);\n return sigHashPostSign(preSign, sc.keyEncoding, sc.signature);\n}\n\n/** Sign a sponsored transaction as the sponsor with a private key */\nexport function signSponsor(tx: StacksTransaction, privateKey: string): StacksTransaction {\n if (tx.auth.authType !== AuthType.Sponsored) {\n throw new Error(\"Transaction must be sponsored\");\n }\n const auth = tx.auth as SponsoredAuthorization;\n const sponsorCondition = auth.sponsorSpendingCondition as SingleSigSpendingCondition;\n const originSigHash = getOriginSigHash(tx);\n\n const { nextSig } = nextSignature(\n originSigHash,\n AuthType.Sponsored,\n sponsorCondition.fee,\n sponsorCondition.nonce,\n privateKey\n );\n\n return {\n ...tx,\n auth: {\n ...auth,\n sponsorSpendingCondition: {\n ...sponsorCondition,\n signature: nextSig,\n },\n },\n };\n}\n\n/** Sign a sponsored transaction as the sponsor using an account */\nexport async function signSponsorWithAccount(\n tx: StacksTransaction,\n account: LocalAccount | CustomAccount\n): Promise<StacksTransaction> {\n if (tx.auth.authType !== AuthType.Sponsored) {\n throw new Error(\"Transaction must be sponsored\");\n }\n const auth = tx.auth as SponsoredAuthorization;\n const sponsorCondition = auth.sponsorSpendingCondition as SingleSigSpendingCondition;\n const originSigHash = getOriginSigHash(tx);\n\n const sigHashPre = sigHashPreSign(\n originSigHash,\n AuthType.Sponsored,\n sponsorCondition.fee,\n sponsorCondition.nonce\n );\n\n const sigBytes = await account.sign(hexToBytes(sigHashPre));\n const nextSig = bytesToHex(sigBytes);\n\n return {\n ...tx,\n auth: {\n ...auth,\n sponsorSpendingCondition: {\n ...sponsorCondition,\n signature: nextSig,\n },\n },\n };\n}\n",
6
- "import type { StacksChain } from \"../chains/types.ts\";\nimport type { ClarityValue } from \"../clarity/types.ts\";\nimport type { PostCondition } from \"../postconditions/types.ts\";\nimport type { MultiSigHashMode, SpendingCondition } from \"./types.ts\";\nimport {\n createSingleSigSpendingCondition,\n createStandardAuth,\n createSponsoredAuth,\n} from \"./authorization.ts\";\nimport { createMultiSigSpendingCondition } from \"./multisig.ts\";\nimport {\n PayloadType,\n AnchorMode,\n PostConditionModeWire,\n FungibleConditionCode,\n NonFungibleConditionCode,\n PostConditionPrincipalId,\n type StacksTransaction,\n type PostConditionWire,\n type PostConditionPrincipalWire,\n type ClarityVersion,\n} from \"./types.ts\";\nimport { Cl } from \"../clarity/values.ts\";\nimport { intToBigInt, type IntegerType } from \"../utils/encoding.ts\";\nimport { validateStacksAddress, parseContractId } from \"../utils/address.ts\";\n\ntype MultiSigOptions = {\n publicKeys?: string[];\n signaturesRequired?: number;\n hashMode?: MultiSigHashMode;\n};\n\nexport type BuildTokenTransferOptions = MultiSigOptions & {\n recipient: string;\n amount: IntegerType;\n memo?: string;\n fee: IntegerType;\n nonce: IntegerType;\n publicKey?: string;\n chain?: StacksChain;\n postConditionMode?: \"allow\" | \"deny\";\n postConditions?: PostCondition[];\n sponsored?: boolean;\n};\n\nexport type BuildContractCallOptions = MultiSigOptions & {\n contractAddress: string;\n contractName: string;\n functionName: string;\n functionArgs: ClarityValue[];\n fee: IntegerType;\n nonce: IntegerType;\n publicKey?: string;\n chain?: StacksChain;\n postConditionMode?: \"allow\" | \"deny\";\n postConditions?: PostCondition[];\n sponsored?: boolean;\n};\n\nexport type BuildContractDeployOptions = MultiSigOptions & {\n contractName: string;\n codeBody: string;\n clarityVersion?: ClarityVersion;\n fee: IntegerType;\n nonce: IntegerType;\n publicKey?: string;\n chain?: StacksChain;\n postConditionMode?: \"allow\" | \"deny\";\n postConditions?: PostCondition[];\n sponsored?: boolean;\n};\n\nfunction resolvePcMode(mode?: \"allow\" | \"deny\"): PostConditionModeWire {\n return mode === \"allow\" ? PostConditionModeWire.Allow : PostConditionModeWire.Deny;\n}\n\nfunction convertPostConditions(pcs?: PostCondition[]): PostConditionWire[] {\n if (!pcs || pcs.length === 0) return [];\n return pcs.map(convertPostCondition);\n}\n\nfunction resolvePrincipal(address: string): PostConditionPrincipalWire {\n if (address === \"origin\") return { type: \"origin\" };\n const [addr, name] = address.split(\".\");\n if (name) {\n return { type: \"contract\", address: addr!, contractName: name };\n }\n return { type: \"standard\", address: addr! };\n}\n\nconst FUNGIBLE_CODE_MAP: Record<string, number> = {\n eq: FungibleConditionCode.Equal,\n gt: FungibleConditionCode.Greater,\n gte: FungibleConditionCode.GreaterEqual,\n lt: FungibleConditionCode.Less,\n lte: FungibleConditionCode.LessEqual,\n};\n\nfunction convertPostCondition(pc: PostCondition): PostConditionWire {\n switch (pc.type) {\n case \"stx-postcondition\":\n return {\n type: \"stx\",\n principal: resolvePrincipal(pc.address),\n conditionCode: FUNGIBLE_CODE_MAP[pc.condition]!,\n amount: intToBigInt(pc.amount),\n };\n case \"ft-postcondition\": {\n const [contractId, tokenName] = pc.asset.split(\"::\");\n const [addr, name] = parseContractId(contractId!);\n return {\n type: \"ft\",\n principal: resolvePrincipal(pc.address),\n asset: { address: addr, contractName: name, assetName: tokenName! },\n conditionCode: FUNGIBLE_CODE_MAP[pc.condition]!,\n amount: intToBigInt(pc.amount),\n };\n }\n case \"nft-postcondition\": {\n const [contractId, tokenName] = pc.asset.split(\"::\");\n const [addr, name] = parseContractId(contractId!);\n return {\n type: \"nft\",\n principal: resolvePrincipal(pc.address),\n asset: { address: addr, contractName: name, assetName: tokenName! },\n conditionCode: pc.condition === \"sent\" ? NonFungibleConditionCode.Sends : NonFungibleConditionCode.DoesNotSend,\n assetId: pc.assetId,\n };\n }\n }\n}\n\nimport type { Authorization } from \"./types.ts\";\n\nfunction resolveSpendingCondition(\n opts: MultiSigOptions & { publicKey?: string },\n nonce: bigint,\n fee: bigint\n): SpendingCondition {\n if (opts.publicKeys) {\n return createMultiSigSpendingCondition(\n opts.publicKeys,\n opts.signaturesRequired!,\n nonce,\n fee,\n opts.hashMode\n );\n }\n return createSingleSigSpendingCondition(opts.publicKey!, nonce, fee);\n}\n\nfunction resolveAuth(spendingCondition: any, sponsored?: boolean): Authorization {\n return sponsored\n ? createSponsoredAuth(spendingCondition)\n : createStandardAuth(spendingCondition);\n}\n\nfunction resolveVersionAndChainId(chain?: StacksChain): { version: number; chainId: number } {\n if (!chain) return { version: 0x00, chainId: 0x00000001 }; // mainnet defaults\n return { version: chain.transactionVersion, chainId: chain.id };\n}\n\nexport function buildTokenTransfer(options: BuildTokenTransferOptions): StacksTransaction {\n const { version, chainId } = resolveVersionAndChainId(options.chain);\n const fee = intToBigInt(options.fee);\n const nonce = intToBigInt(options.nonce);\n\n const spendingCondition = resolveSpendingCondition(options, nonce, fee);\n const recipient = Cl.principal(options.recipient);\n\n const tx: StacksTransaction = {\n version,\n chainId,\n auth: resolveAuth(spendingCondition, options.sponsored),\n anchorMode: AnchorMode.Any,\n postConditionMode: resolvePcMode(options.postConditionMode),\n postConditions: convertPostConditions(options.postConditions),\n payload: {\n payloadType: PayloadType.TokenTransfer,\n recipient,\n amount: intToBigInt(options.amount),\n memo: options.memo ?? \"\",\n },\n };\n\n if (options.publicKeys) {\n (tx as any)._multisig = { publicKeys: options.publicKeys };\n }\n return tx;\n}\n\nexport function buildContractCall(options: BuildContractCallOptions): StacksTransaction {\n const { version, chainId } = resolveVersionAndChainId(options.chain);\n const fee = intToBigInt(options.fee);\n const nonce = intToBigInt(options.nonce);\n\n const spendingCondition = resolveSpendingCondition(options, nonce, fee);\n\n const tx: StacksTransaction = {\n version,\n chainId,\n auth: resolveAuth(spendingCondition, options.sponsored),\n anchorMode: AnchorMode.Any,\n postConditionMode: resolvePcMode(options.postConditionMode),\n postConditions: convertPostConditions(options.postConditions),\n payload: {\n payloadType: PayloadType.ContractCall,\n contractAddress: options.contractAddress,\n contractName: options.contractName,\n functionName: options.functionName,\n functionArgs: options.functionArgs,\n },\n };\n\n if (options.publicKeys) {\n (tx as any)._multisig = { publicKeys: options.publicKeys };\n }\n return tx;\n}\n\nexport function buildContractDeploy(options: BuildContractDeployOptions): StacksTransaction {\n const { version, chainId } = resolveVersionAndChainId(options.chain);\n const fee = intToBigInt(options.fee);\n const nonce = intToBigInt(options.nonce);\n\n const spendingCondition = resolveSpendingCondition(options, nonce, fee);\n const useVersioned = options.clarityVersion !== undefined;\n\n const tx: StacksTransaction = {\n version,\n chainId,\n auth: resolveAuth(spendingCondition, options.sponsored),\n anchorMode: AnchorMode.Any,\n postConditionMode: resolvePcMode(options.postConditionMode),\n postConditions: convertPostConditions(options.postConditions),\n payload: {\n payloadType: useVersioned ? PayloadType.VersionedSmartContract : PayloadType.SmartContract,\n clarityVersion: options.clarityVersion,\n contractName: options.contractName,\n codeBody: options.codeBody,\n },\n };\n\n if (options.publicKeys) {\n (tx as any)._multisig = { publicKeys: options.publicKeys };\n }\n return tx;\n}\n"
7
- ],
8
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,IAAI,CAAC,IAA+B;AAAA,EAC3C,OAAO,cAAc,qBAAqB,EAAE,CAAC;AAAA;AAIxC,SAAS,SAAS,CAAC,IAA+B;AAAA,EACvD,MAAM,UAA6B;AAAA,OAC9B;AAAA,IACH,MAAM,uBAAuB,GAAG,IAAI;AAAA,EACtC;AAAA,EACA,OAAO,KAAK,OAAO;AAAA;AAId,SAAS,eAAe,CAC7B,IACA,YACmB;AAAA,EACnB,MAAM,UAAU,UAAU,EAAE;AAAA,EAC5B,MAAM,YAAY,GAAG,KAAK;AAAA,EAG1B,QAAQ,SAAS,gBAAgB,cAC/B,SACA,SAAS,UACT,UAAU,KACV,UAAU,OACV,UACF;AAAA,EAEA,OAAO;AAAA,OACF;AAAA,IACH,MAAM;AAAA,SACD,GAAG;AAAA,MACN,mBAAmB;AAAA,WACd;AAAA,QACH,WAAW;AAAA,MACb;AAAA,IACF;AAAA,EACF;AAAA;AAIF,eAAsB,0BAA0B,CAC9C,IACA,SAC4B;AAAA,EAC5B,MAAM,UAAU,UAAU,EAAE;AAAA,EAC5B,MAAM,YAAY,GAAG,KAAK;AAAA,EAG1B,MAAM,aAAa,eACjB,SACA,SAAS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C3D;AAAA,EACA,OAAO;AAAA;",
9
- "debugId": "E1E66CCEB4972C3164756E2164756E21",
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": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,kBACE;AAAA,UACA;AAAA;;;ACFF;AAAA,kBACE;AAAA;AAAA;AAAA;AAIF;AACA;;;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,UAAU;AAAA,EACV,UAAU;AACZ;AAIO,IAAM,aAAa;AAAA,EACxB,aAAa;AAAA,EACb,cAAc;AAAA,EACd,KAAK;AACP;AAIO,IAAM,wBAAwB;AAAA,EACnC,OAAO;AAAA,EACP,MAAM;AACR;AAKO,IAAM,kBAAkB;AAAA,EAC7B,OAAO;AAAA,EACP,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,oBAAoB;AAAA,EACpB,0BAA0B;AAC5B;AAIO,IAAM,iBAAiB;AAAA,EAC5B,YAAY;AAAA,EACZ,cAAc;AAChB;AAIO,IAAM,wBAAwB;AAAA,EACnC,OA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