@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/auth.md
CHANGED
|
@@ -33,7 +33,7 @@ export interface AuthMessage {
|
|
|
33
33
|
}
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
See also: [RequestedCertificateSet](
|
|
36
|
+
See also: [RequestedCertificateSet](#interface-requestedcertificateset), [VerifiableCertificate](#class-verifiablecertificate)
|
|
37
37
|
|
|
38
38
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
39
39
|
|
|
@@ -62,7 +62,7 @@ export interface RequestedCertificateSet {
|
|
|
62
62
|
}
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
See also: [RequestedCertificateTypeIDAndFieldList](
|
|
65
|
+
See also: [RequestedCertificateTypeIDAndFieldList](#interface-requestedcertificatetypeidandfieldlist)
|
|
66
66
|
|
|
67
67
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
68
68
|
|
|
@@ -87,7 +87,7 @@ export interface Transport {
|
|
|
87
87
|
}
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
See also: [AuthMessage](
|
|
90
|
+
See also: [AuthMessage](#interface-authmessage)
|
|
91
91
|
|
|
92
92
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
93
93
|
|
|
@@ -128,7 +128,11 @@ export class AuthFetch {
|
|
|
128
128
|
}
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
-
See also: [RequestedCertificateSet](
|
|
131
|
+
See also: [RequestedCertificateSet](#interface-requestedcertificateset), [SessionManager](#class-sessionmanager), [VerifiableCertificate](#class-verifiablecertificate), [WalletInterface](#interface-walletinterface)
|
|
132
|
+
|
|
133
|
+
<details>
|
|
134
|
+
|
|
135
|
+
<summary>Class AuthFetch Details</summary>
|
|
132
136
|
|
|
133
137
|
#### Constructor
|
|
134
138
|
|
|
@@ -137,7 +141,7 @@ Constructs a new AuthFetch instance.
|
|
|
137
141
|
```ts
|
|
138
142
|
constructor(wallet: WalletInterface, requestedCertificates?: RequestedCertificateSet, sessionManager?: SessionManager)
|
|
139
143
|
```
|
|
140
|
-
See also: [RequestedCertificateSet](
|
|
144
|
+
See also: [RequestedCertificateSet](#interface-requestedcertificateset), [SessionManager](#class-sessionmanager), [WalletInterface](#interface-walletinterface)
|
|
141
145
|
|
|
142
146
|
Argument Details
|
|
143
147
|
|
|
@@ -153,7 +157,7 @@ Return any certificates we've collected thus far, then clear them out.
|
|
|
153
157
|
```ts
|
|
154
158
|
public consumeReceivedCertificates(): VerifiableCertificate[]
|
|
155
159
|
```
|
|
156
|
-
See also: [VerifiableCertificate](
|
|
160
|
+
See also: [VerifiableCertificate](#class-verifiablecertificate)
|
|
157
161
|
|
|
158
162
|
#### Method fetch
|
|
159
163
|
|
|
@@ -189,7 +193,9 @@ Request Certificates from a Peer
|
|
|
189
193
|
```ts
|
|
190
194
|
async sendCertificateRequest(baseUrl: string, certificatesToRequest: RequestedCertificateSet): Promise<VerifiableCertificate[]>
|
|
191
195
|
```
|
|
192
|
-
See also: [RequestedCertificateSet](
|
|
196
|
+
See also: [RequestedCertificateSet](#interface-requestedcertificateset), [VerifiableCertificate](#class-verifiablecertificate)
|
|
197
|
+
|
|
198
|
+
</details>
|
|
193
199
|
|
|
194
200
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
195
201
|
|
|
@@ -221,7 +227,11 @@ export default class Certificate {
|
|
|
221
227
|
}
|
|
222
228
|
```
|
|
223
229
|
|
|
224
|
-
See also: [Base64String](
|
|
230
|
+
See also: [Base64String](#type-base64string), [CertificateFieldNameUnder50Bytes](#type-certificatefieldnameunder50bytes), [HexString](#type-hexstring), [OutpointString](#type-outpointstring), [ProtoWallet](#class-protowallet), [PubKeyHex](#type-pubkeyhex), [WalletProtocol](#type-walletprotocol), [sign](#variable-sign), [verify](#variable-verify)
|
|
231
|
+
|
|
232
|
+
<details>
|
|
233
|
+
|
|
234
|
+
<summary>Class Certificate Details</summary>
|
|
225
235
|
|
|
226
236
|
#### Constructor
|
|
227
237
|
|
|
@@ -230,7 +240,7 @@ Constructs a new Certificate.
|
|
|
230
240
|
```ts
|
|
231
241
|
constructor(type: Base64String, serialNumber: Base64String, subject: PubKeyHex, certifier: PubKeyHex, revocationOutpoint: OutpointString, fields: Record<CertificateFieldNameUnder50Bytes, string>, signature?: HexString)
|
|
232
242
|
```
|
|
233
|
-
See also: [Base64String](
|
|
243
|
+
See also: [Base64String](#type-base64string), [CertificateFieldNameUnder50Bytes](#type-certificatefieldnameunder50bytes), [HexString](#type-hexstring), [OutpointString](#type-outpointstring), [PubKeyHex](#type-pubkeyhex)
|
|
234
244
|
|
|
235
245
|
Argument Details
|
|
236
246
|
|
|
@@ -256,7 +266,7 @@ Public key of the certifier who issued the certificate, compressed public key he
|
|
|
256
266
|
```ts
|
|
257
267
|
certifier: PubKeyHex
|
|
258
268
|
```
|
|
259
|
-
See also: [PubKeyHex](
|
|
269
|
+
See also: [PubKeyHex](#type-pubkeyhex)
|
|
260
270
|
|
|
261
271
|
#### Property fields
|
|
262
272
|
|
|
@@ -265,7 +275,7 @@ All the fields present in the certificate, with field names as keys and encrypte
|
|
|
265
275
|
```ts
|
|
266
276
|
fields: Record<CertificateFieldNameUnder50Bytes, Base64String>
|
|
267
277
|
```
|
|
268
|
-
See also: [Base64String](
|
|
278
|
+
See also: [Base64String](#type-base64string), [CertificateFieldNameUnder50Bytes](#type-certificatefieldnameunder50bytes)
|
|
269
279
|
|
|
270
280
|
#### Property revocationOutpoint
|
|
271
281
|
|
|
@@ -274,7 +284,7 @@ The outpoint used to confirm that the certificate has not been revoked (TXID.Out
|
|
|
274
284
|
```ts
|
|
275
285
|
revocationOutpoint: OutpointString
|
|
276
286
|
```
|
|
277
|
-
See also: [OutpointString](
|
|
287
|
+
See also: [OutpointString](#type-outpointstring)
|
|
278
288
|
|
|
279
289
|
#### Property serialNumber
|
|
280
290
|
|
|
@@ -283,7 +293,7 @@ Unique serial number of the certificate, base64 encoded string, 32 bytes.
|
|
|
283
293
|
```ts
|
|
284
294
|
serialNumber: Base64String
|
|
285
295
|
```
|
|
286
|
-
See also: [Base64String](
|
|
296
|
+
See also: [Base64String](#type-base64string)
|
|
287
297
|
|
|
288
298
|
#### Property signature
|
|
289
299
|
|
|
@@ -292,7 +302,7 @@ Certificate signature by the certifier's private key, DER encoded hex string.
|
|
|
292
302
|
```ts
|
|
293
303
|
signature?: HexString
|
|
294
304
|
```
|
|
295
|
-
See also: [HexString](
|
|
305
|
+
See also: [HexString](#type-hexstring)
|
|
296
306
|
|
|
297
307
|
#### Property subject
|
|
298
308
|
|
|
@@ -301,7 +311,7 @@ The public key belonging to the certificate's subject, compressed public key hex
|
|
|
301
311
|
```ts
|
|
302
312
|
subject: PubKeyHex
|
|
303
313
|
```
|
|
304
|
-
See also: [PubKeyHex](
|
|
314
|
+
See also: [PubKeyHex](#type-pubkeyhex)
|
|
305
315
|
|
|
306
316
|
#### Property type
|
|
307
317
|
|
|
@@ -310,7 +320,7 @@ Type identifier for the certificate, base64 encoded string, 32 bytes.
|
|
|
310
320
|
```ts
|
|
311
321
|
type: Base64String
|
|
312
322
|
```
|
|
313
|
-
See also: [Base64String](
|
|
323
|
+
See also: [Base64String](#type-base64string)
|
|
314
324
|
|
|
315
325
|
#### Method fromBinary
|
|
316
326
|
|
|
@@ -319,7 +329,7 @@ Deserializes a certificate from binary format.
|
|
|
319
329
|
```ts
|
|
320
330
|
static fromBinary(bin: number[]): Certificate
|
|
321
331
|
```
|
|
322
|
-
See also: [Certificate](
|
|
332
|
+
See also: [Certificate](#class-certificate)
|
|
323
333
|
|
|
324
334
|
Returns
|
|
325
335
|
|
|
@@ -346,7 +356,7 @@ static getCertificateFieldEncryptionDetails(fieldName: string, serialNumber?: st
|
|
|
346
356
|
keyID: string;
|
|
347
357
|
}
|
|
348
358
|
```
|
|
349
|
-
See also: [WalletProtocol](
|
|
359
|
+
See also: [WalletProtocol](#type-walletprotocol)
|
|
350
360
|
|
|
351
361
|
Returns
|
|
352
362
|
|
|
@@ -369,7 +379,7 @@ Signs the certificate using the provided certifier wallet.
|
|
|
369
379
|
```ts
|
|
370
380
|
async sign(certifierWallet: ProtoWallet): Promise<void>
|
|
371
381
|
```
|
|
372
|
-
See also: [ProtoWallet](
|
|
382
|
+
See also: [ProtoWallet](#class-protowallet)
|
|
373
383
|
|
|
374
384
|
Argument Details
|
|
375
385
|
|
|
@@ -405,6 +415,8 @@ Returns
|
|
|
405
415
|
|
|
406
416
|
- A promise that resolves to true if the signature is valid.
|
|
407
417
|
|
|
418
|
+
</details>
|
|
419
|
+
|
|
408
420
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
409
421
|
|
|
410
422
|
---
|
|
@@ -439,7 +451,7 @@ export class CompletedProtoWallet extends ProtoWallet implements WalletInterface
|
|
|
439
451
|
}
|
|
440
452
|
```
|
|
441
453
|
|
|
442
|
-
See also: [AbortActionResult](
|
|
454
|
+
See also: [AbortActionResult](#interface-abortactionresult), [AcquireCertificateResult](#type-acquirecertificateresult), [AuthenticatedResult](#interface-authenticatedresult), [CreateActionResult](#interface-createactionresult), [DiscoverCertificatesResult](#interface-discovercertificatesresult), [GetHeaderResult](#interface-getheaderresult), [GetHeightResult](#interface-getheightresult), [GetNetworkResult](#interface-getnetworkresult), [GetPublicKeyArgs](#interface-getpublickeyargs), [GetVersionResult](#interface-getversionresult), [InternalizeActionResult](#interface-internalizeactionresult), [KeyDeriver](#class-keyderiver), [KeyDeriverApi](#interface-keyderiverapi), [ListActionsResult](#interface-listactionsresult), [ListCertificatesResult](#interface-listcertificatesresult), [ListOutputsResult](#interface-listoutputsresult), [PrivateKey](#class-privatekey), [ProtoWallet](#class-protowallet), [ProveCertificateResult](#interface-provecertificateresult), [PubKeyHex](#type-pubkeyhex), [RelinquishCertificateResult](#interface-relinquishcertificateresult), [RelinquishOutputResult](#interface-relinquishoutputresult), [SignActionResult](#interface-signactionresult), [WalletInterface](#interface-walletinterface)
|
|
443
455
|
|
|
444
456
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
445
457
|
|
|
@@ -477,7 +489,11 @@ export class MasterCertificate extends Certificate {
|
|
|
477
489
|
}
|
|
478
490
|
```
|
|
479
491
|
|
|
480
|
-
See also: [Base64String](
|
|
492
|
+
See also: [Base64String](#type-base64string), [Certificate](#class-certificate), [CertificateFieldNameUnder50Bytes](#type-certificatefieldnameunder50bytes), [HexString](#type-hexstring), [OutpointString](#type-outpointstring), [ProtoWallet](#class-protowallet), [PubKeyHex](#type-pubkeyhex), [WalletCounterparty](#type-walletcounterparty)
|
|
493
|
+
|
|
494
|
+
<details>
|
|
495
|
+
|
|
496
|
+
<summary>Class MasterCertificate Details</summary>
|
|
481
497
|
|
|
482
498
|
#### Method createCertificateFields
|
|
483
499
|
|
|
@@ -488,7 +504,7 @@ and sign off on the fields, along with the encrypted certificate fields.
|
|
|
488
504
|
```ts
|
|
489
505
|
static async createCertificateFields(creatorWallet: ProtoWallet, certifierOrSubject: WalletCounterparty, fields: Record<CertificateFieldNameUnder50Bytes, string>, privileged?: boolean, privilegedReason?: string): Promise<CreateCertificateFieldsResult>
|
|
490
506
|
```
|
|
491
|
-
See also: [CertificateFieldNameUnder50Bytes](
|
|
507
|
+
See also: [CertificateFieldNameUnder50Bytes](#type-certificatefieldnameunder50bytes), [ProtoWallet](#class-protowallet), [WalletCounterparty](#type-walletcounterparty)
|
|
492
508
|
|
|
493
509
|
Returns
|
|
494
510
|
|
|
@@ -521,7 +537,7 @@ for the verifier to access the designated fields.
|
|
|
521
537
|
```ts
|
|
522
538
|
static async createKeyringForVerifier(subjectWallet: ProtoWallet, certifier: WalletCounterparty, verifier: WalletCounterparty, fields: Record<CertificateFieldNameUnder50Bytes, Base64String>, fieldsToReveal: string[], masterKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>, serialNumber: Base64String, privileged?: boolean, privilegedReason?: string): Promise<Record<CertificateFieldNameUnder50Bytes, string>>
|
|
523
539
|
```
|
|
524
|
-
See also: [Base64String](
|
|
540
|
+
See also: [Base64String](#type-base64string), [CertificateFieldNameUnder50Bytes](#type-certificatefieldnameunder50bytes), [ProtoWallet](#class-protowallet), [WalletCounterparty](#type-walletcounterparty)
|
|
525
541
|
|
|
526
542
|
Returns
|
|
527
543
|
|
|
@@ -562,7 +578,7 @@ The counterparty used for decryption depends on how the certificate fields were
|
|
|
562
578
|
```ts
|
|
563
579
|
static async decryptFields(subjectOrCertifierWallet: ProtoWallet, masterKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>, fields: Record<CertificateFieldNameUnder50Bytes, Base64String>, counterparty: WalletCounterparty, privileged?: boolean, privilegedReason?: string): Promise<Record<CertificateFieldNameUnder50Bytes, string>>
|
|
564
580
|
```
|
|
565
|
-
See also: [Base64String](
|
|
581
|
+
See also: [Base64String](#type-base64string), [CertificateFieldNameUnder50Bytes](#type-certificatefieldnameunder50bytes), [ProtoWallet](#class-protowallet), [WalletCounterparty](#type-walletcounterparty)
|
|
566
582
|
|
|
567
583
|
Returns
|
|
568
584
|
|
|
@@ -602,7 +618,7 @@ static async issueCertificateForSubject(certifierWallet: ProtoWallet, subject: W
|
|
|
602
618
|
return "Certificate revocation not tracked.";
|
|
603
619
|
}, serialNumber?: string): Promise<MasterCertificate>
|
|
604
620
|
```
|
|
605
|
-
See also: [CertificateFieldNameUnder50Bytes](
|
|
621
|
+
See also: [CertificateFieldNameUnder50Bytes](#type-certificatefieldnameunder50bytes), [MasterCertificate](#class-mastercertificate), [ProtoWallet](#class-protowallet), [WalletCounterparty](#type-walletcounterparty)
|
|
606
622
|
|
|
607
623
|
Returns
|
|
608
624
|
|
|
@@ -628,6 +644,8 @@ Throws
|
|
|
628
644
|
|
|
629
645
|
Throws an error if any operation (e.g., encryption, signing) fails during certificate issuance.
|
|
630
646
|
|
|
647
|
+
</details>
|
|
648
|
+
|
|
631
649
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
632
650
|
|
|
633
651
|
---
|
|
@@ -657,7 +675,11 @@ export class Peer {
|
|
|
657
675
|
}
|
|
658
676
|
```
|
|
659
677
|
|
|
660
|
-
See also: [PeerSession](
|
|
678
|
+
See also: [PeerSession](#interface-peersession), [RequestedCertificateSet](#interface-requestedcertificateset), [SessionManager](#class-sessionmanager), [Transport](#interface-transport), [VerifiableCertificate](#class-verifiablecertificate), [WalletInterface](#interface-walletinterface)
|
|
679
|
+
|
|
680
|
+
<details>
|
|
681
|
+
|
|
682
|
+
<summary>Class Peer Details</summary>
|
|
661
683
|
|
|
662
684
|
#### Constructor
|
|
663
685
|
|
|
@@ -666,7 +688,7 @@ Creates a new Peer instance
|
|
|
666
688
|
```ts
|
|
667
689
|
constructor(wallet: WalletInterface, transport: Transport, certificatesToRequest?: RequestedCertificateSet, sessionManager?: SessionManager, autoPersistLastSession?: boolean)
|
|
668
690
|
```
|
|
669
|
-
See also: [RequestedCertificateSet](
|
|
691
|
+
See also: [RequestedCertificateSet](#interface-requestedcertificateset), [SessionManager](#class-sessionmanager), [Transport](#interface-transport), [WalletInterface](#interface-walletinterface)
|
|
670
692
|
|
|
671
693
|
Argument Details
|
|
672
694
|
|
|
@@ -693,7 +715,7 @@ or the session is not authenticated, initiates a handshake to create or authenti
|
|
|
693
715
|
```ts
|
|
694
716
|
async getAuthenticatedSession(identityKey?: string, maxWaitTime?: number): Promise<PeerSession>
|
|
695
717
|
```
|
|
696
|
-
See also: [PeerSession](
|
|
718
|
+
See also: [PeerSession](#interface-peersession)
|
|
697
719
|
|
|
698
720
|
Returns
|
|
699
721
|
|
|
@@ -713,7 +735,7 @@ Registers a callback to listen for certificates received from peers.
|
|
|
713
735
|
```ts
|
|
714
736
|
listenForCertificatesReceived(callback: (senderPublicKey: string, certs: VerifiableCertificate[]) => void): number
|
|
715
737
|
```
|
|
716
|
-
See also: [VerifiableCertificate](
|
|
738
|
+
See also: [VerifiableCertificate](#class-verifiablecertificate)
|
|
717
739
|
|
|
718
740
|
Returns
|
|
719
741
|
|
|
@@ -731,7 +753,7 @@ Registers a callback to listen for certificates requested from peers.
|
|
|
731
753
|
```ts
|
|
732
754
|
listenForCertificatesRequested(callback: (senderPublicKey: string, requestedCertificates: RequestedCertificateSet) => void): number
|
|
733
755
|
```
|
|
734
|
-
See also: [RequestedCertificateSet](
|
|
756
|
+
See also: [RequestedCertificateSet](#interface-requestedcertificateset)
|
|
735
757
|
|
|
736
758
|
Returns
|
|
737
759
|
|
|
@@ -768,7 +790,7 @@ an initial handshake or message has been exchanged.
|
|
|
768
790
|
```ts
|
|
769
791
|
async requestCertificates(certificatesToRequest: RequestedCertificateSet, identityKey?: string, maxWaitTime = 10000): Promise<void>
|
|
770
792
|
```
|
|
771
|
-
See also: [RequestedCertificateSet](
|
|
793
|
+
See also: [RequestedCertificateSet](#interface-requestedcertificateset)
|
|
772
794
|
|
|
773
795
|
Returns
|
|
774
796
|
|
|
@@ -794,7 +816,7 @@ Sends a certificate response message containing the specified certificates to a
|
|
|
794
816
|
```ts
|
|
795
817
|
async sendCertificateResponse(verifierIdentityKey: string, certificates: VerifiableCertificate[]): Promise<void>
|
|
796
818
|
```
|
|
797
|
-
See also: [VerifiableCertificate](
|
|
819
|
+
See also: [VerifiableCertificate](#class-verifiablecertificate)
|
|
798
820
|
|
|
799
821
|
Argument Details
|
|
800
822
|
|
|
@@ -867,6 +889,8 @@ Throws
|
|
|
867
889
|
|
|
868
890
|
Will throw an error if the message fails to send.
|
|
869
891
|
|
|
892
|
+
</details>
|
|
893
|
+
|
|
870
894
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
871
895
|
|
|
872
896
|
---
|
|
@@ -886,7 +910,11 @@ export class SessionManager {
|
|
|
886
910
|
}
|
|
887
911
|
```
|
|
888
912
|
|
|
889
|
-
See also: [PeerSession](
|
|
913
|
+
See also: [PeerSession](#interface-peersession)
|
|
914
|
+
|
|
915
|
+
<details>
|
|
916
|
+
|
|
917
|
+
<summary>Class SessionManager Details</summary>
|
|
890
918
|
|
|
891
919
|
#### Method addSession
|
|
892
920
|
|
|
@@ -899,7 +927,7 @@ allowing multiple concurrent sessions for the same peer.
|
|
|
899
927
|
```ts
|
|
900
928
|
addSession(session: PeerSession): void
|
|
901
929
|
```
|
|
902
|
-
See also: [PeerSession](
|
|
930
|
+
See also: [PeerSession](#interface-peersession)
|
|
903
931
|
|
|
904
932
|
Argument Details
|
|
905
933
|
|
|
@@ -919,7 +947,7 @@ authenticated) session associated with that peer, if any.
|
|
|
919
947
|
```ts
|
|
920
948
|
getSession(identifier: string): PeerSession | undefined
|
|
921
949
|
```
|
|
922
|
-
See also: [PeerSession](
|
|
950
|
+
See also: [PeerSession](#interface-peersession)
|
|
923
951
|
|
|
924
952
|
Returns
|
|
925
953
|
|
|
@@ -954,7 +982,7 @@ Removes a session from the manager by clearing all associated identifiers.
|
|
|
954
982
|
```ts
|
|
955
983
|
removeSession(session: PeerSession): void
|
|
956
984
|
```
|
|
957
|
-
See also: [PeerSession](
|
|
985
|
+
See also: [PeerSession](#interface-peersession)
|
|
958
986
|
|
|
959
987
|
Argument Details
|
|
960
988
|
|
|
@@ -969,13 +997,15 @@ ensuring we record the latest data (e.g., isAuthenticated, lastUpdate, etc.).
|
|
|
969
997
|
```ts
|
|
970
998
|
updateSession(session: PeerSession): void
|
|
971
999
|
```
|
|
972
|
-
See also: [PeerSession](
|
|
1000
|
+
See also: [PeerSession](#interface-peersession)
|
|
973
1001
|
|
|
974
1002
|
Argument Details
|
|
975
1003
|
|
|
976
1004
|
+ **session**
|
|
977
1005
|
+ The peer session to update.
|
|
978
1006
|
|
|
1007
|
+
</details>
|
|
1008
|
+
|
|
979
1009
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
980
1010
|
|
|
981
1011
|
---
|
|
@@ -1001,7 +1031,11 @@ export class SimplifiedFetchTransport implements Transport {
|
|
|
1001
1031
|
}
|
|
1002
1032
|
```
|
|
1003
1033
|
|
|
1004
|
-
See also: [AuthMessage](
|
|
1034
|
+
See also: [AuthMessage](#interface-authmessage), [Transport](#interface-transport)
|
|
1035
|
+
|
|
1036
|
+
<details>
|
|
1037
|
+
|
|
1038
|
+
<summary>Class SimplifiedFetchTransport Details</summary>
|
|
1005
1039
|
|
|
1006
1040
|
#### Constructor
|
|
1007
1041
|
|
|
@@ -1050,7 +1084,7 @@ This must be called before sending any messages to ensure responses can be proce
|
|
|
1050
1084
|
```ts
|
|
1051
1085
|
async onData(callback: (message: AuthMessage) => Promise<void>): Promise<void>
|
|
1052
1086
|
```
|
|
1053
|
-
See also: [AuthMessage](
|
|
1087
|
+
See also: [AuthMessage](#interface-authmessage)
|
|
1054
1088
|
|
|
1055
1089
|
Returns
|
|
1056
1090
|
|
|
@@ -1071,7 +1105,7 @@ the message is sent as a POST request to the `/auth` endpoint.
|
|
|
1071
1105
|
```ts
|
|
1072
1106
|
async send(message: AuthMessage): Promise<void>
|
|
1073
1107
|
```
|
|
1074
|
-
See also: [AuthMessage](
|
|
1108
|
+
See also: [AuthMessage](#interface-authmessage)
|
|
1075
1109
|
|
|
1076
1110
|
Returns
|
|
1077
1111
|
|
|
@@ -1086,6 +1120,8 @@ Throws
|
|
|
1086
1120
|
|
|
1087
1121
|
Will throw an error if no listener has been registered via `onData`.
|
|
1088
1122
|
|
|
1123
|
+
</details>
|
|
1124
|
+
|
|
1089
1125
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
1090
1126
|
|
|
1091
1127
|
---
|
|
@@ -1111,7 +1147,11 @@ export class VerifiableCertificate extends Certificate {
|
|
|
1111
1147
|
}
|
|
1112
1148
|
```
|
|
1113
1149
|
|
|
1114
|
-
See also: [Base64String](
|
|
1150
|
+
See also: [Base64String](#type-base64string), [Certificate](#class-certificate), [CertificateFieldNameUnder50Bytes](#type-certificatefieldnameunder50bytes), [HexString](#type-hexstring), [OutpointString](#type-outpointstring), [ProtoWallet](#class-protowallet), [PubKeyHex](#type-pubkeyhex), [WalletCertificate](#interface-walletcertificate)
|
|
1151
|
+
|
|
1152
|
+
<details>
|
|
1153
|
+
|
|
1154
|
+
<summary>Class VerifiableCertificate Details</summary>
|
|
1115
1155
|
|
|
1116
1156
|
#### Method decryptFields
|
|
1117
1157
|
|
|
@@ -1120,7 +1160,7 @@ Decrypts selectively revealed certificate fields using the provided keyring and
|
|
|
1120
1160
|
```ts
|
|
1121
1161
|
async decryptFields(verifierWallet: ProtoWallet, privileged?: boolean, privilegedReason?: string): Promise<Record<CertificateFieldNameUnder50Bytes, string>>
|
|
1122
1162
|
```
|
|
1123
|
-
See also: [CertificateFieldNameUnder50Bytes](
|
|
1163
|
+
See also: [CertificateFieldNameUnder50Bytes](#type-certificatefieldnameunder50bytes), [ProtoWallet](#class-protowallet)
|
|
1124
1164
|
|
|
1125
1165
|
Returns
|
|
1126
1166
|
|
|
@@ -1144,7 +1184,7 @@ Throws an error if any of the decryption operations fail, with a message indicat
|
|
|
1144
1184
|
```ts
|
|
1145
1185
|
static fromCertificate(certificate: WalletCertificate, keyring: Record<CertificateFieldNameUnder50Bytes, string>): VerifiableCertificate
|
|
1146
1186
|
```
|
|
1147
|
-
See also: [CertificateFieldNameUnder50Bytes](
|
|
1187
|
+
See also: [CertificateFieldNameUnder50Bytes](#type-certificatefieldnameunder50bytes), [VerifiableCertificate](#class-verifiablecertificate), [WalletCertificate](#interface-walletcertificate)
|
|
1148
1188
|
|
|
1149
1189
|
Returns
|
|
1150
1190
|
|
|
@@ -1158,6 +1198,8 @@ Argument Details
|
|
|
1158
1198
|
+ **keyring**
|
|
1159
1199
|
+ – A allows the verifier to decrypt selected certificate fields.
|
|
1160
1200
|
|
|
1201
|
+
</details>
|
|
1202
|
+
|
|
1161
1203
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
1162
1204
|
|
|
1163
1205
|
---
|
|
@@ -1180,7 +1222,11 @@ Creates a nonce derived from a wallet
|
|
|
1180
1222
|
export async function createNonce(wallet: WalletInterface, counterparty: WalletCounterparty = "self"): Promise<Base64String>
|
|
1181
1223
|
```
|
|
1182
1224
|
|
|
1183
|
-
See also: [Base64String](
|
|
1225
|
+
See also: [Base64String](#type-base64string), [WalletCounterparty](#type-walletcounterparty), [WalletInterface](#interface-walletinterface)
|
|
1226
|
+
|
|
1227
|
+
<details>
|
|
1228
|
+
|
|
1229
|
+
<summary>Function createNonce Details</summary>
|
|
1184
1230
|
|
|
1185
1231
|
Returns
|
|
1186
1232
|
|
|
@@ -1191,6 +1237,8 @@ Argument Details
|
|
|
1191
1237
|
+ **counterparty**
|
|
1192
1238
|
+ The counterparty to the nonce creation. Defaults to 'self'.
|
|
1193
1239
|
|
|
1240
|
+
</details>
|
|
1241
|
+
|
|
1194
1242
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
1195
1243
|
|
|
1196
1244
|
---
|
|
@@ -1202,7 +1250,11 @@ Verifies a nonce derived from a wallet
|
|
|
1202
1250
|
export async function verifyNonce(nonce: Base64String, wallet: WalletInterface, counterparty: WalletCounterparty = "self"): Promise<boolean>
|
|
1203
1251
|
```
|
|
1204
1252
|
|
|
1205
|
-
See also: [Base64String](
|
|
1253
|
+
See also: [Base64String](#type-base64string), [WalletCounterparty](#type-walletcounterparty), [WalletInterface](#interface-walletinterface)
|
|
1254
|
+
|
|
1255
|
+
<details>
|
|
1256
|
+
|
|
1257
|
+
<summary>Function verifyNonce Details</summary>
|
|
1206
1258
|
|
|
1207
1259
|
Returns
|
|
1208
1260
|
|
|
@@ -1215,6 +1267,8 @@ Argument Details
|
|
|
1215
1267
|
+ **counterparty**
|
|
1216
1268
|
+ The counterparty to the nonce creation. Defaults to 'self'.
|
|
1217
1269
|
|
|
1270
|
+
</details>
|
|
1271
|
+
|
|
1218
1272
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
1219
1273
|
|
|
1220
1274
|
---
|
|
@@ -1252,7 +1306,7 @@ getVerifiableCertificates = async (wallet: WalletInterface, requestedCertificate
|
|
|
1252
1306
|
}
|
|
1253
1307
|
```
|
|
1254
1308
|
|
|
1255
|
-
See also: [RequestedCertificateSet](
|
|
1309
|
+
See also: [RequestedCertificateSet](#interface-requestedcertificateset), [VerifiableCertificate](#class-verifiablecertificate), [WalletInterface](#interface-walletinterface)
|
|
1256
1310
|
|
|
1257
1311
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
1258
1312
|
|
|
@@ -1288,7 +1342,7 @@ validateCertificates = async (verifierWallet: WalletInterface, message: AuthMess
|
|
|
1288
1342
|
}
|
|
1289
1343
|
```
|
|
1290
1344
|
|
|
1291
|
-
See also: [AuthMessage](
|
|
1345
|
+
See also: [AuthMessage](#interface-authmessage), [Certificate](#class-certificate), [RequestedCertificateSet](#interface-requestedcertificateset), [VerifiableCertificate](#class-verifiablecertificate), [WalletInterface](#interface-walletinterface), [verify](#variable-verify)
|
|
1292
1346
|
|
|
1293
1347
|
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
|
|
1294
1348
|
|