@actioncodes/protocol 1.2.2 → 2.0.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.
Files changed (144) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +318 -33
  3. package/dist/ActionCodesProtocol.d.ts +37 -0
  4. package/dist/ActionCodesProtocol.d.ts.map +1 -0
  5. package/dist/adapters/BaseChainAdapter.d.ts +22 -0
  6. package/dist/adapters/BaseChainAdapter.d.ts.map +1 -0
  7. package/dist/adapters/SolanaAdapter.d.ts +44 -0
  8. package/dist/adapters/SolanaAdapter.d.ts.map +1 -0
  9. package/dist/constants.d.ts +6 -8
  10. package/dist/constants.d.ts.map +1 -1
  11. package/dist/errors.d.ts +63 -0
  12. package/dist/errors.d.ts.map +1 -0
  13. package/dist/index.cjs +3 -0
  14. package/dist/index.cjs.map +25 -0
  15. package/dist/index.d.ts +10 -8
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +3 -36
  18. package/dist/index.js.map +25 -0
  19. package/dist/strategy/DelegationStrategy.d.ts +45 -0
  20. package/dist/strategy/DelegationStrategy.d.ts.map +1 -0
  21. package/dist/strategy/WalletStrategy.d.ts +8 -0
  22. package/dist/strategy/WalletStrategy.d.ts.map +1 -0
  23. package/dist/types.d.ts +40 -0
  24. package/dist/types.d.ts.map +1 -0
  25. package/dist/utils/canonical.d.ts +5 -0
  26. package/dist/utils/canonical.d.ts.map +1 -0
  27. package/dist/utils/crypto.d.ts +13 -0
  28. package/dist/utils/crypto.d.ts.map +1 -0
  29. package/dist/utils/protocolMeta.d.ts +16 -0
  30. package/dist/utils/protocolMeta.d.ts.map +1 -0
  31. package/docs/ActionCodesProtocol/README.md +11 -0
  32. package/docs/ActionCodesProtocol/classes/ActionCodesProtocol.md +147 -0
  33. package/docs/README.md +10 -50
  34. package/docs/adapters/BaseChainAdapter/README.md +20 -0
  35. package/docs/adapters/BaseChainAdapter/classes/BaseChainAdapter.md +56 -0
  36. package/docs/adapters/BaseChainAdapter/interfaces/BaseContext.md +17 -0
  37. package/docs/adapters/BaseChainAdapter/interfaces/ChainAdapter.md +33 -0
  38. package/docs/adapters/BaseChainAdapter/type-aliases/ChainContext.md +23 -0
  39. package/docs/adapters/NodeCryptoAdapter/README.md +15 -0
  40. package/docs/adapters/NodeCryptoAdapter/classes/NodeCryptoAdapter.md +254 -0
  41. package/docs/adapters/NodeCryptoAdapter/type-aliases/NodeCryptoContext.md +27 -0
  42. package/docs/adapters/SolanaAdapter/README.md +16 -0
  43. package/docs/adapters/SolanaAdapter/classes/SolanaAdapter.md +190 -0
  44. package/docs/adapters/SolanaAdapter/type-aliases/SolanaContext.md +27 -0
  45. package/docs/adapters/SolanaAdapter/type-aliases/SolanaTransaction.md +13 -0
  46. package/docs/constants/README.md +8 -13
  47. package/docs/constants/variables/CODE_CHARSET_DIGITS.md +11 -0
  48. package/docs/constants/variables/CODE_DEFAULT_LENGTH.md +11 -0
  49. package/docs/constants/variables/CODE_MAX_LENGTH.md +11 -0
  50. package/docs/constants/variables/CODE_MIN_LENGTH.md +11 -0
  51. package/docs/constants/variables/PROTOCOL_META_MAX_BYTES.md +11 -0
  52. package/docs/constants/variables/PROTOCOL_NORMALIZATION.md +11 -0
  53. package/docs/constants/variables/SUPPORTED_CHAINS.md +3 -3
  54. package/docs/errors/README.md +22 -0
  55. package/docs/errors/classes/ExpiredCodeError.md +695 -0
  56. package/docs/errors/classes/InvalidCodeFormatError.md +691 -0
  57. package/docs/errors/classes/InvalidPubkeyFormatError.md +691 -0
  58. package/docs/errors/classes/InvalidSignatureError.md +687 -0
  59. package/docs/errors/classes/MetaMismatchError.md +695 -0
  60. package/docs/errors/classes/MissingMetaError.md +681 -0
  61. package/docs/errors/classes/ProtocolError.md +637 -0
  62. package/docs/errors/classes/TransactionNotSignedByIntendedOwnerError.md +691 -0
  63. package/docs/errors/enumerations/ProtocolErrorCode.md +121 -0
  64. package/docs/index/README.md +83 -41
  65. package/docs/modules.md +12 -9
  66. package/docs/strategy/WalletStrategy/README.md +11 -0
  67. package/docs/strategy/WalletStrategy/classes/WalletStrategy.md +67 -0
  68. package/docs/types/README.md +14 -0
  69. package/docs/types/interfaces/ActionCode.md +65 -0
  70. package/docs/types/interfaces/CanonicalMessageParts.md +33 -0
  71. package/docs/types/interfaces/CodeGenerationConfig.md +33 -0
  72. package/docs/types/interfaces/CodeGenerationResult.md +25 -0
  73. package/docs/utils/canonical/README.md +16 -0
  74. package/docs/utils/canonical/functions/serializeCanonical.md +21 -0
  75. package/docs/utils/canonical/variables/CANONICAL_MESSAGE_PREFIX.md +11 -0
  76. package/docs/utils/canonical/variables/CANONICAL_MESSAGE_VERSION.md +11 -0
  77. package/docs/utils/crypto/README.md +18 -0
  78. package/docs/utils/crypto/functions/base32EncodeCrockford.md +21 -0
  79. package/docs/utils/crypto/functions/codeHash.md +21 -0
  80. package/docs/utils/crypto/functions/digestToDigits.md +25 -0
  81. package/docs/utils/crypto/functions/generateRandomSecret.md +15 -0
  82. package/docs/utils/crypto/functions/hkdfSha256.md +35 -0
  83. package/docs/utils/crypto/functions/hmacSha256.md +25 -0
  84. package/docs/utils/crypto/functions/sha256.md +21 -0
  85. package/docs/utils/crypto/functions/truncateBits.md +25 -0
  86. package/docs/utils/protocolMeta/README.md +21 -0
  87. package/docs/utils/protocolMeta/functions/buildProtocolMeta.md +21 -0
  88. package/docs/utils/protocolMeta/functions/parseProtocolMeta.md +21 -0
  89. package/docs/utils/protocolMeta/functions/validateProtocolMetaFormat.md +21 -0
  90. package/docs/utils/protocolMeta/interfaces/ProtocolMetaFields.md +41 -0
  91. package/docs/utils/protocolMeta/variables/SCHEME.md +11 -0
  92. package/package.json +42 -47
  93. package/dist/actioncode.d.ts +0 -120
  94. package/dist/actioncode.d.ts.map +0 -1
  95. package/dist/actioncode.js +0 -186
  96. package/dist/adapters/base.d.ts +0 -93
  97. package/dist/adapters/base.d.ts.map +0 -1
  98. package/dist/adapters/base.js +0 -65
  99. package/dist/adapters/solana/index.d.ts +0 -2
  100. package/dist/adapters/solana/index.d.ts.map +0 -1
  101. package/dist/adapters/solana/index.js +0 -30
  102. package/dist/adapters/solana/solana.d.ts +0 -113
  103. package/dist/adapters/solana/solana.d.ts.map +0 -1
  104. package/dist/adapters/solana/solana.js +0 -537
  105. package/dist/codegen.d.ts +0 -76
  106. package/dist/codegen.d.ts.map +0 -1
  107. package/dist/codegen.js +0 -211
  108. package/dist/constants.js +0 -24
  109. package/dist/meta.d.ts +0 -54
  110. package/dist/meta.d.ts.map +0 -1
  111. package/dist/meta.js +0 -104
  112. package/dist/protocol.d.ts +0 -179
  113. package/dist/protocol.d.ts.map +0 -1
  114. package/dist/protocol.js +0 -390
  115. package/docs/_media/LICENSE +0 -201
  116. package/docs/_media/README.md +0 -28
  117. package/docs/actioncode/README.md +0 -21
  118. package/docs/actioncode/classes/ActionCode.md +0 -430
  119. package/docs/actioncode/interfaces/ActionCodeFields.md +0 -89
  120. package/docs/actioncode/interfaces/ActionCodeMetadata.md +0 -25
  121. package/docs/actioncode/interfaces/ActionCodeTransaction.md +0 -57
  122. package/docs/actioncode/type-aliases/ActionCodeStatus.md +0 -11
  123. package/docs/adapters/base/README.md +0 -11
  124. package/docs/adapters/base/classes/BaseChainAdapter.md +0 -396
  125. package/docs/adapters/solana/README.md +0 -19
  126. package/docs/adapters/solana/solana/README.md +0 -15
  127. package/docs/adapters/solana/solana/classes/SolanaAdapter.md +0 -506
  128. package/docs/adapters/solana/solana/type-aliases/SolanaTransaction.md +0 -13
  129. package/docs/codegen/README.md +0 -11
  130. package/docs/codegen/classes/CodeGenerator.md +0 -341
  131. package/docs/constants/type-aliases/SupportedChain.md +0 -11
  132. package/docs/constants/variables/CODE_LENGTH.md +0 -11
  133. package/docs/constants/variables/CODE_TTL.md +0 -11
  134. package/docs/constants/variables/MAX_PREFIX_LENGTH.md +0 -11
  135. package/docs/constants/variables/MIN_PREFIX_LENGTH.md +0 -11
  136. package/docs/constants/variables/PROTOCOL_CODE_PREFIX.md +0 -11
  137. package/docs/constants/variables/PROTOCOL_PREFIX.md +0 -11
  138. package/docs/constants/variables/PROTOCOL_VERSION.md +0 -11
  139. package/docs/meta/README.md +0 -15
  140. package/docs/meta/classes/ProtocolMetaParser.md +0 -177
  141. package/docs/meta/interfaces/ProtocolMetaV1.md +0 -59
  142. package/docs/protocol/README.md +0 -51
  143. package/docs/protocol/classes/ActionCodesProtocol.md +0 -676
  144. package/docs/protocol/interfaces/ProtocolConfig.md +0 -71
@@ -0,0 +1,121 @@
1
+ [**@actioncodes/protocol-v2**](../../README.md)
2
+
3
+ ***
4
+
5
+ [@actioncodes/protocol-v2](../../modules.md) / [errors](../README.md) / ProtocolErrorCode
6
+
7
+ # Enumeration: ProtocolErrorCode
8
+
9
+ Defined in: src/errors.ts:1
10
+
11
+ ## Enumeration Members
12
+
13
+ ### CRYPTO\_ERROR
14
+
15
+ > **CRYPTO\_ERROR**: `"CRYPTO_ERROR"`
16
+
17
+ Defined in: src/errors.ts:23
18
+
19
+ ***
20
+
21
+ ### EXPIRED\_CODE
22
+
23
+ > **EXPIRED\_CODE**: `"EXPIRED_CODE"`
24
+
25
+ Defined in: src/errors.ts:3
26
+
27
+ ***
28
+
29
+ ### INVALID\_CODE\_FORMAT
30
+
31
+ > **INVALID\_CODE\_FORMAT**: `"INVALID_CODE_FORMAT"`
32
+
33
+ Defined in: src/errors.ts:4
34
+
35
+ ***
36
+
37
+ ### INVALID\_DIGEST
38
+
39
+ > **INVALID\_DIGEST**: `"INVALID_DIGEST"`
40
+
41
+ Defined in: src/errors.ts:24
42
+
43
+ ***
44
+
45
+ ### INVALID\_INPUT
46
+
47
+ > **INVALID\_INPUT**: `"INVALID_INPUT"`
48
+
49
+ Defined in: src/errors.ts:19
50
+
51
+ ***
52
+
53
+ ### INVALID\_META\_FORMAT
54
+
55
+ > **INVALID\_META\_FORMAT**: `"INVALID_META_FORMAT"`
56
+
57
+ Defined in: src/errors.ts:9
58
+
59
+ ***
60
+
61
+ ### INVALID\_PUBKEY\_FORMAT
62
+
63
+ > **INVALID\_PUBKEY\_FORMAT**: `"INVALID_PUBKEY_FORMAT"`
64
+
65
+ Defined in: src/errors.ts:16
66
+
67
+ ***
68
+
69
+ ### INVALID\_SIGNATURE
70
+
71
+ > **INVALID\_SIGNATURE**: `"INVALID_SIGNATURE"`
72
+
73
+ Defined in: src/errors.ts:5
74
+
75
+ ***
76
+
77
+ ### INVALID\_TRANSACTION\_FORMAT
78
+
79
+ > **INVALID\_TRANSACTION\_FORMAT**: `"INVALID_TRANSACTION_FORMAT"`
80
+
81
+ Defined in: src/errors.ts:15
82
+
83
+ ***
84
+
85
+ ### META\_MISMATCH
86
+
87
+ > **META\_MISMATCH**: `"META_MISMATCH"`
88
+
89
+ Defined in: src/errors.ts:10
90
+
91
+ ***
92
+
93
+ ### META\_TOO\_LARGE
94
+
95
+ > **META\_TOO\_LARGE**: `"META_TOO_LARGE"`
96
+
97
+ Defined in: src/errors.ts:11
98
+
99
+ ***
100
+
101
+ ### MISSING\_META
102
+
103
+ > **MISSING\_META**: `"MISSING_META"`
104
+
105
+ Defined in: src/errors.ts:8
106
+
107
+ ***
108
+
109
+ ### MISSING\_REQUIRED\_FIELD
110
+
111
+ > **MISSING\_REQUIRED\_FIELD**: `"MISSING_REQUIRED_FIELD"`
112
+
113
+ Defined in: src/errors.ts:20
114
+
115
+ ***
116
+
117
+ ### TRANSACTION\_NOT\_SIGNED\_BY\_INTENDED\_OWNER
118
+
119
+ > **TRANSACTION\_NOT\_SIGNED\_BY\_INTENDED\_OWNER**: `"TRANSACTION_NOT_SIGNED_BY_INTENDED_OWNER"`
120
+
121
+ Defined in: src/errors.ts:14
@@ -1,8 +1,8 @@
1
- [**@actioncodes/protocol**](../README.md)
1
+ [**@actioncodes/protocol-v2**](../README.md)
2
2
 
3
3
  ***
4
4
 
5
- [@actioncodes/protocol](../modules.md) / index
5
+ [@actioncodes/protocol-v2](../modules.md) / index
6
6
 
7
7
  # index
8
8
 
@@ -10,121 +10,157 @@
10
10
 
11
11
  ### ActionCode
12
12
 
13
- Re-exports [ActionCode](../actioncode/classes/ActionCode.md)
13
+ Re-exports [ActionCode](../types/interfaces/ActionCode.md)
14
14
 
15
15
  ***
16
16
 
17
- ### ActionCodeFields
17
+ ### ActionCodesProtocol
18
18
 
19
- Re-exports [ActionCodeFields](../actioncode/interfaces/ActionCodeFields.md)
19
+ Re-exports [ActionCodesProtocol](../ActionCodesProtocol/classes/ActionCodesProtocol.md)
20
20
 
21
21
  ***
22
22
 
23
- ### ActionCodeMetadata
23
+ ### base32EncodeCrockford
24
24
 
25
- Re-exports [ActionCodeMetadata](../actioncode/interfaces/ActionCodeMetadata.md)
25
+ Re-exports [base32EncodeCrockford](../utils/crypto/functions/base32EncodeCrockford.md)
26
26
 
27
27
  ***
28
28
 
29
- ### ActionCodesProtocol
29
+ ### BaseChainAdapter
30
30
 
31
- Re-exports [ActionCodesProtocol](../protocol/classes/ActionCodesProtocol.md)
31
+ Re-exports [BaseChainAdapter](../adapters/BaseChainAdapter/classes/BaseChainAdapter.md)
32
32
 
33
33
  ***
34
34
 
35
- ### ActionCodeStatus
35
+ ### CANONICAL\_MESSAGE\_PREFIX
36
36
 
37
- Re-exports [ActionCodeStatus](../actioncode/type-aliases/ActionCodeStatus.md)
37
+ Re-exports [CANONICAL_MESSAGE_PREFIX](../utils/canonical/variables/CANONICAL_MESSAGE_PREFIX.md)
38
38
 
39
39
  ***
40
40
 
41
- ### ActionCodeTransaction
41
+ ### CANONICAL\_MESSAGE\_VERSION
42
42
 
43
- Re-exports [ActionCodeTransaction](../actioncode/interfaces/ActionCodeTransaction.md)
43
+ Re-exports [CANONICAL_MESSAGE_VERSION](../utils/canonical/variables/CANONICAL_MESSAGE_VERSION.md)
44
44
 
45
45
  ***
46
46
 
47
- ### BaseChainAdapter
47
+ ### CanonicalMessageParts
48
+
49
+ Re-exports [CanonicalMessageParts](../types/interfaces/CanonicalMessageParts.md)
50
+
51
+ ***
52
+
53
+ ### ChainContext
54
+
55
+ Re-exports [ChainContext](../adapters/BaseChainAdapter/type-aliases/ChainContext.md)
56
+
57
+ ***
58
+
59
+ ### CODE\_CHARSET\_DIGITS
60
+
61
+ Re-exports [CODE_CHARSET_DIGITS](../constants/variables/CODE_CHARSET_DIGITS.md)
62
+
63
+ ***
64
+
65
+ ### CODE\_DEFAULT\_LENGTH
48
66
 
49
- Re-exports [BaseChainAdapter](../adapters/base/classes/BaseChainAdapter.md)
67
+ Re-exports [CODE_DEFAULT_LENGTH](../constants/variables/CODE_DEFAULT_LENGTH.md)
50
68
 
51
69
  ***
52
70
 
53
- ### CODE\_LENGTH
71
+ ### CODE\_MAX\_LENGTH
54
72
 
55
- Re-exports [CODE_LENGTH](../constants/variables/CODE_LENGTH.md)
73
+ Re-exports [CODE_MAX_LENGTH](../constants/variables/CODE_MAX_LENGTH.md)
56
74
 
57
75
  ***
58
76
 
59
- ### CODE\_TTL
77
+ ### CODE\_MIN\_LENGTH
60
78
 
61
- Re-exports [CODE_TTL](../constants/variables/CODE_TTL.md)
79
+ Re-exports [CODE_MIN_LENGTH](../constants/variables/CODE_MIN_LENGTH.md)
62
80
 
63
81
  ***
64
82
 
65
- ### CodeGenerator
83
+ ### CodeGenerationConfig
66
84
 
67
- Re-exports [CodeGenerator](../codegen/classes/CodeGenerator.md)
85
+ Re-exports [CodeGenerationConfig](../types/interfaces/CodeGenerationConfig.md)
68
86
 
69
87
  ***
70
88
 
71
- ### MAX\_PREFIX\_LENGTH
89
+ ### CodeGenerationResult
72
90
 
73
- Re-exports [MAX_PREFIX_LENGTH](../constants/variables/MAX_PREFIX_LENGTH.md)
91
+ Re-exports [CodeGenerationResult](../types/interfaces/CodeGenerationResult.md)
74
92
 
75
93
  ***
76
94
 
77
- ### MIN\_PREFIX\_LENGTH
95
+ ### codeHash
78
96
 
79
- Re-exports [MIN_PREFIX_LENGTH](../constants/variables/MIN_PREFIX_LENGTH.md)
97
+ Re-exports [codeHash](../utils/crypto/functions/codeHash.md)
80
98
 
81
99
  ***
82
100
 
83
- ### PROTOCOL\_CODE\_PREFIX
101
+ ### digestToDigits
84
102
 
85
- Re-exports [PROTOCOL_CODE_PREFIX](../constants/variables/PROTOCOL_CODE_PREFIX.md)
103
+ Re-exports [digestToDigits](../utils/crypto/functions/digestToDigits.md)
86
104
 
87
105
  ***
88
106
 
89
- ### PROTOCOL\_PREFIX
107
+ ### generateRandomSecret
90
108
 
91
- Re-exports [PROTOCOL_PREFIX](../constants/variables/PROTOCOL_PREFIX.md)
109
+ Re-exports [generateRandomSecret](../utils/crypto/functions/generateRandomSecret.md)
92
110
 
93
111
  ***
94
112
 
95
- ### PROTOCOL\_VERSION
113
+ ### hkdfSha256
96
114
 
97
- Re-exports [PROTOCOL_VERSION](../constants/variables/PROTOCOL_VERSION.md)
115
+ Re-exports [hkdfSha256](../utils/crypto/functions/hkdfSha256.md)
98
116
 
99
117
  ***
100
118
 
101
- ### ProtocolConfig
119
+ ### hmacSha256
102
120
 
103
- Re-exports [ProtocolConfig](../protocol/interfaces/ProtocolConfig.md)
121
+ Re-exports [hmacSha256](../utils/crypto/functions/hmacSha256.md)
104
122
 
105
123
  ***
106
124
 
107
- ### ProtocolMetaParser
125
+ ### PROTOCOL\_META\_MAX\_BYTES
108
126
 
109
- Re-exports [ProtocolMetaParser](../meta/classes/ProtocolMetaParser.md)
127
+ Re-exports [PROTOCOL_META_MAX_BYTES](../constants/variables/PROTOCOL_META_MAX_BYTES.md)
110
128
 
111
129
  ***
112
130
 
113
- ### ProtocolMetaV1
131
+ ### PROTOCOL\_NORMALIZATION
114
132
 
115
- Re-exports [ProtocolMetaV1](../meta/interfaces/ProtocolMetaV1.md)
133
+ Re-exports [PROTOCOL_NORMALIZATION](../constants/variables/PROTOCOL_NORMALIZATION.md)
134
+
135
+ ***
136
+
137
+ ### serializeCanonical
138
+
139
+ Re-exports [serializeCanonical](../utils/canonical/functions/serializeCanonical.md)
140
+
141
+ ***
142
+
143
+ ### sha256
144
+
145
+ Re-exports [sha256](../utils/crypto/functions/sha256.md)
116
146
 
117
147
  ***
118
148
 
119
149
  ### SolanaAdapter
120
150
 
121
- Re-exports [SolanaAdapter](../adapters/solana/solana/classes/SolanaAdapter.md)
151
+ Re-exports [SolanaAdapter](../adapters/SolanaAdapter/classes/SolanaAdapter.md)
152
+
153
+ ***
154
+
155
+ ### SolanaContext
156
+
157
+ Re-exports [SolanaContext](../adapters/SolanaAdapter/type-aliases/SolanaContext.md)
122
158
 
123
159
  ***
124
160
 
125
161
  ### SolanaTransaction
126
162
 
127
- Re-exports [SolanaTransaction](../adapters/solana/solana/type-aliases/SolanaTransaction.md)
163
+ Re-exports [SolanaTransaction](../adapters/SolanaAdapter/type-aliases/SolanaTransaction.md)
128
164
 
129
165
  ***
130
166
 
@@ -134,6 +170,12 @@ Re-exports [SUPPORTED_CHAINS](../constants/variables/SUPPORTED_CHAINS.md)
134
170
 
135
171
  ***
136
172
 
137
- ### SupportedChain
173
+ ### truncateBits
174
+
175
+ Re-exports [truncateBits](../utils/crypto/functions/truncateBits.md)
176
+
177
+ ***
178
+
179
+ ### WalletStrategy
138
180
 
139
- Re-exports [SupportedChain](../constants/type-aliases/SupportedChain.md)
181
+ Re-exports [WalletStrategy](../strategy/WalletStrategy/classes/WalletStrategy.md)
package/docs/modules.md CHANGED
@@ -1,17 +1,20 @@
1
- [**@actioncodes/protocol**](README.md)
1
+ [**@actioncodes/protocol-v2**](README.md)
2
2
 
3
3
  ***
4
4
 
5
- # @actioncodes/protocol
5
+ # @actioncodes/protocol-v2
6
6
 
7
7
  ## Modules
8
8
 
9
- - [actioncode](actioncode/README.md)
10
- - [adapters/base](adapters/base/README.md)
11
- - [adapters/solana](adapters/solana/README.md)
12
- - [adapters/solana/solana](adapters/solana/solana/README.md)
13
- - [codegen](codegen/README.md)
9
+ - [ActionCodesProtocol](ActionCodesProtocol/README.md)
10
+ - [adapters/BaseChainAdapter](adapters/BaseChainAdapter/README.md)
11
+ - [adapters/NodeCryptoAdapter](adapters/NodeCryptoAdapter/README.md)
12
+ - [adapters/SolanaAdapter](adapters/SolanaAdapter/README.md)
14
13
  - [constants](constants/README.md)
14
+ - [errors](errors/README.md)
15
15
  - [index](index/README.md)
16
- - [meta](meta/README.md)
17
- - [protocol](protocol/README.md)
16
+ - [strategy/WalletStrategy](strategy/WalletStrategy/README.md)
17
+ - [types](types/README.md)
18
+ - [utils/canonical](utils/canonical/README.md)
19
+ - [utils/crypto](utils/crypto/README.md)
20
+ - [utils/protocolMeta](utils/protocolMeta/README.md)
@@ -0,0 +1,11 @@
1
+ [**@actioncodes/protocol-v2**](../../README.md)
2
+
3
+ ***
4
+
5
+ [@actioncodes/protocol-v2](../../modules.md) / strategy/WalletStrategy
6
+
7
+ # strategy/WalletStrategy
8
+
9
+ ## Classes
10
+
11
+ - [WalletStrategy](classes/WalletStrategy.md)
@@ -0,0 +1,67 @@
1
+ [**@actioncodes/protocol-v2**](../../../README.md)
2
+
3
+ ***
4
+
5
+ [@actioncodes/protocol-v2](../../../modules.md) / [strategy/WalletStrategy](../README.md) / WalletStrategy
6
+
7
+ # Class: WalletStrategy
8
+
9
+ Defined in: src/strategy/WalletStrategy.ts:11
10
+
11
+ ## Constructors
12
+
13
+ ### Constructor
14
+
15
+ > **new WalletStrategy**(): `WalletStrategy`
16
+
17
+ #### Returns
18
+
19
+ `WalletStrategy`
20
+
21
+ ## Methods
22
+
23
+ ### generateCode()
24
+
25
+ > `static` **generateCode**(`pubkey`, `config`, `providedSecret?`): [`CodeGenerationResult`](../../../types/interfaces/CodeGenerationResult.md)
26
+
27
+ Defined in: src/strategy/WalletStrategy.ts:12
28
+
29
+ #### Parameters
30
+
31
+ ##### pubkey
32
+
33
+ `string`
34
+
35
+ ##### config
36
+
37
+ [`CodeGenerationConfig`](../../../types/interfaces/CodeGenerationConfig.md)
38
+
39
+ ##### providedSecret?
40
+
41
+ `string`
42
+
43
+ #### Returns
44
+
45
+ [`CodeGenerationResult`](../../../types/interfaces/CodeGenerationResult.md)
46
+
47
+ ***
48
+
49
+ ### validateCode()
50
+
51
+ > `static` **validateCode**(`actionCode`, `config`): `void`
52
+
53
+ Defined in: src/strategy/WalletStrategy.ts:48
54
+
55
+ #### Parameters
56
+
57
+ ##### actionCode
58
+
59
+ [`ActionCode`](../../../types/interfaces/ActionCode.md)
60
+
61
+ ##### config
62
+
63
+ [`CodeGenerationConfig`](../../../types/interfaces/CodeGenerationConfig.md)
64
+
65
+ #### Returns
66
+
67
+ `void`
@@ -0,0 +1,14 @@
1
+ [**@actioncodes/protocol-v2**](../README.md)
2
+
3
+ ***
4
+
5
+ [@actioncodes/protocol-v2](../modules.md) / types
6
+
7
+ # types
8
+
9
+ ## Interfaces
10
+
11
+ - [ActionCode](interfaces/ActionCode.md)
12
+ - [CanonicalMessageParts](interfaces/CanonicalMessageParts.md)
13
+ - [CodeGenerationConfig](interfaces/CodeGenerationConfig.md)
14
+ - [CodeGenerationResult](interfaces/CodeGenerationResult.md)
@@ -0,0 +1,65 @@
1
+ [**@actioncodes/protocol-v2**](../../README.md)
2
+
3
+ ***
4
+
5
+ [@actioncodes/protocol-v2](../../modules.md) / [types](../README.md) / ActionCode
6
+
7
+ # Interface: ActionCode
8
+
9
+ Defined in: src/types.ts:1
10
+
11
+ ## Properties
12
+
13
+ ### code
14
+
15
+ > **code**: `string`
16
+
17
+ Defined in: src/types.ts:2
18
+
19
+ ***
20
+
21
+ ### expiresAt
22
+
23
+ > **expiresAt**: `number`
24
+
25
+ Defined in: src/types.ts:5
26
+
27
+ ***
28
+
29
+ ### pubkey
30
+
31
+ > **pubkey**: `string`
32
+
33
+ Defined in: src/types.ts:3
34
+
35
+ ***
36
+
37
+ ### secret?
38
+
39
+ > `optional` **secret**: `string`
40
+
41
+ Defined in: src/types.ts:9
42
+
43
+ ***
44
+
45
+ ### secretHint?
46
+
47
+ > `optional` **secretHint**: `string`
48
+
49
+ Defined in: src/types.ts:7
50
+
51
+ ***
52
+
53
+ ### signature?
54
+
55
+ > `optional` **signature**: `string`
56
+
57
+ Defined in: src/types.ts:6
58
+
59
+ ***
60
+
61
+ ### timestamp
62
+
63
+ > **timestamp**: `number`
64
+
65
+ Defined in: src/types.ts:4
@@ -0,0 +1,33 @@
1
+ [**@actioncodes/protocol-v2**](../../README.md)
2
+
3
+ ***
4
+
5
+ [@actioncodes/protocol-v2](../../modules.md) / [types](../README.md) / CanonicalMessageParts
6
+
7
+ # Interface: CanonicalMessageParts
8
+
9
+ Defined in: src/types.ts:12
10
+
11
+ ## Properties
12
+
13
+ ### pubkey
14
+
15
+ > **pubkey**: `string`
16
+
17
+ Defined in: src/types.ts:13
18
+
19
+ ***
20
+
21
+ ### secret?
22
+
23
+ > `optional` **secret**: `string`
24
+
25
+ Defined in: src/types.ts:16
26
+
27
+ ***
28
+
29
+ ### windowStart
30
+
31
+ > **windowStart**: `number`
32
+
33
+ Defined in: src/types.ts:14
@@ -0,0 +1,33 @@
1
+ [**@actioncodes/protocol-v2**](../../README.md)
2
+
3
+ ***
4
+
5
+ [@actioncodes/protocol-v2](../../modules.md) / [types](../README.md) / CodeGenerationConfig
6
+
7
+ # Interface: CodeGenerationConfig
8
+
9
+ Defined in: src/types.ts:19
10
+
11
+ ## Properties
12
+
13
+ ### clockSkewMs?
14
+
15
+ > `optional` **clockSkewMs**: `number`
16
+
17
+ Defined in: src/types.ts:22
18
+
19
+ ***
20
+
21
+ ### codeLength
22
+
23
+ > **codeLength**: `number`
24
+
25
+ Defined in: src/types.ts:20
26
+
27
+ ***
28
+
29
+ ### ttlMs
30
+
31
+ > **ttlMs**: `number`
32
+
33
+ Defined in: src/types.ts:21
@@ -0,0 +1,25 @@
1
+ [**@actioncodes/protocol-v2**](../../README.md)
2
+
3
+ ***
4
+
5
+ [@actioncodes/protocol-v2](../../modules.md) / [types](../README.md) / CodeGenerationResult
6
+
7
+ # Interface: CodeGenerationResult
8
+
9
+ Defined in: src/types.ts:25
10
+
11
+ ## Properties
12
+
13
+ ### actionCode
14
+
15
+ > **actionCode**: [`ActionCode`](ActionCode.md)
16
+
17
+ Defined in: src/types.ts:26
18
+
19
+ ***
20
+
21
+ ### canonicalMessage
22
+
23
+ > **canonicalMessage**: `Uint8Array`
24
+
25
+ Defined in: src/types.ts:27
@@ -0,0 +1,16 @@
1
+ [**@actioncodes/protocol-v2**](../../README.md)
2
+
3
+ ***
4
+
5
+ [@actioncodes/protocol-v2](../../modules.md) / utils/canonical
6
+
7
+ # utils/canonical
8
+
9
+ ## Variables
10
+
11
+ - [CANONICAL\_MESSAGE\_PREFIX](variables/CANONICAL_MESSAGE_PREFIX.md)
12
+ - [CANONICAL\_MESSAGE\_VERSION](variables/CANONICAL_MESSAGE_VERSION.md)
13
+
14
+ ## Functions
15
+
16
+ - [serializeCanonical](functions/serializeCanonical.md)
@@ -0,0 +1,21 @@
1
+ [**@actioncodes/protocol-v2**](../../../README.md)
2
+
3
+ ***
4
+
5
+ [@actioncodes/protocol-v2](../../../modules.md) / [utils/canonical](../README.md) / serializeCanonical
6
+
7
+ # Function: serializeCanonical()
8
+
9
+ > **serializeCanonical**(`parts`): `Uint8Array`
10
+
11
+ Defined in: src/utils/canonical.ts:6
12
+
13
+ ## Parameters
14
+
15
+ ### parts
16
+
17
+ [`CanonicalMessageParts`](../../../types/interfaces/CanonicalMessageParts.md)
18
+
19
+ ## Returns
20
+
21
+ `Uint8Array`
@@ -0,0 +1,11 @@
1
+ [**@actioncodes/protocol-v2**](../../../README.md)
2
+
3
+ ***
4
+
5
+ [@actioncodes/protocol-v2](../../../modules.md) / [utils/canonical](../README.md) / CANONICAL\_MESSAGE\_PREFIX
6
+
7
+ # Variable: CANONICAL\_MESSAGE\_PREFIX
8
+
9
+ > `const` **CANONICAL\_MESSAGE\_PREFIX**: `"actioncodes"` = `"actioncodes"`
10
+
11
+ Defined in: src/utils/canonical.ts:4
@@ -0,0 +1,11 @@
1
+ [**@actioncodes/protocol-v2**](../../../README.md)
2
+
3
+ ***
4
+
5
+ [@actioncodes/protocol-v2](../../../modules.md) / [utils/canonical](../README.md) / CANONICAL\_MESSAGE\_VERSION
6
+
7
+ # Variable: CANONICAL\_MESSAGE\_VERSION
8
+
9
+ > `const` **CANONICAL\_MESSAGE\_VERSION**: `1` = `1`
10
+
11
+ Defined in: src/utils/canonical.ts:3