@actioncodes/protocol 2.0.22 → 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.
- package/README.md +239 -146
- package/docs/ActionCodesProtocol/README.md +2 -2
- package/docs/ActionCodesProtocol/classes/ActionCodesProtocol.md +183 -33
- package/docs/README.md +425 -8
- package/docs/adapters/BaseChainAdapter/README.md +3 -4
- package/docs/adapters/BaseChainAdapter/classes/BaseChainAdapter.md +87 -20
- package/docs/adapters/BaseChainAdapter/interfaces/ChainAdapter.md +68 -12
- package/docs/adapters/BaseChainAdapter/type-aliases/SignFn.md +25 -0
- package/docs/adapters/SolanaAdapter/README.md +6 -3
- package/docs/adapters/SolanaAdapter/classes/SolanaAdapter.md +140 -43
- package/docs/adapters/SolanaAdapter/type-aliases/SolanaTransaction.md +3 -3
- package/docs/adapters/SolanaAdapter/variables/ADAPTER_CHAIN_NAME.md +11 -0
- package/docs/constants/README.md +2 -2
- package/docs/constants/variables/CODE_CHARSET_DIGITS.md +2 -2
- package/docs/constants/variables/CODE_DEFAULT_LENGTH.md +2 -2
- package/docs/constants/variables/CODE_MAX_LENGTH.md +2 -2
- package/docs/constants/variables/CODE_MIN_LENGTH.md +2 -2
- package/docs/constants/variables/PROTOCOL_META_MAX_BYTES.md +3 -3
- package/docs/constants/variables/PROTOCOL_NORMALIZATION.md +2 -2
- package/docs/constants/variables/SUPPORTED_CHAINS.md +9 -3
- package/docs/errors/README.md +4 -2
- package/docs/errors/classes/ExpiredCodeError.md +85 -21
- package/docs/errors/classes/InvalidAdapterError.md +751 -0
- package/docs/errors/classes/InvalidCodeFormatError.md +85 -21
- package/docs/errors/classes/InvalidPubkeyFormatError.md +85 -21
- package/docs/errors/classes/InvalidSignatureError.md +85 -21
- package/docs/errors/classes/MetaMismatchError.md +85 -21
- package/docs/errors/classes/MissingMetaError.md +85 -21
- package/docs/errors/classes/ProtocolError.md +75 -21
- package/docs/errors/classes/TransactionNotSignedByIntendedOwnerError.md +85 -21
- package/docs/errors/classes/TransactionNotSignedByIssuerError.md +755 -0
- package/docs/errors/enumerations/ProtocolErrorCode.md +39 -15
- package/docs/index/README.md +170 -14
- package/docs/modules.md +3 -3
- package/docs/strategy/DelegationStrategy/README.md +11 -0
- package/docs/strategy/DelegationStrategy/classes/DelegationStrategy.md +79 -0
- package/docs/strategy/WalletStrategy/README.md +2 -2
- package/docs/strategy/WalletStrategy/classes/WalletStrategy.md +22 -18
- package/docs/types/README.md +11 -3
- package/docs/types/interfaces/ActionCode.md +23 -26
- package/docs/types/interfaces/ActionCodeRevoke.md +93 -0
- package/docs/types/interfaces/CanonicalMessageParts.md +5 -13
- package/docs/types/interfaces/CanonicalRevokeMessageParts.md +33 -0
- package/docs/types/interfaces/CodeGenerationConfig.md +6 -6
- package/docs/types/interfaces/DelegatedActionCode.md +97 -0
- package/docs/types/interfaces/DelegatedActionCodeRevoke.md +105 -0
- package/docs/types/interfaces/DelegationProof.md +49 -0
- package/docs/types/type-aliases/Chain.md +11 -0
- package/docs/utils/canonical/README.md +6 -2
- package/docs/utils/canonical/functions/getCanonicalMessageParts.md +21 -0
- package/docs/utils/canonical/functions/serializeCanonical.md +3 -3
- package/docs/utils/canonical/functions/serializeCanonicalRevoke.md +21 -0
- package/docs/utils/canonical/functions/serializeDelegationProof.md +21 -0
- package/docs/utils/canonical/variables/CANONICAL_MESSAGE_PREFIX.md +3 -3
- package/docs/utils/canonical/variables/CANONICAL_MESSAGE_VERSION.md +3 -3
- package/docs/utils/canonical/variables/CANONICAL_REVOKE_MESSAGE_PREFIX.md +11 -0
- package/docs/utils/crypto/README.md +2 -3
- package/docs/utils/crypto/functions/base32EncodeCrockford.md +2 -2
- package/docs/utils/crypto/functions/codeHash.md +2 -2
- package/docs/utils/crypto/functions/digestToDigits.md +2 -2
- package/docs/utils/crypto/functions/hkdfSha256.md +2 -2
- package/docs/utils/crypto/functions/hmacSha256.md +2 -2
- package/docs/utils/crypto/functions/sha256.md +2 -2
- package/docs/utils/crypto/functions/truncateBits.md +2 -2
- package/docs/utils/protocolMeta/README.md +2 -2
- package/docs/utils/protocolMeta/functions/buildProtocolMeta.md +3 -3
- package/docs/utils/protocolMeta/functions/parseProtocolMeta.md +3 -3
- package/docs/utils/protocolMeta/functions/validateProtocolMetaFormat.md +3 -3
- package/docs/utils/protocolMeta/interfaces/ProtocolMetaFields.md +11 -3
- package/docs/utils/protocolMeta/variables/SCHEME.md +3 -3
- package/package.json +7 -7
- package/docs/adapters/BaseChainAdapter/interfaces/BaseContext.md +0 -17
- package/docs/adapters/BaseChainAdapter/type-aliases/ChainContext.md +0 -23
- package/docs/adapters/NodeCryptoAdapter/README.md +0 -15
- package/docs/adapters/NodeCryptoAdapter/classes/NodeCryptoAdapter.md +0 -254
- package/docs/adapters/NodeCryptoAdapter/type-aliases/NodeCryptoContext.md +0 -27
- package/docs/adapters/SolanaAdapter/type-aliases/SolanaContext.md +0 -27
- package/docs/types/interfaces/CodeGenerationResult.md +0 -25
- package/docs/utils/crypto/functions/generateRandomSecret.md +0 -15
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
[**@actioncodes/protocol
|
|
1
|
+
[**@actioncodes/protocol**](../../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
|
-
[@actioncodes/protocol
|
|
5
|
+
[@actioncodes/protocol](../../modules.md) / [errors](../README.md) / ProtocolErrorCode
|
|
6
6
|
|
|
7
7
|
# Enumeration: ProtocolErrorCode
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@ Defined in: src/errors.ts:1
|
|
|
14
14
|
|
|
15
15
|
> **CRYPTO\_ERROR**: `"CRYPTO_ERROR"`
|
|
16
16
|
|
|
17
|
-
Defined in: src/errors.ts:
|
|
17
|
+
Defined in: src/errors.ts:25
|
|
18
18
|
|
|
19
19
|
***
|
|
20
20
|
|
|
@@ -26,11 +26,27 @@ Defined in: src/errors.ts:3
|
|
|
26
26
|
|
|
27
27
|
***
|
|
28
28
|
|
|
29
|
+
### INVALID\_ADAPTER
|
|
30
|
+
|
|
31
|
+
> **INVALID\_ADAPTER**: `"INVALID_ADAPTER"`
|
|
32
|
+
|
|
33
|
+
Defined in: src/errors.ts:29
|
|
34
|
+
|
|
35
|
+
***
|
|
36
|
+
|
|
37
|
+
### INVALID\_CODE
|
|
38
|
+
|
|
39
|
+
> **INVALID\_CODE**: `"INVALID_CODE"`
|
|
40
|
+
|
|
41
|
+
Defined in: src/errors.ts:4
|
|
42
|
+
|
|
43
|
+
***
|
|
44
|
+
|
|
29
45
|
### INVALID\_CODE\_FORMAT
|
|
30
46
|
|
|
31
47
|
> **INVALID\_CODE\_FORMAT**: `"INVALID_CODE_FORMAT"`
|
|
32
48
|
|
|
33
|
-
Defined in: src/errors.ts:
|
|
49
|
+
Defined in: src/errors.ts:5
|
|
34
50
|
|
|
35
51
|
***
|
|
36
52
|
|
|
@@ -38,7 +54,7 @@ Defined in: src/errors.ts:4
|
|
|
38
54
|
|
|
39
55
|
> **INVALID\_DIGEST**: `"INVALID_DIGEST"`
|
|
40
56
|
|
|
41
|
-
Defined in: src/errors.ts:
|
|
57
|
+
Defined in: src/errors.ts:26
|
|
42
58
|
|
|
43
59
|
***
|
|
44
60
|
|
|
@@ -46,7 +62,7 @@ Defined in: src/errors.ts:24
|
|
|
46
62
|
|
|
47
63
|
> **INVALID\_INPUT**: `"INVALID_INPUT"`
|
|
48
64
|
|
|
49
|
-
Defined in: src/errors.ts:
|
|
65
|
+
Defined in: src/errors.ts:21
|
|
50
66
|
|
|
51
67
|
***
|
|
52
68
|
|
|
@@ -54,7 +70,7 @@ Defined in: src/errors.ts:19
|
|
|
54
70
|
|
|
55
71
|
> **INVALID\_META\_FORMAT**: `"INVALID_META_FORMAT"`
|
|
56
72
|
|
|
57
|
-
Defined in: src/errors.ts:
|
|
73
|
+
Defined in: src/errors.ts:10
|
|
58
74
|
|
|
59
75
|
***
|
|
60
76
|
|
|
@@ -62,7 +78,7 @@ Defined in: src/errors.ts:9
|
|
|
62
78
|
|
|
63
79
|
> **INVALID\_PUBKEY\_FORMAT**: `"INVALID_PUBKEY_FORMAT"`
|
|
64
80
|
|
|
65
|
-
Defined in: src/errors.ts:
|
|
81
|
+
Defined in: src/errors.ts:18
|
|
66
82
|
|
|
67
83
|
***
|
|
68
84
|
|
|
@@ -70,7 +86,7 @@ Defined in: src/errors.ts:16
|
|
|
70
86
|
|
|
71
87
|
> **INVALID\_SIGNATURE**: `"INVALID_SIGNATURE"`
|
|
72
88
|
|
|
73
|
-
Defined in: src/errors.ts:
|
|
89
|
+
Defined in: src/errors.ts:6
|
|
74
90
|
|
|
75
91
|
***
|
|
76
92
|
|
|
@@ -78,7 +94,7 @@ Defined in: src/errors.ts:5
|
|
|
78
94
|
|
|
79
95
|
> **INVALID\_TRANSACTION\_FORMAT**: `"INVALID_TRANSACTION_FORMAT"`
|
|
80
96
|
|
|
81
|
-
Defined in: src/errors.ts:
|
|
97
|
+
Defined in: src/errors.ts:17
|
|
82
98
|
|
|
83
99
|
***
|
|
84
100
|
|
|
@@ -86,7 +102,7 @@ Defined in: src/errors.ts:15
|
|
|
86
102
|
|
|
87
103
|
> **META\_MISMATCH**: `"META_MISMATCH"`
|
|
88
104
|
|
|
89
|
-
Defined in: src/errors.ts:
|
|
105
|
+
Defined in: src/errors.ts:11
|
|
90
106
|
|
|
91
107
|
***
|
|
92
108
|
|
|
@@ -94,7 +110,7 @@ Defined in: src/errors.ts:10
|
|
|
94
110
|
|
|
95
111
|
> **META\_TOO\_LARGE**: `"META_TOO_LARGE"`
|
|
96
112
|
|
|
97
|
-
Defined in: src/errors.ts:
|
|
113
|
+
Defined in: src/errors.ts:12
|
|
98
114
|
|
|
99
115
|
***
|
|
100
116
|
|
|
@@ -102,7 +118,7 @@ Defined in: src/errors.ts:11
|
|
|
102
118
|
|
|
103
119
|
> **MISSING\_META**: `"MISSING_META"`
|
|
104
120
|
|
|
105
|
-
Defined in: src/errors.ts:
|
|
121
|
+
Defined in: src/errors.ts:9
|
|
106
122
|
|
|
107
123
|
***
|
|
108
124
|
|
|
@@ -110,7 +126,7 @@ Defined in: src/errors.ts:8
|
|
|
110
126
|
|
|
111
127
|
> **MISSING\_REQUIRED\_FIELD**: `"MISSING_REQUIRED_FIELD"`
|
|
112
128
|
|
|
113
|
-
Defined in: src/errors.ts:
|
|
129
|
+
Defined in: src/errors.ts:22
|
|
114
130
|
|
|
115
131
|
***
|
|
116
132
|
|
|
@@ -118,4 +134,12 @@ Defined in: src/errors.ts:20
|
|
|
118
134
|
|
|
119
135
|
> **TRANSACTION\_NOT\_SIGNED\_BY\_INTENDED\_OWNER**: `"TRANSACTION_NOT_SIGNED_BY_INTENDED_OWNER"`
|
|
120
136
|
|
|
121
|
-
Defined in: src/errors.ts:
|
|
137
|
+
Defined in: src/errors.ts:15
|
|
138
|
+
|
|
139
|
+
***
|
|
140
|
+
|
|
141
|
+
### TRANSACTION\_NOT\_SIGNED\_BY\_ISSUER
|
|
142
|
+
|
|
143
|
+
> **TRANSACTION\_NOT\_SIGNED\_BY\_ISSUER**: `"TRANSACTION_NOT_SIGNED_BY_ISSUER"`
|
|
144
|
+
|
|
145
|
+
Defined in: src/errors.ts:16
|
package/docs/index/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
[**@actioncodes/protocol
|
|
1
|
+
[**@actioncodes/protocol**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
|
-
[@actioncodes/protocol
|
|
5
|
+
[@actioncodes/protocol](../modules.md) / index
|
|
6
6
|
|
|
7
7
|
# index
|
|
8
8
|
|
|
@@ -14,12 +14,24 @@ Re-exports [ActionCode](../types/interfaces/ActionCode.md)
|
|
|
14
14
|
|
|
15
15
|
***
|
|
16
16
|
|
|
17
|
+
### ActionCodeRevoke
|
|
18
|
+
|
|
19
|
+
Re-exports [ActionCodeRevoke](../types/interfaces/ActionCodeRevoke.md)
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
17
23
|
### ActionCodesProtocol
|
|
18
24
|
|
|
19
25
|
Re-exports [ActionCodesProtocol](../ActionCodesProtocol/classes/ActionCodesProtocol.md)
|
|
20
26
|
|
|
21
27
|
***
|
|
22
28
|
|
|
29
|
+
### ADAPTER\_CHAIN\_NAME
|
|
30
|
+
|
|
31
|
+
Re-exports [ADAPTER_CHAIN_NAME](../adapters/SolanaAdapter/variables/ADAPTER_CHAIN_NAME.md)
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
23
35
|
### base32EncodeCrockford
|
|
24
36
|
|
|
25
37
|
Re-exports [base32EncodeCrockford](../utils/crypto/functions/base32EncodeCrockford.md)
|
|
@@ -32,6 +44,12 @@ Re-exports [BaseChainAdapter](../adapters/BaseChainAdapter/classes/BaseChainAdap
|
|
|
32
44
|
|
|
33
45
|
***
|
|
34
46
|
|
|
47
|
+
### buildProtocolMeta
|
|
48
|
+
|
|
49
|
+
Re-exports [buildProtocolMeta](../utils/protocolMeta/functions/buildProtocolMeta.md)
|
|
50
|
+
|
|
51
|
+
***
|
|
52
|
+
|
|
35
53
|
### CANONICAL\_MESSAGE\_PREFIX
|
|
36
54
|
|
|
37
55
|
Re-exports [CANONICAL_MESSAGE_PREFIX](../utils/canonical/variables/CANONICAL_MESSAGE_PREFIX.md)
|
|
@@ -44,15 +62,33 @@ Re-exports [CANONICAL_MESSAGE_VERSION](../utils/canonical/variables/CANONICAL_ME
|
|
|
44
62
|
|
|
45
63
|
***
|
|
46
64
|
|
|
65
|
+
### CANONICAL\_REVOKE\_MESSAGE\_PREFIX
|
|
66
|
+
|
|
67
|
+
Re-exports [CANONICAL_REVOKE_MESSAGE_PREFIX](../utils/canonical/variables/CANONICAL_REVOKE_MESSAGE_PREFIX.md)
|
|
68
|
+
|
|
69
|
+
***
|
|
70
|
+
|
|
47
71
|
### CanonicalMessageParts
|
|
48
72
|
|
|
49
73
|
Re-exports [CanonicalMessageParts](../types/interfaces/CanonicalMessageParts.md)
|
|
50
74
|
|
|
51
75
|
***
|
|
52
76
|
|
|
53
|
-
###
|
|
77
|
+
### CanonicalRevokeMessageParts
|
|
78
|
+
|
|
79
|
+
Re-exports [CanonicalRevokeMessageParts](../types/interfaces/CanonicalRevokeMessageParts.md)
|
|
80
|
+
|
|
81
|
+
***
|
|
82
|
+
|
|
83
|
+
### Chain
|
|
84
|
+
|
|
85
|
+
Re-exports [Chain](../types/type-aliases/Chain.md)
|
|
86
|
+
|
|
87
|
+
***
|
|
88
|
+
|
|
89
|
+
### ChainAdapter
|
|
54
90
|
|
|
55
|
-
Re-exports [
|
|
91
|
+
Re-exports [ChainAdapter](../adapters/BaseChainAdapter/interfaces/ChainAdapter.md)
|
|
56
92
|
|
|
57
93
|
***
|
|
58
94
|
|
|
@@ -86,15 +122,33 @@ Re-exports [CodeGenerationConfig](../types/interfaces/CodeGenerationConfig.md)
|
|
|
86
122
|
|
|
87
123
|
***
|
|
88
124
|
|
|
89
|
-
###
|
|
125
|
+
### codeHash
|
|
90
126
|
|
|
91
|
-
Re-exports [
|
|
127
|
+
Re-exports [codeHash](../utils/crypto/functions/codeHash.md)
|
|
92
128
|
|
|
93
129
|
***
|
|
94
130
|
|
|
95
|
-
###
|
|
131
|
+
### DelegatedActionCode
|
|
96
132
|
|
|
97
|
-
Re-exports [
|
|
133
|
+
Re-exports [DelegatedActionCode](../types/interfaces/DelegatedActionCode.md)
|
|
134
|
+
|
|
135
|
+
***
|
|
136
|
+
|
|
137
|
+
### DelegatedActionCodeRevoke
|
|
138
|
+
|
|
139
|
+
Re-exports [DelegatedActionCodeRevoke](../types/interfaces/DelegatedActionCodeRevoke.md)
|
|
140
|
+
|
|
141
|
+
***
|
|
142
|
+
|
|
143
|
+
### DelegationProof
|
|
144
|
+
|
|
145
|
+
Re-exports [DelegationProof](../types/interfaces/DelegationProof.md)
|
|
146
|
+
|
|
147
|
+
***
|
|
148
|
+
|
|
149
|
+
### DelegationStrategy
|
|
150
|
+
|
|
151
|
+
Re-exports [DelegationStrategy](../strategy/DelegationStrategy/classes/DelegationStrategy.md)
|
|
98
152
|
|
|
99
153
|
***
|
|
100
154
|
|
|
@@ -104,9 +158,15 @@ Re-exports [digestToDigits](../utils/crypto/functions/digestToDigits.md)
|
|
|
104
158
|
|
|
105
159
|
***
|
|
106
160
|
|
|
107
|
-
###
|
|
161
|
+
### ExpiredCodeError
|
|
162
|
+
|
|
163
|
+
Re-exports [ExpiredCodeError](../errors/classes/ExpiredCodeError.md)
|
|
164
|
+
|
|
165
|
+
***
|
|
166
|
+
|
|
167
|
+
### getCanonicalMessageParts
|
|
108
168
|
|
|
109
|
-
Re-exports [
|
|
169
|
+
Re-exports [getCanonicalMessageParts](../utils/canonical/functions/getCanonicalMessageParts.md)
|
|
110
170
|
|
|
111
171
|
***
|
|
112
172
|
|
|
@@ -122,6 +182,48 @@ Re-exports [hmacSha256](../utils/crypto/functions/hmacSha256.md)
|
|
|
122
182
|
|
|
123
183
|
***
|
|
124
184
|
|
|
185
|
+
### InvalidAdapterError
|
|
186
|
+
|
|
187
|
+
Re-exports [InvalidAdapterError](../errors/classes/InvalidAdapterError.md)
|
|
188
|
+
|
|
189
|
+
***
|
|
190
|
+
|
|
191
|
+
### InvalidCodeFormatError
|
|
192
|
+
|
|
193
|
+
Re-exports [InvalidCodeFormatError](../errors/classes/InvalidCodeFormatError.md)
|
|
194
|
+
|
|
195
|
+
***
|
|
196
|
+
|
|
197
|
+
### InvalidPubkeyFormatError
|
|
198
|
+
|
|
199
|
+
Re-exports [InvalidPubkeyFormatError](../errors/classes/InvalidPubkeyFormatError.md)
|
|
200
|
+
|
|
201
|
+
***
|
|
202
|
+
|
|
203
|
+
### InvalidSignatureError
|
|
204
|
+
|
|
205
|
+
Re-exports [InvalidSignatureError](../errors/classes/InvalidSignatureError.md)
|
|
206
|
+
|
|
207
|
+
***
|
|
208
|
+
|
|
209
|
+
### MetaMismatchError
|
|
210
|
+
|
|
211
|
+
Re-exports [MetaMismatchError](../errors/classes/MetaMismatchError.md)
|
|
212
|
+
|
|
213
|
+
***
|
|
214
|
+
|
|
215
|
+
### MissingMetaError
|
|
216
|
+
|
|
217
|
+
Re-exports [MissingMetaError](../errors/classes/MissingMetaError.md)
|
|
218
|
+
|
|
219
|
+
***
|
|
220
|
+
|
|
221
|
+
### parseProtocolMeta
|
|
222
|
+
|
|
223
|
+
Re-exports [parseProtocolMeta](../utils/protocolMeta/functions/parseProtocolMeta.md)
|
|
224
|
+
|
|
225
|
+
***
|
|
226
|
+
|
|
125
227
|
### PROTOCOL\_META\_MAX\_BYTES
|
|
126
228
|
|
|
127
229
|
Re-exports [PROTOCOL_META_MAX_BYTES](../constants/variables/PROTOCOL_META_MAX_BYTES.md)
|
|
@@ -134,27 +236,63 @@ Re-exports [PROTOCOL_NORMALIZATION](../constants/variables/PROTOCOL_NORMALIZATIO
|
|
|
134
236
|
|
|
135
237
|
***
|
|
136
238
|
|
|
239
|
+
### ProtocolError
|
|
240
|
+
|
|
241
|
+
Re-exports [ProtocolError](../errors/classes/ProtocolError.md)
|
|
242
|
+
|
|
243
|
+
***
|
|
244
|
+
|
|
245
|
+
### ProtocolErrorCode
|
|
246
|
+
|
|
247
|
+
Re-exports [ProtocolErrorCode](../errors/enumerations/ProtocolErrorCode.md)
|
|
248
|
+
|
|
249
|
+
***
|
|
250
|
+
|
|
251
|
+
### ProtocolMetaFields
|
|
252
|
+
|
|
253
|
+
Re-exports [ProtocolMetaFields](../utils/protocolMeta/interfaces/ProtocolMetaFields.md)
|
|
254
|
+
|
|
255
|
+
***
|
|
256
|
+
|
|
257
|
+
### SCHEME
|
|
258
|
+
|
|
259
|
+
Re-exports [SCHEME](../utils/protocolMeta/variables/SCHEME.md)
|
|
260
|
+
|
|
261
|
+
***
|
|
262
|
+
|
|
137
263
|
### serializeCanonical
|
|
138
264
|
|
|
139
265
|
Re-exports [serializeCanonical](../utils/canonical/functions/serializeCanonical.md)
|
|
140
266
|
|
|
141
267
|
***
|
|
142
268
|
|
|
269
|
+
### serializeCanonicalRevoke
|
|
270
|
+
|
|
271
|
+
Re-exports [serializeCanonicalRevoke](../utils/canonical/functions/serializeCanonicalRevoke.md)
|
|
272
|
+
|
|
273
|
+
***
|
|
274
|
+
|
|
275
|
+
### serializeDelegationProof
|
|
276
|
+
|
|
277
|
+
Re-exports [serializeDelegationProof](../utils/canonical/functions/serializeDelegationProof.md)
|
|
278
|
+
|
|
279
|
+
***
|
|
280
|
+
|
|
143
281
|
### sha256
|
|
144
282
|
|
|
145
283
|
Re-exports [sha256](../utils/crypto/functions/sha256.md)
|
|
146
284
|
|
|
147
285
|
***
|
|
148
286
|
|
|
149
|
-
###
|
|
287
|
+
### SignFn
|
|
150
288
|
|
|
151
|
-
Re-exports [
|
|
289
|
+
Re-exports [SignFn](../adapters/BaseChainAdapter/type-aliases/SignFn.md)
|
|
152
290
|
|
|
153
291
|
***
|
|
154
292
|
|
|
155
|
-
###
|
|
293
|
+
### SolanaAdapter
|
|
156
294
|
|
|
157
|
-
Re-exports [
|
|
295
|
+
Re-exports [SolanaAdapter](../adapters/SolanaAdapter/classes/SolanaAdapter.md)
|
|
158
296
|
|
|
159
297
|
***
|
|
160
298
|
|
|
@@ -170,12 +308,30 @@ Re-exports [SUPPORTED_CHAINS](../constants/variables/SUPPORTED_CHAINS.md)
|
|
|
170
308
|
|
|
171
309
|
***
|
|
172
310
|
|
|
311
|
+
### TransactionNotSignedByIntendedOwnerError
|
|
312
|
+
|
|
313
|
+
Re-exports [TransactionNotSignedByIntendedOwnerError](../errors/classes/TransactionNotSignedByIntendedOwnerError.md)
|
|
314
|
+
|
|
315
|
+
***
|
|
316
|
+
|
|
317
|
+
### TransactionNotSignedByIssuerError
|
|
318
|
+
|
|
319
|
+
Re-exports [TransactionNotSignedByIssuerError](../errors/classes/TransactionNotSignedByIssuerError.md)
|
|
320
|
+
|
|
321
|
+
***
|
|
322
|
+
|
|
173
323
|
### truncateBits
|
|
174
324
|
|
|
175
325
|
Re-exports [truncateBits](../utils/crypto/functions/truncateBits.md)
|
|
176
326
|
|
|
177
327
|
***
|
|
178
328
|
|
|
329
|
+
### validateProtocolMetaFormat
|
|
330
|
+
|
|
331
|
+
Re-exports [validateProtocolMetaFormat](../utils/protocolMeta/functions/validateProtocolMetaFormat.md)
|
|
332
|
+
|
|
333
|
+
***
|
|
334
|
+
|
|
179
335
|
### WalletStrategy
|
|
180
336
|
|
|
181
337
|
Re-exports [WalletStrategy](../strategy/WalletStrategy/classes/WalletStrategy.md)
|
package/docs/modules.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
[**@actioncodes/protocol
|
|
1
|
+
[**@actioncodes/protocol**](README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
|
-
# @actioncodes/protocol
|
|
5
|
+
# @actioncodes/protocol
|
|
6
6
|
|
|
7
7
|
## Modules
|
|
8
8
|
|
|
9
9
|
- [ActionCodesProtocol](ActionCodesProtocol/README.md)
|
|
10
10
|
- [adapters/BaseChainAdapter](adapters/BaseChainAdapter/README.md)
|
|
11
|
-
- [adapters/NodeCryptoAdapter](adapters/NodeCryptoAdapter/README.md)
|
|
12
11
|
- [adapters/SolanaAdapter](adapters/SolanaAdapter/README.md)
|
|
13
12
|
- [constants](constants/README.md)
|
|
14
13
|
- [errors](errors/README.md)
|
|
15
14
|
- [index](index/README.md)
|
|
15
|
+
- [strategy/DelegationStrategy](strategy/DelegationStrategy/README.md)
|
|
16
16
|
- [strategy/WalletStrategy](strategy/WalletStrategy/README.md)
|
|
17
17
|
- [types](types/README.md)
|
|
18
18
|
- [utils/canonical](utils/canonical/README.md)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
[**@actioncodes/protocol**](../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@actioncodes/protocol](../../../modules.md) / [strategy/DelegationStrategy](../README.md) / DelegationStrategy
|
|
6
|
+
|
|
7
|
+
# Class: DelegationStrategy
|
|
8
|
+
|
|
9
|
+
Defined in: src/strategy/DelegationStrategy.ts:15
|
|
10
|
+
|
|
11
|
+
## Constructors
|
|
12
|
+
|
|
13
|
+
### Constructor
|
|
14
|
+
|
|
15
|
+
> **new DelegationStrategy**(`config`): `DelegationStrategy`
|
|
16
|
+
|
|
17
|
+
Defined in: src/strategy/DelegationStrategy.ts:19
|
|
18
|
+
|
|
19
|
+
#### Parameters
|
|
20
|
+
|
|
21
|
+
##### config
|
|
22
|
+
|
|
23
|
+
[`CodeGenerationConfig`](../../../types/interfaces/CodeGenerationConfig.md)
|
|
24
|
+
|
|
25
|
+
#### Returns
|
|
26
|
+
|
|
27
|
+
`DelegationStrategy`
|
|
28
|
+
|
|
29
|
+
## Methods
|
|
30
|
+
|
|
31
|
+
### generateDelegatedCode()
|
|
32
|
+
|
|
33
|
+
> **generateDelegatedCode**(`delegationProof`, `canonicalMessage`, `chain`, `signature`): [`DelegatedActionCode`](../../../types/interfaces/DelegatedActionCode.md)
|
|
34
|
+
|
|
35
|
+
Defined in: src/strategy/DelegationStrategy.ts:27
|
|
36
|
+
|
|
37
|
+
Generate a delegated action code using a delegation proof and signature over message to generate code via delegated keypair
|
|
38
|
+
|
|
39
|
+
#### Parameters
|
|
40
|
+
|
|
41
|
+
##### delegationProof
|
|
42
|
+
|
|
43
|
+
[`DelegationProof`](../../../types/interfaces/DelegationProof.md)
|
|
44
|
+
|
|
45
|
+
##### canonicalMessage
|
|
46
|
+
|
|
47
|
+
`Uint8Array`
|
|
48
|
+
|
|
49
|
+
##### chain
|
|
50
|
+
|
|
51
|
+
`"solana"`
|
|
52
|
+
|
|
53
|
+
##### signature
|
|
54
|
+
|
|
55
|
+
`string`
|
|
56
|
+
|
|
57
|
+
#### Returns
|
|
58
|
+
|
|
59
|
+
[`DelegatedActionCode`](../../../types/interfaces/DelegatedActionCode.md)
|
|
60
|
+
|
|
61
|
+
***
|
|
62
|
+
|
|
63
|
+
### validateDelegatedCode()
|
|
64
|
+
|
|
65
|
+
> **validateDelegatedCode**(`actionCode`): `void`
|
|
66
|
+
|
|
67
|
+
Defined in: src/strategy/DelegationStrategy.ts:56
|
|
68
|
+
|
|
69
|
+
Validate a delegated action code
|
|
70
|
+
|
|
71
|
+
#### Parameters
|
|
72
|
+
|
|
73
|
+
##### actionCode
|
|
74
|
+
|
|
75
|
+
[`DelegatedActionCode`](../../../types/interfaces/DelegatedActionCode.md)
|
|
76
|
+
|
|
77
|
+
#### Returns
|
|
78
|
+
|
|
79
|
+
`void`
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
[**@actioncodes/protocol
|
|
1
|
+
[**@actioncodes/protocol**](../../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
|
-
[@actioncodes/protocol
|
|
5
|
+
[@actioncodes/protocol](../../modules.md) / strategy/WalletStrategy
|
|
6
6
|
|
|
7
7
|
# strategy/WalletStrategy
|
|
8
8
|
|
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
[**@actioncodes/protocol
|
|
1
|
+
[**@actioncodes/protocol**](../../../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
|
-
[@actioncodes/protocol
|
|
5
|
+
[@actioncodes/protocol](../../../modules.md) / [strategy/WalletStrategy](../README.md) / WalletStrategy
|
|
6
6
|
|
|
7
7
|
# Class: WalletStrategy
|
|
8
8
|
|
|
9
|
-
Defined in: src/strategy/WalletStrategy.ts:
|
|
9
|
+
Defined in: src/strategy/WalletStrategy.ts:8
|
|
10
10
|
|
|
11
11
|
## Constructors
|
|
12
12
|
|
|
13
13
|
### Constructor
|
|
14
14
|
|
|
15
|
-
> **new WalletStrategy**(): `WalletStrategy`
|
|
15
|
+
> **new WalletStrategy**(`config`): `WalletStrategy`
|
|
16
|
+
|
|
17
|
+
Defined in: src/strategy/WalletStrategy.ts:9
|
|
18
|
+
|
|
19
|
+
#### Parameters
|
|
20
|
+
|
|
21
|
+
##### config
|
|
22
|
+
|
|
23
|
+
[`CodeGenerationConfig`](../../../types/interfaces/CodeGenerationConfig.md)
|
|
16
24
|
|
|
17
25
|
#### Returns
|
|
18
26
|
|
|
@@ -22,35 +30,35 @@ Defined in: src/strategy/WalletStrategy.ts:11
|
|
|
22
30
|
|
|
23
31
|
### generateCode()
|
|
24
32
|
|
|
25
|
-
>
|
|
33
|
+
> **generateCode**(`canonicalMessage`, `chain`, `signature`): [`ActionCode`](../../../types/interfaces/ActionCode.md)
|
|
26
34
|
|
|
27
|
-
Defined in: src/strategy/WalletStrategy.ts:
|
|
35
|
+
Defined in: src/strategy/WalletStrategy.ts:11
|
|
28
36
|
|
|
29
37
|
#### Parameters
|
|
30
38
|
|
|
31
|
-
#####
|
|
39
|
+
##### canonicalMessage
|
|
32
40
|
|
|
33
|
-
`
|
|
41
|
+
`Uint8Array`
|
|
34
42
|
|
|
35
|
-
#####
|
|
43
|
+
##### chain
|
|
36
44
|
|
|
37
|
-
|
|
45
|
+
`"solana"`
|
|
38
46
|
|
|
39
|
-
#####
|
|
47
|
+
##### signature
|
|
40
48
|
|
|
41
49
|
`string`
|
|
42
50
|
|
|
43
51
|
#### Returns
|
|
44
52
|
|
|
45
|
-
[`
|
|
53
|
+
[`ActionCode`](../../../types/interfaces/ActionCode.md)
|
|
46
54
|
|
|
47
55
|
***
|
|
48
56
|
|
|
49
57
|
### validateCode()
|
|
50
58
|
|
|
51
|
-
>
|
|
59
|
+
> **validateCode**(`actionCode`): `void`
|
|
52
60
|
|
|
53
|
-
Defined in: src/strategy/WalletStrategy.ts:
|
|
61
|
+
Defined in: src/strategy/WalletStrategy.ts:53
|
|
54
62
|
|
|
55
63
|
#### Parameters
|
|
56
64
|
|
|
@@ -58,10 +66,6 @@ Defined in: src/strategy/WalletStrategy.ts:48
|
|
|
58
66
|
|
|
59
67
|
[`ActionCode`](../../../types/interfaces/ActionCode.md)
|
|
60
68
|
|
|
61
|
-
##### config
|
|
62
|
-
|
|
63
|
-
[`CodeGenerationConfig`](../../../types/interfaces/CodeGenerationConfig.md)
|
|
64
|
-
|
|
65
69
|
#### Returns
|
|
66
70
|
|
|
67
71
|
`void`
|
package/docs/types/README.md
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
[**@actioncodes/protocol
|
|
1
|
+
[**@actioncodes/protocol**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
|
-
[@actioncodes/protocol
|
|
5
|
+
[@actioncodes/protocol](../modules.md) / types
|
|
6
6
|
|
|
7
7
|
# types
|
|
8
8
|
|
|
9
9
|
## Interfaces
|
|
10
10
|
|
|
11
11
|
- [ActionCode](interfaces/ActionCode.md)
|
|
12
|
+
- [ActionCodeRevoke](interfaces/ActionCodeRevoke.md)
|
|
12
13
|
- [CanonicalMessageParts](interfaces/CanonicalMessageParts.md)
|
|
14
|
+
- [CanonicalRevokeMessageParts](interfaces/CanonicalRevokeMessageParts.md)
|
|
13
15
|
- [CodeGenerationConfig](interfaces/CodeGenerationConfig.md)
|
|
14
|
-
- [
|
|
16
|
+
- [DelegatedActionCode](interfaces/DelegatedActionCode.md)
|
|
17
|
+
- [DelegatedActionCodeRevoke](interfaces/DelegatedActionCodeRevoke.md)
|
|
18
|
+
- [DelegationProof](interfaces/DelegationProof.md)
|
|
19
|
+
|
|
20
|
+
## Type Aliases
|
|
21
|
+
|
|
22
|
+
- [Chain](type-aliases/Chain.md)
|