@secondlayer/stacks 0.0.4 → 0.2.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-zm0b3tgy.js → stacks-0hqzpm29.js} +7 -7
- package/dist/shared/{stacks-zm0b3tgy.js.map → stacks-0hqzpm29.js.map} +2 -2
- package/dist/shared/{stacks-bnvfmt7y.cjs → stacks-2gdt3aqj.cjs} +15 -2
- package/dist/shared/{stacks-8m9byk2j.js.map → stacks-2gdt3aqj.cjs.map} +1 -1
- package/dist/shared/stacks-61rvzkz1.cjs.map +1 -1
- package/dist/shared/stacks-709tra19.js.map +2 -2
- package/dist/shared/{stacks-n2g56wgg.js → stacks-8qhfd37f.js} +13 -13
- package/dist/shared/{stacks-n2g56wgg.js.map → stacks-8qhfd37f.js.map} +3 -3
- package/dist/shared/stacks-9g0jhab3.cjs.map +2 -2
- package/dist/shared/stacks-an5k8n4t.cjs.map +2 -2
- package/dist/shared/stacks-b008c3w8.cjs.map +2 -2
- package/dist/shared/stacks-gck1sq7h.cjs.map +2 -2
- package/dist/shared/stacks-gjvbq6w7.js.map +2 -2
- package/dist/shared/{stacks-74k8cxgb.cjs → stacks-hfem9dck.cjs} +46 -2
- package/dist/shared/stacks-hfem9dck.cjs.map +13 -0
- package/dist/shared/stacks-j2cy7qtt.js.map +2 -2
- package/dist/shared/stacks-k58k970n.js.map +2 -2
- package/dist/shared/{stacks-zyv9qqme.cjs → stacks-kgesjxq4.cjs} +3 -5
- package/dist/shared/stacks-kgesjxq4.cjs.map +11 -0
- package/dist/shared/{stacks-f7wdrzs3.js → stacks-nbz193yk.js} +18 -21
- package/dist/shared/stacks-nbz193yk.js.map +11 -0
- package/dist/shared/stacks-njvyj3ab.js +23 -0
- package/dist/shared/{stacks-bnvfmt7y.cjs.map → stacks-njvyj3ab.js.map} +1 -1
- package/dist/shared/{stacks-dxhntr76.js → stacks-ph4a6322.js} +54 -11
- package/dist/shared/stacks-ph4a6322.js.map +10 -0
- package/dist/shared/stacks-qvg7c24g.cjs.map +2 -2
- package/dist/shared/{stacks-4py5pm0r.cjs → stacks-v3zy6zds.cjs} +42 -2
- package/dist/shared/stacks-v3zy6zds.cjs.map +10 -0
- package/dist/shared/stacks-v9jqcpd4.js.map +2 -2
- package/dist/shared/stacks-vdfag81a.cjs.map +2 -2
- package/dist/shared/{stacks-yfgsm6ap.js → stacks-xtz0n62y.js} +58 -3
- package/dist/shared/stacks-xtz0n62y.js.map +13 -0
- package/dist/shared/stacks-ya3x01yd.cjs.map +2 -2
- package/dist/shared/{stacks-vdfs3e5v.js → stacks-zhd20wgz.js} +2 -2
- package/dist/shared/stacks-zhd20wgz.js.map +10 -0
- package/dist/src/accounts/index.js +1 -1
- package/dist/src/actions/index.d.cts +46 -7
- package/dist/src/actions/index.d.ts +46 -7
- package/dist/src/actions/index.js +7 -7
- package/dist/src/bns/index.cjs +13 -13
- package/dist/src/bns/index.cjs.map +3 -3
- package/dist/src/bns/index.js +22 -22
- package/dist/src/bns/index.js.map +3 -3
- package/dist/src/chains/index.js +1 -1
- package/dist/src/clarity/index.cjs +326 -1
- package/dist/src/clarity/index.cjs.map +5 -3
- package/dist/src/clarity/index.d.cts +24 -5
- package/dist/src/clarity/index.d.ts +24 -5
- package/dist/src/clarity/index.js +264 -13
- package/dist/src/clarity/index.js.map +5 -3
- package/dist/src/connect/index.cjs.map +2 -2
- package/dist/src/connect/index.d.cts +7 -1
- package/dist/src/connect/index.d.ts +7 -1
- package/dist/src/connect/index.js.map +2 -2
- package/dist/src/connect/walletconnect/index.cjs +4 -4
- package/dist/src/connect/walletconnect/index.cjs.map +7 -7
- package/dist/src/connect/walletconnect/index.d.cts +5 -5
- package/dist/src/connect/walletconnect/index.d.ts +5 -5
- package/dist/src/connect/walletconnect/index.js +4 -4
- package/dist/src/connect/walletconnect/index.js.map +7 -7
- package/dist/src/index.cjs +1 -1
- package/dist/src/index.cjs.map +4 -4
- package/dist/src/index.d.cts +44 -3
- package/dist/src/index.d.ts +44 -3
- package/dist/src/index.js +12 -11
- package/dist/src/index.js.map +5 -5
- package/dist/src/postconditions/index.cjs +117 -1
- package/dist/src/postconditions/index.cjs.map +4 -3
- package/dist/src/postconditions/index.js +119 -6
- package/dist/src/postconditions/index.js.map +4 -3
- package/dist/src/pox/index.cjs +9 -9
- package/dist/src/pox/index.cjs.map +4 -4
- package/dist/src/pox/index.js +17 -17
- package/dist/src/pox/index.js.map +4 -4
- package/dist/src/stackingdao/index.cjs +13 -13
- package/dist/src/stackingdao/index.cjs.map +4 -4
- package/dist/src/stackingdao/index.d.cts +18 -7
- package/dist/src/stackingdao/index.d.ts +18 -7
- package/dist/src/stackingdao/index.js +21 -21
- package/dist/src/stackingdao/index.js.map +4 -4
- package/dist/src/subscriptions/index.js +1 -1
- package/dist/src/transactions/index.cjs +5 -1
- package/dist/src/transactions/index.cjs.map +1 -1
- package/dist/src/transactions/index.d.cts +40 -2
- package/dist/src/transactions/index.d.ts +40 -2
- package/dist/src/transactions/index.js +18 -10
- package/dist/src/transactions/index.js.map +1 -1
- package/dist/src/utils/index.cjs.map +2 -2
- package/dist/src/utils/index.d.cts +4 -4
- package/dist/src/utils/index.d.ts +4 -4
- package/dist/src/utils/index.js +5 -5
- package/dist/src/utils/index.js.map +3 -3
- package/package.json +1 -1
- package/dist/shared/stacks-2ar4prfz.cjs +0 -328
- package/dist/shared/stacks-2ar4prfz.cjs.map +0 -11
- package/dist/shared/stacks-4py5pm0r.cjs.map +0 -10
- package/dist/shared/stacks-74k8cxgb.cjs.map +0 -13
- package/dist/shared/stacks-8m9byk2j.js +0 -7
- package/dist/shared/stacks-dr5en54r.cjs +0 -119
- package/dist/shared/stacks-dr5en54r.cjs.map +0 -10
- package/dist/shared/stacks-dxhntr76.js.map +0 -10
- package/dist/shared/stacks-f3tk2k5s.js +0 -27
- package/dist/shared/stacks-f3tk2k5s.js.map +0 -9
- package/dist/shared/stacks-f7wdrzs3.js.map +0 -11
- package/dist/shared/stacks-g9mcjcqg.cjs +0 -3
- package/dist/shared/stacks-g9mcjcqg.cjs.map +0 -9
- package/dist/shared/stacks-tjxmrssa.js +0 -282
- package/dist/shared/stacks-tjxmrssa.js.map +0 -11
- package/dist/shared/stacks-vdfs3e5v.js.map +0 -10
- package/dist/shared/stacks-yfgsm6ap.js.map +0 -13
- package/dist/shared/stacks-yfveb68e.js +0 -121
- package/dist/shared/stacks-yfveb68e.js.map +0 -10
- package/dist/shared/stacks-zyv9qqme.cjs.map +0 -11
|
@@ -137,26 +137,37 @@ interface FeeInfo {
|
|
|
137
137
|
}
|
|
138
138
|
declare const STACKINGDAO_CONTRACTS: {
|
|
139
139
|
readonly core: {
|
|
140
|
-
readonly
|
|
140
|
+
readonly address: string
|
|
141
|
+
readonly name: string
|
|
141
142
|
}
|
|
142
143
|
readonly ststxToken: {
|
|
143
|
-
readonly
|
|
144
|
+
readonly address: string
|
|
145
|
+
readonly name: string
|
|
144
146
|
}
|
|
145
147
|
readonly withdrawNft: {
|
|
146
|
-
readonly
|
|
148
|
+
readonly address: string
|
|
149
|
+
readonly name: string
|
|
147
150
|
}
|
|
148
151
|
readonly reserve: {
|
|
149
|
-
readonly
|
|
152
|
+
readonly address: string
|
|
153
|
+
readonly name: string
|
|
150
154
|
}
|
|
151
155
|
readonly dataCore: {
|
|
152
|
-
readonly
|
|
156
|
+
readonly address: string
|
|
157
|
+
readonly name: string
|
|
153
158
|
}
|
|
154
159
|
readonly dataCoreV1: {
|
|
155
|
-
readonly
|
|
160
|
+
readonly address: string
|
|
161
|
+
readonly name: string
|
|
156
162
|
}
|
|
157
163
|
};
|
|
158
164
|
/** Trait contracts auto-passed to core functions — users never need these. */
|
|
159
|
-
declare const TRAIT_CONTRACTS: {
|
|
165
|
+
declare const TRAIT_CONTRACTS: {
|
|
166
|
+
readonly reserve: string
|
|
167
|
+
readonly commission: string
|
|
168
|
+
readonly directHelpers: string
|
|
169
|
+
readonly staking: string
|
|
170
|
+
};
|
|
160
171
|
/** Actions provided by the StackingDAO extension. */
|
|
161
172
|
type StackingDaoActions = {
|
|
162
173
|
stackingDao: {
|
|
@@ -3,22 +3,22 @@ import {
|
|
|
3
3
|
} from "../../shared/stacks-k58k970n.js";
|
|
4
4
|
import {
|
|
5
5
|
getContract
|
|
6
|
-
} from "../../shared/stacks-
|
|
7
|
-
import"../../shared/stacks-
|
|
6
|
+
} from "../../shared/stacks-zhd20wgz.js";
|
|
7
|
+
import"../../shared/stacks-0hqzpm29.js";
|
|
8
8
|
import"../../shared/stacks-709tra19.js";
|
|
9
9
|
import"../../shared/stacks-d1fmkv3p.js";
|
|
10
|
-
import
|
|
11
|
-
Pc
|
|
12
|
-
} from "../../shared/stacks-yfveb68e.js";
|
|
13
|
-
import"../../shared/stacks-f7wdrzs3.js";
|
|
14
|
-
import"../../shared/stacks-yfgsm6ap.js";
|
|
10
|
+
import"../../shared/stacks-nbz193yk.js";
|
|
15
11
|
import"../../shared/stacks-j2cy7qtt.js";
|
|
16
12
|
import"../../shared/stacks-8yykgdww.js";
|
|
17
13
|
import"../../shared/stacks-v9jqcpd4.js";
|
|
18
14
|
import"../../shared/stacks-bycy6t9k.js";
|
|
19
15
|
import"../../shared/stacks-gjvbq6w7.js";
|
|
20
16
|
import"../../shared/stacks-nqytwfcc.js";
|
|
21
|
-
import"../../shared/stacks-
|
|
17
|
+
import"../../shared/stacks-njvyj3ab.js";
|
|
18
|
+
import {
|
|
19
|
+
Pc
|
|
20
|
+
} from "../postconditions/index.js";
|
|
21
|
+
import"../../shared/stacks-xtz0n62y.js";
|
|
22
22
|
|
|
23
23
|
// src/stackingdao/abi.ts
|
|
24
24
|
var withdrawTuple = {
|
|
@@ -212,7 +212,7 @@ async function deposit(client, params) {
|
|
|
212
212
|
async function initWithdraw(client, params) {
|
|
213
213
|
const core = getCoreContract(client);
|
|
214
214
|
const ststx = STACKINGDAO_CONTRACTS.ststxToken;
|
|
215
|
-
return core.call
|
|
215
|
+
return core.call.initWithdraw({
|
|
216
216
|
reserve: traits.reserve,
|
|
217
217
|
directHelpers: traits.directHelpers,
|
|
218
218
|
ststxAmount: params.ststxAmount
|
|
@@ -234,7 +234,7 @@ async function withdraw(client, params) {
|
|
|
234
234
|
async function withdrawIdle(client, params) {
|
|
235
235
|
const core = getCoreContract(client);
|
|
236
236
|
const ststx = STACKINGDAO_CONTRACTS.ststxToken;
|
|
237
|
-
return core.call
|
|
237
|
+
return core.call.withdrawIdle({
|
|
238
238
|
reserve: traits.reserve,
|
|
239
239
|
directHelpers: traits.directHelpers,
|
|
240
240
|
commissionContract: traits.commissionContract,
|
|
@@ -248,46 +248,46 @@ async function withdrawIdle(client, params) {
|
|
|
248
248
|
}
|
|
249
249
|
async function getStSTXBalance(client, address) {
|
|
250
250
|
const token = getStstxToken(client);
|
|
251
|
-
return await token.read
|
|
251
|
+
return await token.read.getBalance({ account: address });
|
|
252
252
|
}
|
|
253
253
|
async function getExchangeRate(client) {
|
|
254
254
|
const reserve = getReserveContract(client);
|
|
255
255
|
const dataV3 = getDataCoreV3(client);
|
|
256
256
|
const [totalStx, ststxSupply] = await Promise.all([
|
|
257
|
-
reserve.read
|
|
257
|
+
reserve.read.getTotalStx({}),
|
|
258
258
|
getTotalSupply(client)
|
|
259
259
|
]);
|
|
260
|
-
const stxPerStstx = await dataV3.read
|
|
260
|
+
const stxPerStstx = await dataV3.read.getStxPerStstxHelper({
|
|
261
261
|
stxAmount: totalStx
|
|
262
262
|
});
|
|
263
263
|
return { stxPerStstx, ststxSupply, totalStx };
|
|
264
264
|
}
|
|
265
265
|
async function getTotalSupply(client) {
|
|
266
266
|
const token = getStstxToken(client);
|
|
267
|
-
return await token.read
|
|
267
|
+
return await token.read.getTotalSupply({});
|
|
268
268
|
}
|
|
269
269
|
async function getWithdrawalInfo(client, nftId) {
|
|
270
270
|
const dataV1 = getDataCoreV1(client);
|
|
271
|
-
return await dataV1.read
|
|
271
|
+
return await dataV1.read.getWithdrawalsByNft({
|
|
272
272
|
nftId
|
|
273
273
|
});
|
|
274
274
|
}
|
|
275
275
|
async function getFees(client) {
|
|
276
276
|
const core = getCoreContract(client);
|
|
277
277
|
const [stackFee, unstackFee, withdrawIdleFee] = await Promise.all([
|
|
278
|
-
core.read
|
|
279
|
-
core.read
|
|
280
|
-
core.read
|
|
278
|
+
core.read.getStackFee({}),
|
|
279
|
+
core.read.getUnstackFee({}),
|
|
280
|
+
core.read.getWithdrawIdleFee({})
|
|
281
281
|
]);
|
|
282
282
|
return { stackFee, unstackFee, withdrawIdleFee };
|
|
283
283
|
}
|
|
284
284
|
async function getReserveBalance(client) {
|
|
285
285
|
const reserve = getReserveContract(client);
|
|
286
|
-
return await reserve.read
|
|
286
|
+
return await reserve.read.getTotalStx({});
|
|
287
287
|
}
|
|
288
288
|
async function getShutdownDeposits(client) {
|
|
289
289
|
const core = getCoreContract(client);
|
|
290
|
-
return await core.read
|
|
290
|
+
return await core.read.getShutdownDeposits({});
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
// src/stackingdao/index.ts
|
|
@@ -314,5 +314,5 @@ export {
|
|
|
314
314
|
STACKINGDAO_CONTRACTS
|
|
315
315
|
};
|
|
316
316
|
|
|
317
|
-
//# debugId=
|
|
317
|
+
//# debugId=E31D28AFCD8FBC2D64756E2164756E21
|
|
318
318
|
//# sourceMappingURL=index.js.map
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
"sources": ["../src/stackingdao/abi.ts", "../src/stackingdao/constants.ts", "../src/stackingdao/actions.ts", "../src/stackingdao/index.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import type { AbiContract } from \"../clarity/abi/contract.ts\";\n\nconst withdrawTuple = {\n tuple: [\n { name: \"stx-fee-amount\", type: \"uint128\" },\n { name: \"stx-user-amount\", type: \"uint128\" },\n ],\n} as const;\n\nexport const STACKING_DAO_CORE_ABI = {\n functions: [\n // Public — deposit STX, receive stSTX\n {\n name: \"deposit\",\n access: \"public\",\n args: [\n { name: \"reserve\", type: \"trait_reference\" },\n { name: \"commission-contract\", type: \"trait_reference\" },\n { name: \"staking-contract\", type: \"trait_reference\" },\n { name: \"direct-helpers\", type: \"trait_reference\" },\n { name: \"stx-amount\", type: \"uint128\" },\n { name: \"referrer\", type: { optional: \"principal\" } },\n { name: \"pool\", type: { optional: \"principal\" } },\n ],\n outputs: { response: { ok: \"uint128\", error: \"uint128\" } },\n },\n // Public — initiate withdrawal (burn stSTX, get NFT receipt)\n {\n name: \"init-withdraw\",\n access: \"public\",\n args: [\n { name: \"reserve\", type: \"trait_reference\" },\n { name: \"direct-helpers\", type: \"trait_reference\" },\n { name: \"ststx-amount\", type: \"uint128\" },\n ],\n outputs: { response: { ok: \"uint128\", error: \"uint128\" } },\n },\n // Public — finalize withdrawal (burn NFT, receive STX)\n {\n name: \"withdraw\",\n access: \"public\",\n args: [\n { name: \"reserve\", type: \"trait_reference\" },\n { name: \"commission-contract\", type: \"trait_reference\" },\n { name: \"staking-contract\", type: \"trait_reference\" },\n { name: \"nft-id\", type: \"uint128\" },\n ],\n outputs: { response: { ok: withdrawTuple, error: \"uint128\" } },\n },\n // Public — withdraw idle STX (instant, no NFT)\n {\n name: \"withdraw-idle\",\n access: \"public\",\n args: [\n { name: \"reserve\", type: \"trait_reference\" },\n { name: \"direct-helpers\", type: \"trait_reference\" },\n { name: \"commission-contract\", type: \"trait_reference\" },\n { name: \"staking-contract\", type: \"trait_reference\" },\n { name: \"ststx-amount\", type: \"uint128\" },\n ],\n outputs: { response: { ok: withdrawTuple, error: \"uint128\" } },\n },\n // Read-only — fees (direct values, no response wrapper)\n {\n name: \"get-stack-fee\",\n access: \"read-only\",\n args: [],\n outputs: \"uint128\",\n },\n {\n name: \"get-unstack-fee\",\n access: \"read-only\",\n args: [],\n outputs: \"uint128\",\n },\n {\n name: \"get-withdraw-idle-fee\",\n access: \"read-only\",\n args: [],\n outputs: \"uint128\",\n },\n // Read-only — shutdown state (direct bool, no response wrapper)\n {\n name: \"get-shutdown-deposits\",\n access: \"read-only\",\n args: [],\n outputs: \"bool\",\n },\n ],\n} as const satisfies AbiContract;\n\nexport const DATA_CORE_V1_ABI = {\n functions: [\n {\n name: \"get-withdrawals-by-nft\",\n access: \"read-only\",\n args: [{ name: \"nft-id\", type: \"uint128\" }],\n outputs: {\n tuple: [\n { name: \"ststx-amount\", type: \"uint128\" },\n { name: \"stx-amount\", type: \"uint128\" },\n { name: \"unlock-burn-height\", type: \"uint128\" },\n ],\n },\n },\n ],\n} as const satisfies AbiContract;\n\nexport const DATA_CORE_V3_ABI = {\n functions: [\n {\n name: \"get-stx-per-ststx-helper\",\n access: \"read-only\",\n args: [{ name: \"stx-amount\", type: \"uint128\" }],\n outputs: \"uint128\",\n },\n ],\n} as const satisfies AbiContract;\n\nexport const RESERVE_V1_ABI = {\n functions: [\n {\n name: \"get-total-stx\",\n access: \"read-only\",\n args: [],\n outputs: { response: { ok: \"uint128\", error: \"none\" } },\n },\n ],\n} as const satisfies AbiContract;\n",
|
|
6
|
-
"const DEPLOYER = \"SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG\";\n\nexport const STACKINGDAO_CONTRACTS = {\n core: { address: DEPLOYER, name: \"stacking-dao-core-v6\" },\n ststxToken: { address: DEPLOYER, name: \"ststx-token\" },\n withdrawNft: { address: DEPLOYER, name: \"ststx-withdraw-nft-v2\" },\n reserve: { address: DEPLOYER, name: \"reserve-v1\" },\n dataCore: { address: DEPLOYER, name: \"data-core-v3\" },\n dataCoreV1: { address: DEPLOYER, name: \"data-core-v1\" },\n} as const;\n\n/** Trait contracts auto-passed to core functions — users never need these. */\nexport const TRAIT_CONTRACTS = {\n reserve: `${DEPLOYER}.reserve-v1`,\n commission: `${DEPLOYER}.commission-v2`,\n directHelpers: `${DEPLOYER}.direct-helpers-v4`,\n staking: `${DEPLOYER}.staking-v0`,\n} as const;\n",
|
|
7
|
-
"import type { Client } from \"../clients/types.ts\";\nimport { getContract } from \"../actions/getContract.ts\";\nimport { SIP010_ABI } from \"../clarity/abi/standards.ts\";\nimport {\n STACKING_DAO_CORE_ABI,\n DATA_CORE_V1_ABI,\n DATA_CORE_V3_ABI,\n RESERVE_V1_ABI,\n} from \"./abi.ts\";\nimport { STACKINGDAO_CONTRACTS, TRAIT_CONTRACTS } from \"./constants.ts\";\nimport { Pc } from \"../postconditions/index.ts\";\nimport type {\n DepositParams,\n InitWithdrawParams,\n WithdrawParams,\n WithdrawIdleParams,\n ExchangeRateInfo,\n WithdrawalInfo,\n FeeInfo,\n} from \"./types.ts\";\n\nfunction assertMainnet(client: Client) {\n if (!client.chain) {\n throw new Error(\"Client must have a chain configured\");\n }\n if (client.chain.network !== \"mainnet\") {\n throw new Error(\"StackingDAO is only available on mainnet\");\n }\n}\n\nfunction getCoreContract(client: Client) {\n assertMainnet(client);\n const c = STACKINGDAO_CONTRACTS.core;\n return getContract({ client, address: c.address, name: c.name, abi: STACKING_DAO_CORE_ABI });\n}\n\nfunction getStstxToken(client: Client) {\n assertMainnet(client);\n const c = STACKINGDAO_CONTRACTS.ststxToken;\n return getContract({ client, address: c.address, name: c.name, abi: SIP010_ABI });\n}\n\nfunction getDataCoreV1(client: Client) {\n assertMainnet(client);\n const c = STACKINGDAO_CONTRACTS.dataCoreV1;\n return getContract({ client, address: c.address, name: c.name, abi: DATA_CORE_V1_ABI });\n}\n\nfunction getDataCoreV3(client: Client) {\n assertMainnet(client);\n const c = STACKINGDAO_CONTRACTS.dataCore;\n return getContract({ client, address: c.address, name: c.name, abi: DATA_CORE_V3_ABI });\n}\n\nfunction getReserveContract(client: Client) {\n assertMainnet(client);\n const c = STACKINGDAO_CONTRACTS.reserve;\n return getContract({ client, address: c.address, name: c.name, abi: RESERVE_V1_ABI });\n}\n\nconst traits = {\n reserve: TRAIT_CONTRACTS.reserve,\n commissionContract: TRAIT_CONTRACTS.commission,\n stakingContract: TRAIT_CONTRACTS.staking,\n directHelpers: TRAIT_CONTRACTS.directHelpers,\n};\n\n// ── User Actions ──\n\nexport async function deposit(client: Client, params: DepositParams): Promise<string> {\n const core = getCoreContract(client);\n return core.call.deposit(\n {\n ...traits,\n stxAmount: params.amount,\n referrer: params.referrer ?? null,\n pool: params.pool ?? null,\n },\n {\n postConditions: [\n Pc.principal(client.account!.address).willSendEq(params.amount).ustx(),\n ],\n },\n );\n}\n\nexport async function initWithdraw(client: Client, params: InitWithdrawParams): Promise<string> {\n const core = getCoreContract(client);\n const ststx = STACKINGDAO_CONTRACTS.ststxToken;\n return core.call
|
|
6
|
+
"const DEPLOYER: string = \"SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG\";\n\nexport const STACKINGDAO_CONTRACTS: {\n readonly core: { readonly address: string; readonly name: string };\n readonly ststxToken: { readonly address: string; readonly name: string };\n readonly withdrawNft: { readonly address: string; readonly name: string };\n readonly reserve: { readonly address: string; readonly name: string };\n readonly dataCore: { readonly address: string; readonly name: string };\n readonly dataCoreV1: { readonly address: string; readonly name: string };\n} = {\n core: { address: DEPLOYER, name: \"stacking-dao-core-v6\" },\n ststxToken: { address: DEPLOYER, name: \"ststx-token\" },\n withdrawNft: { address: DEPLOYER, name: \"ststx-withdraw-nft-v2\" },\n reserve: { address: DEPLOYER, name: \"reserve-v1\" },\n dataCore: { address: DEPLOYER, name: \"data-core-v3\" },\n dataCoreV1: { address: DEPLOYER, name: \"data-core-v1\" },\n} as const;\n\n/** Trait contracts auto-passed to core functions — users never need these. */\nexport const TRAIT_CONTRACTS: {\n readonly reserve: string;\n readonly commission: string;\n readonly directHelpers: string;\n readonly staking: string;\n} = {\n reserve: `${DEPLOYER}.reserve-v1`,\n commission: `${DEPLOYER}.commission-v2`,\n directHelpers: `${DEPLOYER}.direct-helpers-v4`,\n staking: `${DEPLOYER}.staking-v0`,\n} as const;\n",
|
|
7
|
+
"import type { Client } from \"../clients/types.ts\";\nimport { getContract } from \"../actions/getContract.ts\";\nimport { SIP010_ABI } from \"../clarity/abi/standards.ts\";\nimport {\n STACKING_DAO_CORE_ABI,\n DATA_CORE_V1_ABI,\n DATA_CORE_V3_ABI,\n RESERVE_V1_ABI,\n} from \"./abi.ts\";\nimport { STACKINGDAO_CONTRACTS, TRAIT_CONTRACTS } from \"./constants.ts\";\nimport { Pc } from \"../postconditions/index.ts\";\nimport type {\n DepositParams,\n InitWithdrawParams,\n WithdrawParams,\n WithdrawIdleParams,\n ExchangeRateInfo,\n WithdrawalInfo,\n FeeInfo,\n} from \"./types.ts\";\n\nfunction assertMainnet(client: Client) {\n if (!client.chain) {\n throw new Error(\"Client must have a chain configured\");\n }\n if (client.chain.network !== \"mainnet\") {\n throw new Error(\"StackingDAO is only available on mainnet\");\n }\n}\n\nfunction getCoreContract(client: Client) {\n assertMainnet(client);\n const c = STACKINGDAO_CONTRACTS.core;\n return getContract({ client, address: c.address, name: c.name, abi: STACKING_DAO_CORE_ABI });\n}\n\nfunction getStstxToken(client: Client) {\n assertMainnet(client);\n const c = STACKINGDAO_CONTRACTS.ststxToken;\n return getContract({ client, address: c.address, name: c.name, abi: SIP010_ABI });\n}\n\nfunction getDataCoreV1(client: Client) {\n assertMainnet(client);\n const c = STACKINGDAO_CONTRACTS.dataCoreV1;\n return getContract({ client, address: c.address, name: c.name, abi: DATA_CORE_V1_ABI });\n}\n\nfunction getDataCoreV3(client: Client) {\n assertMainnet(client);\n const c = STACKINGDAO_CONTRACTS.dataCore;\n return getContract({ client, address: c.address, name: c.name, abi: DATA_CORE_V3_ABI });\n}\n\nfunction getReserveContract(client: Client) {\n assertMainnet(client);\n const c = STACKINGDAO_CONTRACTS.reserve;\n return getContract({ client, address: c.address, name: c.name, abi: RESERVE_V1_ABI });\n}\n\nconst traits = {\n reserve: TRAIT_CONTRACTS.reserve,\n commissionContract: TRAIT_CONTRACTS.commission,\n stakingContract: TRAIT_CONTRACTS.staking,\n directHelpers: TRAIT_CONTRACTS.directHelpers,\n};\n\n// ── User Actions ──\n\nexport async function deposit(client: Client, params: DepositParams): Promise<string> {\n const core = getCoreContract(client);\n return core.call.deposit(\n {\n ...traits,\n stxAmount: params.amount,\n referrer: params.referrer ?? null,\n pool: params.pool ?? null,\n },\n {\n postConditions: [\n Pc.principal(client.account!.address).willSendEq(params.amount).ustx(),\n ],\n },\n );\n}\n\nexport async function initWithdraw(client: Client, params: InitWithdrawParams): Promise<string> {\n const core = getCoreContract(client);\n const ststx = STACKINGDAO_CONTRACTS.ststxToken;\n return core.call.initWithdraw(\n {\n reserve: traits.reserve,\n directHelpers: traits.directHelpers,\n ststxAmount: params.ststxAmount,\n },\n {\n postConditions: [\n Pc.principal(client.account!.address)\n .willSendEq(params.ststxAmount)\n .ft(`${ststx.address}.${ststx.name}`, \"ststx\"),\n ],\n },\n );\n}\n\nexport async function withdraw(client: Client, params: WithdrawParams): Promise<string> {\n const core = getCoreContract(client);\n return core.call.withdraw({\n reserve: traits.reserve,\n commissionContract: traits.commissionContract,\n stakingContract: traits.stakingContract,\n nftId: params.nftId,\n });\n}\n\nexport async function withdrawIdle(client: Client, params: WithdrawIdleParams): Promise<string> {\n const core = getCoreContract(client);\n const ststx = STACKINGDAO_CONTRACTS.ststxToken;\n return core.call.withdrawIdle(\n {\n reserve: traits.reserve,\n directHelpers: traits.directHelpers,\n commissionContract: traits.commissionContract,\n stakingContract: traits.stakingContract,\n ststxAmount: params.ststxAmount,\n },\n {\n postConditions: [\n Pc.principal(client.account!.address)\n .willSendEq(params.ststxAmount)\n .ft(`${ststx.address}.${ststx.name}`, \"ststx\"),\n ],\n },\n );\n}\n\n// ── Read-only Queries ──\n\nexport async function getStSTXBalance(client: Client, address: string): Promise<bigint> {\n const token = getStstxToken(client);\n return (await token.read.getBalance({ account: address })) as bigint;\n}\n\nexport async function getExchangeRate(client: Client): Promise<ExchangeRateInfo> {\n const reserve = getReserveContract(client);\n const dataV3 = getDataCoreV3(client);\n\n const [totalStx, ststxSupply] = await Promise.all([\n reserve.read.getTotalStx({}) as Promise<bigint>,\n getTotalSupply(client),\n ]);\n\n const stxPerStstx = (await dataV3.read.getStxPerStstxHelper({\n stxAmount: totalStx,\n })) as bigint;\n\n return { stxPerStstx, ststxSupply, totalStx };\n}\n\nexport async function getTotalSupply(client: Client): Promise<bigint> {\n const token = getStstxToken(client);\n return (await token.read.getTotalSupply({})) as bigint;\n}\n\nexport async function getWithdrawalInfo(\n client: Client,\n nftId: bigint,\n): Promise<WithdrawalInfo> {\n const dataV1 = getDataCoreV1(client);\n return (await dataV1.read.getWithdrawalsByNft({\n nftId,\n })) as WithdrawalInfo;\n}\n\nexport async function getFees(client: Client): Promise<FeeInfo> {\n const core = getCoreContract(client);\n const [stackFee, unstackFee, withdrawIdleFee] = await Promise.all([\n core.read.getStackFee({}) as Promise<bigint>,\n core.read.getUnstackFee({}) as Promise<bigint>,\n core.read.getWithdrawIdleFee({}) as Promise<bigint>,\n ]);\n return { stackFee, unstackFee, withdrawIdleFee };\n}\n\nexport async function getReserveBalance(client: Client): Promise<bigint> {\n const reserve = getReserveContract(client);\n return (await reserve.read.getTotalStx({})) as bigint;\n}\n\nexport async function getShutdownDeposits(client: Client): Promise<boolean> {\n const core = getCoreContract(client);\n return (await core.read.getShutdownDeposits({})) as boolean;\n}\n",
|
|
8
8
|
"import type { Client } from \"../clients/types.ts\";\nimport {\n deposit,\n initWithdraw,\n withdraw,\n withdrawIdle,\n getStSTXBalance,\n getExchangeRate,\n getTotalSupply,\n getWithdrawalInfo,\n getFees,\n getReserveBalance,\n getShutdownDeposits,\n} from \"./actions.ts\";\nimport type {\n DepositParams,\n InitWithdrawParams,\n WithdrawParams,\n WithdrawIdleParams,\n ExchangeRateInfo,\n WithdrawalInfo,\n FeeInfo,\n} from \"./types.ts\";\n\nexport type {\n DepositParams,\n InitWithdrawParams,\n WithdrawParams,\n WithdrawIdleParams,\n ExchangeRateInfo,\n WithdrawalInfo,\n FeeInfo,\n};\n/** Actions provided by the StackingDAO extension. */\nexport type StackingDaoActions = {\n stackingDao: {\n deposit: (params: DepositParams) => Promise<string>;\n initWithdraw: (params: InitWithdrawParams) => Promise<string>;\n withdraw: (params: WithdrawParams) => Promise<string>;\n withdrawIdle: (params: WithdrawIdleParams) => Promise<string>;\n getStSTXBalance: (address: string) => Promise<bigint>;\n getExchangeRate: () => Promise<ExchangeRateInfo>;\n getTotalSupply: () => Promise<bigint>;\n getWithdrawalInfo: (nftId: bigint) => Promise<WithdrawalInfo>;\n getFees: () => Promise<FeeInfo>;\n getReserveBalance: () => Promise<bigint>;\n getShutdownDeposits: () => Promise<boolean>;\n };\n};\n\nexport { STACKINGDAO_CONTRACTS, TRAIT_CONTRACTS } from \"./constants.ts\";\n\n/**\n * StackingDAO liquid staking extension.\n * Deposit STX → receive stSTX. Auto-compounding stacking rewards.\n *\n * @example\n * import { createWalletClient, http, mainnet } from \"stacks\";\n * import { stackingDao } from \"stacks/stackingdao\";\n *\n * const client = createWalletClient({ ... }).extend(stackingDao());\n *\n * // Deposit STX for stSTX\n * await client.stackingDao.deposit({ amount: 100_000_000_000n });\n *\n * // Check exchange rate\n * const rate = await client.stackingDao.getExchangeRate();\n */\nexport function stackingDao(): (client: Client) => StackingDaoActions {\n return (client: Client) => ({\n stackingDao: {\n /** Deposit STX, receive stSTX. */\n deposit: (params: DepositParams) => deposit(client, params),\n\n /** Initiate withdrawal — burns stSTX, mints NFT receipt. */\n initWithdraw: (params: InitWithdrawParams) => initWithdraw(client, params),\n\n /** Finalize withdrawal — burns NFT, receive STX. */\n withdraw: (params: WithdrawParams) => withdraw(client, params),\n\n /** Withdraw idle STX instantly (burns stSTX). */\n withdrawIdle: (params: WithdrawIdleParams) => withdrawIdle(client, params),\n\n /** Get stSTX balance for an address. */\n getStSTXBalance: (address: string) => getStSTXBalance(client, address),\n\n /** Get current STX/stSTX exchange rate info. */\n getExchangeRate: () => getExchangeRate(client),\n\n /** Get total stSTX supply. */\n getTotalSupply: () => getTotalSupply(client),\n\n /** Get withdrawal NFT info by ID. Returns tuple with amounts and unlock height. */\n getWithdrawalInfo: (nftId: bigint) => getWithdrawalInfo(client, nftId),\n\n /** Get current fee rates. */\n getFees: () => getFees(client),\n\n /** Get total STX in reserve. */\n getReserveBalance: () => getReserveBalance(client),\n\n /** Check if deposits are shut down. */\n getShutdownDeposits: () => getShutdownDeposits(client),\n },\n });\n}\n"
|
|
9
9
|
],
|
|
10
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAM,gBAAgB;AAAA,EACpB,OAAO;AAAA,IACL,EAAE,MAAM,kBAAkB,MAAM,UAAU;AAAA,IAC1C,EAAE,MAAM,mBAAmB,MAAM,UAAU;AAAA,EAC7C;AACF;AAEO,IAAM,wBAAwB;AAAA,EACnC,WAAW;AAAA,IAET;AAAA,MACE,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,MAAM;AAAA,QACJ,EAAE,MAAM,WAAW,MAAM,kBAAkB;AAAA,QAC3C,EAAE,MAAM,uBAAuB,MAAM,kBAAkB;AAAA,QACvD,EAAE,MAAM,oBAAoB,MAAM,kBAAkB;AAAA,QACpD,EAAE,MAAM,kBAAkB,MAAM,kBAAkB;AAAA,QAClD,EAAE,MAAM,cAAc,MAAM,UAAU;AAAA,QACtC,EAAE,MAAM,YAAY,MAAM,EAAE,UAAU,YAAY,EAAE;AAAA,QACpD,EAAE,MAAM,QAAQ,MAAM,EAAE,UAAU,YAAY,EAAE;AAAA,MAClD;AAAA,MACA,SAAS,EAAE,UAAU,EAAE,IAAI,WAAW,OAAO,UAAU,EAAE;AAAA,IAC3D;AAAA,IAEA;AAAA,MACE,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,MAAM;AAAA,QACJ,EAAE,MAAM,WAAW,MAAM,kBAAkB;AAAA,QAC3C,EAAE,MAAM,kBAAkB,MAAM,kBAAkB;AAAA,QAClD,EAAE,MAAM,gBAAgB,MAAM,UAAU;AAAA,MAC1C;AAAA,MACA,SAAS,EAAE,UAAU,EAAE,IAAI,WAAW,OAAO,UAAU,EAAE;AAAA,IAC3D;AAAA,IAEA;AAAA,MACE,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,MAAM;AAAA,QACJ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AAK;AAAA,MAGrE,SAAS,MAAM,QAAQ,MAAM;AAAA,MAG7B,mBAAmB,MAAM,kBAAkB,MAAM;AAAA,MAGjD,qBAAqB,MAAM,oBAAoB,MAAM;AAAA,IACvD;AAAA,EACF;AAAA;",
|
|
11
|
+
"debugId": "E31D28AFCD8FBC2D64756E2164756E21",
|
|
12
12
|
"names": []
|
|
13
13
|
}
|
|
@@ -28,16 +28,20 @@ __export(exports_transactions, {
|
|
|
28
28
|
buildTokenTransfer: () => buildTokenTransfer,
|
|
29
29
|
buildContractDeploy: () => buildContractDeploy,
|
|
30
30
|
buildContractCall: () => buildContractCall,
|
|
31
|
+
VRF_PROOF_BYTES_LENGTH: () => VRF_PROOF_BYTES_LENGTH,
|
|
32
|
+
TenureChangeCause: () => TenureChangeCause,
|
|
31
33
|
RECOVERABLE_ECDSA_SIG_LENGTH_BYTES: () => RECOVERABLE_ECDSA_SIG_LENGTH_BYTES,
|
|
32
34
|
PubKeyEncoding: () => PubKeyEncoding,
|
|
33
35
|
PostConditionPrincipalId: () => PostConditionPrincipalId,
|
|
34
36
|
PostConditionModeWire: () => PostConditionModeWire,
|
|
35
37
|
PayloadType: () => PayloadType,
|
|
36
38
|
NonFungibleConditionCode: () => NonFungibleConditionCode,
|
|
39
|
+
MICROBLOCK_HEADER_BYTES_LENGTH: () => MICROBLOCK_HEADER_BYTES_LENGTH,
|
|
37
40
|
MEMO_MAX_LENGTH_BYTES: () => MEMO_MAX_LENGTH_BYTES,
|
|
38
41
|
MAX_STRING_LENGTH_BYTES: () => MAX_STRING_LENGTH_BYTES,
|
|
39
42
|
FungibleConditionCode: () => FungibleConditionCode,
|
|
40
43
|
ClarityVersion: () => ClarityVersion,
|
|
44
|
+
COINBASE_BYTES_LENGTH: () => COINBASE_BYTES_LENGTH,
|
|
41
45
|
AuthType: () => AuthType,
|
|
42
46
|
AuthFieldType: () => AuthFieldType,
|
|
43
47
|
AssetType: () => AssetType,
|
|
@@ -46,5 +50,5 @@ __export(exports_transactions, {
|
|
|
46
50
|
});
|
|
47
51
|
module.exports = __toCommonJS(exports_transactions);
|
|
48
52
|
|
|
49
|
-
//# debugId=
|
|
53
|
+
//# debugId=2AB78B85AA809B4F64756E2164756E21
|
|
50
54
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -138,6 +138,14 @@ declare const AuthFieldType: {
|
|
|
138
138
|
declare const RECOVERABLE_ECDSA_SIG_LENGTH_BYTES = 65;
|
|
139
139
|
declare const MEMO_MAX_LENGTH_BYTES = 34;
|
|
140
140
|
declare const MAX_STRING_LENGTH_BYTES = 128;
|
|
141
|
+
declare const COINBASE_BYTES_LENGTH = 32;
|
|
142
|
+
declare const VRF_PROOF_BYTES_LENGTH = 80;
|
|
143
|
+
declare const MICROBLOCK_HEADER_BYTES_LENGTH = 132;
|
|
144
|
+
declare const TenureChangeCause: {
|
|
145
|
+
readonly BlockFound: 0x00
|
|
146
|
+
readonly Extended: 0x01
|
|
147
|
+
};
|
|
148
|
+
type TenureChangeCause = (typeof TenureChangeCause)[keyof typeof TenureChangeCause];
|
|
141
149
|
type TokenTransferPayload = {
|
|
142
150
|
payloadType: typeof PayloadType.TokenTransfer
|
|
143
151
|
recipient: ClarityValue
|
|
@@ -157,7 +165,37 @@ type SmartContractPayload = {
|
|
|
157
165
|
contractName: string
|
|
158
166
|
codeBody: string
|
|
159
167
|
};
|
|
160
|
-
type
|
|
168
|
+
type CoinbasePayload = {
|
|
169
|
+
payloadType: typeof PayloadType.Coinbase
|
|
170
|
+
coinbaseBuffer: string
|
|
171
|
+
};
|
|
172
|
+
type CoinbaseToAltRecipientPayload = {
|
|
173
|
+
payloadType: typeof PayloadType.CoinbaseToAltRecipient
|
|
174
|
+
coinbaseBuffer: string
|
|
175
|
+
recipient: ClarityValue
|
|
176
|
+
};
|
|
177
|
+
type PoisonMicroblockPayload = {
|
|
178
|
+
payloadType: typeof PayloadType.PoisonMicroblock
|
|
179
|
+
header1: string
|
|
180
|
+
header2: string
|
|
181
|
+
};
|
|
182
|
+
type TenureChangePayload = {
|
|
183
|
+
payloadType: typeof PayloadType.TenureChange
|
|
184
|
+
tenureConsensusHash: string
|
|
185
|
+
prevTenureConsensusHash: string
|
|
186
|
+
burnViewConsensusHash: string
|
|
187
|
+
previousTenureEnd: string
|
|
188
|
+
previousTenureBlocks: number
|
|
189
|
+
cause: TenureChangeCause
|
|
190
|
+
pubkeyHash: string
|
|
191
|
+
};
|
|
192
|
+
type NakamotoCoinbasePayload = {
|
|
193
|
+
payloadType: typeof PayloadType.NakamotoCoinbase
|
|
194
|
+
coinbaseBuffer: string
|
|
195
|
+
recipient: ClarityValue | null
|
|
196
|
+
vrfProof: string
|
|
197
|
+
};
|
|
198
|
+
type TransactionPayload = TokenTransferPayload | ContractCallPayload | SmartContractPayload | CoinbasePayload | CoinbaseToAltRecipientPayload | PoisonMicroblockPayload | TenureChangePayload | NakamotoCoinbasePayload;
|
|
161
199
|
type SingleSigSpendingCondition = {
|
|
162
200
|
hashMode: typeof AddressHashMode.P2PKH | typeof AddressHashMode.P2WPKH
|
|
163
201
|
signer: string
|
|
@@ -409,4 +447,4 @@ declare function signMultiSigWithAccount(tx: StacksTransaction, account: LocalAc
|
|
|
409
447
|
declare function finalizeMultiSig(tx: StacksTransaction, publicKeys: string[]): StacksTransaction;
|
|
410
448
|
/** Combine independently-signed non-sequential multi-sig transactions */
|
|
411
449
|
declare function combineMultiSigSignatures(baseTx: StacksTransaction, signedTxs: StacksTransaction[]): StacksTransaction;
|
|
412
|
-
export { signTransactionWithAccount, signTransaction, signSponsorWithAccount, signSponsor, signMultiSigWithAccount, signMultiSig, signBegin, sigHashPreSign, sigHashPostSign, serializeTransactionHex, serializeTransaction, replayMultiSigSigHash, nextSignature, makeMultiSigAddress, isNonSequential, getTransactionId, getOriginSigHash, finalizeMultiSig, deserializeTransaction, createStandardAuth, createSponsoredAuth, createSingleSigSpendingCondition, createMultiSigSpendingCondition, combineMultiSigSignatures, buildTokenTransfer, buildContractDeploy, buildContractCall, TransactionPayload, TransactionAuthField, TokenTransferPayload, StandardAuthorization, StacksTransaction, SponsoredAuthorization, SpendingCondition, SmartContractPayload, SingleSigSpendingCondition, RECOVERABLE_ECDSA_SIG_LENGTH_BYTES, PubKeyEncoding, PostConditionWire, PostConditionPrincipalId, PostConditionModeWire, PayloadType, NonFungibleConditionCode, MultiSigSpendingCondition, MultiSigHashMode, MEMO_MAX_LENGTH_BYTES, MAX_STRING_LENGTH_BYTES, FungibleConditionCode, ContractCallPayload, ClarityVersion, BuildTokenTransferOptions, BuildContractDeployOptions, BuildContractCallOptions, Authorization, AuthType, AuthFieldType, AssetType, AnchorMode, AddressHashMode };
|
|
450
|
+
export { signTransactionWithAccount, signTransaction, signSponsorWithAccount, signSponsor, signMultiSigWithAccount, signMultiSig, signBegin, sigHashPreSign, sigHashPostSign, serializeTransactionHex, serializeTransaction, replayMultiSigSigHash, nextSignature, makeMultiSigAddress, isNonSequential, getTransactionId, getOriginSigHash, finalizeMultiSig, deserializeTransaction, createStandardAuth, createSponsoredAuth, createSingleSigSpendingCondition, createMultiSigSpendingCondition, combineMultiSigSignatures, buildTokenTransfer, buildContractDeploy, buildContractCall, VRF_PROOF_BYTES_LENGTH, TransactionPayload, TransactionAuthField, TokenTransferPayload, TenureChangePayload, TenureChangeCause as TenureChangeCauseType, TenureChangeCause, StandardAuthorization, StacksTransaction, SponsoredAuthorization, SpendingCondition, SmartContractPayload, SingleSigSpendingCondition, RECOVERABLE_ECDSA_SIG_LENGTH_BYTES, PubKeyEncoding, PostConditionWire, PostConditionPrincipalId, PostConditionModeWire, PoisonMicroblockPayload, PayloadType, NonFungibleConditionCode, NakamotoCoinbasePayload, MultiSigSpendingCondition, MultiSigHashMode, MICROBLOCK_HEADER_BYTES_LENGTH, MEMO_MAX_LENGTH_BYTES, MAX_STRING_LENGTH_BYTES, FungibleConditionCode, ContractCallPayload, CoinbaseToAltRecipientPayload, CoinbasePayload, ClarityVersion, COINBASE_BYTES_LENGTH, BuildTokenTransferOptions, BuildContractDeployOptions, BuildContractCallOptions, Authorization, AuthType, AuthFieldType, AssetType, AnchorMode, AddressHashMode };
|
|
@@ -138,6 +138,14 @@ declare const AuthFieldType: {
|
|
|
138
138
|
declare const RECOVERABLE_ECDSA_SIG_LENGTH_BYTES = 65;
|
|
139
139
|
declare const MEMO_MAX_LENGTH_BYTES = 34;
|
|
140
140
|
declare const MAX_STRING_LENGTH_BYTES = 128;
|
|
141
|
+
declare const COINBASE_BYTES_LENGTH = 32;
|
|
142
|
+
declare const VRF_PROOF_BYTES_LENGTH = 80;
|
|
143
|
+
declare const MICROBLOCK_HEADER_BYTES_LENGTH = 132;
|
|
144
|
+
declare const TenureChangeCause: {
|
|
145
|
+
readonly BlockFound: 0x00
|
|
146
|
+
readonly Extended: 0x01
|
|
147
|
+
};
|
|
148
|
+
type TenureChangeCause = (typeof TenureChangeCause)[keyof typeof TenureChangeCause];
|
|
141
149
|
type TokenTransferPayload = {
|
|
142
150
|
payloadType: typeof PayloadType.TokenTransfer
|
|
143
151
|
recipient: ClarityValue
|
|
@@ -157,7 +165,37 @@ type SmartContractPayload = {
|
|
|
157
165
|
contractName: string
|
|
158
166
|
codeBody: string
|
|
159
167
|
};
|
|
160
|
-
type
|
|
168
|
+
type CoinbasePayload = {
|
|
169
|
+
payloadType: typeof PayloadType.Coinbase
|
|
170
|
+
coinbaseBuffer: string
|
|
171
|
+
};
|
|
172
|
+
type CoinbaseToAltRecipientPayload = {
|
|
173
|
+
payloadType: typeof PayloadType.CoinbaseToAltRecipient
|
|
174
|
+
coinbaseBuffer: string
|
|
175
|
+
recipient: ClarityValue
|
|
176
|
+
};
|
|
177
|
+
type PoisonMicroblockPayload = {
|
|
178
|
+
payloadType: typeof PayloadType.PoisonMicroblock
|
|
179
|
+
header1: string
|
|
180
|
+
header2: string
|
|
181
|
+
};
|
|
182
|
+
type TenureChangePayload = {
|
|
183
|
+
payloadType: typeof PayloadType.TenureChange
|
|
184
|
+
tenureConsensusHash: string
|
|
185
|
+
prevTenureConsensusHash: string
|
|
186
|
+
burnViewConsensusHash: string
|
|
187
|
+
previousTenureEnd: string
|
|
188
|
+
previousTenureBlocks: number
|
|
189
|
+
cause: TenureChangeCause
|
|
190
|
+
pubkeyHash: string
|
|
191
|
+
};
|
|
192
|
+
type NakamotoCoinbasePayload = {
|
|
193
|
+
payloadType: typeof PayloadType.NakamotoCoinbase
|
|
194
|
+
coinbaseBuffer: string
|
|
195
|
+
recipient: ClarityValue | null
|
|
196
|
+
vrfProof: string
|
|
197
|
+
};
|
|
198
|
+
type TransactionPayload = TokenTransferPayload | ContractCallPayload | SmartContractPayload | CoinbasePayload | CoinbaseToAltRecipientPayload | PoisonMicroblockPayload | TenureChangePayload | NakamotoCoinbasePayload;
|
|
161
199
|
type SingleSigSpendingCondition = {
|
|
162
200
|
hashMode: typeof AddressHashMode.P2PKH | typeof AddressHashMode.P2WPKH
|
|
163
201
|
signer: string
|
|
@@ -409,4 +447,4 @@ declare function signMultiSigWithAccount(tx: StacksTransaction, account: LocalAc
|
|
|
409
447
|
declare function finalizeMultiSig(tx: StacksTransaction, publicKeys: string[]): StacksTransaction;
|
|
410
448
|
/** Combine independently-signed non-sequential multi-sig transactions */
|
|
411
449
|
declare function combineMultiSigSignatures(baseTx: StacksTransaction, signedTxs: StacksTransaction[]): StacksTransaction;
|
|
412
|
-
export { signTransactionWithAccount, signTransaction, signSponsorWithAccount, signSponsor, signMultiSigWithAccount, signMultiSig, signBegin, sigHashPreSign, sigHashPostSign, serializeTransactionHex, serializeTransaction, replayMultiSigSigHash, nextSignature, makeMultiSigAddress, isNonSequential, getTransactionId, getOriginSigHash, finalizeMultiSig, deserializeTransaction, createStandardAuth, createSponsoredAuth, createSingleSigSpendingCondition, createMultiSigSpendingCondition, combineMultiSigSignatures, buildTokenTransfer, buildContractDeploy, buildContractCall, TransactionPayload, TransactionAuthField, TokenTransferPayload, StandardAuthorization, StacksTransaction, SponsoredAuthorization, SpendingCondition, SmartContractPayload, SingleSigSpendingCondition, RECOVERABLE_ECDSA_SIG_LENGTH_BYTES, PubKeyEncoding, PostConditionWire, PostConditionPrincipalId, PostConditionModeWire, PayloadType, NonFungibleConditionCode, MultiSigSpendingCondition, MultiSigHashMode, MEMO_MAX_LENGTH_BYTES, MAX_STRING_LENGTH_BYTES, FungibleConditionCode, ContractCallPayload, ClarityVersion, BuildTokenTransferOptions, BuildContractDeployOptions, BuildContractCallOptions, Authorization, AuthType, AuthFieldType, AssetType, AnchorMode, AddressHashMode };
|
|
450
|
+
export { signTransactionWithAccount, signTransaction, signSponsorWithAccount, signSponsor, signMultiSigWithAccount, signMultiSig, signBegin, sigHashPreSign, sigHashPostSign, serializeTransactionHex, serializeTransaction, replayMultiSigSigHash, nextSignature, makeMultiSigAddress, isNonSequential, getTransactionId, getOriginSigHash, finalizeMultiSig, deserializeTransaction, createStandardAuth, createSponsoredAuth, createSingleSigSpendingCondition, createMultiSigSpendingCondition, combineMultiSigSignatures, buildTokenTransfer, buildContractDeploy, buildContractCall, VRF_PROOF_BYTES_LENGTH, TransactionPayload, TransactionAuthField, TokenTransferPayload, TenureChangePayload, TenureChangeCause as TenureChangeCauseType, TenureChangeCause, StandardAuthorization, StacksTransaction, SponsoredAuthorization, SpendingCondition, SmartContractPayload, SingleSigSpendingCondition, RECOVERABLE_ECDSA_SIG_LENGTH_BYTES, PubKeyEncoding, PostConditionWire, PostConditionPrincipalId, PostConditionModeWire, PoisonMicroblockPayload, PayloadType, NonFungibleConditionCode, NakamotoCoinbasePayload, MultiSigSpendingCondition, MultiSigHashMode, MICROBLOCK_HEADER_BYTES_LENGTH, MEMO_MAX_LENGTH_BYTES, MAX_STRING_LENGTH_BYTES, FungibleConditionCode, ContractCallPayload, CoinbaseToAltRecipientPayload, CoinbasePayload, ClarityVersion, COINBASE_BYTES_LENGTH, BuildTokenTransferOptions, BuildContractDeployOptions, BuildContractCallOptions, Authorization, AuthType, AuthFieldType, AssetType, AnchorMode, AddressHashMode };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
deserializeTransaction
|
|
3
|
-
} from "../../shared/stacks-
|
|
3
|
+
} from "../../shared/stacks-ph4a6322.js";
|
|
4
4
|
import {
|
|
5
5
|
buildContractCall,
|
|
6
6
|
buildContractDeploy,
|
|
@@ -12,23 +12,33 @@ import {
|
|
|
12
12
|
signSponsorWithAccount,
|
|
13
13
|
signTransaction,
|
|
14
14
|
signTransactionWithAccount
|
|
15
|
-
} from "../../shared/stacks-
|
|
15
|
+
} from "../../shared/stacks-nbz193yk.js";
|
|
16
|
+
import"../../shared/stacks-j2cy7qtt.js";
|
|
17
|
+
import"../../shared/stacks-8yykgdww.js";
|
|
18
|
+
import"../../shared/stacks-bycy6t9k.js";
|
|
19
|
+
import"../../shared/stacks-gjvbq6w7.js";
|
|
20
|
+
import"../../shared/stacks-nqytwfcc.js";
|
|
21
|
+
import"../../shared/stacks-njvyj3ab.js";
|
|
16
22
|
import {
|
|
17
23
|
AddressHashMode,
|
|
18
24
|
AnchorMode,
|
|
19
25
|
AssetType,
|
|
20
26
|
AuthFieldType,
|
|
21
27
|
AuthType,
|
|
28
|
+
COINBASE_BYTES_LENGTH,
|
|
22
29
|
ClarityVersion,
|
|
23
30
|
FungibleConditionCode,
|
|
24
31
|
MAX_STRING_LENGTH_BYTES,
|
|
25
32
|
MEMO_MAX_LENGTH_BYTES,
|
|
33
|
+
MICROBLOCK_HEADER_BYTES_LENGTH,
|
|
26
34
|
NonFungibleConditionCode,
|
|
27
35
|
PayloadType,
|
|
28
36
|
PostConditionModeWire,
|
|
29
37
|
PostConditionPrincipalId,
|
|
30
38
|
PubKeyEncoding,
|
|
31
39
|
RECOVERABLE_ECDSA_SIG_LENGTH_BYTES,
|
|
40
|
+
TenureChangeCause,
|
|
41
|
+
VRF_PROOF_BYTES_LENGTH,
|
|
32
42
|
combineMultiSigSignatures,
|
|
33
43
|
createMultiSigSpendingCondition,
|
|
34
44
|
createSingleSigSpendingCondition,
|
|
@@ -45,13 +55,7 @@ import {
|
|
|
45
55
|
sigHashPreSign,
|
|
46
56
|
signMultiSig,
|
|
47
57
|
signMultiSigWithAccount
|
|
48
|
-
} from "../../shared/stacks-
|
|
49
|
-
import"../../shared/stacks-j2cy7qtt.js";
|
|
50
|
-
import"../../shared/stacks-8yykgdww.js";
|
|
51
|
-
import"../../shared/stacks-bycy6t9k.js";
|
|
52
|
-
import"../../shared/stacks-gjvbq6w7.js";
|
|
53
|
-
import"../../shared/stacks-nqytwfcc.js";
|
|
54
|
-
import"../../shared/stacks-8m9byk2j.js";
|
|
58
|
+
} from "../../shared/stacks-xtz0n62y.js";
|
|
55
59
|
export {
|
|
56
60
|
signTransactionWithAccount,
|
|
57
61
|
signTransaction,
|
|
@@ -80,16 +84,20 @@ export {
|
|
|
80
84
|
buildTokenTransfer,
|
|
81
85
|
buildContractDeploy,
|
|
82
86
|
buildContractCall,
|
|
87
|
+
VRF_PROOF_BYTES_LENGTH,
|
|
88
|
+
TenureChangeCause,
|
|
83
89
|
RECOVERABLE_ECDSA_SIG_LENGTH_BYTES,
|
|
84
90
|
PubKeyEncoding,
|
|
85
91
|
PostConditionPrincipalId,
|
|
86
92
|
PostConditionModeWire,
|
|
87
93
|
PayloadType,
|
|
88
94
|
NonFungibleConditionCode,
|
|
95
|
+
MICROBLOCK_HEADER_BYTES_LENGTH,
|
|
89
96
|
MEMO_MAX_LENGTH_BYTES,
|
|
90
97
|
MAX_STRING_LENGTH_BYTES,
|
|
91
98
|
FungibleConditionCode,
|
|
92
99
|
ClarityVersion,
|
|
100
|
+
COINBASE_BYTES_LENGTH,
|
|
93
101
|
AuthType,
|
|
94
102
|
AuthFieldType,
|
|
95
103
|
AssetType,
|
|
@@ -97,5 +105,5 @@ export {
|
|
|
97
105
|
AddressHashMode
|
|
98
106
|
};
|
|
99
107
|
|
|
100
|
-
//# debugId=
|
|
108
|
+
//# debugId=F2E8FDA8941F446964756E2164756E21
|
|
101
109
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/utils/signature.ts", "../src/utils/keys.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import { Signature as NobleSignature, verify
|
|
5
|
+
"import { Signature as NobleSignature, verify } from \"@noble/secp256k1\";\nimport { sha256 } from \"@noble/hashes/sha2.js\";\nimport { hexToBytes, concatBytes, utf8ToBytes } from \"./encoding.ts\";\nimport { hashP2PKH } from \"./hash.ts\";\nimport { c32address } from \"./address.ts\";\nimport { AddressVersion } from \"./constants.ts\";\n\nexport interface RecoverableSignature {\n /** Recovery id (0–3) */\n recovery: number;\n /** 32-byte r value as hex */\n r: string;\n /** 32-byte s value as hex */\n s: 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 const clean = hex.startsWith(\"0x\") ? hex.slice(2) : hex;\n if (clean.length !== 130) {\n throw new Error(`Invalid signature length: expected 130 hex chars, got ${clean.length}`);\n }\n return {\n recovery: parseInt(clean.slice(0, 2), 16),\n r: clean.slice(2, 66),\n s: clean.slice(66, 130),\n };\n}\n\n/**\n * Serialize a recoverable signature to 65-byte VRS hex (130 chars).\n */\nexport function serializeSignature(sig: RecoverableSignature): string {\n const v = sig.recovery.toString(16).padStart(2, \"0\");\n return 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 const clean = vrs.startsWith(\"0x\") ? vrs.slice(2) : vrs;\n return 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 const clean = rsv.startsWith(\"0x\") ? rsv.slice(2) : rsv;\n return 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 hash: Uint8Array | string,\n signature: string,\n compressed = true\n): string {\n const parsed = parseSignature(signature);\n const rs = parsed.r + parsed.s;\n const sig = NobleSignature.fromCompact(rs).addRecoveryBit(parsed.recovery);\n const msgHash = typeof hash === \"string\" ? hexToBytes(hash) : hash;\n const point = sig.recoverPublicKey(msgHash);\n return 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 hash: Uint8Array | string,\n signature: string,\n addressVersion: number = AddressVersion.MainnetSingleSig\n): string {\n const pubkey = recoverPublicKey(hash, signature, true);\n const pubkeyHash = hashP2PKH(hexToBytes(pubkey));\n return 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 hash: Uint8Array | string,\n signature: string | Uint8Array,\n publicKey: string | Uint8Array\n): boolean {\n return verify(signature, hash, publicKey, { lowS: false });\n}\n\n/** Bitcoin-style varint encoding for message length prefix. */\nfunction encodeVarint(n: number): Uint8Array {\n if (n < 0xfd) return new Uint8Array([n]);\n if (n <= 0xffff) {\n const buf = new Uint8Array(3);\n buf[0] = 0xfd;\n buf[1] = n & 0xff;\n buf[2] = (n >> 8) & 0xff;\n return buf;\n }\n const buf = new Uint8Array(5);\n buf[0] = 0xfe;\n buf[1] = n & 0xff;\n buf[2] = (n >> 8) & 0xff;\n buf[3] = (n >> 16) & 0xff;\n buf[4] = (n >> 24) & 0xff;\n return 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 const messageBytes = typeof message === \"string\" ? utf8ToBytes(message) : message;\n const prefixBytes = utf8ToBytes(prefix);\n const lengthBytes = encodeVarint(messageBytes.length);\n return 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 message: string | Uint8Array,\n signature: string,\n publicKey: string\n): boolean {\n const parsed = parseSignature(signature);\n const compactSig = parsed.r + parsed.s;\n\n const msgHash = hashMessage(message, STACKS_MESSAGE_PREFIX);\n if (verify(compactSig, msgHash, publicKey, { lowS: false })) return true;\n\n // Fallback to legacy prefix\n if (typeof message === \"string\") {\n const legacyHash = hashMessage(message, LEGACY_MESSAGE_PREFIX);\n if (verify(compactSig, legacyHash, publicKey, { lowS: false })) return true;\n }\n\n return false;\n}\n",
|
|
6
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 const hex = typeof publicKey === \"string\" ? publicKey : bytesToHex(publicKey);\n return Point.fromHex(hex).toHex(true);\n}\n\n/** Uncompress a public key to 65 bytes (hex). */\nexport function uncompressPublicKey(publicKey: string | Uint8Array): string {\n const hex = typeof publicKey === \"string\" ? publicKey : bytesToHex(publicKey);\n return 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 const bytes = typeof publicKey === \"string\" ? hexToBytes(publicKey) : publicKey;\n return 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 return etc.randomBytes(length ?? 32);\n}\n"
|
|
7
7
|
],
|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
|
"names": []
|
|
11
11
|
}
|
|
@@ -33,7 +33,7 @@ declare function c32address(version: number, hash160hex: string): string;
|
|
|
33
33
|
declare function c32addressDecode(c32addr: string): [number, string];
|
|
34
34
|
declare function validateStacksAddress(address: string): boolean;
|
|
35
35
|
/** Alias for validateStacksAddress — matches future.md naming. */
|
|
36
|
-
declare const isValidAddress:
|
|
36
|
+
declare const isValidAddress: (address: string) => boolean;
|
|
37
37
|
declare function parseContractId(contractId: string): [string, string];
|
|
38
38
|
declare function isClarityName(name: string): boolean;
|
|
39
39
|
/**
|
|
@@ -48,9 +48,9 @@ declare function addressToVersion(address: string): number;
|
|
|
48
48
|
* Validates both parts; returns `deployer.contractName`.
|
|
49
49
|
*/
|
|
50
50
|
declare function getContractAddress(deployer: string, contractName: string): string;
|
|
51
|
-
declare const MAX_U128:
|
|
52
|
-
declare const MAX_I128:
|
|
53
|
-
declare const MIN_I128:
|
|
51
|
+
declare const MAX_U128: bigint;
|
|
52
|
+
declare const MAX_I128: bigint;
|
|
53
|
+
declare const MIN_I128: bigint;
|
|
54
54
|
/** C32-encoded address version bytes for single-sig and multi-sig on each network. */
|
|
55
55
|
declare const AddressVersion: {
|
|
56
56
|
readonly MainnetSingleSig: 22
|
|
@@ -33,7 +33,7 @@ declare function c32address(version: number, hash160hex: string): string;
|
|
|
33
33
|
declare function c32addressDecode(c32addr: string): [number, string];
|
|
34
34
|
declare function validateStacksAddress(address: string): boolean;
|
|
35
35
|
/** Alias for validateStacksAddress — matches future.md naming. */
|
|
36
|
-
declare const isValidAddress:
|
|
36
|
+
declare const isValidAddress: (address: string) => boolean;
|
|
37
37
|
declare function parseContractId(contractId: string): [string, string];
|
|
38
38
|
declare function isClarityName(name: string): boolean;
|
|
39
39
|
/**
|
|
@@ -48,9 +48,9 @@ declare function addressToVersion(address: string): number;
|
|
|
48
48
|
* Validates both parts; returns `deployer.contractName`.
|
|
49
49
|
*/
|
|
50
50
|
declare function getContractAddress(deployer: string, contractName: string): string;
|
|
51
|
-
declare const MAX_U128:
|
|
52
|
-
declare const MAX_I128:
|
|
53
|
-
declare const MIN_I128:
|
|
51
|
+
declare const MAX_U128: bigint;
|
|
52
|
+
declare const MAX_I128: bigint;
|
|
53
|
+
declare const MIN_I128: bigint;
|
|
54
54
|
/** C32-encoded address version bytes for single-sig and multi-sig on each network. */
|
|
55
55
|
declare const AddressVersion: {
|
|
56
56
|
readonly MainnetSingleSig: 22
|