@bsv/sdk 1.6.14 → 1.6.15

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.
@@ -38,7 +38,6 @@ See also: [RequestedCertificateSet](./auth.md#interface-requestedcertificateset)
38
38
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
39
39
 
40
40
  ---
41
-
42
41
  ### Interface: PeerSession
43
42
 
44
43
  ```ts
@@ -54,7 +53,6 @@ export interface PeerSession {
54
53
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
55
54
 
56
55
  ---
57
-
58
56
  ### Interface: RequestedCertificateSet
59
57
 
60
58
  ```ts
@@ -69,7 +67,6 @@ See also: [RequestedCertificateTypeIDAndFieldList](./auth.md#interface-requested
69
67
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
70
68
 
71
69
  ---
72
-
73
70
  ### Interface: RequestedCertificateTypeIDAndFieldList
74
71
 
75
72
  ```ts
@@ -81,7 +78,6 @@ export interface RequestedCertificateTypeIDAndFieldList {
81
78
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
82
79
 
83
80
  ---
84
-
85
81
  ### Interface: Transport
86
82
 
87
83
  ```ts
@@ -96,7 +92,6 @@ See also: [AuthMessage](./auth.md#interface-authmessage)
96
92
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
97
93
 
98
94
  ---
99
-
100
95
  ## Classes
101
96
 
102
97
  | |
@@ -142,15 +137,14 @@ Constructs a new AuthFetch instance.
142
137
  ```ts
143
138
  constructor(wallet: WalletInterface, requestedCertificates?: RequestedCertificateSet, sessionManager?: SessionManager)
144
139
  ```
145
-
146
140
  See also: [RequestedCertificateSet](./auth.md#interface-requestedcertificateset), [SessionManager](./auth.md#class-sessionmanager), [WalletInterface](./wallet.md#interface-walletinterface)
147
141
 
148
142
  Argument Details
149
143
 
150
- - **wallet**
151
- - The wallet instance for signing and authentication.
152
- - **requestedCertificates**
153
- - Optional set of certificates to request from peers.
144
+ + **wallet**
145
+ + The wallet instance for signing and authentication.
146
+ + **requestedCertificates**
147
+ + Optional set of certificates to request from peers.
154
148
 
155
149
  #### Method consumeReceivedCertificates
156
150
 
@@ -159,7 +153,6 @@ Return any certificates we've collected thus far, then clear them out.
159
153
  ```ts
160
154
  public consumeReceivedCertificates(): VerifiableCertificate[]
161
155
  ```
162
-
163
156
  See also: [VerifiableCertificate](./auth.md#class-verifiablecertificate)
164
157
 
165
158
  #### Method fetch
@@ -180,10 +173,10 @@ A promise that resolves with the server's response, structured as a Response-lik
180
173
 
181
174
  Argument Details
182
175
 
183
- - **url**
184
- - The URL to send the request to.
185
- - **config**
186
- - Configuration options for the request, including method, headers, and body.
176
+ + **url**
177
+ + The URL to send the request to.
178
+ + **config**
179
+ + Configuration options for the request, including method, headers, and body.
187
180
 
188
181
  Throws
189
182
 
@@ -196,13 +189,11 @@ Request Certificates from a Peer
196
189
  ```ts
197
190
  async sendCertificateRequest(baseUrl: string, certificatesToRequest: RequestedCertificateSet): Promise<VerifiableCertificate[]>
198
191
  ```
199
-
200
192
  See also: [RequestedCertificateSet](./auth.md#interface-requestedcertificateset), [VerifiableCertificate](./auth.md#class-verifiablecertificate)
201
193
 
202
194
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
203
195
 
204
196
  ---
205
-
206
197
  ### Class: Certificate
207
198
 
208
199
  Represents an Identity Certificate as per the Wallet interface specifications.
@@ -239,25 +230,24 @@ Constructs a new Certificate.
239
230
  ```ts
240
231
  constructor(type: Base64String, serialNumber: Base64String, subject: PubKeyHex, certifier: PubKeyHex, revocationOutpoint: OutpointString, fields: Record<CertificateFieldNameUnder50Bytes, string>, signature?: HexString)
241
232
  ```
242
-
243
233
  See also: [Base64String](./wallet.md#type-base64string), [CertificateFieldNameUnder50Bytes](./wallet.md#type-certificatefieldnameunder50bytes), [HexString](./wallet.md#type-hexstring), [OutpointString](./wallet.md#type-outpointstring), [PubKeyHex](./wallet.md#type-pubkeyhex)
244
234
 
245
235
  Argument Details
246
236
 
247
- - **type**
248
- - Type identifier for the certificate, base64 encoded string, 32 bytes.
249
- - **serialNumber**
250
- - Unique serial number of the certificate, base64 encoded string, 32 bytes.
251
- - **subject**
252
- - The public key belonging to the certificate's subject, compressed public key hex string.
253
- - **certifier**
254
- - Public key of the certifier who issued the certificate, compressed public key hex string.
255
- - **revocationOutpoint**
256
- - The outpoint used to confirm that the certificate has not been revoked (TXID.OutputIndex), as a string.
257
- - **fields**
258
- - All the fields present in the certificate.
259
- - **signature**
260
- - Certificate signature by the certifier's private key, DER encoded hex string.
237
+ + **type**
238
+ + Type identifier for the certificate, base64 encoded string, 32 bytes.
239
+ + **serialNumber**
240
+ + Unique serial number of the certificate, base64 encoded string, 32 bytes.
241
+ + **subject**
242
+ + The public key belonging to the certificate's subject, compressed public key hex string.
243
+ + **certifier**
244
+ + Public key of the certifier who issued the certificate, compressed public key hex string.
245
+ + **revocationOutpoint**
246
+ + The outpoint used to confirm that the certificate has not been revoked (TXID.OutputIndex), as a string.
247
+ + **fields**
248
+ + All the fields present in the certificate.
249
+ + **signature**
250
+ + Certificate signature by the certifier's private key, DER encoded hex string.
261
251
 
262
252
  #### Property certifier
263
253
 
@@ -266,7 +256,6 @@ Public key of the certifier who issued the certificate, compressed public key he
266
256
  ```ts
267
257
  certifier: PubKeyHex
268
258
  ```
269
-
270
259
  See also: [PubKeyHex](./wallet.md#type-pubkeyhex)
271
260
 
272
261
  #### Property fields
@@ -276,7 +265,6 @@ All the fields present in the certificate, with field names as keys and encrypte
276
265
  ```ts
277
266
  fields: Record<CertificateFieldNameUnder50Bytes, Base64String>
278
267
  ```
279
-
280
268
  See also: [Base64String](./wallet.md#type-base64string), [CertificateFieldNameUnder50Bytes](./wallet.md#type-certificatefieldnameunder50bytes)
281
269
 
282
270
  #### Property revocationOutpoint
@@ -286,7 +274,6 @@ The outpoint used to confirm that the certificate has not been revoked (TXID.Out
286
274
  ```ts
287
275
  revocationOutpoint: OutpointString
288
276
  ```
289
-
290
277
  See also: [OutpointString](./wallet.md#type-outpointstring)
291
278
 
292
279
  #### Property serialNumber
@@ -296,7 +283,6 @@ Unique serial number of the certificate, base64 encoded string, 32 bytes.
296
283
  ```ts
297
284
  serialNumber: Base64String
298
285
  ```
299
-
300
286
  See also: [Base64String](./wallet.md#type-base64string)
301
287
 
302
288
  #### Property signature
@@ -306,7 +292,6 @@ Certificate signature by the certifier's private key, DER encoded hex string.
306
292
  ```ts
307
293
  signature?: HexString
308
294
  ```
309
-
310
295
  See also: [HexString](./wallet.md#type-hexstring)
311
296
 
312
297
  #### Property subject
@@ -316,7 +301,6 @@ The public key belonging to the certificate's subject, compressed public key hex
316
301
  ```ts
317
302
  subject: PubKeyHex
318
303
  ```
319
-
320
304
  See also: [PubKeyHex](./wallet.md#type-pubkeyhex)
321
305
 
322
306
  #### Property type
@@ -326,7 +310,6 @@ Type identifier for the certificate, base64 encoded string, 32 bytes.
326
310
  ```ts
327
311
  type: Base64String
328
312
  ```
329
-
330
313
  See also: [Base64String](./wallet.md#type-base64string)
331
314
 
332
315
  #### Method fromBinary
@@ -336,7 +319,6 @@ Deserializes a certificate from binary format.
336
319
  ```ts
337
320
  static fromBinary(bin: number[]): Certificate
338
321
  ```
339
-
340
322
  See also: [Certificate](./auth.md#class-certificate)
341
323
 
342
324
  Returns
@@ -345,8 +327,8 @@ Returns
345
327
 
346
328
  Argument Details
347
329
 
348
- - **bin**
349
- - The binary data representing the certificate.
330
+ + **bin**
331
+ + The binary data representing the certificate.
350
332
 
351
333
  #### Method getCertificateFieldEncryptionDetails
352
334
 
@@ -364,23 +346,21 @@ static getCertificateFieldEncryptionDetails(fieldName: string, serialNumber?: st
364
346
  keyID: string;
365
347
  }
366
348
  ```
367
-
368
349
  See also: [WalletProtocol](./wallet.md#type-walletprotocol)
369
350
 
370
351
  Returns
371
352
 
372
353
  An object containing:
373
-
374
354
  - `protocolID` (WalletProtocol): The protocol ID for certificate field encryption.
375
355
  - `keyID` (string): A unique key identifier. It is the `fieldName` if `serialNumber` is undefined,
376
356
  otherwise it is a combination of `serialNumber` and `fieldName`.
377
357
 
378
358
  Argument Details
379
359
 
380
- - **fieldName**
381
- - The name of the field within the certificate to be encrypted.
382
- - **serialNumber**
383
- - (Optional) The serial number of the certificate.
360
+ + **fieldName**
361
+ + The name of the field within the certificate to be encrypted.
362
+ + **serialNumber**
363
+ + (Optional) The serial number of the certificate.
384
364
 
385
365
  #### Method sign
386
366
 
@@ -389,13 +369,12 @@ Signs the certificate using the provided certifier wallet.
389
369
  ```ts
390
370
  async sign(certifierWallet: ProtoWallet): Promise<void>
391
371
  ```
392
-
393
372
  See also: [ProtoWallet](./wallet.md#class-protowallet)
394
373
 
395
374
  Argument Details
396
375
 
397
- - **certifierWallet**
398
- - The wallet representing the certifier.
376
+ + **certifierWallet**
377
+ + The wallet representing the certifier.
399
378
 
400
379
  #### Method toBinary
401
380
 
@@ -411,8 +390,8 @@ Returns
411
390
 
412
391
  Argument Details
413
392
 
414
- - **includeSignature**
415
- - Whether to include the signature in the serialization.
393
+ + **includeSignature**
394
+ + Whether to include the signature in the serialization.
416
395
 
417
396
  #### Method verify
418
397
 
@@ -429,7 +408,6 @@ Returns
429
408
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
430
409
 
431
410
  ---
432
-
433
411
  ### Class: CompletedProtoWallet
434
412
 
435
413
  ```ts
@@ -466,7 +444,6 @@ See also: [AbortActionResult](./wallet.md#interface-abortactionresult), [Acquire
466
444
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
467
445
 
468
446
  ---
469
-
470
447
  ### Class: MasterCertificate
471
448
 
472
449
  MasterCertificate extends the base Certificate class to manage a master keyring, enabling the creation of verifiable certificates.
@@ -511,13 +488,11 @@ and sign off on the fields, along with the encrypted certificate fields.
511
488
  ```ts
512
489
  static async createCertificateFields(creatorWallet: ProtoWallet, certifierOrSubject: WalletCounterparty, fields: Record<CertificateFieldNameUnder50Bytes, string>, privileged?: boolean, privilegedReason?: string): Promise<CreateCertificateFieldsResult>
513
490
  ```
514
-
515
491
  See also: [CertificateFieldNameUnder50Bytes](./wallet.md#type-certificatefieldnameunder50bytes), [ProtoWallet](./wallet.md#class-protowallet), [WalletCounterparty](./wallet.md#type-walletcounterparty)
516
492
 
517
493
  Returns
518
494
 
519
495
  A promise resolving to an object containing:
520
-
521
496
  - `certificateFields` {Record<CertificateFieldNameUnder50Bytes, Base64String>}:
522
497
  The encrypted certificate fields.
523
498
  - `masterKeyring` {Record<CertificateFieldNameUnder50Bytes, Base64String>}:
@@ -525,16 +500,16 @@ The master keyring containing encrypted revelation keys for each field.
525
500
 
526
501
  Argument Details
527
502
 
528
- - **creatorWallet**
529
- - The wallet of the creator responsible for encrypting the fields.
530
- - **certifierOrSubject**
531
- - The certifier or subject who will validate the certificate fields.
532
- - **fields**
533
- - A record of certificate field names (under 50 bytes) mapped to their values.
534
- - **privileged**
535
- - Whether this is a privileged request.
536
- - **privilegedReason**
537
- - Reason provided for privileged access, required if this is a privileged operation. *
503
+ + **creatorWallet**
504
+ + The wallet of the creator responsible for encrypting the fields.
505
+ + **certifierOrSubject**
506
+ + The certifier or subject who will validate the certificate fields.
507
+ + **fields**
508
+ + A record of certificate field names (under 50 bytes) mapped to their values.
509
+ + **privileged**
510
+ + Whether this is a privileged request.
511
+ + **privilegedReason**
512
+ + Reason provided for privileged access, required if this is a privileged operation. *
538
513
 
539
514
  #### Method createKeyringForVerifier
540
515
 
@@ -546,7 +521,6 @@ for the verifier to access the designated fields.
546
521
  ```ts
547
522
  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>>
548
523
  ```
549
-
550
524
  See also: [Base64String](./wallet.md#type-base64string), [CertificateFieldNameUnder50Bytes](./wallet.md#type-certificatefieldnameunder50bytes), [ProtoWallet](./wallet.md#class-protowallet), [WalletCounterparty](./wallet.md#type-walletcounterparty)
551
525
 
552
526
  Returns
@@ -555,23 +529,22 @@ Returns
555
529
 
556
530
  Argument Details
557
531
 
558
- - **subjectWallet**
559
- - The wallet instance of the subject, used to decrypt and re-encrypt field keys.
560
- - **verifier**
561
- - The verifier who will receive access to the selectively revealed fields. Can be an identity key as hex, 'anyone', or 'self'.
562
- - **fieldsToReveal**
563
- - An array of field names to be revealed to the verifier. Must be a subset of the certificate's fields.
564
- - **originator**
565
- - Optional originator identifier, used if additional context is needed for decryption and encryption operations.
566
- - **privileged**
567
- - Whether this is a privileged request.
568
- - **privilegedReason**
569
- - Reason provided for privileged access, required if this is a privileged operation. *
532
+ + **subjectWallet**
533
+ + The wallet instance of the subject, used to decrypt and re-encrypt field keys.
534
+ + **verifier**
535
+ + The verifier who will receive access to the selectively revealed fields. Can be an identity key as hex, 'anyone', or 'self'.
536
+ + **fieldsToReveal**
537
+ + An array of field names to be revealed to the verifier. Must be a subset of the certificate's fields.
538
+ + **originator**
539
+ + Optional originator identifier, used if additional context is needed for decryption and encryption operations.
540
+ + **privileged**
541
+ + Whether this is a privileged request.
542
+ + **privilegedReason**
543
+ + Reason provided for privileged access, required if this is a privileged operation. *
570
544
 
571
545
  Throws
572
546
 
573
547
  Throws an error if:
574
-
575
548
  - fieldsToReveal is not an array of strings.
576
549
  - A field in `fieldsToReveal` does not exist in the certificate.
577
550
  - The decrypted master field key fails to decrypt the corresponding field (indicating an invalid key).
@@ -583,14 +556,12 @@ Decrypts all fields in the MasterCertificate using the subject's or certifier's
583
556
  This method allows the subject or certifier to decrypt the `masterKeyring` and retrieve
584
557
  the encryption keys for each field, which are then used to decrypt the corresponding field values.
585
558
  The counterparty used for decryption depends on how the certificate fields were created:
586
-
587
559
  - If the certificate is self-signed, the counterparty should be set to 'self'.
588
560
  - Otherwise, the counterparty should always be the other party involved in the certificate issuance process (the subject or certifier).
589
561
 
590
562
  ```ts
591
563
  static async decryptFields(subjectOrCertifierWallet: ProtoWallet, masterKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>, fields: Record<CertificateFieldNameUnder50Bytes, Base64String>, counterparty: WalletCounterparty, privileged?: boolean, privilegedReason?: string): Promise<Record<CertificateFieldNameUnder50Bytes, string>>
592
564
  ```
593
-
594
565
  See also: [Base64String](./wallet.md#type-base64string), [CertificateFieldNameUnder50Bytes](./wallet.md#type-certificatefieldnameunder50bytes), [ProtoWallet](./wallet.md#class-protowallet), [WalletCounterparty](./wallet.md#type-walletcounterparty)
595
566
 
596
567
  Returns
@@ -599,18 +570,18 @@ A promise resolving to a record of field names and their decrypted values in pla
599
570
 
600
571
  Argument Details
601
572
 
602
- - **subjectOrCertifierWallet**
603
- - The wallet of the subject or certifier, used to decrypt the master keyring and field values.
604
- - **masterKeyring**
605
- - A record containing encrypted keys for each field.
606
- - **fields**
607
- - A record of encrypted field names and their values.
608
- - **counterparty**
609
- - The counterparty responsible for creating or signing the certificate. For self-signed certificates, use 'self'.
610
- - **privileged**
611
- - Whether this is a privileged request.
612
- - **privilegedReason**
613
- - Reason provided for privileged access, required if this is a privileged operation.
573
+ + **subjectOrCertifierWallet**
574
+ + The wallet of the subject or certifier, used to decrypt the master keyring and field values.
575
+ + **masterKeyring**
576
+ + A record containing encrypted keys for each field.
577
+ + **fields**
578
+ + A record of encrypted field names and their values.
579
+ + **counterparty**
580
+ + The counterparty responsible for creating or signing the certificate. For self-signed certificates, use 'self'.
581
+ + **privileged**
582
+ + Whether this is a privileged request.
583
+ + **privilegedReason**
584
+ + Reason provided for privileged access, required if this is a privileged operation.
614
585
 
615
586
  Throws
616
587
 
@@ -631,7 +602,6 @@ static async issueCertificateForSubject(certifierWallet: ProtoWallet, subject: W
631
602
  return "Certificate revocation not tracked.";
632
603
  }, serialNumber?: string): Promise<MasterCertificate>
633
604
  ```
634
-
635
605
  See also: [CertificateFieldNameUnder50Bytes](./wallet.md#type-certificatefieldnameunder50bytes), [MasterCertificate](./auth.md#class-mastercertificate), [ProtoWallet](./wallet.md#class-protowallet), [WalletCounterparty](./wallet.md#type-walletcounterparty)
636
606
 
637
607
  Returns
@@ -640,19 +610,19 @@ Returns
640
610
 
641
611
  Argument Details
642
612
 
643
- - **certifierWallet**
644
- - The wallet of the certifier, used to sign the certificate and encrypt field keys.
645
- - **subject**
646
- - The subject for whom the certificate is issued.
647
- - **fields**
648
- - Unencrypted certificate fields to include, with their names and values.
649
- - **certificateType**
650
- - The type of certificate being issued.
651
- - **getRevocationOutpoint**
652
- - -
613
+ + **certifierWallet**
614
+ + The wallet of the certifier, used to sign the certificate and encrypt field keys.
615
+ + **subject**
616
+ + The subject for whom the certificate is issued.
617
+ + **fields**
618
+ + Unencrypted certificate fields to include, with their names and values.
619
+ + **certificateType**
620
+ + The type of certificate being issued.
621
+ + **getRevocationOutpoint**
622
+ + -
653
623
  Optional function to obtain a revocation outpoint for the certificate. Defaults to a placeholder.
654
- - **updateProgress**
655
- - Optional callback for reporting progress updates during the operation. Defaults to a no-op.
624
+ + **updateProgress**
625
+ + Optional callback for reporting progress updates during the operation. Defaults to a no-op.
656
626
 
657
627
  Throws
658
628
 
@@ -661,7 +631,6 @@ Throws an error if any operation (e.g., encryption, signing) fails during certif
661
631
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
662
632
 
663
633
  ---
664
-
665
634
  ### Class: Peer
666
635
 
667
636
  Represents a peer capable of performing mutual authentication.
@@ -697,21 +666,20 @@ Creates a new Peer instance
697
666
  ```ts
698
667
  constructor(wallet: WalletInterface, transport: Transport, certificatesToRequest?: RequestedCertificateSet, sessionManager?: SessionManager, autoPersistLastSession?: boolean)
699
668
  ```
700
-
701
669
  See also: [RequestedCertificateSet](./auth.md#interface-requestedcertificateset), [SessionManager](./auth.md#class-sessionmanager), [Transport](./auth.md#interface-transport), [WalletInterface](./wallet.md#interface-walletinterface)
702
670
 
703
671
  Argument Details
704
672
 
705
- - **wallet**
706
- - The wallet instance used for cryptographic operations.
707
- - **transport**
708
- - The transport mechanism used for sending and receiving messages.
709
- - **certificatesToRequest**
710
- - Optional set of certificates to request from a peer during the initial handshake.
711
- - **sessionManager**
712
- - Optional SessionManager to be used for managing peer sessions.
713
- - **autoPersistLastSession**
714
- - Whether to auto-persist the session with the last-interacted-with peer. Defaults to true.
673
+ + **wallet**
674
+ + The wallet instance used for cryptographic operations.
675
+ + **transport**
676
+ + The transport mechanism used for sending and receiving messages.
677
+ + **certificatesToRequest**
678
+ + Optional set of certificates to request from a peer during the initial handshake.
679
+ + **sessionManager**
680
+ + Optional SessionManager to be used for managing peer sessions.
681
+ + **autoPersistLastSession**
682
+ + Whether to auto-persist the session with the last-interacted-with peer. Defaults to true.
715
683
 
716
684
  #### Method getAuthenticatedSession
717
685
 
@@ -725,7 +693,6 @@ or the session is not authenticated, initiates a handshake to create or authenti
725
693
  ```ts
726
694
  async getAuthenticatedSession(identityKey?: string, maxWaitTime?: number): Promise<PeerSession>
727
695
  ```
728
-
729
696
  See also: [PeerSession](./auth.md#interface-peersession)
730
697
 
731
698
  Returns
@@ -734,10 +701,10 @@ Returns
734
701
 
735
702
  Argument Details
736
703
 
737
- - **identityKey**
738
- - The identity public key of the peer.
739
- - **maxWaitTime**
740
- - The maximum time in milliseconds to wait for the handshake.
704
+ + **identityKey**
705
+ + The identity public key of the peer.
706
+ + **maxWaitTime**
707
+ + The maximum time in milliseconds to wait for the handshake.
741
708
 
742
709
  #### Method listenForCertificatesReceived
743
710
 
@@ -746,7 +713,6 @@ Registers a callback to listen for certificates received from peers.
746
713
  ```ts
747
714
  listenForCertificatesReceived(callback: (senderPublicKey: string, certs: VerifiableCertificate[]) => void): number
748
715
  ```
749
-
750
716
  See also: [VerifiableCertificate](./auth.md#class-verifiablecertificate)
751
717
 
752
718
  Returns
@@ -755,8 +721,8 @@ The ID of the callback listener.
755
721
 
756
722
  Argument Details
757
723
 
758
- - **callback**
759
- - The function to call when certificates are received.
724
+ + **callback**
725
+ + The function to call when certificates are received.
760
726
 
761
727
  #### Method listenForCertificatesRequested
762
728
 
@@ -765,7 +731,6 @@ Registers a callback to listen for certificates requested from peers.
765
731
  ```ts
766
732
  listenForCertificatesRequested(callback: (senderPublicKey: string, requestedCertificates: RequestedCertificateSet) => void): number
767
733
  ```
768
-
769
734
  See also: [RequestedCertificateSet](./auth.md#interface-requestedcertificateset)
770
735
 
771
736
  Returns
@@ -774,8 +739,8 @@ The ID of the callback listener.
774
739
 
775
740
  Argument Details
776
741
 
777
- - **callback**
778
- - The function to call when a certificate request is received
742
+ + **callback**
743
+ + The function to call when a certificate request is received
779
744
 
780
745
  #### Method listenForGeneralMessages
781
746
 
@@ -791,8 +756,8 @@ The ID of the callback listener.
791
756
 
792
757
  Argument Details
793
758
 
794
- - **callback**
795
- - The function to call when a general message is received.
759
+ + **callback**
760
+ + The function to call when a general message is received.
796
761
 
797
762
  #### Method requestCertificates
798
763
 
@@ -803,7 +768,6 @@ an initial handshake or message has been exchanged.
803
768
  ```ts
804
769
  async requestCertificates(certificatesToRequest: RequestedCertificateSet, identityKey?: string, maxWaitTime = 10000): Promise<void>
805
770
  ```
806
-
807
771
  See also: [RequestedCertificateSet](./auth.md#interface-requestedcertificateset)
808
772
 
809
773
  Returns
@@ -812,12 +776,12 @@ Resolves if the certificate request message is successfully sent.
812
776
 
813
777
  Argument Details
814
778
 
815
- - **certificatesToRequest**
816
- - Specifies the certifiers and types of certificates required from the peer.
817
- - **identityKey**
818
- - The identity public key of the peer. If not provided, the current or last session identity is used.
819
- - **maxWaitTime**
820
- - Maximum time in milliseconds to wait for the peer session to be authenticated.
779
+ + **certificatesToRequest**
780
+ + Specifies the certifiers and types of certificates required from the peer.
781
+ + **identityKey**
782
+ + The identity public key of the peer. If not provided, the current or last session identity is used.
783
+ + **maxWaitTime**
784
+ + Maximum time in milliseconds to wait for the peer session to be authenticated.
821
785
 
822
786
  Throws
823
787
 
@@ -830,15 +794,14 @@ Sends a certificate response message containing the specified certificates to a
830
794
  ```ts
831
795
  async sendCertificateResponse(verifierIdentityKey: string, certificates: VerifiableCertificate[]): Promise<void>
832
796
  ```
833
-
834
797
  See also: [VerifiableCertificate](./auth.md#class-verifiablecertificate)
835
798
 
836
799
  Argument Details
837
800
 
838
- - **verifierIdentityKey**
839
- - The identity key of the peer requesting the certificates.
840
- - **certificates**
841
- - The list of certificates to include in the response.
801
+ + **verifierIdentityKey**
802
+ + The identity key of the peer requesting the certificates.
803
+ + **certificates**
804
+ + The list of certificates to include in the response.
842
805
 
843
806
  Throws
844
807
 
@@ -854,8 +817,8 @@ stopListeningForCertificatesReceived(callbackID: number): void
854
817
 
855
818
  Argument Details
856
819
 
857
- - **callbackID**
858
- - The ID of the certificates received callback to cancel.
820
+ + **callbackID**
821
+ + The ID of the certificates received callback to cancel.
859
822
 
860
823
  #### Method stopListeningForCertificatesRequested
861
824
 
@@ -867,8 +830,8 @@ stopListeningForCertificatesRequested(callbackID: number): void
867
830
 
868
831
  Argument Details
869
832
 
870
- - **callbackID**
871
- - The ID of the requested certificates callback to cancel.
833
+ + **callbackID**
834
+ + The ID of the requested certificates callback to cancel.
872
835
 
873
836
  #### Method stopListeningForGeneralMessages
874
837
 
@@ -880,8 +843,8 @@ stopListeningForGeneralMessages(callbackID: number): void
880
843
 
881
844
  Argument Details
882
845
 
883
- - **callbackID**
884
- - The ID of the callback to remove.
846
+ + **callbackID**
847
+ + The ID of the callback to remove.
885
848
 
886
849
  #### Method toPeer
887
850
 
@@ -893,12 +856,12 @@ async toPeer(message: number[], identityKey?: string, maxWaitTime?: number): Pro
893
856
 
894
857
  Argument Details
895
858
 
896
- - **message**
897
- - The message payload to send.
898
- - **identityKey**
899
- - The identity public key of the peer. If not provided, uses lastInteractedWithPeer (if any).
900
- - **maxWaitTime**
901
- - optional max wait time in ms
859
+ + **message**
860
+ + The message payload to send.
861
+ + **identityKey**
862
+ + The identity public key of the peer. If not provided, uses lastInteractedWithPeer (if any).
863
+ + **maxWaitTime**
864
+ + optional max wait time in ms
902
865
 
903
866
  Throws
904
867
 
@@ -907,7 +870,6 @@ Will throw an error if the message fails to send.
907
870
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
908
871
 
909
872
  ---
910
-
911
873
  ### Class: SessionManager
912
874
 
913
875
  Manages sessions for peers, allowing multiple concurrent sessions
@@ -937,20 +899,18 @@ allowing multiple concurrent sessions for the same peer.
937
899
  ```ts
938
900
  addSession(session: PeerSession): void
939
901
  ```
940
-
941
902
  See also: [PeerSession](./auth.md#interface-peersession)
942
903
 
943
904
  Argument Details
944
905
 
945
- - **session**
946
- - The peer session to add.
906
+ + **session**
907
+ + The peer session to add.
947
908
 
948
909
  #### Method getSession
949
910
 
950
911
  Retrieves a session based on a given identifier, which can be:
951
-
952
- - A sessionNonce, or
953
- - A peerIdentityKey.
912
+ - A sessionNonce, or
913
+ - A peerIdentityKey.
954
914
 
955
915
  If it is a `sessionNonce`, returns that exact session.
956
916
  If it is a `peerIdentityKey`, returns the "best" (e.g. most recently updated,
@@ -959,7 +919,6 @@ authenticated) session associated with that peer, if any.
959
919
  ```ts
960
920
  getSession(identifier: string): PeerSession | undefined
961
921
  ```
962
-
963
922
  See also: [PeerSession](./auth.md#interface-peersession)
964
923
 
965
924
  Returns
@@ -968,8 +927,8 @@ Returns
968
927
 
969
928
  Argument Details
970
929
 
971
- - **identifier**
972
- - The identifier for the session (sessionNonce or peerIdentityKey).
930
+ + **identifier**
931
+ + The identifier for the session (sessionNonce or peerIdentityKey).
973
932
 
974
933
  #### Method hasSession
975
934
 
@@ -985,8 +944,8 @@ Returns
985
944
 
986
945
  Argument Details
987
946
 
988
- - **identifier**
989
- - The identifier to check.
947
+ + **identifier**
948
+ + The identifier to check.
990
949
 
991
950
  #### Method removeSession
992
951
 
@@ -995,13 +954,12 @@ Removes a session from the manager by clearing all associated identifiers.
995
954
  ```ts
996
955
  removeSession(session: PeerSession): void
997
956
  ```
998
-
999
957
  See also: [PeerSession](./auth.md#interface-peersession)
1000
958
 
1001
959
  Argument Details
1002
960
 
1003
- - **session**
1004
- - The peer session to remove.
961
+ + **session**
962
+ + The peer session to remove.
1005
963
 
1006
964
  #### Method updateSession
1007
965
 
@@ -1011,18 +969,16 @@ ensuring we record the latest data (e.g., isAuthenticated, lastUpdate, etc.).
1011
969
  ```ts
1012
970
  updateSession(session: PeerSession): void
1013
971
  ```
1014
-
1015
972
  See also: [PeerSession](./auth.md#interface-peersession)
1016
973
 
1017
974
  Argument Details
1018
975
 
1019
- - **session**
1020
- - The peer session to update.
976
+ + **session**
977
+ + The peer session to update.
1021
978
 
1022
979
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
1023
980
 
1024
981
  ---
1025
-
1026
982
  ### Class: SimplifiedFetchTransport
1027
983
 
1028
984
  Implements an HTTP-specific transport for handling Peer mutual authentication messages.
@@ -1057,10 +1013,10 @@ constructor(baseUrl: string, fetchClient = defaultFetch)
1057
1013
 
1058
1014
  Argument Details
1059
1015
 
1060
- - **baseUrl**
1061
- - The base URL for all HTTP requests made by this transport.
1062
- - **fetchClient**
1063
- - A fetch implementation to use for HTTP requests (default: global fetch).
1016
+ + **baseUrl**
1017
+ + The base URL for all HTTP requests made by this transport.
1018
+ + **fetchClient**
1019
+ + A fetch implementation to use for HTTP requests (default: global fetch).
1064
1020
 
1065
1021
  #### Method deserializeRequestPayload
1066
1022
 
@@ -1083,18 +1039,17 @@ URL postfix (path and query string), headers, body, and request ID.
1083
1039
 
1084
1040
  Argument Details
1085
1041
 
1086
- - **payload**
1087
- - The serialized payload to deserialize.
1042
+ + **payload**
1043
+ + The serialized payload to deserialize.
1088
1044
 
1089
1045
  #### Method onData
1090
1046
 
1091
- Registers a callback to handle incoming messages.
1047
+ Registers a callback to handle incoming messages.
1092
1048
  This must be called before sending any messages to ensure responses can be processed.
1093
1049
 
1094
1050
  ```ts
1095
1051
  async onData(callback: (message: AuthMessage) => Promise<void>): Promise<void>
1096
1052
  ```
1097
-
1098
1053
  See also: [AuthMessage](./auth.md#interface-authmessage)
1099
1054
 
1100
1055
  Returns
@@ -1103,8 +1058,8 @@ A promise that resolves once the callback is set.
1103
1058
 
1104
1059
  Argument Details
1105
1060
 
1106
- - **callback**
1107
- - A function to invoke when an incoming AuthMessage is received.
1061
+ + **callback**
1062
+ + A function to invoke when an incoming AuthMessage is received.
1108
1063
 
1109
1064
  #### Method send
1110
1065
 
@@ -1116,7 +1071,6 @@ the message is sent as a POST request to the `/auth` endpoint.
1116
1071
  ```ts
1117
1072
  async send(message: AuthMessage): Promise<void>
1118
1073
  ```
1119
-
1120
1074
  See also: [AuthMessage](./auth.md#interface-authmessage)
1121
1075
 
1122
1076
  Returns
@@ -1125,8 +1079,8 @@ A promise that resolves when the message is successfully sent.
1125
1079
 
1126
1080
  Argument Details
1127
1081
 
1128
- - **message**
1129
- - The AuthMessage to send.
1082
+ + **message**
1083
+ + The AuthMessage to send.
1130
1084
 
1131
1085
  Throws
1132
1086
 
@@ -1135,7 +1089,6 @@ Will throw an error if no listener has been registered via `onData`.
1135
1089
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
1136
1090
 
1137
1091
  ---
1138
-
1139
1092
  ### Class: VerifiableCertificate
1140
1093
 
1141
1094
  VerifiableCertificate extends the Certificate class, adding functionality to manage a verifier-specific keyring.
@@ -1167,7 +1120,6 @@ Decrypts selectively revealed certificate fields using the provided keyring and
1167
1120
  ```ts
1168
1121
  async decryptFields(verifierWallet: ProtoWallet, privileged?: boolean, privilegedReason?: string): Promise<Record<CertificateFieldNameUnder50Bytes, string>>
1169
1122
  ```
1170
-
1171
1123
  See also: [CertificateFieldNameUnder50Bytes](./wallet.md#type-certificatefieldnameunder50bytes), [ProtoWallet](./wallet.md#class-protowallet)
1172
1124
 
1173
1125
  Returns
@@ -1176,12 +1128,12 @@ Returns
1176
1128
 
1177
1129
  Argument Details
1178
1130
 
1179
- - **verifierWallet**
1180
- - The wallet instance of the certificate's verifier, used to decrypt field keys.
1181
- - **privileged**
1182
- - Whether this is a privileged request.
1183
- - **privilegedReason**
1184
- - Reason provided for privileged access, required if this is a privileged operation.
1131
+ + **verifierWallet**
1132
+ + The wallet instance of the certificate's verifier, used to decrypt field keys.
1133
+ + **privileged**
1134
+ + Whether this is a privileged request.
1135
+ + **privilegedReason**
1136
+ + Reason provided for privileged access, required if this is a privileged operation.
1185
1137
 
1186
1138
  Throws
1187
1139
 
@@ -1192,7 +1144,6 @@ Throws an error if any of the decryption operations fail, with a message indicat
1192
1144
  ```ts
1193
1145
  static fromCertificate(certificate: WalletCertificate, keyring: Record<CertificateFieldNameUnder50Bytes, string>): VerifiableCertificate
1194
1146
  ```
1195
-
1196
1147
  See also: [CertificateFieldNameUnder50Bytes](./wallet.md#type-certificatefieldnameunder50bytes), [VerifiableCertificate](./auth.md#class-verifiablecertificate), [WalletCertificate](./wallet.md#interface-walletcertificate)
1197
1148
 
1198
1149
  Returns
@@ -1202,15 +1153,14 @@ original certificate data plus the supplied keyring.
1202
1153
 
1203
1154
  Argument Details
1204
1155
 
1205
- - **certificate**
1206
- - – The source certificate that was issued and signed by the certifier.
1207
- - **keyring**
1208
- - – A allows the verifier to decrypt selected certificate fields.
1156
+ + **certificate**
1157
+ + – The source certificate that was issued and signed by the certifier.
1158
+ + **keyring**
1159
+ + – A allows the verifier to decrypt selected certificate fields.
1209
1160
 
1210
1161
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
1211
1162
 
1212
1163
  ---
1213
-
1214
1164
  ## Functions
1215
1165
 
1216
1166
  | |
@@ -1238,13 +1188,12 @@ A random nonce derived with a wallet
1238
1188
 
1239
1189
  Argument Details
1240
1190
 
1241
- - **counterparty**
1242
- - The counterparty to the nonce creation. Defaults to 'self'.
1191
+ + **counterparty**
1192
+ + The counterparty to the nonce creation. Defaults to 'self'.
1243
1193
 
1244
1194
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
1245
1195
 
1246
1196
  ---
1247
-
1248
1197
  ### Function: verifyNonce
1249
1198
 
1250
1199
  Verifies a nonce derived from a wallet
@@ -1261,15 +1210,14 @@ The status of the validation
1261
1210
 
1262
1211
  Argument Details
1263
1212
 
1264
- - **nonce**
1265
- - A nonce to verify as a base64 string.
1266
- - **counterparty**
1267
- - The counterparty to the nonce creation. Defaults to 'self'.
1213
+ + **nonce**
1214
+ + A nonce to verify as a base64 string.
1215
+ + **counterparty**
1216
+ + The counterparty to the nonce creation. Defaults to 'self'.
1268
1217
 
1269
1218
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
1270
1219
 
1271
1220
  ---
1272
-
1273
1221
  ## Types
1274
1222
 
1275
1223
  ## Enums
@@ -1309,7 +1257,6 @@ See also: [RequestedCertificateSet](./auth.md#interface-requestedcertificateset)
1309
1257
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
1310
1258
 
1311
1259
  ---
1312
-
1313
1260
  ### Variable: validateCertificates
1314
1261
 
1315
1262
  ```ts