@actioncodes/protocol 1.2.2 → 2.0.0
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/LICENSE +1 -1
- package/README.md +32 -45
- package/dist/ActionCodesProtocol.d.ts +35 -0
- package/dist/ActionCodesProtocol.d.ts.map +1 -0
- package/dist/adapters/BaseChainAdapter.d.ts +22 -0
- package/dist/adapters/BaseChainAdapter.d.ts.map +1 -0
- package/dist/adapters/SolanaAdapter.d.ts +44 -0
- package/dist/adapters/SolanaAdapter.d.ts.map +1 -0
- package/dist/constants.d.ts +6 -8
- package/dist/constants.d.ts.map +1 -1
- package/dist/errors.d.ts +63 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +25 -0
- package/dist/index.d.ts +10 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -36
- package/dist/index.js.map +25 -0
- package/dist/strategy/DelegationStrategy.d.ts +43 -0
- package/dist/strategy/DelegationStrategy.d.ts.map +1 -0
- package/dist/strategy/WalletStrategy.d.ts +8 -0
- package/dist/strategy/WalletStrategy.d.ts.map +1 -0
- package/dist/types.d.ts +40 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/canonical.d.ts +5 -0
- package/dist/utils/canonical.d.ts.map +1 -0
- package/dist/utils/crypto.d.ts +13 -0
- package/dist/utils/crypto.d.ts.map +1 -0
- package/dist/utils/protocolMeta.d.ts +16 -0
- package/dist/utils/protocolMeta.d.ts.map +1 -0
- package/docs/ActionCodesProtocol/README.md +11 -0
- package/docs/ActionCodesProtocol/classes/ActionCodesProtocol.md +147 -0
- package/docs/README.md +10 -50
- package/docs/adapters/BaseChainAdapter/README.md +20 -0
- package/docs/adapters/BaseChainAdapter/classes/BaseChainAdapter.md +56 -0
- package/docs/adapters/BaseChainAdapter/interfaces/BaseContext.md +17 -0
- package/docs/adapters/BaseChainAdapter/interfaces/ChainAdapter.md +33 -0
- package/docs/adapters/BaseChainAdapter/type-aliases/ChainContext.md +23 -0
- package/docs/adapters/NodeCryptoAdapter/README.md +15 -0
- package/docs/adapters/NodeCryptoAdapter/classes/NodeCryptoAdapter.md +254 -0
- package/docs/adapters/NodeCryptoAdapter/type-aliases/NodeCryptoContext.md +27 -0
- package/docs/adapters/SolanaAdapter/README.md +16 -0
- package/docs/adapters/SolanaAdapter/classes/SolanaAdapter.md +190 -0
- package/docs/adapters/SolanaAdapter/type-aliases/SolanaContext.md +27 -0
- package/docs/adapters/SolanaAdapter/type-aliases/SolanaTransaction.md +13 -0
- package/docs/constants/README.md +8 -13
- package/docs/constants/variables/CODE_CHARSET_DIGITS.md +11 -0
- package/docs/constants/variables/CODE_DEFAULT_LENGTH.md +11 -0
- package/docs/constants/variables/CODE_MAX_LENGTH.md +11 -0
- package/docs/constants/variables/CODE_MIN_LENGTH.md +11 -0
- package/docs/constants/variables/PROTOCOL_META_MAX_BYTES.md +11 -0
- package/docs/constants/variables/PROTOCOL_NORMALIZATION.md +11 -0
- package/docs/constants/variables/SUPPORTED_CHAINS.md +3 -3
- package/docs/errors/README.md +22 -0
- package/docs/errors/classes/ExpiredCodeError.md +695 -0
- package/docs/errors/classes/InvalidCodeFormatError.md +691 -0
- package/docs/errors/classes/InvalidPubkeyFormatError.md +691 -0
- package/docs/errors/classes/InvalidSignatureError.md +687 -0
- package/docs/errors/classes/MetaMismatchError.md +695 -0
- package/docs/errors/classes/MissingMetaError.md +681 -0
- package/docs/errors/classes/ProtocolError.md +637 -0
- package/docs/errors/classes/TransactionNotSignedByIntendedOwnerError.md +691 -0
- package/docs/errors/enumerations/ProtocolErrorCode.md +121 -0
- package/docs/index/README.md +83 -41
- package/docs/modules.md +12 -9
- package/docs/strategy/WalletStrategy/README.md +11 -0
- package/docs/strategy/WalletStrategy/classes/WalletStrategy.md +67 -0
- package/docs/types/README.md +14 -0
- package/docs/types/interfaces/ActionCode.md +65 -0
- package/docs/types/interfaces/CanonicalMessageParts.md +33 -0
- package/docs/types/interfaces/CodeGenerationConfig.md +33 -0
- package/docs/types/interfaces/CodeGenerationResult.md +25 -0
- package/docs/utils/canonical/README.md +16 -0
- package/docs/utils/canonical/functions/serializeCanonical.md +21 -0
- package/docs/utils/canonical/variables/CANONICAL_MESSAGE_PREFIX.md +11 -0
- package/docs/utils/canonical/variables/CANONICAL_MESSAGE_VERSION.md +11 -0
- package/docs/utils/crypto/README.md +18 -0
- package/docs/utils/crypto/functions/base32EncodeCrockford.md +21 -0
- package/docs/utils/crypto/functions/codeHash.md +21 -0
- package/docs/utils/crypto/functions/digestToDigits.md +25 -0
- package/docs/utils/crypto/functions/generateRandomSecret.md +15 -0
- package/docs/utils/crypto/functions/hkdfSha256.md +35 -0
- package/docs/utils/crypto/functions/hmacSha256.md +25 -0
- package/docs/utils/crypto/functions/sha256.md +21 -0
- package/docs/utils/crypto/functions/truncateBits.md +25 -0
- package/docs/utils/protocolMeta/README.md +21 -0
- package/docs/utils/protocolMeta/functions/buildProtocolMeta.md +21 -0
- package/docs/utils/protocolMeta/functions/parseProtocolMeta.md +21 -0
- package/docs/utils/protocolMeta/functions/validateProtocolMetaFormat.md +21 -0
- package/docs/utils/protocolMeta/interfaces/ProtocolMetaFields.md +41 -0
- package/docs/utils/protocolMeta/variables/SCHEME.md +11 -0
- package/package.json +42 -47
- package/dist/actioncode.d.ts +0 -120
- package/dist/actioncode.d.ts.map +0 -1
- package/dist/actioncode.js +0 -186
- package/dist/adapters/base.d.ts +0 -93
- package/dist/adapters/base.d.ts.map +0 -1
- package/dist/adapters/base.js +0 -65
- package/dist/adapters/solana/index.d.ts +0 -2
- package/dist/adapters/solana/index.d.ts.map +0 -1
- package/dist/adapters/solana/index.js +0 -30
- package/dist/adapters/solana/solana.d.ts +0 -113
- package/dist/adapters/solana/solana.d.ts.map +0 -1
- package/dist/adapters/solana/solana.js +0 -537
- package/dist/codegen.d.ts +0 -76
- package/dist/codegen.d.ts.map +0 -1
- package/dist/codegen.js +0 -211
- package/dist/constants.js +0 -24
- package/dist/meta.d.ts +0 -54
- package/dist/meta.d.ts.map +0 -1
- package/dist/meta.js +0 -104
- package/dist/protocol.d.ts +0 -179
- package/dist/protocol.d.ts.map +0 -1
- package/dist/protocol.js +0 -390
- package/docs/_media/LICENSE +0 -201
- package/docs/_media/README.md +0 -28
- package/docs/actioncode/README.md +0 -21
- package/docs/actioncode/classes/ActionCode.md +0 -430
- package/docs/actioncode/interfaces/ActionCodeFields.md +0 -89
- package/docs/actioncode/interfaces/ActionCodeMetadata.md +0 -25
- package/docs/actioncode/interfaces/ActionCodeTransaction.md +0 -57
- package/docs/actioncode/type-aliases/ActionCodeStatus.md +0 -11
- package/docs/adapters/base/README.md +0 -11
- package/docs/adapters/base/classes/BaseChainAdapter.md +0 -396
- package/docs/adapters/solana/README.md +0 -19
- package/docs/adapters/solana/solana/README.md +0 -15
- package/docs/adapters/solana/solana/classes/SolanaAdapter.md +0 -506
- package/docs/adapters/solana/solana/type-aliases/SolanaTransaction.md +0 -13
- package/docs/codegen/README.md +0 -11
- package/docs/codegen/classes/CodeGenerator.md +0 -341
- package/docs/constants/type-aliases/SupportedChain.md +0 -11
- package/docs/constants/variables/CODE_LENGTH.md +0 -11
- package/docs/constants/variables/CODE_TTL.md +0 -11
- package/docs/constants/variables/MAX_PREFIX_LENGTH.md +0 -11
- package/docs/constants/variables/MIN_PREFIX_LENGTH.md +0 -11
- package/docs/constants/variables/PROTOCOL_CODE_PREFIX.md +0 -11
- package/docs/constants/variables/PROTOCOL_PREFIX.md +0 -11
- package/docs/constants/variables/PROTOCOL_VERSION.md +0 -11
- package/docs/meta/README.md +0 -15
- package/docs/meta/classes/ProtocolMetaParser.md +0 -177
- package/docs/meta/interfaces/ProtocolMetaV1.md +0 -59
- package/docs/protocol/README.md +0 -51
- package/docs/protocol/classes/ActionCodesProtocol.md +0 -676
- 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
|
package/docs/index/README.md
CHANGED
@@ -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](../
|
13
|
+
Re-exports [ActionCode](../types/interfaces/ActionCode.md)
|
14
14
|
|
15
15
|
***
|
16
16
|
|
17
|
-
###
|
17
|
+
### ActionCodesProtocol
|
18
18
|
|
19
|
-
Re-exports [
|
19
|
+
Re-exports [ActionCodesProtocol](../ActionCodesProtocol/classes/ActionCodesProtocol.md)
|
20
20
|
|
21
21
|
***
|
22
22
|
|
23
|
-
###
|
23
|
+
### base32EncodeCrockford
|
24
24
|
|
25
|
-
Re-exports [
|
25
|
+
Re-exports [base32EncodeCrockford](../utils/crypto/functions/base32EncodeCrockford.md)
|
26
26
|
|
27
27
|
***
|
28
28
|
|
29
|
-
###
|
29
|
+
### BaseChainAdapter
|
30
30
|
|
31
|
-
Re-exports [
|
31
|
+
Re-exports [BaseChainAdapter](../adapters/BaseChainAdapter/classes/BaseChainAdapter.md)
|
32
32
|
|
33
33
|
***
|
34
34
|
|
35
|
-
###
|
35
|
+
### CANONICAL\_MESSAGE\_PREFIX
|
36
36
|
|
37
|
-
Re-exports [
|
37
|
+
Re-exports [CANONICAL_MESSAGE_PREFIX](../utils/canonical/variables/CANONICAL_MESSAGE_PREFIX.md)
|
38
38
|
|
39
39
|
***
|
40
40
|
|
41
|
-
###
|
41
|
+
### CANONICAL\_MESSAGE\_VERSION
|
42
42
|
|
43
|
-
Re-exports [
|
43
|
+
Re-exports [CANONICAL_MESSAGE_VERSION](../utils/canonical/variables/CANONICAL_MESSAGE_VERSION.md)
|
44
44
|
|
45
45
|
***
|
46
46
|
|
47
|
-
###
|
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 [
|
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 [
|
73
|
+
Re-exports [CODE_MAX_LENGTH](../constants/variables/CODE_MAX_LENGTH.md)
|
56
74
|
|
57
75
|
***
|
58
76
|
|
59
|
-
### CODE\
|
77
|
+
### CODE\_MIN\_LENGTH
|
60
78
|
|
61
|
-
Re-exports [
|
79
|
+
Re-exports [CODE_MIN_LENGTH](../constants/variables/CODE_MIN_LENGTH.md)
|
62
80
|
|
63
81
|
***
|
64
82
|
|
65
|
-
###
|
83
|
+
### CodeGenerationConfig
|
66
84
|
|
67
|
-
Re-exports [
|
85
|
+
Re-exports [CodeGenerationConfig](../types/interfaces/CodeGenerationConfig.md)
|
68
86
|
|
69
87
|
***
|
70
88
|
|
71
|
-
###
|
89
|
+
### CodeGenerationResult
|
72
90
|
|
73
|
-
Re-exports [
|
91
|
+
Re-exports [CodeGenerationResult](../types/interfaces/CodeGenerationResult.md)
|
74
92
|
|
75
93
|
***
|
76
94
|
|
77
|
-
###
|
95
|
+
### codeHash
|
78
96
|
|
79
|
-
Re-exports [
|
97
|
+
Re-exports [codeHash](../utils/crypto/functions/codeHash.md)
|
80
98
|
|
81
99
|
***
|
82
100
|
|
83
|
-
###
|
101
|
+
### digestToDigits
|
84
102
|
|
85
|
-
Re-exports [
|
103
|
+
Re-exports [digestToDigits](../utils/crypto/functions/digestToDigits.md)
|
86
104
|
|
87
105
|
***
|
88
106
|
|
89
|
-
###
|
107
|
+
### generateRandomSecret
|
90
108
|
|
91
|
-
Re-exports [
|
109
|
+
Re-exports [generateRandomSecret](../utils/crypto/functions/generateRandomSecret.md)
|
92
110
|
|
93
111
|
***
|
94
112
|
|
95
|
-
###
|
113
|
+
### hkdfSha256
|
96
114
|
|
97
|
-
Re-exports [
|
115
|
+
Re-exports [hkdfSha256](../utils/crypto/functions/hkdfSha256.md)
|
98
116
|
|
99
117
|
***
|
100
118
|
|
101
|
-
###
|
119
|
+
### hmacSha256
|
102
120
|
|
103
|
-
Re-exports [
|
121
|
+
Re-exports [hmacSha256](../utils/crypto/functions/hmacSha256.md)
|
104
122
|
|
105
123
|
***
|
106
124
|
|
107
|
-
###
|
125
|
+
### PROTOCOL\_META\_MAX\_BYTES
|
108
126
|
|
109
|
-
Re-exports [
|
127
|
+
Re-exports [PROTOCOL_META_MAX_BYTES](../constants/variables/PROTOCOL_META_MAX_BYTES.md)
|
110
128
|
|
111
129
|
***
|
112
130
|
|
113
|
-
###
|
131
|
+
### PROTOCOL\_NORMALIZATION
|
114
132
|
|
115
|
-
Re-exports [
|
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/
|
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/
|
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
|
-
###
|
173
|
+
### truncateBits
|
174
|
+
|
175
|
+
Re-exports [truncateBits](../utils/crypto/functions/truncateBits.md)
|
176
|
+
|
177
|
+
***
|
178
|
+
|
179
|
+
### WalletStrategy
|
138
180
|
|
139
|
-
Re-exports [
|
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
|
-
- [
|
10
|
-
- [adapters/
|
11
|
-
- [adapters/
|
12
|
-
- [adapters/
|
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
|
-
- [
|
17
|
-
- [
|
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,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
|