@opcat-labs/opcat 1.0.1 → 1.0.3
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/.cjs2esm.json +18 -0
- package/.mocharc.yaml +1 -1
- package/CHANGELOG.md +12 -0
- package/README.md +6 -0
- package/{lib/address.js → cjs/address.cjs} +77 -72
- package/cjs/block/block.cjs +332 -0
- package/{lib/block/blockheader.js → cjs/block/blockheader.cjs} +8 -7
- package/cjs/block/index.cjs +2 -0
- package/{lib/block/merkleblock.js → cjs/block/merkleblock.cjs} +23 -15
- package/cjs/bn.cjs +3411 -0
- package/{lib/crypto/bn.js → cjs/crypto/bn.cjs} +3 -3
- package/{lib/crypto/ecdsa.js → cjs/crypto/ecdsa.cjs} +150 -14
- package/{lib/crypto/hash.node.js → cjs/crypto/hash.cjs} +13 -2
- package/cjs/crypto/index.cjs +16 -0
- package/{lib/crypto/point.js → cjs/crypto/point.cjs} +11 -4
- package/cjs/crypto/random.cjs +18 -0
- package/{lib/crypto/signature.js → cjs/crypto/signature.cjs} +158 -8
- package/{lib/encoding/base58.js → cjs/encoding/base58.cjs} +58 -2
- package/cjs/encoding/base58check.cjs +192 -0
- package/cjs/encoding/bufferreader.cjs +333 -0
- package/cjs/encoding/bufferwriter.cjs +244 -0
- package/{lib/encoding/decode-asm.js → cjs/encoding/decode-asm.cjs} +4 -4
- package/{lib/encoding/decode-hex.js → cjs/encoding/decode-hex.cjs} +1 -1
- package/cjs/encoding/index.cjs +14 -0
- package/cjs/encoding/varint.cjs +116 -0
- package/{lib/errors/index.js → cjs/errors/index.cjs} +9 -9
- package/{lib/errors/spec.js → cjs/errors/spec.cjs} +2 -2
- package/cjs/hash-cache.cjs +98 -0
- package/{lib/hdprivatekey.js → cjs/hdprivatekey.cjs} +232 -140
- package/{lib/hdpublickey.js → cjs/hdpublickey.cjs} +120 -93
- package/cjs/index.cjs +94 -0
- package/cjs/interpreter/index.cjs +2 -0
- package/cjs/interpreter/interpreter.cjs +1988 -0
- package/{lib/script/stack.js → cjs/interpreter/stack.cjs} +9 -2
- package/{lib/message/message.js → cjs/message/message.cjs} +62 -25
- package/cjs/mnemonic/index.cjs +3 -0
- package/{lib/mnemonic/mnemonic.js → cjs/mnemonic/mnemonic.cjs} +44 -13
- package/{lib/mnemonic/pbkdf2.node.js → cjs/mnemonic/pbkdf2.cjs} +9 -2
- package/cjs/mnemonic/words/index.cjs +66 -0
- package/cjs/network.cjs +13 -0
- package/cjs/networks.cjs +321 -0
- package/{lib/opcode.js → cjs/opcode.cjs} +69 -5
- package/cjs/privatekey.cjs +422 -0
- package/{lib/publickey.js → cjs/publickey.cjs} +14 -16
- package/cjs/script/index.cjs +2 -0
- package/{lib/script/script.js → cjs/script/script.cjs} +322 -67
- package/cjs/transaction/index.cjs +5 -0
- package/cjs/transaction/input/index.cjs +34 -0
- package/cjs/transaction/input/input.cjs +396 -0
- package/{lib/transaction/input/multisig.js → cjs/transaction/input/multisig.cjs} +112 -18
- package/{lib/transaction/input/publickey.js → cjs/transaction/input/publickey.cjs} +29 -19
- package/{lib/transaction/input/publickeyhash.js → cjs/transaction/input/publickeyhash.cjs} +25 -17
- package/{lib/transaction/output.js → cjs/transaction/output.cjs} +100 -15
- package/cjs/transaction/sighash.cjs +187 -0
- package/{lib/transaction/signature.js → cjs/transaction/signature.cjs} +30 -6
- package/cjs/transaction/transaction.cjs +2000 -0
- package/{lib/transaction/unspentoutput.js → cjs/transaction/unspentoutput.cjs} +5 -5
- package/cjs/util/derivation.cjs +53 -0
- package/cjs/util/index.cjs +11 -0
- package/cjs/util/js.cjs +95 -0
- package/{lib/util/preconditions.js → cjs/util/preconditions.cjs} +2 -2
- package/esm/address.js +483 -0
- package/{lib → esm}/block/block.js +82 -27
- package/esm/block/blockheader.js +296 -0
- package/esm/block/index.js +2 -0
- package/esm/block/merkleblock.js +331 -0
- package/esm/bn.js +3411 -0
- package/esm/crypto/bn.js +278 -0
- package/esm/crypto/ecdsa.js +475 -0
- package/{lib/crypto/hash.browser.js → esm/crypto/hash.js} +18 -7
- package/esm/crypto/index.js +16 -0
- package/esm/crypto/point.js +228 -0
- package/esm/crypto/random.js +18 -0
- package/esm/crypto/signature.js +475 -0
- package/esm/encoding/base58.js +167 -0
- package/esm/encoding/base58check.js +192 -0
- package/esm/encoding/bufferreader.js +333 -0
- package/esm/encoding/bufferwriter.js +243 -0
- package/esm/encoding/decode-asm.js +24 -0
- package/esm/encoding/decode-hex.js +32 -0
- package/esm/encoding/decode-script-chunks.js +43 -0
- package/esm/encoding/encode-hex.js +284 -0
- package/esm/encoding/index.js +14 -0
- package/esm/encoding/is-hex.js +7 -0
- package/esm/encoding/varint.js +116 -0
- package/esm/errors/index.js +54 -0
- package/esm/errors/spec.js +314 -0
- package/esm/hash-cache.js +98 -0
- package/esm/hdprivatekey.js +768 -0
- package/esm/hdpublickey.js +549 -0
- package/esm/index.js +66 -0
- package/esm/interpreter/index.js +2 -0
- package/{lib/script → esm/interpreter}/interpreter.js +219 -66
- package/esm/interpreter/stack.js +116 -0
- package/esm/message/message.js +228 -0
- package/esm/mnemonic/index.js +3 -0
- package/esm/mnemonic/mnemonic.js +332 -0
- package/{lib/mnemonic/pbkdf2.browser.js → esm/mnemonic/pbkdf2.js} +13 -6
- package/esm/mnemonic/words/chinese.js +2054 -0
- package/esm/mnemonic/words/english.js +2054 -0
- package/esm/mnemonic/words/french.js +2054 -0
- package/esm/mnemonic/words/index.js +66 -0
- package/esm/mnemonic/words/italian.js +2054 -0
- package/esm/mnemonic/words/japanese.js +2054 -0
- package/esm/mnemonic/words/spanish.js +2054 -0
- package/esm/network.js +13 -0
- package/{lib → esm}/networks.js +61 -120
- package/esm/opcode.js +319 -0
- package/{lib → esm}/privatekey.js +76 -28
- package/esm/publickey.js +384 -0
- package/esm/script/index.js +2 -0
- package/esm/script/script.js +1329 -0
- package/esm/script/write-i32-le.js +17 -0
- package/esm/script/write-push-data.js +35 -0
- package/esm/script/write-u16-le.js +12 -0
- package/esm/script/write-u32-le.js +16 -0
- package/esm/script/write-u64-le.js +24 -0
- package/esm/script/write-u8-le.js +8 -0
- package/esm/script/write-varint.js +46 -0
- package/esm/transaction/index.js +5 -0
- package/esm/transaction/input/index.js +33 -0
- package/{lib → esm}/transaction/input/input.js +132 -90
- package/esm/transaction/input/multisig.js +335 -0
- package/esm/transaction/input/publickey.js +108 -0
- package/esm/transaction/input/publickeyhash.js +124 -0
- package/esm/transaction/output.js +316 -0
- package/{lib → esm}/transaction/sighash.js +42 -22
- package/esm/transaction/signature.js +120 -0
- package/{lib → esm}/transaction/transaction.js +522 -163
- package/esm/transaction/unspentoutput.js +112 -0
- package/esm/util/_.js +47 -0
- package/esm/util/derivation.js +53 -0
- package/esm/util/index.js +12 -0
- package/esm/util/js.js +95 -0
- package/esm/util/preconditions.js +33 -0
- package/fixup.cjs +17 -0
- package/package.json +18 -4
- package/test/{address.js → address.cjs} +14 -43
- package/test/block/{block.js → block.cjs} +3 -5
- package/test/block/{blockheader.js → blockheader.cjs} +2 -2
- package/test/block/{merklebloack.js → merklebloack.cjs} +2 -2
- package/test/crypto/{ecdsa.js → ecdsa.cjs} +9 -9
- package/test/crypto/{hash.browser.js → hash.browser.cjs} +2 -1
- package/test/crypto/{signature.js → signature.cjs} +2 -2
- package/test/data/bitcoind/script_tests.json +5 -5
- package/test/{hashCache.js → hashCache.cjs} +2 -1
- package/test/{hdkeys.js → hdkeys.cjs} +4 -2
- package/test/{hdprivatekey.js → hdprivatekey.cjs} +7 -6
- package/test/{hdpublickey.js → hdpublickey.cjs} +2 -7
- package/test/mnemonic/{pbkdf2.test.js → pbkdf2.test.cjs} +2 -2
- package/test/{networks.js → networks.cjs} +12 -31
- package/test/{publickey.js → publickey.cjs} +2 -2
- package/test/script/{interpreter.js → interpreter.cjs} +5 -5
- package/test/script/{script.js → script.cjs} +8 -2
- package/test/transaction/{deserialize.js → deserialize.cjs} +2 -2
- package/test/transaction/input/{input.js → input.cjs} +1 -1
- package/test/transaction/input/{multisig.js → multisig.cjs} +2 -1
- package/test/transaction/input/{publickeyhash.js → publickeyhash.cjs} +1 -1
- package/test/transaction/{sighash.js → sighash.cjs} +1 -1
- package/test/transaction/{transaction.js → transaction.cjs} +2 -2
- package/tsconfig.json +13 -0
- package/types/address.d.cts +252 -0
- package/types/block/block.d.cts +139 -0
- package/types/block/blockheader.d.cts +125 -0
- package/types/block/index.d.cts +2 -0
- package/types/block/merkleblock.d.cts +95 -0
- package/types/bn.d.cts +202 -0
- package/types/crypto/bn.d.cts +2 -0
- package/types/crypto/ecdsa.d.cts +187 -0
- package/types/crypto/hash.d.cts +118 -0
- package/types/crypto/index.d.cts +7 -0
- package/types/crypto/point.d.cts +134 -0
- package/types/crypto/random.d.cts +13 -0
- package/types/crypto/signature.d.cts +160 -0
- package/types/encoding/base58.d.cts +106 -0
- package/types/encoding/base58check.d.cts +107 -0
- package/types/encoding/bufferreader.d.cts +164 -0
- package/types/encoding/bufferwriter.d.cts +126 -0
- package/types/encoding/decode-asm.d.cts +2 -0
- package/types/encoding/decode-hex.d.cts +2 -0
- package/types/encoding/decode-script-chunks.d.cts +14 -0
- package/types/encoding/encode-hex.d.cts +2 -0
- package/types/encoding/index.d.cts +6 -0
- package/types/encoding/is-hex.d.cts +2 -0
- package/types/encoding/varint.d.cts +66 -0
- package/types/errors/index.d.cts +4 -0
- package/types/errors/spec.d.cts +22 -0
- package/types/hash-cache.d.cts +65 -0
- package/types/hdprivatekey.d.cts +281 -0
- package/types/hdpublickey.d.cts +240 -0
- package/types/index.d.cts +26 -0
- package/types/interpreter/index.d.cts +2 -0
- package/types/interpreter/interpreter.d.cts +228 -0
- package/types/interpreter/stack.d.cts +35 -0
- package/types/message/message.d.cts +110 -0
- package/types/mnemonic/index.d.cts +2 -0
- package/types/mnemonic/mnemonic.d.cts +171 -0
- package/types/mnemonic/pbkdf2.d.cts +14 -0
- package/types/mnemonic/words/chinese.d.cts +2 -0
- package/types/mnemonic/words/english.d.cts +2 -0
- package/types/mnemonic/words/french.d.cts +2 -0
- package/types/mnemonic/words/index.d.cts +22 -0
- package/types/mnemonic/words/italian.d.cts +2 -0
- package/types/mnemonic/words/japanese.d.cts +2 -0
- package/types/mnemonic/words/spanish.d.cts +2 -0
- package/types/network.d.cts +11 -0
- package/types/networks.d.cts +76 -0
- package/types/opcode.d.cts +93 -0
- package/types/privatekey.d.cts +169 -0
- package/types/publickey.d.cts +202 -0
- package/types/script/index.d.cts +2 -0
- package/types/script/script.d.cts +449 -0
- package/types/script/write-i32-le.d.cts +2 -0
- package/types/script/write-push-data.d.cts +2 -0
- package/types/script/write-u16-le.d.cts +2 -0
- package/types/script/write-u32-le.d.cts +2 -0
- package/types/script/write-u64-le.d.cts +2 -0
- package/types/script/write-u8-le.d.cts +2 -0
- package/types/script/write-varint.d.cts +2 -0
- package/types/transaction/index.d.cts +2 -0
- package/types/transaction/input/index.d.cts +2 -0
- package/types/transaction/input/input.d.cts +178 -0
- package/types/transaction/input/multisig.d.cts +127 -0
- package/types/transaction/input/publickey.d.cts +44 -0
- package/types/transaction/input/publickeyhash.d.cts +45 -0
- package/types/transaction/output.d.cts +118 -0
- package/types/transaction/sighash.d.cts +61 -0
- package/types/transaction/signature.d.cts +43 -0
- package/types/transaction/transaction.d.cts +716 -0
- package/types/transaction/unspentoutput.d.cts +83 -0
- package/types/util/_.d.cts +26 -0
- package/types/util/derivation.d.cts +21 -0
- package/types/util/index.d.cts +5 -0
- package/types/util/js.d.cts +50 -0
- package/types/util/preconditions.d.cts +3 -0
- package/index.d.ts +0 -1541
- package/index.js +0 -74
- package/lib/block/index.js +0 -4
- package/lib/bn.js +0 -3423
- package/lib/crypto/hash.js +0 -2
- package/lib/crypto/random.browser.js +0 -28
- package/lib/crypto/random.js +0 -2
- package/lib/crypto/random.node.js +0 -11
- package/lib/encoding/base58check.js +0 -121
- package/lib/encoding/bufferreader.js +0 -212
- package/lib/encoding/bufferwriter.js +0 -140
- package/lib/encoding/varint.js +0 -75
- package/lib/hash-cache.js +0 -50
- package/lib/mnemonic/pbkdf2.js +0 -2
- package/lib/mnemonic/words/index.js +0 -8
- package/lib/script/index.js +0 -5
- package/lib/transaction/index.js +0 -7
- package/lib/transaction/input/index.js +0 -5
- package/lib/util/js.js +0 -90
- /package/{lib/encoding/decode-script-chunks.js → cjs/encoding/decode-script-chunks.cjs} +0 -0
- /package/{lib/encoding/encode-hex.js → cjs/encoding/encode-hex.cjs} +0 -0
- /package/{lib/encoding/is-hex.js → cjs/encoding/is-hex.cjs} +0 -0
- /package/{lib/mnemonic/words/chinese.js → cjs/mnemonic/words/chinese.cjs} +0 -0
- /package/{lib/mnemonic/words/english.js → cjs/mnemonic/words/english.cjs} +0 -0
- /package/{lib/mnemonic/words/french.js → cjs/mnemonic/words/french.cjs} +0 -0
- /package/{lib/mnemonic/words/italian.js → cjs/mnemonic/words/italian.cjs} +0 -0
- /package/{lib/mnemonic/words/japanese.js → cjs/mnemonic/words/japanese.cjs} +0 -0
- /package/{lib/mnemonic/words/spanish.js → cjs/mnemonic/words/spanish.cjs} +0 -0
- /package/{lib/script/write-i32-le.js → cjs/script/write-i32-le.cjs} +0 -0
- /package/{lib/script/write-push-data.js → cjs/script/write-push-data.cjs} +0 -0
- /package/{lib/script/write-u16-le.js → cjs/script/write-u16-le.cjs} +0 -0
- /package/{lib/script/write-u32-le.js → cjs/script/write-u32-le.cjs} +0 -0
- /package/{lib/script/write-u64-le.js → cjs/script/write-u64-le.cjs} +0 -0
- /package/{lib/script/write-u8-le.js → cjs/script/write-u8-le.cjs} +0 -0
- /package/{lib/script/write-varint.js → cjs/script/write-varint.cjs} +0 -0
- /package/{lib/util/_.js → cjs/util/_.cjs} +0 -0
- /package/test/crypto/{bn.js → bn.cjs} +0 -0
- /package/test/crypto/{hash.js → hash.cjs} +0 -0
- /package/test/crypto/{point.js → point.cjs} +0 -0
- /package/test/crypto/{random.js → random.cjs} +0 -0
- /package/test/data/{blk86756-testnet.js → blk86756-testnet.cjs} +0 -0
- /package/test/data/{merkleblocks.js → merkleblocks.cjs} +0 -0
- /package/test/encoding/{base58.js → base58.cjs} +0 -0
- /package/test/encoding/{base58check.js → base58check.cjs} +0 -0
- /package/test/encoding/{bufferreader.js → bufferreader.cjs} +0 -0
- /package/test/encoding/{bufferwriter.js → bufferwriter.cjs} +0 -0
- /package/test/encoding/{varint.js → varint.cjs} +0 -0
- /package/test/{index.js → index.cjs} +0 -0
- /package/test/message/{message.js → message.cjs} +0 -0
- /package/test/mnemonic/{mnemonic.js → mnemonic.cjs} +0 -0
- /package/test/{opcode.js → opcode.cjs} +0 -0
- /package/test/{privatekey.js → privatekey.cjs} +0 -0
- /package/test/transaction/input/{publickey.js → publickey.cjs} +0 -0
- /package/test/transaction/{output.js → output.cjs} +0 -0
- /package/test/transaction/{signature.js → signature.cjs} +0 -0
- /package/test/transaction/{unspentoutput.js → unspentoutput.cjs} +0 -0
- /package/test/util/{js.js → js.cjs} +0 -0
- /package/test/util/{preconditions.js → preconditions.cjs} +0 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export = UnspentOutput;
|
|
2
|
+
/**
|
|
3
|
+
* Represents an unspent output information: its script, associated amount and address,
|
|
4
|
+
* transaction id and output index.
|
|
5
|
+
*
|
|
6
|
+
* @constructor
|
|
7
|
+
* @param {object} data
|
|
8
|
+
* @param {string} data.txid the previous transaction id
|
|
9
|
+
* @param {string=} data.txId alias for `txid`
|
|
10
|
+
* @param {number} data.vout the index in the transaction
|
|
11
|
+
* @param {number=} data.outputIndex alias for `vout`
|
|
12
|
+
* @param {string|Script} data.scriptPubKey the script that must be resolved to release the funds
|
|
13
|
+
* @param {string|Script=} data.script alias for `scriptPubKey`
|
|
14
|
+
* @param {number} data.amount amount of bitcoins associated
|
|
15
|
+
* @param {number=} data.satoshis alias for `amount`, but expressed in satoshis (1 OPCAT = 1e8 satoshis)
|
|
16
|
+
* @param {string|Address=} data.address the associated address to the script, if provided
|
|
17
|
+
*/
|
|
18
|
+
declare function UnspentOutput(data: {
|
|
19
|
+
txid: string;
|
|
20
|
+
txId?: string | undefined;
|
|
21
|
+
vout: number;
|
|
22
|
+
outputIndex?: number | undefined;
|
|
23
|
+
scriptPubKey: string | Script;
|
|
24
|
+
script?: (string | Script) | undefined;
|
|
25
|
+
amount: number;
|
|
26
|
+
satoshis?: number | undefined;
|
|
27
|
+
address?: (string | Address) | undefined;
|
|
28
|
+
}): UnspentOutput;
|
|
29
|
+
declare class UnspentOutput {
|
|
30
|
+
/**
|
|
31
|
+
* Represents an unspent output information: its script, associated amount and address,
|
|
32
|
+
* transaction id and output index.
|
|
33
|
+
*
|
|
34
|
+
* @constructor
|
|
35
|
+
* @param {object} data
|
|
36
|
+
* @param {string} data.txid the previous transaction id
|
|
37
|
+
* @param {string=} data.txId alias for `txid`
|
|
38
|
+
* @param {number} data.vout the index in the transaction
|
|
39
|
+
* @param {number=} data.outputIndex alias for `vout`
|
|
40
|
+
* @param {string|Script} data.scriptPubKey the script that must be resolved to release the funds
|
|
41
|
+
* @param {string|Script=} data.script alias for `scriptPubKey`
|
|
42
|
+
* @param {number} data.amount amount of bitcoins associated
|
|
43
|
+
* @param {number=} data.satoshis alias for `amount`, but expressed in satoshis (1 OPCAT = 1e8 satoshis)
|
|
44
|
+
* @param {string|Address=} data.address the associated address to the script, if provided
|
|
45
|
+
*/
|
|
46
|
+
constructor(data: {
|
|
47
|
+
txid: string;
|
|
48
|
+
txId?: string | undefined;
|
|
49
|
+
vout: number;
|
|
50
|
+
outputIndex?: number | undefined;
|
|
51
|
+
scriptPubKey: string | Script;
|
|
52
|
+
script?: (string | Script) | undefined;
|
|
53
|
+
amount: number;
|
|
54
|
+
satoshis?: number | undefined;
|
|
55
|
+
address?: (string | Address) | undefined;
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Provide an informative output when displaying this object in the console
|
|
59
|
+
* @returns string
|
|
60
|
+
*/
|
|
61
|
+
inspect(): string;
|
|
62
|
+
/**
|
|
63
|
+
* String representation: just "txid:index"
|
|
64
|
+
* @returns string
|
|
65
|
+
*/
|
|
66
|
+
toString(): string;
|
|
67
|
+
/**
|
|
68
|
+
* Returns a plain object (no prototype or methods) with the associated info for this output
|
|
69
|
+
* @return {object}
|
|
70
|
+
*/
|
|
71
|
+
toObject: () => object;
|
|
72
|
+
toJSON(): object;
|
|
73
|
+
}
|
|
74
|
+
declare namespace UnspentOutput {
|
|
75
|
+
/**
|
|
76
|
+
* Deserialize an UnspentOutput from an object
|
|
77
|
+
* @param {object|string} data
|
|
78
|
+
* @return UnspentOutput
|
|
79
|
+
*/
|
|
80
|
+
function fromObject(data: any): UnspentOutput;
|
|
81
|
+
}
|
|
82
|
+
import Script = require("../script/script.cjs");
|
|
83
|
+
import Address = require("../address.cjs");
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export function isArray(t: any): boolean;
|
|
2
|
+
export function isNumber(t: any): boolean;
|
|
3
|
+
export function isObject(t: any): boolean;
|
|
4
|
+
export function isString(t: any): boolean;
|
|
5
|
+
export function isUndefined(t: any): boolean;
|
|
6
|
+
export function isFunction(t: any): boolean;
|
|
7
|
+
export function isNull(t: any): boolean;
|
|
8
|
+
export function isDate(t: any): boolean;
|
|
9
|
+
export function extend(a: any, b: any): any;
|
|
10
|
+
export function noop(): void;
|
|
11
|
+
export function every(a: any, f: any): any;
|
|
12
|
+
export function map(a: any, f: any): any[];
|
|
13
|
+
export function includes(a: any, e: any): any;
|
|
14
|
+
export function each(a: any, f: any): any;
|
|
15
|
+
export function clone(o: any): any;
|
|
16
|
+
export function pick(object: any, keys: any): {};
|
|
17
|
+
export function values(o: any): any[];
|
|
18
|
+
export function filter(a: any, f: any): any;
|
|
19
|
+
export function reduce(a: any, f: any, s: any): any;
|
|
20
|
+
export function without(a: any, n: any): any;
|
|
21
|
+
export function shuffle(a: any): any;
|
|
22
|
+
export function difference(a: any, b: any): any;
|
|
23
|
+
export function findIndex(a: any, f: any): any;
|
|
24
|
+
export function some(a: any, f: any): any;
|
|
25
|
+
export function range(n: any): any[];
|
|
26
|
+
export function isPositiveNumber(n: any): boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export = Derivation;
|
|
2
|
+
/**
|
|
3
|
+
* Represents a derivation function or class (purpose to be determined based on implementation).
|
|
4
|
+
* @constructor
|
|
5
|
+
*/
|
|
6
|
+
declare function Derivation(): void;
|
|
7
|
+
declare class Derivation {
|
|
8
|
+
}
|
|
9
|
+
declare namespace Derivation {
|
|
10
|
+
let RootElementAlias: string[];
|
|
11
|
+
let Hardened: number;
|
|
12
|
+
/**
|
|
13
|
+
* function that splits a string path into a derivation index array.
|
|
14
|
+
* It will return null if the string path is malformed.
|
|
15
|
+
* It does not validate if indexes are in bounds.
|
|
16
|
+
*
|
|
17
|
+
* @param {string} path
|
|
18
|
+
* @return {Array}
|
|
19
|
+
*/
|
|
20
|
+
function getDerivationIndexes(path: string): any[];
|
|
21
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export = JSUtil;
|
|
2
|
+
/**
|
|
3
|
+
* Utility functions for JavaScript operations.
|
|
4
|
+
* @constructor
|
|
5
|
+
*/
|
|
6
|
+
declare function JSUtil(): void;
|
|
7
|
+
declare class JSUtil {
|
|
8
|
+
}
|
|
9
|
+
declare namespace JSUtil {
|
|
10
|
+
/**
|
|
11
|
+
* Determines whether a string contains only hexadecimal values
|
|
12
|
+
*
|
|
13
|
+
* @name JSUtil.isHexa
|
|
14
|
+
* @param {string} value
|
|
15
|
+
* @return {boolean} true if the string is the hexa representation of a number
|
|
16
|
+
*/
|
|
17
|
+
export function isHexa(value: string): boolean;
|
|
18
|
+
import isHexaString = isHexa;
|
|
19
|
+
export { isHexaString };
|
|
20
|
+
/**
|
|
21
|
+
* Checks that a value is a natural number, a positive integer or zero.
|
|
22
|
+
*
|
|
23
|
+
* @param {*} value
|
|
24
|
+
* @return {Boolean}
|
|
25
|
+
*/
|
|
26
|
+
export function isNaturalNumber(value: any): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Transform a 4-byte integer (unsigned value) into a Buffer of length 4 (Big Endian Byte Order)
|
|
29
|
+
*
|
|
30
|
+
* @param {number} integer
|
|
31
|
+
* @return {Buffer}
|
|
32
|
+
*/
|
|
33
|
+
export function integerAsBuffer(integer: number): Buffer;
|
|
34
|
+
/**
|
|
35
|
+
* Test if an argument is a valid JSON object. If it is, returns a truthy
|
|
36
|
+
* value (the json object decoded), so no double JSON.parse call is necessary
|
|
37
|
+
*
|
|
38
|
+
* @param {string} arg
|
|
39
|
+
* @return {Object|boolean} false if the argument is not a JSON string.
|
|
40
|
+
*/
|
|
41
|
+
export function isValidJSON(arg: string): any;
|
|
42
|
+
/**
|
|
43
|
+
* Define immutable properties on a target object
|
|
44
|
+
*
|
|
45
|
+
* @param {Object} target - An object to be extended
|
|
46
|
+
* @param {Object} values - An object of properties
|
|
47
|
+
* @return {Object} The target object
|
|
48
|
+
*/
|
|
49
|
+
export function defineImmutable(target: any, values: any): any;
|
|
50
|
+
}
|