@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.
- package/README.md +239 -146
- package/dist/adapters/SolanaAdapter.d.ts.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/errors.d.ts +5 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +6 -6
- package/dist/index.js +2 -2
- package/dist/index.js.map +6 -6
- package/dist/utils/protocolMeta.d.ts +1 -0
- package/dist/utils/protocolMeta.d.ts.map +1 -1
- 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,32 +1,88 @@
|
|
|
1
|
-
[**@actioncodes/protocol
|
|
1
|
+
[**@actioncodes/protocol**](../../../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
|
-
[@actioncodes/protocol
|
|
5
|
+
[@actioncodes/protocol](../../../modules.md) / [adapters/BaseChainAdapter](../README.md) / ChainAdapter
|
|
6
6
|
|
|
7
|
-
# Interface: ChainAdapter
|
|
7
|
+
# Interface: ChainAdapter
|
|
8
|
+
|
|
9
|
+
Defined in: src/adapters/BaseChainAdapter.ts:3
|
|
10
|
+
|
|
11
|
+
## Methods
|
|
12
|
+
|
|
13
|
+
### verifyRevokeWithDelegation()
|
|
14
|
+
|
|
15
|
+
> **verifyRevokeWithDelegation**(`actionCode`, `revokeSignature`): `boolean`
|
|
8
16
|
|
|
9
17
|
Defined in: src/adapters/BaseChainAdapter.ts:10
|
|
10
18
|
|
|
11
|
-
|
|
19
|
+
#### Parameters
|
|
12
20
|
|
|
13
|
-
|
|
21
|
+
##### actionCode
|
|
14
22
|
|
|
15
|
-
`
|
|
23
|
+
[`DelegatedActionCode`](../../../types/interfaces/DelegatedActionCode.md)
|
|
16
24
|
|
|
17
|
-
|
|
25
|
+
##### revokeSignature
|
|
26
|
+
|
|
27
|
+
`string`
|
|
28
|
+
|
|
29
|
+
#### Returns
|
|
30
|
+
|
|
31
|
+
`boolean`
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### verifyRevokeWithWallet()
|
|
36
|
+
|
|
37
|
+
> **verifyRevokeWithWallet**(`actionCode`, `revokeSignature`): `boolean`
|
|
38
|
+
|
|
39
|
+
Defined in: src/adapters/BaseChainAdapter.ts:6
|
|
40
|
+
|
|
41
|
+
#### Parameters
|
|
42
|
+
|
|
43
|
+
##### actionCode
|
|
44
|
+
|
|
45
|
+
[`ActionCode`](../../../types/interfaces/ActionCode.md)
|
|
46
|
+
|
|
47
|
+
##### revokeSignature
|
|
48
|
+
|
|
49
|
+
`string`
|
|
50
|
+
|
|
51
|
+
#### Returns
|
|
52
|
+
|
|
53
|
+
`boolean`
|
|
54
|
+
|
|
55
|
+
***
|
|
56
|
+
|
|
57
|
+
### verifyWithDelegation()
|
|
58
|
+
|
|
59
|
+
> **verifyWithDelegation**(`actionCode`): `boolean`
|
|
60
|
+
|
|
61
|
+
Defined in: src/adapters/BaseChainAdapter.ts:5
|
|
62
|
+
|
|
63
|
+
#### Parameters
|
|
64
|
+
|
|
65
|
+
##### actionCode
|
|
66
|
+
|
|
67
|
+
[`DelegatedActionCode`](../../../types/interfaces/DelegatedActionCode.md)
|
|
68
|
+
|
|
69
|
+
#### Returns
|
|
70
|
+
|
|
71
|
+
`boolean`
|
|
72
|
+
|
|
73
|
+
***
|
|
18
74
|
|
|
19
|
-
###
|
|
75
|
+
### verifyWithWallet()
|
|
20
76
|
|
|
21
|
-
> **
|
|
77
|
+
> **verifyWithWallet**(`actionCode`): `boolean`
|
|
22
78
|
|
|
23
|
-
Defined in: src/adapters/BaseChainAdapter.ts:
|
|
79
|
+
Defined in: src/adapters/BaseChainAdapter.ts:4
|
|
24
80
|
|
|
25
81
|
#### Parameters
|
|
26
82
|
|
|
27
|
-
#####
|
|
83
|
+
##### actionCode
|
|
28
84
|
|
|
29
|
-
[`
|
|
85
|
+
[`ActionCode`](../../../types/interfaces/ActionCode.md)
|
|
30
86
|
|
|
31
87
|
#### Returns
|
|
32
88
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**@actioncodes/protocol**](../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@actioncodes/protocol](../../../modules.md) / [adapters/BaseChainAdapter](../README.md) / SignFn
|
|
6
|
+
|
|
7
|
+
# Type Alias: SignFn()
|
|
8
|
+
|
|
9
|
+
> **SignFn** = (`message`, `chain`) => `Promise`\<`string`\>
|
|
10
|
+
|
|
11
|
+
Defined in: src/adapters/BaseChainAdapter.ts:16
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
### message
|
|
16
|
+
|
|
17
|
+
`Uint8Array`
|
|
18
|
+
|
|
19
|
+
### chain
|
|
20
|
+
|
|
21
|
+
[`Chain`](../../../types/type-aliases/Chain.md)
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`Promise`\<`string`\>
|
|
@@ -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) / adapters/SolanaAdapter
|
|
6
6
|
|
|
7
7
|
# adapters/SolanaAdapter
|
|
8
8
|
|
|
@@ -12,5 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
## Type Aliases
|
|
14
14
|
|
|
15
|
-
- [SolanaContext](type-aliases/SolanaContext.md)
|
|
16
15
|
- [SolanaTransaction](type-aliases/SolanaTransaction.md)
|
|
16
|
+
|
|
17
|
+
## Variables
|
|
18
|
+
|
|
19
|
+
- [ADAPTER\_CHAIN\_NAME](variables/ADAPTER_CHAIN_NAME.md)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
[**@actioncodes/protocol
|
|
1
|
+
[**@actioncodes/protocol**](../../../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
|
-
[@actioncodes/protocol
|
|
5
|
+
[@actioncodes/protocol](../../../modules.md) / [adapters/SolanaAdapter](../README.md) / SolanaAdapter
|
|
6
6
|
|
|
7
7
|
# Class: SolanaAdapter
|
|
8
8
|
|
|
9
|
-
Defined in: src/adapters/SolanaAdapter.ts:
|
|
9
|
+
Defined in: src/adapters/SolanaAdapter.ts:31
|
|
10
10
|
|
|
11
11
|
## Extends
|
|
12
12
|
|
|
13
|
-
- [`BaseChainAdapter`](../../BaseChainAdapter/classes/BaseChainAdapter.md)
|
|
13
|
+
- [`BaseChainAdapter`](../../BaseChainAdapter/classes/BaseChainAdapter.md)
|
|
14
14
|
|
|
15
15
|
## Constructors
|
|
16
16
|
|
|
@@ -30,17 +30,17 @@ Defined in: src/adapters/SolanaAdapter.ts:30
|
|
|
30
30
|
|
|
31
31
|
### getProtocolMeta()
|
|
32
32
|
|
|
33
|
-
> **getProtocolMeta**(`
|
|
33
|
+
> **getProtocolMeta**(`txString`): `null` \| `string`
|
|
34
34
|
|
|
35
|
-
Defined in: src/adapters/SolanaAdapter.ts:
|
|
35
|
+
Defined in: src/adapters/SolanaAdapter.ts:280
|
|
36
36
|
|
|
37
|
-
Extract protocol metadata string (memo) from a transaction, or null
|
|
37
|
+
Extract protocol metadata string (memo) from a base64-encoded transaction, or null
|
|
38
38
|
|
|
39
39
|
#### Parameters
|
|
40
40
|
|
|
41
|
-
#####
|
|
41
|
+
##### txString
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
`string`
|
|
44
44
|
|
|
45
45
|
#### Returns
|
|
46
46
|
|
|
@@ -50,17 +50,17 @@ Extract protocol metadata string (memo) from a transaction, or null
|
|
|
50
50
|
|
|
51
51
|
### parseMeta()
|
|
52
52
|
|
|
53
|
-
> **parseMeta**(`
|
|
53
|
+
> **parseMeta**(`txString`): `null` \| [`ProtocolMetaFields`](../../../utils/protocolMeta/interfaces/ProtocolMetaFields.md)
|
|
54
54
|
|
|
55
|
-
Defined in: src/adapters/SolanaAdapter.ts:
|
|
55
|
+
Defined in: src/adapters/SolanaAdapter.ts:329
|
|
56
56
|
|
|
57
|
-
Get parsed ProtocolMeta object, or null if none or invalid
|
|
57
|
+
Get parsed ProtocolMeta object from base64-encoded transaction, or null if none or invalid
|
|
58
58
|
|
|
59
59
|
#### Parameters
|
|
60
60
|
|
|
61
|
-
#####
|
|
61
|
+
##### txString
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
`string`
|
|
64
64
|
|
|
65
65
|
#### Returns
|
|
66
66
|
|
|
@@ -68,19 +68,47 @@ Get parsed ProtocolMeta object, or null if none or invalid
|
|
|
68
68
|
|
|
69
69
|
***
|
|
70
70
|
|
|
71
|
-
###
|
|
71
|
+
### verifyMessageSignedByIntentOwner()
|
|
72
72
|
|
|
73
|
-
> **
|
|
73
|
+
> **verifyMessageSignedByIntentOwner**(`message`, `signature`, `pubkey`): `void`
|
|
74
74
|
|
|
75
|
-
Defined in: src/adapters/SolanaAdapter.ts:
|
|
75
|
+
Defined in: src/adapters/SolanaAdapter.ts:525
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
#### Parameters
|
|
78
|
+
|
|
79
|
+
##### message
|
|
80
|
+
|
|
81
|
+
`string`
|
|
82
|
+
|
|
83
|
+
##### signature
|
|
84
|
+
|
|
85
|
+
`string`
|
|
86
|
+
|
|
87
|
+
##### pubkey
|
|
88
|
+
|
|
89
|
+
`string`
|
|
90
|
+
|
|
91
|
+
#### Returns
|
|
92
|
+
|
|
93
|
+
`void`
|
|
94
|
+
|
|
95
|
+
***
|
|
96
|
+
|
|
97
|
+
### verifyRevokeWithDelegation()
|
|
98
|
+
|
|
99
|
+
> **verifyRevokeWithDelegation**(`delegatedActionCode`, `revokeSignature`): `boolean`
|
|
100
|
+
|
|
101
|
+
Defined in: src/adapters/SolanaAdapter.ts:187
|
|
78
102
|
|
|
79
103
|
#### Parameters
|
|
80
104
|
|
|
81
|
-
#####
|
|
105
|
+
##### delegatedActionCode
|
|
106
|
+
|
|
107
|
+
[`DelegatedActionCode`](../../../types/interfaces/DelegatedActionCode.md)
|
|
108
|
+
|
|
109
|
+
##### revokeSignature
|
|
82
110
|
|
|
83
|
-
|
|
111
|
+
`string`
|
|
84
112
|
|
|
85
113
|
#### Returns
|
|
86
114
|
|
|
@@ -88,17 +116,45 @@ Verify the signature over canonical message (protocol-level)
|
|
|
88
116
|
|
|
89
117
|
#### Overrides
|
|
90
118
|
|
|
91
|
-
[`BaseChainAdapter`](../../BaseChainAdapter/classes/BaseChainAdapter.md).[`
|
|
119
|
+
[`BaseChainAdapter`](../../BaseChainAdapter/classes/BaseChainAdapter.md).[`verifyRevokeWithDelegation`](../../BaseChainAdapter/classes/BaseChainAdapter.md#verifyrevokewithdelegation)
|
|
120
|
+
|
|
121
|
+
***
|
|
122
|
+
|
|
123
|
+
### verifyRevokeWithWallet()
|
|
124
|
+
|
|
125
|
+
> **verifyRevokeWithWallet**(`actionCode`, `revokeSignature`): `boolean`
|
|
126
|
+
|
|
127
|
+
Defined in: src/adapters/SolanaAdapter.ts:154
|
|
128
|
+
|
|
129
|
+
Verify the signature over canonical revoke message (protocol-level)
|
|
130
|
+
|
|
131
|
+
#### Parameters
|
|
132
|
+
|
|
133
|
+
##### actionCode
|
|
134
|
+
|
|
135
|
+
[`ActionCode`](../../../types/interfaces/ActionCode.md)
|
|
136
|
+
|
|
137
|
+
##### revokeSignature
|
|
138
|
+
|
|
139
|
+
`string`
|
|
140
|
+
|
|
141
|
+
#### Returns
|
|
142
|
+
|
|
143
|
+
`boolean`
|
|
144
|
+
|
|
145
|
+
#### Overrides
|
|
146
|
+
|
|
147
|
+
[`BaseChainAdapter`](../../BaseChainAdapter/classes/BaseChainAdapter.md).[`verifyRevokeWithWallet`](../../BaseChainAdapter/classes/BaseChainAdapter.md#verifyrevokewithwallet)
|
|
92
148
|
|
|
93
149
|
***
|
|
94
150
|
|
|
95
151
|
### verifyTransactionMatchesCode()
|
|
96
152
|
|
|
97
|
-
> **verifyTransactionMatchesCode**(`actionCode`, `
|
|
153
|
+
> **verifyTransactionMatchesCode**(`actionCode`, `txString`): `void`
|
|
98
154
|
|
|
99
|
-
Defined in: src/adapters/SolanaAdapter.ts:
|
|
155
|
+
Defined in: src/adapters/SolanaAdapter.ts:375
|
|
100
156
|
|
|
101
|
-
Validate that a transaction's memo meta aligns with the bound `actionCode`.
|
|
157
|
+
Validate that a base64-encoded transaction's memo meta aligns with the bound `actionCode`.
|
|
102
158
|
Throws ProtocolError if validation fails.
|
|
103
159
|
|
|
104
160
|
#### Parameters
|
|
@@ -107,9 +163,9 @@ Throws ProtocolError if validation fails.
|
|
|
107
163
|
|
|
108
164
|
[`ActionCode`](../../../types/interfaces/ActionCode.md)
|
|
109
165
|
|
|
110
|
-
#####
|
|
166
|
+
##### txString
|
|
111
167
|
|
|
112
|
-
|
|
168
|
+
`string`
|
|
113
169
|
|
|
114
170
|
#### Returns
|
|
115
171
|
|
|
@@ -119,19 +175,19 @@ Throws ProtocolError if validation fails.
|
|
|
119
175
|
|
|
120
176
|
### verifyTransactionSignedByIntentOwner()
|
|
121
177
|
|
|
122
|
-
> **verifyTransactionSignedByIntentOwner**(`
|
|
178
|
+
> **verifyTransactionSignedByIntentOwner**(`txString`): `void`
|
|
123
179
|
|
|
124
|
-
Defined in: src/adapters/SolanaAdapter.ts:
|
|
180
|
+
Defined in: src/adapters/SolanaAdapter.ts:413
|
|
125
181
|
|
|
126
|
-
Verify that the transaction is signed by the "intendedFor" pubkey
|
|
182
|
+
Verify that the base64-encoded transaction is signed by the "intendedFor" pubkey
|
|
127
183
|
as declared in the protocol meta of the transaction.
|
|
128
184
|
Throws ProtocolError if validation fails.
|
|
129
185
|
|
|
130
186
|
#### Parameters
|
|
131
187
|
|
|
132
|
-
#####
|
|
188
|
+
##### txString
|
|
133
189
|
|
|
134
|
-
|
|
190
|
+
`string`
|
|
135
191
|
|
|
136
192
|
#### Returns
|
|
137
193
|
|
|
@@ -139,27 +195,68 @@ Throws ProtocolError if validation fails.
|
|
|
139
195
|
|
|
140
196
|
***
|
|
141
197
|
|
|
142
|
-
###
|
|
198
|
+
### verifyWithDelegation()
|
|
199
|
+
|
|
200
|
+
> **verifyWithDelegation**(`delegatedActionCode`): `boolean`
|
|
201
|
+
|
|
202
|
+
Defined in: src/adapters/SolanaAdapter.ts:71
|
|
203
|
+
|
|
204
|
+
Verify delegation proof signature
|
|
205
|
+
|
|
206
|
+
#### Parameters
|
|
207
|
+
|
|
208
|
+
##### delegatedActionCode
|
|
209
|
+
|
|
210
|
+
[`DelegatedActionCode`](../../../types/interfaces/DelegatedActionCode.md)
|
|
211
|
+
|
|
212
|
+
#### Returns
|
|
213
|
+
|
|
214
|
+
`boolean`
|
|
215
|
+
|
|
216
|
+
#### Overrides
|
|
217
|
+
|
|
218
|
+
[`BaseChainAdapter`](../../BaseChainAdapter/classes/BaseChainAdapter.md).[`verifyWithDelegation`](../../BaseChainAdapter/classes/BaseChainAdapter.md#verifywithdelegation)
|
|
219
|
+
|
|
220
|
+
***
|
|
143
221
|
|
|
144
|
-
|
|
222
|
+
### verifyWithWallet()
|
|
145
223
|
|
|
146
|
-
|
|
224
|
+
> **verifyWithWallet**(`actionCode`): `boolean`
|
|
147
225
|
|
|
148
|
-
|
|
226
|
+
Defined in: src/adapters/SolanaAdapter.ts:41
|
|
149
227
|
|
|
150
|
-
|
|
228
|
+
Verify the signature over canonical message (protocol-level)
|
|
229
|
+
|
|
230
|
+
#### Parameters
|
|
231
|
+
|
|
232
|
+
##### actionCode
|
|
233
|
+
|
|
234
|
+
[`ActionCode`](../../../types/interfaces/ActionCode.md)
|
|
235
|
+
|
|
236
|
+
#### Returns
|
|
237
|
+
|
|
238
|
+
`boolean`
|
|
239
|
+
|
|
240
|
+
#### Overrides
|
|
241
|
+
|
|
242
|
+
[`BaseChainAdapter`](../../BaseChainAdapter/classes/BaseChainAdapter.md).[`verifyWithWallet`](../../BaseChainAdapter/classes/BaseChainAdapter.md#verifywithwallet)
|
|
243
|
+
|
|
244
|
+
***
|
|
245
|
+
|
|
246
|
+
### attachProtocolMeta()
|
|
151
247
|
|
|
152
|
-
|
|
248
|
+
> `static` **attachProtocolMeta**(`txString`, `meta`): `string`
|
|
153
249
|
|
|
154
|
-
|
|
250
|
+
Defined in: src/adapters/SolanaAdapter.ts:560
|
|
155
251
|
|
|
156
|
-
|
|
252
|
+
Attach protocol meta into a base64-encoded transaction and return the modified transaction as base64.
|
|
253
|
+
Throws ProtocolError if the transaction already contains protocol meta.
|
|
157
254
|
|
|
158
255
|
#### Parameters
|
|
159
256
|
|
|
160
|
-
#####
|
|
257
|
+
##### txString
|
|
161
258
|
|
|
162
|
-
`
|
|
259
|
+
`string`
|
|
163
260
|
|
|
164
261
|
##### meta
|
|
165
262
|
|
|
@@ -167,7 +264,7 @@ Attach protocol meta into a legacy or versioned transaction.
|
|
|
167
264
|
|
|
168
265
|
#### Returns
|
|
169
266
|
|
|
170
|
-
`
|
|
267
|
+
`string`
|
|
171
268
|
|
|
172
269
|
***
|
|
173
270
|
|
|
@@ -175,7 +272,7 @@ Attach protocol meta into a legacy or versioned transaction.
|
|
|
175
272
|
|
|
176
273
|
> `static` **createProtocolMetaIx**(`meta`): `TransactionInstruction`
|
|
177
274
|
|
|
178
|
-
Defined in: src/adapters/SolanaAdapter.ts:
|
|
275
|
+
Defined in: src/adapters/SolanaAdapter.ts:272
|
|
179
276
|
|
|
180
277
|
Create a Solana memo instruction carrying protocol meta (for SDK/clients)
|
|
181
278
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
[**@actioncodes/protocol
|
|
1
|
+
[**@actioncodes/protocol**](../../../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
|
-
[@actioncodes/protocol
|
|
5
|
+
[@actioncodes/protocol](../../../modules.md) / [adapters/SolanaAdapter](../README.md) / SolanaTransaction
|
|
6
6
|
|
|
7
7
|
# Type Alias: SolanaTransaction
|
|
8
8
|
|
|
9
9
|
> **SolanaTransaction** = `Transaction` \| `VersionedTransaction`
|
|
10
10
|
|
|
11
|
-
Defined in: src/adapters/SolanaAdapter.ts:
|
|
11
|
+
Defined in: src/adapters/SolanaAdapter.ts:27
|
|
12
12
|
|
|
13
13
|
Union of supported Solana txn types
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[**@actioncodes/protocol**](../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@actioncodes/protocol](../../../modules.md) / [adapters/SolanaAdapter](../README.md) / ADAPTER\_CHAIN\_NAME
|
|
6
|
+
|
|
7
|
+
# Variable: ADAPTER\_CHAIN\_NAME
|
|
8
|
+
|
|
9
|
+
> `const` **ADAPTER\_CHAIN\_NAME**: `"solana"`
|
|
10
|
+
|
|
11
|
+
Defined in: src/adapters/SolanaAdapter.ts:29
|
package/docs/constants/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) / [constants](../README.md) / CODE\_CHARSET\_DIGITS
|
|
6
6
|
|
|
7
7
|
# Variable: CODE\_CHARSET\_DIGITS
|
|
8
8
|
|
|
@@ -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) / [constants](../README.md) / CODE\_DEFAULT\_LENGTH
|
|
6
6
|
|
|
7
7
|
# Variable: CODE\_DEFAULT\_LENGTH
|
|
8
8
|
|
|
@@ -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) / [constants](../README.md) / CODE\_MAX\_LENGTH
|
|
6
6
|
|
|
7
7
|
# Variable: CODE\_MAX\_LENGTH
|
|
8
8
|
|
|
@@ -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) / [constants](../README.md) / CODE\_MIN\_LENGTH
|
|
6
6
|
|
|
7
7
|
# Variable: CODE\_MIN\_LENGTH
|
|
8
8
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
[**@actioncodes/protocol
|
|
1
|
+
[**@actioncodes/protocol**](../../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
|
-
[@actioncodes/protocol
|
|
5
|
+
[@actioncodes/protocol](../../modules.md) / [constants](../README.md) / PROTOCOL\_META\_MAX\_BYTES
|
|
6
6
|
|
|
7
7
|
# Variable: PROTOCOL\_META\_MAX\_BYTES
|
|
8
8
|
|
|
9
|
-
> `const` **PROTOCOL\_META\_MAX\_BYTES**: `
|
|
9
|
+
> `const` **PROTOCOL\_META\_MAX\_BYTES**: `512` = `512`
|
|
10
10
|
|
|
11
11
|
Defined in: src/constants.ts:4
|
|
@@ -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) / [constants](../README.md) / PROTOCOL\_NORMALIZATION
|
|
6
6
|
|
|
7
7
|
# Variable: PROTOCOL\_NORMALIZATION
|
|
8
8
|
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
[**@actioncodes/protocol
|
|
1
|
+
[**@actioncodes/protocol**](../../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
|
-
[@actioncodes/protocol
|
|
5
|
+
[@actioncodes/protocol](../../modules.md) / [constants](../README.md) / SUPPORTED\_CHAINS
|
|
6
6
|
|
|
7
7
|
# Variable: SUPPORTED\_CHAINS
|
|
8
8
|
|
|
9
|
-
> `const` **SUPPORTED\_CHAINS**:
|
|
9
|
+
> `const` **SUPPORTED\_CHAINS**: `object`
|
|
10
10
|
|
|
11
11
|
Defined in: src/constants.ts:13
|
|
12
|
+
|
|
13
|
+
## Type Declaration
|
|
14
|
+
|
|
15
|
+
### solana
|
|
16
|
+
|
|
17
|
+
> `readonly` **solana**: `"solana"` = `"solana"`
|
package/docs/errors/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) / errors
|
|
6
6
|
|
|
7
7
|
# errors
|
|
8
8
|
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
## Classes
|
|
14
14
|
|
|
15
15
|
- [ExpiredCodeError](classes/ExpiredCodeError.md)
|
|
16
|
+
- [InvalidAdapterError](classes/InvalidAdapterError.md)
|
|
16
17
|
- [InvalidCodeFormatError](classes/InvalidCodeFormatError.md)
|
|
17
18
|
- [InvalidPubkeyFormatError](classes/InvalidPubkeyFormatError.md)
|
|
18
19
|
- [InvalidSignatureError](classes/InvalidSignatureError.md)
|
|
@@ -20,3 +21,4 @@
|
|
|
20
21
|
- [MissingMetaError](classes/MissingMetaError.md)
|
|
21
22
|
- [ProtocolError](classes/ProtocolError.md)
|
|
22
23
|
- [TransactionNotSignedByIntendedOwnerError](classes/TransactionNotSignedByIntendedOwnerError.md)
|
|
24
|
+
- [TransactionNotSignedByIssuerError](classes/TransactionNotSignedByIssuerError.md)
|