@bsv/sdk 1.8.2 → 1.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/src/primitives/Random.js +78 -19
- package/dist/cjs/src/primitives/Random.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/primitives/Random.js +78 -19
- package/dist/esm/src/primitives/Random.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/primitives/Random.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +3 -3
- package/dist/umd/bundle.js.map +1 -1
- package/docs/reference/compat.md +27 -15
- package/docs/reference/identity.md +16 -12
- package/docs/reference/kvstore.md +25 -7
- package/docs/reference/messages.md +8 -0
- package/docs/reference/overlay-tools.md +22 -15
- package/docs/reference/primitives.md +168 -168
- package/docs/reference/registry.md +19 -9
- package/docs/reference/script.md +32 -31
- package/docs/reference/storage.md +14 -10
- package/docs/reference/totp.md +5 -5
- package/docs/reference/transaction.md +70 -67
- package/docs/reference/wallet.md +135 -131
- package/package.json +1 -1
- package/src/primitives/Random.ts +86 -17
- package/src/primitives/__tests/Random.test.ts +21 -0
|
@@ -34,7 +34,7 @@ export interface ArcConfig {
|
|
|
34
34
|
}
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
See also: [HttpClient](#interface-httpclient)
|
|
37
|
+
See also: [HttpClient](./transaction.md#interface-httpclient)
|
|
38
38
|
|
|
39
39
|
#### Property apiKey
|
|
40
40
|
|
|
@@ -83,7 +83,7 @@ The HTTP client used to make requests to the ARC API.
|
|
|
83
83
|
```ts
|
|
84
84
|
httpClient?: HttpClient
|
|
85
85
|
```
|
|
86
|
-
See also: [HttpClient](#interface-httpclient)
|
|
86
|
+
See also: [HttpClient](./transaction.md#interface-httpclient)
|
|
87
87
|
|
|
88
88
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
89
89
|
|
|
@@ -133,7 +133,7 @@ export interface Broadcaster {
|
|
|
133
133
|
}
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
-
See also: [BroadcastFailure](#interface-broadcastfailure), [BroadcastResponse](#interface-broadcastresponse), [Transaction](#class-transaction)
|
|
136
|
+
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [Transaction](./transaction.md#class-transaction)
|
|
137
137
|
|
|
138
138
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
139
139
|
|
|
@@ -181,7 +181,7 @@ export default interface FeeModel {
|
|
|
181
181
|
}
|
|
182
182
|
```
|
|
183
183
|
|
|
184
|
-
See also: [Transaction](#class-transaction)
|
|
184
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
185
185
|
|
|
186
186
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
187
187
|
|
|
@@ -236,7 +236,7 @@ export interface HttpClient {
|
|
|
236
236
|
}
|
|
237
237
|
```
|
|
238
238
|
|
|
239
|
-
See also: [HttpClientRequestOptions](#interface-httpclientrequestoptions), [HttpClientResponse](#type-httpclientresponse)
|
|
239
|
+
See also: [HttpClientRequestOptions](./transaction.md#interface-httpclientrequestoptions), [HttpClientResponse](./transaction.md#type-httpclientresponse)
|
|
240
240
|
|
|
241
241
|
#### Property request
|
|
242
242
|
|
|
@@ -245,7 +245,7 @@ Makes a request to the server.
|
|
|
245
245
|
```ts
|
|
246
246
|
request: <T = any, D = any>(url: string, options: HttpClientRequestOptions<D>) => Promise<HttpClientResponse<T>>
|
|
247
247
|
```
|
|
248
|
-
See also: [HttpClientRequestOptions](#interface-httpclientrequestoptions), [HttpClientResponse](#type-httpclientresponse)
|
|
248
|
+
See also: [HttpClientRequestOptions](./transaction.md#interface-httpclientrequestoptions), [HttpClientResponse](./transaction.md#type-httpclientresponse)
|
|
249
249
|
|
|
250
250
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
251
251
|
|
|
@@ -308,7 +308,7 @@ export interface HttpsNodejs {
|
|
|
308
308
|
}
|
|
309
309
|
```
|
|
310
310
|
|
|
311
|
-
See also: [HttpClientRequestOptions](#interface-httpclientrequestoptions), [NodejsHttpClientRequest](#interface-nodejshttpclientrequest)
|
|
311
|
+
See also: [HttpClientRequestOptions](./transaction.md#interface-httpclientrequestoptions), [NodejsHttpClientRequest](./transaction.md#interface-nodejshttpclientrequest)
|
|
312
312
|
|
|
313
313
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
314
314
|
|
|
@@ -379,7 +379,7 @@ export default interface TransactionInput {
|
|
|
379
379
|
}
|
|
380
380
|
```
|
|
381
381
|
|
|
382
|
-
See also: [Transaction](#class-transaction)
|
|
382
|
+
See also: [Transaction](./transaction.md#class-transaction), [UnlockingScript](./script.md#class-unlockingscript), [sign](./compat.md#variable-sign)
|
|
383
383
|
|
|
384
384
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
385
385
|
|
|
@@ -409,6 +409,8 @@ export default interface TransactionOutput {
|
|
|
409
409
|
}
|
|
410
410
|
```
|
|
411
411
|
|
|
412
|
+
See also: [LockingScript](./script.md#class-lockingscript)
|
|
413
|
+
|
|
412
414
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
413
415
|
|
|
414
416
|
---
|
|
@@ -423,7 +425,7 @@ export interface WhatsOnChainConfig {
|
|
|
423
425
|
}
|
|
424
426
|
```
|
|
425
427
|
|
|
426
|
-
See also: [HttpClient](#interface-httpclient)
|
|
428
|
+
See also: [HttpClient](./transaction.md#interface-httpclient)
|
|
427
429
|
|
|
428
430
|
#### Property apiKey
|
|
429
431
|
|
|
@@ -440,7 +442,7 @@ The HTTP client used to make requests to the API.
|
|
|
440
442
|
```ts
|
|
441
443
|
httpClient?: HttpClient
|
|
442
444
|
```
|
|
443
|
-
See also: [HttpClient](#interface-httpclient)
|
|
445
|
+
See also: [HttpClient](./transaction.md#interface-httpclient)
|
|
444
446
|
|
|
445
447
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
446
448
|
|
|
@@ -485,7 +487,7 @@ export default class ARC implements Broadcaster {
|
|
|
485
487
|
}
|
|
486
488
|
```
|
|
487
489
|
|
|
488
|
-
See also: [ArcConfig](#interface-arcconfig), [BroadcastFailure](#interface-broadcastfailure), [BroadcastResponse](#interface-broadcastresponse), [Broadcaster](#interface-broadcaster), [Transaction](#class-transaction)
|
|
490
|
+
See also: [ArcConfig](./transaction.md#interface-arcconfig), [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [Broadcaster](./transaction.md#interface-broadcaster), [Transaction](./transaction.md#class-transaction)
|
|
489
491
|
|
|
490
492
|
#### Constructor
|
|
491
493
|
|
|
@@ -494,7 +496,7 @@ Constructs an instance of the ARC broadcaster.
|
|
|
494
496
|
```ts
|
|
495
497
|
constructor(URL: string, config?: ArcConfig)
|
|
496
498
|
```
|
|
497
|
-
See also: [ArcConfig](#interface-arcconfig)
|
|
499
|
+
See also: [ArcConfig](./transaction.md#interface-arcconfig)
|
|
498
500
|
|
|
499
501
|
Argument Details
|
|
500
502
|
|
|
@@ -525,7 +527,7 @@ Broadcasts a transaction via ARC.
|
|
|
525
527
|
```ts
|
|
526
528
|
async broadcast(tx: Transaction): Promise<BroadcastResponse | BroadcastFailure>
|
|
527
529
|
```
|
|
528
|
-
See also: [BroadcastFailure](#interface-broadcastfailure), [BroadcastResponse](#interface-broadcastresponse), [Transaction](#class-transaction)
|
|
530
|
+
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [Transaction](./transaction.md#class-transaction)
|
|
529
531
|
|
|
530
532
|
Returns
|
|
531
533
|
|
|
@@ -544,7 +546,7 @@ Handles mixed responses where some transactions succeed and others fail.
|
|
|
544
546
|
```ts
|
|
545
547
|
async broadcastMany(txs: Transaction[]): Promise<object[]>
|
|
546
548
|
```
|
|
547
|
-
See also: [Transaction](#class-transaction)
|
|
549
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
548
550
|
|
|
549
551
|
Returns
|
|
550
552
|
|
|
@@ -607,7 +609,7 @@ export class Beef {
|
|
|
607
609
|
}
|
|
608
610
|
```
|
|
609
611
|
|
|
610
|
-
See also: [BEEF_V2](#variable-beef_v2), [BeefTx](#class-beeftx), [ChainTracker](#interface-chaintracker), [MerklePath](#class-merklepath), [Transaction](#class-transaction)
|
|
612
|
+
See also: [BEEF_V2](./transaction.md#variable-beef_v2), [BeefTx](./transaction.md#class-beeftx), [ChainTracker](./transaction.md#interface-chaintracker), [MerklePath](./transaction.md#class-merklepath), [Reader](./primitives.md#class-reader), [Transaction](./transaction.md#class-transaction), [Writer](./primitives.md#class-writer), [toHex](./primitives.md#variable-tohex), [verify](./compat.md#variable-verify)
|
|
611
613
|
|
|
612
614
|
#### Method addComputedLeaves
|
|
613
615
|
|
|
@@ -623,7 +625,7 @@ addComputedLeaves(): void
|
|
|
623
625
|
```ts
|
|
624
626
|
clone(): Beef
|
|
625
627
|
```
|
|
626
|
-
See also: [Beef](#class-beef)
|
|
628
|
+
See also: [Beef](./transaction.md#class-beef)
|
|
627
629
|
|
|
628
630
|
Returns
|
|
629
631
|
|
|
@@ -638,7 +640,7 @@ To succeed, the Beef must contain all the required transaction and merkle path d
|
|
|
638
640
|
```ts
|
|
639
641
|
findAtomicTransaction(txid: string): Transaction | undefined
|
|
640
642
|
```
|
|
641
|
-
See also: [Transaction](#class-transaction)
|
|
643
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
642
644
|
|
|
643
645
|
Returns
|
|
644
646
|
|
|
@@ -654,7 +656,7 @@ Argument Details
|
|
|
654
656
|
```ts
|
|
655
657
|
findBump(txid: string): MerklePath | undefined
|
|
656
658
|
```
|
|
657
|
-
See also: [MerklePath](#class-merklepath)
|
|
659
|
+
See also: [MerklePath](./transaction.md#class-merklepath)
|
|
658
660
|
|
|
659
661
|
Returns
|
|
660
662
|
|
|
@@ -670,7 +672,7 @@ The result is suitable for signing.
|
|
|
670
672
|
```ts
|
|
671
673
|
findTransactionForSigning(txid: string): Transaction | undefined
|
|
672
674
|
```
|
|
673
|
-
See also: [Transaction](#class-transaction)
|
|
675
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
674
676
|
|
|
675
677
|
Returns
|
|
676
678
|
|
|
@@ -686,7 +688,7 @@ Argument Details
|
|
|
686
688
|
```ts
|
|
687
689
|
findTxid(txid: string): BeefTx | undefined
|
|
688
690
|
```
|
|
689
|
-
See also: [BeefTx](#class-beeftx)
|
|
691
|
+
See also: [BeefTx](./transaction.md#class-beeftx)
|
|
690
692
|
|
|
691
693
|
Returns
|
|
692
694
|
|
|
@@ -704,7 +706,7 @@ Constructs an instance of the Beef class based on the provided binary array
|
|
|
704
706
|
```ts
|
|
705
707
|
static fromBinary(bin: number[]): Beef
|
|
706
708
|
```
|
|
707
|
-
See also: [Beef](#class-beef)
|
|
709
|
+
See also: [Beef](./transaction.md#class-beef)
|
|
708
710
|
|
|
709
711
|
Returns
|
|
710
712
|
|
|
@@ -722,7 +724,7 @@ Constructs an instance of the Beef class based on the provided string
|
|
|
722
724
|
```ts
|
|
723
725
|
static fromString(s: string, enc: "hex" | "utf8" | "base64" = "hex"): Beef
|
|
724
726
|
```
|
|
725
|
-
See also: [Beef](#class-beef)
|
|
727
|
+
See also: [Beef](./transaction.md#class-beef)
|
|
726
728
|
|
|
727
729
|
Returns
|
|
728
730
|
|
|
@@ -777,7 +779,7 @@ original.
|
|
|
777
779
|
```ts
|
|
778
780
|
makeTxidOnly(txid: string): BeefTx | undefined
|
|
779
781
|
```
|
|
780
|
-
See also: [BeefTx](#class-beeftx)
|
|
782
|
+
See also: [BeefTx](./transaction.md#class-beeftx)
|
|
781
783
|
|
|
782
784
|
Returns
|
|
783
785
|
|
|
@@ -790,7 +792,7 @@ Merge a MerklePath that is assumed to be fully valid.
|
|
|
790
792
|
```ts
|
|
791
793
|
mergeBump(bump: MerklePath): number
|
|
792
794
|
```
|
|
793
|
-
See also: [MerklePath](#class-merklepath)
|
|
795
|
+
See also: [MerklePath](./transaction.md#class-merklepath)
|
|
794
796
|
|
|
795
797
|
Returns
|
|
796
798
|
|
|
@@ -807,7 +809,7 @@ Replaces existing transaction with same txid.
|
|
|
807
809
|
```ts
|
|
808
810
|
mergeRawTx(rawTx: number[], bumpIndex?: number): BeefTx
|
|
809
811
|
```
|
|
810
|
-
See also: [BeefTx](#class-beeftx)
|
|
812
|
+
See also: [BeefTx](./transaction.md#class-beeftx)
|
|
811
813
|
|
|
812
814
|
Returns
|
|
813
815
|
|
|
@@ -829,7 +831,7 @@ Attempts to match an existing bump to the new transaction.
|
|
|
829
831
|
```ts
|
|
830
832
|
mergeTransaction(tx: Transaction): BeefTx
|
|
831
833
|
```
|
|
832
|
-
See also: [BeefTx](#class-beeftx), [Transaction](#class-transaction)
|
|
834
|
+
See also: [BeefTx](./transaction.md#class-beeftx), [Transaction](./transaction.md#class-transaction)
|
|
833
835
|
|
|
834
836
|
Returns
|
|
835
837
|
|
|
@@ -928,6 +930,7 @@ Serializes this data to `writer`
|
|
|
928
930
|
```ts
|
|
929
931
|
toWriter(writer: Writer): void
|
|
930
932
|
```
|
|
933
|
+
See also: [Writer](./primitives.md#class-writer)
|
|
931
934
|
|
|
932
935
|
#### Method trimKnownTxids
|
|
933
936
|
|
|
@@ -952,7 +955,7 @@ Validity requirements:
|
|
|
952
955
|
```ts
|
|
953
956
|
async verify(chainTracker: ChainTracker, allowTxidOnly?: boolean): Promise<boolean>
|
|
954
957
|
```
|
|
955
|
-
See also: [ChainTracker](#interface-chaintracker)
|
|
958
|
+
See also: [ChainTracker](./transaction.md#interface-chaintracker)
|
|
956
959
|
|
|
957
960
|
Argument Details
|
|
958
961
|
|
|
@@ -1028,7 +1031,7 @@ export class BeefParty extends Beef {
|
|
|
1028
1031
|
}
|
|
1029
1032
|
```
|
|
1030
1033
|
|
|
1031
|
-
See also: [Beef](#class-beef)
|
|
1034
|
+
See also: [Beef](./transaction.md#class-beef)
|
|
1032
1035
|
|
|
1033
1036
|
#### Constructor
|
|
1034
1037
|
|
|
@@ -1086,7 +1089,7 @@ Array of txids "known" to `party`.
|
|
|
1086
1089
|
```ts
|
|
1087
1090
|
getTrimmedBeefForParty(party: string): Beef
|
|
1088
1091
|
```
|
|
1089
|
-
See also: [Beef](#class-beef)
|
|
1092
|
+
See also: [Beef](./transaction.md#class-beef)
|
|
1090
1093
|
|
|
1091
1094
|
Returns
|
|
1092
1095
|
|
|
@@ -1113,7 +1116,7 @@ has raw transaction and validity proof data.
|
|
|
1113
1116
|
```ts
|
|
1114
1117
|
mergeBeefFromParty(party: string, beef: number[] | Beef): void
|
|
1115
1118
|
```
|
|
1116
|
-
See also: [Beef](#class-beef)
|
|
1119
|
+
See also: [Beef](./transaction.md#class-beef)
|
|
1117
1120
|
|
|
1118
1121
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
1119
1122
|
|
|
@@ -1152,14 +1155,14 @@ export default class BeefTx {
|
|
|
1152
1155
|
}
|
|
1153
1156
|
```
|
|
1154
1157
|
|
|
1155
|
-
See also: [Transaction](#class-transaction)
|
|
1158
|
+
See also: [Reader](./primitives.md#class-reader), [Transaction](./transaction.md#class-transaction), [Writer](./primitives.md#class-writer)
|
|
1156
1159
|
|
|
1157
1160
|
#### Constructor
|
|
1158
1161
|
|
|
1159
1162
|
```ts
|
|
1160
1163
|
constructor(tx: Transaction | number[] | string, bumpIndex?: number)
|
|
1161
1164
|
```
|
|
1162
|
-
See also: [Transaction](#class-transaction)
|
|
1165
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
1163
1166
|
|
|
1164
1167
|
Argument Details
|
|
1165
1168
|
|
|
@@ -1192,7 +1195,7 @@ export class FetchHttpClient implements HttpClient {
|
|
|
1192
1195
|
}
|
|
1193
1196
|
```
|
|
1194
1197
|
|
|
1195
|
-
See also: [Fetch](#type-fetch), [HttpClient](#interface-httpclient), [HttpClientRequestOptions](#interface-httpclientrequestoptions), [HttpClientResponse](#type-httpclientresponse)
|
|
1198
|
+
See also: [Fetch](./transaction.md#type-fetch), [HttpClient](./transaction.md#interface-httpclient), [HttpClientRequestOptions](./transaction.md#interface-httpclientrequestoptions), [HttpClientResponse](./transaction.md#type-httpclientresponse)
|
|
1196
1199
|
|
|
1197
1200
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
1198
1201
|
|
|
@@ -1210,7 +1213,7 @@ export default class LivePolicy extends SatoshisPerKilobyte {
|
|
|
1210
1213
|
}
|
|
1211
1214
|
```
|
|
1212
1215
|
|
|
1213
|
-
See also: [SatoshisPerKilobyte](#class-satoshisperkilobyte), [Transaction](#class-transaction)
|
|
1216
|
+
See also: [SatoshisPerKilobyte](./transaction.md#class-satoshisperkilobyte), [Transaction](./transaction.md#class-transaction)
|
|
1214
1217
|
|
|
1215
1218
|
#### Constructor
|
|
1216
1219
|
|
|
@@ -1233,7 +1236,7 @@ Overrides the parent method to use dynamic rate fetching.
|
|
|
1233
1236
|
```ts
|
|
1234
1237
|
async computeFee(tx: Transaction): Promise<number>
|
|
1235
1238
|
```
|
|
1236
|
-
See also: [Transaction](#class-transaction)
|
|
1239
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
1237
1240
|
|
|
1238
1241
|
Returns
|
|
1239
1242
|
|
|
@@ -1251,7 +1254,7 @@ Gets the singleton instance of LivePolicy to ensure cache sharing across the app
|
|
|
1251
1254
|
```ts
|
|
1252
1255
|
static getInstance(cacheValidityMs: number = 5 * 60 * 1000): LivePolicy
|
|
1253
1256
|
```
|
|
1254
|
-
See also: [LivePolicy](#class-livepolicy)
|
|
1257
|
+
See also: [LivePolicy](./transaction.md#class-livepolicy)
|
|
1255
1258
|
|
|
1256
1259
|
Returns
|
|
1257
1260
|
|
|
@@ -1308,7 +1311,7 @@ export default class MerklePath {
|
|
|
1308
1311
|
}
|
|
1309
1312
|
```
|
|
1310
1313
|
|
|
1311
|
-
See also: [ChainTracker](#interface-chaintracker), [MerklePathLeaf](#interface-merklepathleaf)
|
|
1314
|
+
See also: [ChainTracker](./transaction.md#interface-chaintracker), [MerklePathLeaf](./transaction.md#interface-merklepathleaf), [Reader](./primitives.md#class-reader), [toHex](./primitives.md#variable-tohex), [verify](./compat.md#variable-verify)
|
|
1312
1315
|
|
|
1313
1316
|
#### Method combine
|
|
1314
1317
|
|
|
@@ -1317,7 +1320,7 @@ Combines this MerklePath with another to create a compound proof.
|
|
|
1317
1320
|
```ts
|
|
1318
1321
|
combine(other: MerklePath): void
|
|
1319
1322
|
```
|
|
1320
|
-
See also: [MerklePath](#class-merklepath)
|
|
1323
|
+
See also: [MerklePath](./transaction.md#class-merklepath)
|
|
1321
1324
|
|
|
1322
1325
|
Argument Details
|
|
1323
1326
|
|
|
@@ -1358,7 +1361,7 @@ Does not add computed leaves to path.
|
|
|
1358
1361
|
```ts
|
|
1359
1362
|
findOrComputeLeaf(height: number, offset: number): MerklePathLeaf | undefined
|
|
1360
1363
|
```
|
|
1361
|
-
See also: [MerklePathLeaf](#interface-merklepathleaf)
|
|
1364
|
+
See also: [MerklePathLeaf](./transaction.md#interface-merklepathleaf)
|
|
1362
1365
|
|
|
1363
1366
|
#### Method fromBinary
|
|
1364
1367
|
|
|
@@ -1367,7 +1370,7 @@ Creates a MerklePath instance from a binary array.
|
|
|
1367
1370
|
```ts
|
|
1368
1371
|
static fromBinary(bump: number[]): MerklePath
|
|
1369
1372
|
```
|
|
1370
|
-
See also: [MerklePath](#class-merklepath)
|
|
1373
|
+
See also: [MerklePath](./transaction.md#class-merklepath)
|
|
1371
1374
|
|
|
1372
1375
|
Returns
|
|
1373
1376
|
|
|
@@ -1383,7 +1386,7 @@ Argument Details
|
|
|
1383
1386
|
```ts
|
|
1384
1387
|
static fromCoinbaseTxidAndHeight(txid: string, height: number): MerklePath
|
|
1385
1388
|
```
|
|
1386
|
-
See also: [MerklePath](#class-merklepath)
|
|
1389
|
+
See also: [MerklePath](./transaction.md#class-merklepath)
|
|
1387
1390
|
|
|
1388
1391
|
Returns
|
|
1389
1392
|
|
|
@@ -1403,7 +1406,7 @@ Creates a MerklePath instance from a hexadecimal string.
|
|
|
1403
1406
|
```ts
|
|
1404
1407
|
static fromHex(hex: string): MerklePath
|
|
1405
1408
|
```
|
|
1406
|
-
See also: [MerklePath](#class-merklepath)
|
|
1409
|
+
See also: [MerklePath](./transaction.md#class-merklepath)
|
|
1407
1410
|
|
|
1408
1411
|
Returns
|
|
1409
1412
|
|
|
@@ -1455,7 +1458,7 @@ Verifies if the given transaction ID is part of the Merkle tree at the specified
|
|
|
1455
1458
|
```ts
|
|
1456
1459
|
async verify(txid: string, chainTracker: ChainTracker): Promise<boolean>
|
|
1457
1460
|
```
|
|
1458
|
-
See also: [ChainTracker](#interface-chaintracker)
|
|
1461
|
+
See also: [ChainTracker](./transaction.md#interface-chaintracker)
|
|
1459
1462
|
|
|
1460
1463
|
Returns
|
|
1461
1464
|
|
|
@@ -1482,7 +1485,7 @@ export class NodejsHttpClient implements HttpClient {
|
|
|
1482
1485
|
}
|
|
1483
1486
|
```
|
|
1484
1487
|
|
|
1485
|
-
See also: [HttpClient](#interface-httpclient), [HttpClientRequestOptions](#interface-httpclientrequestoptions), [HttpClientResponse](#type-httpclientresponse), [HttpsNodejs](#interface-httpsnodejs)
|
|
1488
|
+
See also: [HttpClient](./transaction.md#interface-httpclient), [HttpClientRequestOptions](./transaction.md#interface-httpclientrequestoptions), [HttpClientResponse](./transaction.md#type-httpclientresponse), [HttpsNodejs](./transaction.md#interface-httpsnodejs)
|
|
1486
1489
|
|
|
1487
1490
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
1488
1491
|
|
|
@@ -1499,7 +1502,7 @@ export default class SatoshisPerKilobyte implements FeeModel {
|
|
|
1499
1502
|
}
|
|
1500
1503
|
```
|
|
1501
1504
|
|
|
1502
|
-
See also: [FeeModel](#interface-feemodel), [Transaction](#class-transaction)
|
|
1505
|
+
See also: [FeeModel](./transaction.md#interface-feemodel), [Transaction](./transaction.md#class-transaction)
|
|
1503
1506
|
|
|
1504
1507
|
#### Constructor
|
|
1505
1508
|
|
|
@@ -1521,7 +1524,7 @@ Computes the fee for a given transaction.
|
|
|
1521
1524
|
```ts
|
|
1522
1525
|
async computeFee(tx: Transaction): Promise<number>
|
|
1523
1526
|
```
|
|
1524
|
-
See also: [Transaction](#class-transaction)
|
|
1527
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
1525
1528
|
|
|
1526
1529
|
Returns
|
|
1527
1530
|
|
|
@@ -1606,7 +1609,7 @@ export default class Transaction {
|
|
|
1606
1609
|
}
|
|
1607
1610
|
```
|
|
1608
1611
|
|
|
1609
|
-
See also: [BroadcastFailure](#interface-broadcastfailure), [BroadcastResponse](#interface-broadcastresponse), [Broadcaster](#interface-broadcaster), [ChainTracker](#interface-chaintracker), [FeeModel](#interface-feemodel), [LivePolicy](#class-livepolicy), [MerklePath](#class-merklepath), [TransactionInput](#interface-transactioninput), [TransactionOutput](#interface-transactionoutput), [defaultBroadcaster](#function-defaultbroadcaster), [defaultChainTracker](#function-defaultchaintracker)
|
|
1612
|
+
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [Broadcaster](./transaction.md#interface-broadcaster), [ChainTracker](./transaction.md#interface-chaintracker), [FeeModel](./transaction.md#interface-feemodel), [LivePolicy](./transaction.md#class-livepolicy), [MerklePath](./transaction.md#class-merklepath), [Reader](./primitives.md#class-reader), [TransactionInput](./transaction.md#interface-transactioninput), [TransactionOutput](./transaction.md#interface-transactionoutput), [defaultBroadcaster](./transaction.md#function-defaultbroadcaster), [defaultChainTracker](./transaction.md#function-defaultchaintracker), [sign](./compat.md#variable-sign), [toHex](./primitives.md#variable-tohex), [verify](./compat.md#variable-verify)
|
|
1610
1613
|
|
|
1611
1614
|
#### Method addInput
|
|
1612
1615
|
|
|
@@ -1615,7 +1618,7 @@ Adds a new input to the transaction.
|
|
|
1615
1618
|
```ts
|
|
1616
1619
|
addInput(input: TransactionInput): void
|
|
1617
1620
|
```
|
|
1618
|
-
See also: [TransactionInput](#interface-transactioninput)
|
|
1621
|
+
See also: [TransactionInput](./transaction.md#interface-transactioninput)
|
|
1619
1622
|
|
|
1620
1623
|
Argument Details
|
|
1621
1624
|
|
|
@@ -1633,7 +1636,7 @@ Adds a new output to the transaction.
|
|
|
1633
1636
|
```ts
|
|
1634
1637
|
addOutput(output: TransactionOutput): void
|
|
1635
1638
|
```
|
|
1636
|
-
See also: [TransactionOutput](#interface-transactionoutput)
|
|
1639
|
+
See also: [TransactionOutput](./transaction.md#interface-transactionoutput)
|
|
1637
1640
|
|
|
1638
1641
|
Argument Details
|
|
1639
1642
|
|
|
@@ -1662,7 +1665,7 @@ Broadcasts a transaction.
|
|
|
1662
1665
|
```ts
|
|
1663
1666
|
async broadcast(broadcaster: Broadcaster = defaultBroadcaster()): Promise<BroadcastResponse | BroadcastFailure>
|
|
1664
1667
|
```
|
|
1665
|
-
See also: [BroadcastFailure](#interface-broadcastfailure), [BroadcastResponse](#interface-broadcastresponse), [Broadcaster](#interface-broadcaster), [defaultBroadcaster](#function-defaultbroadcaster)
|
|
1668
|
+
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [Broadcaster](./transaction.md#interface-broadcaster), [defaultBroadcaster](./transaction.md#function-defaultbroadcaster)
|
|
1666
1669
|
|
|
1667
1670
|
Returns
|
|
1668
1671
|
|
|
@@ -1682,7 +1685,7 @@ If fee is a number, the transaction uses that value as fee.
|
|
|
1682
1685
|
```ts
|
|
1683
1686
|
async fee(modelOrFee: FeeModel | number = LivePolicy.getInstance(), changeDistribution: "equal" | "random" = "equal"): Promise<void>
|
|
1684
1687
|
```
|
|
1685
|
-
See also: [FeeModel](#interface-feemodel), [LivePolicy](#class-livepolicy)
|
|
1688
|
+
See also: [FeeModel](./transaction.md#interface-feemodel), [LivePolicy](./transaction.md#class-livepolicy)
|
|
1686
1689
|
|
|
1687
1690
|
Argument Details
|
|
1688
1691
|
|
|
@@ -1700,7 +1703,7 @@ Extracts the subject transaction and supporting merkle path and source transacti
|
|
|
1700
1703
|
```ts
|
|
1701
1704
|
static fromAtomicBEEF(beef: number[]): Transaction
|
|
1702
1705
|
```
|
|
1703
|
-
See also: [Transaction](#class-transaction)
|
|
1706
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
1704
1707
|
|
|
1705
1708
|
Returns
|
|
1706
1709
|
|
|
@@ -1721,7 +1724,7 @@ If no TXID is provided, the last transaction in the BEEF data is returned, or th
|
|
|
1721
1724
|
```ts
|
|
1722
1725
|
static fromBEEF(beef: number[], txid?: string): Transaction
|
|
1723
1726
|
```
|
|
1724
|
-
See also: [Transaction](#class-transaction)
|
|
1727
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
1725
1728
|
|
|
1726
1729
|
Returns
|
|
1727
1730
|
|
|
@@ -1741,7 +1744,7 @@ Creates a Transaction instance from a binary array.
|
|
|
1741
1744
|
```ts
|
|
1742
1745
|
static fromBinary(bin: number[]): Transaction
|
|
1743
1746
|
```
|
|
1744
|
-
See also: [Transaction](#class-transaction)
|
|
1747
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
1745
1748
|
|
|
1746
1749
|
Returns
|
|
1747
1750
|
|
|
@@ -1759,7 +1762,7 @@ Creates a new transaction, linked to its inputs and their associated merkle path
|
|
|
1759
1762
|
```ts
|
|
1760
1763
|
static fromEF(ef: number[]): Transaction
|
|
1761
1764
|
```
|
|
1762
|
-
See also: [Transaction](#class-transaction)
|
|
1765
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
1763
1766
|
|
|
1764
1767
|
Returns
|
|
1765
1768
|
|
|
@@ -1777,7 +1780,7 @@ Creates a Transaction instance from a hexadecimal string.
|
|
|
1777
1780
|
```ts
|
|
1778
1781
|
static fromHex(hex: string): Transaction
|
|
1779
1782
|
```
|
|
1780
|
-
See also: [Transaction](#class-transaction)
|
|
1783
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
1781
1784
|
|
|
1782
1785
|
Returns
|
|
1783
1786
|
|
|
@@ -1798,7 +1801,7 @@ If no TXID is provided, the last transaction in the BEEF data is returned.
|
|
|
1798
1801
|
```ts
|
|
1799
1802
|
static fromHexBEEF(hex: string, txid?: string): Transaction
|
|
1800
1803
|
```
|
|
1801
|
-
See also: [Transaction](#class-transaction)
|
|
1804
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
1802
1805
|
|
|
1803
1806
|
Returns
|
|
1804
1807
|
|
|
@@ -1818,7 +1821,7 @@ Creates a Transaction instance from a hexadecimal string encoded EF.
|
|
|
1818
1821
|
```ts
|
|
1819
1822
|
static fromHexEF(hex: string): Transaction
|
|
1820
1823
|
```
|
|
1821
|
-
See also: [Transaction](#class-transaction)
|
|
1824
|
+
See also: [Transaction](./transaction.md#class-transaction)
|
|
1822
1825
|
|
|
1823
1826
|
Returns
|
|
1824
1827
|
|
|
@@ -2085,7 +2088,7 @@ Verifies the legitimacy of the Bitcoin transaction according to the rules of SPV
|
|
|
2085
2088
|
```ts
|
|
2086
2089
|
async verify(chainTracker: ChainTracker | "scripts only" = defaultChainTracker(), feeModel?: FeeModel, memoryLimit?: number): Promise<boolean>
|
|
2087
2090
|
```
|
|
2088
|
-
See also: [ChainTracker](#interface-chaintracker), [FeeModel](#interface-feemodel), [defaultChainTracker](#function-defaultchaintracker)
|
|
2091
|
+
See also: [ChainTracker](./transaction.md#interface-chaintracker), [FeeModel](./transaction.md#interface-feemodel), [defaultChainTracker](./transaction.md#function-defaultchaintracker)
|
|
2089
2092
|
|
|
2090
2093
|
Returns
|
|
2091
2094
|
|
|
@@ -2126,7 +2129,7 @@ export default class WhatsOnChain implements ChainTracker {
|
|
|
2126
2129
|
}
|
|
2127
2130
|
```
|
|
2128
2131
|
|
|
2129
|
-
See also: [ChainTracker](#interface-chaintracker), [HttpClient](#interface-httpclient), [WhatsOnChainConfig](#interface-whatsonchainconfig)
|
|
2132
|
+
See also: [ChainTracker](./transaction.md#interface-chaintracker), [HttpClient](./transaction.md#interface-httpclient), [WhatsOnChainConfig](./transaction.md#interface-whatsonchainconfig)
|
|
2130
2133
|
|
|
2131
2134
|
#### Constructor
|
|
2132
2135
|
|
|
@@ -2135,7 +2138,7 @@ Constructs an instance of the WhatsOnChain ChainTracker.
|
|
|
2135
2138
|
```ts
|
|
2136
2139
|
constructor(network: "main" | "test" | "stn" = "main", config: WhatsOnChainConfig = {})
|
|
2137
2140
|
```
|
|
2138
|
-
See also: [WhatsOnChainConfig](#interface-whatsonchainconfig)
|
|
2141
|
+
See also: [WhatsOnChainConfig](./transaction.md#interface-whatsonchainconfig)
|
|
2139
2142
|
|
|
2140
2143
|
Argument Details
|
|
2141
2144
|
|
|
@@ -2167,7 +2170,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
2167
2170
|
export function defaultBroadcaster(isTestnet: boolean = false, config: ArcConfig = {}): Broadcaster
|
|
2168
2171
|
```
|
|
2169
2172
|
|
|
2170
|
-
See also: [ArcConfig](#interface-arcconfig), [Broadcaster](#interface-broadcaster)
|
|
2173
|
+
See also: [ArcConfig](./transaction.md#interface-arcconfig), [Broadcaster](./transaction.md#interface-broadcaster)
|
|
2171
2174
|
|
|
2172
2175
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2173
2176
|
|
|
@@ -2178,7 +2181,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
2178
2181
|
export function defaultChainTracker(): ChainTracker
|
|
2179
2182
|
```
|
|
2180
2183
|
|
|
2181
|
-
See also: [ChainTracker](#interface-chaintracker)
|
|
2184
|
+
See also: [ChainTracker](./transaction.md#interface-chaintracker)
|
|
2182
2185
|
|
|
2183
2186
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2184
2187
|
|
|
@@ -2193,7 +2196,7 @@ If running in a Node environment, it falls back to using the Node `https` module
|
|
|
2193
2196
|
export function defaultHttpClient(): HttpClient
|
|
2194
2197
|
```
|
|
2195
2198
|
|
|
2196
|
-
See also: [HttpClient](#interface-httpclient)
|
|
2199
|
+
See also: [HttpClient](./transaction.md#interface-httpclient)
|
|
2197
2200
|
|
|
2198
2201
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2199
2202
|
|
|
@@ -2206,7 +2209,7 @@ Convenience type guard for response from `Broadcaster.broadcast`
|
|
|
2206
2209
|
export function isBroadcastFailure(r: BroadcastResponse | BroadcastFailure): r is BroadcastFailure
|
|
2207
2210
|
```
|
|
2208
2211
|
|
|
2209
|
-
See also: [BroadcastFailure](#interface-broadcastfailure), [BroadcastResponse](#interface-broadcastresponse)
|
|
2212
|
+
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse)
|
|
2210
2213
|
|
|
2211
2214
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2212
2215
|
|
|
@@ -2219,7 +2222,7 @@ Convenience type guard for response from `Broadcaster.broadcast`
|
|
|
2219
2222
|
export function isBroadcastResponse(r: BroadcastResponse | BroadcastFailure): r is BroadcastResponse
|
|
2220
2223
|
```
|
|
2221
2224
|
|
|
2222
|
-
See also: [BroadcastFailure](#interface-broadcastfailure), [BroadcastResponse](#interface-broadcastresponse)
|
|
2225
|
+
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse)
|
|
2223
2226
|
|
|
2224
2227
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2225
2228
|
|
|
@@ -2245,7 +2248,7 @@ Makes a request to the server.
|
|
|
2245
2248
|
export type Fetch = (url: string, options: FetchOptions) => Promise<Response>
|
|
2246
2249
|
```
|
|
2247
2250
|
|
|
2248
|
-
See also: [FetchOptions](#interface-fetchoptions)
|
|
2251
|
+
See also: [FetchOptions](./transaction.md#interface-fetchoptions)
|
|
2249
2252
|
|
|
2250
2253
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
2251
2254
|
|