@actioncodes/protocol 2.0.22 → 2.0.24
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 +8 -2
- package/dist/adapters/SolanaAdapter.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +2 -2
- package/dist/index.js.map +3 -3
- 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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[**@actioncodes/protocol**](../../../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@actioncodes/protocol](../../../modules.md) / [utils/canonical](../README.md) / CANONICAL\_REVOKE\_MESSAGE\_PREFIX
|
|
6
|
+
|
|
7
|
+
# Variable: CANONICAL\_REVOKE\_MESSAGE\_PREFIX
|
|
8
|
+
|
|
9
|
+
> `const` **CANONICAL\_REVOKE\_MESSAGE\_PREFIX**: `"actioncodes-revoke"` = `"actioncodes-revoke"`
|
|
10
|
+
|
|
11
|
+
Defined in: src/utils/canonical.ts:10
|
|
@@ -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) / utils/crypto
|
|
6
6
|
|
|
7
7
|
# utils/crypto
|
|
8
8
|
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
- [base32EncodeCrockford](functions/base32EncodeCrockford.md)
|
|
12
12
|
- [codeHash](functions/codeHash.md)
|
|
13
13
|
- [digestToDigits](functions/digestToDigits.md)
|
|
14
|
-
- [generateRandomSecret](functions/generateRandomSecret.md)
|
|
15
14
|
- [hkdfSha256](functions/hkdfSha256.md)
|
|
16
15
|
- [hmacSha256](functions/hmacSha256.md)
|
|
17
16
|
- [sha256](functions/sha256.md)
|
|
@@ -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) / [utils/crypto](../README.md) / base32EncodeCrockford
|
|
6
6
|
|
|
7
7
|
# Function: base32EncodeCrockford()
|
|
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) / [utils/crypto](../README.md) / codeHash
|
|
6
6
|
|
|
7
7
|
# Function: codeHash()
|
|
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) / [utils/crypto](../README.md) / digestToDigits
|
|
6
6
|
|
|
7
7
|
# Function: digestToDigits()
|
|
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) / [utils/crypto](../README.md) / hkdfSha256
|
|
6
6
|
|
|
7
7
|
# Function: hkdfSha256()
|
|
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) / [utils/crypto](../README.md) / hmacSha256
|
|
6
6
|
|
|
7
7
|
# Function: hmacSha256()
|
|
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) / [utils/crypto](../README.md) / sha256
|
|
6
6
|
|
|
7
7
|
# Function: sha256()
|
|
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) / [utils/crypto](../README.md) / truncateBits
|
|
6
6
|
|
|
7
7
|
# Function: truncateBits()
|
|
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) / utils/protocolMeta
|
|
6
6
|
|
|
7
7
|
# utils/protocolMeta
|
|
8
8
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
[**@actioncodes/protocol
|
|
1
|
+
[**@actioncodes/protocol**](../../../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
|
-
[@actioncodes/protocol
|
|
5
|
+
[@actioncodes/protocol](../../../modules.md) / [utils/protocolMeta](../README.md) / buildProtocolMeta
|
|
6
6
|
|
|
7
7
|
# Function: buildProtocolMeta()
|
|
8
8
|
|
|
9
9
|
> **buildProtocolMeta**(`fields`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: src/utils/protocolMeta.ts:
|
|
11
|
+
Defined in: src/utils/protocolMeta.ts:14
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
[**@actioncodes/protocol
|
|
1
|
+
[**@actioncodes/protocol**](../../../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
|
-
[@actioncodes/protocol
|
|
5
|
+
[@actioncodes/protocol](../../../modules.md) / [utils/protocolMeta](../README.md) / parseProtocolMeta
|
|
6
6
|
|
|
7
7
|
# Function: parseProtocolMeta()
|
|
8
8
|
|
|
9
9
|
> **parseProtocolMeta**(`input`): [`ProtocolMetaFields`](../interfaces/ProtocolMetaFields.md)
|
|
10
10
|
|
|
11
|
-
Defined in: src/utils/protocolMeta.ts:
|
|
11
|
+
Defined in: src/utils/protocolMeta.ts:40
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
[**@actioncodes/protocol
|
|
1
|
+
[**@actioncodes/protocol**](../../../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
|
-
[@actioncodes/protocol
|
|
5
|
+
[@actioncodes/protocol](../../../modules.md) / [utils/protocolMeta](../README.md) / validateProtocolMetaFormat
|
|
6
6
|
|
|
7
7
|
# Function: validateProtocolMetaFormat()
|
|
8
8
|
|
|
9
9
|
> **validateProtocolMetaFormat**(`input`): \{ `ok`: `true`; \} \| \{ `ok`: `false`; `reason`: `string`; \}
|
|
10
10
|
|
|
11
|
-
Defined in: src/utils/protocolMeta.ts:
|
|
11
|
+
Defined in: src/utils/protocolMeta.ts:88
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -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) / [utils/protocolMeta](../README.md) / ProtocolMetaFields
|
|
6
6
|
|
|
7
7
|
# Interface: ProtocolMetaFields
|
|
8
8
|
|
|
@@ -26,11 +26,19 @@ Defined in: src/utils/protocolMeta.ts:7
|
|
|
26
26
|
|
|
27
27
|
***
|
|
28
28
|
|
|
29
|
+
### iss?
|
|
30
|
+
|
|
31
|
+
> `optional` **iss**: `string`
|
|
32
|
+
|
|
33
|
+
Defined in: src/utils/protocolMeta.ts:8
|
|
34
|
+
|
|
35
|
+
***
|
|
36
|
+
|
|
29
37
|
### p?
|
|
30
38
|
|
|
31
39
|
> `optional` **p**: `Record`\<`string`, `unknown`\>
|
|
32
40
|
|
|
33
|
-
Defined in: src/utils/protocolMeta.ts:
|
|
41
|
+
Defined in: src/utils/protocolMeta.ts:9
|
|
34
42
|
|
|
35
43
|
***
|
|
36
44
|
|
|
@@ -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) / [utils/protocolMeta](../README.md) / SCHEME
|
|
6
6
|
|
|
7
7
|
# Variable: SCHEME
|
|
8
8
|
|
|
9
9
|
> `const` **SCHEME**: `"actioncodes:"` = `"actioncodes:"`
|
|
10
10
|
|
|
11
|
-
Defined in: src/utils/protocolMeta.ts:
|
|
11
|
+
Defined in: src/utils/protocolMeta.ts:12
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@actioncodes/protocol",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.24",
|
|
4
4
|
"module": "index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"solana",
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
18
|
+
"actioncodes protocol",
|
|
19
|
+
"actioncodes protocol sdk",
|
|
20
|
+
"actioncodes protocol utils",
|
|
21
|
+
"actioncodes protocol types",
|
|
22
|
+
"actioncodes protocol constants"
|
|
23
23
|
],
|
|
24
24
|
"homepage": "https://actioncodes.org",
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|
|
27
|
-
"url": "https://github.com/
|
|
27
|
+
"url": "https://github.com/actioncodesorg/protocol-v2"
|
|
28
28
|
},
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
[**@actioncodes/protocol-v2**](../../../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@actioncodes/protocol-v2](../../../modules.md) / [adapters/BaseChainAdapter](../README.md) / BaseContext
|
|
6
|
-
|
|
7
|
-
# Interface: BaseContext
|
|
8
|
-
|
|
9
|
-
Defined in: src/adapters/BaseChainAdapter.ts:4
|
|
10
|
-
|
|
11
|
-
## Properties
|
|
12
|
-
|
|
13
|
-
### canonicalMessageParts
|
|
14
|
-
|
|
15
|
-
> **canonicalMessageParts**: [`CanonicalMessageParts`](../../../types/interfaces/CanonicalMessageParts.md)
|
|
16
|
-
|
|
17
|
-
Defined in: src/adapters/BaseChainAdapter.ts:6
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
[**@actioncodes/protocol-v2**](../../../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@actioncodes/protocol-v2](../../../modules.md) / [adapters/BaseChainAdapter](../README.md) / ChainContext
|
|
6
|
-
|
|
7
|
-
# Type Alias: ChainContext\<T\>
|
|
8
|
-
|
|
9
|
-
> **ChainContext**\<`T`\> = [`BaseContext`](../interfaces/BaseContext.md) & `object` & `T`
|
|
10
|
-
|
|
11
|
-
Defined in: src/adapters/BaseChainAdapter.ts:8
|
|
12
|
-
|
|
13
|
-
## Type Declaration
|
|
14
|
-
|
|
15
|
-
### chain
|
|
16
|
-
|
|
17
|
-
> **chain**: `string`
|
|
18
|
-
|
|
19
|
-
## Type Parameters
|
|
20
|
-
|
|
21
|
-
### T
|
|
22
|
-
|
|
23
|
-
`T`
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
[**@actioncodes/protocol-v2**](../../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@actioncodes/protocol-v2](../../modules.md) / adapters/NodeCryptoAdapter
|
|
6
|
-
|
|
7
|
-
# adapters/NodeCryptoAdapter
|
|
8
|
-
|
|
9
|
-
## Classes
|
|
10
|
-
|
|
11
|
-
- [NodeCryptoAdapter](classes/NodeCryptoAdapter.md)
|
|
12
|
-
|
|
13
|
-
## Type Aliases
|
|
14
|
-
|
|
15
|
-
- [NodeCryptoContext](type-aliases/NodeCryptoContext.md)
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
[**@actioncodes/protocol-v2**](../../../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@actioncodes/protocol-v2](../../../modules.md) / [adapters/NodeCryptoAdapter](../README.md) / NodeCryptoAdapter
|
|
6
|
-
|
|
7
|
-
# Class: NodeCryptoAdapter
|
|
8
|
-
|
|
9
|
-
Defined in: src/adapters/NodeCryptoAdapter.ts:20
|
|
10
|
-
|
|
11
|
-
## Extends
|
|
12
|
-
|
|
13
|
-
- [`BaseChainAdapter`](../../BaseChainAdapter/classes/BaseChainAdapter.md)\<[`NodeCryptoContext`](../type-aliases/NodeCryptoContext.md)\>
|
|
14
|
-
|
|
15
|
-
## Constructors
|
|
16
|
-
|
|
17
|
-
### Constructor
|
|
18
|
-
|
|
19
|
-
> **new NodeCryptoAdapter**(): `NodeCryptoAdapter`
|
|
20
|
-
|
|
21
|
-
#### Returns
|
|
22
|
-
|
|
23
|
-
`NodeCryptoAdapter`
|
|
24
|
-
|
|
25
|
-
#### Inherited from
|
|
26
|
-
|
|
27
|
-
[`BaseChainAdapter`](../../BaseChainAdapter/classes/BaseChainAdapter.md).[`constructor`](../../BaseChainAdapter/classes/BaseChainAdapter.md#constructor)
|
|
28
|
-
|
|
29
|
-
## Methods
|
|
30
|
-
|
|
31
|
-
### getProtocolMeta()
|
|
32
|
-
|
|
33
|
-
> **getProtocolMeta**(`tx`): `null` \| `string`
|
|
34
|
-
|
|
35
|
-
Defined in: src/adapters/NodeCryptoAdapter.ts:57
|
|
36
|
-
|
|
37
|
-
Extract protocol metadata from a simulated transaction
|
|
38
|
-
|
|
39
|
-
#### Parameters
|
|
40
|
-
|
|
41
|
-
##### tx
|
|
42
|
-
|
|
43
|
-
###### instructions?
|
|
44
|
-
|
|
45
|
-
`object`[]
|
|
46
|
-
|
|
47
|
-
#### Returns
|
|
48
|
-
|
|
49
|
-
`null` \| `string`
|
|
50
|
-
|
|
51
|
-
***
|
|
52
|
-
|
|
53
|
-
### parseMeta()
|
|
54
|
-
|
|
55
|
-
> **parseMeta**(`tx`): `null` \| [`ProtocolMetaFields`](../../../utils/protocolMeta/interfaces/ProtocolMetaFields.md)
|
|
56
|
-
|
|
57
|
-
Defined in: src/adapters/NodeCryptoAdapter.ts:74
|
|
58
|
-
|
|
59
|
-
Get parsed ProtocolMeta object, or null if none or invalid
|
|
60
|
-
|
|
61
|
-
#### Parameters
|
|
62
|
-
|
|
63
|
-
##### tx
|
|
64
|
-
|
|
65
|
-
###### instructions?
|
|
66
|
-
|
|
67
|
-
`object`[]
|
|
68
|
-
|
|
69
|
-
#### Returns
|
|
70
|
-
|
|
71
|
-
`null` \| [`ProtocolMetaFields`](../../../utils/protocolMeta/interfaces/ProtocolMetaFields.md)
|
|
72
|
-
|
|
73
|
-
***
|
|
74
|
-
|
|
75
|
-
### verify()
|
|
76
|
-
|
|
77
|
-
> **verify**(`context`): `boolean`
|
|
78
|
-
|
|
79
|
-
Defined in: src/adapters/NodeCryptoAdapter.ts:22
|
|
80
|
-
|
|
81
|
-
Verify the signature over canonical message using Node.js crypto
|
|
82
|
-
|
|
83
|
-
#### Parameters
|
|
84
|
-
|
|
85
|
-
##### context
|
|
86
|
-
|
|
87
|
-
[`ChainContext`](../../BaseChainAdapter/type-aliases/ChainContext.md)\<[`NodeCryptoContext`](../type-aliases/NodeCryptoContext.md)\>
|
|
88
|
-
|
|
89
|
-
#### Returns
|
|
90
|
-
|
|
91
|
-
`boolean`
|
|
92
|
-
|
|
93
|
-
#### Overrides
|
|
94
|
-
|
|
95
|
-
[`BaseChainAdapter`](../../BaseChainAdapter/classes/BaseChainAdapter.md).[`verify`](../../BaseChainAdapter/classes/BaseChainAdapter.md#verify)
|
|
96
|
-
|
|
97
|
-
***
|
|
98
|
-
|
|
99
|
-
### verifyTransactionMatchesCode()
|
|
100
|
-
|
|
101
|
-
> **verifyTransactionMatchesCode**(`actionCode`, `tx`): `void`
|
|
102
|
-
|
|
103
|
-
Defined in: src/adapters/NodeCryptoAdapter.ts:84
|
|
104
|
-
|
|
105
|
-
Validate that a transaction's meta aligns with the bound `actionCode`.
|
|
106
|
-
Throws ProtocolError if validation fails.
|
|
107
|
-
|
|
108
|
-
#### Parameters
|
|
109
|
-
|
|
110
|
-
##### actionCode
|
|
111
|
-
|
|
112
|
-
[`ActionCode`](../../../types/interfaces/ActionCode.md)
|
|
113
|
-
|
|
114
|
-
##### tx
|
|
115
|
-
|
|
116
|
-
###### instructions?
|
|
117
|
-
|
|
118
|
-
`object`[]
|
|
119
|
-
|
|
120
|
-
#### Returns
|
|
121
|
-
|
|
122
|
-
`void`
|
|
123
|
-
|
|
124
|
-
***
|
|
125
|
-
|
|
126
|
-
### verifyTransactionSignedByIntentOwner()
|
|
127
|
-
|
|
128
|
-
> **verifyTransactionSignedByIntentOwner**(`tx`): `void`
|
|
129
|
-
|
|
130
|
-
Defined in: src/adapters/NodeCryptoAdapter.ts:125
|
|
131
|
-
|
|
132
|
-
Verify that the transaction is signed by the "intendedFor" pubkey
|
|
133
|
-
as declared in the protocol meta of the transaction.
|
|
134
|
-
Throws ProtocolError if validation fails.
|
|
135
|
-
|
|
136
|
-
#### Parameters
|
|
137
|
-
|
|
138
|
-
##### tx
|
|
139
|
-
|
|
140
|
-
###### instructions?
|
|
141
|
-
|
|
142
|
-
`object`[]
|
|
143
|
-
|
|
144
|
-
###### signatures?
|
|
145
|
-
|
|
146
|
-
`object`[]
|
|
147
|
-
|
|
148
|
-
#### Returns
|
|
149
|
-
|
|
150
|
-
`void`
|
|
151
|
-
|
|
152
|
-
***
|
|
153
|
-
|
|
154
|
-
### attachProtocolMeta()
|
|
155
|
-
|
|
156
|
-
> `static` **attachProtocolMeta**(`tx`, `meta`): `object`
|
|
157
|
-
|
|
158
|
-
Defined in: src/adapters/NodeCryptoAdapter.ts:159
|
|
159
|
-
|
|
160
|
-
Attach protocol meta to a simulated transaction.
|
|
161
|
-
|
|
162
|
-
#### Parameters
|
|
163
|
-
|
|
164
|
-
##### tx
|
|
165
|
-
|
|
166
|
-
###### instructions?
|
|
167
|
-
|
|
168
|
-
`object`[]
|
|
169
|
-
|
|
170
|
-
##### meta
|
|
171
|
-
|
|
172
|
-
[`ProtocolMetaFields`](../../../utils/protocolMeta/interfaces/ProtocolMetaFields.md)
|
|
173
|
-
|
|
174
|
-
#### Returns
|
|
175
|
-
|
|
176
|
-
`object`
|
|
177
|
-
|
|
178
|
-
##### instructions
|
|
179
|
-
|
|
180
|
-
> **instructions**: `object`[]
|
|
181
|
-
|
|
182
|
-
***
|
|
183
|
-
|
|
184
|
-
### createProtocolMetaInstruction()
|
|
185
|
-
|
|
186
|
-
> `static` **createProtocolMetaInstruction**(`meta`): `object`
|
|
187
|
-
|
|
188
|
-
Defined in: src/adapters/NodeCryptoAdapter.ts:46
|
|
189
|
-
|
|
190
|
-
Create a protocol meta instruction for NodeCrypto (simulated)
|
|
191
|
-
|
|
192
|
-
#### Parameters
|
|
193
|
-
|
|
194
|
-
##### meta
|
|
195
|
-
|
|
196
|
-
[`ProtocolMetaFields`](../../../utils/protocolMeta/interfaces/ProtocolMetaFields.md)
|
|
197
|
-
|
|
198
|
-
#### Returns
|
|
199
|
-
|
|
200
|
-
`object`
|
|
201
|
-
|
|
202
|
-
##### data
|
|
203
|
-
|
|
204
|
-
> **data**: `string`
|
|
205
|
-
|
|
206
|
-
##### type
|
|
207
|
-
|
|
208
|
-
> **type**: `string`
|
|
209
|
-
|
|
210
|
-
***
|
|
211
|
-
|
|
212
|
-
### generateKeyPair()
|
|
213
|
-
|
|
214
|
-
> `static` **generateKeyPair**(): `object`
|
|
215
|
-
|
|
216
|
-
Defined in: src/adapters/NodeCryptoAdapter.ts:185
|
|
217
|
-
|
|
218
|
-
Generate a key pair for testing
|
|
219
|
-
|
|
220
|
-
#### Returns
|
|
221
|
-
|
|
222
|
-
`object`
|
|
223
|
-
|
|
224
|
-
##### privateKey
|
|
225
|
-
|
|
226
|
-
> **privateKey**: `KeyObject`
|
|
227
|
-
|
|
228
|
-
##### publicKey
|
|
229
|
-
|
|
230
|
-
> **publicKey**: `KeyObject`
|
|
231
|
-
|
|
232
|
-
***
|
|
233
|
-
|
|
234
|
-
### signMessage()
|
|
235
|
-
|
|
236
|
-
> `static` **signMessage**(`message`, `privateKey`): `string`
|
|
237
|
-
|
|
238
|
-
Defined in: src/adapters/NodeCryptoAdapter.ts:173
|
|
239
|
-
|
|
240
|
-
Sign a message with a private key
|
|
241
|
-
|
|
242
|
-
#### Parameters
|
|
243
|
-
|
|
244
|
-
##### message
|
|
245
|
-
|
|
246
|
-
`Uint8Array`
|
|
247
|
-
|
|
248
|
-
##### privateKey
|
|
249
|
-
|
|
250
|
-
`KeyObject`
|
|
251
|
-
|
|
252
|
-
#### Returns
|
|
253
|
-
|
|
254
|
-
`string`
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
[**@actioncodes/protocol-v2**](../../../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@actioncodes/protocol-v2](../../../modules.md) / [adapters/NodeCryptoAdapter](../README.md) / NodeCryptoContext
|
|
6
|
-
|
|
7
|
-
# Type Alias: NodeCryptoContext
|
|
8
|
-
|
|
9
|
-
> **NodeCryptoContext** = `object`
|
|
10
|
-
|
|
11
|
-
Defined in: src/adapters/NodeCryptoAdapter.ts:15
|
|
12
|
-
|
|
13
|
-
## Properties
|
|
14
|
-
|
|
15
|
-
### pubkey
|
|
16
|
-
|
|
17
|
-
> **pubkey**: `string`
|
|
18
|
-
|
|
19
|
-
Defined in: src/adapters/NodeCryptoAdapter.ts:16
|
|
20
|
-
|
|
21
|
-
***
|
|
22
|
-
|
|
23
|
-
### signature
|
|
24
|
-
|
|
25
|
-
> **signature**: `string`
|
|
26
|
-
|
|
27
|
-
Defined in: src/adapters/NodeCryptoAdapter.ts:17
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
[**@actioncodes/protocol-v2**](../../../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@actioncodes/protocol-v2](../../../modules.md) / [adapters/SolanaAdapter](../README.md) / SolanaContext
|
|
6
|
-
|
|
7
|
-
# Type Alias: SolanaContext
|
|
8
|
-
|
|
9
|
-
> **SolanaContext** = `object`
|
|
10
|
-
|
|
11
|
-
Defined in: src/adapters/SolanaAdapter.ts:22
|
|
12
|
-
|
|
13
|
-
## Properties
|
|
14
|
-
|
|
15
|
-
### pubkey
|
|
16
|
-
|
|
17
|
-
> **pubkey**: `string` \| `PublicKey`
|
|
18
|
-
|
|
19
|
-
Defined in: src/adapters/SolanaAdapter.ts:23
|
|
20
|
-
|
|
21
|
-
***
|
|
22
|
-
|
|
23
|
-
### signature
|
|
24
|
-
|
|
25
|
-
> **signature**: `string`
|
|
26
|
-
|
|
27
|
-
Defined in: src/adapters/SolanaAdapter.ts:24
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
[**@actioncodes/protocol-v2**](../../../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@actioncodes/protocol-v2](../../../modules.md) / [utils/crypto](../README.md) / generateRandomSecret
|
|
6
|
-
|
|
7
|
-
# Function: generateRandomSecret()
|
|
8
|
-
|
|
9
|
-
> **generateRandomSecret**(): `string`
|
|
10
|
-
|
|
11
|
-
Defined in: src/utils/crypto.ts:102
|
|
12
|
-
|
|
13
|
-
## Returns
|
|
14
|
-
|
|
15
|
-
`string`
|