@bsv/sdk 1.4.23 → 1.4.24
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/transaction/broadcasters/Teranode.js +64 -0
- package/dist/cjs/src/transaction/broadcasters/Teranode.js.map +1 -0
- package/dist/cjs/src/transaction/broadcasters/index.js +3 -1
- package/dist/cjs/src/transaction/broadcasters/index.js.map +1 -1
- package/dist/cjs/src/transaction/http/BinaryFetchClient.js +94 -0
- package/dist/cjs/src/transaction/http/BinaryFetchClient.js.map +1 -0
- package/dist/cjs/src/transaction/http/NodejsHttpClient.js.map +1 -1
- package/dist/cjs/src/transaction/http/index.js +3 -1
- package/dist/cjs/src/transaction/http/index.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/transaction/broadcasters/Teranode.js +62 -0
- package/dist/esm/src/transaction/broadcasters/Teranode.js.map +1 -0
- package/dist/esm/src/transaction/broadcasters/index.js +1 -0
- package/dist/esm/src/transaction/broadcasters/index.js.map +1 -1
- package/dist/esm/src/transaction/http/BinaryFetchClient.js +90 -0
- package/dist/esm/src/transaction/http/BinaryFetchClient.js.map +1 -0
- package/dist/esm/src/transaction/http/NodejsHttpClient.js.map +1 -1
- package/dist/esm/src/transaction/http/index.js +1 -0
- package/dist/esm/src/transaction/http/index.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/transaction/broadcasters/Teranode.d.ts +25 -0
- package/dist/types/src/transaction/broadcasters/Teranode.d.ts.map +1 -0
- package/dist/types/src/transaction/broadcasters/index.d.ts +1 -0
- package/dist/types/src/transaction/broadcasters/index.d.ts.map +1 -1
- package/dist/types/src/transaction/http/BinaryFetchClient.d.ts +50 -0
- package/dist/types/src/transaction/http/BinaryFetchClient.d.ts.map +1 -0
- package/dist/types/src/transaction/http/index.d.ts +1 -0
- package/dist/types/src/transaction/http/index.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +1 -1
- package/docs/auth.md +101 -47
- package/docs/compat.md +48 -24
- package/docs/identity.md +14 -8
- package/docs/kvstore.md +9 -3
- package/docs/messages.md +4 -4
- package/docs/overlay-tools.md +69 -21
- package/docs/primitives.md +379 -235
- package/docs/registry.md +20 -14
- package/docs/script.md +80 -32
- package/docs/storage.md +17 -11
- package/docs/totp.md +11 -5
- package/docs/transaction.md +144 -66
- package/docs/wallet.md +169 -133
- package/package.json +1 -1
- package/src/transaction/broadcasters/Teranode.ts +77 -0
- package/src/transaction/broadcasters/index.ts +1 -0
- package/src/transaction/http/BinaryFetchClient.ts +141 -0
- package/src/transaction/http/NodejsHttpClient.ts +1 -1
- package/src/transaction/http/index.ts +1 -0
package/docs/registry.md
CHANGED
|
@@ -36,7 +36,7 @@ export interface BasketDefinitionData {
|
|
|
36
36
|
}
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
See also: [PubKeyHex](
|
|
39
|
+
See also: [PubKeyHex](#type-pubkeyhex)
|
|
40
40
|
|
|
41
41
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
42
42
|
|
|
@@ -76,7 +76,7 @@ export interface CertificateDefinitionData {
|
|
|
76
76
|
}
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
See also: [CertificateFieldDescriptor](
|
|
79
|
+
See also: [CertificateFieldDescriptor](#interface-certificatefielddescriptor), [PubKeyHex](#type-pubkeyhex)
|
|
80
80
|
|
|
81
81
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
82
82
|
|
|
@@ -131,7 +131,7 @@ export interface ProtocolDefinitionData {
|
|
|
131
131
|
}
|
|
132
132
|
```
|
|
133
133
|
|
|
134
|
-
See also: [PubKeyHex](
|
|
134
|
+
See also: [PubKeyHex](#type-pubkeyhex), [WalletProtocol](#type-walletprotocol)
|
|
135
135
|
|
|
136
136
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
137
137
|
|
|
@@ -151,7 +151,7 @@ export interface ProtocolQuery {
|
|
|
151
151
|
}
|
|
152
152
|
```
|
|
153
153
|
|
|
154
|
-
See also: [WalletProtocol](
|
|
154
|
+
See also: [WalletProtocol](#type-walletprotocol)
|
|
155
155
|
|
|
156
156
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
157
157
|
|
|
@@ -168,7 +168,7 @@ export interface RegistryQueryMapping {
|
|
|
168
168
|
}
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
See also: [BasketQuery](
|
|
171
|
+
See also: [BasketQuery](#interface-basketquery), [CertificateQuery](#interface-certificatequery), [ProtocolQuery](#interface-protocolquery)
|
|
172
172
|
|
|
173
173
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
174
174
|
|
|
@@ -187,7 +187,7 @@ export interface TokenData {
|
|
|
187
187
|
}
|
|
188
188
|
```
|
|
189
189
|
|
|
190
|
-
See also: [BEEF](
|
|
190
|
+
See also: [BEEF](#type-beef)
|
|
191
191
|
|
|
192
192
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
193
193
|
|
|
@@ -220,7 +220,11 @@ export class RegistryClient {
|
|
|
220
220
|
}
|
|
221
221
|
```
|
|
222
222
|
|
|
223
|
-
See also: [BroadcastFailure](
|
|
223
|
+
See also: [BroadcastFailure](#interface-broadcastfailure), [BroadcastResponse](#interface-broadcastresponse), [DefinitionData](#type-definitiondata), [DefinitionType](#type-definitiontype), [RegistryQueryMapping](#interface-registryquerymapping), [RegistryRecord](#type-registryrecord), [WalletClient](#class-walletclient), [WalletInterface](#interface-walletinterface)
|
|
224
|
+
|
|
225
|
+
<details>
|
|
226
|
+
|
|
227
|
+
<summary>Class RegistryClient Details</summary>
|
|
224
228
|
|
|
225
229
|
#### Method listOwnRegistryEntries
|
|
226
230
|
|
|
@@ -231,7 +235,7 @@ Returns parsed registry records including transaction details such as txid, outp
|
|
|
231
235
|
```ts
|
|
232
236
|
async listOwnRegistryEntries(definitionType: DefinitionType): Promise<RegistryRecord[]>
|
|
233
237
|
```
|
|
234
|
-
See also: [DefinitionType](
|
|
238
|
+
See also: [DefinitionType](#type-definitiontype), [RegistryRecord](#type-registryrecord)
|
|
235
239
|
|
|
236
240
|
Returns
|
|
237
241
|
|
|
@@ -253,7 +257,7 @@ to establish canonical references for basket IDs, protocol specs, or certificate
|
|
|
253
257
|
```ts
|
|
254
258
|
async registerDefinition(data: DefinitionData): Promise<BroadcastResponse | BroadcastFailure>
|
|
255
259
|
```
|
|
256
|
-
See also: [BroadcastFailure](
|
|
260
|
+
See also: [BroadcastFailure](#interface-broadcastfailure), [BroadcastResponse](#interface-broadcastresponse), [DefinitionData](#type-definitiondata)
|
|
257
261
|
|
|
258
262
|
Returns
|
|
259
263
|
|
|
@@ -279,7 +283,7 @@ The query object shape depends on the registry type:
|
|
|
279
283
|
```ts
|
|
280
284
|
async resolve<T extends DefinitionType>(definitionType: T, query: RegistryQueryMapping[T]): Promise<DefinitionData[]>
|
|
281
285
|
```
|
|
282
|
-
See also: [DefinitionData](
|
|
286
|
+
See also: [DefinitionData](#type-definitiondata), [DefinitionType](#type-definitiontype), [RegistryQueryMapping](#interface-registryquerymapping)
|
|
283
287
|
|
|
284
288
|
Returns
|
|
285
289
|
|
|
@@ -299,7 +303,7 @@ Revokes a registry record by spending its associated UTXO.
|
|
|
299
303
|
```ts
|
|
300
304
|
async revokeOwnRegistryEntry(registryRecord: RegistryRecord): Promise<BroadcastResponse | BroadcastFailure>
|
|
301
305
|
```
|
|
302
|
-
See also: [BroadcastFailure](
|
|
306
|
+
See also: [BroadcastFailure](#interface-broadcastfailure), [BroadcastResponse](#interface-broadcastresponse), [RegistryRecord](#type-registryrecord)
|
|
303
307
|
|
|
304
308
|
Returns
|
|
305
309
|
|
|
@@ -310,6 +314,8 @@ Argument Details
|
|
|
310
314
|
+ **registryRecord**
|
|
311
315
|
+ Must have valid txid, outputIndex, and lockingScript.
|
|
312
316
|
|
|
317
|
+
</details>
|
|
318
|
+
|
|
313
319
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
314
320
|
|
|
315
321
|
---
|
|
@@ -321,7 +327,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
|
|
|
321
327
|
export function deserializeWalletProtocol(str: string): WalletProtocol
|
|
322
328
|
```
|
|
323
329
|
|
|
324
|
-
See also: [WalletProtocol](
|
|
330
|
+
See also: [WalletProtocol](#type-walletprotocol)
|
|
325
331
|
|
|
326
332
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
327
333
|
|
|
@@ -346,7 +352,7 @@ Union of all possible definition data objects.
|
|
|
346
352
|
export type DefinitionData = BasketDefinitionData | ProtocolDefinitionData | CertificateDefinitionData
|
|
347
353
|
```
|
|
348
354
|
|
|
349
|
-
See also: [BasketDefinitionData](
|
|
355
|
+
See also: [BasketDefinitionData](#interface-basketdefinitiondata), [CertificateDefinitionData](#interface-certificatedefinitiondata), [ProtocolDefinitionData](#interface-protocoldefinitiondata)
|
|
350
356
|
|
|
351
357
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
352
358
|
|
|
@@ -372,7 +378,7 @@ plus the on-chain token data for the UTXO holding it.
|
|
|
372
378
|
export type RegistryRecord = DefinitionData & TokenData
|
|
373
379
|
```
|
|
374
380
|
|
|
375
|
-
See also: [DefinitionData](
|
|
381
|
+
See also: [DefinitionData](#type-definitiondata), [TokenData](#interface-tokendata)
|
|
376
382
|
|
|
377
383
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
378
384
|
|
package/docs/script.md
CHANGED
|
@@ -37,7 +37,11 @@ export default interface ScriptTemplate {
|
|
|
37
37
|
}
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
See also: [LockingScript](
|
|
40
|
+
See also: [LockingScript](#class-lockingscript), [ScriptTemplateUnlock](#interface-scripttemplateunlock)
|
|
41
|
+
|
|
42
|
+
<details>
|
|
43
|
+
|
|
44
|
+
<summary>Interface ScriptTemplate Details</summary>
|
|
41
45
|
|
|
42
46
|
#### Property lock
|
|
43
47
|
|
|
@@ -46,7 +50,7 @@ Creates a locking script with the given parameters.
|
|
|
46
50
|
```ts
|
|
47
51
|
lock: (...params: any[]) => LockingScript | Promise<LockingScript>
|
|
48
52
|
```
|
|
49
|
-
See also: [LockingScript](
|
|
53
|
+
See also: [LockingScript](#class-lockingscript)
|
|
50
54
|
|
|
51
55
|
#### Property unlock
|
|
52
56
|
|
|
@@ -59,7 +63,9 @@ This method returns an object containing two functions:
|
|
|
59
63
|
```ts
|
|
60
64
|
unlock: (...params: any[]) => ScriptTemplateUnlock
|
|
61
65
|
```
|
|
62
|
-
See also: [ScriptTemplateUnlock](
|
|
66
|
+
See also: [ScriptTemplateUnlock](#interface-scripttemplateunlock)
|
|
67
|
+
|
|
68
|
+
</details>
|
|
63
69
|
|
|
64
70
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
65
71
|
|
|
@@ -73,7 +79,7 @@ export default interface ScriptTemplateUnlock {
|
|
|
73
79
|
}
|
|
74
80
|
```
|
|
75
81
|
|
|
76
|
-
See also: [Transaction](
|
|
82
|
+
See also: [Transaction](#class-transaction), [UnlockingScript](#class-unlockingscript), [sign](#variable-sign)
|
|
77
83
|
|
|
78
84
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
79
85
|
|
|
@@ -108,7 +114,11 @@ export default class LockingScript extends Script {
|
|
|
108
114
|
}
|
|
109
115
|
```
|
|
110
116
|
|
|
111
|
-
See also: [Script](
|
|
117
|
+
See also: [Script](#class-script)
|
|
118
|
+
|
|
119
|
+
<details>
|
|
120
|
+
|
|
121
|
+
<summary>Class LockingScript Details</summary>
|
|
112
122
|
|
|
113
123
|
#### Method isLockingScript
|
|
114
124
|
|
|
@@ -130,6 +140,8 @@ Returns
|
|
|
130
140
|
|
|
131
141
|
Always returns false for a LockingScript instance.
|
|
132
142
|
|
|
143
|
+
</details>
|
|
144
|
+
|
|
133
145
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
134
146
|
|
|
135
147
|
---
|
|
@@ -149,7 +161,11 @@ export default class P2PKH implements ScriptTemplate {
|
|
|
149
161
|
}
|
|
150
162
|
```
|
|
151
163
|
|
|
152
|
-
See also: [LockingScript](
|
|
164
|
+
See also: [LockingScript](#class-lockingscript), [PrivateKey](#class-privatekey), [Script](#class-script), [ScriptTemplate](#interface-scripttemplate), [Transaction](#class-transaction), [UnlockingScript](#class-unlockingscript), [sign](#variable-sign)
|
|
165
|
+
|
|
166
|
+
<details>
|
|
167
|
+
|
|
168
|
+
<summary>Class P2PKH Details</summary>
|
|
153
169
|
|
|
154
170
|
#### Method lock
|
|
155
171
|
|
|
@@ -158,7 +174,7 @@ Creates a P2PKH locking script for a given public key hash or address string
|
|
|
158
174
|
```ts
|
|
159
175
|
lock(pubkeyhash: string | number[]): LockingScript
|
|
160
176
|
```
|
|
161
|
-
See also: [LockingScript](
|
|
177
|
+
See also: [LockingScript](#class-lockingscript)
|
|
162
178
|
|
|
163
179
|
Returns
|
|
164
180
|
|
|
@@ -184,7 +200,7 @@ unlock(privateKey: PrivateKey, signOutputs: "all" | "none" | "single" = "all", a
|
|
|
184
200
|
estimateLength: () => Promise<108>;
|
|
185
201
|
}
|
|
186
202
|
```
|
|
187
|
-
See also: [PrivateKey](
|
|
203
|
+
See also: [PrivateKey](#class-privatekey), [Script](#class-script), [Transaction](#class-transaction), [UnlockingScript](#class-unlockingscript), [sign](#variable-sign)
|
|
188
204
|
|
|
189
205
|
Returns
|
|
190
206
|
|
|
@@ -203,6 +219,8 @@ Argument Details
|
|
|
203
219
|
+ **lockingScript**
|
|
204
220
|
+ Optional. The lockinScript. Otherwise the input.sourceTransaction is required.
|
|
205
221
|
|
|
222
|
+
</details>
|
|
223
|
+
|
|
206
224
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
207
225
|
|
|
208
226
|
---
|
|
@@ -231,7 +249,11 @@ export default class PushDrop implements ScriptTemplate {
|
|
|
231
249
|
}
|
|
232
250
|
```
|
|
233
251
|
|
|
234
|
-
See also: [LockingScript](
|
|
252
|
+
See also: [LockingScript](#class-lockingscript), [PublicKey](#class-publickey), [ScriptTemplate](#interface-scripttemplate), [SecurityLevel](#type-securitylevel), [Transaction](#class-transaction), [UnlockingScript](#class-unlockingscript), [WalletInterface](#interface-walletinterface), [sign](#variable-sign)
|
|
253
|
+
|
|
254
|
+
<details>
|
|
255
|
+
|
|
256
|
+
<summary>Class PushDrop Details</summary>
|
|
235
257
|
|
|
236
258
|
#### Constructor
|
|
237
259
|
|
|
@@ -240,7 +262,7 @@ Constructs a new instance of the PushDrop class.
|
|
|
240
262
|
```ts
|
|
241
263
|
constructor(wallet: WalletInterface, originator?: string)
|
|
242
264
|
```
|
|
243
|
-
See also: [WalletInterface](
|
|
265
|
+
See also: [WalletInterface](#interface-walletinterface)
|
|
244
266
|
|
|
245
267
|
Argument Details
|
|
246
268
|
|
|
@@ -260,7 +282,7 @@ static decode(script: LockingScript): {
|
|
|
260
282
|
fields: number[][];
|
|
261
283
|
}
|
|
262
284
|
```
|
|
263
|
-
See also: [LockingScript](
|
|
285
|
+
See also: [LockingScript](#class-lockingscript), [PublicKey](#class-publickey)
|
|
264
286
|
|
|
265
287
|
Returns
|
|
266
288
|
|
|
@@ -281,7 +303,7 @@ async lock(fields: number[][], protocolID: [
|
|
|
281
303
|
string
|
|
282
304
|
], keyID: string, counterparty: string, forSelf = false, includeSignature = true, lockPosition: "before" | "after" = "before"): Promise<LockingScript>
|
|
283
305
|
```
|
|
284
|
-
See also: [LockingScript](
|
|
306
|
+
See also: [LockingScript](#class-lockingscript), [SecurityLevel](#type-securitylevel)
|
|
285
307
|
|
|
286
308
|
Returns
|
|
287
309
|
|
|
@@ -315,7 +337,7 @@ unlock(protocolID: [
|
|
|
315
337
|
estimateLength: () => Promise<73>;
|
|
316
338
|
}
|
|
317
339
|
```
|
|
318
|
-
See also: [LockingScript](
|
|
340
|
+
See also: [LockingScript](#class-lockingscript), [SecurityLevel](#type-securitylevel), [Transaction](#class-transaction), [UnlockingScript](#class-unlockingscript), [sign](#variable-sign)
|
|
319
341
|
|
|
320
342
|
Returns
|
|
321
343
|
|
|
@@ -340,6 +362,8 @@ Argument Details
|
|
|
340
362
|
+ **anyoneCanPay**
|
|
341
363
|
+ Specifies if the anyone-can-pay flag is set.
|
|
342
364
|
|
|
365
|
+
</details>
|
|
366
|
+
|
|
343
367
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
344
368
|
|
|
345
369
|
---
|
|
@@ -361,7 +385,11 @@ export default class RPuzzle implements ScriptTemplate {
|
|
|
361
385
|
}
|
|
362
386
|
```
|
|
363
387
|
|
|
364
|
-
See also: [BigNumber](
|
|
388
|
+
See also: [BigNumber](#class-bignumber), [LockingScript](#class-lockingscript), [PrivateKey](#class-privatekey), [ScriptTemplate](#interface-scripttemplate), [Transaction](#class-transaction), [UnlockingScript](#class-unlockingscript), [sign](#variable-sign)
|
|
389
|
+
|
|
390
|
+
<details>
|
|
391
|
+
|
|
392
|
+
<summary>Class RPuzzle Details</summary>
|
|
365
393
|
|
|
366
394
|
#### Constructor
|
|
367
395
|
|
|
@@ -381,7 +409,7 @@ Creates an R puzzle locking script for a given R value or R value hash.
|
|
|
381
409
|
```ts
|
|
382
410
|
lock(value: number[]): LockingScript
|
|
383
411
|
```
|
|
384
|
-
See also: [LockingScript](
|
|
412
|
+
See also: [LockingScript](#class-lockingscript)
|
|
385
413
|
|
|
386
414
|
Returns
|
|
387
415
|
|
|
@@ -407,7 +435,7 @@ unlock(k: BigNumber, privateKey: PrivateKey, signOutputs: "all" | "none" | "sing
|
|
|
407
435
|
estimateLength: () => Promise<108>;
|
|
408
436
|
}
|
|
409
437
|
```
|
|
410
|
-
See also: [BigNumber](
|
|
438
|
+
See also: [BigNumber](#class-bignumber), [PrivateKey](#class-privatekey), [Transaction](#class-transaction), [UnlockingScript](#class-unlockingscript), [sign](#variable-sign)
|
|
411
439
|
|
|
412
440
|
Returns
|
|
413
441
|
|
|
@@ -424,6 +452,8 @@ Argument Details
|
|
|
424
452
|
+ **anyoneCanPay**
|
|
425
453
|
+ Flag indicating if the signature allows for other inputs to be added later.
|
|
426
454
|
|
|
455
|
+
</details>
|
|
456
|
+
|
|
427
457
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
428
458
|
|
|
429
459
|
---
|
|
@@ -457,14 +487,18 @@ export default class Script {
|
|
|
457
487
|
}
|
|
458
488
|
```
|
|
459
489
|
|
|
460
|
-
See also: [BigNumber](
|
|
490
|
+
See also: [BigNumber](#class-bignumber), [ScriptChunk](#interface-scriptchunk), [toHex](#variable-tohex)
|
|
491
|
+
|
|
492
|
+
<details>
|
|
493
|
+
|
|
494
|
+
<summary>Class Script Details</summary>
|
|
461
495
|
|
|
462
496
|
#### Constructor
|
|
463
497
|
|
|
464
498
|
```ts
|
|
465
499
|
constructor(chunks: ScriptChunk[] = [])
|
|
466
500
|
```
|
|
467
|
-
See also: [ScriptChunk](
|
|
501
|
+
See also: [ScriptChunk](#interface-scriptchunk)
|
|
468
502
|
|
|
469
503
|
Argument Details
|
|
470
504
|
|
|
@@ -478,7 +512,7 @@ Deletes the given item wherever it appears in the current script.
|
|
|
478
512
|
```ts
|
|
479
513
|
findAndDelete(script: Script): Script
|
|
480
514
|
```
|
|
481
|
-
See also: [Script](
|
|
515
|
+
See also: [Script](#class-script)
|
|
482
516
|
|
|
483
517
|
Returns
|
|
484
518
|
|
|
@@ -494,7 +528,7 @@ Argument Details
|
|
|
494
528
|
```ts
|
|
495
529
|
static fromASM(asm: string): Script
|
|
496
530
|
```
|
|
497
|
-
See also: [Script](
|
|
531
|
+
See also: [Script](#class-script)
|
|
498
532
|
|
|
499
533
|
Returns
|
|
500
534
|
|
|
@@ -516,7 +550,7 @@ const script = Script.fromASM("OP_DUP OP_HASH160 abcd... OP_EQUALVERIFY OP_CHECK
|
|
|
516
550
|
```ts
|
|
517
551
|
static fromBinary(bin: number[]): Script
|
|
518
552
|
```
|
|
519
|
-
See also: [Script](
|
|
553
|
+
See also: [Script](#class-script)
|
|
520
554
|
|
|
521
555
|
Returns
|
|
522
556
|
|
|
@@ -538,7 +572,7 @@ const script = Script.fromBinary([0x76, 0xa9, ...])
|
|
|
538
572
|
```ts
|
|
539
573
|
static fromHex(hex: string): Script
|
|
540
574
|
```
|
|
541
|
-
See also: [Script](
|
|
575
|
+
See also: [Script](#class-script)
|
|
542
576
|
|
|
543
577
|
Returns
|
|
544
578
|
|
|
@@ -590,7 +624,7 @@ True if the script is an unlocking script, otherwise false.
|
|
|
590
624
|
```ts
|
|
591
625
|
removeCodeseparators(): Script
|
|
592
626
|
```
|
|
593
|
-
See also: [Script](
|
|
627
|
+
See also: [Script](#class-script)
|
|
594
628
|
|
|
595
629
|
Returns
|
|
596
630
|
|
|
@@ -601,7 +635,7 @@ This script instance for chaining.
|
|
|
601
635
|
```ts
|
|
602
636
|
setChunkOpCode(i: number, op: number): Script
|
|
603
637
|
```
|
|
604
|
-
See also: [Script](
|
|
638
|
+
See also: [Script](#class-script)
|
|
605
639
|
|
|
606
640
|
Returns
|
|
607
641
|
|
|
@@ -649,7 +683,7 @@ The script in hexadecimal format.
|
|
|
649
683
|
```ts
|
|
650
684
|
writeBin(bin: number[]): Script
|
|
651
685
|
```
|
|
652
|
-
See also: [Script](
|
|
686
|
+
See also: [Script](#class-script)
|
|
653
687
|
|
|
654
688
|
Returns
|
|
655
689
|
|
|
@@ -669,7 +703,7 @@ Throws an error if the data is too large to be pushed.
|
|
|
669
703
|
```ts
|
|
670
704
|
writeBn(bn: BigNumber): Script
|
|
671
705
|
```
|
|
672
|
-
See also: [BigNumber](
|
|
706
|
+
See also: [BigNumber](#class-bignumber), [Script](#class-script)
|
|
673
707
|
|
|
674
708
|
Returns
|
|
675
709
|
|
|
@@ -685,7 +719,7 @@ Argument Details
|
|
|
685
719
|
```ts
|
|
686
720
|
writeNumber(num: number): Script
|
|
687
721
|
```
|
|
688
|
-
See also: [Script](
|
|
722
|
+
See also: [Script](#class-script)
|
|
689
723
|
|
|
690
724
|
Returns
|
|
691
725
|
|
|
@@ -701,7 +735,7 @@ Argument Details
|
|
|
701
735
|
```ts
|
|
702
736
|
writeOpCode(op: number): Script
|
|
703
737
|
```
|
|
704
|
-
See also: [Script](
|
|
738
|
+
See also: [Script](#class-script)
|
|
705
739
|
|
|
706
740
|
Returns
|
|
707
741
|
|
|
@@ -717,7 +751,7 @@ Argument Details
|
|
|
717
751
|
```ts
|
|
718
752
|
writeScript(script: Script): Script
|
|
719
753
|
```
|
|
720
|
-
See also: [Script](
|
|
754
|
+
See also: [Script](#class-script)
|
|
721
755
|
|
|
722
756
|
Returns
|
|
723
757
|
|
|
@@ -728,6 +762,8 @@ Argument Details
|
|
|
728
762
|
+ **script**
|
|
729
763
|
+ The script to append.
|
|
730
764
|
|
|
765
|
+
</details>
|
|
766
|
+
|
|
731
767
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
732
768
|
|
|
733
769
|
---
|
|
@@ -779,7 +815,11 @@ export default class Spend {
|
|
|
779
815
|
}
|
|
780
816
|
```
|
|
781
817
|
|
|
782
|
-
See also: [LockingScript](
|
|
818
|
+
See also: [LockingScript](#class-lockingscript), [TransactionInput](#interface-transactioninput), [TransactionOutput](#interface-transactionoutput), [UnlockingScript](#class-unlockingscript)
|
|
819
|
+
|
|
820
|
+
<details>
|
|
821
|
+
|
|
822
|
+
<summary>Class Spend Details</summary>
|
|
783
823
|
|
|
784
824
|
#### Constructor
|
|
785
825
|
|
|
@@ -799,7 +839,7 @@ constructor(params: {
|
|
|
799
839
|
memoryLimit?: number;
|
|
800
840
|
})
|
|
801
841
|
```
|
|
802
|
-
See also: [LockingScript](
|
|
842
|
+
See also: [LockingScript](#class-lockingscript), [TransactionInput](#interface-transactioninput), [TransactionOutput](#interface-transactionoutput), [UnlockingScript](#class-unlockingscript)
|
|
803
843
|
|
|
804
844
|
Argument Details
|
|
805
845
|
|
|
@@ -866,6 +906,8 @@ if (spend.validate()) {
|
|
|
866
906
|
}
|
|
867
907
|
```
|
|
868
908
|
|
|
909
|
+
</details>
|
|
910
|
+
|
|
869
911
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
870
912
|
|
|
871
913
|
---
|
|
@@ -883,7 +925,11 @@ export default class UnlockingScript extends Script {
|
|
|
883
925
|
}
|
|
884
926
|
```
|
|
885
927
|
|
|
886
|
-
See also: [Script](
|
|
928
|
+
See also: [Script](#class-script)
|
|
929
|
+
|
|
930
|
+
<details>
|
|
931
|
+
|
|
932
|
+
<summary>Class UnlockingScript Details</summary>
|
|
887
933
|
|
|
888
934
|
#### Method isLockingScript
|
|
889
935
|
|
|
@@ -905,6 +951,8 @@ Returns
|
|
|
905
951
|
|
|
906
952
|
Always returns true for an UnlockingScript instance.
|
|
907
953
|
|
|
954
|
+
</details>
|
|
955
|
+
|
|
908
956
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
909
957
|
|
|
910
958
|
---
|
package/docs/storage.md
CHANGED
|
@@ -102,7 +102,7 @@ export interface UploaderConfig {
|
|
|
102
102
|
}
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
See also: [WalletInterface](
|
|
105
|
+
See also: [WalletInterface](#interface-walletinterface)
|
|
106
106
|
|
|
107
107
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
108
108
|
|
|
@@ -130,7 +130,7 @@ export class StorageDownloader {
|
|
|
130
130
|
}
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
-
See also: [DownloadResult](
|
|
133
|
+
See also: [DownloadResult](#interface-downloadresult), [DownloaderConfig](#interface-downloaderconfig)
|
|
134
134
|
|
|
135
135
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
136
136
|
|
|
@@ -156,7 +156,11 @@ export class StorageUploader {
|
|
|
156
156
|
}
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
-
See also: [FindFileData](
|
|
159
|
+
See also: [FindFileData](#interface-findfiledata), [RenewFileResult](#interface-renewfileresult), [UploadFileResult](#interface-uploadfileresult), [UploadableFile](#interface-uploadablefile), [UploaderConfig](#interface-uploaderconfig)
|
|
160
|
+
|
|
161
|
+
<details>
|
|
162
|
+
|
|
163
|
+
<summary>Class StorageUploader Details</summary>
|
|
160
164
|
|
|
161
165
|
#### Constructor
|
|
162
166
|
|
|
@@ -165,7 +169,7 @@ Creates a new StorageUploader instance.
|
|
|
165
169
|
```ts
|
|
166
170
|
constructor(config: UploaderConfig)
|
|
167
171
|
```
|
|
168
|
-
See also: [UploaderConfig](
|
|
172
|
+
See also: [UploaderConfig](#interface-uploaderconfig)
|
|
169
173
|
|
|
170
174
|
Argument Details
|
|
171
175
|
|
|
@@ -179,7 +183,7 @@ Retrieves metadata for a file matching the given UHRP URL from the `/find` route
|
|
|
179
183
|
```ts
|
|
180
184
|
public async findFile(uhrpUrl: string): Promise<FindFileData>
|
|
181
185
|
```
|
|
182
|
-
See also: [FindFileData](
|
|
186
|
+
See also: [FindFileData](#interface-findfiledata)
|
|
183
187
|
|
|
184
188
|
Returns
|
|
185
189
|
|
|
@@ -225,7 +229,7 @@ public async publishFile(params: {
|
|
|
225
229
|
retentionPeriod: number;
|
|
226
230
|
}): Promise<UploadFileResult>
|
|
227
231
|
```
|
|
228
|
-
See also: [UploadFileResult](
|
|
232
|
+
See also: [UploadFileResult](#interface-uploadfileresult), [UploadableFile](#interface-uploadablefile)
|
|
229
233
|
|
|
230
234
|
Returns
|
|
231
235
|
|
|
@@ -244,7 +248,7 @@ and re-mint the advertisement token on-chain.
|
|
|
244
248
|
```ts
|
|
245
249
|
public async renewFile(uhrpUrl: string, additionalMinutes: number): Promise<RenewFileResult>
|
|
246
250
|
```
|
|
247
|
-
See also: [RenewFileResult](
|
|
251
|
+
See also: [RenewFileResult](#interface-renewfileresult)
|
|
248
252
|
|
|
249
253
|
Returns
|
|
250
254
|
|
|
@@ -261,6 +265,8 @@ Throws
|
|
|
261
265
|
|
|
262
266
|
If the request fails or the server returns an error
|
|
263
267
|
|
|
268
|
+
</details>
|
|
269
|
+
|
|
264
270
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
265
271
|
|
|
266
272
|
---
|
|
@@ -300,7 +306,7 @@ getHashFromURL = (URL: string): number[] => {
|
|
|
300
306
|
}
|
|
301
307
|
```
|
|
302
308
|
|
|
303
|
-
See also: [fromBase58Check](
|
|
309
|
+
See also: [fromBase58Check](#variable-frombase58check), [normalizeURL](#variable-normalizeurl), [toHex](#variable-tohex)
|
|
304
310
|
|
|
305
311
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
306
312
|
|
|
@@ -314,7 +320,7 @@ getURLForFile = (file: number[]): string => {
|
|
|
314
320
|
}
|
|
315
321
|
```
|
|
316
322
|
|
|
317
|
-
See also: [getURLForHash](
|
|
323
|
+
See also: [getURLForHash](#variable-geturlforhash), [sha256](#variable-sha256)
|
|
318
324
|
|
|
319
325
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
320
326
|
|
|
@@ -330,7 +336,7 @@ getURLForHash = (hash: number[]): string => {
|
|
|
330
336
|
}
|
|
331
337
|
```
|
|
332
338
|
|
|
333
|
-
See also: [toArray](
|
|
339
|
+
See also: [toArray](#variable-toarray), [toBase58Check](#variable-tobase58check)
|
|
334
340
|
|
|
335
341
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
336
342
|
|
|
@@ -349,7 +355,7 @@ isValidURL = (URL: string): boolean => {
|
|
|
349
355
|
}
|
|
350
356
|
```
|
|
351
357
|
|
|
352
|
-
See also: [getHashFromURL](
|
|
358
|
+
See also: [getHashFromURL](#variable-gethashfromurl)
|
|
353
359
|
|
|
354
360
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
355
361
|
|
package/docs/totp.md
CHANGED
|
@@ -17,7 +17,7 @@ export interface TOTPOptions {
|
|
|
17
17
|
}
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
See also: [TOTPAlgorithm](
|
|
20
|
+
See also: [TOTPAlgorithm](#type-totpalgorithm)
|
|
21
21
|
|
|
22
22
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
23
23
|
|
|
@@ -33,7 +33,11 @@ export class TOTP {
|
|
|
33
33
|
}
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
See also: [TOTPOptions](
|
|
36
|
+
See also: [TOTPOptions](#interface-totpoptions), [TOTPValidateOptions](#type-totpvalidateoptions)
|
|
37
|
+
|
|
38
|
+
<details>
|
|
39
|
+
|
|
40
|
+
<summary>Class TOTP Details</summary>
|
|
37
41
|
|
|
38
42
|
#### Method generate
|
|
39
43
|
|
|
@@ -42,7 +46,7 @@ Generates a Time-based One-Time Password (TOTP).
|
|
|
42
46
|
```ts
|
|
43
47
|
static generate(secret: number[], options?: TOTPOptions): string
|
|
44
48
|
```
|
|
45
|
-
See also: [TOTPOptions](
|
|
49
|
+
See also: [TOTPOptions](#interface-totpoptions)
|
|
46
50
|
|
|
47
51
|
Returns
|
|
48
52
|
|
|
@@ -62,7 +66,7 @@ Validates a Time-based One-Time Password (TOTP).
|
|
|
62
66
|
```ts
|
|
63
67
|
static validate(secret: number[], passcode: string, options?: TOTPValidateOptions): boolean
|
|
64
68
|
```
|
|
65
|
-
See also: [TOTPValidateOptions](
|
|
69
|
+
See also: [TOTPValidateOptions](#type-totpvalidateoptions)
|
|
66
70
|
|
|
67
71
|
Returns
|
|
68
72
|
|
|
@@ -77,6 +81,8 @@ Argument Details
|
|
|
77
81
|
+ **options**
|
|
78
82
|
+ Optional parameters for TOTP validation.
|
|
79
83
|
|
|
84
|
+
</details>
|
|
85
|
+
|
|
80
86
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
81
87
|
|
|
82
88
|
---
|
|
@@ -112,7 +118,7 @@ export type TOTPValidateOptions = TOTPOptions & {
|
|
|
112
118
|
}
|
|
113
119
|
```
|
|
114
120
|
|
|
115
|
-
See also: [TOTPOptions](
|
|
121
|
+
See also: [TOTPOptions](#interface-totpoptions)
|
|
116
122
|
|
|
117
123
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
118
124
|
|