@actioncodes/protocol 1.1.2 → 1.1.3
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/dist/adapters/base.d.ts +6 -0
- package/dist/adapters/base.d.ts.map +1 -1
- package/dist/adapters/solana/solana.d.ts +8 -1
- package/dist/adapters/solana/solana.d.ts.map +1 -1
- package/dist/adapters/solana/solana.js +104 -0
- package/docs/actioncode/classes/ActionCode.md +23 -23
- package/docs/actioncode/interfaces/ActionCodeFields.md +11 -11
- package/docs/actioncode/interfaces/ActionCodeMetadata.md +3 -3
- package/docs/actioncode/interfaces/ActionCodeTransaction.md +4 -4
- package/docs/actioncode/type-aliases/ActionCodeStatus.md +1 -1
- package/docs/adapters/base/classes/BaseChainAdapter.md +40 -12
- package/docs/adapters/solana/solana/classes/SolanaAdapter.md +48 -14
- package/docs/adapters/solana/solana/type-aliases/SolanaTransaction.md +1 -1
- package/docs/codegen/classes/CodeGenerator.md +14 -14
- package/docs/constants/type-aliases/SupportedChain.md +1 -1
- package/docs/constants/variables/CODE_LENGTH.md +1 -1
- package/docs/constants/variables/CODE_TTL.md +1 -1
- package/docs/constants/variables/MAX_PREFIX_LENGTH.md +1 -1
- package/docs/constants/variables/MIN_PREFIX_LENGTH.md +1 -1
- package/docs/constants/variables/PROTOCOL_CODE_PREFIX.md +1 -1
- package/docs/constants/variables/PROTOCOL_PREFIX.md +1 -1
- package/docs/constants/variables/PROTOCOL_VERSION.md +1 -1
- package/docs/constants/variables/SUPPORTED_CHAINS.md +1 -1
- package/docs/meta/classes/ProtocolMetaParser.md +6 -6
- package/docs/meta/interfaces/ProtocolMetaV1.md +7 -7
- package/docs/protocol/classes/ActionCodesProtocol.md +21 -21
- package/docs/protocol/interfaces/ProtocolConfig.md +7 -7
- package/package.json +1 -1
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
# Class: ActionCodesProtocol
|
8
8
|
|
9
|
-
Defined in: [protocol.ts:31](https://github.com/otaprotocol/actioncodes/blob/
|
9
|
+
Defined in: [protocol.ts:31](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L31)
|
10
10
|
|
11
11
|
OTA Protocol - Main entry point for the One-Time Action Code Protocol
|
12
12
|
|
@@ -19,7 +19,7 @@ action codes across multiple blockchain networks.
|
|
19
19
|
|
20
20
|
> **new ActionCodesProtocol**(`config?`): `ActionCodesProtocol`
|
21
21
|
|
22
|
-
Defined in: [protocol.ts:35](https://github.com/otaprotocol/actioncodes/blob/
|
22
|
+
Defined in: [protocol.ts:35](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L35)
|
23
23
|
|
24
24
|
#### Parameters
|
25
25
|
|
@@ -37,7 +37,7 @@ Defined in: [protocol.ts:35](https://github.com/otaprotocol/actioncodes/blob/8a4
|
|
37
37
|
|
38
38
|
> **attachTransaction**(`actionCode`, `transaction`, `issuer`, `params?`, `txType?`): [`ActionCode`](../../actioncode/classes/ActionCode.md)
|
39
39
|
|
40
|
-
Defined in: [protocol.ts:163](https://github.com/otaprotocol/actioncodes/blob/
|
40
|
+
Defined in: [protocol.ts:163](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L163)
|
41
41
|
|
42
42
|
Attach a transaction to an action code with automatic protocol meta injection
|
43
43
|
|
@@ -85,7 +85,7 @@ Updated ActionCode with injected protocol meta
|
|
85
85
|
|
86
86
|
> **createActionCode**(`pubkey`, `signFn`, `chain`, `prefix`, `timestamp?`): `Promise`\<[`ActionCode`](../../actioncode/classes/ActionCode.md)\>
|
87
87
|
|
88
|
-
Defined in: [protocol.ts:111](https://github.com/otaprotocol/actioncodes/blob/
|
88
|
+
Defined in: [protocol.ts:111](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L111)
|
89
89
|
|
90
90
|
Create an action code
|
91
91
|
|
@@ -133,7 +133,7 @@ Promise resolving to a complete ActionCode object
|
|
133
133
|
|
134
134
|
> **createProtocolMeta**(`actionCode`, `issuer?`, `params?`, `timestamp?`): [`ProtocolMetaV1`](../../meta/interfaces/ProtocolMetaV1.md)
|
135
135
|
|
136
|
-
Defined in: [protocol.ts:252](https://github.com/otaprotocol/actioncodes/blob/
|
136
|
+
Defined in: [protocol.ts:252](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L252)
|
137
137
|
|
138
138
|
Create protocol meta for a transaction
|
139
139
|
|
@@ -175,7 +175,7 @@ ProtocolMetaV1 object
|
|
175
175
|
|
176
176
|
> **decodeProtocolMeta**(`transaction`, `chain`): `null` \| [`ProtocolMetaV1`](../../meta/interfaces/ProtocolMetaV1.md)
|
177
177
|
|
178
|
-
Defined in: [protocol.ts:288](https://github.com/otaprotocol/actioncodes/blob/
|
178
|
+
Defined in: [protocol.ts:288](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L288)
|
179
179
|
|
180
180
|
Decode protocol meta from a transaction
|
181
181
|
|
@@ -205,7 +205,7 @@ Decoded ProtocolMetaV1 or null
|
|
205
205
|
|
206
206
|
> **decodeProtocolMetaTyped**\<`T`\>(`transaction`, `chain`): `null` \| [`ProtocolMetaV1`](../../meta/interfaces/ProtocolMetaV1.md)
|
207
207
|
|
208
|
-
Defined in: [protocol.ts:370](https://github.com/otaprotocol/actioncodes/blob/
|
208
|
+
Defined in: [protocol.ts:370](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L370)
|
209
209
|
|
210
210
|
Decode protocol meta with type safety
|
211
211
|
|
@@ -241,7 +241,7 @@ Decoded ProtocolMetaV1 or null
|
|
241
241
|
|
242
242
|
> **detectTampering**\<`T`\>(`transaction`, `chain`, `authorities`, `expectedPrefix?`): `boolean`
|
243
243
|
|
244
|
-
Defined in: [protocol.ts:350](https://github.com/otaprotocol/actioncodes/blob/
|
244
|
+
Defined in: [protocol.ts:350](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L350)
|
245
245
|
|
246
246
|
Detect tampered transactions with type safety
|
247
247
|
|
@@ -289,7 +289,7 @@ True if transaction is valid and not tampered
|
|
289
289
|
|
290
290
|
> **encodeProtocolMeta**(`meta`, `chain`): `any`
|
291
291
|
|
292
|
-
Defined in: [protocol.ts:273](https://github.com/otaprotocol/actioncodes/blob/
|
292
|
+
Defined in: [protocol.ts:273](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L273)
|
293
293
|
|
294
294
|
Encode protocol meta for a specific chain
|
295
295
|
|
@@ -319,7 +319,7 @@ Chain-specific encoded meta
|
|
319
319
|
|
320
320
|
> **finalizeActionCode**(`actionCode`, `txSignature`): [`ActionCode`](../../actioncode/classes/ActionCode.md)
|
321
321
|
|
322
|
-
Defined in: [protocol.ts:219](https://github.com/otaprotocol/actioncodes/blob/
|
322
|
+
Defined in: [protocol.ts:219](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L219)
|
323
323
|
|
324
324
|
Finalize an action code with transaction signature
|
325
325
|
|
@@ -349,7 +349,7 @@ Updated ActionCode
|
|
349
349
|
|
350
350
|
> **getChainAdapter**\<`T`\>(`chain`): `undefined` \| [`BaseChainAdapter`](../../adapters/base/classes/BaseChainAdapter.md)\<`T`\>
|
351
351
|
|
352
|
-
Defined in: [protocol.ts:77](https://github.com/otaprotocol/actioncodes/blob/
|
352
|
+
Defined in: [protocol.ts:77](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L77)
|
353
353
|
|
354
354
|
Get chain adapter with proper typing
|
355
355
|
|
@@ -379,7 +379,7 @@ Chain adapter or undefined
|
|
379
379
|
|
380
380
|
> **getConfig**(): [`ProtocolConfig`](../interfaces/ProtocolConfig.md)
|
381
381
|
|
382
|
-
Defined in: [protocol.ts:383](https://github.com/otaprotocol/actioncodes/blob/
|
382
|
+
Defined in: [protocol.ts:383](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L383)
|
383
383
|
|
384
384
|
Get protocol configuration
|
385
385
|
|
@@ -395,7 +395,7 @@ Current protocol configuration
|
|
395
395
|
|
396
396
|
> **getRegisteredChains**(): `string`[]
|
397
397
|
|
398
|
-
Defined in: [protocol.ts:59](https://github.com/otaprotocol/actioncodes/blob/
|
398
|
+
Defined in: [protocol.ts:59](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L59)
|
399
399
|
|
400
400
|
Get registered chain adapters
|
401
401
|
|
@@ -411,7 +411,7 @@ Array of registered chain identifiers
|
|
411
411
|
|
412
412
|
> **isChainSupported**(`chain`): `boolean`
|
413
413
|
|
414
|
-
Defined in: [protocol.ts:68](https://github.com/otaprotocol/actioncodes/blob/
|
414
|
+
Defined in: [protocol.ts:68](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L68)
|
415
415
|
|
416
416
|
Check if a chain is supported
|
417
417
|
|
@@ -435,7 +435,7 @@ True if chain is supported
|
|
435
435
|
|
436
436
|
> **registerAdapter**\<`T`\>(`adapter`): `void`
|
437
437
|
|
438
|
-
Defined in: [protocol.ts:51](https://github.com/otaprotocol/actioncodes/blob/
|
438
|
+
Defined in: [protocol.ts:51](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L51)
|
439
439
|
|
440
440
|
Register a chain adapter
|
441
441
|
|
@@ -463,7 +463,7 @@ Chain adapter implementation
|
|
463
463
|
|
464
464
|
> **updateConfig**(`updates`): `void`
|
465
465
|
|
466
|
-
Defined in: [protocol.ts:391](https://github.com/otaprotocol/actioncodes/blob/
|
466
|
+
Defined in: [protocol.ts:391](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L391)
|
467
467
|
|
468
468
|
Update protocol configuration
|
469
469
|
|
@@ -485,7 +485,7 @@ Configuration updates
|
|
485
485
|
|
486
486
|
> **validateActionCode**(`actionCode`): `boolean`
|
487
487
|
|
488
|
-
Defined in: [protocol.ts:86](https://github.com/otaprotocol/actioncodes/blob/
|
488
|
+
Defined in: [protocol.ts:86](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L86)
|
489
489
|
|
490
490
|
Validate an action code
|
491
491
|
|
@@ -509,7 +509,7 @@ True if valid
|
|
509
509
|
|
510
510
|
> **validateTransaction**(`transaction`, `chain`, `authorities`, `expectedPrefix?`): `boolean`
|
511
511
|
|
512
|
-
Defined in: [protocol.ts:305](https://github.com/otaprotocol/actioncodes/blob/
|
512
|
+
Defined in: [protocol.ts:305](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L305)
|
513
513
|
|
514
514
|
Validate a transaction with protocol meta
|
515
515
|
|
@@ -551,7 +551,7 @@ True if transaction is valid
|
|
551
551
|
|
552
552
|
> **validateTransactionTyped**\<`T`\>(`transaction`, `chain`, `authorities`, `expectedPrefix?`): `boolean`
|
553
553
|
|
554
|
-
Defined in: [protocol.ts:328](https://github.com/otaprotocol/actioncodes/blob/
|
554
|
+
Defined in: [protocol.ts:328](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L328)
|
555
555
|
|
556
556
|
Type-safe transaction validation for specific chains
|
557
557
|
|
@@ -599,7 +599,7 @@ True if transaction is valid
|
|
599
599
|
|
600
600
|
> `static` **create**(): `ActionCodesProtocol`
|
601
601
|
|
602
|
-
Defined in: [protocol.ts:399](https://github.com/otaprotocol/actioncodes/blob/
|
602
|
+
Defined in: [protocol.ts:399](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L399)
|
603
603
|
|
604
604
|
Create a new protocol instance with default configuration
|
605
605
|
|
@@ -615,7 +615,7 @@ New protocol instance
|
|
615
615
|
|
616
616
|
> `static` **createWithConfig**(`config`): `ActionCodesProtocol`
|
617
617
|
|
618
|
-
Defined in: [protocol.ts:408](https://github.com/otaprotocol/actioncodes/blob/
|
618
|
+
Defined in: [protocol.ts:408](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L408)
|
619
619
|
|
620
620
|
Create a new protocol instance with custom configuration
|
621
621
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
# Interface: ProtocolConfig
|
8
8
|
|
9
|
-
Defined in: [protocol.ts:10](https://github.com/otaprotocol/actioncodes/blob/
|
9
|
+
Defined in: [protocol.ts:10](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L10)
|
10
10
|
|
11
11
|
OTA Protocol Configuration
|
12
12
|
|
@@ -16,7 +16,7 @@ OTA Protocol Configuration
|
|
16
16
|
|
17
17
|
> **codeLength**: `number`
|
18
18
|
|
19
|
-
Defined in: [protocol.ts:18](https://github.com/otaprotocol/actioncodes/blob/
|
19
|
+
Defined in: [protocol.ts:18](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L18)
|
20
20
|
|
21
21
|
Code length in digits
|
22
22
|
|
@@ -26,7 +26,7 @@ Code length in digits
|
|
26
26
|
|
27
27
|
> **codeTTL**: `number`
|
28
28
|
|
29
|
-
Defined in: [protocol.ts:16](https://github.com/otaprotocol/actioncodes/blob/
|
29
|
+
Defined in: [protocol.ts:16](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L16)
|
30
30
|
|
31
31
|
Code TTL in milliseconds
|
32
32
|
|
@@ -36,7 +36,7 @@ Code TTL in milliseconds
|
|
36
36
|
|
37
37
|
> **defaultPrefix**: `string`
|
38
38
|
|
39
|
-
Defined in: [protocol.ts:14](https://github.com/otaprotocol/actioncodes/blob/
|
39
|
+
Defined in: [protocol.ts:14](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L14)
|
40
40
|
|
41
41
|
Default prefix for action codes
|
42
42
|
|
@@ -46,7 +46,7 @@ Default prefix for action codes
|
|
46
46
|
|
47
47
|
> **maxPrefixLength**: `number`
|
48
48
|
|
49
|
-
Defined in: [protocol.ts:20](https://github.com/otaprotocol/actioncodes/blob/
|
49
|
+
Defined in: [protocol.ts:20](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L20)
|
50
50
|
|
51
51
|
Maximum prefix length
|
52
52
|
|
@@ -56,7 +56,7 @@ Maximum prefix length
|
|
56
56
|
|
57
57
|
> **minPrefixLength**: `number`
|
58
58
|
|
59
|
-
Defined in: [protocol.ts:22](https://github.com/otaprotocol/actioncodes/blob/
|
59
|
+
Defined in: [protocol.ts:22](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L22)
|
60
60
|
|
61
61
|
Minimum prefix length
|
62
62
|
|
@@ -66,6 +66,6 @@ Minimum prefix length
|
|
66
66
|
|
67
67
|
> **version**: `string`
|
68
68
|
|
69
|
-
Defined in: [protocol.ts:12](https://github.com/otaprotocol/actioncodes/blob/
|
69
|
+
Defined in: [protocol.ts:12](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/protocol.ts#L12)
|
70
70
|
|
71
71
|
Protocol version
|