@agoric/portfolio-api 0.2.0 → 0.2.1-upgrade-23-dev-bd79330.0.bd79330

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.
Files changed (38) hide show
  1. package/package.json +26 -28
  2. package/src/constants.d.ts +115 -0
  3. package/src/constants.d.ts.map +1 -0
  4. package/src/constants.js +170 -13
  5. package/src/evm/types.d.ts +19 -0
  6. package/src/evm/types.d.ts.map +1 -0
  7. package/src/evm/types.js +27 -0
  8. package/src/evm-wallet/eip712-messages.d.ts +213 -0
  9. package/src/evm-wallet/eip712-messages.d.ts.map +1 -0
  10. package/src/evm-wallet/eip712-messages.js +355 -0
  11. package/src/evm-wallet/message-handler-helpers.d.ts +54 -0
  12. package/src/evm-wallet/message-handler-helpers.d.ts.map +1 -0
  13. package/src/evm-wallet/message-handler-helpers.js +289 -0
  14. package/src/instruments.d.ts +54 -0
  15. package/src/instruments.d.ts.map +1 -0
  16. package/src/instruments.js +69 -0
  17. package/src/main.d.ts +6 -0
  18. package/src/main.d.ts.map +1 -0
  19. package/src/main.js +6 -1
  20. package/src/model/generated/ymax-machine.d.ts +71 -0
  21. package/src/model/generated/ymax-machine.d.ts.map +1 -0
  22. package/src/model/generated/ymax-machine.js +1292 -0
  23. package/src/model/ymax-machine.mmd +56 -0
  24. package/src/model/ymax-machine.schema.json +180 -0
  25. package/src/model/ymax-machine.yaml +942 -0
  26. package/src/portfolio-constants.d.ts +44 -0
  27. package/src/portfolio-constants.d.ts.map +1 -0
  28. package/src/portfolio-constants.js +80 -0
  29. package/src/resolver.d.ts +159 -0
  30. package/src/resolver.d.ts.map +1 -0
  31. package/src/resolver.js +115 -0
  32. package/src/type-guards.d.ts +39 -0
  33. package/src/type-guards.d.ts.map +1 -0
  34. package/src/type-guards.js +71 -0
  35. package/src/types.d.ts +296 -0
  36. package/src/types.d.ts.map +1 -0
  37. package/src/types.js +337 -0
  38. package/src/types.ts +0 -1
@@ -0,0 +1,289 @@
1
+ /**
2
+ * @file Helpers to handle portfolio EIP-712 messages, extracting operation and
3
+ * deposit permit details, as well as verifying the signature.
4
+ *
5
+ * The viem runtime dependency is expected as a power to make this usable both
6
+ * on chain and in off-chain services.
7
+ */
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+ import {
22
+ encodeType,
23
+
24
+ } from '@agoric/orchestration/src/utils/viem.js';
25
+ import {
26
+ extractWitnessFieldFromTypes,
27
+ isPermit2MessageType,
28
+ makeWitnessTypeStringExtractor,
29
+
30
+ } from '@agoric/orchestration/src/utils/permit2.js';
31
+ import {
32
+
33
+
34
+
35
+
36
+ splitWitnessFieldType,
37
+ validateYmaxDomain,
38
+ validateYmaxOperationTypeName,
39
+ getYmaxOperationTypes,
40
+
41
+ } from './eip712-messages.js';
42
+
43
+ ;
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+ ;
54
+
55
+
56
+
57
+
58
+ ;
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+ ;
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+ /**
76
+ * EVM Message handler utils that depend on 'viem' utils for their
77
+ * implementation. Since on-chain we cannot directly import from 'viem',
78
+ * use a maker pattern to create these utils.
79
+ */
80
+ export const makeEVMHandlerUtils = (viemUtils
81
+
82
+
83
+
84
+
85
+
86
+ ) => {
87
+ const {
88
+ isHex,
89
+ hashStruct,
90
+ recoverTypedDataAddress,
91
+ validateTypedData,
92
+ encodeType,
93
+ } = viemUtils;
94
+
95
+ const getPermit2WitnessTypeString = makeWitnessTypeStringExtractor({
96
+ encodeType,
97
+ });
98
+
99
+ /**
100
+ * Extract operation type name and data from an EIP-712 standalone Ymax typed data
101
+ *
102
+ * @param data - The EIP-712 typed data of a standalone message
103
+ * @param validContractAddresses - *Deprecated*
104
+ * @returns The operation type name and associated data
105
+ */
106
+ const extractOperationDetailsFromStandaloneData = (
107
+
108
+
109
+ data ,
110
+ validContractAddresses ,
111
+ ) => {
112
+ // @ts-expect-error generic/union type compatibility
113
+ const standaloneData = data;
114
+
115
+ const { domain } = standaloneData;
116
+
117
+ validateYmaxDomain(domain, validContractAddresses);
118
+ validateYmaxOperationTypeName (standaloneData.primaryType);
119
+
120
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
121
+ const { nonce, deadline, ..._operationData } = standaloneData.message;
122
+ const operationData = _operationData ;
123
+ const operation = standaloneData.primaryType;
124
+ // @ts-expect-error inference issue
125
+ validateTypedData({
126
+ types: getYmaxOperationTypes(operation),
127
+ message: operationData,
128
+ primaryType: operation,
129
+ });
130
+ return { operation, domain, data: operationData };
131
+ };
132
+
133
+ /**
134
+ * Extract operation type name and data from an EIP-712 Permit2 witness typed data.
135
+ *
136
+ * @param data - The EIP-712 typed data of a Permit2 witness message
137
+ * @returns The operation type name and associated data
138
+ */
139
+ const extractOperationDetailsFromPermit2WitnessData = (
140
+
141
+
142
+ data ,
143
+ ) => {
144
+ // @ts-expect-error generic/union type compatibility
145
+ const permitData = data;
146
+
147
+ const witnessField = extractWitnessFieldFromTypes(permitData.types);
148
+ const witnessData = permitData.message[
149
+ witnessField.name
150
+ ] ;
151
+ const { primaryType, domain } = splitWitnessFieldType(witnessField.type);
152
+ const chainId = BigInt((data.domain ).chainId );
153
+ const operation = primaryType ;
154
+ // @ts-expect-error inference issue
155
+ validateTypedData({
156
+ types: getYmaxOperationTypes(operation),
157
+ message: witnessData,
158
+ primaryType: operation,
159
+ });
160
+ const spender = permitData.message.spender;
161
+ return {
162
+ operation,
163
+ domain: { ...domain, chainId, verifyingContract: spender },
164
+ data: witnessData,
165
+ };
166
+ };
167
+
168
+ /**
169
+ * Extract the data that can be used as partial arguments to permit2's
170
+ * permitWitnessTransferFrom
171
+ *
172
+ * This does not verify the signature; that is expected to be done by the caller.
173
+ *
174
+ * @param data permit2 message with witness data to summarize
175
+ * @param owner address of the permit2 message signer
176
+ * @param signature signature of the permit2 message
177
+ */
178
+ const extractPermitDetails = (
179
+ data ,
180
+ owner ,
181
+ signature ,
182
+ ) => {
183
+ // @ts-expect-error generic/union type compatibility
184
+ const permitData = data;
185
+
186
+ if (!isHex(signature)) {
187
+ throw new Error(`Invalid signature format: ${signature}`);
188
+ }
189
+
190
+ const witnessField = extractWitnessFieldFromTypes(permitData.types);
191
+ const { [witnessField.name]: witnessData, ...permit } = permitData.message;
192
+ const witness = hashStruct({
193
+ primaryType: witnessField.type,
194
+ types: permitData.types,
195
+ data: witnessData,
196
+ });
197
+ const witnessTypeString = getPermit2WitnessTypeString(permitData.types);
198
+
199
+ const { spender, ...permitStruct } = permit;
200
+
201
+ const permit2Payload
202
+
203
+
204
+ = {
205
+ permit: permitStruct,
206
+ owner,
207
+ witness,
208
+ witnessTypeString,
209
+ signature,
210
+ };
211
+
212
+ const details = {
213
+ chainId: permitData.domain .chainId ,
214
+ token: permit.permitted.token,
215
+ amount: permit.permitted.amount,
216
+ permit2Payload,
217
+ spender,
218
+ };
219
+
220
+ return details;
221
+ };
222
+
223
+ /**
224
+ * Extract all details sufficient to handle any EIP-712 portfolio message,
225
+ * optionally with permit data.
226
+ *
227
+ * @param signedData
228
+ * @param validStandaloneContractAddresses *Deprecated*
229
+ */
230
+ const extractOperationDetailsFromSignedData = async (
231
+
232
+
233
+ signedData
234
+
235
+ ,
236
+ validStandaloneContractAddresses ,
237
+ ) => {
238
+ const tokenOwner = await recoverTypedDataAddress(
239
+ signedData ,
240
+ );
241
+ const { nonce, deadline } = (
242
+ signedData
243
+
244
+
245
+ ).message;
246
+
247
+ if (isPermit2MessageType(signedData.primaryType)) {
248
+ const permit2Data =
249
+ signedData ;
250
+
251
+ const permitDetails = extractPermitDetails(
252
+ permit2Data,
253
+ tokenOwner,
254
+ signedData.signature,
255
+ );
256
+ const operationDetails =
257
+ extractOperationDetailsFromPermit2WitnessData(permit2Data);
258
+
259
+ return {
260
+ ...operationDetails,
261
+ permitDetails,
262
+ evmWalletAddress: tokenOwner,
263
+ nonce,
264
+ deadline,
265
+ };
266
+ } else {
267
+ const standaloneData =
268
+ signedData ;
269
+ const operationDetails = extractOperationDetailsFromStandaloneData(
270
+ standaloneData,
271
+ validStandaloneContractAddresses,
272
+ );
273
+
274
+ return {
275
+ ...operationDetails,
276
+ evmWalletAddress: tokenOwner,
277
+ nonce,
278
+ deadline,
279
+ };
280
+ }
281
+ };
282
+
283
+ return {
284
+ extractOperationDetailsFromStandaloneData,
285
+ extractOperationDetailsFromPermit2WitnessData,
286
+ extractPermitDetails,
287
+ extractOperationDetailsFromSignedData,
288
+ };
289
+ };
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Mnemonic IDs for supported financial instruments in which a portfolio can use
3
+ * assets to take a position.
4
+ *
5
+ * These identifiers are to be treated as opaque strings, but must not start
6
+ * with punctuation that could result in them being misinterpreted as any other
7
+ * kind of {@link AssetPlaceRef} (e.g., a `<`-prefixed {@link SeatKeyword} or
8
+ * `@`-prefixed {@link InterChainAccountRef}), and in fact must start with an
9
+ * ASCII letter unless the implementation of {@link isInstrumentId} is relaxed.
10
+ * There are separate data structures to map them to functional interfaces for
11
+ * interoperation.
12
+ */
13
+ export type InstrumentId = (typeof InstrumentId)[keyof typeof InstrumentId];
14
+ export namespace InstrumentId {
15
+ let Aave_Arbitrum: "Aave_Arbitrum";
16
+ let Aave_Avalanche: "Aave_Avalanche";
17
+ let Aave_Base: "Aave_Base";
18
+ let Aave_Ethereum: "Aave_Ethereum";
19
+ let Aave_Optimism: "Aave_Optimism";
20
+ let Beefy_compoundUsdc_Arbitrum: "Beefy_compoundUsdc_Arbitrum";
21
+ let Beefy_compoundUsdc_Optimism: "Beefy_compoundUsdc_Optimism";
22
+ let Beefy_morphoGauntletUsdc_Ethereum: "Beefy_morphoGauntletUsdc_Ethereum";
23
+ let Beefy_morphoSeamlessUsdc_Base: "Beefy_morphoSeamlessUsdc_Base";
24
+ let Beefy_morphoSmokehouseUsdc_Ethereum: "Beefy_morphoSmokehouseUsdc_Ethereum";
25
+ let Beefy_re7_Avalanche: "Beefy_re7_Avalanche";
26
+ let Compound_Arbitrum: "Compound_Arbitrum";
27
+ let Compound_Base: "Compound_Base";
28
+ let Compound_Ethereum: "Compound_Ethereum";
29
+ let Compound_Optimism: "Compound_Optimism";
30
+ let ERC4626_vaultU2_Ethereum: "ERC4626_vaultU2_Ethereum";
31
+ let ERC4626_morphoClearstarHighYieldUsdc_Ethereum: "ERC4626_morphoClearstarHighYieldUsdc_Ethereum";
32
+ let ERC4626_morphoClearstarUsdcCore_Ethereum: "ERC4626_morphoClearstarUsdcCore_Ethereum";
33
+ let ERC4626_morphoGauntletUsdcRwa_Ethereum: "ERC4626_morphoGauntletUsdcRwa_Ethereum";
34
+ let ERC4626_morphoSteakhouseHighYieldInstant_Ethereum: "ERC4626_morphoSteakhouseHighYieldInstant_Ethereum";
35
+ let ERC4626_morphoClearstarInstitutionalUsdc_Ethereum: "ERC4626_morphoClearstarInstitutionalUsdc_Ethereum";
36
+ let ERC4626_morphoClearstarUsdcReactor_Ethereum: "ERC4626_morphoClearstarUsdcReactor_Ethereum";
37
+ let ERC4626_morphoAlphaUsdcCore_Ethereum: "ERC4626_morphoAlphaUsdcCore_Ethereum";
38
+ let ERC4626_morphoResolvUsdc_Ethereum: "ERC4626_morphoResolvUsdc_Ethereum";
39
+ let ERC4626_morphoGauntletUsdcFrontier_Ethereum: "ERC4626_morphoGauntletUsdcFrontier_Ethereum";
40
+ let ERC4626_morphoHyperithmUsdcMidcurve_Ethereum: "ERC4626_morphoHyperithmUsdcMidcurve_Ethereum";
41
+ let ERC4626_morphoHyperithmUsdcDegen_Ethereum: "ERC4626_morphoHyperithmUsdcDegen_Ethereum";
42
+ let ERC4626_morphoGauntletUsdcCore_Ethereum: "ERC4626_morphoGauntletUsdcCore_Ethereum";
43
+ let ERC4626_morphoSteakhousePrimeUsdc_Base: "ERC4626_morphoSteakhousePrimeUsdc_Base";
44
+ let ERC4626_morphoSteakhouseUsdc_Base: "ERC4626_morphoSteakhouseUsdc_Base";
45
+ let ERC4626_morphoGauntletUsdcPrime_Base: "ERC4626_morphoGauntletUsdcPrime_Base";
46
+ let ERC4626_morphoSeamlessUsdcVault_Base: "ERC4626_morphoSeamlessUsdcVault_Base";
47
+ let ERC4626_morphoSteakhouseHighYieldUsdc_Arbitrum: "ERC4626_morphoSteakhouseHighYieldUsdc_Arbitrum";
48
+ let ERC4626_morphoGauntletUsdcCore_Arbitrum: "ERC4626_morphoGauntletUsdcCore_Arbitrum";
49
+ let ERC4626_morphoHyperithmUsdc_Arbitrum: "ERC4626_morphoHyperithmUsdc_Arbitrum";
50
+ let ERC4626_morphoGauntletUsdcPrime_Optimism: "ERC4626_morphoGauntletUsdcPrime_Optimism";
51
+ let USDN: "USDN";
52
+ let USDNVault: "USDNVault";
53
+ }
54
+ //# sourceMappingURL=instruments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instruments.d.ts","sourceRoot":"","sources":["instruments.js"],"names":[],"mappings":";;;;;;;;;;;;2BAYU,CAAC,OAAO,YAAY,EAAE,MAAM,OAAO,YAAY,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Mnemonic IDs for supported financial instruments in which a portfolio can use
3
+ * assets to take a position.
4
+ *
5
+ * These identifiers are to be treated as opaque strings, but must not start
6
+ * with punctuation that could result in them being misinterpreted as any other
7
+ * kind of {@link AssetPlaceRef} (e.g., a `<`-prefixed {@link SeatKeyword} or
8
+ * `@`-prefixed {@link InterChainAccountRef}), and in fact must start with an
9
+ * ASCII letter unless the implementation of {@link isInstrumentId} is relaxed.
10
+ * There are separate data structures to map them to functional interfaces for
11
+ * interoperation.
12
+ *
13
+ * @enum {(typeof InstrumentId)[keyof typeof InstrumentId]}
14
+ */
15
+ export const InstrumentId = /** @type {const} */ ({
16
+ Aave_Arbitrum: 'Aave_Arbitrum',
17
+ Aave_Avalanche: 'Aave_Avalanche',
18
+ Aave_Base: 'Aave_Base',
19
+ Aave_Ethereum: 'Aave_Ethereum',
20
+ Aave_Optimism: 'Aave_Optimism',
21
+ Beefy_compoundUsdc_Arbitrum: 'Beefy_compoundUsdc_Arbitrum',
22
+ Beefy_compoundUsdc_Optimism: 'Beefy_compoundUsdc_Optimism',
23
+ Beefy_morphoGauntletUsdc_Ethereum: 'Beefy_morphoGauntletUsdc_Ethereum',
24
+ Beefy_morphoSeamlessUsdc_Base: 'Beefy_morphoSeamlessUsdc_Base',
25
+ Beefy_morphoSmokehouseUsdc_Ethereum: 'Beefy_morphoSmokehouseUsdc_Ethereum',
26
+ Beefy_re7_Avalanche: 'Beefy_re7_Avalanche',
27
+ Compound_Arbitrum: 'Compound_Arbitrum',
28
+ Compound_Base: 'Compound_Base',
29
+ Compound_Ethereum: 'Compound_Ethereum',
30
+ Compound_Optimism: 'Compound_Optimism',
31
+ ERC4626_vaultU2_Ethereum: 'ERC4626_vaultU2_Ethereum',
32
+ ERC4626_morphoClearstarHighYieldUsdc_Ethereum:
33
+ 'ERC4626_morphoClearstarHighYieldUsdc_Ethereum',
34
+ ERC4626_morphoClearstarUsdcCore_Ethereum:
35
+ 'ERC4626_morphoClearstarUsdcCore_Ethereum',
36
+ ERC4626_morphoGauntletUsdcRwa_Ethereum:
37
+ 'ERC4626_morphoGauntletUsdcRwa_Ethereum',
38
+ ERC4626_morphoSteakhouseHighYieldInstant_Ethereum:
39
+ 'ERC4626_morphoSteakhouseHighYieldInstant_Ethereum',
40
+ ERC4626_morphoClearstarInstitutionalUsdc_Ethereum:
41
+ 'ERC4626_morphoClearstarInstitutionalUsdc_Ethereum',
42
+ ERC4626_morphoClearstarUsdcReactor_Ethereum:
43
+ 'ERC4626_morphoClearstarUsdcReactor_Ethereum',
44
+ ERC4626_morphoAlphaUsdcCore_Ethereum: 'ERC4626_morphoAlphaUsdcCore_Ethereum',
45
+ ERC4626_morphoResolvUsdc_Ethereum: 'ERC4626_morphoResolvUsdc_Ethereum',
46
+ ERC4626_morphoGauntletUsdcFrontier_Ethereum:
47
+ 'ERC4626_morphoGauntletUsdcFrontier_Ethereum',
48
+ ERC4626_morphoHyperithmUsdcMidcurve_Ethereum:
49
+ 'ERC4626_morphoHyperithmUsdcMidcurve_Ethereum',
50
+ ERC4626_morphoHyperithmUsdcDegen_Ethereum:
51
+ 'ERC4626_morphoHyperithmUsdcDegen_Ethereum',
52
+ ERC4626_morphoGauntletUsdcCore_Ethereum:
53
+ 'ERC4626_morphoGauntletUsdcCore_Ethereum',
54
+ ERC4626_morphoSteakhousePrimeUsdc_Base:
55
+ 'ERC4626_morphoSteakhousePrimeUsdc_Base',
56
+ ERC4626_morphoSteakhouseUsdc_Base: 'ERC4626_morphoSteakhouseUsdc_Base',
57
+ ERC4626_morphoGauntletUsdcPrime_Base: 'ERC4626_morphoGauntletUsdcPrime_Base',
58
+ ERC4626_morphoSeamlessUsdcVault_Base: 'ERC4626_morphoSeamlessUsdcVault_Base',
59
+ ERC4626_morphoSteakhouseHighYieldUsdc_Arbitrum:
60
+ 'ERC4626_morphoSteakhouseHighYieldUsdc_Arbitrum',
61
+ ERC4626_morphoGauntletUsdcCore_Arbitrum:
62
+ 'ERC4626_morphoGauntletUsdcCore_Arbitrum',
63
+ ERC4626_morphoHyperithmUsdc_Arbitrum: 'ERC4626_morphoHyperithmUsdc_Arbitrum',
64
+ ERC4626_morphoGauntletUsdcPrime_Optimism:
65
+ 'ERC4626_morphoGauntletUsdcPrime_Optimism',
66
+ USDN: 'USDN',
67
+ USDNVault: 'USDNVault',
68
+ });
69
+ harden(InstrumentId);
package/src/main.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export * from "./constants.js";
2
+ export * from "./instruments.js";
3
+ export * from "./resolver.js";
4
+ export * from "./type-guards.js";
5
+ export * from "./types-index.js";
6
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["main.js"],"names":[],"mappings":""}
package/src/main.js CHANGED
@@ -1,2 +1,7 @@
1
1
  export * from './constants.js';
2
- export * from './types.js';
2
+ export * from './instruments.js';
3
+ export * from './resolver.js';
4
+ export * from './type-guards.js';
5
+
6
+ // eslint-disable-next-line import/export -- just types
7
+ export * from './types-index.js';
@@ -0,0 +1,71 @@
1
+ /**
2
+ * GENERATED FILE - DO NOT EDIT.
3
+ * Source: ../ymax-machine.yaml
4
+ * To regenerate: yarn run -T tsx scripts/gen-ymax-machine.mts
5
+ */
6
+ /**
7
+ * @typedef {object} TransitionTarget
8
+ * @property {string} target
9
+ * @property {string} [description]
10
+ */
11
+ /**
12
+ * @typedef {object} StateNode
13
+ * @property {string} description
14
+ * @property {string} [type]
15
+ * @property {string} [initial]
16
+ * @property {Record<string, StateNode>} [states]
17
+ * @property {Record<string, TransitionTarget | TransitionTarget[]>} [on]
18
+ * @property {TransitionTarget} [onDone]
19
+ * @property {TransitionTarget} [onError]
20
+ * @property {Record<string, TransitionTarget>} [after]
21
+ * @property {string[]} [entry]
22
+ * @property {string[]} [exit]
23
+ * @property {string[]} [tags]
24
+ * @property {{ wayMachines?: string[] } & Record<string, unknown>} [meta]
25
+ */
26
+ /**
27
+ * @typedef {object} MachineDefinition
28
+ * @property {string} description
29
+ * @property {string} [category]
30
+ * @property {string} initial
31
+ * @property {Record<string, StateNode>} states
32
+ */
33
+ /**
34
+ * @typedef {object} YmaxSpec
35
+ * @property {string} [version]
36
+ * @property {Record<string, MachineDefinition>} machines
37
+ */
38
+ /** @type {YmaxSpec} */
39
+ export const ymaxMachine: YmaxSpec;
40
+ export default ymaxMachine;
41
+ export type TransitionTarget = {
42
+ target: string;
43
+ description?: string | undefined;
44
+ };
45
+ export type StateNode = {
46
+ description: string;
47
+ type?: string | undefined;
48
+ initial?: string | undefined;
49
+ states?: Record<string, StateNode> | undefined;
50
+ on?: Record<string, TransitionTarget | TransitionTarget[]> | undefined;
51
+ onDone?: TransitionTarget | undefined;
52
+ onError?: TransitionTarget | undefined;
53
+ after?: Record<string, TransitionTarget> | undefined;
54
+ entry?: string[] | undefined;
55
+ exit?: string[] | undefined;
56
+ tags?: string[] | undefined;
57
+ meta?: ({
58
+ wayMachines?: string[];
59
+ } & Record<string, unknown>) | undefined;
60
+ };
61
+ export type MachineDefinition = {
62
+ description: string;
63
+ category?: string | undefined;
64
+ initial: string;
65
+ states: Record<string, StateNode>;
66
+ };
67
+ export type YmaxSpec = {
68
+ version?: string | undefined;
69
+ machines: Record<string, MachineDefinition>;
70
+ };
71
+ //# sourceMappingURL=ymax-machine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ymax-machine.d.ts","sourceRoot":"","sources":["ymax-machine.js"],"names":[],"mappings":"AACA;;;;GAIG;AAEH;;;;GAIG;AAEH;;;;;;;;;;;;;;GAcG;AAEH;;;;;;GAMG;AAEH;;;;GAIG;AAEH,uBAAuB;AACvB,0BADW,QAAQ,CA8tCjB;;;YAhwCY,MAAM;;;;iBAMN,MAAM;;;;;;;;;;;;sBAWU,MAAM,EAAE;;;;iBAKxB,MAAM;;aAEN,MAAM;YACN,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC;;;;cAMzB,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC"}