@bsv/sdk 1.0.34 → 1.0.37

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 (46) hide show
  1. package/dist/cjs/mod.js +1 -0
  2. package/dist/cjs/mod.js.map +1 -1
  3. package/dist/cjs/package.json +1 -1
  4. package/dist/cjs/src/primitives/PrivateKey.js +5 -3
  5. package/dist/cjs/src/primitives/PrivateKey.js.map +1 -1
  6. package/dist/cjs/src/primitives/PublicKey.js +14 -1
  7. package/dist/cjs/src/primitives/PublicKey.js.map +1 -1
  8. package/dist/cjs/src/script/templates/P2PKH.js +1 -0
  9. package/dist/cjs/src/script/templates/P2PKH.js.map +1 -1
  10. package/dist/cjs/src/transaction/Transaction.js +38 -8
  11. package/dist/cjs/src/transaction/Transaction.js.map +1 -1
  12. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  13. package/dist/esm/mod.js +1 -0
  14. package/dist/esm/mod.js.map +1 -1
  15. package/dist/esm/src/primitives/PrivateKey.js +5 -3
  16. package/dist/esm/src/primitives/PrivateKey.js.map +1 -1
  17. package/dist/esm/src/primitives/PublicKey.js +14 -1
  18. package/dist/esm/src/primitives/PublicKey.js.map +1 -1
  19. package/dist/esm/src/script/templates/P2PKH.js +1 -0
  20. package/dist/esm/src/script/templates/P2PKH.js.map +1 -1
  21. package/dist/esm/src/transaction/Transaction.js +40 -10
  22. package/dist/esm/src/transaction/Transaction.js.map +1 -1
  23. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  24. package/dist/types/mod.d.ts +1 -0
  25. package/dist/types/mod.d.ts.map +1 -1
  26. package/dist/types/src/primitives/PrivateKey.d.ts +6 -4
  27. package/dist/types/src/primitives/PrivateKey.d.ts.map +1 -1
  28. package/dist/types/src/primitives/PublicKey.d.ts +4 -2
  29. package/dist/types/src/primitives/PublicKey.d.ts.map +1 -1
  30. package/dist/types/src/script/templates/P2PKH.d.ts.map +1 -1
  31. package/dist/types/src/transaction/Transaction.d.ts +9 -2
  32. package/dist/types/src/transaction/Transaction.d.ts.map +1 -1
  33. package/dist/types/src/transaction/TransactionInput.d.ts +4 -0
  34. package/dist/types/src/transaction/TransactionInput.d.ts.map +1 -1
  35. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  36. package/docs/primitives.md +73 -67
  37. package/docs/script.md +13 -11
  38. package/docs/transaction.md +508 -39
  39. package/mod.ts +1 -0
  40. package/package.json +1 -1
  41. package/src/primitives/PrivateKey.ts +6 -4
  42. package/src/primitives/PublicKey.ts +13 -2
  43. package/src/script/templates/P2PKH.ts +1 -0
  44. package/src/transaction/Transaction.ts +41 -10
  45. package/src/transaction/TransactionInput.ts +4 -0
  46. package/src/transaction/__tests/Transaction.test.ts +61 -0
@@ -1,6 +1,6 @@
1
1
  # API
2
2
 
3
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
3
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4
4
 
5
5
  ## Interfaces
6
6
 
@@ -21,7 +21,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
21
21
  | [PublicKey](#class-publickey) | [Writer](#class-writer) |
22
22
  | [RIPEMD160](#class-ripemd160) | |
23
23
 
24
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
24
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
25
25
 
26
26
  ---
27
27
 
@@ -169,7 +169,7 @@ mersenne.split(new BigNumber('2345', 16), new BigNumber());
169
169
 
170
170
  </details>
171
171
 
172
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
172
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
173
173
 
174
174
  ---
175
175
  ### Class: K256
@@ -262,7 +262,7 @@ k256.split(input, output);
262
262
 
263
263
  </details>
264
264
 
265
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
265
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
266
266
 
267
267
  ---
268
268
  ### Class: ReductionContext
@@ -795,7 +795,7 @@ this.verify2(new BigNumber(10).toRed(this), new BigNumber(20)); //throws an Erro
795
795
 
796
796
  </details>
797
797
 
798
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
798
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
799
799
 
800
800
  ---
801
801
  ### Class: BigNumber
@@ -4181,7 +4181,7 @@ const zeroBits = bn.zeroBits(); // 3
4181
4181
 
4182
4182
  </details>
4183
4183
 
4184
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4184
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4185
4185
 
4186
4186
  ---
4187
4187
  ### Class: MontgomoryMethod
@@ -4392,7 +4392,7 @@ const product = montMethod.mul(a, b);
4392
4392
 
4393
4393
  </details>
4394
4394
 
4395
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4395
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4396
4396
 
4397
4397
  ---
4398
4398
  ### Class: BasePoint
@@ -4419,7 +4419,7 @@ export default abstract class BasePoint {
4419
4419
  }
4420
4420
  ```
4421
4421
 
4422
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4422
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4423
4423
 
4424
4424
  ---
4425
4425
  ### Class: JacobianPoint
@@ -4746,7 +4746,7 @@ const pointP = pointJ.toP(); // The point in affine coordinates.
4746
4746
 
4747
4747
  </details>
4748
4748
 
4749
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4749
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4750
4750
 
4751
4751
  ---
4752
4752
  ### Class: RIPEMD160
@@ -4786,7 +4786,7 @@ h: number[]
4786
4786
 
4787
4787
  </details>
4788
4788
 
4789
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4789
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4790
4790
 
4791
4791
  ---
4792
4792
  ### Class: SHA256
@@ -4845,7 +4845,7 @@ k: number[]
4845
4845
 
4846
4846
  </details>
4847
4847
 
4848
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4848
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4849
4849
 
4850
4850
  ---
4851
4851
  ### Class: SHA1
@@ -4903,7 +4903,7 @@ k: number[]
4903
4903
 
4904
4904
  </details>
4905
4905
 
4906
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4906
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4907
4907
 
4908
4908
  ---
4909
4909
  ### Class: SHA512
@@ -4962,7 +4962,7 @@ k: number[]
4962
4962
 
4963
4963
  </details>
4964
4964
 
4965
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
4965
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4966
4966
 
4967
4967
  ---
4968
4968
  ### Class: SHA256HMAC
@@ -5108,7 +5108,7 @@ myHMAC.update('deadbeef', 'hex');
5108
5108
 
5109
5109
  </details>
5110
5110
 
5111
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
5111
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5112
5112
 
5113
5113
  ---
5114
5114
  ### Class: SHA512HMAC
@@ -5254,7 +5254,7 @@ myHMAC.update('deadbeef', 'hex');
5254
5254
 
5255
5255
  </details>
5256
5256
 
5257
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
5257
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5258
5258
 
5259
5259
  ---
5260
5260
  ### Class: Writer
@@ -5287,7 +5287,7 @@ export class Writer {
5287
5287
  }
5288
5288
  ```
5289
5289
 
5290
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
5290
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5291
5291
 
5292
5292
  ---
5293
5293
  ### Class: Reader
@@ -5318,7 +5318,7 @@ export class Reader {
5318
5318
  }
5319
5319
  ```
5320
5320
 
5321
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
5321
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5322
5322
 
5323
5323
  ---
5324
5324
  ### Class: Point
@@ -5899,7 +5899,7 @@ const isValid = aPoint.validate();
5899
5899
 
5900
5900
  </details>
5901
5901
 
5902
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
5902
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5903
5903
 
5904
5904
  ---
5905
5905
  ### Class: Curve
@@ -5967,7 +5967,7 @@ export default class Curve {
5967
5967
  }
5968
5968
  ```
5969
5969
 
5970
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
5970
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
5971
5971
 
5972
5972
  ---
5973
5973
  ### Class: DRBG
@@ -6063,7 +6063,7 @@ drbg.update('e13af...');
6063
6063
 
6064
6064
  </details>
6065
6065
 
6066
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
6066
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6067
6067
 
6068
6068
  ---
6069
6069
  ### Class: Signature
@@ -6349,7 +6349,7 @@ const isVerified = signature.verify(msg, publicKey);
6349
6349
 
6350
6350
  </details>
6351
6351
 
6352
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
6352
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6353
6353
 
6354
6354
  ---
6355
6355
  ### Class: PrivateKey
@@ -6374,7 +6374,7 @@ export default class PrivateKey extends BigNumber {
6374
6374
  verify(msg: number[] | string, sig: Signature, enc?: "hex"): boolean
6375
6375
  toPublicKey(): PublicKey
6376
6376
  toWif(prefix: number[] = [128]): string
6377
- toAddress(prefix: number[] = [0]): string
6377
+ toAddress(prefix: number[] | string = [0]): string
6378
6378
  deriveSharedSecret(key: PublicKey): Point
6379
6379
  deriveChild(publicKey: PublicKey, invoiceNumber: string): PrivateKey
6380
6380
  }
@@ -6582,7 +6582,7 @@ Base58Check encodes the hash of the public key associated with this private key
6582
6582
  Defaults to P2PKH for mainnet, otherwise known as a "Bitcoin Address".
6583
6583
 
6584
6584
  ```ts
6585
- toAddress(prefix: number[] = [0]): string
6585
+ toAddress(prefix: number[] | string = [0]): string
6586
6586
  ```
6587
6587
 
6588
6588
  Returns
@@ -6592,13 +6592,15 @@ Returns the address encoding associated with the hash of the public key associat
6592
6592
  Argument Details
6593
6593
 
6594
6594
  + **prefix**
6595
- + defaults to [0x00] for mainnet, set to [0x6f] for testnet.
6595
+ + defaults to [0x00] for mainnet, set to [0x6f] for testnet or use the strings 'testnet' or 'mainnet'
6596
6596
 
6597
6597
  Example
6598
6598
 
6599
6599
  ```ts
6600
- const address = pubkey.toAddress()
6601
- const testnetAddress = pubkey.toAddress([0x6f])
6600
+ const address = privkey.toAddress()
6601
+ const address = privkey.toAddress('mainnet')
6602
+ const testnetAddress = privkey.toAddress([0x6f])
6603
+ const testnetAddress = privkey.toAddress('testnet')
6602
6604
  ```
6603
6605
 
6604
6606
  #### Method toPublicKey
@@ -6685,7 +6687,7 @@ const isSignatureValid = privateKey.verify('Hello, World!', signature);
6685
6687
 
6686
6688
  </details>
6687
6689
 
6688
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
6690
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6689
6691
 
6690
6692
  ---
6691
6693
  ### Class: PublicKey
@@ -6702,7 +6704,7 @@ export default class PublicKey extends Point {
6702
6704
  verify(msg: number[] | string, sig: Signature, enc?: "hex" | "utf8"): boolean
6703
6705
  toDER(): string
6704
6706
  toHash(enc?: "hex"): number[] | string
6705
- toAddress(prefix: number[] = [0]): string
6707
+ toAddress(prefix: number[] | string = [0]): string
6706
6708
  deriveChild(privateKey: PrivateKey, invoiceNumber: string): PublicKey
6707
6709
  static fromMsgHashAndCompactSignature(msgHash: BigNumber, signature: number[] | string, enc?: "hex" | "base64"): PublicKey
6708
6710
  }
@@ -6868,7 +6870,7 @@ Base58Check encodes the hash of the public key with a prefix to indicate locking
6868
6870
  Defaults to P2PKH for mainnet, otherwise known as a "Bitcoin Address".
6869
6871
 
6870
6872
  ```ts
6871
- toAddress(prefix: number[] = [0]): string
6873
+ toAddress(prefix: number[] | string = [0]): string
6872
6874
  ```
6873
6875
 
6874
6876
  Returns
@@ -6878,13 +6880,15 @@ Returns the address encoding associated with the hash of the public key.
6878
6880
  Argument Details
6879
6881
 
6880
6882
  + **prefix**
6881
- + defaults to [0x00] for mainnet, set to [0x6f] for testnet.
6883
+ + defaults to [0x00] for mainnet, set to [0x6f] for testnet or use the strings 'mainnet' or 'testnet'
6882
6884
 
6883
6885
  Example
6884
6886
 
6885
6887
  ```ts
6886
6888
  const address = pubkey.toAddress()
6889
+ const address = pubkey.toAddress('mainnet')
6887
6890
  const testnetAddress = pubkey.toAddress([0x6f])
6891
+ const testnetAddress = pubkey.toAddress('testnet')
6888
6892
  ```
6889
6893
 
6890
6894
  #### Method toDER
@@ -6954,7 +6958,7 @@ const isVerified = myPubKey.verify(myMessage, mySignature)
6954
6958
 
6955
6959
  </details>
6956
6960
 
6957
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
6961
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
6958
6962
 
6959
6963
  ---
6960
6964
  ### Class: SymmetricKey
@@ -7055,7 +7059,7 @@ const symmetricKey = SymmetricKey.fromRandom();
7055
7059
 
7056
7060
  </details>
7057
7061
 
7058
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7062
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7059
7063
 
7060
7064
  ---
7061
7065
  ### Class: TransactionSignature
@@ -7104,7 +7108,7 @@ public hasLowS(): boolean
7104
7108
 
7105
7109
  </details>
7106
7110
 
7107
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7111
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7108
7112
 
7109
7113
  ---
7110
7114
  ## Functions
@@ -7119,7 +7123,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
7119
7123
  | [toArray](#function-toarray) |
7120
7124
  | [toBase64](#function-tobase64) |
7121
7125
 
7122
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7126
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7123
7127
 
7124
7128
  ---
7125
7129
 
@@ -7144,7 +7148,7 @@ Argument Details
7144
7148
 
7145
7149
  </details>
7146
7150
 
7147
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7151
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7148
7152
 
7149
7153
  ---
7150
7154
  ### Function: pbkdf2
@@ -7178,7 +7182,7 @@ Argument Details
7178
7182
 
7179
7183
  </details>
7180
7184
 
7181
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7185
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7182
7186
 
7183
7187
  ---
7184
7188
  ### Function: toBase64
@@ -7211,7 +7215,7 @@ Argument Details
7211
7215
 
7212
7216
  </details>
7213
7217
 
7214
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7218
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7215
7219
 
7216
7220
  ---
7217
7221
  ### Function: AES
@@ -7220,7 +7224,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
7220
7224
  export function AES(input: number[], key: number[]): number[]
7221
7225
  ```
7222
7226
 
7223
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7227
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7224
7228
 
7225
7229
  ---
7226
7230
  ### Function: ghash
@@ -7229,7 +7233,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
7229
7233
  export function ghash(input: number[], hashSubKey: number[]): number[]
7230
7234
  ```
7231
7235
 
7232
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7236
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7233
7237
 
7234
7238
  ---
7235
7239
  ### Function: AESGCM
@@ -7241,7 +7245,7 @@ export function AESGCM(plainText: number[], additionalAuthenticatedData: number[
7241
7245
  }
7242
7246
  ```
7243
7247
 
7244
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7248
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7245
7249
 
7246
7250
  ---
7247
7251
  ### Function: AESGCMDecrypt
@@ -7250,9 +7254,11 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
7250
7254
  export function AESGCMDecrypt(cipherText: number[], additionalAuthenticatedData: number[], initializationVector: number[], authenticationTag: number[], key: number[]): number[] | null
7251
7255
  ```
7252
7256
 
7253
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7257
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7254
7258
 
7255
7259
  ---
7260
+ ## Types
7261
+
7256
7262
  ## Variables
7257
7263
 
7258
7264
  | | | |
@@ -7267,7 +7273,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
7267
7273
  | [hash256](#variable-hash256) | [sha512hmac](#variable-sha512hmac) | |
7268
7274
  | [incrementLeastSignificantThirtyTwoBits](#variable-incrementleastsignificantthirtytwobits) | [sign](#variable-sign) | |
7269
7275
 
7270
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7276
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7271
7277
 
7272
7278
  ---
7273
7279
 
@@ -7279,7 +7285,7 @@ ripemd160 = (msg: number[] | string, enc?: "hex" | "utf8"): number[] => {
7279
7285
  }
7280
7286
  ```
7281
7287
 
7282
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7288
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7283
7289
 
7284
7290
  ---
7285
7291
  ### Variable: sha1
@@ -7290,7 +7296,7 @@ sha1 = (msg: number[] | string, enc?: "hex" | "utf8"): number[] => {
7290
7296
  }
7291
7297
  ```
7292
7298
 
7293
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7299
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7294
7300
 
7295
7301
  ---
7296
7302
  ### Variable: sha256
@@ -7301,7 +7307,7 @@ sha256 = (msg: number[] | string, enc?: "hex" | "utf8"): number[] => {
7301
7307
  }
7302
7308
  ```
7303
7309
 
7304
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7310
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7305
7311
 
7306
7312
  ---
7307
7313
  ### Variable: sha512
@@ -7312,7 +7318,7 @@ sha512 = (msg: number[] | string, enc?: "hex" | "utf8"): number[] => {
7312
7318
  }
7313
7319
  ```
7314
7320
 
7315
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7321
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7316
7322
 
7317
7323
  ---
7318
7324
  ### Variable: hash256
@@ -7324,7 +7330,7 @@ hash256 = (msg: number[] | string, enc?: "hex" | "utf8"): number[] => {
7324
7330
  }
7325
7331
  ```
7326
7332
 
7327
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7333
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7328
7334
 
7329
7335
  ---
7330
7336
  ### Variable: hash160
@@ -7336,7 +7342,7 @@ hash160 = (msg: number[] | string, enc?: "hex" | "utf8"): number[] => {
7336
7342
  }
7337
7343
  ```
7338
7344
 
7339
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7345
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7340
7346
 
7341
7347
  ---
7342
7348
  ### Variable: sha256hmac
@@ -7347,7 +7353,7 @@ sha256hmac = (key: number[] | string, msg: number[] | string, enc?: "hex"): numb
7347
7353
  }
7348
7354
  ```
7349
7355
 
7350
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7356
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7351
7357
 
7352
7358
  ---
7353
7359
  ### Variable: sha512hmac
@@ -7358,7 +7364,7 @@ sha512hmac = (key: number[] | string, msg: number[] | string, enc?: "hex"): numb
7358
7364
  }
7359
7365
  ```
7360
7366
 
7361
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7367
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7362
7368
 
7363
7369
  ---
7364
7370
  ### Variable: zero2
@@ -7374,7 +7380,7 @@ zero2 = (word: string): string => {
7374
7380
  }
7375
7381
  ```
7376
7382
 
7377
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7383
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7378
7384
 
7379
7385
  ---
7380
7386
  ### Variable: toHex
@@ -7389,7 +7395,7 @@ toHex = (msg: number[]): string => {
7389
7395
  }
7390
7396
  ```
7391
7397
 
7392
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7398
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7393
7399
 
7394
7400
  ---
7395
7401
  ### Variable: toArray
@@ -7451,7 +7457,7 @@ toArray = (msg: any, enc?: "hex" | "utf8" | "base64"): any[] => {
7451
7457
  }
7452
7458
  ```
7453
7459
 
7454
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7460
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7455
7461
 
7456
7462
  ---
7457
7463
  ### Variable: toUTF8
@@ -7489,7 +7495,7 @@ toUTF8 = (arr: number[]): string => {
7489
7495
  }
7490
7496
  ```
7491
7497
 
7492
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7498
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7493
7499
 
7494
7500
  ---
7495
7501
  ### Variable: encode
@@ -7507,7 +7513,7 @@ encode = (arr: number[], enc?: "hex" | "utf8"): string | number[] => {
7507
7513
  }
7508
7514
  ```
7509
7515
 
7510
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7516
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7511
7517
 
7512
7518
  ---
7513
7519
  ### Variable: fromBase58
@@ -7543,7 +7549,7 @@ fromBase58 = (str: string): number[] => {
7543
7549
  }
7544
7550
  ```
7545
7551
 
7546
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7552
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7547
7553
 
7548
7554
  ---
7549
7555
  ### Variable: toBase58
@@ -7578,7 +7584,7 @@ toBase58 = (bin: number[]): string => {
7578
7584
  }
7579
7585
  ```
7580
7586
 
7581
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7587
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7582
7588
 
7583
7589
  ---
7584
7590
  ### Variable: toBase58Check
@@ -7591,7 +7597,7 @@ toBase58Check = (bin: number[], prefix: number[] = [0]) => {
7591
7597
  }
7592
7598
  ```
7593
7599
 
7594
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7600
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7595
7601
 
7596
7602
  ---
7597
7603
  ### Variable: fromBase58Check
@@ -7616,7 +7622,7 @@ fromBase58Check = (str: string, enc?: "hex", prefixLength: number = 1) => {
7616
7622
  }
7617
7623
  ```
7618
7624
 
7619
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7625
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7620
7626
 
7621
7627
  ---
7622
7628
  ### Variable: sign
@@ -7682,7 +7688,7 @@ sign = (msg: BigNumber, key: BigNumber, forceLowS: boolean = false, customK?: Bi
7682
7688
  }
7683
7689
  ```
7684
7690
 
7685
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7691
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7686
7692
 
7687
7693
  ---
7688
7694
  ### Variable: verify
@@ -7710,7 +7716,7 @@ verify = (msg: BigNumber, sig: Signature, key: Point): boolean => {
7710
7716
  }
7711
7717
  ```
7712
7718
 
7713
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7719
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7714
7720
 
7715
7721
  ---
7716
7722
  ### Variable: checkBit
@@ -7721,7 +7727,7 @@ checkBit = function (byteArray: number[], byteIndex: number, bitIndex: number):
7721
7727
  }
7722
7728
  ```
7723
7729
 
7724
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7730
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7725
7731
 
7726
7732
  ---
7727
7733
  ### Variable: getBytes
@@ -7737,7 +7743,7 @@ getBytes = function (numericValue: number): number[] {
7737
7743
  }
7738
7744
  ```
7739
7745
 
7740
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7746
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7741
7747
 
7742
7748
  ---
7743
7749
  ### Variable: exclusiveOR
@@ -7753,7 +7759,7 @@ exclusiveOR = function (block0: number[], block1: number[]): number[] {
7753
7759
  }
7754
7760
  ```
7755
7761
 
7756
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7762
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7757
7763
 
7758
7764
  ---
7759
7765
  ### Variable: rightShift
@@ -7775,7 +7781,7 @@ rightShift = function (block: number[]): number[] {
7775
7781
  }
7776
7782
  ```
7777
7783
 
7778
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7784
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7779
7785
 
7780
7786
  ---
7781
7787
  ### Variable: multiply
@@ -7803,7 +7809,7 @@ multiply = function (block0: number[], block1: number[]): number[] {
7803
7809
  }
7804
7810
  ```
7805
7811
 
7806
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7812
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7807
7813
 
7808
7814
  ---
7809
7815
  ### Variable: incrementLeastSignificantThirtyTwoBits
@@ -7825,6 +7831,6 @@ incrementLeastSignificantThirtyTwoBits = function (block: number[]): number[] {
7825
7831
  }
7826
7832
  ```
7827
7833
 
7828
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
7834
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
7829
7835
 
7830
7836
  ---
package/docs/script.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # API
2
2
 
3
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
3
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4
4
 
5
5
  ## Interfaces
6
6
 
@@ -9,7 +9,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
9
9
  | [ScriptChunk](#interface-scriptchunk) |
10
10
  | [ScriptTemplate](#interface-scripttemplate) |
11
11
 
12
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
12
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
13
13
 
14
14
  ---
15
15
 
@@ -24,7 +24,7 @@ export default interface ScriptChunk {
24
24
  }
25
25
  ```
26
26
 
27
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
27
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
28
28
 
29
29
  ---
30
30
  ### Interface: ScriptTemplate
@@ -68,7 +68,7 @@ unlock: (...params: any) => {
68
68
 
69
69
  </details>
70
70
 
71
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
71
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
72
72
 
73
73
  ---
74
74
  ## Classes
@@ -82,7 +82,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
82
82
  | [Spend](#class-spend) |
83
83
  | [UnlockingScript](#class-unlockingscript) |
84
84
 
85
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
85
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
86
86
 
87
87
  ---
88
88
 
@@ -379,7 +379,7 @@ Argument Details
379
379
 
380
380
  </details>
381
381
 
382
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
382
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
383
383
 
384
384
  ---
385
385
  ### Class: LockingScript
@@ -422,7 +422,7 @@ Always returns false for a LockingScript instance.
422
422
 
423
423
  </details>
424
424
 
425
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
425
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
426
426
 
427
427
  ---
428
428
  ### Class: UnlockingScript
@@ -465,7 +465,7 @@ Always returns true for an UnlockingScript instance.
465
465
 
466
466
  </details>
467
467
 
468
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
468
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
469
469
 
470
470
  ---
471
471
  ### Class: Spend
@@ -600,7 +600,7 @@ if (spend.validate()) {
600
600
 
601
601
  </details>
602
602
 
603
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
603
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
604
604
 
605
605
  ---
606
606
  ### Class: P2PKH
@@ -675,7 +675,7 @@ Argument Details
675
675
 
676
676
  </details>
677
677
 
678
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
678
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
679
679
 
680
680
  ---
681
681
  ### Class: RPuzzle
@@ -761,10 +761,12 @@ Argument Details
761
761
 
762
762
  </details>
763
763
 
764
- Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Variables](#variables)
764
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
765
765
 
766
766
  ---
767
767
  ## Functions
768
768
 
769
+ ## Types
770
+
769
771
  ## Variables
770
772