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