@bsv/sdk 1.0.12 → 1.0.14

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.
Files changed (119) hide show
  1. package/dist/cjs/package.json +1 -1
  2. package/dist/cjs/src/compat/BSM.js.map +1 -1
  3. package/dist/cjs/src/compat/ECIES.js +105 -76
  4. package/dist/cjs/src/compat/ECIES.js.map +1 -1
  5. package/dist/cjs/src/compat/HD.js +65 -65
  6. package/dist/cjs/src/compat/HD.js.map +1 -1
  7. package/dist/cjs/src/compat/Mnemonic.js +79 -79
  8. package/dist/cjs/src/compat/Mnemonic.js.map +1 -1
  9. package/dist/cjs/src/compat/bip-39-wordlist-en.js +2 -2
  10. package/dist/cjs/src/compat/bip-39-wordlist-en.js.map +1 -1
  11. package/dist/cjs/src/primitives/AESGCM.js.map +1 -1
  12. package/dist/cjs/src/primitives/BigNumber.js.map +1 -1
  13. package/dist/cjs/src/primitives/DRBG.js.map +1 -1
  14. package/dist/cjs/src/primitives/ECDSA.js.map +1 -1
  15. package/dist/cjs/src/primitives/Hash.js +26 -13
  16. package/dist/cjs/src/primitives/Hash.js.map +1 -1
  17. package/dist/cjs/src/primitives/PrivateKey.js +3 -2
  18. package/dist/cjs/src/primitives/PrivateKey.js.map +1 -1
  19. package/dist/cjs/src/primitives/PublicKey.js +1 -2
  20. package/dist/cjs/src/primitives/PublicKey.js.map +1 -1
  21. package/dist/cjs/src/primitives/Random.js +2 -2
  22. package/dist/cjs/src/primitives/Random.js.map +1 -1
  23. package/dist/cjs/src/primitives/Signature.js +141 -4
  24. package/dist/cjs/src/primitives/Signature.js.map +1 -1
  25. package/dist/cjs/src/primitives/SymmetricKey.js.map +1 -1
  26. package/dist/cjs/src/primitives/TransactionSignature.js.map +1 -1
  27. package/dist/cjs/src/primitives/utils.js +14 -9
  28. package/dist/cjs/src/primitives/utils.js.map +1 -1
  29. package/dist/cjs/src/script/Spend.js.map +1 -1
  30. package/dist/cjs/src/script/templates/P2PKH.js +1 -1
  31. package/dist/cjs/src/script/templates/P2PKH.js.map +1 -1
  32. package/dist/cjs/src/transaction/MerklePath.js +3 -3
  33. package/dist/cjs/src/transaction/MerklePath.js.map +1 -1
  34. package/dist/cjs/src/transaction/Transaction.js +15 -4
  35. package/dist/cjs/src/transaction/Transaction.js.map +1 -1
  36. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  37. package/dist/esm/src/compat/BSM.js.map +1 -1
  38. package/dist/esm/src/compat/ECIES.js +105 -76
  39. package/dist/esm/src/compat/ECIES.js.map +1 -1
  40. package/dist/esm/src/compat/HD.js +65 -65
  41. package/dist/esm/src/compat/HD.js.map +1 -1
  42. package/dist/esm/src/compat/Mnemonic.js +79 -79
  43. package/dist/esm/src/compat/Mnemonic.js.map +1 -1
  44. package/dist/esm/src/compat/bip-39-wordlist-en.js +2 -2
  45. package/dist/esm/src/compat/bip-39-wordlist-en.js.map +1 -1
  46. package/dist/esm/src/primitives/AESGCM.js.map +1 -1
  47. package/dist/esm/src/primitives/BigNumber.js.map +1 -1
  48. package/dist/esm/src/primitives/DRBG.js.map +1 -1
  49. package/dist/esm/src/primitives/ECDSA.js.map +1 -1
  50. package/dist/esm/src/primitives/Hash.js +26 -13
  51. package/dist/esm/src/primitives/Hash.js.map +1 -1
  52. package/dist/esm/src/primitives/PrivateKey.js +3 -2
  53. package/dist/esm/src/primitives/PrivateKey.js.map +1 -1
  54. package/dist/esm/src/primitives/PublicKey.js +1 -2
  55. package/dist/esm/src/primitives/PublicKey.js.map +1 -1
  56. package/dist/esm/src/primitives/Random.js +2 -2
  57. package/dist/esm/src/primitives/Random.js.map +1 -1
  58. package/dist/esm/src/primitives/Signature.js +141 -4
  59. package/dist/esm/src/primitives/Signature.js.map +1 -1
  60. package/dist/esm/src/primitives/SymmetricKey.js.map +1 -1
  61. package/dist/esm/src/primitives/TransactionSignature.js.map +1 -1
  62. package/dist/esm/src/primitives/utils.js +14 -9
  63. package/dist/esm/src/primitives/utils.js.map +1 -1
  64. package/dist/esm/src/script/Spend.js.map +1 -1
  65. package/dist/esm/src/script/templates/P2PKH.js +1 -1
  66. package/dist/esm/src/script/templates/P2PKH.js.map +1 -1
  67. package/dist/esm/src/transaction/MerklePath.js +3 -3
  68. package/dist/esm/src/transaction/MerklePath.js.map +1 -1
  69. package/dist/esm/src/transaction/Transaction.js +16 -4
  70. package/dist/esm/src/transaction/Transaction.js.map +1 -1
  71. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  72. package/dist/types/src/compat/ECIES.d.ts +36 -36
  73. package/dist/types/src/compat/ECIES.d.ts.map +1 -1
  74. package/dist/types/src/compat/HD.d.ts +65 -65
  75. package/dist/types/src/compat/HD.d.ts.map +1 -1
  76. package/dist/types/src/compat/Mnemonic.d.ts +79 -79
  77. package/dist/types/src/compat/Mnemonic.d.ts.map +1 -1
  78. package/dist/types/src/primitives/AESGCM.d.ts.map +1 -1
  79. package/dist/types/src/primitives/BigNumber.d.ts.map +1 -1
  80. package/dist/types/src/primitives/Hash.d.ts.map +1 -1
  81. package/dist/types/src/primitives/PrivateKey.d.ts.map +1 -1
  82. package/dist/types/src/primitives/PublicKey.d.ts.map +1 -1
  83. package/dist/types/src/primitives/Signature.d.ts +62 -0
  84. package/dist/types/src/primitives/Signature.d.ts.map +1 -1
  85. package/dist/types/src/primitives/SymmetricKey.d.ts.map +1 -1
  86. package/dist/types/src/primitives/TransactionSignature.d.ts.map +1 -1
  87. package/dist/types/src/primitives/utils.d.ts.map +1 -1
  88. package/dist/types/src/script/Spend.d.ts.map +1 -1
  89. package/dist/types/src/transaction/Transaction.d.ts +1 -0
  90. package/dist/types/src/transaction/Transaction.d.ts.map +1 -1
  91. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  92. package/docs/compat.md +4 -4
  93. package/docs/primitives.md +288 -79
  94. package/package.json +1 -1
  95. package/src/compat/BSM.ts +12 -12
  96. package/src/compat/ECIES.ts +417 -418
  97. package/src/compat/HD.ts +228 -228
  98. package/src/compat/Mnemonic.ts +173 -173
  99. package/src/compat/__tests/BSM.test.ts +13 -2
  100. package/src/compat/bip-39-wordlist-en.ts +2052 -2052
  101. package/src/primitives/AESGCM.ts +30 -30
  102. package/src/primitives/BigNumber.ts +0 -1
  103. package/src/primitives/DRBG.ts +5 -5
  104. package/src/primitives/ECDSA.ts +1 -1
  105. package/src/primitives/Hash.ts +278 -293
  106. package/src/primitives/PrivateKey.ts +18 -19
  107. package/src/primitives/PublicKey.ts +9 -10
  108. package/src/primitives/Random.ts +4 -4
  109. package/src/primitives/Signature.ts +158 -14
  110. package/src/primitives/SymmetricKey.ts +3 -3
  111. package/src/primitives/TransactionSignature.ts +9 -9
  112. package/src/primitives/index.ts +1 -1
  113. package/src/primitives/utils.ts +60 -64
  114. package/src/script/Spend.ts +12 -12
  115. package/src/script/index.ts +1 -1
  116. package/src/script/templates/P2PKH.ts +1 -1
  117. package/src/transaction/MerklePath.ts +3 -3
  118. package/src/transaction/Transaction.ts +36 -26
  119. package/src/transaction/__tests/Transaction.test.ts +5 -5
@@ -1,24 +1,27 @@
1
1
  # API
2
2
 
3
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
3
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4
+
5
+ ## Interfaces
4
6
 
5
7
  ## Classes
6
8
 
7
9
  | | |
8
10
  | --- | --- |
9
- | [BasePoint](#class-basepoint) | [RIPEMD160](#class-ripemd160) |
10
- | [BigNumber](#class-bignumber) | [Reader](#class-reader) |
11
- | [Curve](#class-curve) | [ReductionContext](#class-reductioncontext) |
12
- | [DRBG](#class-drbg) | [SHA1](#class-sha1) |
13
- | [JacobianPoint](#class-jacobianpoint) | [SHA256](#class-sha256) |
14
- | [K256](#class-k256) | [SHA256HMAC](#class-sha256hmac) |
15
- | [Mersenne](#class-mersenne) | [SHA512](#class-sha512) |
16
- | [MontgomoryMethod](#class-montgomorymethod) | [SHA512HMAC](#class-sha512hmac) |
17
- | [Point](#class-point) | [Signature](#class-signature) |
18
- | [PrivateKey](#class-privatekey) | [SymmetricKey](#class-symmetrickey) |
11
+ | [BasePoint](#class-basepoint) | [Reader](#class-reader) |
12
+ | [BigNumber](#class-bignumber) | [ReductionContext](#class-reductioncontext) |
13
+ | [Curve](#class-curve) | [SHA1](#class-sha1) |
14
+ | [DRBG](#class-drbg) | [SHA256](#class-sha256) |
15
+ | [JacobianPoint](#class-jacobianpoint) | [SHA256HMAC](#class-sha256hmac) |
16
+ | [K256](#class-k256) | [SHA512](#class-sha512) |
17
+ | [Mersenne](#class-mersenne) | [SHA512HMAC](#class-sha512hmac) |
18
+ | [MontgomoryMethod](#class-montgomorymethod) | [Signature](#class-signature) |
19
+ | [Point](#class-point) | [SymmetricKey](#class-symmetrickey) |
20
+ | [PrivateKey](#class-privatekey) | [TransactionSignature](#class-transactionsignature) |
19
21
  | [PublicKey](#class-publickey) | [Writer](#class-writer) |
22
+ | [RIPEMD160](#class-ripemd160) | |
20
23
 
21
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
24
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
22
25
 
23
26
  ---
24
27
 
@@ -166,7 +169,7 @@ mersenne.split(new BigNumber('2345', 16), new BigNumber());
166
169
 
167
170
  </details>
168
171
 
169
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
172
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
170
173
 
171
174
  ---
172
175
  ### Class: K256
@@ -259,7 +262,7 @@ k256.split(input, output);
259
262
 
260
263
  </details>
261
264
 
262
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
265
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
263
266
 
264
267
  ---
265
268
  ### Class: ReductionContext
@@ -792,7 +795,7 @@ this.verify2(new BigNumber(10).toRed(this), new BigNumber(20)); //throws an Erro
792
795
 
793
796
  </details>
794
797
 
795
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
798
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
796
799
 
797
800
  ---
798
801
  ### Class: BigNumber
@@ -1350,7 +1353,7 @@ let result = a.cmpn(10); // 1
1350
1353
 
1351
1354
  #### Method copy
1352
1355
 
1353
- The copy method creates and returns a separate identical copy of the BigNumber.
1356
+ The copy method copies the state of this BigNumber into an exsiting `dest` BigNumber.
1354
1357
 
1355
1358
  ```ts
1356
1359
  copy(dest: BigNumber): void
@@ -1359,14 +1362,14 @@ copy(dest: BigNumber): void
1359
1362
  Argument Details
1360
1363
 
1361
1364
  + **dest**
1362
- + The BigNumber instance that will be made into a copy.
1365
+ + The BigNumber instance that will be updated to become a copy.
1363
1366
 
1364
1367
  Example
1365
1368
 
1366
1369
  ```ts
1367
1370
  const bn1 = new BigNumber('123456', 10, 'be');
1368
1371
  const bn2 = new BigNumber();
1369
- bn1.cop(bn2);
1372
+ bn1.copy(bn2);
1370
1373
  // bn2 is now a BigNumber representing 123456
1371
1374
  ```
1372
1375
 
@@ -4178,7 +4181,7 @@ const zeroBits = bn.zeroBits(); // 3
4178
4181
 
4179
4182
  </details>
4180
4183
 
4181
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4184
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4182
4185
 
4183
4186
  ---
4184
4187
  ### Class: MontgomoryMethod
@@ -4389,7 +4392,7 @@ const product = montMethod.mul(a, b);
4389
4392
 
4390
4393
  </details>
4391
4394
 
4392
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4395
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4393
4396
 
4394
4397
  ---
4395
4398
  ### Class: BasePoint
@@ -4416,7 +4419,7 @@ export default abstract class BasePoint {
4416
4419
  }
4417
4420
  ```
4418
4421
 
4419
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4422
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4420
4423
 
4421
4424
  ---
4422
4425
  ### Class: JacobianPoint
@@ -4743,7 +4746,7 @@ const pointP = pointJ.toP(); // The point in affine coordinates.
4743
4746
 
4744
4747
  </details>
4745
4748
 
4746
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4749
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4747
4750
 
4748
4751
  ---
4749
4752
  ### Class: RIPEMD160
@@ -4783,7 +4786,7 @@ h: number[]
4783
4786
 
4784
4787
  </details>
4785
4788
 
4786
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4789
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4787
4790
 
4788
4791
  ---
4789
4792
  ### Class: SHA256
@@ -4842,7 +4845,7 @@ k: number[]
4842
4845
 
4843
4846
  </details>
4844
4847
 
4845
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4848
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4846
4849
 
4847
4850
  ---
4848
4851
  ### Class: SHA1
@@ -4900,7 +4903,7 @@ k: number[]
4900
4903
 
4901
4904
  </details>
4902
4905
 
4903
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4906
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4904
4907
 
4905
4908
  ---
4906
4909
  ### Class: SHA512
@@ -4959,7 +4962,7 @@ k: number[]
4959
4962
 
4960
4963
  </details>
4961
4964
 
4962
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4965
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4963
4966
 
4964
4967
  ---
4965
4968
  ### Class: SHA256HMAC
@@ -5105,7 +5108,7 @@ myHMAC.update('deadbeef', 'hex');
5105
5108
 
5106
5109
  </details>
5107
5110
 
5108
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
5111
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
5109
5112
 
5110
5113
  ---
5111
5114
  ### Class: SHA512HMAC
@@ -5251,7 +5254,7 @@ myHMAC.update('deadbeef', 'hex');
5251
5254
 
5252
5255
  </details>
5253
5256
 
5254
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
5257
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
5255
5258
 
5256
5259
  ---
5257
5260
  ### Class: Writer
@@ -5284,7 +5287,7 @@ export class Writer {
5284
5287
  }
5285
5288
  ```
5286
5289
 
5287
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
5290
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
5288
5291
 
5289
5292
  ---
5290
5293
  ### Class: Reader
@@ -5315,7 +5318,7 @@ export class Reader {
5315
5318
  }
5316
5319
  ```
5317
5320
 
5318
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
5321
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
5319
5322
 
5320
5323
  ---
5321
5324
  ### Class: Point
@@ -5896,7 +5899,7 @@ const isValid = aPoint.validate();
5896
5899
 
5897
5900
  </details>
5898
5901
 
5899
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
5902
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
5900
5903
 
5901
5904
  ---
5902
5905
  ### Class: Curve
@@ -5964,7 +5967,7 @@ export default class Curve {
5964
5967
  }
5965
5968
  ```
5966
5969
 
5967
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
5970
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
5968
5971
 
5969
5972
  ---
5970
5973
  ### Class: DRBG
@@ -6060,7 +6063,7 @@ drbg.update('e13af...');
6060
6063
 
6061
6064
  </details>
6062
6065
 
6063
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
6066
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
6064
6067
 
6065
6068
  ---
6066
6069
  ### Class: Signature
@@ -6077,10 +6080,14 @@ export default class Signature {
6077
6080
  r: BigNumber;
6078
6081
  s: BigNumber;
6079
6082
  static fromDER(data: number[] | string, enc?: "hex" | "base64"): Signature
6083
+ static fromCompact(data: number[] | string, enc?: "hex" | "base64"): Signature
6080
6084
  constructor(r: BigNumber, s: BigNumber)
6081
6085
  verify(msg: number[] | string, key: PublicKey, enc?: "hex"): boolean
6082
6086
  toString(enc?: "hex" | "base64")
6083
6087
  toDER(enc?: "hex" | "base64"): number[] | string
6088
+ toCompact(recovery: number, compressed: boolean, enc?: "hex" | "base64"): number[] | string
6089
+ RecoverPublicKey(recovery: number, e: BigNumber): PublicKey
6090
+ CalculateRecoveryFactor(pubkey: PublicKey, msgHash: BigNumber): number
6084
6091
  }
6085
6092
  ```
6086
6093
 
@@ -6111,6 +6118,92 @@ const s = new BigNumber('564745627577...');
6111
6118
  const signature = new Signature(r, s);
6112
6119
  ```
6113
6120
 
6121
+ #### Method CalculateRecoveryFactor
6122
+
6123
+ Calculates the recovery factor which will work for a particular public key and message hash.
6124
+ This method will return the recovery factor if it finds a valid recovery factor.
6125
+ If it does not find a valid recovery factor, it will throw an error.
6126
+ The recovery factor is a number between 0 and 3.
6127
+
6128
+ ```ts
6129
+ CalculateRecoveryFactor(pubkey: PublicKey, msgHash: BigNumber): number
6130
+ ```
6131
+
6132
+ Returns
6133
+
6134
+ the recovery factor: number
6135
+ /
6136
+
6137
+ Argument Details
6138
+
6139
+ + **msgHash**
6140
+ + The message hash.
6141
+
6142
+ Example
6143
+
6144
+ ```ts
6145
+ const recovery = signature.CalculateRecoveryFactor(publicKey, msgHash);
6146
+ ```
6147
+
6148
+ #### Method RecoverPublicKey
6149
+
6150
+ Recovers the public key from a signature.
6151
+ This method will return the public key if it finds a valid public key.
6152
+ If it does not find a valid public key, it will throw an error.
6153
+ The recovery factor is a number between 0 and 3.
6154
+
6155
+ ```ts
6156
+ RecoverPublicKey(recovery: number, e: BigNumber): PublicKey
6157
+ ```
6158
+
6159
+ Returns
6160
+
6161
+ The public key associated with the signature.
6162
+
6163
+ Argument Details
6164
+
6165
+ + **recovery**
6166
+ + The recovery factor.
6167
+ + **e**
6168
+ + The message hash.
6169
+
6170
+ Example
6171
+
6172
+ ```ts
6173
+ const publicKey = signature.RecoverPublicKey(0, msgHash);
6174
+ ```
6175
+
6176
+ #### Method fromCompact
6177
+
6178
+ Takes an array of numbers or a string and returns a new Signature instance.
6179
+ This method will throw an error if the Compact encoding is invalid.
6180
+ If a string is provided, it is assumed to represent a hexadecimal sequence.
6181
+ compactByte value 27-31 means compressed public key.
6182
+ 32-35 means uncompressed public key.
6183
+ The range represents the recovery param which can be 0,1,2,3,4.
6184
+ We could support recovery functions in future if there's demand.
6185
+
6186
+ ```ts
6187
+ static fromCompact(data: number[] | string, enc?: "hex" | "base64"): Signature
6188
+ ```
6189
+
6190
+ Returns
6191
+
6192
+ The decoded data in the form of Signature instance.
6193
+
6194
+ Argument Details
6195
+
6196
+ + **data**
6197
+ + The sequence to decode from Compact encoding.
6198
+ + **enc**
6199
+ + The encoding of the data string.
6200
+
6201
+ Example
6202
+
6203
+ ```ts
6204
+ const signature = Signature.fromCompact('1b18c1f5502f8...', 'hex');
6205
+ ```
6206
+
6114
6207
  #### Method fromDER
6115
6208
 
6116
6209
  Takes an array of numbers or a string and returns a new Signature instance.
@@ -6138,6 +6231,33 @@ Example
6138
6231
  const signature = Signature.fromDER('30440220018c1f5502f8...', 'hex');
6139
6232
  ```
6140
6233
 
6234
+ #### Method toCompact
6235
+
6236
+ Converts an instance of Signature into Compact encoding.
6237
+
6238
+ If the encoding parameter is set to 'hex', the function will return a hex string.
6239
+ If 'base64', it will return a base64 string.
6240
+ Otherwise, it will return an array of numbers.
6241
+
6242
+ ```ts
6243
+ toCompact(recovery: number, compressed: boolean, enc?: "hex" | "base64"): number[] | string
6244
+ ```
6245
+
6246
+ Returns
6247
+
6248
+ The current instance in DER encoding.
6249
+
6250
+ Argument Details
6251
+
6252
+ + **enc**
6253
+ + The encoding to use for the output.
6254
+
6255
+ Example
6256
+
6257
+ ```ts
6258
+ const compact = signature.toCompact(3, true, 'base64');
6259
+ ```
6260
+
6141
6261
  #### Method toDER
6142
6262
 
6143
6263
  Converts an instance of Signature into DER encoding.
@@ -6229,7 +6349,7 @@ const isVerified = signature.verify(msg, publicKey);
6229
6349
 
6230
6350
  </details>
6231
6351
 
6232
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
6352
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
6233
6353
 
6234
6354
  ---
6235
6355
  ### Class: PrivateKey
@@ -6244,7 +6364,12 @@ export default class PrivateKey extends BigNumber {
6244
6364
  static fromRandom(): PrivateKey
6245
6365
  static fromString(str: string, base: number | "hex"): PrivateKey
6246
6366
  static fromWif(wif: string, prefixLength: number = 1): PrivateKey
6247
- constructor(number: BigNumber | number | string | number[] = 0, base: number | "be" | "le" | "hex" = 10, endian: "be" | "le" = "be")
6367
+ constructor(number: BigNumber | number | string | number[] = 0, base: number | "be" | "le" | "hex" = 10, endian: "be" | "le" = "be", modN: "apply" | "nocheck" | "error" = "apply")
6368
+ checkInField(): {
6369
+ inField: boolean;
6370
+ modN: BigNumber;
6371
+ }
6372
+ isValid(): boolean
6248
6373
  sign(msg: number[] | string, enc?: "hex" | "utf8", forceLowS: boolean = true, customK?: Function | BigNumber): Signature
6249
6374
  verify(msg: number[] | string, sig: Signature, enc?: "hex"): boolean
6250
6375
  toPublicKey(): PublicKey
@@ -6262,7 +6387,7 @@ export default class PrivateKey extends BigNumber {
6262
6387
  #### Constructor
6263
6388
 
6264
6389
  ```ts
6265
- constructor(number: BigNumber | number | string | number[] = 0, base: number | "be" | "le" | "hex" = 10, endian: "be" | "le" = "be")
6390
+ constructor(number: BigNumber | number | string | number[] = 0, base: number | "be" | "le" | "hex" = 10, endian: "be" | "le" = "be", modN: "apply" | "nocheck" | "error" = "apply")
6266
6391
  ```
6267
6392
 
6268
6393
  Argument Details
@@ -6273,6 +6398,8 @@ Argument Details
6273
6398
  + The base of number provided. By default is 10. Ignored if number is BigNumber.
6274
6399
  + **endian**
6275
6400
  + The endianness provided. By default is 'big endian'. Ignored if number is BigNumber.
6401
+ + **modN**
6402
+ + Optional. Default 'apply. If 'apply', apply modN to input to guarantee a valid PrivateKey. If 'error', if input is out of field throw Error('Input is out of field'). If 'nocheck', assumes input is in field.
6276
6403
 
6277
6404
  Example
6278
6405
 
@@ -6282,6 +6409,21 @@ import BigNumber from './BigNumber';
6282
6409
  const privKey = new PrivateKey(new BigNumber('123456', 10, 'be'));
6283
6410
  ```
6284
6411
 
6412
+ #### Method checkInField
6413
+
6414
+ A utility function to check that the value of this PrivateKey lies in the field limited by curve.n
6415
+
6416
+ ```ts
6417
+ checkInField(): {
6418
+ inField: boolean;
6419
+ modN: BigNumber;
6420
+ }
6421
+ ```
6422
+
6423
+ Returns
6424
+
6425
+ , modN } where modN is this PrivateKey's current BigNumber value mod curve.n, and inField is true only if modN equals current BigNumber value.
6426
+
6285
6427
  #### Method deriveChild
6286
6428
 
6287
6429
  Derives a child key with BRC-42.
@@ -6394,6 +6536,16 @@ Throws
6394
6536
 
6395
6537
  Will throw an error if the string is not a valid WIF.
6396
6538
 
6539
+ #### Method isValid
6540
+
6541
+ ```ts
6542
+ isValid(): boolean
6543
+ ```
6544
+
6545
+ Returns
6546
+
6547
+ true if the PrivateKey's current BigNumber value lies in the field limited by curve.n
6548
+
6397
6549
  #### Method sign
6398
6550
 
6399
6551
  Signs a message using the private key.
@@ -6490,6 +6642,10 @@ Argument Details
6490
6642
  + **prefix**
6491
6643
  + defaults to [0x80] for mainnet, set it to [0xef] for testnet.
6492
6644
 
6645
+ Throws
6646
+
6647
+ Error('Value is out of field') if current BigNumber value is out of field limited by curve.n
6648
+
6493
6649
  Example
6494
6650
 
6495
6651
  ```ts
@@ -6529,7 +6685,7 @@ const isSignatureValid = privateKey.verify('Hello, World!', signature);
6529
6685
 
6530
6686
  </details>
6531
6687
 
6532
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
6688
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
6533
6689
 
6534
6690
  ---
6535
6691
  ### Class: PublicKey
@@ -6765,7 +6921,7 @@ const isVerified = myPubKey.verify(myMessage, mySignature)
6765
6921
 
6766
6922
  </details>
6767
6923
 
6768
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
6924
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
6769
6925
 
6770
6926
  ---
6771
6927
  ### Class: SymmetricKey
@@ -6866,7 +7022,56 @@ const symmetricKey = SymmetricKey.fromRandom();
6866
7022
 
6867
7023
  </details>
6868
7024
 
6869
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7025
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7026
+
7027
+ ---
7028
+ ### Class: TransactionSignature
7029
+
7030
+ ```ts
7031
+ export default class TransactionSignature extends Signature {
7032
+ public static readonly SIGHASH_ALL = 1;
7033
+ public static readonly SIGHASH_NONE = 2;
7034
+ public static readonly SIGHASH_SINGLE = 3;
7035
+ public static readonly SIGHASH_FORKID = 64;
7036
+ public static readonly SIGHASH_ANYONECANPAY = 128;
7037
+ scope: number;
7038
+ static format(params: {
7039
+ sourceTXID: string;
7040
+ sourceOutputIndex: number;
7041
+ sourceSatoshis: number;
7042
+ transactionVersion: number;
7043
+ otherInputs: TransactionInput[];
7044
+ outputs: TransactionOutput[];
7045
+ inputIndex: number;
7046
+ subscript: Script;
7047
+ inputSequence: number;
7048
+ lockTime: number;
7049
+ scope: number;
7050
+ }): number[]
7051
+ static fromChecksigFormat(buf: number[]): TransactionSignature
7052
+ constructor(r: BigNumber, s: BigNumber, scope: number)
7053
+ public hasLowS(): boolean
7054
+ toChecksigFormat(): number[]
7055
+ }
7056
+ ```
7057
+
7058
+ <details>
7059
+
7060
+ <summary>Class TransactionSignature Details</summary>
7061
+
7062
+ #### Method hasLowS
7063
+
7064
+ Compares to bitcoind's IsLowDERSignature
7065
+ See also Ecdsa signature algorithm which enforces this.
7066
+ See also Bip 62, "low S values in signatures"
7067
+
7068
+ ```ts
7069
+ public hasLowS(): boolean
7070
+ ```
7071
+
7072
+ </details>
7073
+
7074
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
6870
7075
 
6871
7076
  ---
6872
7077
  ## Functions
@@ -6881,7 +7086,7 @@ Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#v
6881
7086
  | [toArray](#function-toarray) |
6882
7087
  | [toBase64](#function-tobase64) |
6883
7088
 
6884
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7089
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
6885
7090
 
6886
7091
  ---
6887
7092
 
@@ -6906,7 +7111,7 @@ Argument Details
6906
7111
 
6907
7112
  </details>
6908
7113
 
6909
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7114
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
6910
7115
 
6911
7116
  ---
6912
7117
  ### Function: pbkdf2
@@ -6940,7 +7145,7 @@ Argument Details
6940
7145
 
6941
7146
  </details>
6942
7147
 
6943
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7148
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
6944
7149
 
6945
7150
  ---
6946
7151
  ### Function: toBase64
@@ -6973,7 +7178,7 @@ Argument Details
6973
7178
 
6974
7179
  </details>
6975
7180
 
6976
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7181
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
6977
7182
 
6978
7183
  ---
6979
7184
  ### Function: AES
@@ -6982,7 +7187,7 @@ Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#v
6982
7187
  export function AES(input: number[], key: number[]): number[]
6983
7188
  ```
6984
7189
 
6985
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7190
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
6986
7191
 
6987
7192
  ---
6988
7193
  ### Function: ghash
@@ -6991,7 +7196,7 @@ Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#v
6991
7196
  export function ghash(input: number[], hashSubKey: number[]): number[]
6992
7197
  ```
6993
7198
 
6994
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7199
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
6995
7200
 
6996
7201
  ---
6997
7202
  ### Function: AESGCM
@@ -7003,7 +7208,7 @@ export function AESGCM(plainText: number[], additionalAuthenticatedData: number[
7003
7208
  }
7004
7209
  ```
7005
7210
 
7006
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7211
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7007
7212
 
7008
7213
  ---
7009
7214
  ### Function: AESGCMDecrypt
@@ -7012,7 +7217,7 @@ Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#v
7012
7217
  export function AESGCMDecrypt(cipherText: number[], additionalAuthenticatedData: number[], initializationVector: number[], authenticationTag: number[], key: number[]): number[] | null
7013
7218
  ```
7014
7219
 
7015
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7220
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7016
7221
 
7017
7222
  ---
7018
7223
  ## Variables
@@ -7029,7 +7234,7 @@ Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#v
7029
7234
  | [hash256](#variable-hash256) | [sha512hmac](#variable-sha512hmac) | |
7030
7235
  | [incrementLeastSignificantThirtyTwoBits](#variable-incrementleastsignificantthirtytwobits) | [sign](#variable-sign) | |
7031
7236
 
7032
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7237
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7033
7238
 
7034
7239
  ---
7035
7240
 
@@ -7041,7 +7246,7 @@ ripemd160 = (msg: number[] | string, enc?: "hex" | "utf8"): number[] => {
7041
7246
  }
7042
7247
  ```
7043
7248
 
7044
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7249
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7045
7250
 
7046
7251
  ---
7047
7252
  ### Variable: sha1
@@ -7052,7 +7257,7 @@ sha1 = (msg: number[] | string, enc?: "hex" | "utf8"): number[] => {
7052
7257
  }
7053
7258
  ```
7054
7259
 
7055
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7260
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7056
7261
 
7057
7262
  ---
7058
7263
  ### Variable: sha256
@@ -7063,7 +7268,7 @@ sha256 = (msg: number[] | string, enc?: "hex" | "utf8"): number[] => {
7063
7268
  }
7064
7269
  ```
7065
7270
 
7066
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7271
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7067
7272
 
7068
7273
  ---
7069
7274
  ### Variable: sha512
@@ -7074,7 +7279,7 @@ sha512 = (msg: number[] | string, enc?: "hex" | "utf8"): number[] => {
7074
7279
  }
7075
7280
  ```
7076
7281
 
7077
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7282
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7078
7283
 
7079
7284
  ---
7080
7285
  ### Variable: hash256
@@ -7086,7 +7291,7 @@ hash256 = (msg: number[] | string, enc?: "hex" | "utf8"): number[] => {
7086
7291
  }
7087
7292
  ```
7088
7293
 
7089
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7294
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7090
7295
 
7091
7296
  ---
7092
7297
  ### Variable: hash160
@@ -7098,7 +7303,7 @@ hash160 = (msg: number[] | string, enc?: "hex" | "utf8"): number[] => {
7098
7303
  }
7099
7304
  ```
7100
7305
 
7101
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7306
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7102
7307
 
7103
7308
  ---
7104
7309
  ### Variable: sha256hmac
@@ -7109,7 +7314,7 @@ sha256hmac = (key: number[] | string, msg: number[] | string, enc?: "hex"): numb
7109
7314
  }
7110
7315
  ```
7111
7316
 
7112
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7317
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7113
7318
 
7114
7319
  ---
7115
7320
  ### Variable: sha512hmac
@@ -7120,7 +7325,7 @@ sha512hmac = (key: number[] | string, msg: number[] | string, enc?: "hex"): numb
7120
7325
  }
7121
7326
  ```
7122
7327
 
7123
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7328
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7124
7329
 
7125
7330
  ---
7126
7331
  ### Variable: zero2
@@ -7136,7 +7341,7 @@ zero2 = (word: string): string => {
7136
7341
  }
7137
7342
  ```
7138
7343
 
7139
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7344
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7140
7345
 
7141
7346
  ---
7142
7347
  ### Variable: toHex
@@ -7151,7 +7356,7 @@ toHex = (msg: number[]): string => {
7151
7356
  }
7152
7357
  ```
7153
7358
 
7154
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7359
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7155
7360
 
7156
7361
  ---
7157
7362
  ### Variable: toArray
@@ -7213,7 +7418,7 @@ toArray = (msg: any, enc?: "hex" | "utf8" | "base64"): any[] => {
7213
7418
  }
7214
7419
  ```
7215
7420
 
7216
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7421
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7217
7422
 
7218
7423
  ---
7219
7424
  ### Variable: toUTF8
@@ -7251,7 +7456,7 @@ toUTF8 = (arr: number[]): string => {
7251
7456
  }
7252
7457
  ```
7253
7458
 
7254
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7459
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7255
7460
 
7256
7461
  ---
7257
7462
  ### Variable: encode
@@ -7269,17 +7474,19 @@ encode = (arr: number[], enc?: "hex" | "utf8"): string | number[] => {
7269
7474
  }
7270
7475
  ```
7271
7476
 
7272
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7477
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7273
7478
 
7274
7479
  ---
7275
7480
  ### Variable: fromBase58
7276
7481
 
7277
7482
  ```ts
7278
7483
  fromBase58 = (str: string): number[] => {
7279
- if (!str || typeof str !== "string")
7484
+ if (!str || typeof str !== "string") {
7280
7485
  throw new Error(`Expected base58 string but got “${str}”`);
7281
- if (str.match(/[IOl0]/gmu))
7486
+ }
7487
+ if (str.match(/[IOl0]/gmu)) {
7282
7488
  throw new Error(`Invalid base58 character “${str.match(/[IOl0]/gmu)}”`);
7489
+ }
7283
7490
  const lz = str.match(/^1+/gmu);
7284
7491
  const psz: number = lz ? lz[0].length : 0;
7285
7492
  const size = ((str.length - psz) * (Math.log(58) / Math.log(256)) + 1) >>> 0;
@@ -7303,7 +7510,7 @@ fromBase58 = (str: string): number[] => {
7303
7510
  }
7304
7511
  ```
7305
7512
 
7306
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7513
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7307
7514
 
7308
7515
  ---
7309
7516
  ### Variable: toBase58
@@ -7311,8 +7518,9 @@ Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#v
7311
7518
  ```ts
7312
7519
  toBase58 = (bin: number[]): string => {
7313
7520
  const base58Map = Array(256).fill(-1);
7314
- for (let i = 0; i < base58chars.length; ++i)
7521
+ for (let i = 0; i < base58chars.length; ++i) {
7315
7522
  base58Map[base58chars.charCodeAt(i)] = i;
7523
+ }
7316
7524
  const result = [];
7317
7525
  for (const byte of bin) {
7318
7526
  let carry = byte;
@@ -7326,30 +7534,31 @@ toBase58 = (bin: number[]): string => {
7326
7534
  carry = (carry / 58) | 0;
7327
7535
  }
7328
7536
  }
7329
- for (const byte of bin)
7537
+ for (const byte of bin) {
7330
7538
  if (byte)
7331
7539
  break;
7332
7540
  else
7333
7541
  result.push("1".charCodeAt(0));
7542
+ }
7334
7543
  result.reverse();
7335
7544
  return String.fromCharCode(...result);
7336
7545
  }
7337
7546
  ```
7338
7547
 
7339
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7548
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7340
7549
 
7341
7550
  ---
7342
7551
  ### Variable: toBase58Check
7343
7552
 
7344
7553
  ```ts
7345
7554
  toBase58Check = (bin: number[], prefix: number[] = [0]) => {
7346
- let hash = hash256([...prefix, ...bin]) as number[];
7555
+ let hash = hash256([...prefix, ...bin]);
7347
7556
  hash = [...prefix, ...bin, ...hash.slice(0, 4)];
7348
7557
  return toBase58(hash);
7349
7558
  }
7350
7559
  ```
7351
7560
 
7352
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7561
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7353
7562
 
7354
7563
  ---
7355
7564
  ### Variable: fromBase58Check
@@ -7360,7 +7569,7 @@ fromBase58Check = (str: string, enc?: "hex", prefixLength: number = 1) => {
7360
7569
  let prefix: string | number[] = bin.slice(0, prefixLength);
7361
7570
  let data: string | number[] = bin.slice(prefixLength, -4);
7362
7571
  let hash = [...prefix, ...data];
7363
- hash = hash256(hash) as number[];
7572
+ hash = hash256(hash);
7364
7573
  bin.slice(-4).forEach((check, index) => {
7365
7574
  if (check !== hash[index]) {
7366
7575
  throw new Error("Invalid checksum");
@@ -7374,7 +7583,7 @@ fromBase58Check = (str: string, enc?: "hex", prefixLength: number = 1) => {
7374
7583
  }
7375
7584
  ```
7376
7585
 
7377
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7586
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7378
7587
 
7379
7588
  ---
7380
7589
  ### Variable: sign
@@ -7440,7 +7649,7 @@ sign = (msg: BigNumber, key: BigNumber, forceLowS: boolean = false, customK?: Bi
7440
7649
  }
7441
7650
  ```
7442
7651
 
7443
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7652
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7444
7653
 
7445
7654
  ---
7446
7655
  ### Variable: verify
@@ -7468,7 +7677,7 @@ verify = (msg: BigNumber, sig: Signature, key: Point): boolean => {
7468
7677
  }
7469
7678
  ```
7470
7679
 
7471
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7680
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7472
7681
 
7473
7682
  ---
7474
7683
  ### Variable: checkBit
@@ -7479,7 +7688,7 @@ checkBit = function (byteArray: number[], byteIndex: number, bitIndex: number):
7479
7688
  }
7480
7689
  ```
7481
7690
 
7482
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7691
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7483
7692
 
7484
7693
  ---
7485
7694
  ### Variable: getBytes
@@ -7495,7 +7704,7 @@ getBytes = function (numericValue: number): number[] {
7495
7704
  }
7496
7705
  ```
7497
7706
 
7498
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7707
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7499
7708
 
7500
7709
  ---
7501
7710
  ### Variable: exclusiveOR
@@ -7511,7 +7720,7 @@ exclusiveOR = function (block0: number[], block1: number[]): number[] {
7511
7720
  }
7512
7721
  ```
7513
7722
 
7514
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7723
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7515
7724
 
7516
7725
  ---
7517
7726
  ### Variable: rightShift
@@ -7533,7 +7742,7 @@ rightShift = function (block: number[]): number[] {
7533
7742
  }
7534
7743
  ```
7535
7744
 
7536
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7745
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7537
7746
 
7538
7747
  ---
7539
7748
  ### Variable: multiply
@@ -7561,7 +7770,7 @@ multiply = function (block0: number[], block1: number[]): number[] {
7561
7770
  }
7562
7771
  ```
7563
7772
 
7564
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7773
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7565
7774
 
7566
7775
  ---
7567
7776
  ### Variable: incrementLeastSignificantThirtyTwoBits
@@ -7583,6 +7792,6 @@ incrementLeastSignificantThirtyTwoBits = function (block: number[]): number[] {
7583
7792
  }
7584
7793
  ```
7585
7794
 
7586
- Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7795
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7587
7796
 
7588
7797
  ---