@neuraiproject/neurai-scripts 0.9.2 → 0.10.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 +66 -15
- package/dist/NeuraiScripts.global.js +292 -444
- package/dist/NeuraiScripts.global.js.map +1 -1
- package/dist/browser.js +292 -444
- package/dist/browser.js.map +1 -1
- package/dist/covenants/partial-fill/fill-branches.d.ts +74 -0
- package/dist/covenants/partial-fill/parse-pq.d.ts +2 -3
- package/dist/covenants/partial-fill/parse.d.ts +8 -10
- package/dist/covenants/partial-fill/script-pq.d.ts +4 -4
- package/dist/covenants/partial-fill/script.d.ts +9 -10
- package/dist/index.cjs +292 -444
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +55 -39
- package/dist/index.js +292 -444
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +31 -11
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -45,17 +45,35 @@ export interface PartialFillExpiration {
|
|
|
45
45
|
*/
|
|
46
46
|
value: bigint;
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Seller of an ECDSA-cancel order, in one of two forms:
|
|
50
|
+
* - `sellerAddress` alone: a legacy P2PKH address that is both the
|
|
51
|
+
* payment destination and the cancel key hash;
|
|
52
|
+
* - `paymentAddress` with `sellerPubKeyHash`: any payment destination
|
|
53
|
+
* and the HASH160 of the secp256k1 key that may cancel. This is the
|
|
54
|
+
* form for a strict ECDSA v3 (`nq1r…`) seller, whose address program is
|
|
55
|
+
* a commitment and not a key hash.
|
|
56
|
+
* Passing both forms, or neither, throws.
|
|
57
|
+
*/
|
|
48
58
|
export interface PartialFillOrderParams {
|
|
49
59
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
* Legacy P2PKH seller (base58check, "t..." on testnet, "N..." on
|
|
61
|
+
* mainnet). Its 20-byte PKH is hardcoded as the cancel key hash and the
|
|
62
|
+
* payment output must be the P2PKH script of that same PKH. Bech32m
|
|
63
|
+
* addresses are rejected here: use `paymentAddress` + `sellerPubKeyHash`.
|
|
64
|
+
*/
|
|
65
|
+
sellerAddress?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Destination for the XNA payment: legacy P2PKH, generic AuthScript v1
|
|
68
|
+
* (`nc1p…`), strict PQ v2 (`pq1z…`) or strict ECDSA v3 (`nq1r…`). The
|
|
69
|
+
* covenant hardcodes its full scriptPubKey. Requires `sellerPubKeyHash`.
|
|
57
70
|
*/
|
|
58
|
-
|
|
71
|
+
paymentAddress?: string;
|
|
72
|
+
/**
|
|
73
|
+
* HASH160 of the compressed secp256k1 public key allowed to cancel the
|
|
74
|
+
* order (20 bytes). Requires `paymentAddress`.
|
|
75
|
+
*/
|
|
76
|
+
sellerPubKeyHash?: Uint8Array;
|
|
59
77
|
/** Name of the asset being sold (e.g. "CAT"). */
|
|
60
78
|
tokenId: string;
|
|
61
79
|
/**
|
|
@@ -78,11 +96,13 @@ export interface ParsedPartialFillOrder {
|
|
|
78
96
|
/** Network the parser was invoked with (used for downstream address formatting). */
|
|
79
97
|
network: Network;
|
|
80
98
|
/**
|
|
81
|
-
*
|
|
82
|
-
* branch.
|
|
83
|
-
*
|
|
99
|
+
* 20-byte HASH160 of the key allowed to cancel, extracted from the
|
|
100
|
+
* covenant's cancel branch. It equals the payment P2PKH hash only for
|
|
101
|
+
* orders built with `sellerAddress`.
|
|
84
102
|
*/
|
|
85
103
|
sellerPubKeyHash: Uint8Array;
|
|
104
|
+
/** scriptPubKey bytes embedded in the covenant for the payment output. */
|
|
105
|
+
paymentScriptPubKey: Uint8Array;
|
|
86
106
|
/** Asset name parsed from the covenant. */
|
|
87
107
|
tokenId: string;
|
|
88
108
|
/** Unit price parsed from the covenant, in XNA satoshis. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neuraiproject/neurai-scripts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Script-assembly library for Neurai: opcode constants, ScriptBuilder, standard scripts (P2PKH, P2WPKH, P2WSH, AuthScript, multisig, OP_RETURN) and covenants (partial-fill sell orders, legacy + PQ) targeting the DePIN-Test opcode set",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|