@knuth/js-wasm 2.11.0 → 4.0.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/LICENSE.md +23 -0
- package/README.md +119 -27
- package/SHA256SUMS +4 -0
- package/package.json +21 -8
- package/src/browser_headers_persistent_v1.js +2 -0
- package/src/browser_headers_persistent_v1.wasm +0 -0
- package/src/kth.js +6 -3
- package/src/kth.wasm +0 -0
- package/types/AsyncResults.d.ts +11 -0
- package/types/Bitcoin.d.ts +4 -0
- package/types/DerivationPath.d.ts +8 -0
- package/types/DoubleList.d.ts +5 -4
- package/types/EcCompressed.d.ts +8 -3
- package/types/EcPublic.d.ts +10 -4
- package/types/ElectrumClient.d.ts +79 -0
- package/types/EllipticCurve.d.ts +8 -2
- package/types/Hash.d.ts +5 -0
- package/types/HdPublic.d.ts +9 -3
- package/types/Input.d.ts +10 -7
- package/types/InputList.d.ts +6 -5
- package/types/Interpreter.d.ts +9 -1
- package/types/Kth.d.ts +4 -0
- package/types/LazySequence.d.ts +4 -0
- package/types/ListHelper.d.ts +13 -1
- package/types/ListNative.d.ts +4 -0
- package/types/NativeLifetime.d.ts +11 -0
- package/types/Opcode.d.ts +10 -3
- package/types/OpcodeAliases.d.ts +16 -0
- package/types/Operation.d.ts +31 -26
- package/types/OperationList.d.ts +6 -5
- package/types/Output.d.ts +11 -7
- package/types/OutputList.d.ts +6 -5
- package/types/OutputPoint.d.ts +8 -4
- package/types/PaymentAddress.d.ts +15 -10
- package/types/PaymentAddressList.d.ts +6 -5
- package/types/Program.d.ts +15 -2
- package/types/RuleFork.d.ts +4 -0
- package/types/Script.d.ts +34 -19
- package/types/ScriptFlags.d.ts +67 -0
- package/types/Secret.d.ts +4 -0
- package/types/SecretFunctions.d.ts +4 -0
- package/types/SighashAlgorithm.d.ts +4 -0
- package/types/SighashGuard.d.ts +10 -0
- package/types/StringList.d.ts +5 -4
- package/types/TokenData.d.ts +8 -3
- package/types/TokenDataBothKinds.d.ts +6 -3
- package/types/TokenDataFungible.d.ts +4 -0
- package/types/TokenDataNonFungible.d.ts +9 -2
- package/types/Transaction.d.ts +12 -10
- package/types/TransactionHelpers.d.ts +14 -0
- package/types/U32List.d.ts +5 -4
- package/types/U64List.d.ts +5 -4
- package/types/Utxo.d.ts +10 -6
- package/types/UtxoList.d.ts +6 -5
- package/types/Wallet.d.ts +28 -52
- package/types/WalletData.d.ts +5 -1
- package/types/WalletManager.d.ts +6 -3
- package/types/WalletUtils.d.ts +53 -0
- package/types/encoding.d.ts +4 -0
- package/types/env.d.ts +4 -0
- package/types/logger.d.ts +6 -0
- package/types/main.d.ts +75 -2
- package/types/nativeScope.d.ts +11 -0
- package/types/types.d.ts +4 -0
- package/types/utils.d.ts +4 -0
- package/types/wasm/EmscriptenModule.d.ts +4 -0
- package/types/wasm/bootloader.d.ts +4 -0
- package/types/wasm/callbacks.d.ts +30 -0
- package/types/wasm/exceptions.d.ts +4 -0
- package/types/wasm/glue.d.ts +960 -170
- package/types/wasm/glue_manual.d.ts +4 -0
- package/types/wasm/loadLib.d.ts +4 -0
- package/types/wasm/manualGeneratedTypes.d.ts +4 -0
- package/types/wasm/mem.d.ts +33 -1
- package/types/wasm/promises.d.ts +4 -0
- package/types/wasm/stack.d.ts +6 -0
- package/types/wasm/string.d.ts +13 -0
- package/types/LazySequence copy.d.ts +0 -0
- package/types/wasm/glue copy.d.ts +0 -230
package/types/wasm/glue.d.ts
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
|
+
// Copyright (c) 2016-present Knuth Project developers.
|
|
2
|
+
// Distributed under the MIT software license, see the accompanying
|
|
3
|
+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
4
|
+
|
|
1
5
|
declare const ptrSym: unique symbol;
|
|
6
|
+
/** A native call that returns a status code reported a non-zero status. */
|
|
7
|
+
export declare class NativeStatusError extends Error {
|
|
8
|
+
readonly operation: string;
|
|
9
|
+
readonly status: number;
|
|
10
|
+
constructor(operation: string, status: number);
|
|
11
|
+
}
|
|
12
|
+
/** True for a non-owning view (it must not be released: its parent owns the native handle). */
|
|
13
|
+
export declare function isBorrowedView(obj: any): boolean;
|
|
2
14
|
declare const _CurrencyIntToKey: readonly ["bitcoin", "bitcoin_cash", "litecoin"];
|
|
3
15
|
export declare type Currency = (typeof _CurrencyIntToKey)[number];
|
|
4
16
|
export declare function CurrencyToInt(value: Currency): number;
|
|
17
|
+
export declare function CurrencyFromInt(value: number): Currency;
|
|
5
18
|
export declare class LibConfigTypeSizes {
|
|
6
19
|
private readonly [ptrSym];
|
|
20
|
+
private constructor();
|
|
7
21
|
static _create(ptr: number): LibConfigTypeSizes;
|
|
8
22
|
get size_int(): number;
|
|
9
23
|
get size_long(): number;
|
|
@@ -12,6 +26,7 @@ export declare class LibConfigTypeSizes {
|
|
|
12
26
|
}
|
|
13
27
|
export declare class LibConfig {
|
|
14
28
|
private readonly [ptrSym];
|
|
29
|
+
private constructor();
|
|
15
30
|
static _create(ptr: number): LibConfig;
|
|
16
31
|
get version(): string;
|
|
17
32
|
get microarchitecture_id(): string;
|
|
@@ -35,20 +50,27 @@ export declare class LibConfig {
|
|
|
35
50
|
static getEmscriptenVersionTiny(): number;
|
|
36
51
|
static getBuildTimestamp(): number;
|
|
37
52
|
}
|
|
53
|
+
declare const _NetworkIntToKey: readonly ["mainnet", "testnet", "regtest", "testnet4", "scalenet", "chipnet", "tempnet"];
|
|
54
|
+
export declare type Network = (typeof _NetworkIntToKey)[number];
|
|
55
|
+
export declare function NetworkToInt(value: Network): number;
|
|
56
|
+
export declare function NetworkFromInt(value: number): Network;
|
|
38
57
|
export declare class StringListNative {
|
|
39
58
|
private readonly [ptrSym];
|
|
40
59
|
static _create(ptr: number): StringListNative;
|
|
41
60
|
protected _destructor(): void;
|
|
42
61
|
constructor();
|
|
43
|
-
pushBack(
|
|
62
|
+
pushBack(elem: string): void;
|
|
44
63
|
count(): number;
|
|
45
64
|
nth(index: number): string;
|
|
65
|
+
assignAt(index: number, elem: string): void;
|
|
66
|
+
erase(index: number): void;
|
|
46
67
|
}
|
|
47
68
|
export declare class ShortHashNative {
|
|
48
69
|
private readonly [ptrSym];
|
|
49
70
|
static _create(ptr: number): ShortHashNative;
|
|
50
71
|
get hash(): number;
|
|
51
72
|
protected _destructor(): void;
|
|
73
|
+
constructor();
|
|
52
74
|
set(data: number): void;
|
|
53
75
|
}
|
|
54
76
|
export declare class HashNative {
|
|
@@ -64,6 +86,7 @@ export declare class LongHashNative {
|
|
|
64
86
|
static _create(ptr: number): LongHashNative;
|
|
65
87
|
get hash(): number;
|
|
66
88
|
protected _destructor(): void;
|
|
89
|
+
constructor();
|
|
67
90
|
set(data: number): void;
|
|
68
91
|
}
|
|
69
92
|
export declare class EncryptedSeedNative {
|
|
@@ -71,60 +94,98 @@ export declare class EncryptedSeedNative {
|
|
|
71
94
|
static _create(ptr: number): EncryptedSeedNative;
|
|
72
95
|
get hash(): number;
|
|
73
96
|
protected _destructor(): void;
|
|
97
|
+
constructor();
|
|
74
98
|
set(data: number): void;
|
|
75
99
|
}
|
|
76
100
|
export declare class HashFunctionsNative {
|
|
77
101
|
static sha256(encoded: Uint8Array): HashNative;
|
|
78
102
|
static sha256Reversed(encoded: Uint8Array): HashNative;
|
|
79
103
|
static sha256ReversedStr(encoded: Uint8Array): string;
|
|
104
|
+
static ripemd160(encoded: Uint8Array): ShortHashNative;
|
|
105
|
+
}
|
|
106
|
+
export declare class HashListNative {
|
|
107
|
+
private readonly [ptrSym];
|
|
108
|
+
static _create(ptr: number): HashListNative;
|
|
109
|
+
protected _destructor(): void;
|
|
110
|
+
constructor();
|
|
111
|
+
pushBack(elem: HashNative): void;
|
|
112
|
+
count(): number;
|
|
113
|
+
nth(index: number): HashNative;
|
|
114
|
+
assignAt(index: number, elem: HashNative): void;
|
|
115
|
+
erase(index: number): void;
|
|
80
116
|
}
|
|
81
117
|
export declare class DoubleListNative {
|
|
82
118
|
private readonly [ptrSym];
|
|
83
119
|
static _create(ptr: number): DoubleListNative;
|
|
84
120
|
protected _destructor(): void;
|
|
85
121
|
constructor();
|
|
86
|
-
pushBack(
|
|
122
|
+
pushBack(elem: number): void;
|
|
87
123
|
count(): number;
|
|
88
124
|
nth(index: number): number;
|
|
125
|
+
assignAt(index: number, elem: number): void;
|
|
126
|
+
erase(index: number): void;
|
|
89
127
|
}
|
|
90
128
|
export declare class U32ListNative {
|
|
91
129
|
private readonly [ptrSym];
|
|
92
130
|
static _create(ptr: number): U32ListNative;
|
|
93
131
|
protected _destructor(): void;
|
|
94
132
|
constructor();
|
|
95
|
-
pushBack(
|
|
133
|
+
pushBack(elem: number): void;
|
|
96
134
|
count(): number;
|
|
97
135
|
nth(index: number): number;
|
|
136
|
+
assignAt(index: number, elem: number): void;
|
|
137
|
+
erase(index: number): void;
|
|
98
138
|
}
|
|
99
139
|
export declare class U64ListNative {
|
|
100
140
|
private readonly [ptrSym];
|
|
101
141
|
static _create(ptr: number): U64ListNative;
|
|
102
142
|
protected _destructor(): void;
|
|
103
143
|
constructor();
|
|
104
|
-
pushBack(
|
|
144
|
+
pushBack(elem: bigint): void;
|
|
105
145
|
count(): number;
|
|
106
146
|
nth(index: number): bigint;
|
|
147
|
+
assignAt(index: number, elem: bigint): void;
|
|
148
|
+
erase(index: number): void;
|
|
149
|
+
}
|
|
150
|
+
export declare class BoolListNative {
|
|
151
|
+
private readonly [ptrSym];
|
|
152
|
+
static _create(ptr: number): BoolListNative;
|
|
153
|
+
protected _destructor(): void;
|
|
154
|
+
constructor();
|
|
155
|
+
pushBack(elem: boolean): void;
|
|
156
|
+
count(): number;
|
|
157
|
+
nth(index: number): boolean;
|
|
158
|
+
assignAt(index: number, elem: boolean): void;
|
|
159
|
+
erase(index: number): void;
|
|
107
160
|
}
|
|
161
|
+
declare const _DbModeIntToKey: readonly ["pruned", "normal", "full_indexed"];
|
|
162
|
+
export declare type DbMode = (typeof _DbModeIntToKey)[number];
|
|
163
|
+
export declare function DbModeToInt(value: DbMode): number;
|
|
164
|
+
export declare function DbModeFromInt(value: number): DbMode;
|
|
108
165
|
export declare class HdChainCodeNative {
|
|
109
166
|
private readonly [ptrSym];
|
|
167
|
+
private constructor();
|
|
110
168
|
static _create(ptr: number): HdChainCodeNative;
|
|
111
169
|
get data(): number;
|
|
112
170
|
protected _destructor(): void;
|
|
113
171
|
}
|
|
114
172
|
export declare class HdKeyNative {
|
|
115
173
|
private readonly [ptrSym];
|
|
174
|
+
private constructor();
|
|
116
175
|
static _create(ptr: number): HdKeyNative;
|
|
117
176
|
get data(): number;
|
|
118
177
|
protected _destructor(): void;
|
|
119
178
|
}
|
|
120
179
|
export declare class EcCompressedNative {
|
|
121
180
|
private readonly [ptrSym];
|
|
181
|
+
private constructor();
|
|
122
182
|
static _create(ptr: number): EcCompressedNative;
|
|
123
183
|
get data(): number;
|
|
124
184
|
protected _destructor(): void;
|
|
125
185
|
}
|
|
126
186
|
export declare class EcUncompressedNative {
|
|
127
187
|
private readonly [ptrSym];
|
|
188
|
+
private constructor();
|
|
128
189
|
static _create(ptr: number): EcUncompressedNative;
|
|
129
190
|
get data(): number;
|
|
130
191
|
protected _destructor(): void;
|
|
@@ -139,12 +200,14 @@ export declare class EcSecretNative {
|
|
|
139
200
|
}
|
|
140
201
|
export declare class WifUncompressedNative {
|
|
141
202
|
private readonly [ptrSym];
|
|
203
|
+
private constructor();
|
|
142
204
|
static _create(ptr: number): WifUncompressedNative;
|
|
143
205
|
get data(): number;
|
|
144
206
|
protected _destructor(): void;
|
|
145
207
|
}
|
|
146
208
|
export declare class WifCompressedNative {
|
|
147
209
|
private readonly [ptrSym];
|
|
210
|
+
private constructor();
|
|
148
211
|
static _create(ptr: number): WifCompressedNative;
|
|
149
212
|
get data(): number;
|
|
150
213
|
protected _destructor(): void;
|
|
@@ -157,123 +220,219 @@ export declare class HdLineageNative {
|
|
|
157
220
|
get parent_fingerprint(): number;
|
|
158
221
|
get child_number(): number;
|
|
159
222
|
protected _destructor(): void;
|
|
223
|
+
constructor(prefixes: bigint, depth: number, parent_fingerprint: number, child_number: number);
|
|
160
224
|
}
|
|
161
225
|
export declare class EllipticCurveNative {
|
|
162
|
-
static secretToPublic(
|
|
226
|
+
static secretToPublic(secret: Uint8Array): [boolean, Uint8Array];
|
|
163
227
|
}
|
|
164
228
|
export declare class HdPublicNative {
|
|
165
229
|
private readonly [ptrSym];
|
|
230
|
+
private constructor();
|
|
166
231
|
static _create(ptr: number): HdPublicNative;
|
|
167
232
|
protected _destructor(): void;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
encoded
|
|
172
|
-
|
|
233
|
+
copy(): HdPublicNative;
|
|
234
|
+
static toPrefix(prefixes: bigint): number;
|
|
235
|
+
static parseFrom(encoded: string): HdPublicNative;
|
|
236
|
+
static parseFromWithPrefix(encoded: string, prefix: number): HdPublicNative;
|
|
237
|
+
static fromHdKey(key: Uint8Array): HdPublicNative;
|
|
238
|
+
static fromHdKeyWithPrefix(key: Uint8Array, prefix: number): HdPublicNative;
|
|
239
|
+
static fromSecret(secret: HashNative, chain_code: HashNative, lineage: HdLineageNative): HdPublicNative;
|
|
240
|
+
static fromVerifiedComponents(point: Uint8Array, chain_code: HashNative, lineage: HdLineageNative): HdPublicNative;
|
|
241
|
+
equals(other: HdPublicNative): boolean;
|
|
242
|
+
notEqual(other: HdPublicNative): boolean;
|
|
243
|
+
less(x: HdPublicNative): boolean;
|
|
244
|
+
greater(x: HdPublicNative): boolean;
|
|
245
|
+
lessOrEqual(x: HdPublicNative): boolean;
|
|
246
|
+
greaterOrEqual(x: HdPublicNative): boolean;
|
|
247
|
+
toStr(): string;
|
|
248
|
+
chainCode(): HashNative;
|
|
173
249
|
lineage(): HdLineageNative;
|
|
174
|
-
point():
|
|
175
|
-
toHdKey():
|
|
250
|
+
point(): Uint8Array;
|
|
251
|
+
toHdKey(): Uint8Array;
|
|
176
252
|
derivePublic(index: number): HdPublicNative;
|
|
253
|
+
derivePath(path: string): HdPublicNative;
|
|
254
|
+
fingerprint(): number;
|
|
255
|
+
wipe(): void;
|
|
177
256
|
}
|
|
178
257
|
export declare class HdPrivateNative {
|
|
179
258
|
private readonly [ptrSym];
|
|
259
|
+
private constructor();
|
|
180
260
|
static _create(ptr: number): HdPrivateNative;
|
|
181
261
|
protected _destructor(): void;
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
encoded
|
|
187
|
-
|
|
188
|
-
|
|
262
|
+
copy(): HdPrivateNative;
|
|
263
|
+
static toPrefix(prefixes: bigint): number;
|
|
264
|
+
static parseFrom(encoded: string): HdPrivateNative;
|
|
265
|
+
static parseFromWithPublicPrefix(encoded: string, public_prefix: number): HdPrivateNative;
|
|
266
|
+
static parseFromWithPrefixes(encoded: string, prefixes: bigint): HdPrivateNative;
|
|
267
|
+
static fromSeed(seed: Uint8Array, prefixes: bigint): HdPrivateNative;
|
|
268
|
+
static fromHdKey(private_key: Uint8Array): HdPrivateNative;
|
|
269
|
+
static fromHdKeyWithPublicPrefix(private_key: Uint8Array, public_prefix: number): HdPrivateNative;
|
|
270
|
+
static fromHdKeyWithPrefixes(private_key: Uint8Array, prefixes: bigint): HdPrivateNative;
|
|
271
|
+
static fromVerifiedParts(base: HdPublicNative, secret: HashNative): HdPrivateNative;
|
|
272
|
+
equals(other: HdPrivateNative): boolean;
|
|
273
|
+
notEqual(other: HdPrivateNative): boolean;
|
|
274
|
+
less(x: HdPrivateNative): boolean;
|
|
275
|
+
greater(x: HdPrivateNative): boolean;
|
|
276
|
+
lessOrEqual(x: HdPrivateNative): boolean;
|
|
277
|
+
greaterOrEqual(x: HdPrivateNative): boolean;
|
|
278
|
+
secret(): HashNative;
|
|
279
|
+
publicKey(): HdPublicNative;
|
|
280
|
+
chainCode(): HashNative;
|
|
189
281
|
lineage(): HdLineageNative;
|
|
190
|
-
point():
|
|
191
|
-
|
|
282
|
+
point(): Uint8Array;
|
|
283
|
+
toStr(): string;
|
|
284
|
+
toHdKey(): Uint8Array;
|
|
192
285
|
toPublic(): HdPublicNative;
|
|
193
286
|
derivePrivate(index: number): HdPrivateNative;
|
|
287
|
+
derivePath(path: string): HdPrivateNative;
|
|
288
|
+
static fromSeedAndPath(seed: Uint8Array, path: string, prefixes: bigint): HdPrivateNative;
|
|
194
289
|
derivePublic(index: number): HdPublicNative;
|
|
195
|
-
|
|
196
|
-
export declare class PaymentAddressListNative {
|
|
197
|
-
private readonly [ptrSym];
|
|
198
|
-
static _create(ptr: number): PaymentAddressListNative;
|
|
199
|
-
protected _destructor(): void;
|
|
200
|
-
constructor();
|
|
201
|
-
pushBack(utxo: PaymentAddressNative): void;
|
|
202
|
-
count(): number;
|
|
203
|
-
nth(index: number): PaymentAddressNative;
|
|
290
|
+
wipe(): void;
|
|
204
291
|
}
|
|
205
292
|
export declare class PaymentAddressNative {
|
|
206
293
|
private readonly [ptrSym];
|
|
294
|
+
private constructor();
|
|
207
295
|
static _create(ptr: number): PaymentAddressNative;
|
|
208
296
|
protected _destructor(): void;
|
|
209
|
-
|
|
210
|
-
static
|
|
211
|
-
static
|
|
297
|
+
copy(): PaymentAddressNative;
|
|
298
|
+
static cashaddrPrefixFor(net: Network): string;
|
|
299
|
+
static parseFromSimple(address: string): PaymentAddressNative;
|
|
300
|
+
static parseFrom(address: string, net: Network): PaymentAddressNative;
|
|
301
|
+
static fromPayment(decoded: Uint8Array): PaymentAddressNative;
|
|
302
|
+
static fromEcPrivate(secret: EcPrivateNative): PaymentAddressNative;
|
|
303
|
+
static fromEcPublic(point: EcPublicNative, version: number): PaymentAddressNative;
|
|
212
304
|
static fromScript(script: ScriptNative, version: number): PaymentAddressNative;
|
|
213
305
|
static fromPayPublicKeyHashScript(script: ScriptNative, version: number): PaymentAddressNative;
|
|
306
|
+
static fromShorthash(hash: ShortHashNative, version: number): PaymentAddressNative;
|
|
307
|
+
static fromHash(hash: HashNative, version: number): PaymentAddressNative;
|
|
308
|
+
static isSupportedVersion(version: number): boolean;
|
|
309
|
+
equals(other: PaymentAddressNative): boolean;
|
|
310
|
+
notEqual(other: PaymentAddressNative): boolean;
|
|
311
|
+
less(x: PaymentAddressNative): boolean;
|
|
312
|
+
greater(x: PaymentAddressNative): boolean;
|
|
313
|
+
lessOrEqual(x: PaymentAddressNative): boolean;
|
|
314
|
+
greaterOrEqual(x: PaymentAddressNative): boolean;
|
|
315
|
+
toStr(): string;
|
|
214
316
|
encodedLegacy(): string;
|
|
215
|
-
|
|
317
|
+
encodedCashaddr(token_aware: boolean): string;
|
|
318
|
+
encodedToken(): string;
|
|
319
|
+
version(): number;
|
|
320
|
+
hashSpan(): Uint8Array;
|
|
216
321
|
hash20(): ShortHashNative;
|
|
217
322
|
hash32(): HashNative;
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
static
|
|
221
|
-
static
|
|
222
|
-
|
|
323
|
+
toPayment(): Uint8Array;
|
|
324
|
+
static extract(script: ScriptNative, p2kh_version: number, p2sh_version: number): PaymentAddressListNative;
|
|
325
|
+
static extractInput(script: ScriptNative, p2kh_version: number, p2sh_version: number): PaymentAddressListNative;
|
|
326
|
+
static extractOutput(script: ScriptNative, p2kh_version: number, p2sh_version: number): PaymentAddressListNative;
|
|
327
|
+
}
|
|
328
|
+
export declare class PaymentAddressListNative {
|
|
329
|
+
private readonly [ptrSym];
|
|
330
|
+
static _create(ptr: number): PaymentAddressListNative;
|
|
331
|
+
protected _destructor(): void;
|
|
332
|
+
constructor();
|
|
333
|
+
pushBack(elem: PaymentAddressNative): void;
|
|
334
|
+
count(): number;
|
|
335
|
+
nth(index: number): PaymentAddressNative;
|
|
336
|
+
assignAt(index: number, elem: PaymentAddressNative): void;
|
|
337
|
+
erase(index: number): void;
|
|
223
338
|
}
|
|
224
339
|
export declare class EcPrivateNative {
|
|
225
340
|
private readonly [ptrSym];
|
|
341
|
+
private constructor();
|
|
226
342
|
static _create(ptr: number): EcPrivateNative;
|
|
227
343
|
protected _destructor(): void;
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
secret
|
|
344
|
+
copy(): EcPrivateNative;
|
|
345
|
+
static toAddressPrefix(version: number): number;
|
|
346
|
+
static toWifPrefix(version: number): number;
|
|
347
|
+
static toVersion(address: number, wif: number): number;
|
|
348
|
+
static parseFrom(wif: string, version: number): EcPrivateNative;
|
|
349
|
+
static fromCompressed(wif: Uint8Array, address_version: number): EcPrivateNative;
|
|
350
|
+
static fromUncompressed(wif: Uint8Array, address_version: number): EcPrivateNative;
|
|
351
|
+
static fromSecret(secret: HashNative, version: number, compress: boolean): EcPrivateNative;
|
|
352
|
+
static fromVerifiedSecret(secret: HashNative, version: number, compress: boolean): EcPrivateNative;
|
|
353
|
+
equals(other: EcPrivateNative): boolean;
|
|
354
|
+
notEqual(other: EcPrivateNative): boolean;
|
|
355
|
+
less(x: EcPrivateNative): boolean;
|
|
356
|
+
greater(x: EcPrivateNative): boolean;
|
|
357
|
+
lessOrEqual(x: EcPrivateNative): boolean;
|
|
358
|
+
greaterOrEqual(x: EcPrivateNative): boolean;
|
|
359
|
+
value(): HashNative;
|
|
360
|
+
secret(): HashNative;
|
|
236
361
|
version(): number;
|
|
237
362
|
paymentVersion(): number;
|
|
238
363
|
wifVersion(): number;
|
|
239
364
|
compressed(): boolean;
|
|
365
|
+
toStr(): string;
|
|
240
366
|
toPublic(): EcPublicNative;
|
|
241
367
|
toPaymentAddress(): PaymentAddressNative;
|
|
242
368
|
}
|
|
243
369
|
export declare class EcPublicNative {
|
|
244
370
|
private readonly [ptrSym];
|
|
371
|
+
private constructor();
|
|
245
372
|
static _create(ptr: number): EcPublicNative;
|
|
246
373
|
protected _destructor(): void;
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
374
|
+
static fromData(decoded: Uint8Array): EcPublicNative;
|
|
375
|
+
copy(): EcPublicNative;
|
|
376
|
+
static parseFrom(base16: string): EcPublicNative;
|
|
377
|
+
static fromPrivate(secret: EcPrivateNative): EcPublicNative;
|
|
378
|
+
static fromPoint(point: Uint8Array, compress: boolean): EcPublicNative;
|
|
379
|
+
static fromVerifiedPoint(point: Uint8Array, compress: boolean): EcPublicNative;
|
|
380
|
+
equals(other: EcPublicNative): boolean;
|
|
381
|
+
notEqual(other: EcPublicNative): boolean;
|
|
382
|
+
less(x: EcPublicNative): boolean;
|
|
383
|
+
greater(x: EcPublicNative): boolean;
|
|
384
|
+
lessOrEqual(x: EcPublicNative): boolean;
|
|
385
|
+
greaterOrEqual(x: EcPublicNative): boolean;
|
|
386
|
+
value(): Uint8Array;
|
|
387
|
+
point(): Uint8Array;
|
|
254
388
|
compressed(): boolean;
|
|
389
|
+
toStr(): string;
|
|
390
|
+
encoded(): string;
|
|
255
391
|
toData(): Uint8Array;
|
|
256
|
-
toUncompressed(
|
|
392
|
+
toUncompressed(): Uint8Array;
|
|
257
393
|
toPaymentAddress(version: number): PaymentAddressNative;
|
|
258
394
|
}
|
|
395
|
+
export declare class EcCompressedListNative {
|
|
396
|
+
private readonly [ptrSym];
|
|
397
|
+
static _create(ptr: number): EcCompressedListNative;
|
|
398
|
+
protected _destructor(): void;
|
|
399
|
+
constructor();
|
|
400
|
+
pushBack(elem: Uint8Array): void;
|
|
401
|
+
count(): number;
|
|
402
|
+
nth(index: number): Uint8Array;
|
|
403
|
+
}
|
|
404
|
+
export declare class DataStackNative {
|
|
405
|
+
private readonly [ptrSym];
|
|
406
|
+
static _create(ptr: number): DataStackNative;
|
|
407
|
+
protected _destructor(): void;
|
|
408
|
+
constructor();
|
|
409
|
+
copy(): DataStackNative;
|
|
410
|
+
count(): number;
|
|
411
|
+
pushBack(data: Uint8Array): void;
|
|
412
|
+
nth(index: number): Uint8Array;
|
|
413
|
+
nthCopy(index: number): Uint8Array;
|
|
414
|
+
erase(index: number): void;
|
|
415
|
+
}
|
|
259
416
|
export declare class WalletNative {
|
|
260
417
|
static mnemonicsToSeed(mnemonics: StringListNative): LongHashNative;
|
|
261
|
-
static
|
|
262
|
-
static hdPrivateToEc(key: HdPrivateNative): EcSecretNative;
|
|
263
|
-
static ecToPublic(secret: EcSecretNative, uncompressed: boolean): EcPublicNative;
|
|
264
|
-
static ecToAddress(point: EcPublicNative, version: number): PaymentAddressNative;
|
|
418
|
+
static mnemonicsToSeedNormalizedPassphrase(mnemonics: StringListNative, normalized_passphrase: string): LongHashNative;
|
|
265
419
|
}
|
|
266
420
|
export declare class WalletDataNative {
|
|
267
421
|
private readonly [ptrSym];
|
|
422
|
+
private constructor();
|
|
268
423
|
static _create(ptr: number): WalletDataNative;
|
|
269
424
|
protected _destructor(): void;
|
|
425
|
+
copy(): WalletDataNative;
|
|
270
426
|
mnemonics(): StringListNative;
|
|
271
|
-
|
|
427
|
+
setMnemonics(value: StringListNative): void;
|
|
272
428
|
xpub(): HdPublicNative;
|
|
429
|
+
setXpub(value: HdPublicNative): void;
|
|
430
|
+
encryptedSeed(): Uint8Array;
|
|
431
|
+
setEncryptedSeed(value: Uint8Array): void;
|
|
432
|
+
static create(password: string, normalized_passphrase: string): WalletDataNative;
|
|
273
433
|
}
|
|
274
434
|
export declare class WalletManagerNative {
|
|
275
|
-
static
|
|
276
|
-
static decryptSeed(password: string, encryptedSeed: EncryptedSeedNative): [number, LongHashNative];
|
|
435
|
+
static decryptSeed(password: string, encrypted_seed: Uint8Array): LongHashNative;
|
|
277
436
|
}
|
|
278
437
|
export declare class NodeInfoNative {
|
|
279
438
|
static printThreadId(): void;
|
|
@@ -284,39 +443,295 @@ export declare class NodeInfoNative {
|
|
|
284
443
|
static marchNames(): string;
|
|
285
444
|
static currencySymbol(): string;
|
|
286
445
|
static currency(): string;
|
|
446
|
+
static dbType(mode: DbMode): string;
|
|
287
447
|
static cppapiBuildTimestamp(): number;
|
|
448
|
+
static utxozReferenceMode(): boolean;
|
|
449
|
+
static embeddedBloomAvailable(): boolean;
|
|
450
|
+
static embeddedBloomCheckpointHeight(): number;
|
|
288
451
|
}
|
|
452
|
+
declare const _OpcodeEnumNativeIntToKey: {
|
|
453
|
+
readonly '0': "push_size_0";
|
|
454
|
+
readonly '1': "push_size_1";
|
|
455
|
+
readonly '2': "push_size_2";
|
|
456
|
+
readonly '3': "push_size_3";
|
|
457
|
+
readonly '4': "push_size_4";
|
|
458
|
+
readonly '5': "push_size_5";
|
|
459
|
+
readonly '6': "push_size_6";
|
|
460
|
+
readonly '7': "push_size_7";
|
|
461
|
+
readonly '8': "push_size_8";
|
|
462
|
+
readonly '9': "push_size_9";
|
|
463
|
+
readonly '10': "push_size_10";
|
|
464
|
+
readonly '11': "push_size_11";
|
|
465
|
+
readonly '12': "push_size_12";
|
|
466
|
+
readonly '13': "push_size_13";
|
|
467
|
+
readonly '14': "push_size_14";
|
|
468
|
+
readonly '15': "push_size_15";
|
|
469
|
+
readonly '16': "push_size_16";
|
|
470
|
+
readonly '17': "push_size_17";
|
|
471
|
+
readonly '18': "push_size_18";
|
|
472
|
+
readonly '19': "push_size_19";
|
|
473
|
+
readonly '20': "push_size_20";
|
|
474
|
+
readonly '21': "push_size_21";
|
|
475
|
+
readonly '22': "push_size_22";
|
|
476
|
+
readonly '23': "push_size_23";
|
|
477
|
+
readonly '24': "push_size_24";
|
|
478
|
+
readonly '25': "push_size_25";
|
|
479
|
+
readonly '26': "push_size_26";
|
|
480
|
+
readonly '27': "push_size_27";
|
|
481
|
+
readonly '28': "push_size_28";
|
|
482
|
+
readonly '29': "push_size_29";
|
|
483
|
+
readonly '30': "push_size_30";
|
|
484
|
+
readonly '31': "push_size_31";
|
|
485
|
+
readonly '32': "push_size_32";
|
|
486
|
+
readonly '33': "push_size_33";
|
|
487
|
+
readonly '34': "push_size_34";
|
|
488
|
+
readonly '35': "push_size_35";
|
|
489
|
+
readonly '36': "push_size_36";
|
|
490
|
+
readonly '37': "push_size_37";
|
|
491
|
+
readonly '38': "push_size_38";
|
|
492
|
+
readonly '39': "push_size_39";
|
|
493
|
+
readonly '40': "push_size_40";
|
|
494
|
+
readonly '41': "push_size_41";
|
|
495
|
+
readonly '42': "push_size_42";
|
|
496
|
+
readonly '43': "push_size_43";
|
|
497
|
+
readonly '44': "push_size_44";
|
|
498
|
+
readonly '45': "push_size_45";
|
|
499
|
+
readonly '46': "push_size_46";
|
|
500
|
+
readonly '47': "push_size_47";
|
|
501
|
+
readonly '48': "push_size_48";
|
|
502
|
+
readonly '49': "push_size_49";
|
|
503
|
+
readonly '50': "push_size_50";
|
|
504
|
+
readonly '51': "push_size_51";
|
|
505
|
+
readonly '52': "push_size_52";
|
|
506
|
+
readonly '53': "push_size_53";
|
|
507
|
+
readonly '54': "push_size_54";
|
|
508
|
+
readonly '55': "push_size_55";
|
|
509
|
+
readonly '56': "push_size_56";
|
|
510
|
+
readonly '57': "push_size_57";
|
|
511
|
+
readonly '58': "push_size_58";
|
|
512
|
+
readonly '59': "push_size_59";
|
|
513
|
+
readonly '60': "push_size_60";
|
|
514
|
+
readonly '61': "push_size_61";
|
|
515
|
+
readonly '62': "push_size_62";
|
|
516
|
+
readonly '63': "push_size_63";
|
|
517
|
+
readonly '64': "push_size_64";
|
|
518
|
+
readonly '65': "push_size_65";
|
|
519
|
+
readonly '66': "push_size_66";
|
|
520
|
+
readonly '67': "push_size_67";
|
|
521
|
+
readonly '68': "push_size_68";
|
|
522
|
+
readonly '69': "push_size_69";
|
|
523
|
+
readonly '70': "push_size_70";
|
|
524
|
+
readonly '71': "push_size_71";
|
|
525
|
+
readonly '72': "push_size_72";
|
|
526
|
+
readonly '73': "push_size_73";
|
|
527
|
+
readonly '74': "push_size_74";
|
|
528
|
+
readonly '75': "push_size_75";
|
|
529
|
+
readonly '76': "push_one_size";
|
|
530
|
+
readonly '77': "push_two_size";
|
|
531
|
+
readonly '78': "push_four_size";
|
|
532
|
+
readonly '79': "push_negative_1";
|
|
533
|
+
readonly '80': "reserved_80";
|
|
534
|
+
readonly '81': "push_positive_1";
|
|
535
|
+
readonly '82': "push_positive_2";
|
|
536
|
+
readonly '83': "push_positive_3";
|
|
537
|
+
readonly '84': "push_positive_4";
|
|
538
|
+
readonly '85': "push_positive_5";
|
|
539
|
+
readonly '86': "push_positive_6";
|
|
540
|
+
readonly '87': "push_positive_7";
|
|
541
|
+
readonly '88': "push_positive_8";
|
|
542
|
+
readonly '89': "push_positive_9";
|
|
543
|
+
readonly '90': "push_positive_10";
|
|
544
|
+
readonly '91': "push_positive_11";
|
|
545
|
+
readonly '92': "push_positive_12";
|
|
546
|
+
readonly '93': "push_positive_13";
|
|
547
|
+
readonly '94': "push_positive_14";
|
|
548
|
+
readonly '95': "push_positive_15";
|
|
549
|
+
readonly '96': "push_positive_16";
|
|
550
|
+
readonly '97': "nop";
|
|
551
|
+
readonly '98': "reserved_98";
|
|
552
|
+
readonly '99': "if_";
|
|
553
|
+
readonly '100': "notif";
|
|
554
|
+
readonly '101': "op_begin";
|
|
555
|
+
readonly '102': "op_until";
|
|
556
|
+
readonly '103': "else_";
|
|
557
|
+
readonly '104': "endif";
|
|
558
|
+
readonly '105': "verify";
|
|
559
|
+
readonly '106': "return_";
|
|
560
|
+
readonly '107': "toaltstack";
|
|
561
|
+
readonly '108': "fromaltstack";
|
|
562
|
+
readonly '109': "drop2";
|
|
563
|
+
readonly '110': "dup2";
|
|
564
|
+
readonly '111': "dup3";
|
|
565
|
+
readonly '112': "over2";
|
|
566
|
+
readonly '113': "rot2";
|
|
567
|
+
readonly '114': "swap2";
|
|
568
|
+
readonly '115': "ifdup";
|
|
569
|
+
readonly '116': "depth";
|
|
570
|
+
readonly '117': "drop";
|
|
571
|
+
readonly '118': "dup";
|
|
572
|
+
readonly '119': "nip";
|
|
573
|
+
readonly '120': "over";
|
|
574
|
+
readonly '121': "pick";
|
|
575
|
+
readonly '122': "roll";
|
|
576
|
+
readonly '123': "rot";
|
|
577
|
+
readonly '124': "swap";
|
|
578
|
+
readonly '125': "tuck";
|
|
579
|
+
readonly '126': "cat";
|
|
580
|
+
readonly '127': "split";
|
|
581
|
+
readonly '128': "num2bin";
|
|
582
|
+
readonly '129': "bin2num";
|
|
583
|
+
readonly '130': "size";
|
|
584
|
+
readonly '131': "op_invert";
|
|
585
|
+
readonly '132': "and_";
|
|
586
|
+
readonly '133': "or_";
|
|
587
|
+
readonly '134': "xor_";
|
|
588
|
+
readonly '135': "equal";
|
|
589
|
+
readonly '136': "equalverify";
|
|
590
|
+
readonly '137': "op_define";
|
|
591
|
+
readonly '138': "op_invoke";
|
|
592
|
+
readonly '139': "add1";
|
|
593
|
+
readonly '140': "sub1";
|
|
594
|
+
readonly '141': "op_lshiftnum";
|
|
595
|
+
readonly '142': "op_rshiftnum";
|
|
596
|
+
readonly '143': "negate";
|
|
597
|
+
readonly '144': "abs";
|
|
598
|
+
readonly '145': "not_";
|
|
599
|
+
readonly '146': "nonzero";
|
|
600
|
+
readonly '147': "add";
|
|
601
|
+
readonly '148': "sub";
|
|
602
|
+
readonly '149': "mul";
|
|
603
|
+
readonly '150': "div";
|
|
604
|
+
readonly '151': "mod";
|
|
605
|
+
readonly '152': "op_lshiftbin";
|
|
606
|
+
readonly '153': "op_rshiftbin";
|
|
607
|
+
readonly '154': "booland";
|
|
608
|
+
readonly '155': "boolor";
|
|
609
|
+
readonly '156': "numequal";
|
|
610
|
+
readonly '157': "numequalverify";
|
|
611
|
+
readonly '158': "numnotequal";
|
|
612
|
+
readonly '159': "lessthan";
|
|
613
|
+
readonly '160': "greaterthan";
|
|
614
|
+
readonly '161': "lessthanorequal";
|
|
615
|
+
readonly '162': "greaterthanorequal";
|
|
616
|
+
readonly '163': "min";
|
|
617
|
+
readonly '164': "max";
|
|
618
|
+
readonly '165': "within";
|
|
619
|
+
readonly '166': "ripemd160";
|
|
620
|
+
readonly '167': "sha1";
|
|
621
|
+
readonly '168': "sha256";
|
|
622
|
+
readonly '169': "hash160";
|
|
623
|
+
readonly '170': "hash256";
|
|
624
|
+
readonly '171': "codeseparator";
|
|
625
|
+
readonly '172': "checksig";
|
|
626
|
+
readonly '173': "checksigverify";
|
|
627
|
+
readonly '174': "checkmultisig";
|
|
628
|
+
readonly '175': "checkmultisigverify";
|
|
629
|
+
readonly '176': "nop1";
|
|
630
|
+
readonly '177': "nop2";
|
|
631
|
+
readonly '178': "nop3";
|
|
632
|
+
readonly '179': "nop4";
|
|
633
|
+
readonly '180': "nop5";
|
|
634
|
+
readonly '181': "nop6";
|
|
635
|
+
readonly '182': "nop7";
|
|
636
|
+
readonly '183': "nop8";
|
|
637
|
+
readonly '184': "nop9";
|
|
638
|
+
readonly '185': "nop10";
|
|
639
|
+
readonly '186': "checkdatasig";
|
|
640
|
+
readonly '187': "checkdatasigverify";
|
|
641
|
+
readonly '188': "reverse_bytes";
|
|
642
|
+
readonly '192': "input_index";
|
|
643
|
+
readonly '193': "active_bytecode";
|
|
644
|
+
readonly '194': "tx_version";
|
|
645
|
+
readonly '195': "tx_input_count";
|
|
646
|
+
readonly '196': "tx_output_count";
|
|
647
|
+
readonly '197': "tx_locktime";
|
|
648
|
+
readonly '198': "utxo_value";
|
|
649
|
+
readonly '199': "utxo_bytecode";
|
|
650
|
+
readonly '200': "outpoint_tx_hash";
|
|
651
|
+
readonly '201': "outpoint_index";
|
|
652
|
+
readonly '202': "input_bytecode";
|
|
653
|
+
readonly '203': "input_sequence_number";
|
|
654
|
+
readonly '204': "output_value";
|
|
655
|
+
readonly '205': "output_bytecode";
|
|
656
|
+
readonly '206': "utxo_token_category";
|
|
657
|
+
readonly '207': "utxo_token_commitment";
|
|
658
|
+
readonly '208': "utxo_token_amount";
|
|
659
|
+
readonly '209': "output_token_category";
|
|
660
|
+
readonly '210': "output_token_commitment";
|
|
661
|
+
readonly '211': "output_token_amount";
|
|
662
|
+
readonly '212': "reserved_212";
|
|
663
|
+
readonly '213': "reserved_213";
|
|
664
|
+
readonly '214': "reserved_214";
|
|
665
|
+
readonly '215': "reserved_215";
|
|
666
|
+
readonly '216': "reserved_216";
|
|
667
|
+
readonly '217': "reserved_217";
|
|
668
|
+
readonly '218': "reserved_218";
|
|
669
|
+
readonly '219': "reserved_219";
|
|
670
|
+
readonly '220': "reserved_220";
|
|
671
|
+
readonly '221': "reserved_221";
|
|
672
|
+
readonly '222': "reserved_222";
|
|
673
|
+
readonly '223': "reserved_223";
|
|
674
|
+
readonly '224': "reserved_224";
|
|
675
|
+
readonly '225': "reserved_225";
|
|
676
|
+
readonly '226': "reserved_226";
|
|
677
|
+
readonly '227': "reserved_227";
|
|
678
|
+
readonly '228': "reserved_228";
|
|
679
|
+
readonly '229': "reserved_229";
|
|
680
|
+
readonly '230': "reserved_230";
|
|
681
|
+
readonly '231': "reserved_231";
|
|
682
|
+
readonly '232': "reserved_232";
|
|
683
|
+
readonly '233': "reserved_233";
|
|
684
|
+
readonly '234': "reserved_234";
|
|
685
|
+
readonly '235': "reserved_235";
|
|
686
|
+
readonly '236': "reserved_236";
|
|
687
|
+
readonly '237': "reserved_237";
|
|
688
|
+
readonly '238': "reserved_238";
|
|
689
|
+
readonly '239': "reserved_239";
|
|
690
|
+
readonly '240': "reserved_240";
|
|
691
|
+
readonly '241': "reserved_241";
|
|
692
|
+
readonly '242': "reserved_242";
|
|
693
|
+
readonly '243': "reserved_243";
|
|
694
|
+
readonly '244': "reserved_244";
|
|
695
|
+
readonly '245': "reserved_245";
|
|
696
|
+
readonly '246': "reserved_246";
|
|
697
|
+
readonly '247': "reserved_247";
|
|
698
|
+
readonly '248': "reserved_248";
|
|
699
|
+
readonly '249': "reserved_249";
|
|
700
|
+
readonly '250': "reserved_250";
|
|
701
|
+
readonly '251': "reserved_251";
|
|
702
|
+
readonly '252': "reserved_252";
|
|
703
|
+
readonly '253': "reserved_253";
|
|
704
|
+
readonly '254': "reserved_254";
|
|
705
|
+
readonly '255': "reserved_255";
|
|
706
|
+
};
|
|
707
|
+
export declare type OpcodeEnumNative = (typeof _OpcodeEnumNativeIntToKey)[keyof typeof _OpcodeEnumNativeIntToKey];
|
|
708
|
+
export declare function OpcodeEnumNativeToInt(value: OpcodeEnumNative): number;
|
|
709
|
+
export declare function OpcodeEnumNativeFromInt(value: number): OpcodeEnumNative;
|
|
289
710
|
export declare class OpcodeNative {
|
|
290
|
-
static
|
|
291
|
-
static
|
|
292
|
-
static
|
|
293
|
-
static
|
|
711
|
+
static toStr(value: OpcodeEnumNative, active_flags: bigint): string;
|
|
712
|
+
static fromStr(value: string): [boolean, OpcodeEnumNative];
|
|
713
|
+
static toHexadecimal(code: OpcodeEnumNative): string;
|
|
714
|
+
static fromHexadecimal(value: string): [boolean, OpcodeEnumNative];
|
|
294
715
|
}
|
|
295
716
|
export declare class OperationNative {
|
|
296
717
|
private readonly [ptrSym];
|
|
297
718
|
static _create(ptr: number): OperationNative;
|
|
298
719
|
protected _destructor(): void;
|
|
299
720
|
constructor();
|
|
300
|
-
constructor(
|
|
301
|
-
constructor(
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
721
|
+
constructor(code: OpcodeEnumNative);
|
|
722
|
+
constructor(uncoded: Uint8Array, minimal: boolean);
|
|
723
|
+
static fromData(data: Uint8Array): OperationNative;
|
|
724
|
+
copy(): OperationNative;
|
|
725
|
+
equals(other: OperationNative): boolean;
|
|
726
|
+
notEqual(other: OperationNative): boolean;
|
|
727
|
+
fromStr(mnemonic: string): boolean;
|
|
306
728
|
isValid(): boolean;
|
|
729
|
+
toDataSimple(): Uint8Array;
|
|
730
|
+
toData(): Uint8Array;
|
|
731
|
+
toStr(active_flags: bigint): string;
|
|
307
732
|
serializedSize(): number;
|
|
308
733
|
code(): OpcodeEnumNative;
|
|
309
734
|
data(): Uint8Array;
|
|
310
|
-
isPush(): boolean;
|
|
311
|
-
isCounted(): boolean;
|
|
312
|
-
isVersion(): boolean;
|
|
313
|
-
isPositive(): boolean;
|
|
314
|
-
isDisabled(activeForks: number): boolean;
|
|
315
|
-
isConditional(): boolean;
|
|
316
|
-
isRelaxedPush(): boolean;
|
|
317
|
-
isOversized(maxSize: number): boolean;
|
|
318
|
-
isMinimalPush(): boolean;
|
|
319
|
-
isNominalPush(): boolean;
|
|
320
735
|
static opcodeFromSize(size: number): OpcodeEnumNative;
|
|
321
736
|
static minimalOpcodeFromData(data: Uint8Array): OpcodeEnumNative;
|
|
322
737
|
static nominalOpcodeFromData(data: Uint8Array): OpcodeEnumNative;
|
|
@@ -329,42 +744,65 @@ export declare class OperationNative {
|
|
|
329
744
|
static opcodeIsNumeric(code: OpcodeEnumNative): boolean;
|
|
330
745
|
static opcodeIsPositive(code: OpcodeEnumNative): boolean;
|
|
331
746
|
static opcodeIsReserved(code: OpcodeEnumNative): boolean;
|
|
332
|
-
static opcodeIsDisabled(code: OpcodeEnumNative,
|
|
747
|
+
static opcodeIsDisabled(code: OpcodeEnumNative, active_flags: bigint): boolean;
|
|
333
748
|
static opcodeIsConditional(code: OpcodeEnumNative): boolean;
|
|
334
749
|
static opcodeIsRelaxedPush(code: OpcodeEnumNative): boolean;
|
|
750
|
+
isPush(): boolean;
|
|
751
|
+
isCounted(): boolean;
|
|
752
|
+
isVersion(): boolean;
|
|
753
|
+
isPositive(): boolean;
|
|
754
|
+
isDisabled(active_flags: bigint): boolean;
|
|
755
|
+
isConditional(): boolean;
|
|
756
|
+
isRelaxedPush(): boolean;
|
|
757
|
+
isOversized(max_size: number): boolean;
|
|
758
|
+
isMinimalPush(): boolean;
|
|
759
|
+
isNominalPush(): boolean;
|
|
335
760
|
}
|
|
336
761
|
export declare class OperationListNative {
|
|
337
762
|
private readonly [ptrSym];
|
|
338
763
|
static _create(ptr: number): OperationListNative;
|
|
339
764
|
protected _destructor(): void;
|
|
340
765
|
constructor();
|
|
341
|
-
pushBack(
|
|
766
|
+
pushBack(elem: OperationNative): void;
|
|
342
767
|
count(): number;
|
|
343
768
|
nth(index: number): OperationNative;
|
|
769
|
+
assignAt(index: number, elem: OperationNative): void;
|
|
770
|
+
erase(index: number): void;
|
|
344
771
|
}
|
|
345
|
-
declare const _ScriptPatternIntToKey: readonly ["null_data", "
|
|
772
|
+
declare const _ScriptPatternIntToKey: readonly ["null_data", "pay_to_multisig", "pay_to_public_key", "pay_to_public_key_hash", "pay_to_script_hash", "pay_to_script_hash_32", "pay_to_script", "sign_multisig", "sign_public_key", "sign_public_key_hash", "sign_script_hash", "witness_reservation", "non_standard"];
|
|
346
773
|
export declare type ScriptPattern = (typeof _ScriptPatternIntToKey)[number];
|
|
347
774
|
export declare function ScriptPatternToInt(value: ScriptPattern): number;
|
|
775
|
+
export declare function ScriptPatternFromInt(value: number): ScriptPattern;
|
|
348
776
|
declare const _EndorsementTypeIntToKey: readonly ["ecdsa", "schnorr"];
|
|
349
777
|
export declare type EndorsementType = (typeof _EndorsementTypeIntToKey)[number];
|
|
350
778
|
export declare function EndorsementTypeToInt(value: EndorsementType): number;
|
|
779
|
+
export declare function EndorsementTypeFromInt(value: number): EndorsementType;
|
|
351
780
|
export declare class ScriptNative {
|
|
352
781
|
private readonly [ptrSym];
|
|
353
782
|
static _create(ptr: number): ScriptNative;
|
|
354
783
|
protected _destructor(): void;
|
|
355
784
|
constructor();
|
|
356
|
-
constructor(
|
|
357
|
-
constructor(operations: OperationListNative);
|
|
785
|
+
constructor(ops: OperationListNative);
|
|
358
786
|
constructor(encoded: Uint8Array, prefix: boolean);
|
|
787
|
+
static fromData(data: Uint8Array, prefix: boolean): ScriptNative;
|
|
788
|
+
copy(): ScriptNative;
|
|
789
|
+
equals(other: ScriptNative): boolean;
|
|
790
|
+
notEqual(other: ScriptNative): boolean;
|
|
791
|
+
static fromDataWithSize(data: Uint8Array, size: number): ScriptNative;
|
|
792
|
+
fromOperations(ops: OperationListNative): void;
|
|
793
|
+
fromStr(mnemonic: string): boolean;
|
|
359
794
|
isValid(): boolean;
|
|
360
795
|
isValidOperations(): boolean;
|
|
361
|
-
satoshiContentSize(): number;
|
|
362
|
-
serializedSize(prefix: boolean): number;
|
|
363
|
-
toStr(activeForks: number): string;
|
|
364
|
-
type(): string;
|
|
365
796
|
toData(prefix: boolean): Uint8Array;
|
|
797
|
+
toStr(active_flags: bigint): string;
|
|
798
|
+
serializedSize(prefix: boolean): number;
|
|
799
|
+
bytes(): Uint8Array;
|
|
366
800
|
operations(): OperationListNative;
|
|
367
|
-
|
|
801
|
+
firstOperation(): OperationNative;
|
|
802
|
+
static generateSignatureHash(tx: TransactionNative, input_index: number, script_code: ScriptNative, sighash_type: number, active_flags: bigint, value: bigint): [HashNative, number];
|
|
803
|
+
static checkSignature(signature: LongHashNative, sighash_type: number, public_key: Uint8Array, script_code: ScriptNative, tx: TransactionNative, input_index: number, active_flags: bigint, value: bigint): [boolean, number];
|
|
804
|
+
static createEndorsement(secret: HashNative, prevout_script: ScriptNative, tx: TransactionNative, input_index: number, sighash_type: number, active_flags: bigint, value: bigint, type: EndorsementType): Uint8Array;
|
|
805
|
+
static isEnabled(active_flags: bigint, fork: bigint): boolean;
|
|
368
806
|
static isPushOnly(ops: OperationListNative): boolean;
|
|
369
807
|
static isRelaxedPush(ops: OperationListNative): boolean;
|
|
370
808
|
static isCoinbasePattern(ops: OperationListNative, height: number): boolean;
|
|
@@ -373,174 +811,457 @@ export declare class ScriptNative {
|
|
|
373
811
|
static isPayPublicKeyPattern(ops: OperationListNative): boolean;
|
|
374
812
|
static isPayPublicKeyHashPattern(ops: OperationListNative): boolean;
|
|
375
813
|
static isPayScriptHashPattern(ops: OperationListNative): boolean;
|
|
814
|
+
static isPayScriptHash32Pattern(ops: OperationListNative): boolean;
|
|
376
815
|
static isSignMultisigPattern(ops: OperationListNative): boolean;
|
|
377
816
|
static isSignPublicKeyPattern(ops: OperationListNative): boolean;
|
|
378
817
|
static isSignPublicKeyHashPattern(ops: OperationListNative): boolean;
|
|
379
818
|
static isSignScriptHashPattern(ops: OperationListNative): boolean;
|
|
380
|
-
static toNullDataPattern(data: Uint8Array): OperationListNative;
|
|
381
|
-
static toPayPublicKeyPattern(point: Uint8Array): OperationListNative;
|
|
819
|
+
static toNullDataPattern(data: Uint8Array): OperationListNative | null;
|
|
820
|
+
static toPayPublicKeyPattern(point: Uint8Array): OperationListNative | null;
|
|
382
821
|
static toPayPublicKeyHashPattern(hash: ShortHashNative): OperationListNative;
|
|
822
|
+
static toPayPublicKeyHashPatternUnlocking(end: Uint8Array, pubkey: EcPublicNative): OperationListNative | null;
|
|
823
|
+
static toPayPublicKeyHashPatternUnlockingPlaceholder(endorsement_size: number, pubkey_size: number): OperationListNative;
|
|
824
|
+
static toPayScriptHashPatternUnlockingPlaceholder(script_size: number, multisig: boolean): OperationListNative;
|
|
383
825
|
static toPayScriptHashPattern(hash: ShortHashNative): OperationListNative;
|
|
826
|
+
static toPayScriptHash32Pattern(hash: HashNative): OperationListNative;
|
|
827
|
+
static toPayMultisigPatternEcCompressedList(signatures: number, points: EcCompressedListNative): OperationListNative;
|
|
828
|
+
static toPayMultisigPatternDataStack(signatures: number, points: DataStackNative): OperationListNative;
|
|
384
829
|
pattern(): ScriptPattern;
|
|
385
|
-
|
|
830
|
+
outputPatternSimple(): ScriptPattern;
|
|
831
|
+
outputPattern(flags: bigint): ScriptPattern;
|
|
386
832
|
inputPattern(): ScriptPattern;
|
|
387
833
|
sigops(accurate: boolean): number;
|
|
388
834
|
isUnspendable(): boolean;
|
|
389
835
|
reset(): void;
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
static
|
|
836
|
+
isPayToScriptHash(flags: bigint): boolean;
|
|
837
|
+
isPayToScriptHash32(flags: bigint): boolean;
|
|
838
|
+
static verify(tx: TransactionNative, input_index: number, flags: bigint, input_script: ScriptNative, prevout_script: ScriptNative, value: bigint): number;
|
|
839
|
+
static verifySimple(tx: TransactionNative, input: number, flags: bigint): number;
|
|
840
|
+
}
|
|
841
|
+
export declare class PointNative {
|
|
842
|
+
private readonly [ptrSym];
|
|
843
|
+
static _create(ptr: number): PointNative;
|
|
844
|
+
protected _destructor(): void;
|
|
845
|
+
constructor(hash: HashNative, index: number);
|
|
846
|
+
static fromData(data: Uint8Array, wire?: boolean): PointNative;
|
|
847
|
+
copy(): PointNative;
|
|
848
|
+
equals(other: PointNative): boolean;
|
|
849
|
+
notEqual(other: PointNative): boolean;
|
|
850
|
+
less(x: PointNative): boolean;
|
|
851
|
+
greater(x: PointNative): boolean;
|
|
852
|
+
lessOrEqual(x: PointNative): boolean;
|
|
853
|
+
greaterOrEqual(x: PointNative): boolean;
|
|
854
|
+
toData(wire: boolean): Uint8Array;
|
|
855
|
+
static satoshiFixedSize(): number;
|
|
856
|
+
serializedSize(wire?: boolean): number;
|
|
857
|
+
static createNull(): PointNative;
|
|
858
|
+
hash(): HashNative;
|
|
859
|
+
index(): number;
|
|
860
|
+
checksum(): bigint;
|
|
861
|
+
isNull(): boolean;
|
|
393
862
|
}
|
|
394
863
|
export declare class OutputPointNative {
|
|
395
864
|
private readonly [ptrSym];
|
|
396
865
|
static _create(ptr: number): OutputPointNative;
|
|
397
866
|
protected _destructor(): void;
|
|
398
867
|
constructor();
|
|
868
|
+
constructor(x: PointNative);
|
|
399
869
|
constructor(hash: HashNative, index: number);
|
|
870
|
+
static fromData(data: Uint8Array, wire?: boolean): OutputPointNative;
|
|
871
|
+
copy(): OutputPointNative;
|
|
872
|
+
static createNull(): OutputPointNative;
|
|
873
|
+
isMature(height: number): boolean;
|
|
874
|
+
isMatureWithTicks(ticks: BlockTicksNative, height: number): boolean;
|
|
875
|
+
equals(other: OutputPointNative): boolean;
|
|
876
|
+
notEqual(other: OutputPointNative): boolean;
|
|
877
|
+
less(x: OutputPointNative): boolean;
|
|
878
|
+
greater(x: OutputPointNative): boolean;
|
|
879
|
+
lessOrEqual(x: OutputPointNative): boolean;
|
|
880
|
+
greaterOrEqual(x: OutputPointNative): boolean;
|
|
881
|
+
toData(wire: boolean): Uint8Array;
|
|
882
|
+
static satoshiFixedSize(): number;
|
|
883
|
+
serializedSize(wire?: boolean): number;
|
|
400
884
|
hash(): HashNative;
|
|
401
885
|
index(): number;
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
setIndex(index: number): void;
|
|
405
|
-
setCachedOutput(output: OutputNative): void;
|
|
886
|
+
checksum(): bigint;
|
|
887
|
+
isNull(): boolean;
|
|
406
888
|
}
|
|
407
|
-
declare const _TokenKindIntToKey: readonly ["
|
|
889
|
+
declare const _TokenKindIntToKey: readonly ["fungible_only", "non_fungible_only", "both"];
|
|
408
890
|
export declare type TokenKind = (typeof _TokenKindIntToKey)[number];
|
|
409
891
|
export declare function TokenKindToInt(value: TokenKind): number;
|
|
410
|
-
declare
|
|
892
|
+
export declare function TokenKindFromInt(value: number): TokenKind;
|
|
893
|
+
declare const _TokenCapabilityIntToKey: readonly ["none", "mut", "minting"];
|
|
411
894
|
export declare type TokenCapability = (typeof _TokenCapabilityIntToKey)[number];
|
|
412
895
|
export declare function TokenCapabilityToInt(value: TokenCapability): number;
|
|
896
|
+
export declare function TokenCapabilityFromInt(value: number): TokenCapability;
|
|
413
897
|
export declare class TokenDataNative {
|
|
414
898
|
private readonly [ptrSym];
|
|
899
|
+
private constructor();
|
|
415
900
|
static _create(ptr: number): TokenDataNative;
|
|
416
901
|
protected _destructor(): void;
|
|
417
|
-
static
|
|
418
|
-
|
|
419
|
-
|
|
902
|
+
static fromData(data: Uint8Array): TokenDataNative;
|
|
903
|
+
copy(): TokenDataNative;
|
|
904
|
+
id(): HashNative;
|
|
905
|
+
setId(value: HashNative): void;
|
|
906
|
+
equals(other: TokenDataNative): boolean;
|
|
907
|
+
notEqual(other: TokenDataNative): boolean;
|
|
908
|
+
less(x: TokenDataNative): boolean;
|
|
909
|
+
greater(x: TokenDataNative): boolean;
|
|
910
|
+
lessOrEqual(x: TokenDataNative): boolean;
|
|
911
|
+
greaterOrEqual(x: TokenDataNative): boolean;
|
|
912
|
+
static makeFungible(id: HashNative, amount: bigint): TokenDataNative | null;
|
|
913
|
+
static makeNonFungible(id: HashNative, capability: TokenCapability, commitment: Uint8Array): TokenDataNative | null;
|
|
914
|
+
static makeBoth(id: HashNative, amount: bigint, capability: TokenCapability, commitment: Uint8Array): TokenDataNative | null;
|
|
915
|
+
getKind(): TokenKind;
|
|
420
916
|
isValid(): boolean;
|
|
917
|
+
getAmount(): bigint;
|
|
918
|
+
hasNft(): boolean;
|
|
919
|
+
isFungibleOnly(): boolean;
|
|
920
|
+
getNftCapability(): TokenCapability;
|
|
921
|
+
getNftCommitment(): Uint8Array;
|
|
922
|
+
isImmutableNft(): boolean;
|
|
923
|
+
isMutableNft(): boolean;
|
|
924
|
+
isMintingNft(): boolean;
|
|
421
925
|
serializedSize(): number;
|
|
926
|
+
bitfield(): number;
|
|
422
927
|
toData(): Uint8Array;
|
|
423
|
-
kind(): TokenKind;
|
|
424
|
-
category(): HashNative;
|
|
425
|
-
fungibleAmount(): bigint;
|
|
426
|
-
nonFungibleCapability(): TokenCapability;
|
|
427
|
-
nonFungibleCommitment(): Uint8Array;
|
|
428
928
|
}
|
|
429
929
|
export declare class UtxoNative {
|
|
430
930
|
private readonly [ptrSym];
|
|
431
931
|
static _create(ptr: number): UtxoNative;
|
|
432
932
|
protected _destructor(): void;
|
|
433
933
|
constructor();
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
934
|
+
constructor(point: OutputPointNative, amount: bigint, token_data: TokenDataNative | null);
|
|
935
|
+
copy(): UtxoNative;
|
|
936
|
+
equals(other: UtxoNative): boolean;
|
|
937
|
+
notEqual(other: UtxoNative): boolean;
|
|
938
|
+
less(x: UtxoNative): boolean;
|
|
939
|
+
greater(x: UtxoNative): boolean;
|
|
940
|
+
lessOrEqual(x: UtxoNative): boolean;
|
|
941
|
+
greaterOrEqual(x: UtxoNative): boolean;
|
|
942
|
+
height(): number;
|
|
943
|
+
point(): OutputPointNative;
|
|
440
944
|
amount(): bigint;
|
|
441
|
-
|
|
442
|
-
hasTokenData(): boolean;
|
|
443
|
-
tokenData(): TokenDataNative;
|
|
444
|
-
tokenCategory(): HashNative;
|
|
445
|
-
tokenAmount(): bigint;
|
|
446
|
-
setHash(hash: HashNative): void;
|
|
447
|
-
setIndex(index: number): void;
|
|
448
|
-
setAmount(amount: bigint): void;
|
|
449
|
-
setCachedOutput(output: OutputNative): void;
|
|
450
|
-
setTokenData(token_data: TokenDataNative): void;
|
|
451
|
-
setTokenCategory(category: HashNative): void;
|
|
452
|
-
setTokenAmount(amount: bigint): void;
|
|
945
|
+
tokenData(): TokenDataNative | null;
|
|
453
946
|
}
|
|
454
947
|
export declare class OutputNative {
|
|
455
948
|
private readonly [ptrSym];
|
|
456
949
|
static _create(ptr: number): OutputNative;
|
|
457
950
|
protected _destructor(): void;
|
|
458
951
|
constructor();
|
|
459
|
-
constructor(value: bigint, script: ScriptNative);
|
|
460
|
-
|
|
461
|
-
|
|
952
|
+
constructor(value: bigint, script: ScriptNative, token_data: TokenDataNative | null);
|
|
953
|
+
static fromData(data: Uint8Array, wire?: boolean): OutputNative;
|
|
954
|
+
copy(): OutputNative;
|
|
955
|
+
equals(other: OutputNative): boolean;
|
|
956
|
+
notEqual(other: OutputNative): boolean;
|
|
462
957
|
toData(wire: boolean): Uint8Array;
|
|
463
|
-
serializedSize(wire
|
|
464
|
-
isValid(): boolean;
|
|
958
|
+
serializedSize(wire?: boolean): number;
|
|
465
959
|
value(): bigint;
|
|
960
|
+
setValue(value: bigint): void;
|
|
466
961
|
script(): ScriptNative;
|
|
467
|
-
|
|
468
|
-
tokenData(): TokenDataNative;
|
|
962
|
+
setScript(value: ScriptNative): void;
|
|
963
|
+
tokenData(): TokenDataNative | null;
|
|
964
|
+
setTokenData(value: TokenDataNative | null): void;
|
|
965
|
+
addressSimple(testnet?: boolean): PaymentAddressNative | null;
|
|
966
|
+
address(p2kh_version: number, p2sh_version: number): PaymentAddressNative | null;
|
|
967
|
+
addresses(p2kh_version: number, p2sh_version: number): PaymentAddressListNative;
|
|
968
|
+
isValid(): boolean;
|
|
969
|
+
signatureOperations(bip141: boolean): number;
|
|
970
|
+
isDust(minimum_output_value: bigint): boolean;
|
|
971
|
+
reset(): void;
|
|
469
972
|
}
|
|
470
973
|
export declare class InputNative {
|
|
471
974
|
private readonly [ptrSym];
|
|
472
975
|
static _create(ptr: number): InputNative;
|
|
473
976
|
protected _destructor(): void;
|
|
474
|
-
constructor();
|
|
475
|
-
|
|
476
|
-
|
|
977
|
+
constructor(previous_output: OutputPointNative, script: ScriptNative, sequence_value: number);
|
|
978
|
+
static fromData(data: Uint8Array, wire: boolean): InputNative;
|
|
979
|
+
copy(): InputNative;
|
|
980
|
+
equals(other: InputNative): boolean;
|
|
981
|
+
notEqual(other: InputNative): boolean;
|
|
477
982
|
toData(wire: boolean): Uint8Array;
|
|
478
|
-
serializedSize(wire
|
|
479
|
-
isValid(): boolean;
|
|
480
|
-
seq(): number;
|
|
481
|
-
script(): ScriptNative;
|
|
983
|
+
serializedSize(wire?: boolean): number;
|
|
482
984
|
previousOutput(): OutputPointNative;
|
|
985
|
+
setPreviousOutput(value: OutputPointNative): void;
|
|
986
|
+
script(): ScriptNative;
|
|
987
|
+
setScript(value: ScriptNative): void;
|
|
988
|
+
sequenceValue(): number;
|
|
989
|
+
setSequence(value: number): void;
|
|
990
|
+
address(): PaymentAddressNative | null;
|
|
991
|
+
addresses(): PaymentAddressListNative;
|
|
992
|
+
isFinal(): boolean;
|
|
993
|
+
isLocked(block_height: number, median_time_past: number): boolean;
|
|
994
|
+
isLockedWithTicks(ticks: BlockTicksNative, block_height: number, median_time_past: number): boolean;
|
|
995
|
+
signatureOperations(bip16: boolean, bip141: boolean): number;
|
|
996
|
+
extractEmbeddedScript(): ScriptNative;
|
|
483
997
|
}
|
|
484
998
|
export declare class OutputListNative {
|
|
485
999
|
private readonly [ptrSym];
|
|
486
1000
|
static _create(ptr: number): OutputListNative;
|
|
487
1001
|
protected _destructor(): void;
|
|
488
1002
|
constructor();
|
|
489
|
-
pushBack(
|
|
1003
|
+
pushBack(elem: OutputNative): void;
|
|
490
1004
|
count(): number;
|
|
491
1005
|
nth(index: number): OutputNative;
|
|
1006
|
+
assignAt(index: number, elem: OutputNative): void;
|
|
1007
|
+
erase(index: number): void;
|
|
492
1008
|
}
|
|
493
1009
|
export declare class InputListNative {
|
|
494
1010
|
private readonly [ptrSym];
|
|
495
1011
|
static _create(ptr: number): InputListNative;
|
|
496
1012
|
protected _destructor(): void;
|
|
497
1013
|
constructor();
|
|
498
|
-
pushBack(
|
|
1014
|
+
pushBack(elem: InputNative): void;
|
|
499
1015
|
count(): number;
|
|
500
1016
|
nth(index: number): InputNative;
|
|
1017
|
+
assignAt(index: number, elem: InputNative): void;
|
|
1018
|
+
erase(index: number): void;
|
|
1019
|
+
}
|
|
1020
|
+
export declare class OutputPointListNative {
|
|
1021
|
+
private readonly [ptrSym];
|
|
1022
|
+
static _create(ptr: number): OutputPointListNative;
|
|
1023
|
+
protected _destructor(): void;
|
|
1024
|
+
constructor();
|
|
1025
|
+
pushBack(elem: OutputPointNative): void;
|
|
1026
|
+
count(): number;
|
|
1027
|
+
nth(index: number): OutputPointNative;
|
|
1028
|
+
assignAt(index: number, elem: OutputPointNative): void;
|
|
1029
|
+
erase(index: number): void;
|
|
1030
|
+
}
|
|
1031
|
+
export declare class PointListNative {
|
|
1032
|
+
private readonly [ptrSym];
|
|
1033
|
+
static _create(ptr: number): PointListNative;
|
|
1034
|
+
protected _destructor(): void;
|
|
1035
|
+
constructor();
|
|
1036
|
+
pushBack(elem: PointNative): void;
|
|
1037
|
+
count(): number;
|
|
1038
|
+
nth(index: number): PointNative;
|
|
1039
|
+
assignAt(index: number, elem: PointNative): void;
|
|
1040
|
+
erase(index: number): void;
|
|
501
1041
|
}
|
|
502
1042
|
export declare class UtxoListNative {
|
|
503
1043
|
private readonly [ptrSym];
|
|
504
1044
|
static _create(ptr: number): UtxoListNative;
|
|
505
1045
|
protected _destructor(): void;
|
|
506
1046
|
constructor();
|
|
507
|
-
pushBack(
|
|
1047
|
+
pushBack(elem: UtxoNative): void;
|
|
508
1048
|
count(): number;
|
|
509
1049
|
nth(index: number): UtxoNative;
|
|
1050
|
+
assignAt(index: number, elem: UtxoNative): void;
|
|
1051
|
+
erase(index: number): void;
|
|
510
1052
|
}
|
|
511
1053
|
declare const _CoinSelectionAlgorithmIntToKey: readonly ["smallest_first", "largest_first", "manual", "send_all"];
|
|
512
1054
|
export declare type CoinSelectionAlgorithm = (typeof _CoinSelectionAlgorithmIntToKey)[number];
|
|
513
1055
|
export declare function CoinSelectionAlgorithmToInt(value: CoinSelectionAlgorithm): number;
|
|
1056
|
+
export declare function CoinSelectionAlgorithmFromInt(value: number): CoinSelectionAlgorithm;
|
|
514
1057
|
export declare class TransactionNative {
|
|
515
1058
|
private readonly [ptrSym];
|
|
516
1059
|
static _create(ptr: number): TransactionNative;
|
|
517
1060
|
protected _destructor(): void;
|
|
518
1061
|
constructor();
|
|
519
1062
|
constructor(version: number, locktime: number, inputs: InputListNative, outputs: OutputListNative);
|
|
520
|
-
static fromData(data: Uint8Array): TransactionNative;
|
|
1063
|
+
static fromData(data: Uint8Array, wire?: boolean): TransactionNative;
|
|
1064
|
+
static constructMove(version: number, locktime: number, inputs: InputListNative, outputs: OutputListNative): TransactionNative;
|
|
1065
|
+
copy(): TransactionNative;
|
|
1066
|
+
static createNull(): TransactionNative;
|
|
1067
|
+
isNull(): boolean;
|
|
1068
|
+
equals(other: TransactionNative): boolean;
|
|
1069
|
+
notEqual(other: TransactionNative): boolean;
|
|
521
1070
|
toData(wire: boolean): Uint8Array;
|
|
522
|
-
serializedSize(wire
|
|
523
|
-
isValid(): boolean;
|
|
524
|
-
hash(): HashNative;
|
|
1071
|
+
serializedSize(wire?: boolean): number;
|
|
525
1072
|
version(): number;
|
|
526
1073
|
locktime(): number;
|
|
527
|
-
outputs(): OutputListNative;
|
|
528
1074
|
inputs(): InputListNative;
|
|
529
|
-
|
|
1075
|
+
outputs(): OutputListNative;
|
|
1076
|
+
hash(): HashNative;
|
|
1077
|
+
outputsHash(): HashNative;
|
|
1078
|
+
inpointsHash(): HashNative;
|
|
1079
|
+
sequencesHash(): HashNative;
|
|
1080
|
+
utxosHash(): HashNative;
|
|
1081
|
+
fees(): bigint;
|
|
1082
|
+
previousOutputs(): PointListNative;
|
|
1083
|
+
missingPreviousOutputs(): PointListNative;
|
|
1084
|
+
missingPreviousTransactions(): HashListNative;
|
|
530
1085
|
totalInputValue(): bigint;
|
|
531
1086
|
totalOutputValue(): bigint;
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
1087
|
+
signatureOperations(bip16: boolean, bip141: boolean): number;
|
|
1088
|
+
isCoinbase(): boolean;
|
|
1089
|
+
isNullNonCoinbase(): boolean;
|
|
1090
|
+
isOversizedCoinbase(): boolean;
|
|
1091
|
+
isMature(height: number): boolean;
|
|
1092
|
+
isMatureWithTicks(ticks: BlockTicksNative, height: number): boolean;
|
|
1093
|
+
isInternalDoubleSpend(): boolean;
|
|
1094
|
+
isDoubleSpend(include_unconfirmed: boolean): boolean;
|
|
1095
|
+
isDusty(minimum_output_value: bigint): boolean;
|
|
1096
|
+
isMissingPreviousOutputs(): boolean;
|
|
1097
|
+
isFinal(block_height: number, block_time: number): boolean;
|
|
1098
|
+
isFinalWithTicks(ticks: BlockTicksNative, block_height: number, block_time: number): boolean;
|
|
1099
|
+
isLocked(block_height: number, median_time_past: number): boolean;
|
|
1100
|
+
isLockedWithTicks(ticks: BlockTicksNative, block_height: number, median_time_past: number): boolean;
|
|
1101
|
+
isLocktimeConflict(): boolean;
|
|
1102
|
+
isOverspent(): boolean;
|
|
1103
|
+
check(max_block_size: number, transaction_pool: boolean, retarget: boolean): number;
|
|
1104
|
+
minTxSize(flags: bigint): number;
|
|
1105
|
+
accept(flags: bigint, height: number, median_time_past: number, max_sigops: number, is_under_checkpoint: boolean, transaction_pool: boolean, duplicate: boolean): number;
|
|
1106
|
+
acceptWithTicks(ticks: BlockTicksNative, flags: bigint, height: number, median_time_past: number, max_sigops: number, is_under_checkpoint: boolean, transaction_pool: boolean, duplicate: boolean): number;
|
|
1107
|
+
isStandardSimple(): boolean;
|
|
1108
|
+
isStandard(flags: bigint): boolean;
|
|
1109
|
+
}
|
|
1110
|
+
export declare class TransactionListNative {
|
|
1111
|
+
private readonly [ptrSym];
|
|
1112
|
+
static _create(ptr: number): TransactionListNative;
|
|
1113
|
+
protected _destructor(): void;
|
|
1114
|
+
constructor();
|
|
1115
|
+
pushBack(elem: TransactionNative): void;
|
|
1116
|
+
count(): number;
|
|
1117
|
+
nth(index: number): TransactionNative;
|
|
1118
|
+
assignAt(index: number, elem: TransactionNative): void;
|
|
1119
|
+
erase(index: number): void;
|
|
536
1120
|
}
|
|
537
1121
|
export declare class InterpreterNative {
|
|
538
|
-
static
|
|
539
|
-
static
|
|
540
|
-
static
|
|
541
|
-
static
|
|
542
|
-
static
|
|
543
|
-
static
|
|
1122
|
+
static runSimple(program: ProgramNative): number;
|
|
1123
|
+
static run(op: OperationNative, program: ProgramNative): number;
|
|
1124
|
+
static debugBegin(prog: ProgramNative): DebugSnapshotNative;
|
|
1125
|
+
static debugStep(snapshot: DebugSnapshotNative): DebugSnapshotNative;
|
|
1126
|
+
static debugStepN(snapshot: DebugSnapshotNative, n: number): DebugSnapshotNative;
|
|
1127
|
+
static debugRun(snapshot: DebugSnapshotNative): DebugSnapshotNative;
|
|
1128
|
+
static debugRunTraced(start: DebugSnapshotNative): DebugSnapshotListNative;
|
|
1129
|
+
static debugFinalize(snapshot: DebugSnapshotNative): number;
|
|
1130
|
+
}
|
|
1131
|
+
export declare class MetricsNative {
|
|
1132
|
+
private readonly [ptrSym];
|
|
1133
|
+
private constructor();
|
|
1134
|
+
static _create(ptr: number): MetricsNative;
|
|
1135
|
+
protected _destructor(): void;
|
|
1136
|
+
copy(): MetricsNative;
|
|
1137
|
+
sigChecks(): number;
|
|
1138
|
+
opCost(): bigint;
|
|
1139
|
+
hashDigestIterations(): bigint;
|
|
1140
|
+
addOpCost(cost: number): void;
|
|
1141
|
+
addPushOp(stack_item_length: number): void;
|
|
1142
|
+
addHashIterations(message_length: number, is_two_round_hash: boolean): void;
|
|
1143
|
+
addSigChecks(n_checks: number): void;
|
|
1144
|
+
isOverOpCostLimit(flags: bigint): boolean;
|
|
1145
|
+
isOverOpCostLimitSimple(): boolean;
|
|
1146
|
+
isOverHashItersLimit(): boolean;
|
|
1147
|
+
hasValidScriptLimits(): boolean;
|
|
1148
|
+
setScriptLimits(flags: bigint, script_sig_size: bigint): void;
|
|
1149
|
+
setNativeScriptLimits(standard: boolean, script_sig_size: bigint): void;
|
|
1150
|
+
compositeOpCostScriptFlags(flags: bigint): bigint;
|
|
1151
|
+
compositeOpCostBool(standard: boolean): bigint;
|
|
1152
|
+
}
|
|
1153
|
+
export declare class ScriptExecutionContextNative {
|
|
1154
|
+
private readonly [ptrSym];
|
|
1155
|
+
static _create(ptr: number): ScriptExecutionContextNative;
|
|
1156
|
+
protected _destructor(): void;
|
|
1157
|
+
constructor(input_index: number, transaction: TransactionNative);
|
|
1158
|
+
copy(): ScriptExecutionContextNative;
|
|
1159
|
+
inputIndex(): number;
|
|
1160
|
+
transaction(): TransactionNative;
|
|
1161
|
+
inputCount(): number;
|
|
1162
|
+
outputCount(): number;
|
|
1163
|
+
txVersion(): number;
|
|
1164
|
+
txLocktime(): number;
|
|
1165
|
+
}
|
|
1166
|
+
export declare class DebugSnapshotNative {
|
|
1167
|
+
private readonly [ptrSym];
|
|
1168
|
+
static _create(ptr: number): DebugSnapshotNative;
|
|
1169
|
+
protected _destructor(): void;
|
|
1170
|
+
constructor();
|
|
1171
|
+
constructor(p: ProgramNative);
|
|
1172
|
+
copy(): DebugSnapshotNative;
|
|
1173
|
+
prog(): ProgramNative;
|
|
1174
|
+
step(): number;
|
|
1175
|
+
last(): number;
|
|
1176
|
+
done(): boolean;
|
|
1177
|
+
controlStack(): BoolListNative;
|
|
1178
|
+
loopStack(): U64ListNative;
|
|
1179
|
+
invokeDepth(): number;
|
|
1180
|
+
outerLoopDepth(): number;
|
|
1181
|
+
}
|
|
1182
|
+
export declare class DebugSnapshotListNative {
|
|
1183
|
+
private readonly [ptrSym];
|
|
1184
|
+
static _create(ptr: number): DebugSnapshotListNative;
|
|
1185
|
+
protected _destructor(): void;
|
|
1186
|
+
constructor();
|
|
1187
|
+
pushBack(elem: DebugSnapshotNative): void;
|
|
1188
|
+
count(): number;
|
|
1189
|
+
nth(index: number): DebugSnapshotNative;
|
|
1190
|
+
assignAt(index: number, elem: DebugSnapshotNative): void;
|
|
1191
|
+
erase(index: number): void;
|
|
1192
|
+
}
|
|
1193
|
+
export declare class NumberNative {
|
|
1194
|
+
private readonly [ptrSym];
|
|
1195
|
+
static _create(ptr: number): NumberNative;
|
|
1196
|
+
protected _destructor(): void;
|
|
1197
|
+
constructor();
|
|
1198
|
+
copy(): NumberNative;
|
|
1199
|
+
static fromInt(value: bigint): NumberNative;
|
|
1200
|
+
valid(max_size: number): boolean;
|
|
1201
|
+
setData(data: Uint8Array, max_size: number): boolean;
|
|
1202
|
+
data(): Uint8Array;
|
|
1203
|
+
int32(): number;
|
|
1204
|
+
int64(): bigint;
|
|
1205
|
+
isTrue(): boolean;
|
|
1206
|
+
isFalse(): boolean;
|
|
1207
|
+
greater(value: bigint): boolean;
|
|
1208
|
+
less(value: bigint): boolean;
|
|
1209
|
+
greaterOrEqual(value: bigint): boolean;
|
|
1210
|
+
lessOrEqual(value: bigint): boolean;
|
|
1211
|
+
equals(other: NumberNative): boolean;
|
|
1212
|
+
notEqual(other: NumberNative): boolean;
|
|
1213
|
+
addInt64(value: bigint): NumberNative;
|
|
1214
|
+
subtractInt64(value: bigint): NumberNative;
|
|
1215
|
+
addNumber(x: NumberNative): NumberNative;
|
|
1216
|
+
subtractNumber(x: NumberNative): NumberNative;
|
|
1217
|
+
multiply(x: NumberNative): NumberNative;
|
|
1218
|
+
safeAddNumber(x: NumberNative): boolean;
|
|
1219
|
+
safeAddInt64(x: bigint): boolean;
|
|
1220
|
+
safeSubNumber(x: NumberNative): boolean;
|
|
1221
|
+
safeSubInt64(x: bigint): boolean;
|
|
1222
|
+
safeMulNumber(x: NumberNative): boolean;
|
|
1223
|
+
safeMulInt64(x: bigint): boolean;
|
|
1224
|
+
static safeAddNumber2(x: NumberNative, y: NumberNative): NumberNative;
|
|
1225
|
+
static safeSubNumber2(x: NumberNative, y: NumberNative): NumberNative;
|
|
1226
|
+
static safeMulNumber2(x: NumberNative, y: NumberNative): NumberNative;
|
|
1227
|
+
static isMinimallyEncoded(data: Uint8Array, max_integer_size: number): boolean;
|
|
1228
|
+
static minimallyEncode(data: Uint8Array): Uint8Array;
|
|
1229
|
+
}
|
|
1230
|
+
export declare class BigNumberNative {
|
|
1231
|
+
private readonly [ptrSym];
|
|
1232
|
+
static _create(ptr: number): BigNumberNative;
|
|
1233
|
+
protected _destructor(): void;
|
|
1234
|
+
constructor();
|
|
1235
|
+
constructor(value: bigint);
|
|
1236
|
+
constructor(decimal_str: string);
|
|
1237
|
+
copy(): BigNumberNative;
|
|
1238
|
+
static fromHex(hex_str: string): BigNumberNative;
|
|
1239
|
+
serialize(): Uint8Array;
|
|
1240
|
+
deserialize(data: Uint8Array): boolean;
|
|
1241
|
+
toStr(): string;
|
|
1242
|
+
toHex(): string;
|
|
1243
|
+
sign(): number;
|
|
1244
|
+
isZero(): boolean;
|
|
1245
|
+
isNonzero(): boolean;
|
|
1246
|
+
isNegative(): boolean;
|
|
1247
|
+
toInt32Saturating(): number;
|
|
1248
|
+
byteCount(): number;
|
|
1249
|
+
compare(other: BigNumberNative): number;
|
|
1250
|
+
equals(other: BigNumberNative): boolean;
|
|
1251
|
+
notEqual(other: BigNumberNative): boolean;
|
|
1252
|
+
add(other: BigNumberNative): BigNumberNative;
|
|
1253
|
+
subtract(other: BigNumberNative): BigNumberNative;
|
|
1254
|
+
multiply(other: BigNumberNative): BigNumberNative;
|
|
1255
|
+
abs(): BigNumberNative;
|
|
1256
|
+
negate(): void;
|
|
1257
|
+
pow(exp: BigNumberNative): BigNumberNative;
|
|
1258
|
+
powMod(exp: BigNumberNative, mod: BigNumberNative): BigNumberNative;
|
|
1259
|
+
mathModulo(mod: BigNumberNative): BigNumberNative;
|
|
1260
|
+
data(): Uint8Array;
|
|
1261
|
+
setData(d: Uint8Array, max_size: number): boolean;
|
|
1262
|
+
isTrue(): boolean;
|
|
1263
|
+
isFalse(): boolean;
|
|
1264
|
+
static isMinimallyEncoded(data: Uint8Array, max_size: number): boolean;
|
|
544
1265
|
}
|
|
545
1266
|
export declare class ProgramNative {
|
|
546
1267
|
private readonly [ptrSym];
|
|
@@ -548,18 +1269,87 @@ export declare class ProgramNative {
|
|
|
548
1269
|
protected _destructor(): void;
|
|
549
1270
|
constructor();
|
|
550
1271
|
constructor(script: ScriptNative);
|
|
551
|
-
constructor(script: ScriptNative,
|
|
552
|
-
constructor(script: ScriptNative,
|
|
1272
|
+
constructor(script: ScriptNative, x: ProgramNative);
|
|
1273
|
+
constructor(script: ScriptNative, x: ProgramNative, move: boolean);
|
|
1274
|
+
constructor(script: ScriptNative, transaction: TransactionNative, input_index: number, flags: bigint, value: bigint);
|
|
1275
|
+
constructor(script: ScriptNative, transaction: TransactionNative, input_index: number, flags: bigint, stack: DataStackNative, value: bigint);
|
|
1276
|
+
copy(): ProgramNative;
|
|
1277
|
+
getMetrics(): MetricsNative;
|
|
553
1278
|
isValid(): boolean;
|
|
554
|
-
|
|
1279
|
+
flags(): bigint;
|
|
1280
|
+
maxScriptElementSize(): number;
|
|
1281
|
+
maxIntegerSizeLegacy(): number;
|
|
1282
|
+
maxIntegerSize(): number;
|
|
1283
|
+
isChipVmLimitsEnabled(): boolean;
|
|
1284
|
+
isBigintEnabled(): boolean;
|
|
1285
|
+
inputIndex(): number;
|
|
1286
|
+
value(): bigint;
|
|
1287
|
+
transaction(): TransactionNative;
|
|
1288
|
+
context(): ScriptExecutionContextNative | null;
|
|
1289
|
+
getScript(): ScriptNative;
|
|
1290
|
+
resetActiveScript(): void;
|
|
1291
|
+
operationCount(): number;
|
|
1292
|
+
evaluateSimple(): number;
|
|
1293
|
+
evaluate(op: OperationNative): number;
|
|
1294
|
+
incrementOperationCountOperation(op: OperationNative): boolean;
|
|
1295
|
+
incrementOperationCountInt32(public_keys: number): boolean;
|
|
1296
|
+
markCodeSeparator(pc: number): boolean;
|
|
1297
|
+
push(value: boolean): void;
|
|
1298
|
+
pushMove(item: Uint8Array): void;
|
|
1299
|
+
pushCopy(item: Uint8Array): void;
|
|
1300
|
+
drop(): void;
|
|
1301
|
+
popSimple(): Uint8Array;
|
|
1302
|
+
popInt32(): number;
|
|
1303
|
+
popInt64(): bigint;
|
|
1304
|
+
popNumber(maximum_size: number): NumberNative;
|
|
1305
|
+
popBinary(): [NumberNative, NumberNative];
|
|
1306
|
+
popTernary(): [NumberNative, NumberNative, NumberNative];
|
|
1307
|
+
popBigNumber(maximum_size: number): BigNumberNative;
|
|
1308
|
+
popBigBinary(): [BigNumberNative, BigNumberNative];
|
|
1309
|
+
popBigTernary(): [BigNumberNative, BigNumberNative, BigNumberNative];
|
|
1310
|
+
popIndex(): number;
|
|
1311
|
+
pop(count: number): DataStackNative;
|
|
1312
|
+
duplicate(index: number): void;
|
|
1313
|
+
swap(index_left: number, index_right: number): void;
|
|
1314
|
+
empty(): boolean;
|
|
1315
|
+
stackTrue(clean: boolean): boolean;
|
|
555
1316
|
stackResult(clean: boolean): boolean;
|
|
556
|
-
|
|
1317
|
+
isStackOverflowSimple(): boolean;
|
|
1318
|
+
isStackOverflow(extra: number): boolean;
|
|
1319
|
+
if(op: OperationNative): boolean;
|
|
557
1320
|
item(index: number): Uint8Array;
|
|
1321
|
+
top(): Uint8Array;
|
|
1322
|
+
topNumber(maximum_size: number): NumberNative;
|
|
1323
|
+
topBigNumber(maximum_size: number): BigNumberNative;
|
|
1324
|
+
subscript(): OperationListNative;
|
|
1325
|
+
size(): number;
|
|
1326
|
+
conditionalStackSize(): number;
|
|
1327
|
+
emptyAlternate(): boolean;
|
|
1328
|
+
pushAlternate(value: Uint8Array): void;
|
|
1329
|
+
popAlternate(): Uint8Array;
|
|
1330
|
+
open(value: boolean): void;
|
|
1331
|
+
negate(): void;
|
|
1332
|
+
close(): void;
|
|
1333
|
+
closed(): boolean;
|
|
1334
|
+
succeeded(): boolean;
|
|
1335
|
+
}
|
|
1336
|
+
export declare class BlockTicksNative {
|
|
1337
|
+
private readonly [ptrSym];
|
|
1338
|
+
static _create(ptr: number): BlockTicksNative;
|
|
1339
|
+
protected _destructor(): void;
|
|
1340
|
+
constructor();
|
|
1341
|
+
copy(): BlockTicksNative;
|
|
1342
|
+
static activatedAt(activation_height: bigint): BlockTicksNative;
|
|
1343
|
+
heightToTick(height: bigint): bigint;
|
|
1344
|
+
tickToHeight(tick: bigint): bigint;
|
|
1345
|
+
blockInterval(height: bigint): bigint;
|
|
1346
|
+
nextBlockInterval(height: bigint): bigint;
|
|
1347
|
+
nextBlockTick(tip: bigint): bigint;
|
|
1348
|
+
equals(other: BlockTicksNative): boolean;
|
|
1349
|
+
notEqual(other: BlockTicksNative): boolean;
|
|
558
1350
|
}
|
|
559
1351
|
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"];
|
|
560
1352
|
export declare type RuleForkEnumNative = (typeof _RuleForkEnumNativeIntToKey)[number];
|
|
561
1353
|
export declare function RuleForkEnumNativeToInt(value: RuleForkEnumNative): number;
|
|
562
|
-
declare
|
|
563
|
-
export declare type OpcodeEnumNative = (typeof _OpcodeEnumNativeIntToKey)[number];
|
|
564
|
-
export declare function OpcodeEnumNativeToInt(value: OpcodeEnumNative): number;
|
|
1354
|
+
export declare function RuleForkEnumNativeFromInt(value: number): RuleForkEnumNative;
|
|
565
1355
|
export {};
|