@secondlayer/stacks 0.0.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.
- package/README.md +92 -0
- package/dist/shared/stacks-02actsrx.cjs +17 -0
- package/dist/shared/stacks-02actsrx.cjs.map +10 -0
- package/dist/shared/stacks-1aqm7c2h.cjs +110 -0
- package/dist/shared/stacks-1aqm7c2h.cjs.map +11 -0
- package/dist/shared/stacks-24h5k94q.cjs +74 -0
- package/dist/shared/stacks-24h5k94q.cjs.map +11 -0
- package/dist/shared/stacks-2ar4prfz.cjs +328 -0
- package/dist/shared/stacks-2ar4prfz.cjs.map +11 -0
- package/dist/shared/stacks-4py5pm0r.cjs +237 -0
- package/dist/shared/stacks-4py5pm0r.cjs.map +10 -0
- package/dist/shared/stacks-5tprhns9.cjs +54 -0
- package/dist/shared/stacks-5tprhns9.cjs.map +11 -0
- package/dist/shared/stacks-61rvzkz1.cjs +132 -0
- package/dist/shared/stacks-61rvzkz1.cjs.map +17 -0
- package/dist/shared/stacks-709tra19.js +30 -0
- package/dist/shared/stacks-709tra19.js.map +10 -0
- package/dist/shared/stacks-74k8cxgb.cjs +567 -0
- package/dist/shared/stacks-74k8cxgb.cjs.map +13 -0
- package/dist/shared/stacks-8m9byk2j.js +7 -0
- package/dist/shared/stacks-8m9byk2j.js.map +9 -0
- package/dist/shared/stacks-8yykgdww.js +125 -0
- package/dist/shared/stacks-8yykgdww.js.map +11 -0
- package/dist/shared/stacks-9g0jhab3.cjs +40 -0
- package/dist/shared/stacks-9g0jhab3.cjs.map +10 -0
- package/dist/shared/stacks-an5k8n4t.cjs +291 -0
- package/dist/shared/stacks-an5k8n4t.cjs.map +23 -0
- package/dist/shared/stacks-b008c3w8.cjs +214 -0
- package/dist/shared/stacks-b008c3w8.cjs.map +11 -0
- package/dist/shared/stacks-bnvfmt7y.cjs +31 -0
- package/dist/shared/stacks-bnvfmt7y.cjs.map +9 -0
- package/dist/shared/stacks-bycy6t9k.js +22 -0
- package/dist/shared/stacks-bycy6t9k.js.map +10 -0
- package/dist/shared/stacks-d1fmkv3p.js +258 -0
- package/dist/shared/stacks-d1fmkv3p.js.map +13 -0
- package/dist/shared/stacks-dr5en54r.cjs +119 -0
- package/dist/shared/stacks-dr5en54r.cjs.map +10 -0
- package/dist/shared/stacks-dxhntr76.js +278 -0
- package/dist/shared/stacks-dxhntr76.js.map +10 -0
- package/dist/shared/stacks-evnzth1q.cjs +35 -0
- package/dist/shared/stacks-evnzth1q.cjs.map +10 -0
- package/dist/shared/stacks-f3tk2k5s.js +27 -0
- package/dist/shared/stacks-f3tk2k5s.js.map +9 -0
- package/dist/shared/stacks-f7wdrzs3.js +285 -0
- package/dist/shared/stacks-f7wdrzs3.js.map +11 -0
- package/dist/shared/stacks-fcaefc5b.cjs +16 -0
- package/dist/shared/stacks-fcaefc5b.cjs.map +10 -0
- package/dist/shared/stacks-g9mcjcqg.cjs +3 -0
- package/dist/shared/stacks-g9mcjcqg.cjs.map +9 -0
- package/dist/shared/stacks-gck1sq7h.cjs +28 -0
- package/dist/shared/stacks-gck1sq7h.cjs.map +10 -0
- package/dist/shared/stacks-gjvbq6w7.js +46 -0
- package/dist/shared/stacks-gjvbq6w7.js.map +10 -0
- package/dist/shared/stacks-j2cy7qtt.js +237 -0
- package/dist/shared/stacks-j2cy7qtt.js.map +11 -0
- package/dist/shared/stacks-k08tgzyp.cjs +232 -0
- package/dist/shared/stacks-k08tgzyp.cjs.map +13 -0
- package/dist/shared/stacks-k2p5tv6x.js +37 -0
- package/dist/shared/stacks-k2p5tv6x.js.map +10 -0
- package/dist/shared/stacks-k58k970n.js +234 -0
- package/dist/shared/stacks-k58k970n.js.map +10 -0
- package/dist/shared/stacks-n2g56wgg.js +338 -0
- package/dist/shared/stacks-n2g56wgg.js.map +23 -0
- package/dist/shared/stacks-nqytwfcc.js +243 -0
- package/dist/shared/stacks-nqytwfcc.js.map +11 -0
- package/dist/shared/stacks-qcae5852.js +19 -0
- package/dist/shared/stacks-qcae5852.js.map +10 -0
- package/dist/shared/stacks-qt8ehebn.js +76 -0
- package/dist/shared/stacks-qt8ehebn.js.map +11 -0
- package/dist/shared/stacks-qvg7c24g.cjs +232 -0
- package/dist/shared/stacks-qvg7c24g.cjs.map +10 -0
- package/dist/shared/stacks-r1t6g3c3.cjs +241 -0
- package/dist/shared/stacks-r1t6g3c3.cjs.map +11 -0
- package/dist/shared/stacks-tjxmrssa.js +282 -0
- package/dist/shared/stacks-tjxmrssa.js.map +11 -0
- package/dist/shared/stacks-v9jqcpd4.js +18 -0
- package/dist/shared/stacks-v9jqcpd4.js.map +10 -0
- package/dist/shared/stacks-vdfag81a.cjs +121 -0
- package/dist/shared/stacks-vdfag81a.cjs.map +10 -0
- package/dist/shared/stacks-vdfs3e5v.js +134 -0
- package/dist/shared/stacks-vdfs3e5v.js.map +10 -0
- package/dist/shared/stacks-y3dh7hv1.js +60 -0
- package/dist/shared/stacks-y3dh7hv1.js.map +11 -0
- package/dist/shared/stacks-ya3x01yd.cjs +16 -0
- package/dist/shared/stacks-ya3x01yd.cjs.map +10 -0
- package/dist/shared/stacks-yfgsm6ap.js +599 -0
- package/dist/shared/stacks-yfgsm6ap.js.map +13 -0
- package/dist/shared/stacks-yfveb68e.js +121 -0
- package/dist/shared/stacks-yfveb68e.js.map +10 -0
- package/dist/shared/stacks-zm0b3tgy.js +160 -0
- package/dist/shared/stacks-zm0b3tgy.js.map +17 -0
- package/dist/shared/stacks-zyv9qqme.cjs +249 -0
- package/dist/shared/stacks-zyv9qqme.cjs.map +11 -0
- package/dist/src/accounts/index.cjs +90 -0
- package/dist/src/accounts/index.cjs.map +12 -0
- package/dist/src/accounts/index.d.cts +47 -0
- package/dist/src/accounts/index.d.ts +47 -0
- package/dist/src/accounts/index.js +104 -0
- package/dist/src/accounts/index.js.map +12 -0
- package/dist/src/actions/index.cjs +36 -0
- package/dist/src/actions/index.cjs.map +9 -0
- package/dist/src/actions/index.d.cts +886 -0
- package/dist/src/actions/index.d.ts +886 -0
- package/dist/src/actions/index.js +81 -0
- package/dist/src/actions/index.js.map +9 -0
- package/dist/src/bns/index.cjs +590 -0
- package/dist/src/bns/index.cjs.map +15 -0
- package/dist/src/bns/index.d.cts +241 -0
- package/dist/src/bns/index.d.ts +241 -0
- package/dist/src/bns/index.js +611 -0
- package/dist/src/bns/index.js.map +15 -0
- package/dist/src/chains/index.cjs +13 -0
- package/dist/src/chains/index.cjs.map +9 -0
- package/dist/src/chains/index.d.cts +53 -0
- package/dist/src/chains/index.d.ts +53 -0
- package/dist/src/chains/index.js +18 -0
- package/dist/src/chains/index.js.map +9 -0
- package/dist/src/clarity/index.cjs +3 -0
- package/dist/src/clarity/index.cjs.map +9 -0
- package/dist/src/clarity/index.d.cts +821 -0
- package/dist/src/clarity/index.d.ts +821 -0
- package/dist/src/clarity/index.js +145 -0
- package/dist/src/clarity/index.js.map +9 -0
- package/dist/src/connect/index.cjs +480 -0
- package/dist/src/connect/index.cjs.map +19 -0
- package/dist/src/connect/index.d.cts +110 -0
- package/dist/src/connect/index.d.ts +110 -0
- package/dist/src/connect/index.js +448 -0
- package/dist/src/connect/index.js.map +19 -0
- package/dist/src/connect/walletconnect/index.cjs +1322 -0
- package/dist/src/connect/walletconnect/index.cjs.map +18 -0
- package/dist/src/connect/walletconnect/index.d.cts +132 -0
- package/dist/src/connect/walletconnect/index.d.ts +132 -0
- package/dist/src/connect/walletconnect/index.js +1290 -0
- package/dist/src/connect/walletconnect/index.js.map +18 -0
- package/dist/src/index.cjs +557 -0
- package/dist/src/index.cjs.map +21 -0
- package/dist/src/index.d.cts +847 -0
- package/dist/src/index.d.ts +847 -0
- package/dist/src/index.js +629 -0
- package/dist/src/index.js.map +21 -0
- package/dist/src/postconditions/index.cjs +3 -0
- package/dist/src/postconditions/index.cjs.map +9 -0
- package/dist/src/postconditions/index.d.cts +91 -0
- package/dist/src/postconditions/index.d.ts +91 -0
- package/dist/src/postconditions/index.js +12 -0
- package/dist/src/postconditions/index.js.map +9 -0
- package/dist/src/pox/index.cjs +860 -0
- package/dist/src/pox/index.cjs.map +15 -0
- package/dist/src/pox/index.d.cts +244 -0
- package/dist/src/pox/index.d.ts +244 -0
- package/dist/src/pox/index.js +877 -0
- package/dist/src/pox/index.js.map +15 -0
- package/dist/src/stackingdao/index.cjs +300 -0
- package/dist/src/stackingdao/index.cjs.map +13 -0
- package/dist/src/stackingdao/index.d.cts +179 -0
- package/dist/src/stackingdao/index.d.ts +179 -0
- package/dist/src/stackingdao/index.js +318 -0
- package/dist/src/stackingdao/index.js.map +13 -0
- package/dist/src/subscriptions/index.cjs +14 -0
- package/dist/src/subscriptions/index.cjs.map +9 -0
- package/dist/src/subscriptions/index.d.cts +250 -0
- package/dist/src/subscriptions/index.d.ts +250 -0
- package/dist/src/subscriptions/index.js +21 -0
- package/dist/src/subscriptions/index.js.map +9 -0
- package/dist/src/transactions/index.cjs +50 -0
- package/dist/src/transactions/index.cjs.map +9 -0
- package/dist/src/transactions/index.d.cts +412 -0
- package/dist/src/transactions/index.d.ts +412 -0
- package/dist/src/transactions/index.js +101 -0
- package/dist/src/transactions/index.js.map +9 -0
- package/dist/src/utils/index.cjs +168 -0
- package/dist/src/utils/index.cjs.map +11 -0
- package/dist/src/utils/index.d.cts +140 -0
- package/dist/src/utils/index.d.ts +140 -0
- package/dist/src/utils/index.js +222 -0
- package/dist/src/utils/index.js.map +11 -0
- package/package.json +105 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// src/postconditions/index.ts
|
|
2
|
+
var exports_postconditions = {};
|
|
3
|
+
__export(exports_postconditions, {
|
|
4
|
+
Pc: () => Pc
|
|
5
|
+
});
|
|
6
|
+
module.exports = __toCommonJS(exports_postconditions);
|
|
7
|
+
|
|
8
|
+
// src/postconditions/builder.ts
|
|
9
|
+
class PartialPcWithPrincipal {
|
|
10
|
+
address;
|
|
11
|
+
constructor(address) {
|
|
12
|
+
this.address = address;
|
|
13
|
+
}
|
|
14
|
+
willSendEq(amount) {
|
|
15
|
+
return new PartialPcFtWithCode(this.address, amount, "eq");
|
|
16
|
+
}
|
|
17
|
+
willSendGte(amount) {
|
|
18
|
+
return new PartialPcFtWithCode(this.address, amount, "gte");
|
|
19
|
+
}
|
|
20
|
+
willSendGt(amount) {
|
|
21
|
+
return new PartialPcFtWithCode(this.address, amount, "gt");
|
|
22
|
+
}
|
|
23
|
+
willSendLte(amount) {
|
|
24
|
+
return new PartialPcFtWithCode(this.address, amount, "lte");
|
|
25
|
+
}
|
|
26
|
+
willSendLt(amount) {
|
|
27
|
+
return new PartialPcFtWithCode(this.address, amount, "lt");
|
|
28
|
+
}
|
|
29
|
+
willSendAsset() {
|
|
30
|
+
return new PartialPcNftWithCode(this.address, "sent");
|
|
31
|
+
}
|
|
32
|
+
willNotSendAsset() {
|
|
33
|
+
return new PartialPcNftWithCode(this.address, "not-sent");
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
class PartialPcFtWithCode {
|
|
38
|
+
address;
|
|
39
|
+
amount;
|
|
40
|
+
code;
|
|
41
|
+
constructor(address, amount, code) {
|
|
42
|
+
this.address = address;
|
|
43
|
+
this.amount = amount;
|
|
44
|
+
this.code = code;
|
|
45
|
+
}
|
|
46
|
+
ustx() {
|
|
47
|
+
return {
|
|
48
|
+
type: "stx-postcondition",
|
|
49
|
+
address: this.address,
|
|
50
|
+
condition: this.code,
|
|
51
|
+
amount: intToBigInt(this.amount).toString()
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
ft(contractId, tokenName) {
|
|
55
|
+
const [address, name] = contractId.split(".");
|
|
56
|
+
if (!address || !validateStacksAddress(address) || !name) {
|
|
57
|
+
throw new Error(`Invalid contract id: ${contractId}`);
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
type: "ft-postcondition",
|
|
61
|
+
address: this.address,
|
|
62
|
+
condition: this.code,
|
|
63
|
+
amount: intToBigInt(this.amount).toString(),
|
|
64
|
+
asset: `${contractId}::${tokenName}`
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
class PartialPcNftWithCode {
|
|
70
|
+
address;
|
|
71
|
+
code;
|
|
72
|
+
constructor(address, code) {
|
|
73
|
+
this.address = address;
|
|
74
|
+
this.code = code;
|
|
75
|
+
}
|
|
76
|
+
nft(assetOrContractId, tokenNameOrAssetId, assetId) {
|
|
77
|
+
let contractAddress;
|
|
78
|
+
let contractName;
|
|
79
|
+
let tokenName;
|
|
80
|
+
let id;
|
|
81
|
+
if (assetId !== undefined) {
|
|
82
|
+
[contractAddress, contractName] = parseContractId(assetOrContractId);
|
|
83
|
+
tokenName = tokenNameOrAssetId;
|
|
84
|
+
id = assetId;
|
|
85
|
+
} else {
|
|
86
|
+
const [principal, tName] = assetOrContractId.split("::");
|
|
87
|
+
if (!principal || !tName)
|
|
88
|
+
throw new Error(`Invalid asset name: ${assetOrContractId}`);
|
|
89
|
+
[contractAddress, contractName] = parseContractId(principal);
|
|
90
|
+
tokenName = tName;
|
|
91
|
+
id = tokenNameOrAssetId;
|
|
92
|
+
}
|
|
93
|
+
if (!validateStacksAddress(contractAddress)) {
|
|
94
|
+
throw new Error(`Invalid contract address: ${contractAddress}`);
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
type: "nft-postcondition",
|
|
98
|
+
address: this.address,
|
|
99
|
+
condition: this.code,
|
|
100
|
+
asset: `${contractAddress}.${contractName}::${tokenName}`,
|
|
101
|
+
assetId: id
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
var Pc = {
|
|
106
|
+
principal(address) {
|
|
107
|
+
const [addr, name] = address.split(".");
|
|
108
|
+
if (!addr || !validateStacksAddress(addr) || typeof name === "string" && !name) {
|
|
109
|
+
throw new Error(`Invalid principal: ${address}`);
|
|
110
|
+
}
|
|
111
|
+
return new PartialPcWithPrincipal(address);
|
|
112
|
+
},
|
|
113
|
+
origin() {
|
|
114
|
+
return new PartialPcWithPrincipal("origin");
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
//# debugId=60B2774FE4E4DD2564756E2164756E21
|
|
119
|
+
//# sourceMappingURL=stacks-dr5en54r.cjs.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/postconditions/builder.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { intToBigInt, type IntegerType } from \"../utils/encoding.ts\";\nimport { validateStacksAddress, parseContractId } from \"../utils/address.ts\";\nimport type { ClarityValue } from \"../clarity/types.ts\";\nimport type {\n StxPostCondition,\n FtPostCondition,\n NftPostCondition,\n FungibleComparator,\n NonFungibleComparator,\n} from \"./types.ts\";\n\nclass PartialPcWithPrincipal {\n constructor(private address: string) {}\n\n willSendEq(amount: IntegerType) {\n return new PartialPcFtWithCode(this.address, amount, \"eq\");\n }\n willSendGte(amount: IntegerType) {\n return new PartialPcFtWithCode(this.address, amount, \"gte\");\n }\n willSendGt(amount: IntegerType) {\n return new PartialPcFtWithCode(this.address, amount, \"gt\");\n }\n willSendLte(amount: IntegerType) {\n return new PartialPcFtWithCode(this.address, amount, \"lte\");\n }\n willSendLt(amount: IntegerType) {\n return new PartialPcFtWithCode(this.address, amount, \"lt\");\n }\n willSendAsset() {\n return new PartialPcNftWithCode(this.address, \"sent\");\n }\n willNotSendAsset() {\n return new PartialPcNftWithCode(this.address, \"not-sent\");\n }\n}\n\nclass PartialPcFtWithCode {\n constructor(\n private address: string,\n private amount: IntegerType,\n private code: FungibleComparator\n ) {}\n\n ustx(): StxPostCondition {\n return {\n type: \"stx-postcondition\",\n address: this.address,\n condition: this.code,\n amount: intToBigInt(this.amount).toString(),\n };\n }\n\n ft(contractId: string, tokenName: string): FtPostCondition {\n const [address, name] = contractId.split(\".\");\n if (!address || !validateStacksAddress(address) || !name) {\n throw new Error(`Invalid contract id: ${contractId}`);\n }\n return {\n type: \"ft-postcondition\",\n address: this.address,\n condition: this.code,\n amount: intToBigInt(this.amount).toString(),\n asset: `${contractId}::${tokenName}`,\n };\n }\n}\n\nclass PartialPcNftWithCode {\n constructor(\n private address: string,\n private code: NonFungibleComparator\n ) {}\n\n nft(assetOrContractId: string, tokenNameOrAssetId: string | ClarityValue, assetId?: ClarityValue): NftPostCondition {\n let contractAddress: string;\n let contractName: string;\n let tokenName: string;\n let id: ClarityValue;\n\n if (assetId !== undefined) {\n // 3 args: contractId, tokenName, assetId\n [contractAddress, contractName] = parseContractId(assetOrContractId);\n tokenName = tokenNameOrAssetId as string;\n id = assetId;\n } else {\n // 2 args: assetString (addr.contract::token), assetId\n const [principal, tName] = assetOrContractId.split(\"::\");\n if (!principal || !tName) throw new Error(`Invalid asset name: ${assetOrContractId}`);\n [contractAddress, contractName] = parseContractId(principal);\n tokenName = tName;\n id = tokenNameOrAssetId as ClarityValue;\n }\n\n if (!validateStacksAddress(contractAddress)) {\n throw new Error(`Invalid contract address: ${contractAddress}`);\n }\n\n return {\n type: \"nft-postcondition\",\n address: this.address,\n condition: this.code,\n asset: `${contractAddress}.${contractName}::${tokenName}`,\n assetId: id,\n };\n }\n}\n\nexport const Pc = {\n principal(address: string) {\n const [addr, name] = address.split(\".\");\n if (!addr || !validateStacksAddress(addr) || (typeof name === \"string\" && !name)) {\n throw new Error(`Invalid principal: ${address}`);\n }\n return new PartialPcWithPrincipal(address);\n },\n origin() {\n return new PartialPcWithPrincipal(\"origin\");\n },\n};\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;;;AAWA,MAAM,uBAAuB;AAAA,EACP;AAAA,EAApB,WAAW,CAAS,SAAiB;AAAA,IAAjB;AAAA;AAAA,EAEpB,UAAU,CAAC,QAAqB;AAAA,IAC9B,OAAO,IAAI,oBAAoB,KAAK,SAAS,QAAQ,IAAI;AAAA;AAAA,EAE3D,WAAW,CAAC,QAAqB;AAAA,IAC/B,OAAO,IAAI,oBAAoB,KAAK,SAAS,QAAQ,KAAK;A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21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AddressHashMode,
|
|
3
|
+
AssetType,
|
|
4
|
+
AuthType,
|
|
5
|
+
MEMO_MAX_LENGTH_BYTES,
|
|
6
|
+
PayloadType,
|
|
7
|
+
PostConditionPrincipalId,
|
|
8
|
+
RECOVERABLE_ECDSA_SIG_LENGTH_BYTES
|
|
9
|
+
} from "./stacks-yfgsm6ap.js";
|
|
10
|
+
import {
|
|
11
|
+
bufferCV,
|
|
12
|
+
contractPrincipalCV,
|
|
13
|
+
falseCV,
|
|
14
|
+
intCV,
|
|
15
|
+
listCV,
|
|
16
|
+
noneCV,
|
|
17
|
+
responseErrorCV,
|
|
18
|
+
responseOkCV,
|
|
19
|
+
someCV,
|
|
20
|
+
standardPrincipalCV,
|
|
21
|
+
stringAsciiCV,
|
|
22
|
+
stringUtf8CV,
|
|
23
|
+
trueCV,
|
|
24
|
+
tupleCV,
|
|
25
|
+
uintCV
|
|
26
|
+
} from "./stacks-j2cy7qtt.js";
|
|
27
|
+
import {
|
|
28
|
+
clarityTypeFromByte
|
|
29
|
+
} from "./stacks-8yykgdww.js";
|
|
30
|
+
import {
|
|
31
|
+
bytesToAscii,
|
|
32
|
+
bytesToHex,
|
|
33
|
+
bytesToTwosBigInt,
|
|
34
|
+
bytesToUtf8,
|
|
35
|
+
c32address,
|
|
36
|
+
hexToBytes,
|
|
37
|
+
without0x
|
|
38
|
+
} from "./stacks-nqytwfcc.js";
|
|
39
|
+
|
|
40
|
+
// src/transactions/wire/deserialize.ts
|
|
41
|
+
class Reader {
|
|
42
|
+
data;
|
|
43
|
+
offset = 0;
|
|
44
|
+
constructor(data) {
|
|
45
|
+
this.data = data;
|
|
46
|
+
}
|
|
47
|
+
readUInt8() {
|
|
48
|
+
return this.data[this.offset++];
|
|
49
|
+
}
|
|
50
|
+
readUInt16BE() {
|
|
51
|
+
const val = (this.data[this.offset] << 8 | this.data[this.offset + 1]) >>> 0;
|
|
52
|
+
this.offset += 2;
|
|
53
|
+
return val;
|
|
54
|
+
}
|
|
55
|
+
readUInt32BE() {
|
|
56
|
+
const val = (this.data[this.offset] << 24 | this.data[this.offset + 1] << 16 | this.data[this.offset + 2] << 8 | this.data[this.offset + 3]) >>> 0;
|
|
57
|
+
this.offset += 4;
|
|
58
|
+
return val;
|
|
59
|
+
}
|
|
60
|
+
readBytes(length) {
|
|
61
|
+
const slice = this.data.slice(this.offset, this.offset + length);
|
|
62
|
+
this.offset += length;
|
|
63
|
+
return slice;
|
|
64
|
+
}
|
|
65
|
+
readBigUInt64BE() {
|
|
66
|
+
return BigInt(`0x${bytesToHex(this.readBytes(8))}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function readAddress(r) {
|
|
70
|
+
const version = r.readUInt8();
|
|
71
|
+
const hash160 = bytesToHex(r.readBytes(20));
|
|
72
|
+
return c32address(version, hash160);
|
|
73
|
+
}
|
|
74
|
+
function readLPString(r, prefixBytes = 1) {
|
|
75
|
+
let length = 0;
|
|
76
|
+
for (let i = 0;i < prefixBytes; i++) {
|
|
77
|
+
length = length << 8 | r.readUInt8();
|
|
78
|
+
}
|
|
79
|
+
return bytesToUtf8(r.readBytes(length));
|
|
80
|
+
}
|
|
81
|
+
function readCV(r) {
|
|
82
|
+
const typeByte = r.readUInt8();
|
|
83
|
+
const type = clarityTypeFromByte(typeByte);
|
|
84
|
+
switch (type) {
|
|
85
|
+
case "int":
|
|
86
|
+
return intCV(bytesToTwosBigInt(r.readBytes(16)));
|
|
87
|
+
case "uint":
|
|
88
|
+
return uintCV(r.readBytes(16));
|
|
89
|
+
case "true":
|
|
90
|
+
return trueCV();
|
|
91
|
+
case "false":
|
|
92
|
+
return falseCV();
|
|
93
|
+
case "buffer": {
|
|
94
|
+
const len = r.readUInt32BE();
|
|
95
|
+
return bufferCV(r.readBytes(len));
|
|
96
|
+
}
|
|
97
|
+
case "none":
|
|
98
|
+
return noneCV();
|
|
99
|
+
case "some":
|
|
100
|
+
return someCV(readCV(r));
|
|
101
|
+
case "ok":
|
|
102
|
+
return responseOkCV(readCV(r));
|
|
103
|
+
case "err":
|
|
104
|
+
return responseErrorCV(readCV(r));
|
|
105
|
+
case "address":
|
|
106
|
+
return standardPrincipalCV(readAddress(r));
|
|
107
|
+
case "contract": {
|
|
108
|
+
const addr = readAddress(r);
|
|
109
|
+
const name = readLPString(r);
|
|
110
|
+
return contractPrincipalCV(addr, name);
|
|
111
|
+
}
|
|
112
|
+
case "list": {
|
|
113
|
+
const len = r.readUInt32BE();
|
|
114
|
+
const items = [];
|
|
115
|
+
for (let i = 0;i < len; i++)
|
|
116
|
+
items.push(readCV(r));
|
|
117
|
+
return listCV(items);
|
|
118
|
+
}
|
|
119
|
+
case "tuple": {
|
|
120
|
+
const len = r.readUInt32BE();
|
|
121
|
+
const data = {};
|
|
122
|
+
for (let i = 0;i < len; i++) {
|
|
123
|
+
const key = readLPString(r);
|
|
124
|
+
data[key] = readCV(r);
|
|
125
|
+
}
|
|
126
|
+
return tupleCV(data);
|
|
127
|
+
}
|
|
128
|
+
case "ascii": {
|
|
129
|
+
const len = r.readUInt32BE();
|
|
130
|
+
return stringAsciiCV(bytesToAscii(r.readBytes(len)));
|
|
131
|
+
}
|
|
132
|
+
case "utf8": {
|
|
133
|
+
const len = r.readUInt32BE();
|
|
134
|
+
return stringUtf8CV(bytesToUtf8(r.readBytes(len)));
|
|
135
|
+
}
|
|
136
|
+
default:
|
|
137
|
+
throw new Error(`Unknown clarity type: ${type}`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
function readSpendingCondition(r) {
|
|
141
|
+
const hashMode = r.readUInt8();
|
|
142
|
+
const signer = bytesToHex(r.readBytes(20));
|
|
143
|
+
const nonce = r.readBigUInt64BE();
|
|
144
|
+
const fee = r.readBigUInt64BE();
|
|
145
|
+
if (hashMode === AddressHashMode.P2PKH || hashMode === AddressHashMode.P2WPKH) {
|
|
146
|
+
const keyEncoding = r.readUInt8();
|
|
147
|
+
const signature = bytesToHex(r.readBytes(RECOVERABLE_ECDSA_SIG_LENGTH_BYTES));
|
|
148
|
+
return { hashMode, signer, nonce, fee, keyEncoding, signature };
|
|
149
|
+
}
|
|
150
|
+
const fieldCount = r.readUInt32BE();
|
|
151
|
+
const fields = [];
|
|
152
|
+
for (let i = 0;i < fieldCount; i++) {
|
|
153
|
+
const fieldType = r.readUInt8();
|
|
154
|
+
if (fieldType <= 1) {
|
|
155
|
+
const keyLen = fieldType === 0 ? 33 : 65;
|
|
156
|
+
fields.push({
|
|
157
|
+
type: "publicKey",
|
|
158
|
+
pubKeyEncoding: fieldType,
|
|
159
|
+
data: bytesToHex(r.readBytes(keyLen))
|
|
160
|
+
});
|
|
161
|
+
} else {
|
|
162
|
+
fields.push({
|
|
163
|
+
type: "signature",
|
|
164
|
+
pubKeyEncoding: fieldType === 2 ? 0 : 1,
|
|
165
|
+
data: bytesToHex(r.readBytes(RECOVERABLE_ECDSA_SIG_LENGTH_BYTES))
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
const signaturesRequired = r.readUInt16BE();
|
|
170
|
+
return { hashMode, signer, nonce, fee, fields, signaturesRequired };
|
|
171
|
+
}
|
|
172
|
+
function readAuthorization(r) {
|
|
173
|
+
const authType = r.readUInt8();
|
|
174
|
+
const spendingCondition = readSpendingCondition(r);
|
|
175
|
+
if (authType === AuthType.Standard) {
|
|
176
|
+
return { authType: AuthType.Standard, spendingCondition };
|
|
177
|
+
}
|
|
178
|
+
const sponsorSpendingCondition = readSpendingCondition(r);
|
|
179
|
+
return {
|
|
180
|
+
authType: AuthType.Sponsored,
|
|
181
|
+
spendingCondition,
|
|
182
|
+
sponsorSpendingCondition
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function readAssetInfo(r) {
|
|
186
|
+
return {
|
|
187
|
+
address: readAddress(r),
|
|
188
|
+
contractName: readLPString(r),
|
|
189
|
+
assetName: readLPString(r)
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
function readPostConditionPrincipal(r) {
|
|
193
|
+
const type = r.readUInt8();
|
|
194
|
+
switch (type) {
|
|
195
|
+
case PostConditionPrincipalId.Origin:
|
|
196
|
+
return { type: "origin" };
|
|
197
|
+
case PostConditionPrincipalId.Standard:
|
|
198
|
+
return { type: "standard", address: readAddress(r) };
|
|
199
|
+
case PostConditionPrincipalId.Contract:
|
|
200
|
+
return { type: "contract", address: readAddress(r), contractName: readLPString(r) };
|
|
201
|
+
default:
|
|
202
|
+
throw new Error(`Unknown post condition principal type: ${type}`);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
function readPostConditions(r) {
|
|
206
|
+
const count = r.readUInt32BE();
|
|
207
|
+
const pcs = [];
|
|
208
|
+
for (let i = 0;i < count; i++) {
|
|
209
|
+
const principal = readPostConditionPrincipal(r);
|
|
210
|
+
const assetType = r.readUInt8();
|
|
211
|
+
switch (assetType) {
|
|
212
|
+
case AssetType.STX:
|
|
213
|
+
pcs.push({ type: "stx", principal, conditionCode: r.readUInt8(), amount: r.readBigUInt64BE() });
|
|
214
|
+
break;
|
|
215
|
+
case AssetType.Fungible:
|
|
216
|
+
pcs.push({ type: "ft", principal, asset: readAssetInfo(r), conditionCode: r.readUInt8(), amount: r.readBigUInt64BE() });
|
|
217
|
+
break;
|
|
218
|
+
case AssetType.NonFungible:
|
|
219
|
+
pcs.push({ type: "nft", principal, asset: readAssetInfo(r), assetId: readCV(r), conditionCode: r.readUInt8() });
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return pcs;
|
|
224
|
+
}
|
|
225
|
+
function readPayload(r) {
|
|
226
|
+
const payloadType = r.readUInt8();
|
|
227
|
+
switch (payloadType) {
|
|
228
|
+
case PayloadType.TokenTransfer: {
|
|
229
|
+
const recipient = readCV(r);
|
|
230
|
+
const amount = r.readBigUInt64BE();
|
|
231
|
+
const memoContentLen = r.readUInt8();
|
|
232
|
+
const memoBytes = r.readBytes(MEMO_MAX_LENGTH_BYTES);
|
|
233
|
+
const memo = bytesToAscii(memoBytes.slice(0, memoContentLen)).replace(/\0+$/, "");
|
|
234
|
+
return { payloadType: PayloadType.TokenTransfer, recipient, amount, memo };
|
|
235
|
+
}
|
|
236
|
+
case PayloadType.ContractCall: {
|
|
237
|
+
const contractAddress = readAddress(r);
|
|
238
|
+
const contractName = readLPString(r);
|
|
239
|
+
const functionName = readLPString(r);
|
|
240
|
+
const numArgs = r.readUInt32BE();
|
|
241
|
+
const functionArgs = [];
|
|
242
|
+
for (let i = 0;i < numArgs; i++)
|
|
243
|
+
functionArgs.push(readCV(r));
|
|
244
|
+
return { payloadType: PayloadType.ContractCall, contractAddress, contractName, functionName, functionArgs };
|
|
245
|
+
}
|
|
246
|
+
case PayloadType.SmartContract: {
|
|
247
|
+
const contractName = readLPString(r);
|
|
248
|
+
const codeBody = readLPString(r, 4);
|
|
249
|
+
return { payloadType: PayloadType.SmartContract, contractName, codeBody };
|
|
250
|
+
}
|
|
251
|
+
case PayloadType.VersionedSmartContract: {
|
|
252
|
+
const clarityVersion = r.readUInt8();
|
|
253
|
+
const contractName = readLPString(r);
|
|
254
|
+
const codeBody = readLPString(r, 4);
|
|
255
|
+
return { payloadType: PayloadType.VersionedSmartContract, clarityVersion, contractName, codeBody };
|
|
256
|
+
}
|
|
257
|
+
default:
|
|
258
|
+
throw new Error(`Unknown payload type: ${payloadType}`);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
function deserializeTransaction(input) {
|
|
262
|
+
const bytes = typeof input === "string" ? hexToBytes(without0x(input)) : input;
|
|
263
|
+
const r = new Reader(bytes);
|
|
264
|
+
return {
|
|
265
|
+
version: r.readUInt8(),
|
|
266
|
+
chainId: r.readUInt32BE(),
|
|
267
|
+
auth: readAuthorization(r),
|
|
268
|
+
anchorMode: r.readUInt8(),
|
|
269
|
+
postConditionMode: r.readUInt8(),
|
|
270
|
+
postConditions: readPostConditions(r),
|
|
271
|
+
payload: readPayload(r)
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export { deserializeTransaction };
|
|
276
|
+
|
|
277
|
+
//# debugId=10C8FB91F221D94764756E2164756E21
|
|
278
|
+
//# sourceMappingURL=stacks-dxhntr76.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
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 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} 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 const slice = this.data.slice(this.offset, this.offset + length);\n this.offset += length;\n return slice;\n }\n\n readBigUInt64BE(): bigint {\n return BigInt(`0x${bytesToHex(this.readBytes(8))}`);\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 throw new Error(`Unknown post condition principal type: ${type}`);\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 const principal = readPostConditionPrincipal(r);\n const assetType = r.readUInt8();\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 const memoContentLen = r.readUInt8();\n const memoBytes = r.readBytes(MEMO_MAX_LENGTH_BYTES);\n const memo = bytesToAscii(memoBytes.slice(0, memoContentLen)).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 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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,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,KAAK,KAAK,KAAK,SAAS,MAAO,IAChC,KAAK,KAAK,KAAK,SAAS,QAC1B;AAAA,IACF,KAAK,UAAU;AAAA,IACf,OAAO;AAAA;AAAA,EAGT,SAAS,CAAC,QAA4B;AAAA,IACpC,MAAM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AAM,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": "10C8FB91F221D94764756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// src/utils/units.ts
|
|
2
|
+
function formatUnits(value, decimals) {
|
|
3
|
+
let v = BigInt(value);
|
|
4
|
+
const negative = v < 0n;
|
|
5
|
+
if (negative)
|
|
6
|
+
v = -v;
|
|
7
|
+
const divisor = 10n ** BigInt(decimals);
|
|
8
|
+
let integer = (v / divisor).toString();
|
|
9
|
+
let fraction = (v % divisor).toString().padStart(decimals, "0");
|
|
10
|
+
fraction = fraction.replace(/0+$/, "") || "0";
|
|
11
|
+
const result = `${integer}.${fraction}`;
|
|
12
|
+
return negative ? `-${result}` : result;
|
|
13
|
+
}
|
|
14
|
+
function parseUnits(value, decimals) {
|
|
15
|
+
let str = typeof value === "number" ? value.toString() : value;
|
|
16
|
+
const negative = str.startsWith("-");
|
|
17
|
+
if (negative)
|
|
18
|
+
str = str.slice(1);
|
|
19
|
+
const [integer = "", fraction = ""] = str.split(".");
|
|
20
|
+
if (fraction.length > decimals) {
|
|
21
|
+
throw new Error(`Too many decimal places: "${value}" has ${fraction.length} decimals, max is ${decimals}`);
|
|
22
|
+
}
|
|
23
|
+
const padded = fraction.padEnd(decimals, "0");
|
|
24
|
+
const result = BigInt(integer + padded);
|
|
25
|
+
return negative ? -result : result;
|
|
26
|
+
}
|
|
27
|
+
function formatStx(microStx) {
|
|
28
|
+
return formatUnits(microStx, 6);
|
|
29
|
+
}
|
|
30
|
+
function parseStx(stx) {
|
|
31
|
+
return parseUnits(stx, 6);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//# debugId=1526CC87E34EA2D064756E2164756E21
|
|
35
|
+
//# sourceMappingURL=stacks-evnzth1q.cjs.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/utils/units.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"/**\n * Format a bigint value with decimal places.\n * @example formatUnits(1000000n, 6) → \"1.0\"\n * @example formatUnits(1500000n, 6) → \"1.5\"\n */\nexport function formatUnits(value: bigint | number | string, decimals: number): string {\n let v = BigInt(value);\n\n const negative = v < 0n;\n if (negative) v = -v;\n\n const divisor = 10n ** BigInt(decimals);\n let integer = (v / divisor).toString();\n let fraction = (v % divisor).toString().padStart(decimals, \"0\");\n\n // Trim trailing zeros, but keep at least one decimal\n fraction = fraction.replace(/0+$/, \"\") || \"0\";\n\n const result = `${integer}.${fraction}`;\n return negative ? `-${result}` : result;\n}\n\n/**\n * Parse a decimal string into a bigint with the given number of decimals.\n * @example parseUnits(\"1.5\", 6) → 1500000n\n * @example parseUnits(\"1\", 6) → 1000000n\n */\nexport function parseUnits(value: string | number, decimals: number): bigint {\n let str = typeof value === \"number\" ? value.toString() : value;\n\n const negative = str.startsWith(\"-\");\n if (negative) str = str.slice(1);\n\n const [integer = \"\", fraction = \"\"] = str.split(\".\");\n\n if (fraction.length > decimals) {\n throw new Error(\n `Too many decimal places: \"${value}\" has ${fraction.length} decimals, max is ${decimals}`\n );\n }\n\n const padded = fraction.padEnd(decimals, \"0\");\n const result = BigInt(integer + padded);\n return negative ? -result : result;\n}\n\n/**\n * Format microSTX to STX string (6 decimals).\n * @example formatStx(1000000n) → \"1.0\"\n */\nexport function formatStx(microStx: bigint | number | string): string {\n return formatUnits(microStx, 6);\n}\n\n/**\n * Parse STX string to microSTX bigint (6 decimals).\n * @example parseStx(\"1.5\") → 1500000n\n */\nexport function parseStx(stx: string | number): bigint {\n return parseUnits(stx, 6);\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";AAKO,SAAS,WAAW,CAAC,OAAiC,UAA0B;AAAA,EACrF,IAAI,IAAI,OAAO,KAAK;AAAA,EAEpB,MAAM,WAAW,IAAI;AAAA,EACrB,IAAI;AAAA,IAAU,IAAI,CAAC;AAAA,EAEnB,MAAM,UAAU,OAAO,OAAO,QAAQ;AAAA,EACtC,IAAI,WAAW,IAAI,SAAS,SAAS;AAAA,EACrC,IAAI,YAAY,IAAI,SAAS,SAAS,EAAE,SAAS,UAAU,GAAG;AAAA,EAG9D,WAAW,SAAS,QAAQ,OAAO,EAAE,KAAK;AAAA,EAE1C,MAAM,SAAS,GAAG,WAAW;AAAA,EAC7B,OAAO,WAAW,IAAI,WAAW;AAAA;AAQ5B,SAAS,UAAU,CAAC,OAAwB,UAA0B;AAAA,EAC3E,IAAI,MAAM,OAAO,UAAU,WAAW,MAAM,SAAS,IAAI;AAAA,EAEzD,MAAM,WAAW,IAAI,WAAW,GAAG;AAAA,EACnC,IAAI;AAAA,IAAU,MAAM,IAAI,MAAM,CAAC;AAAA,EAE/B,OAAO,UAAU,IAAI,WAAW,MAAM,IAAI,MAAM,GAAG;AAAA,EAEnD,IAAI,SAAS,SAAS,UAAU;AAAA,IAC9B,MAAM,IAAI,MACR,6BAA6B,cAAc,SAAS,2BAA2B,UACjF;AAAA,EACF;AAAA,EAEA,MAAM,SAAS,SAAS,OAAO,UAAU,GAAG;AAAA,EAC5C,MAAM,SAAS,OAAO,UAAU,MAAM;AAAA,EACtC,OAAO,WAAW,CAAC,SAAS;AAAA;AAOvB,SAAS,SAAS,CAAC,UAA4C;AAAA,EACpE,OAAO,YAAY,UAAU,CAAC;AAAA;AAOzB,SAAS,QAAQ,CAAC,KAA8B;AAAA,EACrD,OAAO,WAAW,KAAK,CAAC;AAAA;",
|
|
8
|
+
"debugId": "1526CC87E34EA2D064756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
combineMultiSigSignatures,
|
|
3
|
+
createMultiSigSpendingCondition,
|
|
4
|
+
finalizeMultiSig,
|
|
5
|
+
isNonSequential,
|
|
6
|
+
makeMultiSigAddress,
|
|
7
|
+
replayMultiSigSigHash,
|
|
8
|
+
signMultiSig,
|
|
9
|
+
signMultiSigWithAccount
|
|
10
|
+
} from "./stacks-yfgsm6ap.js";
|
|
11
|
+
import"./stacks-8yykgdww.js";
|
|
12
|
+
import"./stacks-bycy6t9k.js";
|
|
13
|
+
import"./stacks-nqytwfcc.js";
|
|
14
|
+
import"./stacks-8m9byk2j.js";
|
|
15
|
+
export {
|
|
16
|
+
signMultiSigWithAccount,
|
|
17
|
+
signMultiSig,
|
|
18
|
+
replayMultiSigSigHash,
|
|
19
|
+
makeMultiSigAddress,
|
|
20
|
+
isNonSequential,
|
|
21
|
+
finalizeMultiSig,
|
|
22
|
+
createMultiSigSpendingCondition,
|
|
23
|
+
combineMultiSigSignatures
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
//# debugId=D608AC6A85F865CA64756E2164756E21
|
|
27
|
+
//# sourceMappingURL=stacks-f3tk2k5s.js.map
|