@knuth/js-wasm 2.10.0 → 3.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 +235 -22
- package/package.json +12 -7
- package/src/kth.js +6 -3
- package/src/kth.wasm +0 -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 +12 -0
- 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 +13 -8
- 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 +10 -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/exceptions.d.ts +4 -0
- package/types/wasm/glue.d.ts +937 -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/main.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
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
|
import Kth from './Kth';
|
|
2
6
|
import Utxo from './Utxo';
|
|
3
7
|
import Opcode from './Opcode';
|
|
@@ -24,6 +28,7 @@ import { ScriptNative } from './wasm/glue';
|
|
|
24
28
|
import Operation from './Operation';
|
|
25
29
|
import OperationList from './OperationList';
|
|
26
30
|
import RuleFork from './RuleFork';
|
|
31
|
+
import { ScriptFlags, ScriptUpgrades } from './ScriptFlags';
|
|
27
32
|
import SighashAlgorithm from './SighashAlgorithm';
|
|
28
33
|
import Program from './Program';
|
|
29
34
|
import { Interpreter, Debugger } from './Interpreter';
|
|
@@ -33,9 +38,11 @@ import { bytesToHexStr, hexStrToBytes, encodeHash, decodeHash } from './encoding
|
|
|
33
38
|
import { HashFunctions, Hash, ShortHash, LongHash, EncryptedSeed } from './Hash';
|
|
34
39
|
import WalletManager from './WalletManager';
|
|
35
40
|
import WalletData from './WalletData';
|
|
41
|
+
import WalletUtils from './WalletUtils';
|
|
42
|
+
import { ElectrumClient, electrumClient } from './ElectrumClient';
|
|
36
43
|
import loadLib from './wasm/loadLib';
|
|
37
44
|
import { free, malloc } from './wasm/mem';
|
|
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 };
|
|
45
|
+
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, ScriptFlags, ScriptUpgrades, RuleForkEnumNative, RuleForkEnumNativeToInt, SighashAlgorithm, Interpreter, Debugger, Program, bytesToHexStr, hexStrToBytes, encodeHash, decodeHash, bitcoinToSatoshis, satoshisToBitcoin, HashFunctions, Hash, ShortHash, LongHash, EncryptedSeed, WalletManager, WalletData, WalletUtils, ElectrumClient, electrumClient, free, malloc, };
|
|
39
46
|
declare const _default: {
|
|
40
47
|
loadLib: typeof loadLib;
|
|
41
48
|
Kth: typeof Kth;
|
|
@@ -49,10 +56,73 @@ declare const _default: {
|
|
|
49
56
|
OpcodeEnumNativeToInt: typeof OpcodeEnumNativeToInt;
|
|
50
57
|
Operation: typeof Operation;
|
|
51
58
|
RuleFork: typeof RuleFork;
|
|
59
|
+
ScriptFlags: Readonly<{
|
|
60
|
+
noRules: 0n;
|
|
61
|
+
easyBlocks: 1n;
|
|
62
|
+
bip16Rule: 2n;
|
|
63
|
+
bip30Rule: 4n;
|
|
64
|
+
bip34Rule: 8n;
|
|
65
|
+
bip66Rule: 16n;
|
|
66
|
+
bip65Rule: 32n;
|
|
67
|
+
bip90Rule: 64n;
|
|
68
|
+
allowCollisions: 128n;
|
|
69
|
+
bip68Rule: 256n;
|
|
70
|
+
bip112Rule: 512n;
|
|
71
|
+
bip113Rule: 1024n;
|
|
72
|
+
bchStrictenc: 2048n;
|
|
73
|
+
bchSighashForkid: 4096n;
|
|
74
|
+
bchLowS: 8192n;
|
|
75
|
+
bchNullfail: 16384n;
|
|
76
|
+
bchReactivatedOpcodes: 32768n;
|
|
77
|
+
bchSigpushonly: 65536n;
|
|
78
|
+
bchCleanstack: 131072n;
|
|
79
|
+
bchSchnorrMultisig: 262144n;
|
|
80
|
+
bchMinimaldata: 524288n;
|
|
81
|
+
bchEnforceSigchecks: 1048576n;
|
|
82
|
+
bch64bitIntegers: 2097152n;
|
|
83
|
+
bchNativeIntrospection: 4194304n;
|
|
84
|
+
bchP2sh32: 8388608n;
|
|
85
|
+
bchTokens: 16777216n;
|
|
86
|
+
bchVmLimits: 33554432n;
|
|
87
|
+
bchBigint: 67108864n;
|
|
88
|
+
bchLoops: 134217728n;
|
|
89
|
+
bchSubroutines: 268435456n;
|
|
90
|
+
bchBitwiseOps: 536870912n;
|
|
91
|
+
bchP2s: 1073741824n;
|
|
92
|
+
bch2027May: 2147483648n;
|
|
93
|
+
bchVmLimitsStandard: 144115188075855872n;
|
|
94
|
+
bchMinimalif: 288230376151711744n;
|
|
95
|
+
bchInputSigchecks: 576460752303423488n;
|
|
96
|
+
bchDiscourageUpgradableNops: 1152921504606846976n;
|
|
97
|
+
bchDisallowSegwitRecovery: 2305843009213693952n;
|
|
98
|
+
retarget: 4611686018427387904n;
|
|
99
|
+
unverified: 9223372036854775808n;
|
|
100
|
+
allPolicyFlags: 4467570830351532032n;
|
|
101
|
+
allRules: 144115188075855871n;
|
|
102
|
+
allBits: 18446744073709551615n;
|
|
103
|
+
standardPolicyFlags: 4467570830351532032n;
|
|
104
|
+
}>;
|
|
105
|
+
ScriptUpgrades: Readonly<{
|
|
106
|
+
bip34Activations: 56n;
|
|
107
|
+
bchUahf: 6144n;
|
|
108
|
+
bchDaaCw144: 30720n;
|
|
109
|
+
bchPythagoras: 63488n;
|
|
110
|
+
bchEuclid: 260096n;
|
|
111
|
+
bchPisano: 260096n;
|
|
112
|
+
bchMersenne: 1046528n;
|
|
113
|
+
bchFermat: 2095104n;
|
|
114
|
+
bchEuler: 2095104n;
|
|
115
|
+
bchGauss: 8386560n;
|
|
116
|
+
bchDescartes: 33552384n;
|
|
117
|
+
bchLobachevski: 33552384n;
|
|
118
|
+
bchGalois: 134215680n;
|
|
119
|
+
bchLeibniz: 2147481600n;
|
|
120
|
+
bchCantor: 4294965248n;
|
|
121
|
+
}>;
|
|
52
122
|
RuleForkEnumNativeToInt: typeof RuleForkEnumNativeToInt;
|
|
53
123
|
SighashAlgorithm: typeof SighashAlgorithm;
|
|
54
124
|
Utxo: typeof Utxo;
|
|
55
|
-
UtxoList:
|
|
125
|
+
UtxoList: import("./ListHelper").ListAdapter<Utxo, import("./wasm/glue").UtxoListNative>;
|
|
56
126
|
bytesToHexStr: typeof bytesToHexStr;
|
|
57
127
|
hexStrToBytes: typeof hexStrToBytes;
|
|
58
128
|
encodeHash: typeof encodeHash;
|
|
@@ -62,6 +132,9 @@ declare const _default: {
|
|
|
62
132
|
HashFunctions: typeof HashFunctions;
|
|
63
133
|
WalletManager: typeof WalletManager;
|
|
64
134
|
WalletData: typeof WalletData;
|
|
135
|
+
WalletUtils: typeof WalletUtils;
|
|
136
|
+
ElectrumClient: typeof ElectrumClient;
|
|
137
|
+
electrumClient: ElectrumClient;
|
|
65
138
|
free: typeof free;
|
|
66
139
|
malloc: typeof malloc;
|
|
67
140
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
|
|
5
|
+
export declare class NativeScope {
|
|
6
|
+
private readonly owned;
|
|
7
|
+
own<T>(native: T): T;
|
|
8
|
+
release(): void;
|
|
9
|
+
}
|
|
10
|
+
export declare function withNatives<T>(body: (scope: NativeScope) => T): T;
|
package/types/types.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
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
|
export type OnlyAttributes<T extends object> = WithoutValueType<WithoutKeyType<T, Symbol>, Function>;
|
|
2
6
|
export type WithoutKeyType<T extends object, KT> = {
|
|
3
7
|
[P in keyof T as P extends KT ? never : P]: T[P];
|
package/types/utils.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
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
|
import type { WithoutKeyType } from './types';
|
|
2
6
|
export declare function isArrayString(obj: any): obj is Array<string | null>;
|
|
3
7
|
export declare function isArrayArrayString(obj: any): obj is Array<Array<string>>;
|
|
@@ -1,3 +1,7 @@
|
|
|
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
|
export default interface EmscriptenModule {
|
|
2
6
|
readonly _malloc: (size: number) => number;
|
|
3
7
|
readonly _free: (ptr: number) => void;
|
|
@@ -1,3 +1,7 @@
|
|
|
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
|
import KthModule from '../main';
|
|
2
6
|
export * from '../main';
|
|
3
7
|
export default KthModule;
|