@knuth/js-wasm 2.4.0 → 2.6.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/package.json +1 -1
- package/src/kth.js +1 -1
- package/src/kth.wasm +0 -0
- package/types/Bitcoin.d.ts +2 -0
- package/types/DoubleList.d.ts +6 -0
- package/types/EcCompressed.d.ts +7 -0
- package/types/EcPublic.d.ts +13 -0
- package/types/Hash.d.ts +32 -0
- package/types/HdPublic.d.ts +13 -0
- package/types/Input.d.ts +17 -0
- package/types/InputList.d.ts +7 -0
- package/types/Interpreter.d.ts +17 -0
- package/types/ListHelper.d.ts +5 -0
- package/types/ListNative.d.ts +5 -0
- package/types/Operation.d.ts +4 -4
- package/types/Output.d.ts +18 -0
- package/types/OutputList.d.ts +7 -0
- package/types/OutputPoint.d.ts +14 -0
- package/types/PaymentAddress.d.ts +16 -1
- package/types/PaymentAddressList.d.ts +7 -0
- package/types/Program.d.ts +15 -0
- package/types/RuleFork.d.ts +35 -2
- package/types/Script.d.ts +19 -4
- package/types/Secret.d.ts +4 -0
- package/types/SecretFunctions.d.ts +8 -0
- package/types/SighashAlgorithm.d.ts +19 -0
- package/types/StringList.d.ts +6 -0
- package/types/TokenData.d.ts +18 -0
- package/types/TokenDataBothKinds.d.ts +9 -0
- package/types/TokenDataFungible.d.ts +5 -0
- package/types/TokenDataNonFungible.d.ts +7 -0
- package/types/Transaction.d.ts +30 -0
- package/types/U32List.d.ts +6 -0
- package/types/U64List.d.ts +6 -0
- package/types/Utxo.d.ts +17 -0
- package/types/UtxoList.d.ts +7 -0
- package/types/Wallet.d.ts +19 -6
- package/types/WalletData.d.ts +11 -0
- package/types/WalletManager.d.ts +8 -0
- package/types/encoding.d.ts +3 -0
- package/types/main.d.ts +42 -4
- package/types/wasm/glue.d.ts +270 -12
- package/types/wasm/glue_manual.d.ts +5 -0
- package/types/wasm/manualGeneratedTypes.d.ts +5 -0
package/types/main.d.ts
CHANGED
|
@@ -1,29 +1,67 @@
|
|
|
1
1
|
import Kth from './Kth';
|
|
2
|
+
import Utxo from './Utxo';
|
|
3
|
+
import Opcode from './Opcode';
|
|
4
|
+
import OutputPoint from './OutputPoint';
|
|
5
|
+
import Output from './Output';
|
|
6
|
+
import TokenData from './TokenData';
|
|
7
|
+
import TokenDataFungible from './TokenDataFungible';
|
|
8
|
+
import TokenDataNonFungible from './TokenDataNonFungible';
|
|
9
|
+
import TokenDataBothKinds from './TokenDataBothKinds';
|
|
10
|
+
import Input from './Input';
|
|
11
|
+
import OutputList from './OutputList';
|
|
12
|
+
import InputList from './InputList';
|
|
13
|
+
import UtxoList from './UtxoList';
|
|
2
14
|
import PaymentAddress from './PaymentAddress';
|
|
3
|
-
import Wallet from './Wallet';
|
|
4
15
|
import Script from './Script';
|
|
5
|
-
import
|
|
16
|
+
import Transaction from './Transaction';
|
|
17
|
+
import Wallet from './Wallet';
|
|
18
|
+
import HdPublic from './HdPublic';
|
|
19
|
+
import EcPublic from './EcPublic';
|
|
20
|
+
import { EcSecret } from './Secret';
|
|
21
|
+
import { SecretFunctions } from './SecretFunctions';
|
|
6
22
|
import { OpcodeEnumNative, OpcodeEnumNativeToInt } from './wasm/glue';
|
|
23
|
+
import { ScriptNative } from './wasm/glue';
|
|
7
24
|
import Operation from './Operation';
|
|
25
|
+
import OperationList from './OperationList';
|
|
8
26
|
import RuleFork from './RuleFork';
|
|
27
|
+
import SighashAlgorithm from './SighashAlgorithm';
|
|
28
|
+
import Program from './Program';
|
|
29
|
+
import { Interpreter, Debugger } from './Interpreter';
|
|
30
|
+
import { bitcoinToSatoshis, satoshisToBitcoin } from './Bitcoin';
|
|
9
31
|
import { RuleForkEnumNative, RuleForkEnumNativeToInt } from './wasm/glue_manual';
|
|
10
|
-
import { bytesToHexStr, hexStrToBytes } from './encoding';
|
|
32
|
+
import { bytesToHexStr, hexStrToBytes, encodeHash, decodeHash } from './encoding';
|
|
33
|
+
import { HashFunctions, Hash, ShortHash, LongHash, EncryptedSeed } from './Hash';
|
|
34
|
+
import WalletManager from './WalletManager';
|
|
35
|
+
import WalletData from './WalletData';
|
|
11
36
|
import loadLib from './wasm/loadLib';
|
|
12
37
|
import { free, malloc } from './wasm/mem';
|
|
13
|
-
export { loadLib, Kth, PaymentAddress, Wallet,
|
|
38
|
+
export { loadLib, Kth, OutputPoint, Utxo, Output, OutputList, TokenData, TokenDataFungible, TokenDataNonFungible, TokenDataBothKinds, Input, InputList, UtxoList, PaymentAddress, Script, ScriptNative, Transaction, Wallet, HdPublic, EcPublic, EcSecret, SecretFunctions, Opcode, OpcodeEnumNative, OpcodeEnumNativeToInt, Operation, OperationList, RuleFork, RuleForkEnumNative, RuleForkEnumNativeToInt, SighashAlgorithm, Interpreter, Debugger, Program, bytesToHexStr, hexStrToBytes, encodeHash, decodeHash, bitcoinToSatoshis, satoshisToBitcoin, HashFunctions, Hash, ShortHash, LongHash, EncryptedSeed, WalletManager, WalletData, free, malloc };
|
|
14
39
|
declare const _default: {
|
|
15
40
|
loadLib: typeof loadLib;
|
|
16
41
|
Kth: typeof Kth;
|
|
17
42
|
PaymentAddress: typeof PaymentAddress;
|
|
18
43
|
Wallet: typeof Wallet;
|
|
19
44
|
Script: typeof Script;
|
|
45
|
+
HdPublic: typeof HdPublic;
|
|
46
|
+
EcPublic: typeof EcPublic;
|
|
47
|
+
SecretFunctions: typeof SecretFunctions;
|
|
20
48
|
Opcode: typeof Opcode;
|
|
21
49
|
OpcodeEnumNativeToInt: typeof OpcodeEnumNativeToInt;
|
|
22
50
|
Operation: typeof Operation;
|
|
23
51
|
RuleFork: typeof RuleFork;
|
|
24
52
|
RuleForkEnumNativeToInt: typeof RuleForkEnumNativeToInt;
|
|
53
|
+
SighashAlgorithm: typeof SighashAlgorithm;
|
|
54
|
+
Utxo: typeof Utxo;
|
|
55
|
+
UtxoList: typeof UtxoList;
|
|
25
56
|
bytesToHexStr: typeof bytesToHexStr;
|
|
26
57
|
hexStrToBytes: typeof hexStrToBytes;
|
|
58
|
+
encodeHash: typeof encodeHash;
|
|
59
|
+
decodeHash: typeof decodeHash;
|
|
60
|
+
bitcoinToSatoshis: typeof bitcoinToSatoshis;
|
|
61
|
+
satoshisToBitcoin: typeof satoshisToBitcoin;
|
|
62
|
+
HashFunctions: typeof HashFunctions;
|
|
63
|
+
WalletManager: typeof WalletManager;
|
|
64
|
+
WalletData: typeof WalletData;
|
|
27
65
|
free: typeof free;
|
|
28
66
|
malloc: typeof malloc;
|
|
29
67
|
};
|
package/types/wasm/glue.d.ts
CHANGED
|
@@ -46,24 +46,69 @@ export declare class StringListNative {
|
|
|
46
46
|
protected _destructor(): void;
|
|
47
47
|
constructor();
|
|
48
48
|
pushBack(string: string): void;
|
|
49
|
+
count(): number;
|
|
50
|
+
nth(index: number): string;
|
|
49
51
|
}
|
|
50
52
|
export declare class ShortHashNative {
|
|
51
53
|
private readonly [ptrSym];
|
|
52
54
|
static _create(ptr: number): ShortHashNative;
|
|
53
55
|
get hash(): number;
|
|
54
56
|
protected _destructor(): void;
|
|
57
|
+
set(data: number): void;
|
|
55
58
|
}
|
|
56
59
|
export declare class HashNative {
|
|
57
60
|
private readonly [ptrSym];
|
|
58
61
|
static _create(ptr: number): HashNative;
|
|
59
62
|
get hash(): number;
|
|
60
63
|
protected _destructor(): void;
|
|
64
|
+
constructor();
|
|
65
|
+
set(data: number): void;
|
|
61
66
|
}
|
|
62
67
|
export declare class LongHashNative {
|
|
63
68
|
private readonly [ptrSym];
|
|
64
69
|
static _create(ptr: number): LongHashNative;
|
|
65
70
|
get hash(): number;
|
|
66
71
|
protected _destructor(): void;
|
|
72
|
+
set(data: number): void;
|
|
73
|
+
}
|
|
74
|
+
export declare class EncryptedSeedNative {
|
|
75
|
+
private readonly [ptrSym];
|
|
76
|
+
static _create(ptr: number): EncryptedSeedNative;
|
|
77
|
+
get hash(): number;
|
|
78
|
+
protected _destructor(): void;
|
|
79
|
+
set(data: number): void;
|
|
80
|
+
}
|
|
81
|
+
export declare class HashFunctionsNative {
|
|
82
|
+
static sha256(encoded: Uint8Array): HashNative;
|
|
83
|
+
static sha256Reversed(encoded: Uint8Array): HashNative;
|
|
84
|
+
static sha256ReversedStr(encoded: Uint8Array): string;
|
|
85
|
+
}
|
|
86
|
+
export declare class DoubleListNative {
|
|
87
|
+
private readonly [ptrSym];
|
|
88
|
+
static _create(ptr: number): DoubleListNative;
|
|
89
|
+
protected _destructor(): void;
|
|
90
|
+
constructor();
|
|
91
|
+
pushBack(x: number): void;
|
|
92
|
+
count(): number;
|
|
93
|
+
nth(index: number): number;
|
|
94
|
+
}
|
|
95
|
+
export declare class U32ListNative {
|
|
96
|
+
private readonly [ptrSym];
|
|
97
|
+
static _create(ptr: number): U32ListNative;
|
|
98
|
+
protected _destructor(): void;
|
|
99
|
+
constructor();
|
|
100
|
+
pushBack(x: number): void;
|
|
101
|
+
count(): number;
|
|
102
|
+
nth(index: number): number;
|
|
103
|
+
}
|
|
104
|
+
export declare class U64ListNative {
|
|
105
|
+
private readonly [ptrSym];
|
|
106
|
+
static _create(ptr: number): U64ListNative;
|
|
107
|
+
protected _destructor(): void;
|
|
108
|
+
constructor();
|
|
109
|
+
pushBack(x: bigint): void;
|
|
110
|
+
count(): number;
|
|
111
|
+
nth(index: number): bigint;
|
|
67
112
|
}
|
|
68
113
|
export declare class HdChainCodeNative {
|
|
69
114
|
private readonly [ptrSym];
|
|
@@ -94,6 +139,8 @@ export declare class EcSecretNative {
|
|
|
94
139
|
static _create(ptr: number): EcSecretNative;
|
|
95
140
|
get hash(): number;
|
|
96
141
|
protected _destructor(): void;
|
|
142
|
+
constructor();
|
|
143
|
+
set(data: number): void;
|
|
97
144
|
}
|
|
98
145
|
export declare class WifUncompressedNative {
|
|
99
146
|
private readonly [ptrSym];
|
|
@@ -124,6 +171,7 @@ export declare class HdPublicNative {
|
|
|
124
171
|
static _create(ptr: number): HdPublicNative;
|
|
125
172
|
protected _destructor(): void;
|
|
126
173
|
constructor();
|
|
174
|
+
constructor(encoded: string);
|
|
127
175
|
isValid(): boolean;
|
|
128
176
|
encoded(): string;
|
|
129
177
|
chainCode(): HdChainCodeNative;
|
|
@@ -155,13 +203,28 @@ export declare class PaymentAddressNative {
|
|
|
155
203
|
static _create(ptr: number): PaymentAddressNative;
|
|
156
204
|
protected _destructor(): void;
|
|
157
205
|
constructor(address: string);
|
|
158
|
-
|
|
206
|
+
static fromShortHash(hash: ShortHashNative, version: number): PaymentAddressNative;
|
|
207
|
+
static fromHash(hash: HashNative, version: number): PaymentAddressNative;
|
|
208
|
+
static fromScript(script: ScriptNative, version: number): PaymentAddressNative;
|
|
209
|
+
static fromPayPublicKeyHashScript(script: ScriptNative, version: number): PaymentAddressNative;
|
|
159
210
|
encodedLegacy(): string;
|
|
160
|
-
|
|
211
|
+
encodedCashAddr(tokenAware: boolean): string;
|
|
161
212
|
hash20(): ShortHashNative;
|
|
162
213
|
hash32(): HashNative;
|
|
163
214
|
version(): number;
|
|
164
215
|
isValid(): boolean;
|
|
216
|
+
static extract(script: ScriptNative, p2khVersion: number, p2shVersion: number): PaymentAddressListNative;
|
|
217
|
+
static extractInput(script: ScriptNative, p2khVersion: number, p2shVersion: number): PaymentAddressListNative;
|
|
218
|
+
static extractOutput(script: ScriptNative, p2khVersion: number, p2shVersion: number): PaymentAddressListNative;
|
|
219
|
+
}
|
|
220
|
+
export declare class PaymentAddressListNative {
|
|
221
|
+
private readonly [ptrSym];
|
|
222
|
+
static _create(ptr: number): PaymentAddressListNative;
|
|
223
|
+
protected _destructor(): void;
|
|
224
|
+
constructor();
|
|
225
|
+
pushBack(utxo: PaymentAddressNative): void;
|
|
226
|
+
count(): number;
|
|
227
|
+
nth(index: number): PaymentAddressNative;
|
|
165
228
|
}
|
|
166
229
|
export declare class EcPrivateNative {
|
|
167
230
|
private readonly [ptrSym];
|
|
@@ -194,6 +257,7 @@ export declare class EcPublicNative {
|
|
|
194
257
|
encoded(): string;
|
|
195
258
|
point(): EcCompressedNative;
|
|
196
259
|
compressed(): boolean;
|
|
260
|
+
toData(): Uint8Array;
|
|
197
261
|
toUncompressed(outData: EcUncompressedNative): boolean;
|
|
198
262
|
toPaymentAddress(version: number): PaymentAddressNative;
|
|
199
263
|
}
|
|
@@ -204,6 +268,18 @@ export declare class WalletNative {
|
|
|
204
268
|
static ecToPublic(secret: EcSecretNative, uncompressed: boolean): EcPublicNative;
|
|
205
269
|
static ecToAddress(point: EcPublicNative, version: number): PaymentAddressNative;
|
|
206
270
|
}
|
|
271
|
+
export declare class WalletDataNative {
|
|
272
|
+
private readonly [ptrSym];
|
|
273
|
+
static _create(ptr: number): WalletDataNative;
|
|
274
|
+
protected _destructor(): void;
|
|
275
|
+
mnemonics(): StringListNative;
|
|
276
|
+
encryptedSeed(): EncryptedSeedNative;
|
|
277
|
+
xpub(): HdPublicNative;
|
|
278
|
+
}
|
|
279
|
+
export declare class WalletManagerNative {
|
|
280
|
+
static createWallet(password: string, normalizedPassphrase: string): [number, WalletDataNative];
|
|
281
|
+
static decryptSeed(password: string, encryptedSeed: EncryptedSeedNative): [number, LongHashNative];
|
|
282
|
+
}
|
|
207
283
|
export declare class NodeInfoNative {
|
|
208
284
|
static printThreadId(): void;
|
|
209
285
|
static getThreadId(): bigint;
|
|
@@ -215,9 +291,6 @@ export declare class NodeInfoNative {
|
|
|
215
291
|
static currency(): string;
|
|
216
292
|
static cppapiBuildTimestamp(): number;
|
|
217
293
|
}
|
|
218
|
-
declare const _OpcodeEnumNativeIntToKey: readonly ["push_size_0", "push_size_1", "push_size_2", "push_size_3", "push_size_4", "push_size_5", "push_size_6", "push_size_7", "push_size_8", "push_size_9", "push_size_10", "push_size_11", "push_size_12", "push_size_13", "push_size_14", "push_size_15", "push_size_16", "push_size_17", "push_size_18", "push_size_19", "push_size_20", "push_size_21", "push_size_22", "push_size_23", "push_size_24", "push_size_25", "push_size_26", "push_size_27", "push_size_28", "push_size_29", "push_size_30", "push_size_31", "push_size_32", "push_size_33", "push_size_34", "push_size_35", "push_size_36", "push_size_37", "push_size_38", "push_size_39", "push_size_40", "push_size_41", "push_size_42", "push_size_43", "push_size_44", "push_size_45", "push_size_46", "push_size_47", "push_size_48", "push_size_49", "push_size_50", "push_size_51", "push_size_52", "push_size_53", "push_size_54", "push_size_55", "push_size_56", "push_size_57", "push_size_58", "push_size_59", "push_size_60", "push_size_61", "push_size_62", "push_size_63", "push_size_64", "push_size_65", "push_size_66", "push_size_67", "push_size_68", "push_size_69", "push_size_70", "push_size_71", "push_size_72", "push_size_73", "push_size_74", "push_size_75", "push_one_size", "push_two_size", "push_four_size", "push_negative_1", "reserved_80", "push_positive_1", "push_positive_2", "push_positive_3", "push_positive_4", "push_positive_5", "push_positive_6", "push_positive_7", "push_positive_8", "push_positive_9", "push_positive_10", "push_positive_11", "push_positive_12", "push_positive_13", "push_positive_14", "push_positive_15", "push_positive_16", "nop", "reserved_98", "if_", "notif", "disabled_verif", "disabled_vernotif", "else_", "endif", "verify", "return_", "toaltstack", "fromaltstack", "drop2", "dup2", "dup3", "over2", "rot2", "swap2", "ifdup", "depth", "drop", "dup", "nip", "over", "pick", "roll", "rot", "swap", "tuck", "disabled_cat", "disabled_substr", "disabled_left", "disabled_right", "size", "disabled_invert", "disabled_and", "disabled_or", "disabled_xor", "equal", "equalverify", "reserved_137", "reserved_138", "add1", "sub1", "disabled_mul2", "disabled_div2", "negate", "abs", "not_", "nonzero", "add", "sub", "disabled_mul", "disabled_div", "disabled_mod", "disabled_lshift", "disabled_rshift", "booland", "boolor", "numequal", "numequalverify", "numnotequal", "lessthan", "greaterthan", "lessthanorequal", "greaterthanorequal", "min", "max", "within", "ripemd160", "sha1", "sha256", "hash160", "hash256", "codeseparator", "checksig", "checksigverify", "checkmultisig", "checkmultisigverify", "nop1", "nop2", "checklocktimeverify", "nop3", "checksequenceverify", "nop4", "nop5", "nop6", "nop7", "nop8", "nop9", "nop10", "checkdatasig", "checkdatasigverify", "reversebytes", "inputindex", "activebytecode", "txversion", "txinputcount", "txoutputcount", "txlocktime", "utxovalue", "utxobytecode", "outpointtxhash", "outpointindex", "inputbytecode", "inputsequencenumber", "outputvalue", "outputbytecode", "utxotokencategory", "utxotokencommitment", "utxotokenamount", "outputtokencategory", "outputtokencommitment", "outputtokenamount", "reserved3", "reserved4", "first_undefined_op_value", "special_token_prefix", "invalidopcode", "reserved_186", "reserved_187", "reserved_188", "reserved_189", "reserved_190", "reserved_191", "reserved_192", "reserved_193", "reserved_194", "reserved_195", "reserved_196", "reserved_197", "reserved_198", "reserved_199", "reserved_200", "reserved_201", "reserved_202", "reserved_203", "reserved_204", "reserved_205", "reserved_206", "reserved_207", "reserved_208", "reserved_209", "reserved_210", "reserved_211", "reserved_212", "reserved_213", "reserved_214", "reserved_215", "reserved_216", "reserved_217", "reserved_218", "reserved_219", "reserved_220", "reserved_221", "reserved_222", "reserved_223", "reserved_224", "reserved_225", "reserved_226", "reserved_227", "reserved_228", "reserved_229", "reserved_230", "reserved_231", "reserved_232", "reserved_233", "reserved_234", "reserved_235", "reserved_236", "reserved_237", "reserved_238", "reserved_239", "reserved_240", "reserved_241", "reserved_242", "reserved_243", "reserved_244", "reserved_245", "reserved_246", "reserved_247", "reserved_248", "reserved_249", "reserved_250", "reserved_251", "reserved_252", "reserved_253", "reserved_254", "reserved_255"];
|
|
219
|
-
export declare type OpcodeEnumNative = (typeof _OpcodeEnumNativeIntToKey)[number];
|
|
220
|
-
export declare function OpcodeEnumNativeToInt(value: OpcodeEnumNative): number;
|
|
221
294
|
export declare class OpcodeNative {
|
|
222
295
|
static to_string(value: OpcodeEnumNative, active_forks: number): string;
|
|
223
296
|
static from_string(value: string): [boolean, OpcodeEnumNative];
|
|
@@ -243,10 +316,10 @@ export declare class OperationNative {
|
|
|
243
316
|
isCounted(): boolean;
|
|
244
317
|
isVersion(): boolean;
|
|
245
318
|
isPositive(): boolean;
|
|
246
|
-
isDisabled(): boolean;
|
|
319
|
+
isDisabled(activeForks: number): boolean;
|
|
247
320
|
isConditional(): boolean;
|
|
248
321
|
isRelaxedPush(): boolean;
|
|
249
|
-
isOversized(): boolean;
|
|
322
|
+
isOversized(maxSize: number): boolean;
|
|
250
323
|
isMinimalPush(): boolean;
|
|
251
324
|
isNominalPush(): boolean;
|
|
252
325
|
static opcodeFromSize(size: number): OpcodeEnumNative;
|
|
@@ -261,7 +334,7 @@ export declare class OperationNative {
|
|
|
261
334
|
static opcodeIsNumeric(code: OpcodeEnumNative): boolean;
|
|
262
335
|
static opcodeIsPositive(code: OpcodeEnumNative): boolean;
|
|
263
336
|
static opcodeIsReserved(code: OpcodeEnumNative): boolean;
|
|
264
|
-
static opcodeIsDisabled(code: OpcodeEnumNative): boolean;
|
|
337
|
+
static opcodeIsDisabled(code: OpcodeEnumNative, activeForks: number): boolean;
|
|
265
338
|
static opcodeIsConditional(code: OpcodeEnumNative): boolean;
|
|
266
339
|
static opcodeIsRelaxedPush(code: OpcodeEnumNative): boolean;
|
|
267
340
|
}
|
|
@@ -274,6 +347,12 @@ export declare class OperationListNative {
|
|
|
274
347
|
count(): number;
|
|
275
348
|
nth(index: number): OperationNative;
|
|
276
349
|
}
|
|
350
|
+
declare const _ScriptPatternIntToKey: readonly ["null_data", "pay_multisig", "pay_public_key", "pay_public_key_hash", "pay_script_hash", "sign_multisig", "sign_public_key", "sign_public_key_hash", "sign_script_hash", "witness_reservation", "non_standard"];
|
|
351
|
+
export declare type ScriptPattern = (typeof _ScriptPatternIntToKey)[number];
|
|
352
|
+
export declare function ScriptPatternToInt(value: ScriptPattern): number;
|
|
353
|
+
declare const _EndorsementTypeIntToKey: readonly ["ecdsa", "schnorr"];
|
|
354
|
+
export declare type EndorsementType = (typeof _EndorsementTypeIntToKey)[number];
|
|
355
|
+
export declare function EndorsementTypeToInt(value: EndorsementType): number;
|
|
277
356
|
export declare class ScriptNative {
|
|
278
357
|
private readonly [ptrSym];
|
|
279
358
|
static _create(ptr: number): ScriptNative;
|
|
@@ -289,7 +368,6 @@ export declare class ScriptNative {
|
|
|
289
368
|
toStr(activeForks: number): string;
|
|
290
369
|
type(): string;
|
|
291
370
|
toData(prefix: boolean): Uint8Array;
|
|
292
|
-
sigops(embedded: boolean): number;
|
|
293
371
|
operations(): OperationListNative;
|
|
294
372
|
toBytes(): Uint8Array;
|
|
295
373
|
static isPushOnly(ops: OperationListNative): boolean;
|
|
@@ -298,15 +376,195 @@ export declare class ScriptNative {
|
|
|
298
376
|
static isNullDataPattern(ops: OperationListNative): boolean;
|
|
299
377
|
static isPayMultisigPattern(ops: OperationListNative): boolean;
|
|
300
378
|
static isPayPublicKeyPattern(ops: OperationListNative): boolean;
|
|
301
|
-
static
|
|
379
|
+
static isPayPublicKeyHashPattern(ops: OperationListNative): boolean;
|
|
302
380
|
static isPayScriptHashPattern(ops: OperationListNative): boolean;
|
|
303
381
|
static isSignMultisigPattern(ops: OperationListNative): boolean;
|
|
304
382
|
static isSignPublicKeyPattern(ops: OperationListNative): boolean;
|
|
305
|
-
static
|
|
383
|
+
static isSignPublicKeyHashPattern(ops: OperationListNative): boolean;
|
|
306
384
|
static isSignScriptHashPattern(ops: OperationListNative): boolean;
|
|
307
385
|
static toNullDataPattern(data: Uint8Array): OperationListNative;
|
|
308
386
|
static toPayPublicKeyPattern(point: Uint8Array): OperationListNative;
|
|
309
|
-
static
|
|
387
|
+
static toPayPublicKeyHashPattern(hash: ShortHashNative): OperationListNative;
|
|
310
388
|
static toPayScriptHashPattern(hash: ShortHashNative): OperationListNative;
|
|
389
|
+
pattern(): ScriptPattern;
|
|
390
|
+
outputPattern(): ScriptPattern;
|
|
391
|
+
inputPattern(): ScriptPattern;
|
|
392
|
+
sigops(accurate: boolean): number;
|
|
393
|
+
isUnspendable(): boolean;
|
|
394
|
+
reset(): void;
|
|
395
|
+
static createEndorsement(secret: EcSecretNative, prevoutScript: ScriptNative, tx: TransactionNative, inputIndex: number, sighashType: number, activeForks: number, value: bigint, endorsementType: EndorsementType): Uint8Array;
|
|
396
|
+
static verify(tx: TransactionNative, input: number, forks: number, inputScript: ScriptNative, prevoutScript: ScriptNative, value: bigint): number;
|
|
397
|
+
static verifyTransaction(tx: TransactionNative, input: number, forks: number): number;
|
|
398
|
+
}
|
|
399
|
+
export declare class OutputPointNative {
|
|
400
|
+
private readonly [ptrSym];
|
|
401
|
+
static _create(ptr: number): OutputPointNative;
|
|
402
|
+
protected _destructor(): void;
|
|
403
|
+
constructor();
|
|
404
|
+
constructor(hash: HashNative, index: number);
|
|
405
|
+
hash(): HashNative;
|
|
406
|
+
index(): number;
|
|
407
|
+
cachedOutput(): OutputNative;
|
|
408
|
+
setHash(hash: HashNative): void;
|
|
409
|
+
setIndex(index: number): void;
|
|
410
|
+
setCachedOutput(output: OutputNative): void;
|
|
311
411
|
}
|
|
412
|
+
declare const _TokenKindIntToKey: readonly ["none", "fungible", "non_fungible", "both"];
|
|
413
|
+
export declare type TokenKind = (typeof _TokenKindIntToKey)[number];
|
|
414
|
+
export declare function TokenKindToInt(value: TokenKind): number;
|
|
415
|
+
declare const _TokenCapabilityIntToKey: readonly ["none", "mutable", "minting"];
|
|
416
|
+
export declare type TokenCapability = (typeof _TokenCapabilityIntToKey)[number];
|
|
417
|
+
export declare function TokenCapabilityToInt(value: TokenCapability): number;
|
|
418
|
+
export declare class TokenDataNative {
|
|
419
|
+
private readonly [ptrSym];
|
|
420
|
+
static _create(ptr: number): TokenDataNative;
|
|
421
|
+
protected _destructor(): void;
|
|
422
|
+
static constructFungible(category: HashNative, amount: bigint): TokenDataNative;
|
|
423
|
+
static constructNonFungible(category: HashNative, capability: TokenCapability, commitmentData: Uint8Array): TokenDataNative;
|
|
424
|
+
static constructBothKinds(category: HashNative, amount: bigint, capability: TokenCapability, commitmentData: Uint8Array): TokenDataNative;
|
|
425
|
+
isValid(): boolean;
|
|
426
|
+
serializedSize(): number;
|
|
427
|
+
toData(): Uint8Array;
|
|
428
|
+
kind(): TokenKind;
|
|
429
|
+
category(): HashNative;
|
|
430
|
+
fungibleAmount(): bigint;
|
|
431
|
+
nonFungibleCapability(): TokenCapability;
|
|
432
|
+
nonFungibleCommitment(): Uint8Array;
|
|
433
|
+
}
|
|
434
|
+
export declare class UtxoNative {
|
|
435
|
+
private readonly [ptrSym];
|
|
436
|
+
static _create(ptr: number): UtxoNative;
|
|
437
|
+
protected _destructor(): void;
|
|
438
|
+
constructor();
|
|
439
|
+
static fromPointAmount(hash: HashNative, index: number, amount: bigint): UtxoNative;
|
|
440
|
+
static fromPointAmountFungible(hash: HashNative, index: number, amount: bigint, category: HashNative, tokenAmount: bigint): UtxoNative;
|
|
441
|
+
static fromPointAmountNonFungible(hash: HashNative, index: number, amount: bigint, category: HashNative, capability: TokenCapability, commitmentData: Uint8Array): UtxoNative;
|
|
442
|
+
static fromPointAmountBothKinds(hash: HashNative, index: number, amount: bigint, category: HashNative, tokenAmount: bigint, capability: TokenCapability, commitmentData: Uint8Array): UtxoNative;
|
|
443
|
+
hash(): HashNative;
|
|
444
|
+
index(): number;
|
|
445
|
+
amount(): bigint;
|
|
446
|
+
cachedOutput(): OutputNative;
|
|
447
|
+
hasTokenData(): boolean;
|
|
448
|
+
tokenData(): TokenDataNative;
|
|
449
|
+
tokenCategory(): HashNative;
|
|
450
|
+
tokenAmount(): bigint;
|
|
451
|
+
setHash(hash: HashNative): void;
|
|
452
|
+
setIndex(index: number): void;
|
|
453
|
+
setAmount(amount: bigint): void;
|
|
454
|
+
setCachedOutput(output: OutputNative): void;
|
|
455
|
+
setTokenData(token_data: TokenDataNative): void;
|
|
456
|
+
setTokenCategory(category: HashNative): void;
|
|
457
|
+
setTokenAmount(amount: bigint): void;
|
|
458
|
+
}
|
|
459
|
+
export declare class OutputNative {
|
|
460
|
+
private readonly [ptrSym];
|
|
461
|
+
static _create(ptr: number): OutputNative;
|
|
462
|
+
protected _destructor(): void;
|
|
463
|
+
constructor();
|
|
464
|
+
constructor(value: bigint, script: ScriptNative);
|
|
465
|
+
constructor(value: bigint, script: ScriptNative, tokenData: TokenDataNative);
|
|
466
|
+
static fromData(data: Uint8Array): OutputNative;
|
|
467
|
+
toData(wire: boolean): Uint8Array;
|
|
468
|
+
serializedSize(wire: boolean): number;
|
|
469
|
+
isValid(): boolean;
|
|
470
|
+
value(): bigint;
|
|
471
|
+
script(): ScriptNative;
|
|
472
|
+
hasTokenData(): boolean;
|
|
473
|
+
tokenData(): TokenDataNative;
|
|
474
|
+
}
|
|
475
|
+
export declare class InputNative {
|
|
476
|
+
private readonly [ptrSym];
|
|
477
|
+
static _create(ptr: number): InputNative;
|
|
478
|
+
protected _destructor(): void;
|
|
479
|
+
constructor();
|
|
480
|
+
constructor(previousOutput: OutputPointNative, script: ScriptNative, seq: number);
|
|
481
|
+
static fromData(data: Uint8Array): InputNative;
|
|
482
|
+
toData(wire: boolean): Uint8Array;
|
|
483
|
+
serializedSize(wire: boolean): number;
|
|
484
|
+
isValid(): boolean;
|
|
485
|
+
seq(): number;
|
|
486
|
+
script(): ScriptNative;
|
|
487
|
+
previousOutput(): OutputPointNative;
|
|
488
|
+
}
|
|
489
|
+
export declare class OutputListNative {
|
|
490
|
+
private readonly [ptrSym];
|
|
491
|
+
static _create(ptr: number): OutputListNative;
|
|
492
|
+
protected _destructor(): void;
|
|
493
|
+
constructor();
|
|
494
|
+
pushBack(output: OutputNative): void;
|
|
495
|
+
count(): number;
|
|
496
|
+
nth(index: number): OutputNative;
|
|
497
|
+
}
|
|
498
|
+
export declare class InputListNative {
|
|
499
|
+
private readonly [ptrSym];
|
|
500
|
+
static _create(ptr: number): InputListNative;
|
|
501
|
+
protected _destructor(): void;
|
|
502
|
+
constructor();
|
|
503
|
+
pushBack(input: InputNative): void;
|
|
504
|
+
count(): number;
|
|
505
|
+
nth(index: number): InputNative;
|
|
506
|
+
}
|
|
507
|
+
export declare class UtxoListNative {
|
|
508
|
+
private readonly [ptrSym];
|
|
509
|
+
static _create(ptr: number): UtxoListNative;
|
|
510
|
+
protected _destructor(): void;
|
|
511
|
+
constructor();
|
|
512
|
+
pushBack(utxo: UtxoNative): void;
|
|
513
|
+
count(): number;
|
|
514
|
+
nth(index: number): UtxoNative;
|
|
515
|
+
}
|
|
516
|
+
declare const _CoinSelectionAlgorithmIntToKey: readonly ["smallest_first", "largest_first", "manual", "send_all"];
|
|
517
|
+
export declare type CoinSelectionAlgorithm = (typeof _CoinSelectionAlgorithmIntToKey)[number];
|
|
518
|
+
export declare function CoinSelectionAlgorithmToInt(value: CoinSelectionAlgorithm): number;
|
|
519
|
+
export declare class TransactionNative {
|
|
520
|
+
private readonly [ptrSym];
|
|
521
|
+
static _create(ptr: number): TransactionNative;
|
|
522
|
+
protected _destructor(): void;
|
|
523
|
+
constructor();
|
|
524
|
+
constructor(version: number, locktime: number, inputs: InputListNative, outputs: OutputListNative);
|
|
525
|
+
static fromData(data: Uint8Array): TransactionNative;
|
|
526
|
+
toData(wire: boolean): Uint8Array;
|
|
527
|
+
serializedSize(wire: boolean): number;
|
|
528
|
+
isValid(): boolean;
|
|
529
|
+
hash(): HashNative;
|
|
530
|
+
version(): number;
|
|
531
|
+
locktime(): number;
|
|
532
|
+
outputs(): OutputListNative;
|
|
533
|
+
inputs(): InputListNative;
|
|
534
|
+
isCoinbase(): boolean;
|
|
535
|
+
totalInputValue(): bigint;
|
|
536
|
+
totalOutputValue(): bigint;
|
|
537
|
+
fees(): bigint;
|
|
538
|
+
isMature(target_height: number): boolean;
|
|
539
|
+
static createTemplateWithChangeRatios(available_utxos: UtxoListNative, amount_to_send: bigint, destination_address: PaymentAddressNative, change_addresses: PaymentAddressListNative, change_ratios: DoubleListNative, selection_algo: CoinSelectionAlgorithm): [number, TransactionNative, U32ListNative, PaymentAddressListNative, U64ListNative];
|
|
540
|
+
static createTemplate(available_utxos: UtxoListNative, amount_to_send: bigint, destination_address: PaymentAddressNative, change_addresses: PaymentAddressListNative, selection_algo: CoinSelectionAlgorithm): [number, TransactionNative, U32ListNative, PaymentAddressListNative, U64ListNative];
|
|
541
|
+
}
|
|
542
|
+
export declare class InterpreterNative {
|
|
543
|
+
static run(program: ProgramNative): number;
|
|
544
|
+
static runOperation(operation: OperationNative, program: ProgramNative): number;
|
|
545
|
+
static debugStart(program: ProgramNative): [number, number];
|
|
546
|
+
static debugStepsAvailable(program: ProgramNative, step: number): boolean;
|
|
547
|
+
static debugStep(program: ProgramNative, step: number): [number, number, ProgramNative];
|
|
548
|
+
static debugEnd(program: ProgramNative): number;
|
|
549
|
+
}
|
|
550
|
+
export declare class ProgramNative {
|
|
551
|
+
private readonly [ptrSym];
|
|
552
|
+
static _create(ptr: number): ProgramNative;
|
|
553
|
+
protected _destructor(): void;
|
|
554
|
+
constructor();
|
|
555
|
+
constructor(script: ScriptNative);
|
|
556
|
+
constructor(script: ScriptNative, program: ProgramNative);
|
|
557
|
+
constructor(script: ScriptNative, transaction: TransactionNative, inputIndex: number, forks: number);
|
|
558
|
+
isValid(): boolean;
|
|
559
|
+
evaluate(): number;
|
|
560
|
+
stackResult(clean: boolean): boolean;
|
|
561
|
+
size(): number;
|
|
562
|
+
item(index: number): Uint8Array;
|
|
563
|
+
}
|
|
564
|
+
declare const _RuleForkEnumNativeIntToKey: readonly ["no_rules", "easy_blocks", "bip16_rule", "bip30_rule", "bip34_rule", "bip66_rule", "bip65_rule", "bip90_rule", "allow_collisions", "bip68_rule", "bip112_rule", "bip113_rule", "bch_uahf", "bch_daa_cw144", "bch_pythagoras", "bch_euclid", "bch_pisano", "bch_mersenne", "bch_fermat", "bch_euler", "bch_gauss", "bch_descartes", "bch_lobachevski", "bch_galois", "bch_leibniz", "retarget", "unverified", "bip34_activations", "bip9_bit0_group", "bip9_bit1_group", "all_rules"];
|
|
565
|
+
export declare type RuleForkEnumNative = (typeof _RuleForkEnumNativeIntToKey)[number];
|
|
566
|
+
export declare function RuleForkEnumNativeToInt(value: RuleForkEnumNative): number;
|
|
567
|
+
declare const _OpcodeEnumNativeIntToKey: readonly ["push_size_0", "push_size_1", "push_size_2", "push_size_3", "push_size_4", "push_size_5", "push_size_6", "push_size_7", "push_size_8", "push_size_9", "push_size_10", "push_size_11", "push_size_12", "push_size_13", "push_size_14", "push_size_15", "push_size_16", "push_size_17", "push_size_18", "push_size_19", "push_size_20", "push_size_21", "push_size_22", "push_size_23", "push_size_24", "push_size_25", "push_size_26", "push_size_27", "push_size_28", "push_size_29", "push_size_30", "push_size_31", "push_size_32", "push_size_33", "push_size_34", "push_size_35", "push_size_36", "push_size_37", "push_size_38", "push_size_39", "push_size_40", "push_size_41", "push_size_42", "push_size_43", "push_size_44", "push_size_45", "push_size_46", "push_size_47", "push_size_48", "push_size_49", "push_size_50", "push_size_51", "push_size_52", "push_size_53", "push_size_54", "push_size_55", "push_size_56", "push_size_57", "push_size_58", "push_size_59", "push_size_60", "push_size_61", "push_size_62", "push_size_63", "push_size_64", "push_size_65", "push_size_66", "push_size_67", "push_size_68", "push_size_69", "push_size_70", "push_size_71", "push_size_72", "push_size_73", "push_size_74", "push_size_75", "push_one_size", "push_two_size", "push_four_size", "push_negative_1", "reserved_80", "push_positive_1", "push_positive_2", "push_positive_3", "push_positive_4", "push_positive_5", "push_positive_6", "push_positive_7", "push_positive_8", "push_positive_9", "push_positive_10", "push_positive_11", "push_positive_12", "push_positive_13", "push_positive_14", "push_positive_15", "push_positive_16", "nop", "reserved_98", "if", "notif", "disabled_verif", "disabled_vernotif", "else", "endif", "verify", "return", "toaltstack", "fromaltstack", "drop2", "dup2", "dup3", "over2", "rot2", "swap2", "ifdup", "depth", "drop", "dup", "nip", "over", "pick", "roll", "rot", "swap", "tuck", "cat", "split", "num2bin", "bin2num", "size", "disabled_invert", "and", "or", "xor", "equal", "equalverify", "reserved_137", "reserved_138", "add1", "sub1", "disabled_mul2", "disabled_div2", "negate", "abs", "not", "nonzero", "add", "sub", "mul", "div", "mod", "disabled_lshift", "disabled_rshift", "booland", "boolor", "numequal", "numequalverify", "numnotequal", "lessthan", "greaterthan", "lessthanorequal", "greaterthanorequal", "min", "max", "within", "ripemd160", "sha1", "sha256", "hash160", "hash256", "codeseparator", "checksig", "checksigverify", "checkmultisig", "checkmultisigverify", "nop1", "nop2", "checklocktimeverify", "nop3", "checksequenceverify", "nop4", "nop5", "nop6", "nop7", "nop8", "nop9", "nop10", "checkdatasig", "checkdatasigverify", "reverse_bytes", "available1", "available2", "available3", "input_index", "active_bytecode", "tx_version", "tx_input_count", "tx_output_count", "tx_locktime", "utxo_value", "utxo_bytecode", "outpoint_tx_hash", "outpoint_index", "input_bytecode", "input_sequence_number", "output_value", "output_bytecode", "utxo_token_category", "utxo_token_commitment", "utxo_token_amount", "output_token_category", "output_token_commitment", "output_token_amount", "reserved_212", "reserved_213", "reserved_214", "first_undefined_op_value", "reserved_215", "reserved_216", "reserved_217", "reserved_218", "reserved_219", "reserved_220", "reserved_221", "reserved_222", "reserved_223", "reserved_224", "reserved_225", "reserved_226", "reserved_227", "reserved_228", "reserved_229", "reserved_230", "reserved_231", "reserved_232", "reserved_233", "reserved_234", "reserved_235", "reserved_236", "reserved_237", "reserved_238", "reserved_239", "special_token_prefix", "reserved_240", "reserved_241", "reserved_242", "reserved_243", "reserved_244", "reserved_245", "reserved_246", "reserved_247", "reserved_248", "reserved_249", "reserved_250", "reserved_251", "reserved_252", "reserved_253", "reserved_254", "reserved_255", "invalidopcode"];
|
|
568
|
+
export declare type OpcodeEnumNative = (typeof _OpcodeEnumNativeIntToKey)[number];
|
|
569
|
+
export declare function OpcodeEnumNativeToInt(value: OpcodeEnumNative): number;
|
|
312
570
|
export {};
|
|
@@ -31,7 +31,12 @@ declare const _RuleForkEnumNativeKeyToInt: {
|
|
|
31
31
|
readonly bip9_bit1_group: number;
|
|
32
32
|
readonly all_rules: 4294967295;
|
|
33
33
|
};
|
|
34
|
+
export declare const RuleForkEnumValues: string[];
|
|
34
35
|
export declare type RuleForkEnumNative = keyof typeof _RuleForkEnumNativeKeyToInt;
|
|
35
36
|
export declare function RuleForkEnumNativeToInt(value: RuleForkEnumNative): number;
|
|
36
37
|
export declare function RuleForkEnumNativeFromInt(value: number): RuleForkEnumNative | undefined;
|
|
38
|
+
declare const _OpcodeEnumNativeIntToKey: readonly ["push_size_0", "push_size_1", "push_size_2", "push_size_3", "push_size_4", "push_size_5", "push_size_6", "push_size_7", "push_size_8", "push_size_9", "push_size_10", "push_size_11", "push_size_12", "push_size_13", "push_size_14", "push_size_15", "push_size_16", "push_size_17", "push_size_18", "push_size_19", "push_size_20", "push_size_21", "push_size_22", "push_size_23", "push_size_24", "push_size_25", "push_size_26", "push_size_27", "push_size_28", "push_size_29", "push_size_30", "push_size_31", "push_size_32", "push_size_33", "push_size_34", "push_size_35", "push_size_36", "push_size_37", "push_size_38", "push_size_39", "push_size_40", "push_size_41", "push_size_42", "push_size_43", "push_size_44", "push_size_45", "push_size_46", "push_size_47", "push_size_48", "push_size_49", "push_size_50", "push_size_51", "push_size_52", "push_size_53", "push_size_54", "push_size_55", "push_size_56", "push_size_57", "push_size_58", "push_size_59", "push_size_60", "push_size_61", "push_size_62", "push_size_63", "push_size_64", "push_size_65", "push_size_66", "push_size_67", "push_size_68", "push_size_69", "push_size_70", "push_size_71", "push_size_72", "push_size_73", "push_size_74", "push_size_75", "push_one_size", "push_two_size", "push_four_size", "push_negative_1", "reserved_80", "push_positive_1", "push_positive_2", "push_positive_3", "push_positive_4", "push_positive_5", "push_positive_6", "push_positive_7", "push_positive_8", "push_positive_9", "push_positive_10", "push_positive_11", "push_positive_12", "push_positive_13", "push_positive_14", "push_positive_15", "push_positive_16", "nop", "reserved_98", "if", "notif", "disabled_verif", "disabled_vernotif", "else", "endif", "verify", "return", "toaltstack", "fromaltstack", "drop2", "dup2", "dup3", "over2", "rot2", "swap2", "ifdup", "depth", "drop", "dup", "nip", "over", "pick", "roll", "rot", "swap", "tuck", "cat", "split", "num2bin", "bin2num", "size", "disabled_invert", "and", "or", "xor", "equal", "equalverify", "reserved_137", "reserved_138", "add1", "sub1", "disabled_mul2", "disabled_div2", "negate", "abs", "not", "nonzero", "add", "sub", "mul", "div", "mod", "disabled_lshift", "disabled_rshift", "booland", "boolor", "numequal", "numequalverify", "numnotequal", "lessthan", "greaterthan", "lessthanorequal", "greaterthanorequal", "min", "max", "within", "ripemd160", "sha1", "sha256", "hash160", "hash256", "codeseparator", "checksig", "checksigverify", "checkmultisig", "checkmultisigverify", "nop1", "checklocktimeverify", "checksequenceverify", "nop4", "nop5", "nop6", "nop7", "nop8", "nop9", "nop10", "checkdatasig", "checkdatasigverify", "reverse_bytes", "available1", "available2", "available3", "input_index", "active_bytecode", "tx_version", "tx_input_count", "tx_output_count", "tx_locktime", "utxo_value", "utxo_bytecode", "outpoint_tx_hash", "outpoint_index", "input_bytecode", "input_sequence_number", "output_value", "output_bytecode", "utxo_token_category", "utxo_token_commitment", "utxo_token_amount", "output_token_category", "output_token_commitment", "output_token_amount", "reserved_212", "reserved_213", "first_undefined_op_value", "reserved_215", "reserved_216", "reserved_217", "reserved_218", "reserved_219", "reserved_220", "reserved_221", "reserved_222", "reserved_223", "reserved_224", "reserved_225", "reserved_226", "reserved_227", "reserved_228", "reserved_229", "reserved_230", "reserved_231", "reserved_232", "reserved_233", "reserved_234", "reserved_235", "reserved_236", "reserved_237", "reserved_238", "special_token_prefix", "reserved_240", "reserved_241", "reserved_242", "reserved_243", "reserved_244", "reserved_245", "reserved_246", "reserved_247", "reserved_248", "reserved_249", "reserved_250", "reserved_251", "reserved_252", "reserved_253", "reserved_254", "invalidopcode"];
|
|
39
|
+
export declare type OpcodeEnumNative = (typeof _OpcodeEnumNativeIntToKey)[number];
|
|
40
|
+
export declare const OpcodeEnumValues: string[];
|
|
41
|
+
export declare function OpcodeEnumNativeToInt(value: OpcodeEnumNative): number;
|
|
37
42
|
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Klass from '../../tools/wasm-generator/src/klass';
|
|
2
|
+
import Enum from '../../tools/wasm-generator/src/enum';
|
|
3
|
+
import Typedef from '../../tools/wasm-generator/src/typedef';
|
|
4
|
+
declare const manualGeneratedTypes: Array<Klass | Enum | Typedef>;
|
|
5
|
+
export default manualGeneratedTypes;
|