@actioncodes/protocol 1.1.1 → 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 +9 -3
- package/dist/adapters/base.d.ts.map +1 -1
- package/dist/adapters/solana/solana.d.ts +25 -19
- package/dist/adapters/solana/solana.d.ts.map +1 -1
- package/dist/adapters/solana/solana.js +203 -69
- package/dist/protocol.d.ts +9 -6
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +29 -8
- 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 +46 -18
- package/docs/adapters/solana/solana/classes/SolanaAdapter.md +87 -61
- 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 +45 -27
- package/docs/protocol/interfaces/ProtocolConfig.md +7 -7
- package/package.json +1 -1
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
# Class: ActionCode
|
8
8
|
|
9
|
-
Defined in: [actioncode.ts:32](https://github.com/otaprotocol/actioncodes/blob/
|
9
|
+
Defined in: [actioncode.ts:32](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L32)
|
10
10
|
|
11
11
|
## Constructors
|
12
12
|
|
@@ -14,7 +14,7 @@ Defined in: [actioncode.ts:32](https://github.com/otaprotocol/actioncodes/blob/5
|
|
14
14
|
|
15
15
|
> **new ActionCode**(`fields`): `ActionCode`
|
16
16
|
|
17
|
-
Defined in: [actioncode.ts:33](https://github.com/otaprotocol/actioncodes/blob/
|
17
|
+
Defined in: [actioncode.ts:33](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L33)
|
18
18
|
|
19
19
|
#### Parameters
|
20
20
|
|
@@ -34,7 +34,7 @@ Defined in: [actioncode.ts:33](https://github.com/otaprotocol/actioncodes/blob/5
|
|
34
34
|
|
35
35
|
> **get** **chain**(): `string`
|
36
36
|
|
37
|
-
Defined in: [actioncode.ts:95](https://github.com/otaprotocol/actioncodes/blob/
|
37
|
+
Defined in: [actioncode.ts:95](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L95)
|
38
38
|
|
39
39
|
Get the target chain for this action code
|
40
40
|
|
@@ -52,7 +52,7 @@ Chain identifier (e.g., "solana", "evm")
|
|
52
52
|
|
53
53
|
> **get** **code**(): `string`
|
54
54
|
|
55
|
-
Defined in: [actioncode.ts:111](https://github.com/otaprotocol/actioncodes/blob/
|
55
|
+
Defined in: [actioncode.ts:111](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L111)
|
56
56
|
|
57
57
|
Get the action code string
|
58
58
|
|
@@ -70,7 +70,7 @@ The 8-character action code
|
|
70
70
|
|
71
71
|
> **get** **codeHash**(): `string`
|
72
72
|
|
73
|
-
Defined in: [actioncode.ts:217](https://github.com/otaprotocol/actioncodes/blob/
|
73
|
+
Defined in: [actioncode.ts:217](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L217)
|
74
74
|
|
75
75
|
Get the code hash for this action code
|
76
76
|
it is also used in the protocol meta as the code id
|
@@ -89,7 +89,7 @@ Code hash string
|
|
89
89
|
|
90
90
|
> **get** **description**(): `undefined` \| `string`
|
91
91
|
|
92
|
-
Defined in: [actioncode.ts:151](https://github.com/otaprotocol/actioncodes/blob/
|
92
|
+
Defined in: [actioncode.ts:151](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L151)
|
93
93
|
|
94
94
|
Get a human-readable description of the action
|
95
95
|
|
@@ -107,7 +107,7 @@ Description string or undefined
|
|
107
107
|
|
108
108
|
> **get** **displayString**(): `string`
|
109
109
|
|
110
|
-
Defined in: [actioncode.ts:183](https://github.com/otaprotocol/actioncodes/blob/
|
110
|
+
Defined in: [actioncode.ts:183](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L183)
|
111
111
|
|
112
112
|
Get a human-readable display string for the action code
|
113
113
|
|
@@ -125,7 +125,7 @@ Formatted display string
|
|
125
125
|
|
126
126
|
> **get** **encoded**(): `string`
|
127
127
|
|
128
|
-
Defined in: [actioncode.ts:47](https://github.com/otaprotocol/actioncodes/blob/
|
128
|
+
Defined in: [actioncode.ts:47](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L47)
|
129
129
|
|
130
130
|
##### Returns
|
131
131
|
|
@@ -139,7 +139,7 @@ Defined in: [actioncode.ts:47](https://github.com/otaprotocol/actioncodes/blob/5
|
|
139
139
|
|
140
140
|
> **get** **expired**(): `boolean`
|
141
141
|
|
142
|
-
Defined in: [actioncode.ts:87](https://github.com/otaprotocol/actioncodes/blob/
|
142
|
+
Defined in: [actioncode.ts:87](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L87)
|
143
143
|
|
144
144
|
Check if the action code has expired
|
145
145
|
|
@@ -157,7 +157,7 @@ True if the code has expired
|
|
157
157
|
|
158
158
|
> **get** **json**(): [`ActionCodeFields`](../interfaces/ActionCodeFields.md)
|
159
159
|
|
160
|
-
Defined in: [actioncode.ts:68](https://github.com/otaprotocol/actioncodes/blob/
|
160
|
+
Defined in: [actioncode.ts:68](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L68)
|
161
161
|
|
162
162
|
##### Returns
|
163
163
|
|
@@ -171,7 +171,7 @@ Defined in: [actioncode.ts:68](https://github.com/otaprotocol/actioncodes/blob/5
|
|
171
171
|
|
172
172
|
> **get** **metadata**(): `undefined` \| [`ActionCodeMetadata`](../interfaces/ActionCodeMetadata.md)
|
173
173
|
|
174
|
-
Defined in: [actioncode.ts:143](https://github.com/otaprotocol/actioncodes/blob/
|
174
|
+
Defined in: [actioncode.ts:143](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L143)
|
175
175
|
|
176
176
|
Get metadata associated with this action code
|
177
177
|
|
@@ -189,7 +189,7 @@ Metadata object or undefined
|
|
189
189
|
|
190
190
|
> **get** **params**(): `undefined` \| `Record`\<`string`, `any`\>
|
191
191
|
|
192
|
-
Defined in: [actioncode.ts:159](https://github.com/otaprotocol/actioncodes/blob/
|
192
|
+
Defined in: [actioncode.ts:159](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L159)
|
193
193
|
|
194
194
|
Get parameters associated with this action
|
195
195
|
|
@@ -207,7 +207,7 @@ Parameters object or undefined
|
|
207
207
|
|
208
208
|
> **get** **prefix**(): `string`
|
209
209
|
|
210
|
-
Defined in: [actioncode.ts:119](https://github.com/otaprotocol/actioncodes/blob/
|
210
|
+
Defined in: [actioncode.ts:119](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L119)
|
211
211
|
|
212
212
|
Get the prefix used for this action code
|
213
213
|
|
@@ -225,7 +225,7 @@ Normalized prefix
|
|
225
225
|
|
226
226
|
> **get** **pubkey**(): `string`
|
227
227
|
|
228
|
-
Defined in: [actioncode.ts:127](https://github.com/otaprotocol/actioncodes/blob/
|
228
|
+
Defined in: [actioncode.ts:127](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L127)
|
229
229
|
|
230
230
|
Get the user's public key
|
231
231
|
|
@@ -243,7 +243,7 @@ User's public key
|
|
243
243
|
|
244
244
|
> **get** **remainingTime**(): `number`
|
245
245
|
|
246
|
-
Defined in: [actioncode.ts:78](https://github.com/otaprotocol/actioncodes/blob/
|
246
|
+
Defined in: [actioncode.ts:78](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L78)
|
247
247
|
|
248
248
|
Get remaining time in milliseconds until expiration
|
249
249
|
|
@@ -261,7 +261,7 @@ Remaining time in milliseconds, or 0 if expired
|
|
261
261
|
|
262
262
|
> **get** **remainingTimeString**(): `string`
|
263
263
|
|
264
|
-
Defined in: [actioncode.ts:196](https://github.com/otaprotocol/actioncodes/blob/
|
264
|
+
Defined in: [actioncode.ts:196](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L196)
|
265
265
|
|
266
266
|
Get a formatted time string showing remaining time
|
267
267
|
|
@@ -279,7 +279,7 @@ Human-readable time string (e.g., "1m 30s remaining")
|
|
279
279
|
|
280
280
|
> **get** **signature**(): `string`
|
281
281
|
|
282
|
-
Defined in: [actioncode.ts:175](https://github.com/otaprotocol/actioncodes/blob/
|
282
|
+
Defined in: [actioncode.ts:175](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L175)
|
283
283
|
|
284
284
|
Get the user's signature
|
285
285
|
|
@@ -297,7 +297,7 @@ User's signature string
|
|
297
297
|
|
298
298
|
> **get** **status**(): [`ActionCodeStatus`](../type-aliases/ActionCodeStatus.md)
|
299
299
|
|
300
|
-
Defined in: [actioncode.ts:103](https://github.com/otaprotocol/actioncodes/blob/
|
300
|
+
Defined in: [actioncode.ts:103](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L103)
|
301
301
|
|
302
302
|
Get the current status of the action code
|
303
303
|
|
@@ -315,7 +315,7 @@ Current status
|
|
315
315
|
|
316
316
|
> **get** **timestamp**(): `number`
|
317
317
|
|
318
|
-
Defined in: [actioncode.ts:167](https://github.com/otaprotocol/actioncodes/blob/
|
318
|
+
Defined in: [actioncode.ts:167](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L167)
|
319
319
|
|
320
320
|
Get the timestamp when the code was generated
|
321
321
|
|
@@ -333,7 +333,7 @@ Timestamp in milliseconds
|
|
333
333
|
|
334
334
|
> **get** **transaction**(): `undefined` \| [`ActionCodeTransaction`](../interfaces/ActionCodeTransaction.md)
|
335
335
|
|
336
|
-
Defined in: [actioncode.ts:135](https://github.com/otaprotocol/actioncodes/blob/
|
336
|
+
Defined in: [actioncode.ts:135](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L135)
|
337
337
|
|
338
338
|
Get the transaction data (chain-specific)
|
339
339
|
|
@@ -349,7 +349,7 @@ Transaction data or undefined
|
|
349
349
|
|
350
350
|
> **isValid**(`protocol`): `boolean`
|
351
351
|
|
352
|
-
Defined in: [actioncode.ts:51](https://github.com/otaprotocol/actioncodes/blob/
|
352
|
+
Defined in: [actioncode.ts:51](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L51)
|
353
353
|
|
354
354
|
#### Parameters
|
355
355
|
|
@@ -367,7 +367,7 @@ Defined in: [actioncode.ts:51](https://github.com/otaprotocol/actioncodes/blob/5
|
|
367
367
|
|
368
368
|
> `static` **fromEncoded**(`encoded`): `ActionCode`
|
369
369
|
|
370
|
-
Defined in: [actioncode.ts:42](https://github.com/otaprotocol/actioncodes/blob/
|
370
|
+
Defined in: [actioncode.ts:42](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L42)
|
371
371
|
|
372
372
|
#### Parameters
|
373
373
|
|
@@ -385,7 +385,7 @@ Defined in: [actioncode.ts:42](https://github.com/otaprotocol/actioncodes/blob/5
|
|
385
385
|
|
386
386
|
> `static` **fromPayload**(`input`): `ActionCode`
|
387
387
|
|
388
|
-
Defined in: [actioncode.ts:35](https://github.com/otaprotocol/actioncodes/blob/
|
388
|
+
Defined in: [actioncode.ts:35](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L35)
|
389
389
|
|
390
390
|
#### Parameters
|
391
391
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
# Interface: ActionCodeFields
|
8
8
|
|
9
|
-
Defined in: [actioncode.ts:19](https://github.com/otaprotocol/actioncodes/blob/
|
9
|
+
Defined in: [actioncode.ts:19](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L19)
|
10
10
|
|
11
11
|
## Properties
|
12
12
|
|
@@ -14,7 +14,7 @@ Defined in: [actioncode.ts:19](https://github.com/otaprotocol/actioncodes/blob/5
|
|
14
14
|
|
15
15
|
> **chain**: `"solana"`
|
16
16
|
|
17
|
-
Defined in: [actioncode.ts:25](https://github.com/otaprotocol/actioncodes/blob/
|
17
|
+
Defined in: [actioncode.ts:25](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L25)
|
18
18
|
|
19
19
|
***
|
20
20
|
|
@@ -22,7 +22,7 @@ Defined in: [actioncode.ts:25](https://github.com/otaprotocol/actioncodes/blob/5
|
|
22
22
|
|
23
23
|
> **code**: `string`
|
24
24
|
|
25
|
-
Defined in: [actioncode.ts:20](https://github.com/otaprotocol/actioncodes/blob/
|
25
|
+
Defined in: [actioncode.ts:20](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L20)
|
26
26
|
|
27
27
|
***
|
28
28
|
|
@@ -30,7 +30,7 @@ Defined in: [actioncode.ts:20](https://github.com/otaprotocol/actioncodes/blob/5
|
|
30
30
|
|
31
31
|
> **expiresAt**: `number`
|
32
32
|
|
33
|
-
Defined in: [actioncode.ts:28](https://github.com/otaprotocol/actioncodes/blob/
|
33
|
+
Defined in: [actioncode.ts:28](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L28)
|
34
34
|
|
35
35
|
***
|
36
36
|
|
@@ -38,7 +38,7 @@ Defined in: [actioncode.ts:28](https://github.com/otaprotocol/actioncodes/blob/5
|
|
38
38
|
|
39
39
|
> `optional` **metadata**: [`ActionCodeMetadata`](ActionCodeMetadata.md)
|
40
40
|
|
41
|
-
Defined in: [actioncode.ts:27](https://github.com/otaprotocol/actioncodes/blob/
|
41
|
+
Defined in: [actioncode.ts:27](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L27)
|
42
42
|
|
43
43
|
***
|
44
44
|
|
@@ -46,7 +46,7 @@ Defined in: [actioncode.ts:27](https://github.com/otaprotocol/actioncodes/blob/5
|
|
46
46
|
|
47
47
|
> **prefix**: `string`
|
48
48
|
|
49
|
-
Defined in: [actioncode.ts:21](https://github.com/otaprotocol/actioncodes/blob/
|
49
|
+
Defined in: [actioncode.ts:21](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L21)
|
50
50
|
|
51
51
|
***
|
52
52
|
|
@@ -54,7 +54,7 @@ Defined in: [actioncode.ts:21](https://github.com/otaprotocol/actioncodes/blob/5
|
|
54
54
|
|
55
55
|
> **pubkey**: `string`
|
56
56
|
|
57
|
-
Defined in: [actioncode.ts:22](https://github.com/otaprotocol/actioncodes/blob/
|
57
|
+
Defined in: [actioncode.ts:22](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L22)
|
58
58
|
|
59
59
|
***
|
60
60
|
|
@@ -62,7 +62,7 @@ Defined in: [actioncode.ts:22](https://github.com/otaprotocol/actioncodes/blob/5
|
|
62
62
|
|
63
63
|
> **signature**: `string`
|
64
64
|
|
65
|
-
Defined in: [actioncode.ts:24](https://github.com/otaprotocol/actioncodes/blob/
|
65
|
+
Defined in: [actioncode.ts:24](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L24)
|
66
66
|
|
67
67
|
***
|
68
68
|
|
@@ -70,7 +70,7 @@ Defined in: [actioncode.ts:24](https://github.com/otaprotocol/actioncodes/blob/5
|
|
70
70
|
|
71
71
|
> **status**: [`ActionCodeStatus`](../type-aliases/ActionCodeStatus.md)
|
72
72
|
|
73
|
-
Defined in: [actioncode.ts:29](https://github.com/otaprotocol/actioncodes/blob/
|
73
|
+
Defined in: [actioncode.ts:29](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L29)
|
74
74
|
|
75
75
|
***
|
76
76
|
|
@@ -78,7 +78,7 @@ Defined in: [actioncode.ts:29](https://github.com/otaprotocol/actioncodes/blob/5
|
|
78
78
|
|
79
79
|
> **timestamp**: `number`
|
80
80
|
|
81
|
-
Defined in: [actioncode.ts:23](https://github.com/otaprotocol/actioncodes/blob/
|
81
|
+
Defined in: [actioncode.ts:23](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L23)
|
82
82
|
|
83
83
|
***
|
84
84
|
|
@@ -86,4 +86,4 @@ Defined in: [actioncode.ts:23](https://github.com/otaprotocol/actioncodes/blob/5
|
|
86
86
|
|
87
87
|
> `optional` **transaction**: [`ActionCodeTransaction`](ActionCodeTransaction.md)
|
88
88
|
|
89
|
-
Defined in: [actioncode.ts:26](https://github.com/otaprotocol/actioncodes/blob/
|
89
|
+
Defined in: [actioncode.ts:26](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L26)
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
# Interface: ActionCodeMetadata
|
8
8
|
|
9
|
-
Defined in: [actioncode.ts:8](https://github.com/otaprotocol/actioncodes/blob/
|
9
|
+
Defined in: [actioncode.ts:8](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L8)
|
10
10
|
|
11
11
|
## Properties
|
12
12
|
|
@@ -14,7 +14,7 @@ Defined in: [actioncode.ts:8](https://github.com/otaprotocol/actioncodes/blob/57
|
|
14
14
|
|
15
15
|
> `optional` **description**: `string`
|
16
16
|
|
17
|
-
Defined in: [actioncode.ts:9](https://github.com/otaprotocol/actioncodes/blob/
|
17
|
+
Defined in: [actioncode.ts:9](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L9)
|
18
18
|
|
19
19
|
***
|
20
20
|
|
@@ -22,4 +22,4 @@ Defined in: [actioncode.ts:9](https://github.com/otaprotocol/actioncodes/blob/57
|
|
22
22
|
|
23
23
|
> `optional` **params**: `Record`\<`string`, `any`\>
|
24
24
|
|
25
|
-
Defined in: [actioncode.ts:10](https://github.com/otaprotocol/actioncodes/blob/
|
25
|
+
Defined in: [actioncode.ts:10](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L10)
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
# Interface: ActionCodeTransaction
|
8
8
|
|
9
|
-
Defined in: [actioncode.ts:13](https://github.com/otaprotocol/actioncodes/blob/
|
9
|
+
Defined in: [actioncode.ts:13](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L13)
|
10
10
|
|
11
11
|
## Properties
|
12
12
|
|
@@ -14,7 +14,7 @@ Defined in: [actioncode.ts:13](https://github.com/otaprotocol/actioncodes/blob/5
|
|
14
14
|
|
15
15
|
> `optional` **transaction**: `string`
|
16
16
|
|
17
|
-
Defined in: [actioncode.ts:14](https://github.com/otaprotocol/actioncodes/blob/
|
17
|
+
Defined in: [actioncode.ts:14](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L14)
|
18
18
|
|
19
19
|
***
|
20
20
|
|
@@ -22,7 +22,7 @@ Defined in: [actioncode.ts:14](https://github.com/otaprotocol/actioncodes/blob/5
|
|
22
22
|
|
23
23
|
> `optional` **txSignature**: `string`
|
24
24
|
|
25
|
-
Defined in: [actioncode.ts:15](https://github.com/otaprotocol/actioncodes/blob/
|
25
|
+
Defined in: [actioncode.ts:15](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L15)
|
26
26
|
|
27
27
|
***
|
28
28
|
|
@@ -30,4 +30,4 @@ Defined in: [actioncode.ts:15](https://github.com/otaprotocol/actioncodes/blob/5
|
|
30
30
|
|
31
31
|
> `optional` **txType**: `string`
|
32
32
|
|
33
|
-
Defined in: [actioncode.ts:16](https://github.com/otaprotocol/actioncodes/blob/
|
33
|
+
Defined in: [actioncode.ts:16](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L16)
|
@@ -8,4 +8,4 @@
|
|
8
8
|
|
9
9
|
> **ActionCodeStatus** = `"pending"` \| `"resolved"` \| `"finalized"` \| `"expired"` \| `"error"`
|
10
10
|
|
11
|
-
Defined in: [actioncode.ts:6](https://github.com/otaprotocol/actioncodes/blob/
|
11
|
+
Defined in: [actioncode.ts:6](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/actioncode.ts#L6)
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
# Class: `abstract` BaseChainAdapter\<T\>
|
8
8
|
|
9
|
-
Defined in: [adapters/base.ts:9](https://github.com/otaprotocol/actioncodes/blob/
|
9
|
+
Defined in: [adapters/base.ts:9](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/adapters/base.ts#L9)
|
10
10
|
|
11
11
|
Base adapter class for chain-specific protocol meta operations
|
12
12
|
|
@@ -38,7 +38,7 @@ Chain-specific transaction type
|
|
38
38
|
|
39
39
|
> `abstract` `readonly` **chain**: `string`
|
40
40
|
|
41
|
-
Defined in: [adapters/base.ts:10](https://github.com/otaprotocol/actioncodes/blob/
|
41
|
+
Defined in: [adapters/base.ts:10](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/adapters/base.ts#L10)
|
42
42
|
|
43
43
|
## Methods
|
44
44
|
|
@@ -46,7 +46,7 @@ Defined in: [adapters/base.ts:10](https://github.com/otaprotocol/actioncodes/blo
|
|
46
46
|
|
47
47
|
> `abstract` **decodeMeta**(`tx`): `null` \| [`ProtocolMetaV1`](../../../meta/interfaces/ProtocolMetaV1.md)
|
48
48
|
|
49
|
-
Defined in: [adapters/base.ts:24](https://github.com/otaprotocol/actioncodes/blob/
|
49
|
+
Defined in: [adapters/base.ts:24](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/adapters/base.ts#L24)
|
50
50
|
|
51
51
|
Decode protocol meta from chain-specific transaction
|
52
52
|
|
@@ -70,7 +70,7 @@ Decoded ProtocolMetaV1 or null
|
|
70
70
|
|
71
71
|
> **detectTampering**(`tx`, `authorities`, `expectedPrefix`): `boolean`
|
72
72
|
|
73
|
-
Defined in: [adapters/base.ts:58](https://github.com/otaprotocol/actioncodes/blob/
|
73
|
+
Defined in: [adapters/base.ts:58](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/adapters/base.ts#L58)
|
74
74
|
|
75
75
|
Detect tampered transactions by cross-checking metadata
|
76
76
|
|
@@ -106,7 +106,7 @@ True if transaction is valid and not tampered
|
|
106
106
|
|
107
107
|
> `abstract` **encodeMeta**(`meta`): `any`
|
108
108
|
|
109
|
-
Defined in: [adapters/base.ts:17](https://github.com/otaprotocol/actioncodes/blob/
|
109
|
+
Defined in: [adapters/base.ts:17](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/adapters/base.ts#L17)
|
110
110
|
|
111
111
|
Encode protocol meta for this chain
|
112
112
|
|
@@ -130,7 +130,7 @@ Chain-specific encoded data
|
|
130
130
|
|
131
131
|
> **getCodeSignatureMessage**(`code`, `timestamp`, `prefix`): `string`
|
132
132
|
|
133
|
-
Defined in: [adapters/base.ts:104](https://github.com/otaprotocol/actioncodes/blob/
|
133
|
+
Defined in: [adapters/base.ts:104](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/adapters/base.ts#L104)
|
134
134
|
|
135
135
|
Get the code signature message
|
136
136
|
|
@@ -166,7 +166,7 @@ The code signature message
|
|
166
166
|
|
167
167
|
> `abstract` **hasIssuerSignature**(`tx`, `issuer`): `boolean`
|
168
168
|
|
169
|
-
Defined in: [adapters/base.ts:49](https://github.com/otaprotocol/actioncodes/blob/
|
169
|
+
Defined in: [adapters/base.ts:49](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/adapters/base.ts#L49)
|
170
170
|
|
171
171
|
Check if the issuer has signed the transaction
|
172
172
|
|
@@ -194,19 +194,19 @@ True if issuer has signed
|
|
194
194
|
|
195
195
|
### injectMeta()
|
196
196
|
|
197
|
-
> `abstract` **injectMeta**(`
|
197
|
+
> `abstract` **injectMeta**(`serializedTx`, `meta`): `string`
|
198
198
|
|
199
|
-
Defined in: [adapters/base.ts:32](https://github.com/otaprotocol/actioncodes/blob/
|
199
|
+
Defined in: [adapters/base.ts:32](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/adapters/base.ts#L32)
|
200
200
|
|
201
201
|
Inject protocol meta into chain-specific transaction
|
202
202
|
|
203
203
|
#### Parameters
|
204
204
|
|
205
|
-
#####
|
205
|
+
##### serializedTx
|
206
206
|
|
207
|
-
`
|
207
|
+
`string`
|
208
208
|
|
209
|
-
|
209
|
+
Serialized transaction string
|
210
210
|
|
211
211
|
##### meta
|
212
212
|
|
@@ -216,9 +216,9 @@ ProtocolMetaV1 object
|
|
216
216
|
|
217
217
|
#### Returns
|
218
218
|
|
219
|
-
`
|
219
|
+
`string`
|
220
220
|
|
221
|
-
|
221
|
+
Serialized transaction with injected meta
|
222
222
|
|
223
223
|
***
|
224
224
|
|
@@ -226,7 +226,7 @@ Chain-specific transaction with injected meta
|
|
226
226
|
|
227
227
|
> `abstract` **signWithProtocolKey**(`actionCode`, `key`): `Promise`\<[`ActionCode`](../../../actioncode/classes/ActionCode.md)\>
|
228
228
|
|
229
|
-
Defined in: [adapters/base.ts:126](https://github.com/otaprotocol/actioncodes/blob/
|
229
|
+
Defined in: [adapters/base.ts:126](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/adapters/base.ts#L126)
|
230
230
|
|
231
231
|
Sign the transaction with the protocol key using a callback approach
|
232
232
|
This method should be implemented by each chain-specific adapter to handle
|
@@ -254,7 +254,7 @@ Promise that resolves to the signed transaction
|
|
254
254
|
|
255
255
|
> `abstract` **validate**(`tx`, `authorities`, `expectedPrefix?`): `boolean`
|
256
256
|
|
257
|
-
Defined in: [adapters/base.ts:41](https://github.com/otaprotocol/actioncodes/blob/
|
257
|
+
Defined in: [adapters/base.ts:41](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/adapters/base.ts#L41)
|
258
258
|
|
259
259
|
Validate transaction with protocol meta and authority list
|
260
260
|
|
@@ -290,7 +290,7 @@ True if transaction is valid
|
|
290
290
|
|
291
291
|
> `abstract` `protected` **validateTransactionIntegrity**(`tx`, `meta`): `boolean`
|
292
292
|
|
293
|
-
Defined in: [adapters/base.ts:95](https://github.com/otaprotocol/actioncodes/blob/
|
293
|
+
Defined in: [adapters/base.ts:95](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/adapters/base.ts#L95)
|
294
294
|
|
295
295
|
Chain-specific transaction integrity validation
|
296
296
|
Override this method for additional validation logic
|
@@ -321,7 +321,7 @@ True if transaction integrity is valid
|
|
321
321
|
|
322
322
|
> `abstract` **verifyCodeSignature**(`actionCode`): `boolean`
|
323
323
|
|
324
|
-
Defined in: [adapters/base.ts:115](https://github.com/otaprotocol/actioncodes/blob/
|
324
|
+
Defined in: [adapters/base.ts:115](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/adapters/base.ts#L115)
|
325
325
|
|
326
326
|
Verify the code signature
|
327
327
|
This is specific to the chain and should be implemented by the concrete adapter
|
@@ -340,3 +340,31 @@ The action code to verify
|
|
340
340
|
`boolean`
|
341
341
|
|
342
342
|
True if the code signature is valid
|
343
|
+
|
344
|
+
***
|
345
|
+
|
346
|
+
### verifyFinalizedTransaction()
|
347
|
+
|
348
|
+
> `abstract` **verifyFinalizedTransaction**(`tx`, `actionCode`): `boolean`
|
349
|
+
|
350
|
+
Defined in: [adapters/base.ts:136](https://github.com/otaprotocol/actioncodes/blob/a8b35c1388affc2365ea89beead5f92a97b38de7/src/adapters/base.ts#L136)
|
351
|
+
|
352
|
+
Verify the finalized transaction
|
353
|
+
|
354
|
+
#### Parameters
|
355
|
+
|
356
|
+
##### tx
|
357
|
+
|
358
|
+
`any`
|
359
|
+
|
360
|
+
The finalized transaction to verify
|
361
|
+
|
362
|
+
##### actionCode
|
363
|
+
|
364
|
+
[`ActionCode`](../../../actioncode/classes/ActionCode.md)
|
365
|
+
|
366
|
+
#### Returns
|
367
|
+
|
368
|
+
`boolean`
|
369
|
+
|
370
|
+
True if the transaction is valid
|