@stacks/codec 2.0.0-pox5.3 → 2.0.0-pox5.5
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/index.d.ts +56 -2
- package/index.js +15 -1
- package/index.mjs +16 -0
- package/native/darwin-arm64.node +0 -0
- package/native/linux-arm64-glibc.node +0 -0
- package/native/linux-arm64-musl.node +0 -0
- package/native/linux-x64-glibc.node +0 -0
- package/native/linux-x64-musl.node +0 -0
- package/native/win32-x64.node +0 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as bindings from './loader.js';
|
|
|
2
2
|
export * from './loader.js';
|
|
3
3
|
export declare const StacksNativeEncodingBindings: typeof bindings;
|
|
4
4
|
export default StacksNativeEncodingBindings;
|
|
5
|
-
export type TxPostCondition = PostConditionStx | PostConditionFungible | PostConditionNonfungible;
|
|
5
|
+
export type TxPostCondition = PostConditionStx | PostConditionFungible | PostConditionNonfungible | PostConditionStaking | PostConditionPox;
|
|
6
6
|
export interface DecodedPostConditionsResult {
|
|
7
7
|
post_condition_mode: PostConditionModeID;
|
|
8
8
|
post_conditions: TxPostCondition[];
|
|
@@ -23,7 +23,9 @@ export interface DecodedTxResult {
|
|
|
23
23
|
export declare enum PostConditionAssetInfoID {
|
|
24
24
|
STX = 0,
|
|
25
25
|
FungibleAsset = 1,
|
|
26
|
-
NonfungibleAsset = 2
|
|
26
|
+
NonfungibleAsset = 2,
|
|
27
|
+
Staking = 3,
|
|
28
|
+
Pox = 4
|
|
27
29
|
}
|
|
28
30
|
export interface PostConditionStx {
|
|
29
31
|
asset_info_id: PostConditionAssetInfoID.STX;
|
|
@@ -48,11 +50,44 @@ export interface PostConditionNonfungible {
|
|
|
48
50
|
condition_code: PostConditionNonfungibleConditionCodeID;
|
|
49
51
|
condition_name: PostConditionNonFungibleConditionName;
|
|
50
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Constrains how much STX a principal may stake (lock for PoX) during the
|
|
55
|
+
* transaction. Only valid in Stacks epoch 4.0 and later.
|
|
56
|
+
*/
|
|
57
|
+
export interface PostConditionStaking {
|
|
58
|
+
asset_info_id: PostConditionAssetInfoID.Staking;
|
|
59
|
+
principal: PostConditionPrincipal;
|
|
60
|
+
condition_code: PostConditionFungibleConditionCodeID;
|
|
61
|
+
condition_name: PostConditionFungibleConditionCodeName;
|
|
62
|
+
amount: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Constrains whether a principal may perform a position-altering PoX
|
|
66
|
+
* operation (`unstake`, `unstake-sbtc`, `update-bond-registration`,
|
|
67
|
+
* `announce-l1-early-exit`) during the transaction. Only valid in Stacks
|
|
68
|
+
* epoch 4.0 and later.
|
|
69
|
+
*/
|
|
70
|
+
export interface PostConditionPox {
|
|
71
|
+
asset_info_id: PostConditionAssetInfoID.Pox;
|
|
72
|
+
principal: PostConditionPrincipal;
|
|
73
|
+
condition_code: PostConditionPoxConditionCodeID;
|
|
74
|
+
condition_name: PostConditionPoxConditionCodeName;
|
|
75
|
+
}
|
|
51
76
|
export interface PostConditionAssetInfo {
|
|
52
77
|
contract_address: string;
|
|
53
78
|
contract_name: string;
|
|
54
79
|
asset_name: string;
|
|
55
80
|
}
|
|
81
|
+
export declare enum PostConditionPoxConditionCodeID {
|
|
82
|
+
NotPerformed = 48,
|
|
83
|
+
MaybePerformed = 49,
|
|
84
|
+
Performed = 50
|
|
85
|
+
}
|
|
86
|
+
export declare enum PostConditionPoxConditionCodeName {
|
|
87
|
+
NotPerformed = "not_performed",
|
|
88
|
+
MaybePerformed = "maybe_performed",
|
|
89
|
+
Performed = "performed"
|
|
90
|
+
}
|
|
56
91
|
export declare enum PostConditionNonfungibleConditionCodeID {
|
|
57
92
|
Sent = 16,
|
|
58
93
|
NotSent = 17,
|
|
@@ -803,6 +838,23 @@ export interface Pox5EventAddToAllowlist extends Pox5EventBase {
|
|
|
803
838
|
bond_index: string;
|
|
804
839
|
};
|
|
805
840
|
}
|
|
841
|
+
/** One proven L1 output in a `register-for-bond` `btc_lockup`. */
|
|
842
|
+
export interface Pox5BtcLockupTx {
|
|
843
|
+
/** Reversed (big-endian) txid as a `0x`-prefixed hex string. */
|
|
844
|
+
txid: string;
|
|
845
|
+
/** String-quoted unsigned integer */
|
|
846
|
+
output_index: string;
|
|
847
|
+
}
|
|
848
|
+
/** The `btc_lockup` sub-object of a `register-for-bond` event. */
|
|
849
|
+
export interface Pox5BtcLockup {
|
|
850
|
+
/** `'l1'` for a Bitcoin L1 lockup, `'l2'` for an sBTC lockup. */
|
|
851
|
+
type: string;
|
|
852
|
+
/**
|
|
853
|
+
* The proven L1 outputs for an `'l1'` lockup, or `null` for an `'l2'`
|
|
854
|
+
* (sBTC) lockup.
|
|
855
|
+
*/
|
|
856
|
+
txs: Pox5BtcLockupTx[] | null;
|
|
857
|
+
}
|
|
806
858
|
export interface Pox5EventRegisterForBond extends Pox5EventBase {
|
|
807
859
|
name: Pox5EventName.RegisterForBond;
|
|
808
860
|
data: {
|
|
@@ -824,6 +876,8 @@ export interface Pox5EventRegisterForBond extends Pox5EventBase {
|
|
|
824
876
|
unlock_cycle: string;
|
|
825
877
|
/** True if the participant proved an L1 BTC lockup; false if they locked sBTC. */
|
|
826
878
|
is_l1_lock: boolean;
|
|
879
|
+
/** How the BTC was locked (L1 proof outputs vs. sBTC). */
|
|
880
|
+
btc_lockup: Pox5BtcLockup;
|
|
827
881
|
};
|
|
828
882
|
}
|
|
829
883
|
export interface Pox5EventUpdateBondRegistration extends Pox5EventBase {
|
package/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.Pox5EventName = exports.Pox4EventName = exports.ClarityTypeID = exports.PostConditionModeID = exports.AnchorModeID = exports.TransactionVersion = exports.TxPublicKeyEncoding = exports.TxAuthFieldTypeID = exports.ClarityVersion = exports.TxSpendingConditionMultiSigHashMode = exports.TxSpendingConditionSingleSigHashMode = exports.PostConditionAuthFlag = exports.TxPayloadTypeID = exports.TenureChangeCause = exports.PrincipalTypeID = exports.PostConditionPrincipalTypeID = exports.PostConditionFungibleConditionCodeName = exports.PostConditionFungibleConditionCodeID = exports.PostConditionNonFungibleConditionName = exports.PostConditionNonfungibleConditionCodeID = exports.PostConditionAssetInfoID = exports.StacksNativeEncodingBindings = void 0;
|
|
39
|
+
exports.Pox5EventName = exports.Pox4EventName = exports.ClarityTypeID = exports.PostConditionModeID = exports.AnchorModeID = exports.TransactionVersion = exports.TxPublicKeyEncoding = exports.TxAuthFieldTypeID = exports.ClarityVersion = exports.TxSpendingConditionMultiSigHashMode = exports.TxSpendingConditionSingleSigHashMode = exports.PostConditionAuthFlag = exports.TxPayloadTypeID = exports.TenureChangeCause = exports.PrincipalTypeID = exports.PostConditionPrincipalTypeID = exports.PostConditionFungibleConditionCodeName = exports.PostConditionFungibleConditionCodeID = exports.PostConditionNonFungibleConditionName = exports.PostConditionNonfungibleConditionCodeID = exports.PostConditionPoxConditionCodeName = exports.PostConditionPoxConditionCodeID = exports.PostConditionAssetInfoID = exports.StacksNativeEncodingBindings = void 0;
|
|
40
40
|
const bindings = __importStar(require("./loader.js"));
|
|
41
41
|
__exportStar(require("./loader.js"), exports);
|
|
42
42
|
exports.StacksNativeEncodingBindings = bindings;
|
|
@@ -46,7 +46,21 @@ var PostConditionAssetInfoID;
|
|
|
46
46
|
PostConditionAssetInfoID[PostConditionAssetInfoID["STX"] = 0] = "STX";
|
|
47
47
|
PostConditionAssetInfoID[PostConditionAssetInfoID["FungibleAsset"] = 1] = "FungibleAsset";
|
|
48
48
|
PostConditionAssetInfoID[PostConditionAssetInfoID["NonfungibleAsset"] = 2] = "NonfungibleAsset";
|
|
49
|
+
PostConditionAssetInfoID[PostConditionAssetInfoID["Staking"] = 3] = "Staking";
|
|
50
|
+
PostConditionAssetInfoID[PostConditionAssetInfoID["Pox"] = 4] = "Pox";
|
|
49
51
|
})(PostConditionAssetInfoID || (exports.PostConditionAssetInfoID = PostConditionAssetInfoID = {}));
|
|
52
|
+
var PostConditionPoxConditionCodeID;
|
|
53
|
+
(function (PostConditionPoxConditionCodeID) {
|
|
54
|
+
PostConditionPoxConditionCodeID[PostConditionPoxConditionCodeID["NotPerformed"] = 48] = "NotPerformed";
|
|
55
|
+
PostConditionPoxConditionCodeID[PostConditionPoxConditionCodeID["MaybePerformed"] = 49] = "MaybePerformed";
|
|
56
|
+
PostConditionPoxConditionCodeID[PostConditionPoxConditionCodeID["Performed"] = 50] = "Performed";
|
|
57
|
+
})(PostConditionPoxConditionCodeID || (exports.PostConditionPoxConditionCodeID = PostConditionPoxConditionCodeID = {}));
|
|
58
|
+
var PostConditionPoxConditionCodeName;
|
|
59
|
+
(function (PostConditionPoxConditionCodeName) {
|
|
60
|
+
PostConditionPoxConditionCodeName["NotPerformed"] = "not_performed";
|
|
61
|
+
PostConditionPoxConditionCodeName["MaybePerformed"] = "maybe_performed";
|
|
62
|
+
PostConditionPoxConditionCodeName["Performed"] = "performed";
|
|
63
|
+
})(PostConditionPoxConditionCodeName || (exports.PostConditionPoxConditionCodeName = PostConditionPoxConditionCodeName = {}));
|
|
50
64
|
var PostConditionNonfungibleConditionCodeID;
|
|
51
65
|
(function (PostConditionNonfungibleConditionCodeID) {
|
|
52
66
|
PostConditionNonfungibleConditionCodeID[PostConditionNonfungibleConditionCodeID["Sent"] = 16] = "Sent";
|
package/index.mjs
CHANGED
|
@@ -6,8 +6,22 @@ var PostConditionAssetInfoID = /* @__PURE__ */ ((PostConditionAssetInfoID2) => {
|
|
|
6
6
|
PostConditionAssetInfoID2[PostConditionAssetInfoID2["STX"] = 0] = "STX";
|
|
7
7
|
PostConditionAssetInfoID2[PostConditionAssetInfoID2["FungibleAsset"] = 1] = "FungibleAsset";
|
|
8
8
|
PostConditionAssetInfoID2[PostConditionAssetInfoID2["NonfungibleAsset"] = 2] = "NonfungibleAsset";
|
|
9
|
+
PostConditionAssetInfoID2[PostConditionAssetInfoID2["Staking"] = 3] = "Staking";
|
|
10
|
+
PostConditionAssetInfoID2[PostConditionAssetInfoID2["Pox"] = 4] = "Pox";
|
|
9
11
|
return PostConditionAssetInfoID2;
|
|
10
12
|
})(PostConditionAssetInfoID || {});
|
|
13
|
+
var PostConditionPoxConditionCodeID = /* @__PURE__ */ ((PostConditionPoxConditionCodeID2) => {
|
|
14
|
+
PostConditionPoxConditionCodeID2[PostConditionPoxConditionCodeID2["NotPerformed"] = 48] = "NotPerformed";
|
|
15
|
+
PostConditionPoxConditionCodeID2[PostConditionPoxConditionCodeID2["MaybePerformed"] = 49] = "MaybePerformed";
|
|
16
|
+
PostConditionPoxConditionCodeID2[PostConditionPoxConditionCodeID2["Performed"] = 50] = "Performed";
|
|
17
|
+
return PostConditionPoxConditionCodeID2;
|
|
18
|
+
})(PostConditionPoxConditionCodeID || {});
|
|
19
|
+
var PostConditionPoxConditionCodeName = /* @__PURE__ */ ((PostConditionPoxConditionCodeName2) => {
|
|
20
|
+
PostConditionPoxConditionCodeName2["NotPerformed"] = "not_performed";
|
|
21
|
+
PostConditionPoxConditionCodeName2["MaybePerformed"] = "maybe_performed";
|
|
22
|
+
PostConditionPoxConditionCodeName2["Performed"] = "performed";
|
|
23
|
+
return PostConditionPoxConditionCodeName2;
|
|
24
|
+
})(PostConditionPoxConditionCodeName || {});
|
|
11
25
|
var PostConditionNonfungibleConditionCodeID = /* @__PURE__ */ ((PostConditionNonfungibleConditionCodeID2) => {
|
|
12
26
|
PostConditionNonfungibleConditionCodeID2[PostConditionNonfungibleConditionCodeID2["Sent"] = 16] = "Sent";
|
|
13
27
|
PostConditionNonfungibleConditionCodeID2[PostConditionNonfungibleConditionCodeID2["NotSent"] = 17] = "NotSent";
|
|
@@ -190,6 +204,8 @@ export {
|
|
|
190
204
|
PostConditionModeID,
|
|
191
205
|
PostConditionNonFungibleConditionName,
|
|
192
206
|
PostConditionNonfungibleConditionCodeID,
|
|
207
|
+
PostConditionPoxConditionCodeID,
|
|
208
|
+
PostConditionPoxConditionCodeName,
|
|
193
209
|
PostConditionPrincipalTypeID,
|
|
194
210
|
Pox4EventName,
|
|
195
211
|
Pox5EventName,
|
package/native/darwin-arm64.node
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/native/win32-x64.node
CHANGED
|
Binary file
|
package/package.json
CHANGED