@stacks/codec 1.6.0 → 1.8.0-pox5.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 +1 -1
- package/index.d.ts +14 -13
- package/index.js +45 -22
- package/index.mjs +183 -0
- package/loader.d.ts +20 -9
- package/loader.js +26 -4
- 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 +22 -8
package/README.md
CHANGED
package/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as bindings from './loader';
|
|
2
|
-
export * from './loader';
|
|
1
|
+
import * as bindings from './loader.js';
|
|
2
|
+
export * from './loader.js';
|
|
3
3
|
export declare const StacksNativeEncodingBindings: typeof bindings;
|
|
4
4
|
export default StacksNativeEncodingBindings;
|
|
5
|
-
export
|
|
5
|
+
export type TxPostCondition = PostConditionStx | PostConditionFungible | PostConditionNonfungible;
|
|
6
6
|
export interface DecodedPostConditionsResult {
|
|
7
7
|
post_condition_mode: PostConditionModeID;
|
|
8
8
|
post_conditions: TxPostCondition[];
|
|
@@ -85,7 +85,7 @@ export declare enum PostConditionPrincipalTypeID {
|
|
|
85
85
|
/** A Non-fungible token post-condition, which pertains to one of the origin account's non-fungible tokens. */
|
|
86
86
|
Contract = 3
|
|
87
87
|
}
|
|
88
|
-
export
|
|
88
|
+
export type PostConditionPrincipal = PostConditionPrincipalOrigin | PostConditionPrincipalStandard | PostConditionPrincipalContract;
|
|
89
89
|
export interface PostConditionPrincipalOrigin {
|
|
90
90
|
type_id: PostConditionPrincipalTypeID.Origin;
|
|
91
91
|
}
|
|
@@ -259,7 +259,8 @@ export declare enum ClarityVersion {
|
|
|
259
259
|
Clarity2 = 2,
|
|
260
260
|
Clarity3 = 3,
|
|
261
261
|
Clarity4 = 4,
|
|
262
|
-
Clarity5 = 5
|
|
262
|
+
Clarity5 = 5,
|
|
263
|
+
Clarity6 = 6
|
|
263
264
|
}
|
|
264
265
|
export interface DecodedTxSpendingConditionSingleSig {
|
|
265
266
|
hash_mode: TxSpendingConditionSingleSigHashMode;
|
|
@@ -416,7 +417,7 @@ export interface ClarityValuePrincipalContract extends ClarityValueCommon {
|
|
|
416
417
|
address_hash_bytes: string;
|
|
417
418
|
contract_name: string;
|
|
418
419
|
}
|
|
419
|
-
export
|
|
420
|
+
export type ClarityTupleData<T extends ClarityValue = ClarityValue> = {
|
|
420
421
|
[key: string]: T;
|
|
421
422
|
};
|
|
422
423
|
export interface ClarityValueTuple<T extends ClarityTupleData = ClarityTupleData> extends ClarityValueCommon {
|
|
@@ -438,18 +439,18 @@ export interface ClarityValueResponseError<T extends ClarityValue = ClarityValue
|
|
|
438
439
|
type_id: ClarityTypeID.ResponseError;
|
|
439
440
|
value: T;
|
|
440
441
|
}
|
|
441
|
-
export
|
|
442
|
-
export
|
|
443
|
-
export
|
|
444
|
-
export
|
|
442
|
+
export type ClarityValue = ClarityValueInt | ClarityValueUInt | ClarityValueBoolTrue | ClarityValueBoolFalse | ClarityValueBuffer | ClarityValueList | ClarityValueStringAscii | ClarityValueStringUtf8 | ClarityValuePrincipalStandard | ClarityValuePrincipalContract | ClarityValueTuple | ClarityValueOptionalSome | ClarityValueOptionalNone | ClarityValueResponseOk | ClarityValueResponseError;
|
|
443
|
+
export type ClarityValueOptional<T extends ClarityValue = ClarityValue> = ClarityValueOptionalSome<T> | ClarityValueOptionalNone;
|
|
444
|
+
export type ClarityValueBool = ClarityValueBoolTrue | ClarityValueBoolFalse;
|
|
445
|
+
export type ClarityValueResponse<TOk extends ClarityValue = ClarityValue, TError extends ClarityValue = ClarityValue> = ClarityValueResponseOk<TOk> | ClarityValueResponseError<TError>;
|
|
445
446
|
/**
|
|
446
447
|
* Type for commonly used `(optional bool)`
|
|
447
448
|
*/
|
|
448
|
-
export
|
|
449
|
+
export type ClarityValueOptionalBool = ClarityValueOptional<ClarityValueBool>;
|
|
449
450
|
/**
|
|
450
451
|
* Type for commonly used `(optional uint)`
|
|
451
452
|
*/
|
|
452
|
-
export
|
|
453
|
+
export type ClarityValueOptionalUInt = ClarityValueOptional<ClarityValueUInt>;
|
|
453
454
|
export interface DecodedNakamotoBlockResult {
|
|
454
455
|
/** Hex encoded string of the block ID (index block hash) */
|
|
455
456
|
block_id: string;
|
|
@@ -719,4 +720,4 @@ export interface PoxEventRevokeDelegateStx extends PoxEventBase {
|
|
|
719
720
|
start_cycle_id: string | null;
|
|
720
721
|
};
|
|
721
722
|
}
|
|
722
|
-
export
|
|
723
|
+
export type DecodedPoxSyntheticEvent = PoxEventHandleUnlock | PoxEventStackStx | PoxEventStackIncrease | PoxEventStackExtend | PoxEventDelegateStx | PoxEventDelegateStackStx | PoxEventDelegateStackIncrease | PoxEventDelegateStackExtend | PoxEventStackAggregationCommit | PoxEventStackAggregationCommitIndexed | PoxEventStackAggregationIncrease | PoxEventRevokeDelegateStx;
|
package/index.js
CHANGED
|
@@ -10,13 +10,35 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
13
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
37
|
};
|
|
16
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
39
|
exports.PoxEventName = 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;
|
|
18
|
-
const bindings = require("./loader");
|
|
19
|
-
__exportStar(require("./loader"), exports);
|
|
40
|
+
const bindings = __importStar(require("./loader.js"));
|
|
41
|
+
__exportStar(require("./loader.js"), exports);
|
|
20
42
|
exports.StacksNativeEncodingBindings = bindings;
|
|
21
43
|
exports.default = exports.StacksNativeEncodingBindings;
|
|
22
44
|
var PostConditionAssetInfoID;
|
|
@@ -24,19 +46,19 @@ var PostConditionAssetInfoID;
|
|
|
24
46
|
PostConditionAssetInfoID[PostConditionAssetInfoID["STX"] = 0] = "STX";
|
|
25
47
|
PostConditionAssetInfoID[PostConditionAssetInfoID["FungibleAsset"] = 1] = "FungibleAsset";
|
|
26
48
|
PostConditionAssetInfoID[PostConditionAssetInfoID["NonfungibleAsset"] = 2] = "NonfungibleAsset";
|
|
27
|
-
})(PostConditionAssetInfoID
|
|
49
|
+
})(PostConditionAssetInfoID || (exports.PostConditionAssetInfoID = PostConditionAssetInfoID = {}));
|
|
28
50
|
var PostConditionNonfungibleConditionCodeID;
|
|
29
51
|
(function (PostConditionNonfungibleConditionCodeID) {
|
|
30
52
|
PostConditionNonfungibleConditionCodeID[PostConditionNonfungibleConditionCodeID["Sent"] = 16] = "Sent";
|
|
31
53
|
PostConditionNonfungibleConditionCodeID[PostConditionNonfungibleConditionCodeID["NotSent"] = 17] = "NotSent";
|
|
32
54
|
PostConditionNonfungibleConditionCodeID[PostConditionNonfungibleConditionCodeID["MaybeSent"] = 18] = "MaybeSent";
|
|
33
|
-
})(PostConditionNonfungibleConditionCodeID
|
|
55
|
+
})(PostConditionNonfungibleConditionCodeID || (exports.PostConditionNonfungibleConditionCodeID = PostConditionNonfungibleConditionCodeID = {}));
|
|
34
56
|
var PostConditionNonFungibleConditionName;
|
|
35
57
|
(function (PostConditionNonFungibleConditionName) {
|
|
36
58
|
PostConditionNonFungibleConditionName["Sent"] = "sent";
|
|
37
59
|
PostConditionNonFungibleConditionName["NotSent"] = "not_sent";
|
|
38
60
|
PostConditionNonFungibleConditionName["MaybeSent"] = "maybe_sent";
|
|
39
|
-
})(PostConditionNonFungibleConditionName
|
|
61
|
+
})(PostConditionNonFungibleConditionName || (exports.PostConditionNonFungibleConditionName = PostConditionNonFungibleConditionName = {}));
|
|
40
62
|
var PostConditionFungibleConditionCodeID;
|
|
41
63
|
(function (PostConditionFungibleConditionCodeID) {
|
|
42
64
|
PostConditionFungibleConditionCodeID[PostConditionFungibleConditionCodeID["SentEq"] = 1] = "SentEq";
|
|
@@ -44,7 +66,7 @@ var PostConditionFungibleConditionCodeID;
|
|
|
44
66
|
PostConditionFungibleConditionCodeID[PostConditionFungibleConditionCodeID["SentGe"] = 3] = "SentGe";
|
|
45
67
|
PostConditionFungibleConditionCodeID[PostConditionFungibleConditionCodeID["SentLt"] = 4] = "SentLt";
|
|
46
68
|
PostConditionFungibleConditionCodeID[PostConditionFungibleConditionCodeID["SentLe"] = 5] = "SentLe";
|
|
47
|
-
})(PostConditionFungibleConditionCodeID
|
|
69
|
+
})(PostConditionFungibleConditionCodeID || (exports.PostConditionFungibleConditionCodeID = PostConditionFungibleConditionCodeID = {}));
|
|
48
70
|
var PostConditionFungibleConditionCodeName;
|
|
49
71
|
(function (PostConditionFungibleConditionCodeName) {
|
|
50
72
|
PostConditionFungibleConditionCodeName["SentEq"] = "sent_equal_to";
|
|
@@ -52,7 +74,7 @@ var PostConditionFungibleConditionCodeName;
|
|
|
52
74
|
PostConditionFungibleConditionCodeName["SentGe"] = "sent_greater_than_or_equal_to";
|
|
53
75
|
PostConditionFungibleConditionCodeName["SentLt"] = "sent_less_than";
|
|
54
76
|
PostConditionFungibleConditionCodeName["SentLe"] = "sent_less_than_or_equal_to";
|
|
55
|
-
})(PostConditionFungibleConditionCodeName
|
|
77
|
+
})(PostConditionFungibleConditionCodeName || (exports.PostConditionFungibleConditionCodeName = PostConditionFungibleConditionCodeName = {}));
|
|
56
78
|
var PostConditionPrincipalTypeID;
|
|
57
79
|
(function (PostConditionPrincipalTypeID) {
|
|
58
80
|
/** A STX post-condition, which pertains to the origin account's STX. */
|
|
@@ -61,12 +83,12 @@ var PostConditionPrincipalTypeID;
|
|
|
61
83
|
PostConditionPrincipalTypeID[PostConditionPrincipalTypeID["Standard"] = 2] = "Standard";
|
|
62
84
|
/** A Non-fungible token post-condition, which pertains to one of the origin account's non-fungible tokens. */
|
|
63
85
|
PostConditionPrincipalTypeID[PostConditionPrincipalTypeID["Contract"] = 3] = "Contract";
|
|
64
|
-
})(PostConditionPrincipalTypeID
|
|
86
|
+
})(PostConditionPrincipalTypeID || (exports.PostConditionPrincipalTypeID = PostConditionPrincipalTypeID = {}));
|
|
65
87
|
var PrincipalTypeID;
|
|
66
88
|
(function (PrincipalTypeID) {
|
|
67
89
|
PrincipalTypeID[PrincipalTypeID["Standard"] = 5] = "Standard";
|
|
68
90
|
PrincipalTypeID[PrincipalTypeID["Contract"] = 6] = "Contract";
|
|
69
|
-
})(PrincipalTypeID
|
|
91
|
+
})(PrincipalTypeID || (exports.PrincipalTypeID = PrincipalTypeID = {}));
|
|
70
92
|
var TenureChangeCause;
|
|
71
93
|
(function (TenureChangeCause) {
|
|
72
94
|
/** A valid winning block-commit */
|
|
@@ -83,7 +105,7 @@ var TenureChangeCause;
|
|
|
83
105
|
TenureChangeCause[TenureChangeCause["ExtendedWriteCount"] = 5] = "ExtendedWriteCount";
|
|
84
106
|
/** SIP-034: extend specific dimensions - write length */
|
|
85
107
|
TenureChangeCause[TenureChangeCause["ExtendedWriteLength"] = 6] = "ExtendedWriteLength";
|
|
86
|
-
})(TenureChangeCause
|
|
108
|
+
})(TenureChangeCause || (exports.TenureChangeCause = TenureChangeCause = {}));
|
|
87
109
|
var TxPayloadTypeID;
|
|
88
110
|
(function (TxPayloadTypeID) {
|
|
89
111
|
TxPayloadTypeID[TxPayloadTypeID["TokenTransfer"] = 0] = "TokenTransfer";
|
|
@@ -95,19 +117,19 @@ var TxPayloadTypeID;
|
|
|
95
117
|
TxPayloadTypeID[TxPayloadTypeID["VersionedSmartContract"] = 6] = "VersionedSmartContract";
|
|
96
118
|
TxPayloadTypeID[TxPayloadTypeID["TenureChange"] = 7] = "TenureChange";
|
|
97
119
|
TxPayloadTypeID[TxPayloadTypeID["NakamotoCoinbase"] = 8] = "NakamotoCoinbase";
|
|
98
|
-
})(TxPayloadTypeID
|
|
120
|
+
})(TxPayloadTypeID || (exports.TxPayloadTypeID = TxPayloadTypeID = {}));
|
|
99
121
|
var PostConditionAuthFlag;
|
|
100
122
|
(function (PostConditionAuthFlag) {
|
|
101
123
|
PostConditionAuthFlag[PostConditionAuthFlag["Standard"] = 4] = "Standard";
|
|
102
124
|
PostConditionAuthFlag[PostConditionAuthFlag["Sponsored"] = 5] = "Sponsored";
|
|
103
|
-
})(PostConditionAuthFlag
|
|
125
|
+
})(PostConditionAuthFlag || (exports.PostConditionAuthFlag = PostConditionAuthFlag = {}));
|
|
104
126
|
var TxSpendingConditionSingleSigHashMode;
|
|
105
127
|
(function (TxSpendingConditionSingleSigHashMode) {
|
|
106
128
|
/** hash160(public-key), same as bitcoin's p2pkh */
|
|
107
129
|
TxSpendingConditionSingleSigHashMode[TxSpendingConditionSingleSigHashMode["P2PKH"] = 0] = "P2PKH";
|
|
108
130
|
/** hash160(segwit-program-00(p2pkh)), same as bitcoin's p2sh-p2wpkh */
|
|
109
131
|
TxSpendingConditionSingleSigHashMode[TxSpendingConditionSingleSigHashMode["P2WPKH"] = 2] = "P2WPKH";
|
|
110
|
-
})(TxSpendingConditionSingleSigHashMode
|
|
132
|
+
})(TxSpendingConditionSingleSigHashMode || (exports.TxSpendingConditionSingleSigHashMode = TxSpendingConditionSingleSigHashMode = {}));
|
|
111
133
|
var TxSpendingConditionMultiSigHashMode;
|
|
112
134
|
(function (TxSpendingConditionMultiSigHashMode) {
|
|
113
135
|
/** hash160(multisig-redeem-script), same as bitcoin's multisig p2sh */
|
|
@@ -118,7 +140,7 @@ var TxSpendingConditionMultiSigHashMode;
|
|
|
118
140
|
TxSpendingConditionMultiSigHashMode[TxSpendingConditionMultiSigHashMode["P2WSH"] = 3] = "P2WSH";
|
|
119
141
|
/** hash160(segwit-program-00(public-keys)), same as bitcoin's p2sh-p2wsh (non-sequential signing) */
|
|
120
142
|
TxSpendingConditionMultiSigHashMode[TxSpendingConditionMultiSigHashMode["P2WSHNonSequential"] = 7] = "P2WSHNonSequential";
|
|
121
|
-
})(TxSpendingConditionMultiSigHashMode
|
|
143
|
+
})(TxSpendingConditionMultiSigHashMode || (exports.TxSpendingConditionMultiSigHashMode = TxSpendingConditionMultiSigHashMode = {}));
|
|
122
144
|
var ClarityVersion;
|
|
123
145
|
(function (ClarityVersion) {
|
|
124
146
|
ClarityVersion[ClarityVersion["Clarity1"] = 1] = "Clarity1";
|
|
@@ -126,7 +148,8 @@ var ClarityVersion;
|
|
|
126
148
|
ClarityVersion[ClarityVersion["Clarity3"] = 3] = "Clarity3";
|
|
127
149
|
ClarityVersion[ClarityVersion["Clarity4"] = 4] = "Clarity4";
|
|
128
150
|
ClarityVersion[ClarityVersion["Clarity5"] = 5] = "Clarity5";
|
|
129
|
-
|
|
151
|
+
ClarityVersion[ClarityVersion["Clarity6"] = 6] = "Clarity6";
|
|
152
|
+
})(ClarityVersion || (exports.ClarityVersion = ClarityVersion = {}));
|
|
130
153
|
var TxAuthFieldTypeID;
|
|
131
154
|
(function (TxAuthFieldTypeID) {
|
|
132
155
|
/** The next 33 bytes are a compressed secp256k1 public key. If the field ID is 0x00, the key will be loaded as a compressed secp256k1 public key. */
|
|
@@ -137,17 +160,17 @@ var TxAuthFieldTypeID;
|
|
|
137
160
|
TxAuthFieldTypeID[TxAuthFieldTypeID["SignatureCompressed"] = 2] = "SignatureCompressed";
|
|
138
161
|
/** The next 65 bytes are a recoverable secp256k1 ECDSA signature. If it is 0x03, then the recovered public key will be loaded as an uncompressed public key. */
|
|
139
162
|
TxAuthFieldTypeID[TxAuthFieldTypeID["SignatureUncompressed"] = 3] = "SignatureUncompressed";
|
|
140
|
-
})(TxAuthFieldTypeID
|
|
163
|
+
})(TxAuthFieldTypeID || (exports.TxAuthFieldTypeID = TxAuthFieldTypeID = {}));
|
|
141
164
|
var TxPublicKeyEncoding;
|
|
142
165
|
(function (TxPublicKeyEncoding) {
|
|
143
166
|
TxPublicKeyEncoding[TxPublicKeyEncoding["Compressed"] = 0] = "Compressed";
|
|
144
167
|
TxPublicKeyEncoding[TxPublicKeyEncoding["Uncompressed"] = 1] = "Uncompressed";
|
|
145
|
-
})(TxPublicKeyEncoding
|
|
168
|
+
})(TxPublicKeyEncoding || (exports.TxPublicKeyEncoding = TxPublicKeyEncoding = {}));
|
|
146
169
|
var TransactionVersion;
|
|
147
170
|
(function (TransactionVersion) {
|
|
148
171
|
TransactionVersion[TransactionVersion["Mainnet"] = 0] = "Mainnet";
|
|
149
172
|
TransactionVersion[TransactionVersion["Testnet"] = 128] = "Testnet";
|
|
150
|
-
})(TransactionVersion
|
|
173
|
+
})(TransactionVersion || (exports.TransactionVersion = TransactionVersion = {}));
|
|
151
174
|
var AnchorModeID;
|
|
152
175
|
(function (AnchorModeID) {
|
|
153
176
|
/** The transaction MUST be included in an anchored block. */
|
|
@@ -156,7 +179,7 @@ var AnchorModeID;
|
|
|
156
179
|
AnchorModeID[AnchorModeID["OffChainOnly"] = 2] = "OffChainOnly";
|
|
157
180
|
/** The leader can choose where to include the transaction. */
|
|
158
181
|
AnchorModeID[AnchorModeID["Any"] = 3] = "Any";
|
|
159
|
-
})(AnchorModeID
|
|
182
|
+
})(AnchorModeID || (exports.AnchorModeID = AnchorModeID = {}));
|
|
160
183
|
var PostConditionModeID;
|
|
161
184
|
(function (PostConditionModeID) {
|
|
162
185
|
/** This transaction may affect other assets not listed in the post-conditions. */
|
|
@@ -165,7 +188,7 @@ var PostConditionModeID;
|
|
|
165
188
|
PostConditionModeID[PostConditionModeID["Deny"] = 2] = "Deny";
|
|
166
189
|
/** Deny for the transaction origin; allow for everyone else (SIP-040). */
|
|
167
190
|
PostConditionModeID[PostConditionModeID["Originator"] = 3] = "Originator";
|
|
168
|
-
})(PostConditionModeID
|
|
191
|
+
})(PostConditionModeID || (exports.PostConditionModeID = PostConditionModeID = {}));
|
|
169
192
|
var ClarityTypeID;
|
|
170
193
|
(function (ClarityTypeID) {
|
|
171
194
|
ClarityTypeID[ClarityTypeID["Int"] = 0] = "Int";
|
|
@@ -183,7 +206,7 @@ var ClarityTypeID;
|
|
|
183
206
|
ClarityTypeID[ClarityTypeID["Tuple"] = 12] = "Tuple";
|
|
184
207
|
ClarityTypeID[ClarityTypeID["StringAscii"] = 13] = "StringAscii";
|
|
185
208
|
ClarityTypeID[ClarityTypeID["StringUtf8"] = 14] = "StringUtf8";
|
|
186
|
-
})(ClarityTypeID
|
|
209
|
+
})(ClarityTypeID || (exports.ClarityTypeID = ClarityTypeID = {}));
|
|
187
210
|
// ============================================================================
|
|
188
211
|
// PoX Synthetic Event Types
|
|
189
212
|
// ============================================================================
|
|
@@ -201,4 +224,4 @@ var PoxEventName;
|
|
|
201
224
|
PoxEventName["StackAggregationCommitIndexed"] = "stack-aggregation-commit-indexed";
|
|
202
225
|
PoxEventName["StackAggregationIncrease"] = "stack-aggregation-increase";
|
|
203
226
|
PoxEventName["RevokeDelegateStx"] = "revoke-delegate-stx";
|
|
204
|
-
})(PoxEventName
|
|
227
|
+
})(PoxEventName || (exports.PoxEventName = PoxEventName = {}));
|
package/index.mjs
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import * as bindings from "./loader.js";
|
|
2
|
+
export * from "./loader.js";
|
|
3
|
+
const StacksNativeEncodingBindings = bindings;
|
|
4
|
+
var index_default = StacksNativeEncodingBindings;
|
|
5
|
+
var PostConditionAssetInfoID = /* @__PURE__ */ ((PostConditionAssetInfoID2) => {
|
|
6
|
+
PostConditionAssetInfoID2[PostConditionAssetInfoID2["STX"] = 0] = "STX";
|
|
7
|
+
PostConditionAssetInfoID2[PostConditionAssetInfoID2["FungibleAsset"] = 1] = "FungibleAsset";
|
|
8
|
+
PostConditionAssetInfoID2[PostConditionAssetInfoID2["NonfungibleAsset"] = 2] = "NonfungibleAsset";
|
|
9
|
+
return PostConditionAssetInfoID2;
|
|
10
|
+
})(PostConditionAssetInfoID || {});
|
|
11
|
+
var PostConditionNonfungibleConditionCodeID = /* @__PURE__ */ ((PostConditionNonfungibleConditionCodeID2) => {
|
|
12
|
+
PostConditionNonfungibleConditionCodeID2[PostConditionNonfungibleConditionCodeID2["Sent"] = 16] = "Sent";
|
|
13
|
+
PostConditionNonfungibleConditionCodeID2[PostConditionNonfungibleConditionCodeID2["NotSent"] = 17] = "NotSent";
|
|
14
|
+
PostConditionNonfungibleConditionCodeID2[PostConditionNonfungibleConditionCodeID2["MaybeSent"] = 18] = "MaybeSent";
|
|
15
|
+
return PostConditionNonfungibleConditionCodeID2;
|
|
16
|
+
})(PostConditionNonfungibleConditionCodeID || {});
|
|
17
|
+
var PostConditionNonFungibleConditionName = /* @__PURE__ */ ((PostConditionNonFungibleConditionName2) => {
|
|
18
|
+
PostConditionNonFungibleConditionName2["Sent"] = "sent";
|
|
19
|
+
PostConditionNonFungibleConditionName2["NotSent"] = "not_sent";
|
|
20
|
+
PostConditionNonFungibleConditionName2["MaybeSent"] = "maybe_sent";
|
|
21
|
+
return PostConditionNonFungibleConditionName2;
|
|
22
|
+
})(PostConditionNonFungibleConditionName || {});
|
|
23
|
+
var PostConditionFungibleConditionCodeID = /* @__PURE__ */ ((PostConditionFungibleConditionCodeID2) => {
|
|
24
|
+
PostConditionFungibleConditionCodeID2[PostConditionFungibleConditionCodeID2["SentEq"] = 1] = "SentEq";
|
|
25
|
+
PostConditionFungibleConditionCodeID2[PostConditionFungibleConditionCodeID2["SentGt"] = 2] = "SentGt";
|
|
26
|
+
PostConditionFungibleConditionCodeID2[PostConditionFungibleConditionCodeID2["SentGe"] = 3] = "SentGe";
|
|
27
|
+
PostConditionFungibleConditionCodeID2[PostConditionFungibleConditionCodeID2["SentLt"] = 4] = "SentLt";
|
|
28
|
+
PostConditionFungibleConditionCodeID2[PostConditionFungibleConditionCodeID2["SentLe"] = 5] = "SentLe";
|
|
29
|
+
return PostConditionFungibleConditionCodeID2;
|
|
30
|
+
})(PostConditionFungibleConditionCodeID || {});
|
|
31
|
+
var PostConditionFungibleConditionCodeName = /* @__PURE__ */ ((PostConditionFungibleConditionCodeName2) => {
|
|
32
|
+
PostConditionFungibleConditionCodeName2["SentEq"] = "sent_equal_to";
|
|
33
|
+
PostConditionFungibleConditionCodeName2["SentGt"] = "sent_greater_than";
|
|
34
|
+
PostConditionFungibleConditionCodeName2["SentGe"] = "sent_greater_than_or_equal_to";
|
|
35
|
+
PostConditionFungibleConditionCodeName2["SentLt"] = "sent_less_than";
|
|
36
|
+
PostConditionFungibleConditionCodeName2["SentLe"] = "sent_less_than_or_equal_to";
|
|
37
|
+
return PostConditionFungibleConditionCodeName2;
|
|
38
|
+
})(PostConditionFungibleConditionCodeName || {});
|
|
39
|
+
var PostConditionPrincipalTypeID = /* @__PURE__ */ ((PostConditionPrincipalTypeID2) => {
|
|
40
|
+
PostConditionPrincipalTypeID2[PostConditionPrincipalTypeID2["Origin"] = 1] = "Origin";
|
|
41
|
+
PostConditionPrincipalTypeID2[PostConditionPrincipalTypeID2["Standard"] = 2] = "Standard";
|
|
42
|
+
PostConditionPrincipalTypeID2[PostConditionPrincipalTypeID2["Contract"] = 3] = "Contract";
|
|
43
|
+
return PostConditionPrincipalTypeID2;
|
|
44
|
+
})(PostConditionPrincipalTypeID || {});
|
|
45
|
+
var PrincipalTypeID = /* @__PURE__ */ ((PrincipalTypeID2) => {
|
|
46
|
+
PrincipalTypeID2[PrincipalTypeID2["Standard"] = 5] = "Standard";
|
|
47
|
+
PrincipalTypeID2[PrincipalTypeID2["Contract"] = 6] = "Contract";
|
|
48
|
+
return PrincipalTypeID2;
|
|
49
|
+
})(PrincipalTypeID || {});
|
|
50
|
+
var TenureChangeCause = /* @__PURE__ */ ((TenureChangeCause2) => {
|
|
51
|
+
TenureChangeCause2[TenureChangeCause2["BlockFound"] = 0] = "BlockFound";
|
|
52
|
+
TenureChangeCause2[TenureChangeCause2["Extended"] = 1] = "Extended";
|
|
53
|
+
TenureChangeCause2[TenureChangeCause2["ExtendedRuntime"] = 2] = "ExtendedRuntime";
|
|
54
|
+
TenureChangeCause2[TenureChangeCause2["ExtendedReadCount"] = 3] = "ExtendedReadCount";
|
|
55
|
+
TenureChangeCause2[TenureChangeCause2["ExtendedReadLength"] = 4] = "ExtendedReadLength";
|
|
56
|
+
TenureChangeCause2[TenureChangeCause2["ExtendedWriteCount"] = 5] = "ExtendedWriteCount";
|
|
57
|
+
TenureChangeCause2[TenureChangeCause2["ExtendedWriteLength"] = 6] = "ExtendedWriteLength";
|
|
58
|
+
return TenureChangeCause2;
|
|
59
|
+
})(TenureChangeCause || {});
|
|
60
|
+
var TxPayloadTypeID = /* @__PURE__ */ ((TxPayloadTypeID2) => {
|
|
61
|
+
TxPayloadTypeID2[TxPayloadTypeID2["TokenTransfer"] = 0] = "TokenTransfer";
|
|
62
|
+
TxPayloadTypeID2[TxPayloadTypeID2["SmartContract"] = 1] = "SmartContract";
|
|
63
|
+
TxPayloadTypeID2[TxPayloadTypeID2["ContractCall"] = 2] = "ContractCall";
|
|
64
|
+
TxPayloadTypeID2[TxPayloadTypeID2["PoisonMicroblock"] = 3] = "PoisonMicroblock";
|
|
65
|
+
TxPayloadTypeID2[TxPayloadTypeID2["Coinbase"] = 4] = "Coinbase";
|
|
66
|
+
TxPayloadTypeID2[TxPayloadTypeID2["CoinbaseToAltRecipient"] = 5] = "CoinbaseToAltRecipient";
|
|
67
|
+
TxPayloadTypeID2[TxPayloadTypeID2["VersionedSmartContract"] = 6] = "VersionedSmartContract";
|
|
68
|
+
TxPayloadTypeID2[TxPayloadTypeID2["TenureChange"] = 7] = "TenureChange";
|
|
69
|
+
TxPayloadTypeID2[TxPayloadTypeID2["NakamotoCoinbase"] = 8] = "NakamotoCoinbase";
|
|
70
|
+
return TxPayloadTypeID2;
|
|
71
|
+
})(TxPayloadTypeID || {});
|
|
72
|
+
var PostConditionAuthFlag = /* @__PURE__ */ ((PostConditionAuthFlag2) => {
|
|
73
|
+
PostConditionAuthFlag2[PostConditionAuthFlag2["Standard"] = 4] = "Standard";
|
|
74
|
+
PostConditionAuthFlag2[PostConditionAuthFlag2["Sponsored"] = 5] = "Sponsored";
|
|
75
|
+
return PostConditionAuthFlag2;
|
|
76
|
+
})(PostConditionAuthFlag || {});
|
|
77
|
+
var TxSpendingConditionSingleSigHashMode = /* @__PURE__ */ ((TxSpendingConditionSingleSigHashMode2) => {
|
|
78
|
+
TxSpendingConditionSingleSigHashMode2[TxSpendingConditionSingleSigHashMode2["P2PKH"] = 0] = "P2PKH";
|
|
79
|
+
TxSpendingConditionSingleSigHashMode2[TxSpendingConditionSingleSigHashMode2["P2WPKH"] = 2] = "P2WPKH";
|
|
80
|
+
return TxSpendingConditionSingleSigHashMode2;
|
|
81
|
+
})(TxSpendingConditionSingleSigHashMode || {});
|
|
82
|
+
var TxSpendingConditionMultiSigHashMode = /* @__PURE__ */ ((TxSpendingConditionMultiSigHashMode2) => {
|
|
83
|
+
TxSpendingConditionMultiSigHashMode2[TxSpendingConditionMultiSigHashMode2["P2SH"] = 1] = "P2SH";
|
|
84
|
+
TxSpendingConditionMultiSigHashMode2[TxSpendingConditionMultiSigHashMode2["P2SHNonSequential"] = 5] = "P2SHNonSequential";
|
|
85
|
+
TxSpendingConditionMultiSigHashMode2[TxSpendingConditionMultiSigHashMode2["P2WSH"] = 3] = "P2WSH";
|
|
86
|
+
TxSpendingConditionMultiSigHashMode2[TxSpendingConditionMultiSigHashMode2["P2WSHNonSequential"] = 7] = "P2WSHNonSequential";
|
|
87
|
+
return TxSpendingConditionMultiSigHashMode2;
|
|
88
|
+
})(TxSpendingConditionMultiSigHashMode || {});
|
|
89
|
+
var ClarityVersion = /* @__PURE__ */ ((ClarityVersion2) => {
|
|
90
|
+
ClarityVersion2[ClarityVersion2["Clarity1"] = 1] = "Clarity1";
|
|
91
|
+
ClarityVersion2[ClarityVersion2["Clarity2"] = 2] = "Clarity2";
|
|
92
|
+
ClarityVersion2[ClarityVersion2["Clarity3"] = 3] = "Clarity3";
|
|
93
|
+
ClarityVersion2[ClarityVersion2["Clarity4"] = 4] = "Clarity4";
|
|
94
|
+
ClarityVersion2[ClarityVersion2["Clarity5"] = 5] = "Clarity5";
|
|
95
|
+
ClarityVersion2[ClarityVersion2["Clarity6"] = 6] = "Clarity6";
|
|
96
|
+
return ClarityVersion2;
|
|
97
|
+
})(ClarityVersion || {});
|
|
98
|
+
var TxAuthFieldTypeID = /* @__PURE__ */ ((TxAuthFieldTypeID2) => {
|
|
99
|
+
TxAuthFieldTypeID2[TxAuthFieldTypeID2["PublicKeyCompressed"] = 0] = "PublicKeyCompressed";
|
|
100
|
+
TxAuthFieldTypeID2[TxAuthFieldTypeID2["PublicKeyUncompressed"] = 1] = "PublicKeyUncompressed";
|
|
101
|
+
TxAuthFieldTypeID2[TxAuthFieldTypeID2["SignatureCompressed"] = 2] = "SignatureCompressed";
|
|
102
|
+
TxAuthFieldTypeID2[TxAuthFieldTypeID2["SignatureUncompressed"] = 3] = "SignatureUncompressed";
|
|
103
|
+
return TxAuthFieldTypeID2;
|
|
104
|
+
})(TxAuthFieldTypeID || {});
|
|
105
|
+
var TxPublicKeyEncoding = /* @__PURE__ */ ((TxPublicKeyEncoding2) => {
|
|
106
|
+
TxPublicKeyEncoding2[TxPublicKeyEncoding2["Compressed"] = 0] = "Compressed";
|
|
107
|
+
TxPublicKeyEncoding2[TxPublicKeyEncoding2["Uncompressed"] = 1] = "Uncompressed";
|
|
108
|
+
return TxPublicKeyEncoding2;
|
|
109
|
+
})(TxPublicKeyEncoding || {});
|
|
110
|
+
var TransactionVersion = /* @__PURE__ */ ((TransactionVersion2) => {
|
|
111
|
+
TransactionVersion2[TransactionVersion2["Mainnet"] = 0] = "Mainnet";
|
|
112
|
+
TransactionVersion2[TransactionVersion2["Testnet"] = 128] = "Testnet";
|
|
113
|
+
return TransactionVersion2;
|
|
114
|
+
})(TransactionVersion || {});
|
|
115
|
+
var AnchorModeID = /* @__PURE__ */ ((AnchorModeID2) => {
|
|
116
|
+
AnchorModeID2[AnchorModeID2["OnChainOnly"] = 1] = "OnChainOnly";
|
|
117
|
+
AnchorModeID2[AnchorModeID2["OffChainOnly"] = 2] = "OffChainOnly";
|
|
118
|
+
AnchorModeID2[AnchorModeID2["Any"] = 3] = "Any";
|
|
119
|
+
return AnchorModeID2;
|
|
120
|
+
})(AnchorModeID || {});
|
|
121
|
+
var PostConditionModeID = /* @__PURE__ */ ((PostConditionModeID2) => {
|
|
122
|
+
PostConditionModeID2[PostConditionModeID2["Allow"] = 1] = "Allow";
|
|
123
|
+
PostConditionModeID2[PostConditionModeID2["Deny"] = 2] = "Deny";
|
|
124
|
+
PostConditionModeID2[PostConditionModeID2["Originator"] = 3] = "Originator";
|
|
125
|
+
return PostConditionModeID2;
|
|
126
|
+
})(PostConditionModeID || {});
|
|
127
|
+
var ClarityTypeID = /* @__PURE__ */ ((ClarityTypeID2) => {
|
|
128
|
+
ClarityTypeID2[ClarityTypeID2["Int"] = 0] = "Int";
|
|
129
|
+
ClarityTypeID2[ClarityTypeID2["UInt"] = 1] = "UInt";
|
|
130
|
+
ClarityTypeID2[ClarityTypeID2["Buffer"] = 2] = "Buffer";
|
|
131
|
+
ClarityTypeID2[ClarityTypeID2["BoolTrue"] = 3] = "BoolTrue";
|
|
132
|
+
ClarityTypeID2[ClarityTypeID2["BoolFalse"] = 4] = "BoolFalse";
|
|
133
|
+
ClarityTypeID2[ClarityTypeID2["PrincipalStandard"] = 5] = "PrincipalStandard";
|
|
134
|
+
ClarityTypeID2[ClarityTypeID2["PrincipalContract"] = 6] = "PrincipalContract";
|
|
135
|
+
ClarityTypeID2[ClarityTypeID2["ResponseOk"] = 7] = "ResponseOk";
|
|
136
|
+
ClarityTypeID2[ClarityTypeID2["ResponseError"] = 8] = "ResponseError";
|
|
137
|
+
ClarityTypeID2[ClarityTypeID2["OptionalNone"] = 9] = "OptionalNone";
|
|
138
|
+
ClarityTypeID2[ClarityTypeID2["OptionalSome"] = 10] = "OptionalSome";
|
|
139
|
+
ClarityTypeID2[ClarityTypeID2["List"] = 11] = "List";
|
|
140
|
+
ClarityTypeID2[ClarityTypeID2["Tuple"] = 12] = "Tuple";
|
|
141
|
+
ClarityTypeID2[ClarityTypeID2["StringAscii"] = 13] = "StringAscii";
|
|
142
|
+
ClarityTypeID2[ClarityTypeID2["StringUtf8"] = 14] = "StringUtf8";
|
|
143
|
+
return ClarityTypeID2;
|
|
144
|
+
})(ClarityTypeID || {});
|
|
145
|
+
var PoxEventName = /* @__PURE__ */ ((PoxEventName2) => {
|
|
146
|
+
PoxEventName2["HandleUnlock"] = "handle-unlock";
|
|
147
|
+
PoxEventName2["StackStx"] = "stack-stx";
|
|
148
|
+
PoxEventName2["StackIncrease"] = "stack-increase";
|
|
149
|
+
PoxEventName2["StackExtend"] = "stack-extend";
|
|
150
|
+
PoxEventName2["DelegateStx"] = "delegate-stx";
|
|
151
|
+
PoxEventName2["DelegateStackStx"] = "delegate-stack-stx";
|
|
152
|
+
PoxEventName2["DelegateStackIncrease"] = "delegate-stack-increase";
|
|
153
|
+
PoxEventName2["DelegateStackExtend"] = "delegate-stack-extend";
|
|
154
|
+
PoxEventName2["StackAggregationCommit"] = "stack-aggregation-commit";
|
|
155
|
+
PoxEventName2["StackAggregationCommitIndexed"] = "stack-aggregation-commit-indexed";
|
|
156
|
+
PoxEventName2["StackAggregationIncrease"] = "stack-aggregation-increase";
|
|
157
|
+
PoxEventName2["RevokeDelegateStx"] = "revoke-delegate-stx";
|
|
158
|
+
return PoxEventName2;
|
|
159
|
+
})(PoxEventName || {});
|
|
160
|
+
export {
|
|
161
|
+
AnchorModeID,
|
|
162
|
+
ClarityTypeID,
|
|
163
|
+
ClarityVersion,
|
|
164
|
+
PostConditionAssetInfoID,
|
|
165
|
+
PostConditionAuthFlag,
|
|
166
|
+
PostConditionFungibleConditionCodeID,
|
|
167
|
+
PostConditionFungibleConditionCodeName,
|
|
168
|
+
PostConditionModeID,
|
|
169
|
+
PostConditionNonFungibleConditionName,
|
|
170
|
+
PostConditionNonfungibleConditionCodeID,
|
|
171
|
+
PostConditionPrincipalTypeID,
|
|
172
|
+
PoxEventName,
|
|
173
|
+
PrincipalTypeID,
|
|
174
|
+
StacksNativeEncodingBindings,
|
|
175
|
+
TenureChangeCause,
|
|
176
|
+
TransactionVersion,
|
|
177
|
+
TxAuthFieldTypeID,
|
|
178
|
+
TxPayloadTypeID,
|
|
179
|
+
TxPublicKeyEncoding,
|
|
180
|
+
TxSpendingConditionMultiSigHashMode,
|
|
181
|
+
TxSpendingConditionSingleSigHashMode,
|
|
182
|
+
index_default as default
|
|
183
|
+
};
|
package/loader.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
DecodedPostConditionsResult,
|
|
3
|
+
DecodedTxResult,
|
|
4
|
+
DecodedNakamotoBlockResult,
|
|
5
|
+
DecodedStacksBlockResult,
|
|
6
|
+
ClarityValue,
|
|
7
|
+
ClarityValueAbstract,
|
|
8
|
+
DecodedPoxSyntheticEvent,
|
|
9
|
+
} from './index.js';
|
|
2
10
|
|
|
3
11
|
export function getVersion(): string;
|
|
4
12
|
|
|
@@ -25,19 +33,22 @@ export function decodeClarityValueToTypeName(arg: string | Buffer): string;
|
|
|
25
33
|
export function decodeClarityValue<T extends ClarityValue = ClarityValue>(arg: string | Buffer): T;
|
|
26
34
|
|
|
27
35
|
/**
|
|
28
|
-
*
|
|
29
|
-
* @param arg
|
|
30
|
-
* @param deep - If not true, then the deserialized objects will only contain the
|
|
36
|
+
*
|
|
37
|
+
* @param arg
|
|
38
|
+
* @param deep - If not true, then the deserialized objects will only contain the
|
|
31
39
|
* properties `hex, repr, type, type_id`. And nested types like Tuple, List, Response, etc will
|
|
32
40
|
* not contain decoded children.
|
|
33
41
|
* TODO: fix the clarity result type definition to be more accurate.
|
|
34
42
|
*/
|
|
35
|
-
export function decodeClarityValueList(
|
|
43
|
+
export function decodeClarityValueList(
|
|
44
|
+
arg: string | Buffer,
|
|
45
|
+
deep?: false | undefined
|
|
46
|
+
): ClarityValueAbstract[];
|
|
36
47
|
|
|
37
48
|
/**
|
|
38
|
-
*
|
|
39
|
-
* @param arg
|
|
40
|
-
* @param deep - If not true, then the deserialized objects will only contain the
|
|
49
|
+
*
|
|
50
|
+
* @param arg
|
|
51
|
+
* @param deep - If not true, then the deserialized objects will only contain the
|
|
41
52
|
* properties `hex, repr, type, type_id`. And nested types like Tuple, List, Response, etc will
|
|
42
53
|
* not contain decoded children.
|
|
43
54
|
* TODO: fix the clarity result type definition to be more accurate.
|
|
@@ -54,7 +65,7 @@ export function isValidStacksAddress(address: string): boolean;
|
|
|
54
65
|
|
|
55
66
|
export function decodeStacksAddress(address: string): [version: number, hash160: string];
|
|
56
67
|
|
|
57
|
-
export function decodeClarityValueToPrincipal(clarityValue: string | Buffer)
|
|
68
|
+
export function decodeClarityValueToPrincipal(clarityValue: string | Buffer): string;
|
|
58
69
|
|
|
59
70
|
export function stacksAddressFromParts(version: number, hash160: string | Buffer): string;
|
|
60
71
|
|
package/loader.js
CHANGED
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
let targetName = `${process.platform}-${process.arch}`;
|
|
2
2
|
if (process.platform === 'linux') {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const libc = require('detect-libc').familySync() || 'glibc';
|
|
4
|
+
targetName += `-${libc}`;
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const addon = require(`./native/${targetName}.node`);
|
|
7
|
+
module.exports = addon;
|
|
8
|
+
// Explicit named exports so Node's CJS static analysis (and `export * from` in ESM) can see them.
|
|
9
|
+
module.exports.getVersion = addon.getVersion;
|
|
10
|
+
module.exports.decodeTransaction = addon.decodeTransaction;
|
|
11
|
+
module.exports.decodeNakamotoBlock = addon.decodeNakamotoBlock;
|
|
12
|
+
module.exports.decodeStacksBlock = addon.decodeStacksBlock;
|
|
13
|
+
module.exports.decodeClarityValueToRepr = addon.decodeClarityValueToRepr;
|
|
14
|
+
module.exports.decodeClarityValueToTypeName = addon.decodeClarityValueToTypeName;
|
|
15
|
+
module.exports.decodeClarityValue = addon.decodeClarityValue;
|
|
16
|
+
module.exports.decodeClarityValueList = addon.decodeClarityValueList;
|
|
17
|
+
module.exports.decodePostConditions = addon.decodePostConditions;
|
|
18
|
+
module.exports.stacksToBitcoinAddress = addon.stacksToBitcoinAddress;
|
|
19
|
+
module.exports.bitcoinToStacksAddress = addon.bitcoinToStacksAddress;
|
|
20
|
+
module.exports.isValidStacksAddress = addon.isValidStacksAddress;
|
|
21
|
+
module.exports.decodeStacksAddress = addon.decodeStacksAddress;
|
|
22
|
+
module.exports.decodeClarityValueToPrincipal = addon.decodeClarityValueToPrincipal;
|
|
23
|
+
module.exports.stacksAddressFromParts = addon.stacksAddressFromParts;
|
|
24
|
+
module.exports.memoToString = addon.memoToString;
|
|
25
|
+
module.exports.decodePoxSyntheticEvent = addon.decodePoxSyntheticEvent;
|
|
26
|
+
module.exports.startProfiler = addon.startProfiler;
|
|
27
|
+
module.exports.stopProfiler = addon.stopProfiler;
|
|
28
|
+
module.exports.createProfiler = addon.createProfiler;
|
|
29
|
+
module.exports.perfTestC32Encode = addon.perfTestC32Encode;
|
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
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacks/codec",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0-pox5.1",
|
|
4
4
|
"description": "Encoding & decoding functions for the Stacks blockchain exposed as a fast native Node.js addon",
|
|
5
|
-
"main": "index.js",
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"module": "./index.mjs",
|
|
7
|
+
"types": "./index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./index.d.ts",
|
|
11
|
+
"import": "./index.mjs",
|
|
12
|
+
"require": "./index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
6
15
|
"scripts": {
|
|
7
16
|
"build:cargo": "node build.js",
|
|
8
|
-
"build:ts": "tsc",
|
|
17
|
+
"build:ts": "tsc && esbuild index.ts --format=esm --platform=node --target=es2021 --outfile=index.mjs",
|
|
9
18
|
"build": "npm run build:ts",
|
|
10
19
|
"build:dev": "npm run build:ts && npm run build:cargo -- dev",
|
|
11
20
|
"test:cargo": "cargo test",
|
|
@@ -26,23 +35,28 @@
|
|
|
26
35
|
"type": "git",
|
|
27
36
|
"url": "git+https://github.com/stx-labs/stacks-codec-js.git"
|
|
28
37
|
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=20"
|
|
40
|
+
},
|
|
29
41
|
"prettier": "@stacks/prettier-config",
|
|
30
42
|
"devDependencies": {
|
|
31
43
|
"@stacks/prettier-config": "^0.0.10",
|
|
32
|
-
"@types/jest": "^
|
|
44
|
+
"@types/jest": "^29.5.14",
|
|
33
45
|
"cargo-cp-artifact": "^0.1.9",
|
|
34
|
-
"jest": "^
|
|
35
|
-
"ts-jest": "^
|
|
36
|
-
"
|
|
46
|
+
"jest": "^29.7.0",
|
|
47
|
+
"ts-jest": "^29.3.0",
|
|
48
|
+
"esbuild": "^0.25.0",
|
|
49
|
+
"typescript": "^5.7.0"
|
|
37
50
|
},
|
|
38
51
|
"dependencies": {
|
|
39
|
-
"@types/node": "^
|
|
52
|
+
"@types/node": "^20.14.0",
|
|
40
53
|
"detect-libc": "^2.0.1"
|
|
41
54
|
},
|
|
42
55
|
"files": [
|
|
43
56
|
"README.md",
|
|
44
57
|
"native/**/*",
|
|
45
58
|
"index.js",
|
|
59
|
+
"index.mjs",
|
|
46
60
|
"index.d.ts",
|
|
47
61
|
"loader.js",
|
|
48
62
|
"loader.d.ts"
|