@stacks/codec 1.5.0 → 1.7.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/README.md +1 -1
- package/index.d.ts +19 -15
- package/index.js +48 -22
- package/index.mjs +182 -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[];
|
|
@@ -55,11 +55,13 @@ export interface PostConditionAssetInfo {
|
|
|
55
55
|
}
|
|
56
56
|
export declare enum PostConditionNonfungibleConditionCodeID {
|
|
57
57
|
Sent = 16,
|
|
58
|
-
NotSent = 17
|
|
58
|
+
NotSent = 17,
|
|
59
|
+
MaybeSent = 18
|
|
59
60
|
}
|
|
60
61
|
export declare enum PostConditionNonFungibleConditionName {
|
|
61
62
|
Sent = "sent",
|
|
62
|
-
NotSent = "not_sent"
|
|
63
|
+
NotSent = "not_sent",
|
|
64
|
+
MaybeSent = "maybe_sent"
|
|
63
65
|
}
|
|
64
66
|
export declare enum PostConditionFungibleConditionCodeID {
|
|
65
67
|
SentEq = 1,
|
|
@@ -83,7 +85,7 @@ export declare enum PostConditionPrincipalTypeID {
|
|
|
83
85
|
/** A Non-fungible token post-condition, which pertains to one of the origin account's non-fungible tokens. */
|
|
84
86
|
Contract = 3
|
|
85
87
|
}
|
|
86
|
-
export
|
|
88
|
+
export type PostConditionPrincipal = PostConditionPrincipalOrigin | PostConditionPrincipalStandard | PostConditionPrincipalContract;
|
|
87
89
|
export interface PostConditionPrincipalOrigin {
|
|
88
90
|
type_id: PostConditionPrincipalTypeID.Origin;
|
|
89
91
|
}
|
|
@@ -334,7 +336,9 @@ export declare enum PostConditionModeID {
|
|
|
334
336
|
/** This transaction may affect other assets not listed in the post-conditions. */
|
|
335
337
|
Allow = 1,
|
|
336
338
|
/** This transaction may NOT affect other assets besides those listed in the post-conditions. */
|
|
337
|
-
Deny = 2
|
|
339
|
+
Deny = 2,
|
|
340
|
+
/** Deny for the transaction origin; allow for everyone else (SIP-040). */
|
|
341
|
+
Originator = 3
|
|
338
342
|
}
|
|
339
343
|
export interface ClarityValueCommon {
|
|
340
344
|
/** Clarity repr value */
|
|
@@ -412,7 +416,7 @@ export interface ClarityValuePrincipalContract extends ClarityValueCommon {
|
|
|
412
416
|
address_hash_bytes: string;
|
|
413
417
|
contract_name: string;
|
|
414
418
|
}
|
|
415
|
-
export
|
|
419
|
+
export type ClarityTupleData<T extends ClarityValue = ClarityValue> = {
|
|
416
420
|
[key: string]: T;
|
|
417
421
|
};
|
|
418
422
|
export interface ClarityValueTuple<T extends ClarityTupleData = ClarityTupleData> extends ClarityValueCommon {
|
|
@@ -434,18 +438,18 @@ export interface ClarityValueResponseError<T extends ClarityValue = ClarityValue
|
|
|
434
438
|
type_id: ClarityTypeID.ResponseError;
|
|
435
439
|
value: T;
|
|
436
440
|
}
|
|
437
|
-
export
|
|
438
|
-
export
|
|
439
|
-
export
|
|
440
|
-
export
|
|
441
|
+
export type ClarityValue = ClarityValueInt | ClarityValueUInt | ClarityValueBoolTrue | ClarityValueBoolFalse | ClarityValueBuffer | ClarityValueList | ClarityValueStringAscii | ClarityValueStringUtf8 | ClarityValuePrincipalStandard | ClarityValuePrincipalContract | ClarityValueTuple | ClarityValueOptionalSome | ClarityValueOptionalNone | ClarityValueResponseOk | ClarityValueResponseError;
|
|
442
|
+
export type ClarityValueOptional<T extends ClarityValue = ClarityValue> = ClarityValueOptionalSome<T> | ClarityValueOptionalNone;
|
|
443
|
+
export type ClarityValueBool = ClarityValueBoolTrue | ClarityValueBoolFalse;
|
|
444
|
+
export type ClarityValueResponse<TOk extends ClarityValue = ClarityValue, TError extends ClarityValue = ClarityValue> = ClarityValueResponseOk<TOk> | ClarityValueResponseError<TError>;
|
|
441
445
|
/**
|
|
442
446
|
* Type for commonly used `(optional bool)`
|
|
443
447
|
*/
|
|
444
|
-
export
|
|
448
|
+
export type ClarityValueOptionalBool = ClarityValueOptional<ClarityValueBool>;
|
|
445
449
|
/**
|
|
446
450
|
* Type for commonly used `(optional uint)`
|
|
447
451
|
*/
|
|
448
|
-
export
|
|
452
|
+
export type ClarityValueOptionalUInt = ClarityValueOptional<ClarityValueUInt>;
|
|
449
453
|
export interface DecodedNakamotoBlockResult {
|
|
450
454
|
/** Hex encoded string of the block ID (index block hash) */
|
|
451
455
|
block_id: string;
|
|
@@ -715,4 +719,4 @@ export interface PoxEventRevokeDelegateStx extends PoxEventBase {
|
|
|
715
719
|
start_cycle_id: string | null;
|
|
716
720
|
};
|
|
717
721
|
}
|
|
718
|
-
export
|
|
722
|
+
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,17 +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";
|
|
55
|
+
})(PostConditionNonfungibleConditionCodeID || (exports.PostConditionNonfungibleConditionCodeID = PostConditionNonfungibleConditionCodeID = {}));
|
|
33
56
|
var PostConditionNonFungibleConditionName;
|
|
34
57
|
(function (PostConditionNonFungibleConditionName) {
|
|
35
58
|
PostConditionNonFungibleConditionName["Sent"] = "sent";
|
|
36
59
|
PostConditionNonFungibleConditionName["NotSent"] = "not_sent";
|
|
37
|
-
|
|
60
|
+
PostConditionNonFungibleConditionName["MaybeSent"] = "maybe_sent";
|
|
61
|
+
})(PostConditionNonFungibleConditionName || (exports.PostConditionNonFungibleConditionName = PostConditionNonFungibleConditionName = {}));
|
|
38
62
|
var PostConditionFungibleConditionCodeID;
|
|
39
63
|
(function (PostConditionFungibleConditionCodeID) {
|
|
40
64
|
PostConditionFungibleConditionCodeID[PostConditionFungibleConditionCodeID["SentEq"] = 1] = "SentEq";
|
|
@@ -42,7 +66,7 @@ var PostConditionFungibleConditionCodeID;
|
|
|
42
66
|
PostConditionFungibleConditionCodeID[PostConditionFungibleConditionCodeID["SentGe"] = 3] = "SentGe";
|
|
43
67
|
PostConditionFungibleConditionCodeID[PostConditionFungibleConditionCodeID["SentLt"] = 4] = "SentLt";
|
|
44
68
|
PostConditionFungibleConditionCodeID[PostConditionFungibleConditionCodeID["SentLe"] = 5] = "SentLe";
|
|
45
|
-
})(PostConditionFungibleConditionCodeID
|
|
69
|
+
})(PostConditionFungibleConditionCodeID || (exports.PostConditionFungibleConditionCodeID = PostConditionFungibleConditionCodeID = {}));
|
|
46
70
|
var PostConditionFungibleConditionCodeName;
|
|
47
71
|
(function (PostConditionFungibleConditionCodeName) {
|
|
48
72
|
PostConditionFungibleConditionCodeName["SentEq"] = "sent_equal_to";
|
|
@@ -50,7 +74,7 @@ var PostConditionFungibleConditionCodeName;
|
|
|
50
74
|
PostConditionFungibleConditionCodeName["SentGe"] = "sent_greater_than_or_equal_to";
|
|
51
75
|
PostConditionFungibleConditionCodeName["SentLt"] = "sent_less_than";
|
|
52
76
|
PostConditionFungibleConditionCodeName["SentLe"] = "sent_less_than_or_equal_to";
|
|
53
|
-
})(PostConditionFungibleConditionCodeName
|
|
77
|
+
})(PostConditionFungibleConditionCodeName || (exports.PostConditionFungibleConditionCodeName = PostConditionFungibleConditionCodeName = {}));
|
|
54
78
|
var PostConditionPrincipalTypeID;
|
|
55
79
|
(function (PostConditionPrincipalTypeID) {
|
|
56
80
|
/** A STX post-condition, which pertains to the origin account's STX. */
|
|
@@ -59,12 +83,12 @@ var PostConditionPrincipalTypeID;
|
|
|
59
83
|
PostConditionPrincipalTypeID[PostConditionPrincipalTypeID["Standard"] = 2] = "Standard";
|
|
60
84
|
/** A Non-fungible token post-condition, which pertains to one of the origin account's non-fungible tokens. */
|
|
61
85
|
PostConditionPrincipalTypeID[PostConditionPrincipalTypeID["Contract"] = 3] = "Contract";
|
|
62
|
-
})(PostConditionPrincipalTypeID
|
|
86
|
+
})(PostConditionPrincipalTypeID || (exports.PostConditionPrincipalTypeID = PostConditionPrincipalTypeID = {}));
|
|
63
87
|
var PrincipalTypeID;
|
|
64
88
|
(function (PrincipalTypeID) {
|
|
65
89
|
PrincipalTypeID[PrincipalTypeID["Standard"] = 5] = "Standard";
|
|
66
90
|
PrincipalTypeID[PrincipalTypeID["Contract"] = 6] = "Contract";
|
|
67
|
-
})(PrincipalTypeID
|
|
91
|
+
})(PrincipalTypeID || (exports.PrincipalTypeID = PrincipalTypeID = {}));
|
|
68
92
|
var TenureChangeCause;
|
|
69
93
|
(function (TenureChangeCause) {
|
|
70
94
|
/** A valid winning block-commit */
|
|
@@ -81,7 +105,7 @@ var TenureChangeCause;
|
|
|
81
105
|
TenureChangeCause[TenureChangeCause["ExtendedWriteCount"] = 5] = "ExtendedWriteCount";
|
|
82
106
|
/** SIP-034: extend specific dimensions - write length */
|
|
83
107
|
TenureChangeCause[TenureChangeCause["ExtendedWriteLength"] = 6] = "ExtendedWriteLength";
|
|
84
|
-
})(TenureChangeCause
|
|
108
|
+
})(TenureChangeCause || (exports.TenureChangeCause = TenureChangeCause = {}));
|
|
85
109
|
var TxPayloadTypeID;
|
|
86
110
|
(function (TxPayloadTypeID) {
|
|
87
111
|
TxPayloadTypeID[TxPayloadTypeID["TokenTransfer"] = 0] = "TokenTransfer";
|
|
@@ -93,19 +117,19 @@ var TxPayloadTypeID;
|
|
|
93
117
|
TxPayloadTypeID[TxPayloadTypeID["VersionedSmartContract"] = 6] = "VersionedSmartContract";
|
|
94
118
|
TxPayloadTypeID[TxPayloadTypeID["TenureChange"] = 7] = "TenureChange";
|
|
95
119
|
TxPayloadTypeID[TxPayloadTypeID["NakamotoCoinbase"] = 8] = "NakamotoCoinbase";
|
|
96
|
-
})(TxPayloadTypeID
|
|
120
|
+
})(TxPayloadTypeID || (exports.TxPayloadTypeID = TxPayloadTypeID = {}));
|
|
97
121
|
var PostConditionAuthFlag;
|
|
98
122
|
(function (PostConditionAuthFlag) {
|
|
99
123
|
PostConditionAuthFlag[PostConditionAuthFlag["Standard"] = 4] = "Standard";
|
|
100
124
|
PostConditionAuthFlag[PostConditionAuthFlag["Sponsored"] = 5] = "Sponsored";
|
|
101
|
-
})(PostConditionAuthFlag
|
|
125
|
+
})(PostConditionAuthFlag || (exports.PostConditionAuthFlag = PostConditionAuthFlag = {}));
|
|
102
126
|
var TxSpendingConditionSingleSigHashMode;
|
|
103
127
|
(function (TxSpendingConditionSingleSigHashMode) {
|
|
104
128
|
/** hash160(public-key), same as bitcoin's p2pkh */
|
|
105
129
|
TxSpendingConditionSingleSigHashMode[TxSpendingConditionSingleSigHashMode["P2PKH"] = 0] = "P2PKH";
|
|
106
130
|
/** hash160(segwit-program-00(p2pkh)), same as bitcoin's p2sh-p2wpkh */
|
|
107
131
|
TxSpendingConditionSingleSigHashMode[TxSpendingConditionSingleSigHashMode["P2WPKH"] = 2] = "P2WPKH";
|
|
108
|
-
})(TxSpendingConditionSingleSigHashMode
|
|
132
|
+
})(TxSpendingConditionSingleSigHashMode || (exports.TxSpendingConditionSingleSigHashMode = TxSpendingConditionSingleSigHashMode = {}));
|
|
109
133
|
var TxSpendingConditionMultiSigHashMode;
|
|
110
134
|
(function (TxSpendingConditionMultiSigHashMode) {
|
|
111
135
|
/** hash160(multisig-redeem-script), same as bitcoin's multisig p2sh */
|
|
@@ -116,7 +140,7 @@ var TxSpendingConditionMultiSigHashMode;
|
|
|
116
140
|
TxSpendingConditionMultiSigHashMode[TxSpendingConditionMultiSigHashMode["P2WSH"] = 3] = "P2WSH";
|
|
117
141
|
/** hash160(segwit-program-00(public-keys)), same as bitcoin's p2sh-p2wsh (non-sequential signing) */
|
|
118
142
|
TxSpendingConditionMultiSigHashMode[TxSpendingConditionMultiSigHashMode["P2WSHNonSequential"] = 7] = "P2WSHNonSequential";
|
|
119
|
-
})(TxSpendingConditionMultiSigHashMode
|
|
143
|
+
})(TxSpendingConditionMultiSigHashMode || (exports.TxSpendingConditionMultiSigHashMode = TxSpendingConditionMultiSigHashMode = {}));
|
|
120
144
|
var ClarityVersion;
|
|
121
145
|
(function (ClarityVersion) {
|
|
122
146
|
ClarityVersion[ClarityVersion["Clarity1"] = 1] = "Clarity1";
|
|
@@ -124,7 +148,7 @@ var ClarityVersion;
|
|
|
124
148
|
ClarityVersion[ClarityVersion["Clarity3"] = 3] = "Clarity3";
|
|
125
149
|
ClarityVersion[ClarityVersion["Clarity4"] = 4] = "Clarity4";
|
|
126
150
|
ClarityVersion[ClarityVersion["Clarity5"] = 5] = "Clarity5";
|
|
127
|
-
})(ClarityVersion
|
|
151
|
+
})(ClarityVersion || (exports.ClarityVersion = ClarityVersion = {}));
|
|
128
152
|
var TxAuthFieldTypeID;
|
|
129
153
|
(function (TxAuthFieldTypeID) {
|
|
130
154
|
/** 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. */
|
|
@@ -135,17 +159,17 @@ var TxAuthFieldTypeID;
|
|
|
135
159
|
TxAuthFieldTypeID[TxAuthFieldTypeID["SignatureCompressed"] = 2] = "SignatureCompressed";
|
|
136
160
|
/** 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. */
|
|
137
161
|
TxAuthFieldTypeID[TxAuthFieldTypeID["SignatureUncompressed"] = 3] = "SignatureUncompressed";
|
|
138
|
-
})(TxAuthFieldTypeID
|
|
162
|
+
})(TxAuthFieldTypeID || (exports.TxAuthFieldTypeID = TxAuthFieldTypeID = {}));
|
|
139
163
|
var TxPublicKeyEncoding;
|
|
140
164
|
(function (TxPublicKeyEncoding) {
|
|
141
165
|
TxPublicKeyEncoding[TxPublicKeyEncoding["Compressed"] = 0] = "Compressed";
|
|
142
166
|
TxPublicKeyEncoding[TxPublicKeyEncoding["Uncompressed"] = 1] = "Uncompressed";
|
|
143
|
-
})(TxPublicKeyEncoding
|
|
167
|
+
})(TxPublicKeyEncoding || (exports.TxPublicKeyEncoding = TxPublicKeyEncoding = {}));
|
|
144
168
|
var TransactionVersion;
|
|
145
169
|
(function (TransactionVersion) {
|
|
146
170
|
TransactionVersion[TransactionVersion["Mainnet"] = 0] = "Mainnet";
|
|
147
171
|
TransactionVersion[TransactionVersion["Testnet"] = 128] = "Testnet";
|
|
148
|
-
})(TransactionVersion
|
|
172
|
+
})(TransactionVersion || (exports.TransactionVersion = TransactionVersion = {}));
|
|
149
173
|
var AnchorModeID;
|
|
150
174
|
(function (AnchorModeID) {
|
|
151
175
|
/** The transaction MUST be included in an anchored block. */
|
|
@@ -154,14 +178,16 @@ var AnchorModeID;
|
|
|
154
178
|
AnchorModeID[AnchorModeID["OffChainOnly"] = 2] = "OffChainOnly";
|
|
155
179
|
/** The leader can choose where to include the transaction. */
|
|
156
180
|
AnchorModeID[AnchorModeID["Any"] = 3] = "Any";
|
|
157
|
-
})(AnchorModeID
|
|
181
|
+
})(AnchorModeID || (exports.AnchorModeID = AnchorModeID = {}));
|
|
158
182
|
var PostConditionModeID;
|
|
159
183
|
(function (PostConditionModeID) {
|
|
160
184
|
/** This transaction may affect other assets not listed in the post-conditions. */
|
|
161
185
|
PostConditionModeID[PostConditionModeID["Allow"] = 1] = "Allow";
|
|
162
186
|
/** This transaction may NOT affect other assets besides those listed in the post-conditions. */
|
|
163
187
|
PostConditionModeID[PostConditionModeID["Deny"] = 2] = "Deny";
|
|
164
|
-
|
|
188
|
+
/** Deny for the transaction origin; allow for everyone else (SIP-040). */
|
|
189
|
+
PostConditionModeID[PostConditionModeID["Originator"] = 3] = "Originator";
|
|
190
|
+
})(PostConditionModeID || (exports.PostConditionModeID = PostConditionModeID = {}));
|
|
165
191
|
var ClarityTypeID;
|
|
166
192
|
(function (ClarityTypeID) {
|
|
167
193
|
ClarityTypeID[ClarityTypeID["Int"] = 0] = "Int";
|
|
@@ -179,7 +205,7 @@ var ClarityTypeID;
|
|
|
179
205
|
ClarityTypeID[ClarityTypeID["Tuple"] = 12] = "Tuple";
|
|
180
206
|
ClarityTypeID[ClarityTypeID["StringAscii"] = 13] = "StringAscii";
|
|
181
207
|
ClarityTypeID[ClarityTypeID["StringUtf8"] = 14] = "StringUtf8";
|
|
182
|
-
})(ClarityTypeID
|
|
208
|
+
})(ClarityTypeID || (exports.ClarityTypeID = ClarityTypeID = {}));
|
|
183
209
|
// ============================================================================
|
|
184
210
|
// PoX Synthetic Event Types
|
|
185
211
|
// ============================================================================
|
|
@@ -197,4 +223,4 @@ var PoxEventName;
|
|
|
197
223
|
PoxEventName["StackAggregationCommitIndexed"] = "stack-aggregation-commit-indexed";
|
|
198
224
|
PoxEventName["StackAggregationIncrease"] = "stack-aggregation-increase";
|
|
199
225
|
PoxEventName["RevokeDelegateStx"] = "revoke-delegate-stx";
|
|
200
|
-
})(PoxEventName
|
|
226
|
+
})(PoxEventName || (exports.PoxEventName = PoxEventName = {}));
|
package/index.mjs
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
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
|
+
return ClarityVersion2;
|
|
96
|
+
})(ClarityVersion || {});
|
|
97
|
+
var TxAuthFieldTypeID = /* @__PURE__ */ ((TxAuthFieldTypeID2) => {
|
|
98
|
+
TxAuthFieldTypeID2[TxAuthFieldTypeID2["PublicKeyCompressed"] = 0] = "PublicKeyCompressed";
|
|
99
|
+
TxAuthFieldTypeID2[TxAuthFieldTypeID2["PublicKeyUncompressed"] = 1] = "PublicKeyUncompressed";
|
|
100
|
+
TxAuthFieldTypeID2[TxAuthFieldTypeID2["SignatureCompressed"] = 2] = "SignatureCompressed";
|
|
101
|
+
TxAuthFieldTypeID2[TxAuthFieldTypeID2["SignatureUncompressed"] = 3] = "SignatureUncompressed";
|
|
102
|
+
return TxAuthFieldTypeID2;
|
|
103
|
+
})(TxAuthFieldTypeID || {});
|
|
104
|
+
var TxPublicKeyEncoding = /* @__PURE__ */ ((TxPublicKeyEncoding2) => {
|
|
105
|
+
TxPublicKeyEncoding2[TxPublicKeyEncoding2["Compressed"] = 0] = "Compressed";
|
|
106
|
+
TxPublicKeyEncoding2[TxPublicKeyEncoding2["Uncompressed"] = 1] = "Uncompressed";
|
|
107
|
+
return TxPublicKeyEncoding2;
|
|
108
|
+
})(TxPublicKeyEncoding || {});
|
|
109
|
+
var TransactionVersion = /* @__PURE__ */ ((TransactionVersion2) => {
|
|
110
|
+
TransactionVersion2[TransactionVersion2["Mainnet"] = 0] = "Mainnet";
|
|
111
|
+
TransactionVersion2[TransactionVersion2["Testnet"] = 128] = "Testnet";
|
|
112
|
+
return TransactionVersion2;
|
|
113
|
+
})(TransactionVersion || {});
|
|
114
|
+
var AnchorModeID = /* @__PURE__ */ ((AnchorModeID2) => {
|
|
115
|
+
AnchorModeID2[AnchorModeID2["OnChainOnly"] = 1] = "OnChainOnly";
|
|
116
|
+
AnchorModeID2[AnchorModeID2["OffChainOnly"] = 2] = "OffChainOnly";
|
|
117
|
+
AnchorModeID2[AnchorModeID2["Any"] = 3] = "Any";
|
|
118
|
+
return AnchorModeID2;
|
|
119
|
+
})(AnchorModeID || {});
|
|
120
|
+
var PostConditionModeID = /* @__PURE__ */ ((PostConditionModeID2) => {
|
|
121
|
+
PostConditionModeID2[PostConditionModeID2["Allow"] = 1] = "Allow";
|
|
122
|
+
PostConditionModeID2[PostConditionModeID2["Deny"] = 2] = "Deny";
|
|
123
|
+
PostConditionModeID2[PostConditionModeID2["Originator"] = 3] = "Originator";
|
|
124
|
+
return PostConditionModeID2;
|
|
125
|
+
})(PostConditionModeID || {});
|
|
126
|
+
var ClarityTypeID = /* @__PURE__ */ ((ClarityTypeID2) => {
|
|
127
|
+
ClarityTypeID2[ClarityTypeID2["Int"] = 0] = "Int";
|
|
128
|
+
ClarityTypeID2[ClarityTypeID2["UInt"] = 1] = "UInt";
|
|
129
|
+
ClarityTypeID2[ClarityTypeID2["Buffer"] = 2] = "Buffer";
|
|
130
|
+
ClarityTypeID2[ClarityTypeID2["BoolTrue"] = 3] = "BoolTrue";
|
|
131
|
+
ClarityTypeID2[ClarityTypeID2["BoolFalse"] = 4] = "BoolFalse";
|
|
132
|
+
ClarityTypeID2[ClarityTypeID2["PrincipalStandard"] = 5] = "PrincipalStandard";
|
|
133
|
+
ClarityTypeID2[ClarityTypeID2["PrincipalContract"] = 6] = "PrincipalContract";
|
|
134
|
+
ClarityTypeID2[ClarityTypeID2["ResponseOk"] = 7] = "ResponseOk";
|
|
135
|
+
ClarityTypeID2[ClarityTypeID2["ResponseError"] = 8] = "ResponseError";
|
|
136
|
+
ClarityTypeID2[ClarityTypeID2["OptionalNone"] = 9] = "OptionalNone";
|
|
137
|
+
ClarityTypeID2[ClarityTypeID2["OptionalSome"] = 10] = "OptionalSome";
|
|
138
|
+
ClarityTypeID2[ClarityTypeID2["List"] = 11] = "List";
|
|
139
|
+
ClarityTypeID2[ClarityTypeID2["Tuple"] = 12] = "Tuple";
|
|
140
|
+
ClarityTypeID2[ClarityTypeID2["StringAscii"] = 13] = "StringAscii";
|
|
141
|
+
ClarityTypeID2[ClarityTypeID2["StringUtf8"] = 14] = "StringUtf8";
|
|
142
|
+
return ClarityTypeID2;
|
|
143
|
+
})(ClarityTypeID || {});
|
|
144
|
+
var PoxEventName = /* @__PURE__ */ ((PoxEventName2) => {
|
|
145
|
+
PoxEventName2["HandleUnlock"] = "handle-unlock";
|
|
146
|
+
PoxEventName2["StackStx"] = "stack-stx";
|
|
147
|
+
PoxEventName2["StackIncrease"] = "stack-increase";
|
|
148
|
+
PoxEventName2["StackExtend"] = "stack-extend";
|
|
149
|
+
PoxEventName2["DelegateStx"] = "delegate-stx";
|
|
150
|
+
PoxEventName2["DelegateStackStx"] = "delegate-stack-stx";
|
|
151
|
+
PoxEventName2["DelegateStackIncrease"] = "delegate-stack-increase";
|
|
152
|
+
PoxEventName2["DelegateStackExtend"] = "delegate-stack-extend";
|
|
153
|
+
PoxEventName2["StackAggregationCommit"] = "stack-aggregation-commit";
|
|
154
|
+
PoxEventName2["StackAggregationCommitIndexed"] = "stack-aggregation-commit-indexed";
|
|
155
|
+
PoxEventName2["StackAggregationIncrease"] = "stack-aggregation-increase";
|
|
156
|
+
PoxEventName2["RevokeDelegateStx"] = "revoke-delegate-stx";
|
|
157
|
+
return PoxEventName2;
|
|
158
|
+
})(PoxEventName || {});
|
|
159
|
+
export {
|
|
160
|
+
AnchorModeID,
|
|
161
|
+
ClarityTypeID,
|
|
162
|
+
ClarityVersion,
|
|
163
|
+
PostConditionAssetInfoID,
|
|
164
|
+
PostConditionAuthFlag,
|
|
165
|
+
PostConditionFungibleConditionCodeID,
|
|
166
|
+
PostConditionFungibleConditionCodeName,
|
|
167
|
+
PostConditionModeID,
|
|
168
|
+
PostConditionNonFungibleConditionName,
|
|
169
|
+
PostConditionNonfungibleConditionCodeID,
|
|
170
|
+
PostConditionPrincipalTypeID,
|
|
171
|
+
PoxEventName,
|
|
172
|
+
PrincipalTypeID,
|
|
173
|
+
StacksNativeEncodingBindings,
|
|
174
|
+
TenureChangeCause,
|
|
175
|
+
TransactionVersion,
|
|
176
|
+
TxAuthFieldTypeID,
|
|
177
|
+
TxPayloadTypeID,
|
|
178
|
+
TxPublicKeyEncoding,
|
|
179
|
+
TxSpendingConditionMultiSigHashMode,
|
|
180
|
+
TxSpendingConditionSingleSigHashMode,
|
|
181
|
+
index_default as default
|
|
182
|
+
};
|
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.7.0",
|
|
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"
|