@actioncodes/protocol 2.0.21 → 2.0.23

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.
Files changed (89) hide show
  1. package/README.md +239 -146
  2. package/dist/adapters/SolanaAdapter.d.ts.map +1 -1
  3. package/dist/constants.d.ts +1 -1
  4. package/dist/errors.d.ts +5 -0
  5. package/dist/errors.d.ts.map +1 -1
  6. package/dist/index.cjs +2 -2
  7. package/dist/index.cjs.map +6 -6
  8. package/dist/index.js +2 -2
  9. package/dist/index.js.map +6 -6
  10. package/dist/utils/protocolMeta.d.ts +1 -0
  11. package/dist/utils/protocolMeta.d.ts.map +1 -1
  12. package/docs/ActionCodesProtocol/README.md +2 -2
  13. package/docs/ActionCodesProtocol/classes/ActionCodesProtocol.md +183 -33
  14. package/docs/README.md +425 -8
  15. package/docs/adapters/BaseChainAdapter/README.md +3 -4
  16. package/docs/adapters/BaseChainAdapter/classes/BaseChainAdapter.md +87 -20
  17. package/docs/adapters/BaseChainAdapter/interfaces/ChainAdapter.md +68 -12
  18. package/docs/adapters/BaseChainAdapter/type-aliases/SignFn.md +25 -0
  19. package/docs/adapters/SolanaAdapter/README.md +6 -3
  20. package/docs/adapters/SolanaAdapter/classes/SolanaAdapter.md +140 -43
  21. package/docs/adapters/SolanaAdapter/type-aliases/SolanaTransaction.md +3 -3
  22. package/docs/adapters/SolanaAdapter/variables/ADAPTER_CHAIN_NAME.md +11 -0
  23. package/docs/constants/README.md +2 -2
  24. package/docs/constants/variables/CODE_CHARSET_DIGITS.md +2 -2
  25. package/docs/constants/variables/CODE_DEFAULT_LENGTH.md +2 -2
  26. package/docs/constants/variables/CODE_MAX_LENGTH.md +2 -2
  27. package/docs/constants/variables/CODE_MIN_LENGTH.md +2 -2
  28. package/docs/constants/variables/PROTOCOL_META_MAX_BYTES.md +3 -3
  29. package/docs/constants/variables/PROTOCOL_NORMALIZATION.md +2 -2
  30. package/docs/constants/variables/SUPPORTED_CHAINS.md +9 -3
  31. package/docs/errors/README.md +4 -2
  32. package/docs/errors/classes/ExpiredCodeError.md +85 -21
  33. package/docs/errors/classes/InvalidAdapterError.md +751 -0
  34. package/docs/errors/classes/InvalidCodeFormatError.md +85 -21
  35. package/docs/errors/classes/InvalidPubkeyFormatError.md +85 -21
  36. package/docs/errors/classes/InvalidSignatureError.md +85 -21
  37. package/docs/errors/classes/MetaMismatchError.md +85 -21
  38. package/docs/errors/classes/MissingMetaError.md +85 -21
  39. package/docs/errors/classes/ProtocolError.md +75 -21
  40. package/docs/errors/classes/TransactionNotSignedByIntendedOwnerError.md +85 -21
  41. package/docs/errors/classes/TransactionNotSignedByIssuerError.md +755 -0
  42. package/docs/errors/enumerations/ProtocolErrorCode.md +39 -15
  43. package/docs/index/README.md +170 -14
  44. package/docs/modules.md +3 -3
  45. package/docs/strategy/DelegationStrategy/README.md +11 -0
  46. package/docs/strategy/DelegationStrategy/classes/DelegationStrategy.md +79 -0
  47. package/docs/strategy/WalletStrategy/README.md +2 -2
  48. package/docs/strategy/WalletStrategy/classes/WalletStrategy.md +22 -18
  49. package/docs/types/README.md +11 -3
  50. package/docs/types/interfaces/ActionCode.md +23 -26
  51. package/docs/types/interfaces/ActionCodeRevoke.md +93 -0
  52. package/docs/types/interfaces/CanonicalMessageParts.md +5 -13
  53. package/docs/types/interfaces/CanonicalRevokeMessageParts.md +33 -0
  54. package/docs/types/interfaces/CodeGenerationConfig.md +6 -6
  55. package/docs/types/interfaces/DelegatedActionCode.md +97 -0
  56. package/docs/types/interfaces/DelegatedActionCodeRevoke.md +105 -0
  57. package/docs/types/interfaces/DelegationProof.md +49 -0
  58. package/docs/types/type-aliases/Chain.md +11 -0
  59. package/docs/utils/canonical/README.md +6 -2
  60. package/docs/utils/canonical/functions/getCanonicalMessageParts.md +21 -0
  61. package/docs/utils/canonical/functions/serializeCanonical.md +3 -3
  62. package/docs/utils/canonical/functions/serializeCanonicalRevoke.md +21 -0
  63. package/docs/utils/canonical/functions/serializeDelegationProof.md +21 -0
  64. package/docs/utils/canonical/variables/CANONICAL_MESSAGE_PREFIX.md +3 -3
  65. package/docs/utils/canonical/variables/CANONICAL_MESSAGE_VERSION.md +3 -3
  66. package/docs/utils/canonical/variables/CANONICAL_REVOKE_MESSAGE_PREFIX.md +11 -0
  67. package/docs/utils/crypto/README.md +2 -3
  68. package/docs/utils/crypto/functions/base32EncodeCrockford.md +2 -2
  69. package/docs/utils/crypto/functions/codeHash.md +2 -2
  70. package/docs/utils/crypto/functions/digestToDigits.md +2 -2
  71. package/docs/utils/crypto/functions/hkdfSha256.md +2 -2
  72. package/docs/utils/crypto/functions/hmacSha256.md +2 -2
  73. package/docs/utils/crypto/functions/sha256.md +2 -2
  74. package/docs/utils/crypto/functions/truncateBits.md +2 -2
  75. package/docs/utils/protocolMeta/README.md +2 -2
  76. package/docs/utils/protocolMeta/functions/buildProtocolMeta.md +3 -3
  77. package/docs/utils/protocolMeta/functions/parseProtocolMeta.md +3 -3
  78. package/docs/utils/protocolMeta/functions/validateProtocolMetaFormat.md +3 -3
  79. package/docs/utils/protocolMeta/interfaces/ProtocolMetaFields.md +11 -3
  80. package/docs/utils/protocolMeta/variables/SCHEME.md +3 -3
  81. package/package.json +7 -7
  82. package/docs/adapters/BaseChainAdapter/interfaces/BaseContext.md +0 -17
  83. package/docs/adapters/BaseChainAdapter/type-aliases/ChainContext.md +0 -23
  84. package/docs/adapters/NodeCryptoAdapter/README.md +0 -15
  85. package/docs/adapters/NodeCryptoAdapter/classes/NodeCryptoAdapter.md +0 -254
  86. package/docs/adapters/NodeCryptoAdapter/type-aliases/NodeCryptoContext.md +0 -27
  87. package/docs/adapters/SolanaAdapter/type-aliases/SolanaContext.md +0 -27
  88. package/docs/types/interfaces/CodeGenerationResult.md +0 -25
  89. package/docs/utils/crypto/functions/generateRandomSecret.md +0 -15
@@ -1,12 +1,12 @@
1
- [**@actioncodes/protocol-v2**](../../README.md)
1
+ [**@actioncodes/protocol**](../../README.md)
2
2
 
3
3
  ***
4
4
 
5
- [@actioncodes/protocol-v2](../../modules.md) / [errors](../README.md) / TransactionNotSignedByIntendedOwnerError
5
+ [@actioncodes/protocol](../../modules.md) / [errors](../README.md) / TransactionNotSignedByIntendedOwnerError
6
6
 
7
7
  # Class: TransactionNotSignedByIntendedOwnerError
8
8
 
9
- Defined in: src/errors.ts:165
9
+ Defined in: src/errors.ts:187
10
10
 
11
11
  ## Extends
12
12
 
@@ -18,7 +18,7 @@ Defined in: src/errors.ts:165
18
18
 
19
19
  > **new TransactionNotSignedByIntendedOwnerError**(`intended`, `actualSigners`): `TransactionNotSignedByIntendedOwnerError`
20
20
 
21
- Defined in: src/errors.ts:166
21
+ Defined in: src/errors.ts:188
22
22
 
23
23
  #### Parameters
24
24
 
@@ -58,7 +58,7 @@ The cause of the error.
58
58
 
59
59
  > `readonly` **code**: [`ProtocolErrorCode`](../enumerations/ProtocolErrorCode.md)
60
60
 
61
- Defined in: src/errors.ts:29
61
+ Defined in: src/errors.ts:34
62
62
 
63
63
  #### Inherited from
64
64
 
@@ -70,7 +70,7 @@ Defined in: src/errors.ts:29
70
70
 
71
71
  > `readonly` `optional` **details**: `Record`\<`string`, `unknown`\>
72
72
 
73
- Defined in: src/errors.ts:31
73
+ Defined in: src/errors.ts:36
74
74
 
75
75
  #### Inherited from
76
76
 
@@ -238,7 +238,7 @@ Create .stack property on a target object
238
238
 
239
239
  > `static` **create**(`code`, `message`, `details?`): [`ProtocolError`](ProtocolError.md)
240
240
 
241
- Defined in: src/errors.ts:127
241
+ Defined in: src/errors.ts:149
242
242
 
243
243
  #### Parameters
244
244
 
@@ -268,7 +268,7 @@ Defined in: src/errors.ts:127
268
268
 
269
269
  > `static` **cryptoError**(`operation`, `reason`): [`ProtocolError`](ProtocolError.md)
270
270
 
271
- Defined in: src/errors.ts:110
271
+ Defined in: src/errors.ts:127
272
272
 
273
273
  #### Parameters
274
274
 
@@ -294,7 +294,7 @@ Defined in: src/errors.ts:110
294
294
 
295
295
  > `static` **expiredCode**(`code`, `expiresAt`, `currentTime`): [`ExpiredCodeError`](ExpiredCodeError.md)
296
296
 
297
- Defined in: src/errors.ts:38
297
+ Defined in: src/errors.ts:43
298
298
 
299
299
  #### Parameters
300
300
 
@@ -320,11 +320,49 @@ Defined in: src/errors.ts:38
320
320
 
321
321
  ***
322
322
 
323
+ ### invalidAdapter()
324
+
325
+ > `static` **invalidAdapter**(`adapter`): [`InvalidAdapterError`](InvalidAdapterError.md)
326
+
327
+ Defined in: src/errors.ts:144
328
+
329
+ #### Parameters
330
+
331
+ ##### adapter
332
+
333
+ `string`
334
+
335
+ #### Returns
336
+
337
+ [`InvalidAdapterError`](InvalidAdapterError.md)
338
+
339
+ #### Inherited from
340
+
341
+ [`ProtocolError`](ProtocolError.md).[`invalidAdapter`](ProtocolError.md#invalidadapter)
342
+
343
+ ***
344
+
345
+ ### invalidCode()
346
+
347
+ > `static` **invalidCode**(): [`ProtocolError`](ProtocolError.md)
348
+
349
+ Defined in: src/errors.ts:47
350
+
351
+ #### Returns
352
+
353
+ [`ProtocolError`](ProtocolError.md)
354
+
355
+ #### Inherited from
356
+
357
+ [`ProtocolError`](ProtocolError.md).[`invalidCode`](ProtocolError.md#invalidcode)
358
+
359
+ ***
360
+
323
361
  ### invalidCodeFormat()
324
362
 
325
363
  > `static` **invalidCodeFormat**(`code`, `reason`): [`InvalidCodeFormatError`](InvalidCodeFormatError.md)
326
364
 
327
- Defined in: src/errors.ts:42
365
+ Defined in: src/errors.ts:55
328
366
 
329
367
  #### Parameters
330
368
 
@@ -350,7 +388,7 @@ Defined in: src/errors.ts:42
350
388
 
351
389
  > `static` **invalidDigest**(`reason`): [`ProtocolError`](ProtocolError.md)
352
390
 
353
- Defined in: src/errors.ts:118
391
+ Defined in: src/errors.ts:135
354
392
 
355
393
  #### Parameters
356
394
 
@@ -372,7 +410,7 @@ Defined in: src/errors.ts:118
372
410
 
373
411
  > `static` **invalidInput**(`field`, `value`, `reason`): [`ProtocolError`](ProtocolError.md)
374
412
 
375
- Defined in: src/errors.ts:93
413
+ Defined in: src/errors.ts:110
376
414
 
377
415
  #### Parameters
378
416
 
@@ -402,7 +440,7 @@ Defined in: src/errors.ts:93
402
440
 
403
441
  > `static` **invalidMetaFormat**(`reason`): [`ProtocolError`](ProtocolError.md)
404
442
 
405
- Defined in: src/errors.ts:55
443
+ Defined in: src/errors.ts:68
406
444
 
407
445
  #### Parameters
408
446
 
@@ -424,7 +462,7 @@ Defined in: src/errors.ts:55
424
462
 
425
463
  > `static` **invalidPubkeyFormat**(`pubkey`, `reason`): [`InvalidPubkeyFormatError`](InvalidPubkeyFormatError.md)
426
464
 
427
- Defined in: src/errors.ts:88
465
+ Defined in: src/errors.ts:105
428
466
 
429
467
  #### Parameters
430
468
 
@@ -450,7 +488,7 @@ Defined in: src/errors.ts:88
450
488
 
451
489
  > `static` **invalidSignature**(`reason`): [`InvalidSignatureError`](InvalidSignatureError.md)
452
490
 
453
- Defined in: src/errors.ts:46
491
+ Defined in: src/errors.ts:59
454
492
 
455
493
  #### Parameters
456
494
 
@@ -472,7 +510,7 @@ Defined in: src/errors.ts:46
472
510
 
473
511
  > `static` **invalidTransactionFormat**(`reason`): [`ProtocolError`](ProtocolError.md)
474
512
 
475
- Defined in: src/errors.ts:80
513
+ Defined in: src/errors.ts:97
476
514
 
477
515
  #### Parameters
478
516
 
@@ -546,7 +584,7 @@ True if the value is an instance of Error, false otherwise
546
584
 
547
585
  > `static` **metaMismatch**(`expected`, `actual`, `field`): [`MetaMismatchError`](MetaMismatchError.md)
548
586
 
549
- Defined in: src/errors.ts:63
587
+ Defined in: src/errors.ts:76
550
588
 
551
589
  #### Parameters
552
590
 
@@ -576,7 +614,7 @@ Defined in: src/errors.ts:63
576
614
 
577
615
  > `static` **metaTooLarge**(`maxBytes`, `actualBytes`): [`ProtocolError`](ProtocolError.md)
578
616
 
579
- Defined in: src/errors.ts:67
617
+ Defined in: src/errors.ts:80
580
618
 
581
619
  #### Parameters
582
620
 
@@ -602,7 +640,7 @@ Defined in: src/errors.ts:67
602
640
 
603
641
  > `static` **missingMeta**(): [`MissingMetaError`](MissingMetaError.md)
604
642
 
605
- Defined in: src/errors.ts:51
643
+ Defined in: src/errors.ts:64
606
644
 
607
645
  #### Returns
608
646
 
@@ -618,7 +656,7 @@ Defined in: src/errors.ts:51
618
656
 
619
657
  > `static` **missingRequiredField**(`field`): [`ProtocolError`](ProtocolError.md)
620
658
 
621
- Defined in: src/errors.ts:101
659
+ Defined in: src/errors.ts:118
622
660
 
623
661
  #### Parameters
624
662
 
@@ -670,7 +708,7 @@ https://v8.dev/docs/stack-trace-api#customizing-stack-traces
670
708
 
671
709
  > `static` **transactionNotSignedByIntendedOwner**(`intended`, `actualSigners`): `TransactionNotSignedByIntendedOwnerError`
672
710
 
673
- Defined in: src/errors.ts:76
711
+ Defined in: src/errors.ts:89
674
712
 
675
713
  #### Parameters
676
714
 
@@ -689,3 +727,29 @@ Defined in: src/errors.ts:76
689
727
  #### Inherited from
690
728
 
691
729
  [`ProtocolError`](ProtocolError.md).[`transactionNotSignedByIntendedOwner`](ProtocolError.md#transactionnotsignedbyintendedowner)
730
+
731
+ ***
732
+
733
+ ### transactionNotSignedByIssuer()
734
+
735
+ > `static` **transactionNotSignedByIssuer**(`issuer`, `actualSigners`): [`TransactionNotSignedByIssuerError`](TransactionNotSignedByIssuerError.md)
736
+
737
+ Defined in: src/errors.ts:93
738
+
739
+ #### Parameters
740
+
741
+ ##### issuer
742
+
743
+ `string`
744
+
745
+ ##### actualSigners
746
+
747
+ `string`[]
748
+
749
+ #### Returns
750
+
751
+ [`TransactionNotSignedByIssuerError`](TransactionNotSignedByIssuerError.md)
752
+
753
+ #### Inherited from
754
+
755
+ [`ProtocolError`](ProtocolError.md).[`transactionNotSignedByIssuer`](ProtocolError.md#transactionnotsignedbyissuer)