@bsv/sdk 1.3.15 → 1.3.18
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/dist/cjs/package.json +2 -1
- package/dist/cjs/src/script/ScriptTemplateUnlock.js +3 -0
- package/dist/cjs/src/script/ScriptTemplateUnlock.js.map +1 -0
- package/dist/cjs/src/script/index.js.map +1 -1
- package/dist/cjs/src/wallet/substrates/HTTPWalletJSON.js +8 -1
- package/dist/cjs/src/wallet/substrates/HTTPWalletJSON.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/script/ScriptTemplateUnlock.js +2 -0
- package/dist/esm/src/script/ScriptTemplateUnlock.js.map +1 -0
- package/dist/esm/src/script/index.js.map +1 -1
- package/dist/esm/src/wallet/substrates/HTTPWalletJSON.js +8 -1
- package/dist/esm/src/wallet/substrates/HTTPWalletJSON.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/script/ScriptTemplate.d.ts +6 -10
- package/dist/types/src/script/ScriptTemplate.d.ts.map +1 -1
- package/dist/types/src/script/ScriptTemplateUnlock.d.ts +7 -0
- package/dist/types/src/script/ScriptTemplateUnlock.d.ts.map +1 -0
- package/dist/types/src/script/index.d.ts +1 -0
- package/dist/types/src/script/index.d.ts.map +1 -1
- package/dist/types/src/wallet/substrates/HTTPWalletJSON.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +1 -1
- package/docs/auth.md +0 -54
- package/docs/compat.md +0 -24
- package/docs/overlay-tools.md +0 -48
- package/docs/primitives.md +0 -144
- package/docs/script.md +17 -56
- package/docs/totp.md +0 -6
- package/docs/transaction.md +0 -78
- package/docs/wallet.md +0 -24
- package/package.json +2 -1
- package/src/script/ScriptTemplate.ts +6 -10
- package/src/script/ScriptTemplateUnlock.ts +7 -0
- package/src/script/index.ts +1 -0
- package/src/wallet/substrates/HTTPWalletJSON.ts +8 -1
package/docs/primitives.md
CHANGED
|
@@ -205,10 +205,6 @@ export default class BigNumber {
|
|
|
205
205
|
|
|
206
206
|
See also: [ReductionContext](./primitives.md#class-reductioncontext), [toArray](./primitives.md#variable-toarray), [toHex](./primitives.md#variable-tohex)
|
|
207
207
|
|
|
208
|
-
<details>
|
|
209
|
-
|
|
210
|
-
<summary>Class BigNumber Details</summary>
|
|
211
|
-
|
|
212
208
|
#### Constructor
|
|
213
209
|
|
|
214
210
|
```ts
|
|
@@ -3525,8 +3521,6 @@ const bn = new BigNumber('8'); // binary: 1000
|
|
|
3525
3521
|
const zeroBits = bn.zeroBits(); // 3
|
|
3526
3522
|
```
|
|
3527
3523
|
|
|
3528
|
-
</details>
|
|
3529
|
-
|
|
3530
3524
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
3531
3525
|
|
|
3532
3526
|
---
|
|
@@ -3627,10 +3621,6 @@ export default class DRBG {
|
|
|
3627
3621
|
|
|
3628
3622
|
See also: [SHA256HMAC](./primitives.md#class-sha256hmac)
|
|
3629
3623
|
|
|
3630
|
-
<details>
|
|
3631
|
-
|
|
3632
|
-
<summary>Class DRBG Details</summary>
|
|
3633
|
-
|
|
3634
3624
|
#### Method generate
|
|
3635
3625
|
|
|
3636
3626
|
Generates deterministic random hexadecimal string of given length.
|
|
@@ -3698,8 +3688,6 @@ Example
|
|
|
3698
3688
|
drbg.update('e13af...');
|
|
3699
3689
|
```
|
|
3700
3690
|
|
|
3701
|
-
</details>
|
|
3702
|
-
|
|
3703
3691
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
3704
3692
|
|
|
3705
3693
|
---
|
|
@@ -3738,10 +3726,6 @@ export default class JacobianPoint extends BasePoint {
|
|
|
3738
3726
|
|
|
3739
3727
|
See also: [BasePoint](./primitives.md#class-basepoint), [BigNumber](./primitives.md#class-bignumber), [Point](./primitives.md#class-point)
|
|
3740
3728
|
|
|
3741
|
-
<details>
|
|
3742
|
-
|
|
3743
|
-
<summary>Class JacobianPoint Details</summary>
|
|
3744
|
-
|
|
3745
3729
|
#### Constructor
|
|
3746
3730
|
|
|
3747
3731
|
Constructs a new `JacobianPoint` instance.
|
|
@@ -4039,8 +4023,6 @@ const pointJ = new JacobianPoint('3', '4', '1');
|
|
|
4039
4023
|
const pointP = pointJ.toP(); // The point in affine coordinates.
|
|
4040
4024
|
```
|
|
4041
4025
|
|
|
4042
|
-
</details>
|
|
4043
|
-
|
|
4044
4026
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
4045
4027
|
|
|
4046
4028
|
---
|
|
@@ -4066,10 +4048,6 @@ export default class K256 extends Mersenne {
|
|
|
4066
4048
|
|
|
4067
4049
|
See also: [BigNumber](./primitives.md#class-bignumber), [Mersenne](./primitives.md#class-mersenne)
|
|
4068
4050
|
|
|
4069
|
-
<details>
|
|
4070
|
-
|
|
4071
|
-
<summary>Class K256 Details</summary>
|
|
4072
|
-
|
|
4073
4051
|
#### Constructor
|
|
4074
4052
|
|
|
4075
4053
|
Constructor for the K256 class.
|
|
@@ -4136,8 +4114,6 @@ const output = new BigNumber(0);
|
|
|
4136
4114
|
k256.split(input, output);
|
|
4137
4115
|
```
|
|
4138
4116
|
|
|
4139
|
-
</details>
|
|
4140
|
-
|
|
4141
4117
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
4142
4118
|
|
|
4143
4119
|
---
|
|
@@ -4185,10 +4161,6 @@ export default class Mersenne {
|
|
|
4185
4161
|
|
|
4186
4162
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
4187
4163
|
|
|
4188
|
-
<details>
|
|
4189
|
-
|
|
4190
|
-
<summary>Class Mersenne Details</summary>
|
|
4191
|
-
|
|
4192
4164
|
#### Constructor
|
|
4193
4165
|
|
|
4194
4166
|
```ts
|
|
@@ -4314,8 +4286,6 @@ Example
|
|
|
4314
4286
|
mersenne.split(new BigNumber('2345', 16), new BigNumber());
|
|
4315
4287
|
```
|
|
4316
4288
|
|
|
4317
|
-
</details>
|
|
4318
|
-
|
|
4319
4289
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
4320
4290
|
|
|
4321
4291
|
---
|
|
@@ -4348,10 +4318,6 @@ export default class MontgomoryMethod extends ReductionContext {
|
|
|
4348
4318
|
|
|
4349
4319
|
See also: [BigNumber](./primitives.md#class-bignumber), [ReductionContext](./primitives.md#class-reductioncontext)
|
|
4350
4320
|
|
|
4351
|
-
<details>
|
|
4352
|
-
|
|
4353
|
-
<summary>Class MontgomoryMethod Details</summary>
|
|
4354
|
-
|
|
4355
4321
|
#### Constructor
|
|
4356
4322
|
|
|
4357
4323
|
```ts
|
|
@@ -4537,8 +4503,6 @@ const montMethod = new MontgomoryMethod(m);
|
|
|
4537
4503
|
const product = montMethod.mul(a, b);
|
|
4538
4504
|
```
|
|
4539
4505
|
|
|
4540
|
-
</details>
|
|
4541
|
-
|
|
4542
4506
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
4543
4507
|
|
|
4544
4508
|
---
|
|
@@ -4594,10 +4558,6 @@ export default class Point extends BasePoint {
|
|
|
4594
4558
|
|
|
4595
4559
|
See also: [BasePoint](./primitives.md#class-basepoint), [BigNumber](./primitives.md#class-bignumber), [encode](./primitives.md#variable-encode)
|
|
4596
4560
|
|
|
4597
|
-
<details>
|
|
4598
|
-
|
|
4599
|
-
<summary>Class Point Details</summary>
|
|
4600
|
-
|
|
4601
4561
|
#### Constructor
|
|
4602
4562
|
|
|
4603
4563
|
```ts
|
|
@@ -5170,8 +5130,6 @@ const aPoint = new Point(x, y);
|
|
|
5170
5130
|
const isValid = aPoint.validate();
|
|
5171
5131
|
```
|
|
5172
5132
|
|
|
5173
|
-
</details>
|
|
5174
|
-
|
|
5175
5133
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5176
5134
|
|
|
5177
5135
|
---
|
|
@@ -5189,10 +5147,6 @@ export class PointInFiniteField {
|
|
|
5189
5147
|
|
|
5190
5148
|
See also: [BigNumber](./primitives.md#class-bignumber)
|
|
5191
5149
|
|
|
5192
|
-
<details>
|
|
5193
|
-
|
|
5194
|
-
<summary>Class PointInFiniteField Details</summary>
|
|
5195
|
-
|
|
5196
5150
|
#### Method toString
|
|
5197
5151
|
|
|
5198
5152
|
function toString() { [native code] }
|
|
@@ -5201,8 +5155,6 @@ function toString() { [native code] }
|
|
|
5201
5155
|
toString(): string
|
|
5202
5156
|
```
|
|
5203
5157
|
|
|
5204
|
-
</details>
|
|
5205
|
-
|
|
5206
5158
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5207
5159
|
|
|
5208
5160
|
---
|
|
@@ -5273,10 +5225,6 @@ export default class PrivateKey extends BigNumber {
|
|
|
5273
5225
|
|
|
5274
5226
|
See also: [BigNumber](./primitives.md#class-bignumber), [KeyShares](./primitives.md#class-keyshares), [Point](./primitives.md#class-point), [PublicKey](./primitives.md#class-publickey), [Signature](./primitives.md#class-signature), [sign](./compat.md#variable-sign), [toHex](./primitives.md#variable-tohex), [verify](./compat.md#variable-verify)
|
|
5275
5227
|
|
|
5276
|
-
<details>
|
|
5277
|
-
|
|
5278
|
-
<summary>Class PrivateKey Details</summary>
|
|
5279
|
-
|
|
5280
5228
|
#### Constructor
|
|
5281
5229
|
|
|
5282
5230
|
```ts
|
|
@@ -5737,8 +5685,6 @@ const signature = privateKey.sign('Hello, World!');
|
|
|
5737
5685
|
const isSignatureValid = privateKey.verify('Hello, World!', signature);
|
|
5738
5686
|
```
|
|
5739
5687
|
|
|
5740
|
-
</details>
|
|
5741
|
-
|
|
5742
5688
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
5743
5689
|
|
|
5744
5690
|
---
|
|
@@ -5765,10 +5711,6 @@ export default class PublicKey extends Point {
|
|
|
5765
5711
|
|
|
5766
5712
|
See also: [BigNumber](./primitives.md#class-bignumber), [Point](./primitives.md#class-point), [PrivateKey](./primitives.md#class-privatekey), [Signature](./primitives.md#class-signature), [verify](./compat.md#variable-verify)
|
|
5767
5713
|
|
|
5768
|
-
<details>
|
|
5769
|
-
|
|
5770
|
-
<summary>Class PublicKey Details</summary>
|
|
5771
|
-
|
|
5772
5714
|
#### Constructor
|
|
5773
5715
|
|
|
5774
5716
|
```ts
|
|
@@ -6047,8 +5989,6 @@ const mySignature = new Signature(...)
|
|
|
6047
5989
|
const isVerified = myPubKey.verify(myMessage, mySignature)
|
|
6048
5990
|
```
|
|
6049
5991
|
|
|
6050
|
-
</details>
|
|
6051
|
-
|
|
6052
5992
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
6053
5993
|
|
|
6054
5994
|
---
|
|
@@ -6075,10 +6015,6 @@ export class RIPEMD160 extends BaseHash {
|
|
|
6075
6015
|
}
|
|
6076
6016
|
```
|
|
6077
6017
|
|
|
6078
|
-
<details>
|
|
6079
|
-
|
|
6080
|
-
<summary>Class RIPEMD160 Details</summary>
|
|
6081
|
-
|
|
6082
6018
|
#### Property h
|
|
6083
6019
|
|
|
6084
6020
|
Array that is updated iteratively as part of hashing computation.
|
|
@@ -6087,8 +6023,6 @@ Array that is updated iteratively as part of hashing computation.
|
|
|
6087
6023
|
h: number[]
|
|
6088
6024
|
```
|
|
6089
6025
|
|
|
6090
|
-
</details>
|
|
6091
|
-
|
|
6092
6026
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
6093
6027
|
|
|
6094
6028
|
---
|
|
@@ -6159,10 +6093,6 @@ export default class ReductionContext {
|
|
|
6159
6093
|
|
|
6160
6094
|
See also: [BigNumber](./primitives.md#class-bignumber), [Mersenne](./primitives.md#class-mersenne)
|
|
6161
6095
|
|
|
6162
|
-
<details>
|
|
6163
|
-
|
|
6164
|
-
<summary>Class ReductionContext Details</summary>
|
|
6165
|
-
|
|
6166
6096
|
#### Constructor
|
|
6167
6097
|
|
|
6168
6098
|
Constructs a new ReductionContext.
|
|
@@ -6676,8 +6606,6 @@ this.verify2(new BigNumber(-10).toRed(this), new BigNumber(20).toRed(this)); //t
|
|
|
6676
6606
|
this.verify2(new BigNumber(10).toRed(this), new BigNumber(20)); //throws an Error
|
|
6677
6607
|
```
|
|
6678
6608
|
|
|
6679
|
-
</details>
|
|
6680
|
-
|
|
6681
6609
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
6682
6610
|
|
|
6683
6611
|
---
|
|
@@ -6706,10 +6634,6 @@ export class SHA1 extends BaseHash {
|
|
|
6706
6634
|
}
|
|
6707
6635
|
```
|
|
6708
6636
|
|
|
6709
|
-
<details>
|
|
6710
|
-
|
|
6711
|
-
<summary>Class SHA1 Details</summary>
|
|
6712
|
-
|
|
6713
6637
|
#### Property W
|
|
6714
6638
|
|
|
6715
6639
|
Provides a way to recycle usage of the array memory.
|
|
@@ -6734,8 +6658,6 @@ The round constants used for each round of SHA-1.
|
|
|
6734
6658
|
k: number[]
|
|
6735
6659
|
```
|
|
6736
6660
|
|
|
6737
|
-
</details>
|
|
6738
|
-
|
|
6739
6661
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
6740
6662
|
|
|
6741
6663
|
---
|
|
@@ -6783,10 +6705,6 @@ export class SHA256 extends BaseHash {
|
|
|
6783
6705
|
}
|
|
6784
6706
|
```
|
|
6785
6707
|
|
|
6786
|
-
<details>
|
|
6787
|
-
|
|
6788
|
-
<summary>Class SHA256 Details</summary>
|
|
6789
|
-
|
|
6790
6708
|
#### Property W
|
|
6791
6709
|
|
|
6792
6710
|
Provides a way to recycle usage of the array memory.
|
|
@@ -6811,8 +6729,6 @@ The round constants used for each round of SHA-256
|
|
|
6811
6729
|
k: number[]
|
|
6812
6730
|
```
|
|
6813
6731
|
|
|
6814
|
-
</details>
|
|
6815
|
-
|
|
6816
6732
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
6817
6733
|
|
|
6818
6734
|
---
|
|
@@ -6839,10 +6755,6 @@ export class SHA256HMAC {
|
|
|
6839
6755
|
|
|
6840
6756
|
See also: [SHA256](./primitives.md#class-sha256)
|
|
6841
6757
|
|
|
6842
|
-
<details>
|
|
6843
|
-
|
|
6844
|
-
<summary>Class SHA256HMAC Details</summary>
|
|
6845
|
-
|
|
6846
6758
|
#### Constructor
|
|
6847
6759
|
|
|
6848
6760
|
The constructor for the `SHA256HMAC` class.
|
|
@@ -6962,8 +6874,6 @@ Example
|
|
|
6962
6874
|
myHMAC.update('deadbeef', 'hex');
|
|
6963
6875
|
```
|
|
6964
6876
|
|
|
6965
|
-
</details>
|
|
6966
|
-
|
|
6967
6877
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
6968
6878
|
|
|
6969
6879
|
---
|
|
@@ -6993,10 +6903,6 @@ export class SHA512 extends BaseHash {
|
|
|
6993
6903
|
}
|
|
6994
6904
|
```
|
|
6995
6905
|
|
|
6996
|
-
<details>
|
|
6997
|
-
|
|
6998
|
-
<summary>Class SHA512 Details</summary>
|
|
6999
|
-
|
|
7000
6906
|
#### Property W
|
|
7001
6907
|
|
|
7002
6908
|
Provides a way to recycle usage of the array memory.
|
|
@@ -7021,8 +6927,6 @@ The round constants used for each round of SHA-512.
|
|
|
7021
6927
|
k: number[]
|
|
7022
6928
|
```
|
|
7023
6929
|
|
|
7024
|
-
</details>
|
|
7025
|
-
|
|
7026
6930
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
7027
6931
|
|
|
7028
6932
|
---
|
|
@@ -7049,10 +6953,6 @@ export class SHA512HMAC {
|
|
|
7049
6953
|
|
|
7050
6954
|
See also: [SHA512](./primitives.md#class-sha512)
|
|
7051
6955
|
|
|
7052
|
-
<details>
|
|
7053
|
-
|
|
7054
|
-
<summary>Class SHA512HMAC Details</summary>
|
|
7055
|
-
|
|
7056
6956
|
#### Constructor
|
|
7057
6957
|
|
|
7058
6958
|
The constructor for the `SHA512HMAC` class.
|
|
@@ -7172,8 +7072,6 @@ Example
|
|
|
7172
7072
|
myHMAC.update('deadbeef', 'hex');
|
|
7173
7073
|
```
|
|
7174
7074
|
|
|
7175
|
-
</details>
|
|
7176
|
-
|
|
7177
7075
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
7178
7076
|
|
|
7179
7077
|
---
|
|
@@ -7226,10 +7124,6 @@ export default class Schnorr {
|
|
|
7226
7124
|
|
|
7227
7125
|
See also: [BigNumber](./primitives.md#class-bignumber), [Point](./primitives.md#class-point), [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)
|
|
7228
7126
|
|
|
7229
|
-
<details>
|
|
7230
|
-
|
|
7231
|
-
<summary>Class Schnorr Details</summary>
|
|
7232
|
-
|
|
7233
7127
|
#### Method generateProof
|
|
7234
7128
|
|
|
7235
7129
|
Generates a proof that demonstrates the link between public key A and shared secret S
|
|
@@ -7286,8 +7180,6 @@ Argument Details
|
|
|
7286
7180
|
+ **proof**
|
|
7287
7181
|
+ Proof (R, S', z)
|
|
7288
7182
|
|
|
7289
|
-
</details>
|
|
7290
|
-
|
|
7291
7183
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
7292
7184
|
|
|
7293
7185
|
---
|
|
@@ -7318,10 +7210,6 @@ export default class Signature {
|
|
|
7318
7210
|
|
|
7319
7211
|
See also: [BigNumber](./primitives.md#class-bignumber), [PublicKey](./primitives.md#class-publickey), [verify](./compat.md#variable-verify)
|
|
7320
7212
|
|
|
7321
|
-
<details>
|
|
7322
|
-
|
|
7323
|
-
<summary>Class Signature Details</summary>
|
|
7324
|
-
|
|
7325
7213
|
#### Constructor
|
|
7326
7214
|
|
|
7327
7215
|
Creates an instance of the Signature class.
|
|
@@ -7580,8 +7468,6 @@ const publicKey = PublicKey.fromString('04188ca1050...');
|
|
|
7580
7468
|
const isVerified = signature.verify(msg, publicKey);
|
|
7581
7469
|
```
|
|
7582
7470
|
|
|
7583
|
-
</details>
|
|
7584
|
-
|
|
7585
7471
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
7586
7472
|
|
|
7587
7473
|
---
|
|
@@ -7601,10 +7487,6 @@ export default class SymmetricKey extends BigNumber {
|
|
|
7601
7487
|
|
|
7602
7488
|
See also: [BigNumber](./primitives.md#class-bignumber), [decrypt](./messages.md#variable-decrypt), [encrypt](./messages.md#variable-encrypt)
|
|
7603
7489
|
|
|
7604
|
-
<details>
|
|
7605
|
-
|
|
7606
|
-
<summary>Class SymmetricKey Details</summary>
|
|
7607
|
-
|
|
7608
7490
|
#### Method decrypt
|
|
7609
7491
|
|
|
7610
7492
|
Decrypts a given AES-GCM encrypted message using the same key that was used for encryption.
|
|
@@ -7684,8 +7566,6 @@ Example
|
|
|
7684
7566
|
const symmetricKey = SymmetricKey.fromRandom();
|
|
7685
7567
|
```
|
|
7686
7568
|
|
|
7687
|
-
</details>
|
|
7688
|
-
|
|
7689
7569
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
7690
7570
|
|
|
7691
7571
|
---
|
|
@@ -7721,10 +7601,6 @@ export default class TransactionSignature extends Signature {
|
|
|
7721
7601
|
|
|
7722
7602
|
See also: [BigNumber](./primitives.md#class-bignumber), [Script](./script.md#class-script), [Signature](./primitives.md#class-signature), [TransactionInput](./transaction.md#interface-transactioninput), [TransactionOutput](./transaction.md#interface-transactionoutput)
|
|
7723
7603
|
|
|
7724
|
-
<details>
|
|
7725
|
-
|
|
7726
|
-
<summary>Class TransactionSignature Details</summary>
|
|
7727
|
-
|
|
7728
7604
|
#### Method hasLowS
|
|
7729
7605
|
|
|
7730
7606
|
Compares to bitcoind's IsLowDERSignature
|
|
@@ -7735,8 +7611,6 @@ See also Bip 62, "low S values in signatures"
|
|
|
7735
7611
|
public hasLowS(): boolean
|
|
7736
7612
|
```
|
|
7737
7613
|
|
|
7738
|
-
</details>
|
|
7739
|
-
|
|
7740
7614
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
7741
7615
|
|
|
7742
7616
|
---
|
|
@@ -7838,10 +7712,6 @@ Limited SHA-512-only PBKDF2 function for use in deprecated BIP39 code.
|
|
|
7838
7712
|
export function pbkdf2(password: number[], salt: number[], iterations: number, keylen: number, digest = "sha512"): number[]
|
|
7839
7713
|
```
|
|
7840
7714
|
|
|
7841
|
-
<details>
|
|
7842
|
-
|
|
7843
|
-
<summary>Function pbkdf2 Details</summary>
|
|
7844
|
-
|
|
7845
7715
|
Returns
|
|
7846
7716
|
|
|
7847
7717
|
The computed key
|
|
@@ -7859,8 +7729,6 @@ Argument Details
|
|
|
7859
7729
|
+ **digest**
|
|
7860
7730
|
+ The digest (must be sha512 for this implementation)
|
|
7861
7731
|
|
|
7862
|
-
</details>
|
|
7863
|
-
|
|
7864
7732
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
7865
7733
|
|
|
7866
7734
|
---
|
|
@@ -7870,10 +7738,6 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
7870
7738
|
export function toArray(msg: number[] | string, enc?: "hex" | "utf8"): number[]
|
|
7871
7739
|
```
|
|
7872
7740
|
|
|
7873
|
-
<details>
|
|
7874
|
-
|
|
7875
|
-
<summary>Function toArray Details</summary>
|
|
7876
|
-
|
|
7877
7741
|
Returns
|
|
7878
7742
|
|
|
7879
7743
|
array of byte values from msg. If msg is an array, a copy is returned.
|
|
@@ -7883,8 +7747,6 @@ Argument Details
|
|
|
7883
7747
|
+ **enc**
|
|
7884
7748
|
+ Optional. Encoding to use if msg is string. Default is 'utf8'.
|
|
7885
7749
|
|
|
7886
|
-
</details>
|
|
7887
|
-
|
|
7888
7750
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
7889
7751
|
|
|
7890
7752
|
---
|
|
@@ -7903,10 +7765,6 @@ console.log(toBase64(bytes)); // Outputs: SGVsbG8=
|
|
|
7903
7765
|
export function toBase64(byteArray: number[]): string
|
|
7904
7766
|
```
|
|
7905
7767
|
|
|
7906
|
-
<details>
|
|
7907
|
-
|
|
7908
|
-
<summary>Function toBase64 Details</summary>
|
|
7909
|
-
|
|
7910
7768
|
Returns
|
|
7911
7769
|
|
|
7912
7770
|
The base64 encoded string.
|
|
@@ -7916,8 +7774,6 @@ Argument Details
|
|
|
7916
7774
|
+ **byteArray**
|
|
7917
7775
|
+ An array of numbers where each number is a byte (0-255).
|
|
7918
7776
|
|
|
7919
|
-
</details>
|
|
7920
|
-
|
|
7921
7777
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
7922
7778
|
|
|
7923
7779
|
---
|
package/docs/script.md
CHANGED
|
@@ -8,6 +8,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
8
8
|
| --- |
|
|
9
9
|
| [ScriptChunk](#interface-scriptchunk) |
|
|
10
10
|
| [ScriptTemplate](#interface-scripttemplate) |
|
|
11
|
+
| [ScriptTemplateUnlock](#interface-scripttemplateunlock) |
|
|
11
12
|
|
|
12
13
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
13
14
|
|
|
@@ -31,26 +32,19 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
31
32
|
|
|
32
33
|
```ts
|
|
33
34
|
export default interface ScriptTemplate {
|
|
34
|
-
lock: (...params:
|
|
35
|
-
unlock: (...params:
|
|
36
|
-
sign: (tx: Transaction, inputIndex: number) => Promise<UnlockingScript>;
|
|
37
|
-
estimateLength: (tx: Transaction, inputIndex: number) => Promise<number>;
|
|
38
|
-
};
|
|
35
|
+
lock: (...params: any[]) => LockingScript | Promise<LockingScript>;
|
|
36
|
+
unlock: (...params: any[]) => ScriptTemplateUnlock;
|
|
39
37
|
}
|
|
40
38
|
```
|
|
41
39
|
|
|
42
|
-
See also: [LockingScript](./script.md#class-lockingscript), [
|
|
43
|
-
|
|
44
|
-
<details>
|
|
45
|
-
|
|
46
|
-
<summary>Interface ScriptTemplate Details</summary>
|
|
40
|
+
See also: [LockingScript](./script.md#class-lockingscript), [ScriptTemplateUnlock](./script.md#interface-scripttemplateunlock)
|
|
47
41
|
|
|
48
42
|
#### Property lock
|
|
49
43
|
|
|
50
44
|
Creates a locking script with the given parameters.
|
|
51
45
|
|
|
52
46
|
```ts
|
|
53
|
-
lock: (...params:
|
|
47
|
+
lock: (...params: any[]) => LockingScript | Promise<LockingScript>
|
|
54
48
|
```
|
|
55
49
|
See also: [LockingScript](./script.md#class-lockingscript)
|
|
56
50
|
|
|
@@ -63,14 +57,23 @@ This method returns an object containing two functions:
|
|
|
63
57
|
2. `estimateLength` - A function that returns the estimated length of the unlocking script in bytes.
|
|
64
58
|
|
|
65
59
|
```ts
|
|
66
|
-
unlock: (...params:
|
|
60
|
+
unlock: (...params: any[]) => ScriptTemplateUnlock
|
|
61
|
+
```
|
|
62
|
+
See also: [ScriptTemplateUnlock](./script.md#interface-scripttemplateunlock)
|
|
63
|
+
|
|
64
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
### Interface: ScriptTemplateUnlock
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
export default interface ScriptTemplateUnlock {
|
|
67
71
|
sign: (tx: Transaction, inputIndex: number) => Promise<UnlockingScript>;
|
|
68
72
|
estimateLength: (tx: Transaction, inputIndex: number) => Promise<number>;
|
|
69
73
|
}
|
|
70
74
|
```
|
|
71
|
-
See also: [Transaction](./transaction.md#class-transaction), [UnlockingScript](./script.md#class-unlockingscript), [sign](./compat.md#variable-sign)
|
|
72
75
|
|
|
73
|
-
|
|
76
|
+
See also: [Transaction](./transaction.md#class-transaction), [UnlockingScript](./script.md#class-unlockingscript), [sign](./compat.md#variable-sign)
|
|
74
77
|
|
|
75
78
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
76
79
|
|
|
@@ -107,10 +110,6 @@ export default class LockingScript extends Script {
|
|
|
107
110
|
|
|
108
111
|
See also: [Script](./script.md#class-script)
|
|
109
112
|
|
|
110
|
-
<details>
|
|
111
|
-
|
|
112
|
-
<summary>Class LockingScript Details</summary>
|
|
113
|
-
|
|
114
113
|
#### Method isLockingScript
|
|
115
114
|
|
|
116
115
|
```ts
|
|
@@ -131,8 +130,6 @@ Returns
|
|
|
131
130
|
|
|
132
131
|
Always returns false for a LockingScript instance.
|
|
133
132
|
|
|
134
|
-
</details>
|
|
135
|
-
|
|
136
133
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
137
134
|
|
|
138
135
|
---
|
|
@@ -154,10 +151,6 @@ export default class P2PKH implements ScriptTemplate {
|
|
|
154
151
|
|
|
155
152
|
See also: [LockingScript](./script.md#class-lockingscript), [PrivateKey](./primitives.md#class-privatekey), [Script](./script.md#class-script), [ScriptTemplate](./script.md#interface-scripttemplate), [Transaction](./transaction.md#class-transaction), [UnlockingScript](./script.md#class-unlockingscript), [sign](./compat.md#variable-sign)
|
|
156
153
|
|
|
157
|
-
<details>
|
|
158
|
-
|
|
159
|
-
<summary>Class P2PKH Details</summary>
|
|
160
|
-
|
|
161
154
|
#### Method lock
|
|
162
155
|
|
|
163
156
|
Creates a P2PKH locking script for a given public key hash or address string
|
|
@@ -210,8 +203,6 @@ Argument Details
|
|
|
210
203
|
+ **lockingScript**
|
|
211
204
|
+ Optional. The lockinScript. Otherwise the input.sourceTransaction is required.
|
|
212
205
|
|
|
213
|
-
</details>
|
|
214
|
-
|
|
215
206
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
216
207
|
|
|
217
208
|
---
|
|
@@ -241,10 +232,6 @@ export default class PushDrop implements ScriptTemplate {
|
|
|
241
232
|
|
|
242
233
|
See also: [LockingScript](./script.md#class-lockingscript), [PublicKey](./primitives.md#class-publickey), [ScriptTemplate](./script.md#interface-scripttemplate), [SecurityLevel](./wallet.md#type-securitylevel), [Transaction](./transaction.md#class-transaction), [UnlockingScript](./script.md#class-unlockingscript), [WalletInterface](./wallet.md#interface-walletinterface), [sign](./compat.md#variable-sign)
|
|
243
234
|
|
|
244
|
-
<details>
|
|
245
|
-
|
|
246
|
-
<summary>Class PushDrop Details</summary>
|
|
247
|
-
|
|
248
235
|
#### Constructor
|
|
249
236
|
|
|
250
237
|
Constructs a new instance of the PushDrop class.
|
|
@@ -350,8 +337,6 @@ Argument Details
|
|
|
350
337
|
+ **anyoneCanPay**
|
|
351
338
|
+ Specifies if the anyone-can-pay flag is set.
|
|
352
339
|
|
|
353
|
-
</details>
|
|
354
|
-
|
|
355
340
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
356
341
|
|
|
357
342
|
---
|
|
@@ -375,10 +360,6 @@ export default class RPuzzle implements ScriptTemplate {
|
|
|
375
360
|
|
|
376
361
|
See also: [BigNumber](./primitives.md#class-bignumber), [LockingScript](./script.md#class-lockingscript), [PrivateKey](./primitives.md#class-privatekey), [ScriptTemplate](./script.md#interface-scripttemplate), [Transaction](./transaction.md#class-transaction), [UnlockingScript](./script.md#class-unlockingscript), [sign](./compat.md#variable-sign)
|
|
377
362
|
|
|
378
|
-
<details>
|
|
379
|
-
|
|
380
|
-
<summary>Class RPuzzle Details</summary>
|
|
381
|
-
|
|
382
363
|
#### Constructor
|
|
383
364
|
|
|
384
365
|
```ts
|
|
@@ -440,8 +421,6 @@ Argument Details
|
|
|
440
421
|
+ **anyoneCanPay**
|
|
441
422
|
+ Flag indicating if the signature allows for other inputs to be added later.
|
|
442
423
|
|
|
443
|
-
</details>
|
|
444
|
-
|
|
445
424
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
446
425
|
|
|
447
426
|
---
|
|
@@ -477,10 +456,6 @@ export default class Script {
|
|
|
477
456
|
|
|
478
457
|
See also: [BigNumber](./primitives.md#class-bignumber), [ScriptChunk](./script.md#interface-scriptchunk), [toHex](./primitives.md#variable-tohex)
|
|
479
458
|
|
|
480
|
-
<details>
|
|
481
|
-
|
|
482
|
-
<summary>Class Script Details</summary>
|
|
483
|
-
|
|
484
459
|
#### Constructor
|
|
485
460
|
|
|
486
461
|
```ts
|
|
@@ -750,8 +725,6 @@ Argument Details
|
|
|
750
725
|
+ **script**
|
|
751
726
|
+ The script to append.
|
|
752
727
|
|
|
753
|
-
</details>
|
|
754
|
-
|
|
755
728
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
756
729
|
|
|
757
730
|
---
|
|
@@ -801,10 +774,6 @@ export default class Spend {
|
|
|
801
774
|
|
|
802
775
|
See also: [LockingScript](./script.md#class-lockingscript), [TransactionInput](./transaction.md#interface-transactioninput), [TransactionOutput](./transaction.md#interface-transactionoutput), [UnlockingScript](./script.md#class-unlockingscript)
|
|
803
776
|
|
|
804
|
-
<details>
|
|
805
|
-
|
|
806
|
-
<summary>Class Spend Details</summary>
|
|
807
|
-
|
|
808
777
|
#### Constructor
|
|
809
778
|
|
|
810
779
|
```ts
|
|
@@ -888,8 +857,6 @@ if (spend.validate()) {
|
|
|
888
857
|
}
|
|
889
858
|
```
|
|
890
859
|
|
|
891
|
-
</details>
|
|
892
|
-
|
|
893
860
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
894
861
|
|
|
895
862
|
---
|
|
@@ -909,10 +876,6 @@ export default class UnlockingScript extends Script {
|
|
|
909
876
|
|
|
910
877
|
See also: [Script](./script.md#class-script)
|
|
911
878
|
|
|
912
|
-
<details>
|
|
913
|
-
|
|
914
|
-
<summary>Class UnlockingScript Details</summary>
|
|
915
|
-
|
|
916
879
|
#### Method isLockingScript
|
|
917
880
|
|
|
918
881
|
```ts
|
|
@@ -933,8 +896,6 @@ Returns
|
|
|
933
896
|
|
|
934
897
|
Always returns true for an UnlockingScript instance.
|
|
935
898
|
|
|
936
|
-
</details>
|
|
937
|
-
|
|
938
899
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
939
900
|
|
|
940
901
|
---
|
package/docs/totp.md
CHANGED
|
@@ -35,10 +35,6 @@ export class TOTP {
|
|
|
35
35
|
|
|
36
36
|
See also: [TOTPOptions](./totp.md#interface-totpoptions), [TOTPValidateOptions](./totp.md#type-totpvalidateoptions)
|
|
37
37
|
|
|
38
|
-
<details>
|
|
39
|
-
|
|
40
|
-
<summary>Class TOTP Details</summary>
|
|
41
|
-
|
|
42
38
|
#### Method generate
|
|
43
39
|
|
|
44
40
|
Generates a Time-based One-Time Password (TOTP).
|
|
@@ -81,8 +77,6 @@ Argument Details
|
|
|
81
77
|
+ **options**
|
|
82
78
|
+ Optional parameters for TOTP validation.
|
|
83
79
|
|
|
84
|
-
</details>
|
|
85
|
-
|
|
86
80
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
87
81
|
|
|
88
82
|
---
|