@secondlayer/stacks 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/stacks-02actsrx.cjs.map +2 -2
- package/dist/shared/{stacks-xp9n3r0t.js → stacks-09wa7ewe.js} +108 -108
- package/dist/shared/stacks-09wa7ewe.js.map +15 -0
- package/dist/shared/{stacks-ky14tdf6.cjs → stacks-0nfexv24.cjs} +20 -8
- package/dist/shared/stacks-0nfexv24.cjs.map +14 -0
- package/dist/shared/{stacks-an5k8n4t.cjs → stacks-14pgpkrr.cjs} +82 -73
- package/dist/shared/stacks-14pgpkrr.cjs.map +23 -0
- package/dist/shared/{stacks-v6ja2eh7.cjs → stacks-17sdtaxg.cjs} +106 -102
- package/dist/shared/stacks-17sdtaxg.cjs.map +15 -0
- package/dist/shared/{stacks-96gaxfcf.js → stacks-1s5w4ncf.js} +44 -32
- package/dist/shared/stacks-1s5w4ncf.js.map +17 -0
- package/dist/shared/stacks-24h5k94q.cjs.map +3 -3
- package/dist/shared/{stacks-evnzth1q.cjs → stacks-4vzmhw3q.cjs} +3 -3
- package/dist/shared/stacks-4vzmhw3q.cjs.map +10 -0
- package/dist/shared/{stacks-k9p8m3wf.js → stacks-4x2bcc2k.js} +87 -78
- package/dist/shared/stacks-4x2bcc2k.js.map +23 -0
- package/dist/shared/stacks-5tprhns9.cjs.map +3 -3
- package/dist/shared/stacks-709tra19.js.map +2 -2
- package/dist/shared/{stacks-q79dx28x.js → stacks-70p84bgg.js} +3 -3
- package/dist/shared/stacks-70p84bgg.js.map +10 -0
- package/dist/shared/{stacks-k2p5tv6x.js → stacks-913a2rx7.js} +3 -3
- package/dist/shared/stacks-913a2rx7.js.map +10 -0
- package/dist/shared/{stacks-jrnmh4kc.js → stacks-96d6m1zy.js} +15 -6
- package/dist/shared/stacks-96d6m1zy.js.map +11 -0
- package/dist/shared/stacks-9g0jhab3.cjs.map +2 -2
- package/dist/shared/stacks-dr5en54r.cjs.map +2 -2
- package/dist/shared/stacks-fcaefc5b.cjs.map +2 -2
- package/dist/shared/stacks-gck1sq7h.cjs.map +2 -2
- package/dist/shared/stacks-je937aas.js.map +2 -2
- package/dist/shared/{stacks-k58k970n.js → stacks-kg1npstf.js} +5 -3
- package/dist/shared/stacks-kg1npstf.js.map +10 -0
- package/dist/shared/{stacks-qvg7c24g.cjs → stacks-n98w7g57.cjs} +5 -3
- package/dist/shared/stacks-n98w7g57.cjs.map +10 -0
- package/dist/shared/{stacks-6m1z4j07.js → stacks-nqae5amn.cjs} +74 -160
- package/dist/shared/stacks-nqae5amn.cjs.map +10 -0
- package/dist/shared/stacks-qcae5852.js.map +2 -2
- package/dist/shared/stacks-qt8ehebn.js.map +3 -3
- package/dist/shared/stacks-ra02bpny.cjs.map +3 -3
- package/dist/shared/stacks-rwfgts3s.js.map +2 -2
- package/dist/shared/stacks-s10yb9gz.js.map +2 -2
- package/dist/shared/{stacks-etf219gs.cjs → stacks-s30kkvm8.js} +101 -118
- package/dist/shared/stacks-s30kkvm8.js.map +10 -0
- package/dist/shared/stacks-s7z5q8be.js.map +3 -3
- package/dist/shared/stacks-v9jqcpd4.js.map +2 -2
- package/dist/shared/stacks-vdfag81a.cjs.map +2 -2
- package/dist/shared/{stacks-rg1g0fja.js → stacks-wjem3xw9.js} +21 -9
- package/dist/shared/stacks-wjem3xw9.js.map +14 -0
- package/dist/shared/{stacks-k08tgzyp.cjs → stacks-wyxj879g.cjs} +3 -3
- package/dist/shared/stacks-wyxj879g.cjs.map +13 -0
- package/dist/shared/stacks-y3dh7hv1.js.map +3 -3
- package/dist/shared/{stacks-2ar4prfz.cjs → stacks-y5262j0z.cjs} +14 -5
- package/dist/shared/stacks-y5262j0z.cjs.map +11 -0
- package/dist/shared/stacks-ya3x01yd.cjs.map +2 -2
- package/dist/shared/{stacks-p93g814f.js → stacks-zf7rbpzp.js} +4 -4
- package/dist/shared/stacks-zf7rbpzp.js.map +13 -0
- package/dist/shared/{stacks-61rvzkz1.cjs → stacks-znrb59ce.cjs} +41 -29
- package/dist/shared/stacks-znrb59ce.cjs.map +17 -0
- package/dist/src/accounts/index.cjs +2 -2
- package/dist/src/accounts/index.cjs.map +5 -5
- package/dist/src/accounts/index.js +2 -6
- package/dist/src/accounts/index.js.map +5 -5
- package/dist/src/actions/index.d.cts +29 -29
- package/dist/src/actions/index.d.ts +29 -29
- package/dist/src/actions/index.js +7 -7
- package/dist/src/bns/index.cjs +55 -43
- package/dist/src/bns/index.cjs.map +9 -9
- package/dist/src/bns/index.d.cts +29 -29
- package/dist/src/bns/index.d.ts +29 -29
- package/dist/src/bns/index.js +62 -50
- package/dist/src/bns/index.js.map +9 -9
- package/dist/src/clarity/index.js +4 -4
- package/dist/src/connect/index.cjs +114 -112
- package/dist/src/connect/index.cjs.map +13 -13
- package/dist/src/connect/index.js +114 -112
- package/dist/src/connect/index.js.map +13 -13
- package/dist/src/connect/walletconnect/index.cjs +3 -3
- package/dist/src/connect/walletconnect/index.cjs.map +10 -10
- package/dist/src/connect/walletconnect/index.js +3 -3
- package/dist/src/connect/walletconnect/index.js.map +10 -10
- package/dist/src/index.cjs +108 -2
- package/dist/src/index.cjs.map +19 -15
- package/dist/src/index.d.cts +291 -112
- package/dist/src/index.d.ts +291 -112
- package/dist/src/index.js +122 -9
- package/dist/src/index.js.map +19 -15
- package/dist/src/pox/index.cjs.map +6 -6
- package/dist/src/pox/index.d.cts +29 -29
- package/dist/src/pox/index.d.ts +29 -29
- package/dist/src/pox/index.js +5 -5
- package/dist/src/pox/index.js.map +6 -6
- package/dist/src/stackingdao/index.cjs +31 -6
- package/dist/src/stackingdao/index.cjs.map +6 -6
- package/dist/src/stackingdao/index.d.cts +29 -29
- package/dist/src/stackingdao/index.d.ts +29 -29
- package/dist/src/stackingdao/index.js +37 -12
- package/dist/src/stackingdao/index.js.map +6 -6
- package/dist/src/subscriptions/index.d.cts +29 -29
- package/dist/src/subscriptions/index.d.ts +29 -29
- package/dist/src/tools/btc/index.cjs +130 -0
- package/dist/src/tools/btc/index.cjs.map +10 -0
- package/dist/src/tools/btc/index.d.cts +8 -0
- package/dist/src/tools/btc/index.d.ts +8 -0
- package/dist/src/tools/btc/index.js +89 -0
- package/dist/src/tools/btc/index.js.map +10 -0
- package/dist/src/tools/index.cjs +2470 -0
- package/dist/src/tools/index.cjs.map +61 -0
- package/dist/src/tools/index.d.cts +144 -0
- package/dist/src/tools/index.d.ts +144 -0
- package/dist/src/tools/index.js +2435 -0
- package/dist/src/tools/index.js.map +61 -0
- package/dist/src/transactions/index.js +3 -3
- package/dist/src/triggers/index.cjs +66 -0
- package/dist/src/triggers/index.cjs.map +10 -0
- package/dist/src/triggers/index.d.cts +116 -0
- package/dist/src/triggers/index.d.ts +116 -0
- package/dist/src/triggers/index.js +25 -0
- package/dist/src/triggers/index.js.map +10 -0
- package/dist/src/tx/index.cjs +65 -0
- package/dist/src/tx/index.cjs.map +10 -0
- package/dist/src/tx/index.d.cts +42 -0
- package/dist/src/tx/index.d.ts +42 -0
- package/dist/src/tx/index.js +22 -0
- package/dist/src/tx/index.js.map +10 -0
- package/dist/src/ui/index.cjs +431 -0
- package/dist/src/ui/index.cjs.map +27 -0
- package/dist/src/ui/index.d.cts +107 -0
- package/dist/src/ui/index.d.ts +107 -0
- package/dist/src/ui/index.js +391 -0
- package/dist/src/ui/index.js.map +27 -0
- package/dist/src/ui/schemas.cjs +134 -0
- package/dist/src/ui/schemas.cjs.map +18 -0
- package/dist/src/ui/schemas.d.cts +83 -0
- package/dist/src/ui/schemas.d.ts +83 -0
- package/dist/src/ui/schemas.js +91 -0
- package/dist/src/ui/schemas.js.map +18 -0
- package/dist/src/utils/index.cjs +3 -3
- package/dist/src/utils/index.cjs.map +4 -4
- package/dist/src/utils/index.js +4 -4
- package/dist/src/utils/index.js.map +4 -4
- package/package.json +157 -105
- package/dist/shared/stacks-2ar4prfz.cjs.map +0 -11
- package/dist/shared/stacks-61rvzkz1.cjs.map +0 -17
- package/dist/shared/stacks-6m1z4j07.js.map +0 -10
- package/dist/shared/stacks-96gaxfcf.js.map +0 -17
- package/dist/shared/stacks-an5k8n4t.cjs.map +0 -23
- package/dist/shared/stacks-etf219gs.cjs.map +0 -10
- package/dist/shared/stacks-evnzth1q.cjs.map +0 -10
- package/dist/shared/stacks-jrnmh4kc.js.map +0 -11
- package/dist/shared/stacks-k08tgzyp.cjs.map +0 -13
- package/dist/shared/stacks-k2p5tv6x.js.map +0 -10
- package/dist/shared/stacks-k58k970n.js.map +0 -10
- package/dist/shared/stacks-k9p8m3wf.js.map +0 -23
- package/dist/shared/stacks-ky14tdf6.cjs.map +0 -13
- package/dist/shared/stacks-p93g814f.js.map +0 -13
- package/dist/shared/stacks-q79dx28x.js.map +0 -10
- package/dist/shared/stacks-qvg7c24g.cjs.map +0 -10
- package/dist/shared/stacks-rg1g0fja.js.map +0 -13
- package/dist/shared/stacks-v6ja2eh7.cjs.map +0 -15
- package/dist/shared/stacks-xp9n3r0t.js.map +0 -15
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/utils/signature.ts", "../src/utils/keys.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import {
|
|
6
|
-
"import { Point, etc } from \"@noble/secp256k1\";\nimport { bytesToHex, hexToBytes } from \"./encoding.ts\";\n\n/** Compress a public key to 33 bytes (hex). */\nexport function compressPublicKey(publicKey: string | Uint8Array): string {\n
|
|
5
|
+
"import { sha256 } from \"@noble/hashes/sha2.js\";\nimport { Signature as NobleSignature, verify } from \"@noble/secp256k1\";\nimport { c32address } from \"./address.ts\";\nimport { AddressVersion } from \"./constants.ts\";\nimport { concatBytes, hexToBytes, utf8ToBytes } from \"./encoding.ts\";\nimport { hashP2PKH } from \"./hash.ts\";\n\nexport interface RecoverableSignature {\n\t/** Recovery id (0–3) */\n\trecovery: number;\n\t/** 32-byte r value as hex */\n\tr: string;\n\t/** 32-byte s value as hex */\n\ts: string;\n}\n\n// --- Format conversion ---\n\n/**\n * Parse a 65-byte VRS hex signature into components.\n * VRS format: recovery (1 byte) + r (32 bytes) + s (32 bytes)\n */\nexport function parseSignature(hex: string): RecoverableSignature {\n\tconst clean = hex.startsWith(\"0x\") ? hex.slice(2) : hex;\n\tif (clean.length !== 130) {\n\t\tthrow new Error(\n\t\t\t`Invalid signature length: expected 130 hex chars, got ${clean.length}`,\n\t\t);\n\t}\n\treturn {\n\t\trecovery: Number.parseInt(clean.slice(0, 2), 16),\n\t\tr: clean.slice(2, 66),\n\t\ts: clean.slice(66, 130),\n\t};\n}\n\n/**\n * Serialize a recoverable signature to 65-byte VRS hex (130 chars).\n */\nexport function serializeSignature(sig: RecoverableSignature): string {\n\tconst v = sig.recovery.toString(16).padStart(2, \"0\");\n\treturn v + sig.r + sig.s;\n}\n\n/** Convert VRS hex to RSV hex: r+s (128 chars) + recovery (2 chars). */\nexport function signatureVrsToRsv(vrs: string): string {\n\tconst clean = vrs.startsWith(\"0x\") ? vrs.slice(2) : vrs;\n\treturn clean.slice(2) + clean.slice(0, 2);\n}\n\n/** Convert RSV hex to VRS hex: recovery (2 chars) + r+s (128 chars). */\nexport function signatureRsvToVrs(rsv: string): string {\n\tconst clean = rsv.startsWith(\"0x\") ? rsv.slice(2) : rsv;\n\treturn clean.slice(-2) + clean.slice(0, -2);\n}\n\n// --- Recovery ---\n\n/**\n * Recover a public key from a message hash and VRS signature.\n * @returns hex-encoded public key (33 bytes compressed, or 65 bytes uncompressed)\n */\nexport function recoverPublicKey(\n\thash: Uint8Array | string,\n\tsignature: string,\n\tcompressed = true,\n): string {\n\tconst parsed = parseSignature(signature);\n\tconst rs = parsed.r + parsed.s;\n\tconst sig = NobleSignature.fromCompact(rs).addRecoveryBit(parsed.recovery);\n\tconst msgHash = typeof hash === \"string\" ? hexToBytes(hash) : hash;\n\tconst point = sig.recoverPublicKey(msgHash);\n\treturn point.toHex(compressed);\n}\n\n/**\n * Recover a Stacks address from a message hash and VRS signature.\n * @param addressVersion defaults to MainnetSingleSig (22)\n */\nexport function recoverAddress(\n\thash: Uint8Array | string,\n\tsignature: string,\n\taddressVersion: number = AddressVersion.MainnetSingleSig,\n): string {\n\tconst pubkey = recoverPublicKey(hash, signature, true);\n\tconst pubkeyHash = hashP2PKH(hexToBytes(pubkey));\n\treturn c32address(addressVersion, pubkeyHash);\n}\n\n// --- Verification ---\n\n/**\n * Verify an ECDSA signature against a message hash and public key.\n * Accepts compact (64-byte) signature as hex or Uint8Array.\n */\nexport function verifySignature(\n\thash: Uint8Array | string,\n\tsignature: string | Uint8Array,\n\tpublicKey: string | Uint8Array,\n): boolean {\n\treturn verify(signature, hash, publicKey, { lowS: false });\n}\n\n/** Bitcoin-style varint encoding for message length prefix. */\nfunction encodeVarint(n: number): Uint8Array {\n\tif (n < 0xfd) return new Uint8Array([n]);\n\tif (n <= 0xffff) {\n\t\tconst buf = new Uint8Array(3);\n\t\tbuf[0] = 0xfd;\n\t\tbuf[1] = n & 0xff;\n\t\tbuf[2] = (n >> 8) & 0xff;\n\t\treturn buf;\n\t}\n\tconst buf = new Uint8Array(5);\n\tbuf[0] = 0xfe;\n\tbuf[1] = n & 0xff;\n\tbuf[2] = (n >> 8) & 0xff;\n\tbuf[3] = (n >> 16) & 0xff;\n\tbuf[4] = (n >> 24) & 0xff;\n\treturn buf;\n}\n\nconst STACKS_MESSAGE_PREFIX = \"\\x17Stacks Signed Message:\\n\";\nconst LEGACY_MESSAGE_PREFIX = \"\\x18Stacks Message Signing:\\n\";\n\n/** Hash a message with the Stacks structured message prefix. */\nfunction hashMessage(message: string | Uint8Array, prefix: string): Uint8Array {\n\tconst messageBytes =\n\t\ttypeof message === \"string\" ? utf8ToBytes(message) : message;\n\tconst prefixBytes = utf8ToBytes(prefix);\n\tconst lengthBytes = encodeVarint(messageBytes.length);\n\treturn sha256(concatBytes(prefixBytes, lengthBytes, messageBytes));\n}\n\n/**\n * Verify a signed Stacks message.\n * Parses a VRS signature, extracts r+s for verification.\n * Falls back to legacy prefix if standard prefix fails.\n */\nexport function verifyMessageSignature(\n\tmessage: string | Uint8Array,\n\tsignature: string,\n\tpublicKey: string,\n): boolean {\n\tconst parsed = parseSignature(signature);\n\tconst compactSig = parsed.r + parsed.s;\n\n\tconst msgHash = hashMessage(message, STACKS_MESSAGE_PREFIX);\n\tif (verify(compactSig, msgHash, publicKey, { lowS: false })) return true;\n\n\t// Fallback to legacy prefix\n\tif (typeof message === \"string\") {\n\t\tconst legacyHash = hashMessage(message, LEGACY_MESSAGE_PREFIX);\n\t\tif (verify(compactSig, legacyHash, publicKey, { lowS: false })) return true;\n\t}\n\n\treturn false;\n}\n",
|
|
6
|
+
"import { Point, etc } from \"@noble/secp256k1\";\nimport { bytesToHex, hexToBytes } from \"./encoding.ts\";\n\n/** Compress a public key to 33 bytes (hex). */\nexport function compressPublicKey(publicKey: string | Uint8Array): string {\n\tconst hex = typeof publicKey === \"string\" ? publicKey : bytesToHex(publicKey);\n\treturn Point.fromHex(hex).toHex(true);\n}\n\n/** Uncompress a public key to 65 bytes (hex). */\nexport function uncompressPublicKey(publicKey: string | Uint8Array): string {\n\tconst hex = typeof publicKey === \"string\" ? publicKey : bytesToHex(publicKey);\n\treturn Point.fromHex(hex).toHex(false);\n}\n\n/** Check if a public key is in compressed format (starts with 0x02 or 0x03). */\nexport function isCompressedPublicKey(publicKey: string | Uint8Array): boolean {\n\tconst bytes =\n\t\ttypeof publicKey === \"string\" ? hexToBytes(publicKey) : publicKey;\n\treturn bytes.length === 33 && (bytes[0] === 0x02 || bytes[0] === 0x03);\n}\n\n/** Generate cryptographically secure random bytes. Defaults to 32 bytes. */\nexport function randomBytes(length?: number): Uint8Array {\n\treturn etc.randomBytes(length ?? 32);\n}\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
9
|
-
"debugId": "
|
|
8
|
+
"mappings": ";;;;;;;;;;;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8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
2
|
+
"name": "@secondlayer/stacks",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "A viem-style SDK for the Stacks blockchain",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/src/index.cjs",
|
|
7
|
+
"module": "./dist/src/index.js",
|
|
8
|
+
"types": "./dist/src/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/src/index.d.ts",
|
|
12
|
+
"import": "./dist/src/index.js",
|
|
13
|
+
"require": "./dist/src/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./accounts": {
|
|
16
|
+
"types": "./dist/src/accounts/index.d.ts",
|
|
17
|
+
"import": "./dist/src/accounts/index.js",
|
|
18
|
+
"require": "./dist/src/accounts/index.cjs"
|
|
19
|
+
},
|
|
20
|
+
"./chains": {
|
|
21
|
+
"types": "./dist/src/chains/index.d.ts",
|
|
22
|
+
"import": "./dist/src/chains/index.js",
|
|
23
|
+
"require": "./dist/src/chains/index.cjs"
|
|
24
|
+
},
|
|
25
|
+
"./clarity": {
|
|
26
|
+
"types": "./dist/src/clarity/index.d.ts",
|
|
27
|
+
"import": "./dist/src/clarity/index.js",
|
|
28
|
+
"require": "./dist/src/clarity/index.cjs"
|
|
29
|
+
},
|
|
30
|
+
"./actions": {
|
|
31
|
+
"types": "./dist/src/actions/index.d.ts",
|
|
32
|
+
"import": "./dist/src/actions/index.js",
|
|
33
|
+
"require": "./dist/src/actions/index.cjs"
|
|
34
|
+
},
|
|
35
|
+
"./postconditions": {
|
|
36
|
+
"types": "./dist/src/postconditions/index.d.ts",
|
|
37
|
+
"import": "./dist/src/postconditions/index.js",
|
|
38
|
+
"require": "./dist/src/postconditions/index.cjs"
|
|
39
|
+
},
|
|
40
|
+
"./transactions": {
|
|
41
|
+
"types": "./dist/src/transactions/index.d.ts",
|
|
42
|
+
"import": "./dist/src/transactions/index.js",
|
|
43
|
+
"require": "./dist/src/transactions/index.cjs"
|
|
44
|
+
},
|
|
45
|
+
"./utils": {
|
|
46
|
+
"types": "./dist/src/utils/index.d.ts",
|
|
47
|
+
"import": "./dist/src/utils/index.js",
|
|
48
|
+
"require": "./dist/src/utils/index.cjs"
|
|
49
|
+
},
|
|
50
|
+
"./connect": {
|
|
51
|
+
"types": "./dist/src/connect/index.d.ts",
|
|
52
|
+
"import": "./dist/src/connect/index.js",
|
|
53
|
+
"require": "./dist/src/connect/index.cjs"
|
|
54
|
+
},
|
|
55
|
+
"./bns": {
|
|
56
|
+
"types": "./dist/src/bns/index.d.ts",
|
|
57
|
+
"import": "./dist/src/bns/index.js",
|
|
58
|
+
"require": "./dist/src/bns/index.cjs"
|
|
59
|
+
},
|
|
60
|
+
"./pox": {
|
|
61
|
+
"types": "./dist/src/pox/index.d.ts",
|
|
62
|
+
"import": "./dist/src/pox/index.js",
|
|
63
|
+
"require": "./dist/src/pox/index.cjs"
|
|
64
|
+
},
|
|
65
|
+
"./stackingdao": {
|
|
66
|
+
"types": "./dist/src/stackingdao/index.d.ts",
|
|
67
|
+
"import": "./dist/src/stackingdao/index.js",
|
|
68
|
+
"require": "./dist/src/stackingdao/index.cjs"
|
|
69
|
+
},
|
|
70
|
+
"./subscriptions": {
|
|
71
|
+
"types": "./dist/src/subscriptions/index.d.ts",
|
|
72
|
+
"import": "./dist/src/subscriptions/index.js",
|
|
73
|
+
"require": "./dist/src/subscriptions/index.cjs"
|
|
74
|
+
},
|
|
75
|
+
"./connect/walletconnect": {
|
|
76
|
+
"types": "./dist/src/connect/walletconnect/index.d.ts",
|
|
77
|
+
"import": "./dist/src/connect/walletconnect/index.js",
|
|
78
|
+
"require": "./dist/src/connect/walletconnect/index.cjs"
|
|
79
|
+
},
|
|
80
|
+
"./ui": {
|
|
81
|
+
"types": "./dist/src/ui/index.d.ts",
|
|
82
|
+
"import": "./dist/src/ui/index.js",
|
|
83
|
+
"require": "./dist/src/ui/index.cjs"
|
|
84
|
+
},
|
|
85
|
+
"./ui/schemas": {
|
|
86
|
+
"types": "./dist/src/ui/schemas.d.ts",
|
|
87
|
+
"import": "./dist/src/ui/schemas.js",
|
|
88
|
+
"require": "./dist/src/ui/schemas.cjs"
|
|
89
|
+
},
|
|
90
|
+
"./tools": {
|
|
91
|
+
"types": "./dist/src/tools/index.d.ts",
|
|
92
|
+
"import": "./dist/src/tools/index.js",
|
|
93
|
+
"require": "./dist/src/tools/index.cjs"
|
|
94
|
+
},
|
|
95
|
+
"./tools/btc": {
|
|
96
|
+
"types": "./dist/src/tools/btc/index.d.ts",
|
|
97
|
+
"import": "./dist/src/tools/btc/index.js",
|
|
98
|
+
"require": "./dist/src/tools/btc/index.cjs"
|
|
99
|
+
},
|
|
100
|
+
"./triggers": {
|
|
101
|
+
"types": "./dist/src/triggers/index.d.ts",
|
|
102
|
+
"import": "./dist/src/triggers/index.js",
|
|
103
|
+
"require": "./dist/src/triggers/index.cjs"
|
|
104
|
+
},
|
|
105
|
+
"./tx": {
|
|
106
|
+
"types": "./dist/src/tx/index.d.ts",
|
|
107
|
+
"import": "./dist/src/tx/index.js",
|
|
108
|
+
"require": "./dist/src/tx/index.cjs"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"files": [
|
|
112
|
+
"dist"
|
|
113
|
+
],
|
|
114
|
+
"scripts": {
|
|
115
|
+
"build": "bunup",
|
|
116
|
+
"test": "bun test",
|
|
117
|
+
"typecheck": "tsc --noEmit",
|
|
118
|
+
"prepublishOnly": "bun run build"
|
|
119
|
+
},
|
|
120
|
+
"publishConfig": {
|
|
121
|
+
"access": "public"
|
|
122
|
+
},
|
|
123
|
+
"devDependencies": {
|
|
124
|
+
"@json-render/core": "0.18.0",
|
|
125
|
+
"@json-render/react": "0.18.0",
|
|
126
|
+
"@types/bun": "latest",
|
|
127
|
+
"@types/react": "^19.1.0",
|
|
128
|
+
"react": "^19.2.4"
|
|
129
|
+
},
|
|
130
|
+
"peerDependencies": {
|
|
131
|
+
"@json-render/core": "0.18.0",
|
|
132
|
+
"@json-render/react": "0.18.0",
|
|
133
|
+
"react": "^19.2.3",
|
|
134
|
+
"typescript": "^5"
|
|
135
|
+
},
|
|
136
|
+
"peerDependenciesMeta": {
|
|
137
|
+
"@json-render/core": {
|
|
138
|
+
"optional": true
|
|
139
|
+
},
|
|
140
|
+
"@json-render/react": {
|
|
141
|
+
"optional": true
|
|
142
|
+
},
|
|
143
|
+
"react": {
|
|
144
|
+
"optional": true
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"dependencies": {
|
|
148
|
+
"@noble/hashes": "2.0.1",
|
|
149
|
+
"@noble/secp256k1": "2.3.0",
|
|
150
|
+
"@scure/bip32": "2.0.1",
|
|
151
|
+
"@noble/ciphers": "2.1.1",
|
|
152
|
+
"@noble/curves": "2.0.1",
|
|
153
|
+
"@scure/bip39": "2.0.1",
|
|
154
|
+
"@secondlayer/subgraphs": "^0.11.7",
|
|
155
|
+
"@secondlayer/workflows": "^1.1.0",
|
|
156
|
+
"ai": "6.0.167",
|
|
157
|
+
"zod": "^4.3.6"
|
|
158
|
+
}
|
|
107
159
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/clarity/prettyPrint.ts", "../src/clarity/abi/converters.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import { hexToBytes, bytesToAscii, asciiToBytes, utf8ToBytes } from \"../utils/encoding.ts\";\nimport type { ClarityValue } from \"./types.ts\";\n\nexport function prettyPrint(val: ClarityValue, encoding: \"tryAscii\" | \"hex\" = \"hex\"): string | undefined {\n switch (val.type) {\n case \"true\":\n return \"true\";\n case \"false\":\n return \"false\";\n case \"int\":\n return val.value.toString();\n case \"uint\":\n return `u${val.value.toString()}`;\n case \"buffer\":\n if (encoding === \"tryAscii\") {\n const str = bytesToAscii(hexToBytes(val.value));\n if (/^[ -~]*$/.test(str)) return JSON.stringify(str);\n }\n return `0x${val.value}`;\n case \"none\":\n return \"none\";\n case \"some\":\n return `(some ${prettyPrint(val.value, encoding)})`;\n case \"ok\":\n return `(ok ${prettyPrint(val.value, encoding)})`;\n case \"err\":\n return `(err ${prettyPrint(val.value, encoding)})`;\n case \"address\":\n case \"contract\":\n return val.value;\n case \"list\":\n return `(list ${val.value.map((v) => prettyPrint(v, encoding)).join(\" \")})`;\n case \"tuple\":\n return `(tuple ${Object.keys(val.value)\n .map((key) => `(${key} ${prettyPrint(val.value[key]!, encoding)})`)\n .join(\" \")})`;\n case \"ascii\":\n return `\"${val.value}\"`;\n case \"utf8\":\n return `u\"${val.value}\"`;\n }\n}\n\nexport function cvToJSON(val: ClarityValue): any {\n switch (val.type) {\n case \"true\":\n return { type: \"bool\", value: true };\n case \"false\":\n return { type: \"bool\", value: false };\n case \"int\":\n return { type: \"int\", value: val.value.toString() };\n case \"uint\":\n return { type: \"uint\", value: val.value.toString() };\n case \"buffer\":\n return { type: `(buff ${Math.ceil(val.value.length / 2)})`, value: `0x${val.value}` };\n case \"none\":\n return { type: \"(optional none)\", value: null };\n case \"some\":\n return { type: `(optional)`, value: cvToJSON(val.value) };\n case \"ok\":\n return { type: \"(response)\", value: cvToJSON(val.value), success: true };\n case \"err\":\n return { type: \"(response)\", value: cvToJSON(val.value), success: false };\n case \"address\":\n case \"contract\":\n return { type: \"principal\", value: val.value };\n case \"list\":\n return { type: \"(list)\", value: val.value.map(cvToJSON) };\n case \"tuple\": {\n const result: Record<string, any> = {};\n for (const key of Object.keys(val.value)) {\n result[key] = cvToJSON(val.value[key]!);\n }\n return { type: \"(tuple)\", value: result };\n }\n case \"ascii\":\n return { type: `(string-ascii ${asciiToBytes(val.value).length})`, value: val.value };\n case \"utf8\":\n return { type: `(string-utf8 ${utf8ToBytes(val.value).length})`, value: val.value };\n }\n}\n\nexport function cvToValue(val: ClarityValue): any {\n switch (val.type) {\n case \"true\":\n return true;\n case \"false\":\n return false;\n case \"int\":\n case \"uint\":\n return val.value;\n case \"buffer\":\n return `0x${val.value}`;\n case \"none\":\n return null;\n case \"some\":\n return cvToValue(val.value);\n case \"ok\":\n case \"err\":\n return cvToValue(val.value);\n case \"address\":\n case \"contract\":\n return val.value;\n case \"list\":\n return val.value.map(cvToValue);\n case \"tuple\": {\n const result: Record<string, any> = {};\n for (const key of Object.keys(val.value)) {\n result[key] = cvToValue(val.value[key]!);\n }\n return result;\n }\n case \"ascii\":\n case \"utf8\":\n return val.value;\n }\n}\n",
|
|
6
|
-
"import type { AbiType } from \"./types.ts\";\nimport type { AbiFunction } from \"./contract.ts\";\nimport {\n isUint128,\n isInt128,\n isBool,\n isPrincipal,\n isString,\n isUint8Array,\n isAbiList,\n isAbiTuple,\n isAbiOptional,\n isAbiResponse,\n isAbiBuffer,\n isAbiStringAscii,\n isAbiStringUtf8,\n} from \"./guards.ts\";\nimport { toCamelCase } from \"./utils.ts\";\n\nexport class ClarityConversionError extends Error {\n constructor(\n message: string,\n public readonly type: AbiType,\n public readonly value: unknown,\n ) {\n super(message);\n this.name = \"ClarityConversionError\";\n }\n}\n\nexport function jsToClarity(type: AbiType, value: unknown): unknown {\n if (type === \"none\") return null;\n\n if (type === \"uint128\") {\n if (!isUint128(value))\n throw new ClarityConversionError(\"Invalid uint128 value\", type, value);\n return value;\n }\n\n if (type === \"int128\") {\n if (!isInt128(value))\n throw new ClarityConversionError(\"Invalid int128 value\", type, value);\n return value;\n }\n\n if (type === \"bool\") {\n if (!isBool(value))\n throw new ClarityConversionError(\"Invalid bool value\", type, value);\n return value;\n }\n\n if (type === \"principal\") {\n if (!isPrincipal(value))\n throw new ClarityConversionError(\"Invalid principal value\", type, value);\n return value;\n }\n\n if (type === \"trait_reference\") {\n if (!isPrincipal(value))\n throw new ClarityConversionError(\n \"Invalid trait_reference value\",\n type,\n value,\n );\n return value;\n }\n\n if (isAbiStringAscii(type)) {\n if (!isString(value))\n throw new ClarityConversionError(\n \"Invalid string-ascii value\",\n type,\n value,\n );\n const str = value as string;\n for (let i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) > 127) {\n throw new ClarityConversionError(\n `Non-ASCII character at position ${i}: '${str[i]}' (code ${str.charCodeAt(i)})`,\n type,\n value,\n );\n }\n }\n if (str.length > type[\"string-ascii\"].length) {\n throw new ClarityConversionError(\n `String length ${str.length} exceeds max ${type[\"string-ascii\"].length}`,\n type,\n value,\n );\n }\n return value;\n }\n\n if (isAbiStringUtf8(type)) {\n if (!isString(value))\n throw new ClarityConversionError(\n \"Invalid string-utf8 value\",\n type,\n value,\n );\n const str = value as string;\n const byteLength = new TextEncoder().encode(str).length;\n if (byteLength > type[\"string-utf8\"].length) {\n throw new ClarityConversionError(\n `String byte length ${byteLength} exceeds max ${type[\"string-utf8\"].length}`,\n type,\n value,\n );\n }\n return value;\n }\n\n if (isAbiBuffer(type)) {\n if (!isUint8Array(value))\n throw new ClarityConversionError(\"Invalid buffer value\", type, value);\n const buff = value as Uint8Array;\n if (buff.length > type.buff.length) {\n throw new ClarityConversionError(\n `Buffer length ${buff.length} exceeds max ${type.buff.length}`,\n type,\n value,\n );\n }\n return value;\n }\n\n if (isAbiList(type)) {\n if (!Array.isArray(value))\n throw new ClarityConversionError(\n \"Expected array for list type\",\n type,\n value,\n );\n if (value.length > type.list.length) {\n throw new ClarityConversionError(\n `List length ${value.length} exceeds max ${type.list.length}`,\n type,\n value,\n );\n }\n return value.map((item) => jsToClarity(type.list.type, item));\n }\n\n if (isAbiTuple(type)) {\n if (typeof value !== \"object\" || value === null)\n throw new ClarityConversionError(\n \"Expected object for tuple type\",\n type,\n value,\n );\n const result: Record<string, unknown> = {};\n for (const field of type.tuple) {\n const camelKey = toCamelCase(field.name);\n const hasOriginal = field.name in (value as object);\n const hasCamel = camelKey in (value as object);\n if (!hasOriginal && !hasCamel) {\n throw new ClarityConversionError(\n `Missing tuple field: ${field.name}`,\n type,\n value,\n );\n }\n const fieldValue = hasOriginal\n ? (value as Record<string, unknown>)[field.name]\n : (value as Record<string, unknown>)[camelKey];\n result[field.name] = jsToClarity(field.type, fieldValue);\n }\n return result;\n }\n\n if (isAbiOptional(type)) {\n if (value === null || value === undefined) return null;\n return jsToClarity(type.optional, value);\n }\n\n if (isAbiResponse(type)) {\n if (typeof value !== \"object\" || value === null)\n throw new ClarityConversionError(\n \"Expected object for response type\",\n type,\n value,\n );\n const hasOk = \"ok\" in value;\n const hasErr = \"err\" in value;\n if (hasOk && !hasErr) {\n return {\n ok: jsToClarity(type.response.ok, (value as { ok: unknown }).ok),\n };\n }\n if (hasErr && !hasOk) {\n return {\n err: jsToClarity(\n type.response.error,\n (value as { err: unknown }).err,\n ),\n };\n }\n throw new ClarityConversionError(\n \"Response must have exactly 'ok' or 'err' property\",\n type,\n value,\n );\n }\n\n throw new ClarityConversionError(`Unknown Clarity type`, type, value);\n}\n\nexport function prepareArgs<F extends AbiFunction>(\n func: F,\n args: Record<string, unknown>,\n): unknown[] {\n return func.args.map((arg) => {\n if (!(arg.name in args)) {\n throw new ClarityConversionError(\n `Missing argument: ${arg.name}`,\n arg.type,\n undefined,\n );\n }\n return jsToClarity(arg.type, args[arg.name]);\n });\n}\n\nexport function validateArgs<F extends AbiFunction>(\n func: F,\n args: Record<string, unknown>,\n): void {\n for (const arg of func.args) {\n if (!(arg.name in args)) {\n throw new ClarityConversionError(\n `Missing argument: ${arg.name}`,\n arg.type,\n undefined,\n );\n }\n jsToClarity(arg.type, args[arg.name]);\n }\n}\n\nexport function validateArgsArray<F extends AbiFunction>(\n func: F,\n args: unknown[],\n): void {\n if (args.length !== func.args.length) {\n throw new ClarityConversionError(\n `Expected ${func.args.length} arguments, got ${args.length}`,\n func.args[0]?.type ?? \"bool\",\n args,\n );\n }\n func.args.forEach((arg, i) => {\n jsToClarity(arg.type, args[i]);\n });\n}\n"
|
|
7
|
-
],
|
|
8
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,SAAS,WAAW,CAAC,KAAmB,WAA+B,OAA2B;AAAA,EACvG,QAAQ,IAAI;AAAA,SACL;AAAA,MACH,OAAO;AAAA,S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,IAAI,KAAK,WAAW,KAAK,KAAK,QAAQ;AAAA,IACpC,MAAM,IAAI,uBACR,YAAY,KAAK,KAAK,yBAAyB,KAAK,UACpD,KAAK,KAAK,IAAI,QAAQ,QACtB,IACF;AAAA,EACF;AAAA,EACA,KAAK,KAAK,QAAQ,CAAC,KAAK,MAAM;AAAA,IAC5B,YAAY,IAAI,MAAM,KAAK,EAAE;AAAA,GAC9B;AAAA;",
|
|
9
|
-
"debugId": "72D7A0CDC9AC36C164756E2164756E21",
|
|
10
|
-
"names": []
|
|
11
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/actions/public/getNonce.ts", "../src/actions/public/readContract.ts", "../src/actions/public/getMapEntry.ts", "../src/actions/public/estimateFee.ts", "../src/errors/transaction.ts", "../src/actions/wallet/sendTransaction.ts", "../src/actions/wallet/utils.ts", "../src/actions/wallet/callContract.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import type { Client } from \"../../clients/types.ts\";\n\nexport type GetNonceParams = {\n address: string;\n};\n\nexport type GetNonceResult = {\n nonce: bigint;\n possibleNextNonce: bigint;\n};\n\nexport async function getNonce(\n client: Client,\n params: GetNonceParams\n): Promise<bigint> {\n const data = await client.request(`/v2/accounts/${params.address}`, {\n method: \"GET\",\n });\n return BigInt(data.nonce);\n}\n",
|
|
6
|
-
"import type { Client } from \"../../clients/types.ts\";\nimport type { ClarityValue } from \"../../clarity/types.ts\";\nimport { serializeCVBytes } from \"../../clarity/serialize.ts\";\nimport { deserializeCVBytes } from \"../../clarity/deserialize.ts\";\nimport { bytesToHex, with0x } from \"../../utils/encoding.ts\";\nimport { parseContractId } from \"../../utils/address.ts\";\n\nexport type ReadContractParams = {\n contract: string; // \"address.name\"\n functionName: string;\n args?: ClarityValue[];\n sender?: string;\n};\n\nexport async function readContract<T extends ClarityValue = ClarityValue>(\n client: Client,\n params: ReadContractParams\n): Promise<T> {\n const [address, name] = parseContractId(params.contract);\n const sender = params.sender ?? address;\n\n const serializedArgs = (params.args ?? []).map((arg) =>\n with0x(bytesToHex(serializeCVBytes(arg)))\n );\n\n const data = await client.request(\n `/v2/contracts/call-read/${address}/${name}/${params.functionName}`,\n {\n method: \"POST\",\n body: {\n sender,\n arguments: serializedArgs,\n },\n }\n );\n\n if (data.okay) {\n return deserializeCVBytes<T>(data.result);\n }\n throw new Error(data.cause ?? \"Read-only call failed\");\n}\n",
|
|
7
|
-
"import type { Client } from \"../../clients/types.ts\";\nimport type { ClarityValue } from \"../../clarity/types.ts\";\nimport { serializeCVBytes } from \"../../clarity/serialize.ts\";\nimport { deserializeCVBytes } from \"../../clarity/deserialize.ts\";\nimport { bytesToHex, with0x } from \"../../utils/encoding.ts\";\nimport { parseContractId } from \"../../utils/address.ts\";\n\nexport type GetMapEntryParams = {\n contract: string; // \"address.name\"\n mapName: string;\n key: ClarityValue;\n};\n\nexport async function getMapEntry<T extends ClarityValue = ClarityValue>(\n client: Client,\n params: GetMapEntryParams\n): Promise<T> {\n const [address, name] = parseContractId(params.contract);\n const serializedKey = with0x(bytesToHex(serializeCVBytes(params.key)));\n\n const data = await client.request(\n `/v2/map_entry/${address}/${name}/${params.mapName}`,\n {\n method: \"POST\",\n body: serializedKey,\n }\n );\n\n return deserializeCVBytes<T>(data.data);\n}\n",
|
|
8
|
-
"import type { Client } from \"../../clients/types.ts\";\nimport { bytesToHex } from \"../../utils/encoding.ts\";\nimport { serializePayload, serializeTransaction } from \"../../transactions/wire/serialize.ts\";\nimport type { StacksTransaction } from \"../../transactions/types.ts\";\n\nexport type EstimateFeeParams = {\n transaction: StacksTransaction;\n};\n\nexport type FeeEstimation = {\n feeRate: number;\n fee: number;\n};\n\nexport async function estimateFee(\n client: Client,\n params: EstimateFeeParams\n): Promise<FeeEstimation[]> {\n const payloadHex = bytesToHex(serializePayload(params.transaction.payload));\n const txHex = bytesToHex(serializeTransaction(params.transaction));\n\n const data = await client.request(\"/v2/fees/transaction\", {\n method: \"POST\",\n body: {\n estimated_len: Math.ceil(txHex.length / 2),\n transaction_payload: \"0x\" + payloadHex,\n },\n });\n\n return (data.estimations ?? []).map((e: any) => ({\n feeRate: e.fee_rate,\n fee: e.fee,\n }));\n}\n",
|
|
9
|
-
"import { BaseError } from \"./base.ts\";\n\nexport class TransactionError extends BaseError {\n override name = \"TransactionError\";\n}\n\nexport class BroadcastError extends BaseError {\n override name = \"BroadcastError\";\n txid?: string;\n reason?: string;\n\n constructor(\n message: string,\n options?: { cause?: Error; txid?: string; reason?: string }\n ) {\n super(message, options);\n this.txid = options?.txid;\n this.reason = options?.reason;\n }\n}\n\nexport class SerializationError extends BaseError {\n override name = \"SerializationError\";\n}\n\nexport class SigningError extends BaseError {\n override name = \"SigningError\";\n}\n",
|
|
10
|
-
"import type { Client } from \"../../clients/types.ts\";\nimport { bytesToHex } from \"../../utils/encoding.ts\";\nimport { serializeTransaction } from \"../../transactions/wire/serialize.ts\";\nimport { getTransactionId } from \"../../transactions/signer.ts\";\nimport type { StacksTransaction } from \"../../transactions/types.ts\";\nimport { BroadcastError } from \"../../errors/transaction.ts\";\n\nexport type SendTransactionParams = {\n transaction: StacksTransaction;\n attachment?: Uint8Array | string;\n};\n\nexport type SendTransactionResult = {\n txid: string;\n};\n\n/** Broadcast a signed transaction to the network */\nexport async function sendTransaction(\n client: Client,\n params: SendTransactionParams\n): Promise<SendTransactionResult> {\n const hex = bytesToHex(serializeTransaction(params.transaction));\n\n const body: Record<string, string> = { tx: hex };\n if (params.attachment) {\n body.attachment =\n typeof params.attachment === \"string\"\n ? params.attachment\n : bytesToHex(params.attachment);\n }\n\n const data = await client.request(\"/v2/transactions\", {\n method: \"POST\",\n body,\n });\n\n if (data.error) {\n throw new BroadcastError(data.reason ?? data.error, {\n reason: data.reason,\n });\n }\n\n const txid =\n typeof data === \"string\"\n ? data.replace(/\"/g, \"\")\n : data.txid ?? getTransactionId(params.transaction);\n\n return { txid };\n}\n",
|
|
11
|
-
"import type { Account } from \"../../clients/types.ts\";\nimport type { ProviderAccount } from \"../../accounts/types.ts\";\n\nexport function isProviderAccount(account: Account): account is ProviderAccount {\n return account.type === \"provider\";\n}\n",
|
|
12
|
-
"import type { Client } from \"../../clients/types.ts\";\nimport type { ClarityValue } from \"../../clarity/types.ts\";\nimport type { PostCondition } from \"../../postconditions/types.ts\";\nimport type { IntegerType } from \"../../utils/encoding.ts\";\nimport { parseContractId } from \"../../utils/address.ts\";\nimport { buildContractCall } from \"../../transactions/build.ts\";\nimport { signTransactionWithAccount } from \"../../transactions/signer.ts\";\nimport { sendTransaction } from \"./sendTransaction.ts\";\nimport { getNonce } from \"../public/getNonce.ts\";\nimport { estimateFee } from \"../public/estimateFee.ts\";\nimport { isProviderAccount } from \"./utils.ts\";\n\nexport type CallContractParams = {\n contract: string; // \"address.name\"\n functionName: string;\n functionArgs?: ClarityValue[];\n fee?: IntegerType;\n nonce?: IntegerType;\n postConditionMode?: \"allow\" | \"deny\";\n postConditions?: PostCondition[];\n};\n\n/** Build, sign, and broadcast a contract call */\nexport async function callContract(\n client: Client,\n params: CallContractParams\n): Promise<string> {\n const account = client.account;\n if (!account) throw new Error(\"Account required\");\n\n // Provider: delegate to wallet\n if (isProviderAccount(account)) {\n const result = await account.provider.request(\"stx_callContract\", {\n contract: params.contract,\n functionName: params.functionName,\n functionArgs: params.functionArgs ?? [],\n });\n return result.txid;\n }\n\n // Local/Custom: build → sign → broadcast\n const [contractAddress, contractName] = parseContractId(params.contract);\n\n const nonce =\n params.nonce ?? await getNonce(client, { address: account.address });\n\n const unsigned = buildContractCall({\n contractAddress,\n contractName,\n functionName: params.functionName,\n functionArgs: params.functionArgs ?? [],\n fee: params.fee ?? 0n,\n nonce,\n publicKey: account.publicKey,\n chain: client.chain,\n postConditionMode: params.postConditionMode,\n postConditions: params.postConditions,\n });\n\n if (params.fee === undefined) {\n const estimates = await estimateFee(client, { transaction: unsigned });\n const mid = estimates[1] ?? estimates[0];\n if (mid) {\n (unsigned.auth.spendingCondition as any).fee = BigInt(mid.fee);\n }\n }\n\n const signed = await signTransactionWithAccount(unsigned, account);\n const result = await sendTransaction(client, { transaction: signed });\n return result.txid;\n}\n"
|
|
13
|
-
],
|
|
14
|
-
"mappings": ";AAWA,eAAsB,QAAQ,CAC5B,QACA,QACiB;AAAA,EACjB,MAAM,OAAO,MAAM,OAAO,QAAQ,gBAAgB,OAAO,WAAW;AAAA,IAClE,QAAQ;AAAA,EACV,CAAC;AAAA,EACD,OAAO,OAAO,KAAK,KAAK;AAAA;;;ACJ1B,eAAsB,YAAmD,CACvE,QACA,QACY;AAAA,EACZ,OAAO,SAAS,QAAQ,gBAAgB,OAAO,QAAQ;AAAA,EACvD,MAAM,SAAS,OAAO,UAAU;AAAA,EAEhC,MAAM,kBAAkB,OAAO,QAAQ,CAAC,GAAG,IAAI,CAAC,QAC9C,OAAO,WAAW,iBAAiB,GAAG,CAAC,CAAC,CAC1C;AAAA,EAEA,MAAM,OAAO,MAAM,OAAO,QACxB,2BAA2B,WAAW,QAAQ,OAAO,gBACrD;AAAA,IACE,QAAQ;AAAA,IACR,MAAM;AAAA,MACJ;AAAA,MACA,WAAW;AAAA,IACb;AAAA,EACF,CACF;AAAA,EAEA,IAAI,KAAK,MAAM;AAAA,IACb,OAAO,mBAAsB,KAAK,MAAM;AAAA,EAC1C;AAAA,EACA,MAAM,IAAI,MAAM,KAAK,SAAS,uBAAuB;AAAA;;;AC1BvD,eAAsB,WAAkD,CACtE,QACA,QACY;AAAA,EACZ,OAAO,SAAS,QAAQ,gBAAgB,OAAO,QAAQ;AAAA,EACvD,MAAM,gBAAgB,OAAO,WAAW,iBAAiB,OAAO,GAAG,CAAC,CAAC;AAAA,EAErE,MAAM,OAAO,MAAM,OAAO,QACxB,iBAAiB,WAAW,QAAQ,OAAO,WAC3C;AAAA,IACE,QAAQ;AAAA,IACR,MAAM;AAAA,EACR,CACF;AAAA,EAEA,OAAO,mBAAsB,KAAK,IAAI;AAAA;;;ACdxC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SAAS,MAAM,2BAA2B,UAAU,OAAO;AAAA,EACjE,MAAM,SAAS,MAAM,gBAAgB,QAAQ,EAAE,aAAa,OAAO,CAAC;AAAA,EACpE,OAAO,OAAO;AAAA;",
|
|
15
|
-
"debugId": "298B41CF751E957264756E2164756E21",
|
|
16
|
-
"names": []
|
|
17
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/transactions/wire/deserialize.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import {\n bytesToHex,\n hexToBytes,\n bytesToAscii,\n bytesToUtf8,\n without0x,\n} from \"../../utils/encoding.ts\";\nimport { c32address } from \"../../utils/c32.ts\";\nimport {\n AuthType,\n PayloadType,\n AddressHashMode,\n PostConditionPrincipalId,\n AssetType,\n RECOVERABLE_ECDSA_SIG_LENGTH_BYTES,\n MEMO_MAX_LENGTH_BYTES,\n COINBASE_BYTES_LENGTH,\n VRF_PROOF_BYTES_LENGTH,\n MICROBLOCK_HEADER_BYTES_LENGTH,\n type StacksTransaction,\n type Authorization,\n type SpendingCondition,\n type TransactionPayload,\n type PostConditionWire,\n type PostConditionPrincipalWire,\n type AssetInfoWire,\n type TransactionAuthField,\n type AnchorMode,\n type PostConditionModeWire,\n type ClarityVersion,\n type TenureChangeCause,\n} from \"../types.ts\";\nimport type { ClarityValue } from \"../../clarity/types.ts\";\nimport { clarityTypeFromByte } from \"../../clarity/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 \"../../clarity/values.ts\";\nimport { bytesToTwosBigInt } from \"../../utils/encoding.ts\";\n\nclass Reader {\n private data: Uint8Array;\n public offset = 0;\n\n constructor(data: Uint8Array) {\n this.data = data;\n }\n\n readUInt8(): number {\n return this.data[this.offset++]!;\n }\n\n readUInt16BE(): number {\n const val = ((this.data[this.offset]! << 8) | this.data[this.offset + 1]!) >>> 0;\n this.offset += 2;\n return val;\n }\n\n readUInt32BE(): number {\n const val =\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 val;\n }\n\n readBytes(length: number): Uint8Array {\n if (this.offset + length > this.data.length) {\n throw new Error(`Buffer underflow: need ${length} bytes at offset ${this.offset}, have ${this.data.length}`);\n }\n const slice = this.data.slice(this.offset, this.offset + length);\n this.offset += length;\n return slice;\n }\n\n readBigUInt64BE(): bigint {\n const bytes = this.readBytes(8);\n const hex = bytesToHex(bytes);\n return hex.length > 0 ? BigInt(`0x${hex}`) : 0n;\n }\n}\n\nfunction readAddress(r: Reader): string {\n const version = r.readUInt8();\n const hash160 = bytesToHex(r.readBytes(20));\n return c32address(version, hash160);\n}\n\nfunction readLPString(r: Reader, prefixBytes = 1): string {\n let length = 0;\n for (let i = 0; i < prefixBytes; i++) {\n length = (length << 8) | r.readUInt8();\n }\n return bytesToUtf8(r.readBytes(length));\n}\n\nfunction readCV(r: Reader): ClarityValue {\n const typeByte = r.readUInt8();\n const type = clarityTypeFromByte(typeByte);\n\n switch (type) {\n case \"int\":\n return intCV(bytesToTwosBigInt(r.readBytes(16)));\n case \"uint\":\n return uintCV(r.readBytes(16));\n case \"true\":\n return trueCV();\n case \"false\":\n return falseCV();\n case \"buffer\": {\n const len = r.readUInt32BE();\n return bufferCV(r.readBytes(len));\n }\n case \"none\":\n return noneCV();\n case \"some\":\n return someCV(readCV(r));\n case \"ok\":\n return responseOkCV(readCV(r));\n case \"err\":\n return responseErrorCV(readCV(r));\n case \"address\":\n return standardPrincipalCV(readAddress(r));\n case \"contract\": {\n const addr = readAddress(r);\n const name = readLPString(r);\n return contractPrincipalCV(addr, name);\n }\n case \"list\": {\n const len = r.readUInt32BE();\n const items: ClarityValue[] = [];\n for (let i = 0; i < len; i++) items.push(readCV(r));\n return listCV(items);\n }\n case \"tuple\": {\n const len = r.readUInt32BE();\n const data: Record<string, ClarityValue> = {};\n for (let i = 0; i < len; i++) {\n const key = readLPString(r);\n data[key] = readCV(r);\n }\n return tupleCV(data);\n }\n case \"ascii\": {\n const len = r.readUInt32BE();\n return stringAsciiCV(bytesToAscii(r.readBytes(len)));\n }\n case \"utf8\": {\n const len = r.readUInt32BE();\n return stringUtf8CV(bytesToUtf8(r.readBytes(len)));\n }\n default:\n throw new Error(`Unknown clarity type: ${type}`);\n }\n}\n\nfunction readSpendingCondition(r: Reader): SpendingCondition {\n const hashMode = r.readUInt8();\n const signer = bytesToHex(r.readBytes(20));\n const nonce = r.readBigUInt64BE();\n const fee = r.readBigUInt64BE();\n\n if (hashMode === AddressHashMode.P2PKH || hashMode === AddressHashMode.P2WPKH) {\n const keyEncoding = r.readUInt8();\n const signature = bytesToHex(r.readBytes(RECOVERABLE_ECDSA_SIG_LENGTH_BYTES));\n return { hashMode, signer, nonce, fee, keyEncoding, signature } as SpendingCondition;\n }\n\n const fieldCount = r.readUInt32BE();\n const fields: TransactionAuthField[] = [];\n for (let i = 0; i < fieldCount; i++) {\n const fieldType = r.readUInt8();\n if (fieldType <= 0x01) {\n const keyLen = fieldType === 0x00 ? 33 : 65;\n fields.push({\n type: \"publicKey\",\n pubKeyEncoding: fieldType as 0x00 | 0x01,\n data: bytesToHex(r.readBytes(keyLen)),\n });\n } else {\n fields.push({\n type: \"signature\",\n pubKeyEncoding: (fieldType === 0x02 ? 0x00 : 0x01) as 0x00 | 0x01,\n data: bytesToHex(r.readBytes(RECOVERABLE_ECDSA_SIG_LENGTH_BYTES)),\n });\n }\n }\n const signaturesRequired = r.readUInt16BE();\n\n return { hashMode, signer, nonce, fee, fields, signaturesRequired } as SpendingCondition;\n}\n\nfunction readAuthorization(r: Reader): Authorization {\n const authType = r.readUInt8();\n const spendingCondition = readSpendingCondition(r);\n\n if (authType === AuthType.Standard) {\n return { authType: AuthType.Standard, spendingCondition };\n }\n\n const sponsorSpendingCondition = readSpendingCondition(r);\n return {\n authType: AuthType.Sponsored,\n spendingCondition,\n sponsorSpendingCondition,\n };\n}\n\nfunction readAssetInfo(r: Reader): AssetInfoWire {\n return {\n address: readAddress(r),\n contractName: readLPString(r),\n assetName: readLPString(r),\n };\n}\n\nfunction readPostConditionPrincipal(r: Reader): PostConditionPrincipalWire {\n const type = r.readUInt8();\n switch (type) {\n case PostConditionPrincipalId.Origin:\n return { type: \"origin\" };\n case PostConditionPrincipalId.Standard:\n return { type: \"standard\", address: readAddress(r) };\n case PostConditionPrincipalId.Contract:\n return { type: \"contract\", address: readAddress(r), contractName: readLPString(r) };\n default:\n // Some legacy transactions may have unexpected principal types.\n // Treat as origin to allow deserialization to continue.\n return { type: \"origin\" };\n }\n}\n\nfunction readPostConditions(r: Reader): PostConditionWire[] {\n const count = r.readUInt32BE();\n const pcs: PostConditionWire[] = [];\n for (let i = 0; i < count; i++) {\n // Wire order: asset_type, then principal (per SIP-005 and stacks.js)\n const assetType = r.readUInt8();\n const principal = readPostConditionPrincipal(r);\n switch (assetType) {\n case AssetType.STX:\n pcs.push({ type: \"stx\", principal, conditionCode: r.readUInt8(), amount: r.readBigUInt64BE() });\n break;\n case AssetType.Fungible:\n pcs.push({ type: \"ft\", principal, asset: readAssetInfo(r), conditionCode: r.readUInt8(), amount: r.readBigUInt64BE() });\n break;\n case AssetType.NonFungible:\n pcs.push({ type: \"nft\", principal, asset: readAssetInfo(r), assetId: readCV(r), conditionCode: r.readUInt8() });\n break;\n }\n }\n return pcs;\n}\n\nfunction readPayload(r: Reader): TransactionPayload {\n const payloadType = r.readUInt8();\n\n switch (payloadType) {\n case PayloadType.TokenTransfer: {\n const recipient = readCV(r);\n const amount = r.readBigUInt64BE();\n // Memo is a flat 34-byte field (no length prefix) per SIP-005\n const memoBytes = r.readBytes(MEMO_MAX_LENGTH_BYTES);\n const memo = bytesToAscii(memoBytes).replace(/\\0+$/, \"\");\n return { payloadType: PayloadType.TokenTransfer, recipient, amount, memo };\n }\n case PayloadType.ContractCall: {\n const contractAddress = readAddress(r);\n const contractName = readLPString(r);\n const functionName = readLPString(r);\n const numArgs = r.readUInt32BE();\n const functionArgs: ClarityValue[] = [];\n for (let i = 0; i < numArgs; i++) functionArgs.push(readCV(r));\n return { payloadType: PayloadType.ContractCall, contractAddress, contractName, functionName, functionArgs };\n }\n case PayloadType.SmartContract: {\n const contractName = readLPString(r);\n const codeBody = readLPString(r, 4);\n return { payloadType: PayloadType.SmartContract, contractName, codeBody };\n }\n case PayloadType.VersionedSmartContract: {\n const clarityVersion = r.readUInt8() as ClarityVersion;\n const contractName = readLPString(r);\n const codeBody = readLPString(r, 4);\n return { payloadType: PayloadType.VersionedSmartContract, clarityVersion, contractName, codeBody };\n }\n case PayloadType.Coinbase: {\n const coinbaseBuffer = bytesToHex(r.readBytes(COINBASE_BYTES_LENGTH));\n return { payloadType: PayloadType.Coinbase, coinbaseBuffer };\n }\n case PayloadType.CoinbaseToAltRecipient: {\n const coinbaseBuffer = bytesToHex(r.readBytes(COINBASE_BYTES_LENGTH));\n const recipient = readCV(r);\n return { payloadType: PayloadType.CoinbaseToAltRecipient, coinbaseBuffer, recipient };\n }\n case PayloadType.PoisonMicroblock: {\n const header1 = bytesToHex(r.readBytes(MICROBLOCK_HEADER_BYTES_LENGTH));\n const header2 = bytesToHex(r.readBytes(MICROBLOCK_HEADER_BYTES_LENGTH));\n return { payloadType: PayloadType.PoisonMicroblock, header1, header2 };\n }\n case PayloadType.TenureChange: {\n const tenureConsensusHash = bytesToHex(r.readBytes(20));\n const prevTenureConsensusHash = bytesToHex(r.readBytes(20));\n const burnViewConsensusHash = bytesToHex(r.readBytes(20));\n const previousTenureEnd = bytesToHex(r.readBytes(32));\n const previousTenureBlocks = r.readUInt32BE();\n const cause = r.readUInt8() as TenureChangeCause;\n const pubkeyHash = bytesToHex(r.readBytes(20));\n return {\n payloadType: PayloadType.TenureChange,\n tenureConsensusHash,\n prevTenureConsensusHash,\n burnViewConsensusHash,\n previousTenureEnd,\n previousTenureBlocks,\n cause,\n pubkeyHash,\n };\n }\n case PayloadType.NakamotoCoinbase: {\n const coinbaseBuffer = bytesToHex(r.readBytes(COINBASE_BYTES_LENGTH));\n const optionalCV = readCV(r);\n const recipient = optionalCV.type === \"none\" ? null : optionalCV.type === \"some\" ? optionalCV.value : optionalCV;\n const vrfProof = bytesToHex(r.readBytes(VRF_PROOF_BYTES_LENGTH));\n return { payloadType: PayloadType.NakamotoCoinbase, coinbaseBuffer, recipient, vrfProof };\n }\n default:\n throw new Error(`Unknown payload type: ${payloadType}`);\n }\n}\n\nexport function deserializeTransaction(input: string | Uint8Array): StacksTransaction {\n const bytes = typeof input === \"string\" ? hexToBytes(without0x(input)) : input;\n const r = new Reader(bytes);\n\n return {\n version: r.readUInt8(),\n chainId: r.readUInt32BE(),\n auth: readAuthorization(r),\n anchorMode: r.readUInt8() as AnchorMode,\n postConditionMode: r.readUInt8() as PostConditionModeWire,\n postConditions: readPostConditions(r),\n payload: readPayload(r),\n };\n}\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAM,OAAO;AAAA,EACH;AAAA,EACD,SAAS;AAAA,EAEhB,WAAW,CAAC,MAAkB;AAAA,IAC5B,KAAK,OAAO;AAAA;AAAA,EAGd,SAAS,GAAW;AAAA,IAClB,OAAO,KAAK,KAAK,KAAK;AAAA;AAAA,EAGxB,YAAY,GAAW;AAAA,IACrB,MAAM,OAAQ,KAAK,KAAK,KAAK,WAAY,IAAK,KAAK,KAAK,KAAK,SAAS,QAAS;AAAA,IAC/E,KAAK,UAAU;AAAA,IACf,OAAO;AAAA;AAAA,EAGT,YAAY,GAAW;AAAA,IACrB,MAAM,OACF,KAAK,KAAK,KAAK,WAAY,KAC1B,KAAK,KAAK,KAAK,SAAS,MAAO,KAC/B,K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;AAAA,QACL,aAAa,YAAY;AAAA,QACzB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,SACK,YAAY,kBAAkB;AAAA,MACjC,MAAM,iBAAiB,WAAW,EAAE,UAAU,qBAAqB,CAAC;AAAA,MACpE,MAAM,aAAa,OAAO,CAAC;AAAA,MAC3B,MAAM,YAAY,WAAW,SAAS,SAAS,OAAO,WAAW,SAAS,SAAS,WAAW,QAAQ;AAAA,MACtG,MAAM,WAAW,WAAW,EAAE,UAAU,sBAAsB,CAAC;AAAA,MAC/D,OAAO,EAAE,aAAa,YAAY,kBAAkB,gBAAgB,WAAW,SAAS;AAAA,IAC1F;AAAA;AAAA,MAEE,MAAM,IAAI,MAAM,yBAAyB,aAAa;AAAA;AAAA;AAIrD,SAAS,sBAAsB,CAAC,OAA+C;AAAA,EACpF,MAAM,QAAQ,OAAO,UAAU,WAAW,WAAW,UAAU,KAAK,CAAC,IAAI;AAAA,EACzE,MAAM,IAAI,IAAI,OAAO,KAAK;AAAA,EAE1B,OAAO;AAAA,IACL,SAAS,EAAE,UAAU;AAAA,IACrB,SAAS,EAAE,aAAa;AAAA,IACxB,MAAM,kBAAkB,CAAC;AAAA,IACzB,YAAY,EAAE,UAAU;AAAA,IACxB,mBAAmB,EAAE,UAAU;AAAA,IAC/B,gBAAgB,mBAAmB,CAAC;AAAA,IACpC,SAAS,YAAY,CAAC;AAAA,EACxB;AAAA;",
|
|
8
|
-
"debugId": "D5112D23B379FB5564756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/actions/public/getNonce.ts", "../src/actions/public/readContract.ts", "../src/actions/public/getMapEntry.ts", "../src/actions/public/estimateFee.ts", "../src/errors/transaction.ts", "../src/actions/wallet/sendTransaction.ts", "../src/actions/wallet/utils.ts", "../src/actions/wallet/callContract.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import type { Client } from \"../../clients/types.ts\";\n\nexport type GetNonceParams = {\n address: string;\n};\n\nexport type GetNonceResult = {\n nonce: bigint;\n possibleNextNonce: bigint;\n};\n\nexport async function getNonce(\n client: Client,\n params: GetNonceParams\n): Promise<bigint> {\n const data = await client.request(`/v2/accounts/${params.address}`, {\n method: \"GET\",\n });\n return BigInt(data.nonce);\n}\n",
|
|
6
|
-
"import type { Client } from \"../../clients/types.ts\";\nimport type { ClarityValue } from \"../../clarity/types.ts\";\nimport { serializeCVBytes } from \"../../clarity/serialize.ts\";\nimport { deserializeCVBytes } from \"../../clarity/deserialize.ts\";\nimport { bytesToHex, with0x } from \"../../utils/encoding.ts\";\nimport { parseContractId } from \"../../utils/address.ts\";\n\nexport type ReadContractParams = {\n contract: string; // \"address.name\"\n functionName: string;\n args?: ClarityValue[];\n sender?: string;\n};\n\nexport async function readContract<T extends ClarityValue = ClarityValue>(\n client: Client,\n params: ReadContractParams\n): Promise<T> {\n const [address, name] = parseContractId(params.contract);\n const sender = params.sender ?? address;\n\n const serializedArgs = (params.args ?? []).map((arg) =>\n with0x(bytesToHex(serializeCVBytes(arg)))\n );\n\n const data = await client.request(\n `/v2/contracts/call-read/${address}/${name}/${params.functionName}`,\n {\n method: \"POST\",\n body: {\n sender,\n arguments: serializedArgs,\n },\n }\n );\n\n if (data.okay) {\n return deserializeCVBytes<T>(data.result);\n }\n throw new Error(data.cause ?? \"Read-only call failed\");\n}\n",
|
|
7
|
-
"import type { Client } from \"../../clients/types.ts\";\nimport type { ClarityValue } from \"../../clarity/types.ts\";\nimport { serializeCVBytes } from \"../../clarity/serialize.ts\";\nimport { deserializeCVBytes } from \"../../clarity/deserialize.ts\";\nimport { bytesToHex, with0x } from \"../../utils/encoding.ts\";\nimport { parseContractId } from \"../../utils/address.ts\";\n\nexport type GetMapEntryParams = {\n contract: string; // \"address.name\"\n mapName: string;\n key: ClarityValue;\n};\n\nexport async function getMapEntry<T extends ClarityValue = ClarityValue>(\n client: Client,\n params: GetMapEntryParams\n): Promise<T> {\n const [address, name] = parseContractId(params.contract);\n const serializedKey = with0x(bytesToHex(serializeCVBytes(params.key)));\n\n const data = await client.request(\n `/v2/map_entry/${address}/${name}/${params.mapName}`,\n {\n method: \"POST\",\n body: serializedKey,\n }\n );\n\n return deserializeCVBytes<T>(data.data);\n}\n",
|
|
8
|
-
"import type { Client } from \"../../clients/types.ts\";\nimport { bytesToHex } from \"../../utils/encoding.ts\";\nimport { serializePayload, serializeTransaction } from \"../../transactions/wire/serialize.ts\";\nimport type { StacksTransaction } from \"../../transactions/types.ts\";\n\nexport type EstimateFeeParams = {\n transaction: StacksTransaction;\n};\n\nexport type FeeEstimation = {\n feeRate: number;\n fee: number;\n};\n\nexport async function estimateFee(\n client: Client,\n params: EstimateFeeParams\n): Promise<FeeEstimation[]> {\n const payloadHex = bytesToHex(serializePayload(params.transaction.payload));\n const txHex = bytesToHex(serializeTransaction(params.transaction));\n\n const data = await client.request(\"/v2/fees/transaction\", {\n method: \"POST\",\n body: {\n estimated_len: Math.ceil(txHex.length / 2),\n transaction_payload: \"0x\" + payloadHex,\n },\n });\n\n return (data.estimations ?? []).map((e: any) => ({\n feeRate: e.fee_rate,\n fee: e.fee,\n }));\n}\n",
|
|
9
|
-
"import { BaseError } from \"./base.ts\";\n\nexport class TransactionError extends BaseError {\n override name = \"TransactionError\";\n}\n\nexport class BroadcastError extends BaseError {\n override name = \"BroadcastError\";\n txid?: string;\n reason?: string;\n\n constructor(\n message: string,\n options?: { cause?: Error; txid?: string; reason?: string }\n ) {\n super(message, options);\n this.txid = options?.txid;\n this.reason = options?.reason;\n }\n}\n\nexport class SerializationError extends BaseError {\n override name = \"SerializationError\";\n}\n\nexport class SigningError extends BaseError {\n override name = \"SigningError\";\n}\n",
|
|
10
|
-
"import type { Client } from \"../../clients/types.ts\";\nimport { bytesToHex } from \"../../utils/encoding.ts\";\nimport { serializeTransaction } from \"../../transactions/wire/serialize.ts\";\nimport { getTransactionId } from \"../../transactions/signer.ts\";\nimport type { StacksTransaction } from \"../../transactions/types.ts\";\nimport { BroadcastError } from \"../../errors/transaction.ts\";\n\nexport type SendTransactionParams = {\n transaction: StacksTransaction;\n attachment?: Uint8Array | string;\n};\n\nexport type SendTransactionResult = {\n txid: string;\n};\n\n/** Broadcast a signed transaction to the network */\nexport async function sendTransaction(\n client: Client,\n params: SendTransactionParams\n): Promise<SendTransactionResult> {\n const hex = bytesToHex(serializeTransaction(params.transaction));\n\n const body: Record<string, string> = { tx: hex };\n if (params.attachment) {\n body.attachment =\n typeof params.attachment === \"string\"\n ? params.attachment\n : bytesToHex(params.attachment);\n }\n\n const data = await client.request(\"/v2/transactions\", {\n method: \"POST\",\n body,\n });\n\n if (data.error) {\n throw new BroadcastError(data.reason ?? data.error, {\n reason: data.reason,\n });\n }\n\n const txid =\n typeof data === \"string\"\n ? data.replace(/\"/g, \"\")\n : data.txid ?? getTransactionId(params.transaction);\n\n return { txid };\n}\n",
|
|
11
|
-
"import type { Account } from \"../../clients/types.ts\";\nimport type { ProviderAccount } from \"../../accounts/types.ts\";\n\nexport function isProviderAccount(account: Account): account is ProviderAccount {\n return account.type === \"provider\";\n}\n",
|
|
12
|
-
"import type { Client } from \"../../clients/types.ts\";\nimport type { ClarityValue } from \"../../clarity/types.ts\";\nimport type { PostCondition } from \"../../postconditions/types.ts\";\nimport type { IntegerType } from \"../../utils/encoding.ts\";\nimport { parseContractId } from \"../../utils/address.ts\";\nimport { buildContractCall } from \"../../transactions/build.ts\";\nimport { signTransactionWithAccount } from \"../../transactions/signer.ts\";\nimport { sendTransaction } from \"./sendTransaction.ts\";\nimport { getNonce } from \"../public/getNonce.ts\";\nimport { estimateFee } from \"../public/estimateFee.ts\";\nimport { isProviderAccount } from \"./utils.ts\";\n\nexport type CallContractParams = {\n contract: string; // \"address.name\"\n functionName: string;\n functionArgs?: ClarityValue[];\n fee?: IntegerType;\n nonce?: IntegerType;\n postConditionMode?: \"allow\" | \"deny\";\n postConditions?: PostCondition[];\n};\n\n/** Build, sign, and broadcast a contract call */\nexport async function callContract(\n client: Client,\n params: CallContractParams\n): Promise<string> {\n const account = client.account;\n if (!account) throw new Error(\"Account required\");\n\n // Provider: delegate to wallet\n if (isProviderAccount(account)) {\n const result = await account.provider.request(\"stx_callContract\", {\n contract: params.contract,\n functionName: params.functionName,\n functionArgs: params.functionArgs ?? [],\n });\n return result.txid;\n }\n\n // Local/Custom: build → sign → broadcast\n const [contractAddress, contractName] = parseContractId(params.contract);\n\n const nonce =\n params.nonce ?? await getNonce(client, { address: account.address });\n\n const unsigned = buildContractCall({\n contractAddress,\n contractName,\n functionName: params.functionName,\n functionArgs: params.functionArgs ?? [],\n fee: params.fee ?? 0n,\n nonce,\n publicKey: account.publicKey,\n chain: client.chain,\n postConditionMode: params.postConditionMode,\n postConditions: params.postConditions,\n });\n\n if (params.fee === undefined) {\n const estimates = await estimateFee(client, { transaction: unsigned });\n const mid = estimates[1] ?? estimates[0];\n if (mid) {\n (unsigned.auth.spendingCondition as any).fee = BigInt(mid.fee);\n }\n }\n\n const signed = await signTransactionWithAccount(unsigned, account);\n const result = await sendTransaction(client, { transaction: signed });\n return result.txid;\n}\n"
|
|
13
|
-
],
|
|
14
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAWA,eAAsB,QAAQ,CAC5B,QACA,QACiB;AAAA,EACjB,MAAM,OAAO,MAAM,OAAO,QAAQ,gBAAgB,OAAO,WAAW;AAAA,IAClE,QAAQ;AAAA,EACV,CAAC;AAAA,EACD,OAAO,OAAO,KAAK,KAAK;AAAA;;;ACJ1B,eAAsB,YAAmD,CACvE,QACA,QACY;AAAA,EACZ,OAAO,SAAS,QAAQ,gBAAgB,OAAO,QAAQ;AAAA,EACvD,MAAM,SAAS,OAAO,UAAU;AAAA,EAEhC,MAAM,kBAAkB,OAAO,QAAQ,CAAC,GAAG,IAAI,CAAC,QAC9C,OAAO,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