@sudobility/heavymath_types 0.0.7 → 0.0.9

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/common.cjs CHANGED
@@ -3,4 +3,93 @@
3
3
  * Common utility types used throughout the Heavymath application
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.isChainPrefixedId = isChainPrefixedId;
7
+ exports.isPredictionId = isPredictionId;
8
+ exports.isTxLogId = isTxLogId;
9
+ exports.parseChainPrefixedId = parseChainPrefixedId;
10
+ // ============================================================================
11
+ // Validation Utilities
12
+ // ============================================================================
13
+ /**
14
+ * Regex pattern for ChainPrefixedId: one or more digits, a dash, then one or more characters.
15
+ */
16
+ const CHAIN_PREFIXED_ID_RE = /^\d+-[^-].*/;
17
+ /**
18
+ * Regex pattern for PredictionId: digits-string-string with at least two dashes.
19
+ */
20
+ const PREDICTION_ID_RE = /^\d+-[^-]+-[^-]+/;
21
+ /**
22
+ * Regex pattern for TxLogId: non-empty string, a dash, then a numeric string
23
+ * (bigint serialises to digits, optionally with a leading minus).
24
+ */
25
+ const TX_LOG_ID_RE = /^.+-(-?\d+)$/;
26
+ /**
27
+ * Type guard that checks whether a string conforms to the {@link ChainPrefixedId}
28
+ * template literal format (`{number}-{string}`).
29
+ *
30
+ * @param value - The string to validate
31
+ * @returns `true` (narrowed to `ChainPrefixedId`) when the value matches
32
+ * @example
33
+ * ```ts
34
+ * if (isChainPrefixedId(input)) {
35
+ * // input is now typed as ChainPrefixedId
36
+ * }
37
+ * ```
38
+ */
39
+ function isChainPrefixedId(value) {
40
+ return CHAIN_PREFIXED_ID_RE.test(value);
41
+ }
42
+ /**
43
+ * Type guard that checks whether a string conforms to the {@link PredictionId}
44
+ * template literal format (`{number}-{string}-{string}`).
45
+ *
46
+ * @param value - The string to validate
47
+ * @returns `true` (narrowed to `PredictionId`) when the value matches
48
+ * @example
49
+ * ```ts
50
+ * if (isPredictionId(input)) {
51
+ * // input is now typed as PredictionId
52
+ * }
53
+ * ```
54
+ */
55
+ function isPredictionId(value) {
56
+ return PREDICTION_ID_RE.test(value);
57
+ }
58
+ /**
59
+ * Type guard that checks whether a string conforms to the {@link TxLogId}
60
+ * template literal format (`{string}-{bigint}`).
61
+ *
62
+ * The trailing segment must be a valid integer (the serialised form of a
63
+ * bigint). Empty strings are rejected.
64
+ *
65
+ * @param value - The string to validate
66
+ * @returns `true` (narrowed to `TxLogId`) when the value matches
67
+ * @example
68
+ * ```ts
69
+ * if (isTxLogId(input)) {
70
+ * // input is now typed as TxLogId
71
+ * }
72
+ * ```
73
+ */
74
+ function isTxLogId(value) {
75
+ return TX_LOG_ID_RE.test(value);
76
+ }
77
+ /**
78
+ * Parses a {@link ChainPrefixedId} into its constituent parts.
79
+ *
80
+ * @param id - A valid ChainPrefixedId string
81
+ * @returns An object containing the numeric `chainId` and the `identifier`
82
+ * @example
83
+ * ```ts
84
+ * const { chainId, identifier } = parseChainPrefixedId('137-0xabc');
85
+ * // chainId === 137, identifier === '0xabc'
86
+ * ```
87
+ */
88
+ function parseChainPrefixedId(id) {
89
+ const dashIndex = id.indexOf('-');
90
+ return {
91
+ chainId: Number(id.slice(0, dashIndex)),
92
+ identifier: id.slice(dashIndex + 1),
93
+ };
94
+ }
6
95
  //# sourceMappingURL=common.js.map
package/dist/entities.cjs CHANGED
@@ -5,4 +5,61 @@
5
5
  * @version 1.0.0
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.WithdrawalTypeValues = exports.ClaimTypeValues = exports.MarketStatusValues = void 0;
9
+ exports.isMarketStatus = isMarketStatus;
10
+ exports.isClaimType = isClaimType;
11
+ exports.isWithdrawalType = isWithdrawalType;
12
+ // ============================================================================
13
+ // Enums and Constants
14
+ // ============================================================================
15
+ /**
16
+ * All possible values for {@link MarketStatus}, exposed as a runtime constant
17
+ * so consumers can iterate over them or perform runtime validation.
18
+ */
19
+ exports.MarketStatusValues = [
20
+ 'Active',
21
+ 'Cancelled',
22
+ 'Resolved',
23
+ 'Abandoned',
24
+ ];
25
+ /**
26
+ * All possible values for {@link ClaimType}, exposed as a runtime constant
27
+ * so consumers can iterate over them or perform runtime validation.
28
+ */
29
+ exports.ClaimTypeValues = ['winnings', 'refund'];
30
+ /**
31
+ * All possible values for {@link WithdrawalType}, exposed as a runtime constant
32
+ * so consumers can iterate over them or perform runtime validation.
33
+ */
34
+ exports.WithdrawalTypeValues = ['dealer', 'system'];
35
+ // ============================================================================
36
+ // Type Guards
37
+ // ============================================================================
38
+ /**
39
+ * Runtime type guard for {@link MarketStatus}.
40
+ *
41
+ * @param value - The string to validate
42
+ * @returns `true` (narrowed to `MarketStatus`) when the value is a valid market status
43
+ */
44
+ function isMarketStatus(value) {
45
+ return exports.MarketStatusValues.includes(value);
46
+ }
47
+ /**
48
+ * Runtime type guard for {@link ClaimType}.
49
+ *
50
+ * @param value - The string to validate
51
+ * @returns `true` (narrowed to `ClaimType`) when the value is a valid claim type
52
+ */
53
+ function isClaimType(value) {
54
+ return exports.ClaimTypeValues.includes(value);
55
+ }
56
+ /**
57
+ * Runtime type guard for {@link WithdrawalType}.
58
+ *
59
+ * @param value - The string to validate
60
+ * @returns `true` (narrowed to `WithdrawalType`) when the value is a valid withdrawal type
61
+ */
62
+ function isWithdrawalType(value) {
63
+ return exports.WithdrawalTypeValues.includes(value);
64
+ }
8
65
  //# sourceMappingURL=entities.js.map
@@ -9,156 +9,297 @@
9
9
  import { Optional } from './common';
10
10
  import { MarketStatus, WithdrawalType, WalletFavoriteEntity } from './entities';
11
11
  /**
12
- * Market data returned by API endpoints
12
+ * Market data returned by API endpoints.
13
+ * Serialised form of {@link import('./entities').MarketEntity} where `bigint`
14
+ * fields are represented as strings for JSON compatibility.
13
15
  */
14
16
  export interface MarketData {
17
+ /** Unique identifier, typically a {@link import('./common').ChainPrefixedId} */
15
18
  id: string;
19
+ /** EVM chain ID where this market exists (e.g., 1 for Ethereum mainnet) */
16
20
  chainId: number;
21
+ /** On-chain market identifier */
17
22
  marketId: string;
23
+ /** String representation of the dealer NFT token ID used to create this market */
18
24
  dealerNftTokenId: string;
25
+ /** Ethereum address of the dealer who created the market */
19
26
  dealerAddress: string;
27
+ /** Human-readable title of the market */
20
28
  title: string;
29
+ /** Optional longer description of the market's prediction question */
21
30
  description: Optional<string>;
31
+ /** Category label for the market (e.g., "sports", "crypto") */
22
32
  category: string;
33
+ /** Current status of the market */
23
34
  status: MarketStatus;
35
+ /**
36
+ * String representation of the resolution outcome.
37
+ * `null` when the market is still active or was cancelled/abandoned.
38
+ */
24
39
  outcome: Optional<string>;
40
+ /** ISO 8601 timestamp when the market was created */
25
41
  createdAt: string;
42
+ /**
43
+ * ISO 8601 timestamp when the market was resolved.
44
+ * `null` when the market has not been resolved.
45
+ */
26
46
  resolvedAt: Optional<string>;
47
+ /** String representation of the block number where the market was created */
27
48
  blockNumber: string;
49
+ /** Transaction hash of the market creation transaction */
28
50
  transactionHash: string;
29
51
  }
30
52
  /**
31
- * Prediction data returned by API endpoints
53
+ * Prediction data returned by API endpoints.
54
+ * Serialised form of {@link import('./entities').PredictionEntity} where
55
+ * `bigint` fields are represented as strings for JSON compatibility.
32
56
  */
33
57
  export interface PredictionData {
58
+ /** Unique identifier, typically a {@link import('./common').PredictionId} */
34
59
  id: string;
60
+ /** EVM chain ID where this prediction exists */
35
61
  chainId: number;
62
+ /** ID of the market this prediction belongs to */
36
63
  marketId: string;
64
+ /** Ethereum address of the user who placed the prediction */
37
65
  userAddress: string;
66
+ /** String representation of the wagered amount in the token's smallest unit */
38
67
  amount: string;
68
+ /** Predicted percentage value */
39
69
  percentage: number;
70
+ /** The predicted outcome label */
40
71
  outcome: string;
72
+ /** Whether the user has claimed winnings or a refund for this prediction */
41
73
  hasClaimed: boolean;
74
+ /**
75
+ * String representation of the claimed amount.
76
+ * `null` if the user has not yet claimed.
77
+ */
42
78
  claimedAmount: Optional<string>;
79
+ /** ISO 8601 timestamp when the prediction was created */
43
80
  createdAt: string;
81
+ /** ISO 8601 timestamp of the last update to the prediction */
44
82
  updatedAt: string;
83
+ /** String representation of the block number of the last update */
45
84
  lastBlockNumber: string;
85
+ /** Transaction hash of the last update transaction */
46
86
  lastTransactionHash: string;
47
87
  }
48
88
  /**
49
- * Dealer NFT data returned by API endpoints
89
+ * Dealer NFT data returned by API endpoints.
90
+ * Serialised form of {@link import('./entities').DealerNftEntity} where
91
+ * `bigint` fields are represented as strings for JSON compatibility.
50
92
  */
51
93
  export interface DealerNftData {
94
+ /** Unique identifier, typically a {@link import('./common').ChainPrefixedId} */
52
95
  id: string;
96
+ /** EVM chain ID where this NFT exists */
53
97
  chainId: number;
98
+ /** String representation of the on-chain token ID */
54
99
  tokenId: string;
100
+ /** Ethereum address of the current NFT owner */
55
101
  ownerAddress: string;
102
+ /** ISO 8601 timestamp when the NFT was minted */
56
103
  mintedAt: string;
104
+ /** String representation of the block number where the NFT was minted */
57
105
  mintBlockNumber: string;
106
+ /** Transaction hash of the mint transaction */
58
107
  mintTransactionHash: string;
108
+ /**
109
+ * ISO 8601 timestamp of the most recent transfer.
110
+ * `null` if the NFT has never been transferred after minting.
111
+ */
59
112
  lastTransferAt: Optional<string>;
113
+ /**
114
+ * String representation of the block number of the most recent transfer.
115
+ * `null` if the NFT has never been transferred after minting.
116
+ */
60
117
  lastTransferBlockNumber: Optional<string>;
118
+ /**
119
+ * Transaction hash of the most recent transfer.
120
+ * `null` if the NFT has never been transferred after minting.
121
+ */
61
122
  lastTransferTransactionHash: Optional<string>;
62
123
  }
63
124
  /**
64
- * Dealer permission data returned by API endpoints
125
+ * Dealer permission data returned by API endpoints.
126
+ * Serialised form of {@link import('./entities').DealerPermissionEntity}.
65
127
  */
66
128
  export interface DealerPermissionData {
129
+ /** Unique identifier combining chain, token, category, and subcategory */
67
130
  id: string;
131
+ /** EVM chain ID where this permission exists */
68
132
  chainId: number;
133
+ /** String representation of the dealer license NFT token ID */
69
134
  tokenId: string;
135
+ /** Numeric category index the dealer is permitted to operate in */
70
136
  category: number;
137
+ /** Numeric sub-category index the dealer is permitted to operate in */
71
138
  subCategory: number;
139
+ /** ISO 8601 timestamp when the permission was granted */
72
140
  grantedAt: string;
141
+ /** String representation of the block number where the permission was granted */
73
142
  blockNumber: string;
143
+ /** Transaction hash of the permission grant transaction */
74
144
  transactionHash: string;
75
145
  }
76
146
  /**
77
- * Fee withdrawal data returned by API endpoints
147
+ * Fee withdrawal data returned by API endpoints.
148
+ * Serialised form of {@link import('./entities').FeeWithdrawalEntity} where
149
+ * `bigint` fields are represented as strings for JSON compatibility.
78
150
  */
79
151
  export interface FeeWithdrawalData {
152
+ /** Unique identifier */
80
153
  id: string;
154
+ /** EVM chain ID where this withdrawal occurred */
81
155
  chainId: number;
156
+ /**
157
+ * ID of the market the fees were withdrawn from.
158
+ * `null` for system-level withdrawals that are not tied to a specific market.
159
+ */
82
160
  marketId: Optional<string>;
161
+ /** Ethereum address of the entity that performed the withdrawal */
83
162
  withdrawerAddress: string;
163
+ /** Whether this is a dealer or system fee withdrawal */
84
164
  withdrawalType: WithdrawalType;
165
+ /** String representation of the withdrawn amount in the token's smallest unit */
85
166
  amount: string;
167
+ /** ISO 8601 timestamp when the withdrawal occurred */
86
168
  withdrawnAt: string;
169
+ /** String representation of the block number where the withdrawal occurred */
87
170
  blockNumber: string;
171
+ /** Transaction hash of the withdrawal transaction */
88
172
  transactionHash: string;
89
173
  }
90
174
  /**
91
- * Oracle request data returned by API endpoints
175
+ * Oracle request data returned by API endpoints.
176
+ * Serialised form of {@link import('./entities').OracleRequestEntity} where
177
+ * `bigint` fields are represented as strings for JSON compatibility.
92
178
  */
93
179
  export interface OracleRequestData {
180
+ /** Unique identifier */
94
181
  id: string;
182
+ /** EVM chain ID where this request was made */
95
183
  chainId: number;
184
+ /** ID of the market requesting oracle resolution */
96
185
  marketId: string;
186
+ /** On-chain request identifier */
97
187
  requestId: string;
188
+ /** ISO 8601 timestamp when the request was submitted */
98
189
  requestedAt: string;
190
+ /** String representation of the block number where the request was submitted */
99
191
  requestBlockNumber: string;
192
+ /** Transaction hash of the request transaction */
100
193
  requestTransactionHash: string;
194
+ /**
195
+ * ISO 8601 timestamp when the oracle responded.
196
+ * `null` if the request is still pending.
197
+ */
101
198
  respondedAt: Optional<string>;
199
+ /**
200
+ * String representation of the block number of the oracle's response.
201
+ * `null` if the request is still pending.
202
+ */
102
203
  responseBlockNumber: Optional<string>;
204
+ /**
205
+ * Transaction hash of the oracle's response transaction.
206
+ * `null` if the request is still pending.
207
+ */
103
208
  responseTransactionHash: Optional<string>;
209
+ /**
210
+ * Boolean result of the oracle's determination.
211
+ * `null` if the request is still pending or timed out.
212
+ */
104
213
  result: Optional<boolean>;
214
+ /** Whether the request timed out before receiving a response */
105
215
  timedOut: boolean;
106
216
  }
107
217
  /**
108
- * Market state history data returned by API endpoints
218
+ * Market state history data returned by API endpoints.
219
+ * Serialised form of {@link import('./entities').MarketStateHistoryEntity}
220
+ * where `bigint` fields are represented as strings for JSON compatibility.
109
221
  */
110
222
  export interface MarketStateHistoryData {
223
+ /** Unique identifier */
111
224
  id: string;
225
+ /** EVM chain ID where this state transition occurred */
112
226
  chainId: number;
227
+ /** ID of the market that transitioned */
113
228
  marketId: string;
229
+ /**
230
+ * The state the market transitioned from.
231
+ * `null` for the initial creation event (the market had no prior state).
232
+ */
114
233
  fromState: Optional<string>;
234
+ /** The state the market transitioned to */
115
235
  toState: string;
236
+ /** ISO 8601 timestamp when the state change occurred */
116
237
  changedAt: string;
238
+ /** String representation of the block number where the state change occurred */
117
239
  blockNumber: string;
240
+ /** Transaction hash of the state change transaction */
118
241
  transactionHash: string;
242
+ /**
243
+ * Human-readable reason for the state change.
244
+ * `null` when no reason was provided.
245
+ */
119
246
  reason: Optional<string>;
120
247
  }
121
248
  /**
122
- * Market statistics data returned by API endpoints
249
+ * Market statistics data returned by API endpoints.
123
250
  */
124
251
  export interface MarketStatsData {
252
+ /** Total number of markets */
125
253
  total: number;
254
+ /** Breakdown of market count by status (e.g., { Active: 50, Resolved: 40 }) */
126
255
  byStatus: Record<string, number>;
256
+ /** Breakdown of market count by category (e.g., { sports: 30, crypto: 40 }) */
127
257
  byCategory: Record<string, number>;
128
258
  }
129
259
  /**
130
- * Health check data returned by API endpoints
260
+ * Health check data returned by API endpoints.
131
261
  */
132
262
  export interface HealthData {
263
+ /** Current health status of the service */
133
264
  status: 'healthy' | 'unhealthy';
265
+ /** Unix timestamp (milliseconds) when the health check was performed */
134
266
  timestamp: number;
135
267
  }
136
268
  /**
137
- * SSE connection statistics data
269
+ * SSE (Server-Sent Events) connection statistics data.
138
270
  */
139
271
  export interface SSEStatsData {
272
+ /** Number of currently connected SSE clients */
140
273
  clients: number;
274
+ /** Total number of active subscriptions across all clients */
141
275
  subscriptions: number;
142
276
  }
143
277
  /**
144
- * Wallet favorite data (same as entity for API use)
278
+ * Wallet favorite data (same as entity for API use).
145
279
  */
146
280
  export type WalletFavoriteData = WalletFavoriteEntity;
147
281
  /**
148
- * Request body for creating a wallet favorite
282
+ * Request body for creating a wallet favorite.
149
283
  */
150
284
  export interface CreateFavoriteRequest {
285
+ /** Category of the item to favorite (e.g., "sports", "crypto") */
151
286
  category: string;
287
+ /** Sub-category of the item to favorite (e.g., "football", "bitcoin") */
152
288
  subcategory: string;
289
+ /** Type of the item to favorite (e.g., "market", "dealer") */
153
290
  type: string;
291
+ /** ID of the item to favorite */
154
292
  id: string;
155
293
  }
156
294
  /**
157
- * Pagination metadata
295
+ * Pagination metadata included in paginated API responses.
158
296
  */
159
297
  export interface PaginationMeta {
298
+ /** Total number of items matching the query */
160
299
  count: number;
300
+ /** Maximum number of items returned per page */
161
301
  limit: number;
302
+ /** Number of items skipped (for offset-based pagination) */
162
303
  offset: number;
163
304
  }
164
305
  //# sourceMappingURL=api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/types/api.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EA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8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,EAAE,EAAE,MAAM,CAAC;CACZ;AAMD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -2,25 +2,100 @@
2
2
  * Common utility types used throughout the Heavymath application
3
3
  */
4
4
  /**
5
- * Utility type for values that can be T, undefined, or null
6
- * Provides a more semantic way to represent optional/nullable values
5
+ * Utility type for values that can be T, undefined, or null.
6
+ * Provides a more semantic way to represent optional/nullable values.
7
7
  */
8
8
  export type Optional<T> = T | undefined | null;
9
9
  /**
10
- * Chain-Prefixed ID
11
- * Format: "{chainId}-{identifier}"
12
- * Used for creating unique IDs across multiple chains
10
+ * Chain-Prefixed ID.
11
+ * Format: `"{chainId}-{identifier}"` where chainId is a numeric EVM chain ID
12
+ * and identifier is a contract-specific string (e.g., market ID, oracle ID).
13
+ * @example "1-0xabc123" (Ethereum mainnet)
14
+ * @example "137-market456" (Polygon)
15
+ * @example "42161-0xdef789" (Arbitrum)
13
16
  */
14
17
  export type ChainPrefixedId = `${number}-${string}`;
15
18
  /**
16
- * Composite ID for Predictions
17
- * Format: "{chainId}-{marketId}-{predictorAddress}"
19
+ * Composite ID for Predictions.
20
+ * Format: `"{chainId}-{marketId}-{predictorAddress}"` where chainId is a
21
+ * numeric EVM chain ID, marketId is the on-chain market identifier, and
22
+ * predictorAddress is the user's wallet address.
23
+ * @example "1-market123-0xuser"
24
+ * @example "137-0xabc-0xdef"
18
25
  */
19
26
  export type PredictionId = `${number}-${string}-${string}`;
20
27
  /**
21
- * Transaction-Log ID
22
- * Format: "{transactionHash}-{logIndex}"
23
- * Used for unique identification of log entries
28
+ * Transaction-Log ID.
29
+ * Format: `"{transactionHash}-{logIndex}"` where transactionHash is the
30
+ * on-chain transaction hash and logIndex is the position of the log entry
31
+ * within the transaction receipt.
32
+ * @example "0xabc123def-0" (first log in a transaction)
24
33
  */
25
34
  export type TxLogId = `${string}-${bigint}`;
35
+ /**
36
+ * Type guard that checks whether a string conforms to the {@link ChainPrefixedId}
37
+ * template literal format (`{number}-{string}`).
38
+ *
39
+ * @param value - The string to validate
40
+ * @returns `true` (narrowed to `ChainPrefixedId`) when the value matches
41
+ * @example
42
+ * ```ts
43
+ * if (isChainPrefixedId(input)) {
44
+ * // input is now typed as ChainPrefixedId
45
+ * }
46
+ * ```
47
+ */
48
+ export declare function isChainPrefixedId(value: string): value is ChainPrefixedId;
49
+ /**
50
+ * Type guard that checks whether a string conforms to the {@link PredictionId}
51
+ * template literal format (`{number}-{string}-{string}`).
52
+ *
53
+ * @param value - The string to validate
54
+ * @returns `true` (narrowed to `PredictionId`) when the value matches
55
+ * @example
56
+ * ```ts
57
+ * if (isPredictionId(input)) {
58
+ * // input is now typed as PredictionId
59
+ * }
60
+ * ```
61
+ */
62
+ export declare function isPredictionId(value: string): value is PredictionId;
63
+ /**
64
+ * Type guard that checks whether a string conforms to the {@link TxLogId}
65
+ * template literal format (`{string}-{bigint}`).
66
+ *
67
+ * The trailing segment must be a valid integer (the serialised form of a
68
+ * bigint). Empty strings are rejected.
69
+ *
70
+ * @param value - The string to validate
71
+ * @returns `true` (narrowed to `TxLogId`) when the value matches
72
+ * @example
73
+ * ```ts
74
+ * if (isTxLogId(input)) {
75
+ * // input is now typed as TxLogId
76
+ * }
77
+ * ```
78
+ */
79
+ export declare function isTxLogId(value: string): value is TxLogId;
80
+ /**
81
+ * Parsed result of a {@link ChainPrefixedId}.
82
+ */
83
+ export interface ParsedChainPrefixedId {
84
+ /** Numeric EVM chain ID */
85
+ chainId: number;
86
+ /** The identifier portion after the chain prefix */
87
+ identifier: string;
88
+ }
89
+ /**
90
+ * Parses a {@link ChainPrefixedId} into its constituent parts.
91
+ *
92
+ * @param id - A valid ChainPrefixedId string
93
+ * @returns An object containing the numeric `chainId` and the `identifier`
94
+ * @example
95
+ * ```ts
96
+ * const { chainId, identifier } = parseChainPrefixedId('137-0xabc');
97
+ * // chainId === 137, identifier === '0xabc'
98
+ * ```
99
+ */
100
+ export declare function parseChainPrefixedId(id: ChainPrefixedId): ParsedChainPrefixedId;
26
101
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;AAE/C;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AAE3D;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;AAE/C;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,MAAM,OAAO,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;AAsB5C;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,eAAe,CAEzE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,YAAY,CAEnE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,OAAO,CAEzD;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,2BAA2B;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,eAAe,GAAG,qBAAqB,CAM/E"}
@@ -1,5 +1,89 @@
1
1
  /**
2
2
  * Common utility types used throughout the Heavymath application
3
3
  */
4
- export {};
4
+ // ============================================================================
5
+ // Validation Utilities
6
+ // ============================================================================
7
+ /**
8
+ * Regex pattern for ChainPrefixedId: one or more digits, a dash, then one or more characters.
9
+ */
10
+ const CHAIN_PREFIXED_ID_RE = /^\d+-[^-].*/;
11
+ /**
12
+ * Regex pattern for PredictionId: digits-string-string with at least two dashes.
13
+ */
14
+ const PREDICTION_ID_RE = /^\d+-[^-]+-[^-]+/;
15
+ /**
16
+ * Regex pattern for TxLogId: non-empty string, a dash, then a numeric string
17
+ * (bigint serialises to digits, optionally with a leading minus).
18
+ */
19
+ const TX_LOG_ID_RE = /^.+-(-?\d+)$/;
20
+ /**
21
+ * Type guard that checks whether a string conforms to the {@link ChainPrefixedId}
22
+ * template literal format (`{number}-{string}`).
23
+ *
24
+ * @param value - The string to validate
25
+ * @returns `true` (narrowed to `ChainPrefixedId`) when the value matches
26
+ * @example
27
+ * ```ts
28
+ * if (isChainPrefixedId(input)) {
29
+ * // input is now typed as ChainPrefixedId
30
+ * }
31
+ * ```
32
+ */
33
+ export function isChainPrefixedId(value) {
34
+ return CHAIN_PREFIXED_ID_RE.test(value);
35
+ }
36
+ /**
37
+ * Type guard that checks whether a string conforms to the {@link PredictionId}
38
+ * template literal format (`{number}-{string}-{string}`).
39
+ *
40
+ * @param value - The string to validate
41
+ * @returns `true` (narrowed to `PredictionId`) when the value matches
42
+ * @example
43
+ * ```ts
44
+ * if (isPredictionId(input)) {
45
+ * // input is now typed as PredictionId
46
+ * }
47
+ * ```
48
+ */
49
+ export function isPredictionId(value) {
50
+ return PREDICTION_ID_RE.test(value);
51
+ }
52
+ /**
53
+ * Type guard that checks whether a string conforms to the {@link TxLogId}
54
+ * template literal format (`{string}-{bigint}`).
55
+ *
56
+ * The trailing segment must be a valid integer (the serialised form of a
57
+ * bigint). Empty strings are rejected.
58
+ *
59
+ * @param value - The string to validate
60
+ * @returns `true` (narrowed to `TxLogId`) when the value matches
61
+ * @example
62
+ * ```ts
63
+ * if (isTxLogId(input)) {
64
+ * // input is now typed as TxLogId
65
+ * }
66
+ * ```
67
+ */
68
+ export function isTxLogId(value) {
69
+ return TX_LOG_ID_RE.test(value);
70
+ }
71
+ /**
72
+ * Parses a {@link ChainPrefixedId} into its constituent parts.
73
+ *
74
+ * @param id - A valid ChainPrefixedId string
75
+ * @returns An object containing the numeric `chainId` and the `identifier`
76
+ * @example
77
+ * ```ts
78
+ * const { chainId, identifier } = parseChainPrefixedId('137-0xabc');
79
+ * // chainId === 137, identifier === '0xabc'
80
+ * ```
81
+ */
82
+ export function parseChainPrefixedId(id) {
83
+ const dashIndex = id.indexOf('-');
84
+ return {
85
+ chainId: Number(id.slice(0, dashIndex)),
86
+ identifier: id.slice(dashIndex + 1),
87
+ };
88
+ }
5
89
  //# sourceMappingURL=common.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA;;GAEG"}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA;;GAEG;AAqCH,+EAA+E;AAC/E,uBAAuB;AACvB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAE3C;;GAEG;AACH,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAE5C;;;GAGG;AACH,MAAM,YAAY,GAAG,cAAc,CAAC;AAEpC;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,OAAO,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,OAAO,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,OAAO,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAClC,CAAC;AAYD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,oBAAoB,CAAC,EAAmB;IACtD,MAAM,SAAS,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;QACvC,UAAU,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC;KACpC,CAAC;AACJ,CAAC"}
@@ -5,180 +5,369 @@
5
5
  */
6
6
  import { Optional } from './common';
7
7
  /**
8
- * Market Status Enum
9
- * Possible states of a prediction market
8
+ * All possible values for {@link MarketStatus}, exposed as a runtime constant
9
+ * so consumers can iterate over them or perform runtime validation.
10
10
  */
11
- export type MarketStatus = 'Active' | 'Cancelled' | 'Resolved' | 'Abandoned';
11
+ export declare const MarketStatusValues: readonly ["Active", "Cancelled", "Resolved", "Abandoned"];
12
12
  /**
13
- * Claim Type Enum
14
- * Types of claims that can be made
13
+ * Possible states of a prediction market.
14
+ * - `'Active'` - Market is open for predictions
15
+ * - `'Cancelled'` - Market was cancelled by the dealer before resolution
16
+ * - `'Resolved'` - Market has been resolved with a final outcome
17
+ * - `'Abandoned'` - Market was abandoned due to no resolution after deadline
15
18
  */
16
- export type ClaimType = 'winnings' | 'refund';
19
+ export type MarketStatus = (typeof MarketStatusValues)[number];
17
20
  /**
18
- * Withdrawal Type Enum
19
- * Types of fee withdrawals
21
+ * All possible values for {@link ClaimType}, exposed as a runtime constant
22
+ * so consumers can iterate over them or perform runtime validation.
20
23
  */
21
- export type WithdrawalType = 'dealer' | 'system';
24
+ export declare const ClaimTypeValues: readonly ["winnings", "refund"];
25
+ /**
26
+ * Types of claims that can be made against a market.
27
+ * - `'winnings'` - Claim winnings from a resolved market
28
+ * - `'refund'` - Claim a refund from a cancelled or abandoned market
29
+ */
30
+ export type ClaimType = (typeof ClaimTypeValues)[number];
31
+ /**
32
+ * All possible values for {@link WithdrawalType}, exposed as a runtime constant
33
+ * so consumers can iterate over them or perform runtime validation.
34
+ */
35
+ export declare const WithdrawalTypeValues: readonly ["dealer", "system"];
36
+ /**
37
+ * Types of fee withdrawals.
38
+ * - `'dealer'` - Dealer withdraws accumulated fees from a specific market
39
+ * - `'system'` - System-level fee withdrawal to the treasury
40
+ */
41
+ export type WithdrawalType = (typeof WithdrawalTypeValues)[number];
42
+ /**
43
+ * Runtime type guard for {@link MarketStatus}.
44
+ *
45
+ * @param value - The string to validate
46
+ * @returns `true` (narrowed to `MarketStatus`) when the value is a valid market status
47
+ */
48
+ export declare function isMarketStatus(value: string): value is MarketStatus;
49
+ /**
50
+ * Runtime type guard for {@link ClaimType}.
51
+ *
52
+ * @param value - The string to validate
53
+ * @returns `true` (narrowed to `ClaimType`) when the value is a valid claim type
54
+ */
55
+ export declare function isClaimType(value: string): value is ClaimType;
56
+ /**
57
+ * Runtime type guard for {@link WithdrawalType}.
58
+ *
59
+ * @param value - The string to validate
60
+ * @returns `true` (narrowed to `WithdrawalType`) when the value is a valid withdrawal type
61
+ */
62
+ export declare function isWithdrawalType(value: string): value is WithdrawalType;
22
63
  /**
23
64
  * Market Entity
24
- * Database representation of a prediction market
65
+ * Database representation of a prediction market.
25
66
  */
26
67
  export interface MarketEntity {
68
+ /** Unique identifier, typically a {@link import('./common').ChainPrefixedId} */
27
69
  id: string;
70
+ /** Ethereum address of the dealer who created the market */
28
71
  dealer: string;
72
+ /** Dealer NFT token ID used to create this market */
29
73
  tokenId: bigint;
74
+ /** Numeric category index for the market (e.g., sports, crypto) */
30
75
  category: bigint;
76
+ /** Numeric sub-category index within the parent category */
31
77
  subCategory: bigint;
78
+ /** Unix timestamp (seconds) after which the market can be resolved */
32
79
  deadline: bigint;
80
+ /** Human-readable description of the market's prediction question */
33
81
  description: string;
82
+ /** Unix timestamp (seconds) when the market was created on-chain */
34
83
  createdAt: bigint;
84
+ /**
85
+ * Dealer fee in basis points (1 bps = 0.01%).
86
+ * Valid range is 10-200 (0.10% to 2.00%).
87
+ */
35
88
  dealerFeeBps: bigint;
89
+ /** Current status of the market */
36
90
  status: MarketStatus;
91
+ /**
92
+ * Final resolution value of the market.
93
+ * `null` when the market is still active or was cancelled/abandoned.
94
+ */
37
95
  resolution: Optional<bigint>;
96
+ /**
97
+ * Equilibrium value at the time of resolution, representing the
98
+ * weighted average of all predictions.
99
+ * `null` when the market has not been resolved.
100
+ */
38
101
  equilibrium: Optional<bigint>;
102
+ /**
103
+ * Identifier of the oracle assigned to this market.
104
+ * `null` if no oracle is assigned (manual resolution).
105
+ */
39
106
  oracleId: Optional<string>;
107
+ /** EVM chain ID where this market exists (e.g., 1 for Ethereum mainnet) */
40
108
  chainId: number;
109
+ /** Block number in which the market creation transaction was mined */
41
110
  blockNumber: bigint;
111
+ /** Transaction hash of the market creation transaction */
42
112
  txHash: string;
113
+ /** Unix timestamp (seconds) of the block containing the creation transaction */
43
114
  timestamp: bigint;
44
115
  }
45
116
  /**
46
117
  * Prediction Entity
47
- * Database representation of a user's prediction
118
+ * Database representation of a user's prediction on a market.
48
119
  */
49
120
  export interface PredictionEntity {
121
+ /** Unique identifier, typically a {@link import('./common').PredictionId} */
50
122
  id: string;
123
+ /** ID of the market this prediction belongs to */
51
124
  marketId: string;
125
+ /** Ethereum address of the user who placed the prediction */
52
126
  predictor: string;
127
+ /** Amount wagered, in the token's smallest unit (e.g., wei) */
53
128
  amount: bigint;
129
+ /** Predicted percentage value (basis-point scale) */
54
130
  percentage: bigint;
131
+ /** Unix timestamp (seconds) when the prediction was placed on-chain */
55
132
  placedAt: bigint;
133
+ /** Whether the user has claimed winnings or a refund for this prediction */
56
134
  claimed: boolean;
135
+ /** EVM chain ID where this prediction exists */
57
136
  chainId: number;
137
+ /** Block number in which the prediction transaction was mined */
58
138
  blockNumber: bigint;
139
+ /** Transaction hash of the prediction transaction */
59
140
  txHash: string;
141
+ /** Unix timestamp (seconds) of the block containing the prediction transaction */
60
142
  timestamp: bigint;
61
143
  }
62
144
  /**
63
145
  * Claim Entity
64
- * Database representation of a claim (winnings or refund)
146
+ * Database representation of a claim (winnings or refund).
65
147
  */
66
148
  export interface ClaimEntity {
149
+ /** Unique identifier, typically a {@link import('./common').TxLogId} */
67
150
  id: string;
151
+ /** ID of the market this claim is for */
68
152
  marketId: string;
153
+ /** Ethereum address of the user who made the claim */
69
154
  claimer: string;
155
+ /** Amount claimed, in the token's smallest unit (e.g., wei) */
70
156
  amount: bigint;
157
+ /** Whether this claim is for winnings or a refund */
71
158
  claimType: ClaimType;
159
+ /** EVM chain ID where this claim was made */
72
160
  chainId: number;
161
+ /** Block number in which the claim transaction was mined */
73
162
  blockNumber: bigint;
163
+ /** Transaction hash of the claim transaction */
74
164
  txHash: string;
165
+ /** Unix timestamp (seconds) of the block containing the claim transaction */
75
166
  timestamp: bigint;
76
167
  }
77
168
  /**
78
169
  * Oracle Entity
79
- * Database representation of an oracle
170
+ * Database representation of a registered oracle.
80
171
  */
81
172
  export interface OracleEntity {
173
+ /** Unique identifier, typically a {@link import('./common').ChainPrefixedId} */
82
174
  id: string;
175
+ /** On-chain oracle identifier */
83
176
  oracleId: string;
177
+ /** Type of oracle (e.g., "Manual", "PriceFeed", "CustomData") */
84
178
  oracleType: string;
179
+ /**
180
+ * Address or URL of the oracle's data source.
181
+ * `null` for manual oracles that do not use an external data source.
182
+ */
85
183
  dataSource: Optional<string>;
184
+ /** Minimum value the oracle can report */
86
185
  minValue: bigint;
186
+ /** Maximum value the oracle can report */
87
187
  maxValue: bigint;
188
+ /** EVM chain ID where this oracle is registered */
88
189
  chainId: number;
190
+ /** Block number in which the oracle registration transaction was mined */
89
191
  blockNumber: bigint;
192
+ /** Transaction hash of the oracle registration transaction */
90
193
  txHash: string;
194
+ /** Unix timestamp (seconds) of the block containing the registration transaction */
91
195
  timestamp: bigint;
92
196
  }
93
197
  /**
94
198
  * Dealer NFT Entity
95
- * Database representation of a dealer license NFT
199
+ * Database representation of a dealer license NFT.
96
200
  */
97
201
  export interface DealerNftEntity {
202
+ /** Unique identifier, typically a {@link import('./common').ChainPrefixedId} */
98
203
  id: string;
204
+ /** EVM chain ID where this NFT exists */
99
205
  chainId: number;
206
+ /** On-chain token ID of the dealer license NFT */
100
207
  tokenId: bigint;
208
+ /** Ethereum address of the current NFT owner */
101
209
  ownerAddress: string;
210
+ /** Unix timestamp (seconds) when the NFT was minted */
102
211
  mintedAt: bigint;
212
+ /** Block number in which the mint transaction was mined */
103
213
  mintBlockNumber: bigint;
214
+ /** Transaction hash of the mint transaction */
104
215
  mintTransactionHash: string;
216
+ /**
217
+ * Unix timestamp (seconds) of the most recent transfer.
218
+ * `null` if the NFT has never been transferred after minting.
219
+ */
105
220
  lastTransferAt: Optional<bigint>;
221
+ /**
222
+ * Block number of the most recent transfer.
223
+ * `null` if the NFT has never been transferred after minting.
224
+ */
106
225
  lastTransferBlockNumber: Optional<bigint>;
226
+ /**
227
+ * Transaction hash of the most recent transfer.
228
+ * `null` if the NFT has never been transferred after minting.
229
+ */
107
230
  lastTransferTransactionHash: Optional<string>;
108
231
  }
109
232
  /**
110
233
  * Dealer Permission Entity
111
- * Database representation of dealer category/subcategory permissions
234
+ * Database representation of dealer category/subcategory permissions.
112
235
  */
113
236
  export interface DealerPermissionEntity {
237
+ /** Unique identifier combining chain, token, category, and subcategory */
114
238
  id: string;
239
+ /** EVM chain ID where this permission exists */
115
240
  chainId: number;
241
+ /** Token ID of the dealer license NFT this permission belongs to */
116
242
  tokenId: bigint;
243
+ /** Numeric category index the dealer is permitted to operate in */
117
244
  category: number;
245
+ /** Numeric sub-category index the dealer is permitted to operate in */
118
246
  subCategory: number;
247
+ /** Unix timestamp (seconds) when the permission was granted on-chain */
119
248
  grantedAt: bigint;
249
+ /** Block number in which the permission grant transaction was mined */
120
250
  blockNumber: bigint;
251
+ /** Transaction hash of the permission grant transaction */
121
252
  transactionHash: string;
122
253
  }
123
254
  /**
124
255
  * Wallet Favorite Entity
125
- * Database representation of a user's favorite items
256
+ * Database representation of a user's favorite items.
126
257
  */
127
258
  export interface WalletFavoriteEntity {
259
+ /** Auto-incrementing database primary key */
128
260
  id: number;
261
+ /** Ethereum address of the wallet that owns this favorite */
129
262
  walletAddress: string;
263
+ /** Category of the favorited item (e.g., "sports", "crypto") */
130
264
  category: string;
265
+ /** Sub-category of the favorited item (e.g., "football", "bitcoin") */
131
266
  subcategory: string;
267
+ /** Type of the favorited item (e.g., "market", "dealer") */
132
268
  type: string;
269
+ /** ID of the favorited item */
133
270
  itemId: string;
271
+ /** Unix timestamp (seconds) when the favorite was created */
134
272
  createdAt: bigint;
135
273
  }
136
274
  /**
137
275
  * Fee Withdrawal Entity
138
- * Database representation of fee withdrawals
276
+ * Database representation of fee withdrawals.
139
277
  */
140
278
  export interface FeeWithdrawalEntity {
279
+ /** Unique identifier, typically a {@link import('./common').TxLogId} */
141
280
  id: string;
281
+ /** EVM chain ID where this withdrawal occurred */
142
282
  chainId: number;
283
+ /**
284
+ * ID of the market the fees were withdrawn from.
285
+ * `null` for system-level withdrawals that are not tied to a specific market.
286
+ */
143
287
  marketId: Optional<string>;
288
+ /** Ethereum address of the entity that performed the withdrawal */
144
289
  withdrawerAddress: string;
290
+ /** Whether this is a dealer or system fee withdrawal */
145
291
  withdrawalType: WithdrawalType;
292
+ /** Amount withdrawn, in the token's smallest unit (e.g., wei) */
146
293
  amount: bigint;
294
+ /** Unix timestamp (seconds) when the withdrawal occurred on-chain */
147
295
  withdrawnAt: bigint;
296
+ /** Block number in which the withdrawal transaction was mined */
148
297
  blockNumber: bigint;
298
+ /** Transaction hash of the withdrawal transaction */
149
299
  transactionHash: string;
150
300
  }
151
301
  /**
152
302
  * Oracle Request Entity
153
- * Database representation of oracle requests
303
+ * Database representation of oracle resolution requests.
154
304
  */
155
305
  export interface OracleRequestEntity {
306
+ /** Unique identifier */
156
307
  id: string;
308
+ /** EVM chain ID where this request was made */
157
309
  chainId: number;
310
+ /** ID of the market requesting oracle resolution */
158
311
  marketId: string;
312
+ /** On-chain request identifier */
159
313
  requestId: string;
314
+ /** Unix timestamp (seconds) when the request was submitted */
160
315
  requestedAt: bigint;
316
+ /** Block number in which the request transaction was mined */
161
317
  requestBlockNumber: bigint;
318
+ /** Transaction hash of the request transaction */
162
319
  requestTransactionHash: string;
320
+ /**
321
+ * Unix timestamp (seconds) when the oracle responded.
322
+ * `null` if the request is still pending.
323
+ */
163
324
  respondedAt: Optional<bigint>;
325
+ /**
326
+ * Block number of the oracle's response transaction.
327
+ * `null` if the request is still pending.
328
+ */
164
329
  responseBlockNumber: Optional<bigint>;
330
+ /**
331
+ * Transaction hash of the oracle's response transaction.
332
+ * `null` if the request is still pending.
333
+ */
165
334
  responseTransactionHash: Optional<string>;
335
+ /**
336
+ * Boolean result of the oracle's determination.
337
+ * `null` if the request is still pending or timed out without a response.
338
+ */
166
339
  result: Optional<boolean>;
340
+ /** Whether the request timed out before receiving a response */
167
341
  timedOut: boolean;
168
342
  }
169
343
  /**
170
344
  * Market State History Entity
171
- * Database representation of market state transitions
345
+ * Database representation of market state transitions.
172
346
  */
173
347
  export interface MarketStateHistoryEntity {
348
+ /** Unique identifier */
174
349
  id: string;
350
+ /** EVM chain ID where this state transition occurred */
175
351
  chainId: number;
352
+ /** ID of the market that transitioned */
176
353
  marketId: string;
354
+ /**
355
+ * The state the market transitioned from.
356
+ * `null` for the initial creation event (the market had no prior state).
357
+ */
177
358
  fromState: Optional<string>;
359
+ /** The state the market transitioned to */
178
360
  toState: string;
361
+ /** Unix timestamp (seconds) when the state change occurred on-chain */
179
362
  changedAt: bigint;
363
+ /** Block number in which the state change transaction was mined */
180
364
  blockNumber: bigint;
365
+ /** Transaction hash of the state change transaction */
181
366
  transactionHash: string;
367
+ /**
368
+ * Human-readable reason for the state change.
369
+ * `null` when no reason was provided.
370
+ */
182
371
  reason: Optional<string>;
183
372
  }
184
373
  //# sourceMappingURL=entities.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../src/types/entities.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAMpC;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,CAAC;AAE7E;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE9C;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAMjD;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC7B,WAAW,EAAE,QAAQ,CAAC,MA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AClB,8DAA8D;IAC9D,WAAW,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kDAAkD;IAClD,sBAAsB,EAAE,MAAM,CAAC;IAC/B;;;OAGG;IACH,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC9B;;;OAGG;IACH,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACtC;;;OAGG;IACH,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1C;;;OAGG;IACH,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC1B,gEAAgE;IAChE,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC5B,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAC;IAClB,mEAAmE;IACnE,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC1B"}
@@ -3,5 +3,57 @@
3
3
  * @description Centralized type definitions for all database entities
4
4
  * @version 1.0.0
5
5
  */
6
- export {};
6
+ // ============================================================================
7
+ // Enums and Constants
8
+ // ============================================================================
9
+ /**
10
+ * All possible values for {@link MarketStatus}, exposed as a runtime constant
11
+ * so consumers can iterate over them or perform runtime validation.
12
+ */
13
+ export const MarketStatusValues = [
14
+ 'Active',
15
+ 'Cancelled',
16
+ 'Resolved',
17
+ 'Abandoned',
18
+ ];
19
+ /**
20
+ * All possible values for {@link ClaimType}, exposed as a runtime constant
21
+ * so consumers can iterate over them or perform runtime validation.
22
+ */
23
+ export const ClaimTypeValues = ['winnings', 'refund'];
24
+ /**
25
+ * All possible values for {@link WithdrawalType}, exposed as a runtime constant
26
+ * so consumers can iterate over them or perform runtime validation.
27
+ */
28
+ export const WithdrawalTypeValues = ['dealer', 'system'];
29
+ // ============================================================================
30
+ // Type Guards
31
+ // ============================================================================
32
+ /**
33
+ * Runtime type guard for {@link MarketStatus}.
34
+ *
35
+ * @param value - The string to validate
36
+ * @returns `true` (narrowed to `MarketStatus`) when the value is a valid market status
37
+ */
38
+ export function isMarketStatus(value) {
39
+ return MarketStatusValues.includes(value);
40
+ }
41
+ /**
42
+ * Runtime type guard for {@link ClaimType}.
43
+ *
44
+ * @param value - The string to validate
45
+ * @returns `true` (narrowed to `ClaimType`) when the value is a valid claim type
46
+ */
47
+ export function isClaimType(value) {
48
+ return ClaimTypeValues.includes(value);
49
+ }
50
+ /**
51
+ * Runtime type guard for {@link WithdrawalType}.
52
+ *
53
+ * @param value - The string to validate
54
+ * @returns `true` (narrowed to `WithdrawalType`) when the value is a valid withdrawal type
55
+ */
56
+ export function isWithdrawalType(value) {
57
+ return WithdrawalTypeValues.includes(value);
58
+ }
7
59
  //# sourceMappingURL=entities.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"entities.js","sourceRoot":"","sources":["../../src/types/entities.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
1
+ {"version":3,"file":"entities.js","sourceRoot":"","sources":["../../src/types/entities.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,QAAQ;IACR,WAAW;IACX,UAAU;IACV,WAAW;CACH,CAAC;AAWX;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAU,CAAC;AAS/D;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAU,CAAC;AASlE,+EAA+E;AAC/E,cAAc;AACd,+EAA+E;AAE/E;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,OAAQ,kBAAwC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACnE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAQ,eAAqC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,OAAQ,oBAA0C,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACrE,CAAC"}
@@ -8,11 +8,19 @@
8
8
  * provide accurate code suggestions.
9
9
  */
10
10
  /**
11
- * Hex string type (for use when viem is not available)
11
+ * Hex string type.
12
+ * Locally defined as `0x${string}` so it is always available with full type
13
+ * safety, regardless of whether the optional `viem` peer dependency is
14
+ * installed. When `viem` is present, this type is structurally compatible with
15
+ * `viem`'s `Hex` type.
12
16
  */
13
17
  export type Hex = `0x${string}`;
14
18
  /**
15
- * Address type (for use when viem is not available)
19
+ * Ethereum address type.
20
+ * Locally defined as `0x${string}` so it is always available with full type
21
+ * safety, regardless of whether the optional `viem` peer dependency is
22
+ * installed. When `viem` is present, this type is structurally compatible with
23
+ * `viem`'s `Address` type.
16
24
  */
17
25
  export type Address = `0x${string}`;
18
26
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,KAAK,MAAM,EAAE,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,KAAK,MAAM,EAAE,CAAC;AAEpC;;;GAGG;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O,CAAC;IACd,EAAE,EAAE,OAAO,CAAC;CACb;AAMD;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;CAIb,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAE3E;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;CACrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA2KH,+EAA+E;AAC/E,6BAA6B;AAC7B,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,CAAC;IACT,SAAS,EAAE,CAAC;IACZ,UAAU,EAAE,CAAC;CACL,CAAC"}
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAmLH,+EAA+E;AAC/E,6BAA6B;AAC7B,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,CAAC;IACT,SAAS,EAAE,CAAC;IACZ,UAAU,EAAE,CAAC;CACL,CAAC"}
@@ -1,9 +1,11 @@
1
1
  /**
2
2
  * @fileoverview Type exports for @heavymath/types
3
3
  */
4
- export type { Optional, ChainPrefixedId, PredictionId, TxLogId, } from './common';
4
+ export type { Optional, ChainPrefixedId, PredictionId, TxLogId, ParsedChainPrefixedId, } from './common';
5
+ export { isChainPrefixedId, isPredictionId, isTxLogId, parseChainPrefixedId, } from './common';
5
6
  export type { Hex, Address, BaseEventContext, MarketCreatedArgs, PredictionPlacedArgs, PredictionUpdatedArgs, MarketResolvedArgs, MarketCancelledArgs, MarketAbandonedArgs, DealerFeeSetArgs, WinningsClaimedArgs, RefundClaimedArgs, DealerFeesWithdrawnArgs, SystemFeesWithdrawnArgs, LicenseIssuedArgs, PermissionsSetArgs, LicenseTransferredArgs, OracleTypeValue, OracleRegisteredArgs, OracleDataUpdatedArgs, UpdaterAuthorizedArgs, } from './events';
6
7
  export { OracleType } from './events';
7
8
  export type { MarketStatus, ClaimType, WithdrawalType, MarketEntity, PredictionEntity, ClaimEntity, OracleEntity, DealerNftEntity, DealerPermissionEntity, WalletFavoriteEntity, FeeWithdrawalEntity, OracleRequestEntity, MarketStateHistoryEntity, } from './entities';
9
+ export { MarketStatusValues, ClaimTypeValues, WithdrawalTypeValues, isMarketStatus, isClaimType, isWithdrawalType, } from './entities';
8
10
  export type { MarketData, PredictionData, DealerNftData, DealerPermissionData, FeeWithdrawalData, OracleRequestData, MarketStateHistoryData, MarketStatsData, HealthData, SSEStatsData, WalletFavoriteData, CreateFavoriteRequest, PaginationMeta, } from './api';
9
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,YAAY,EACV,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,OAAO,GACR,MAAM,UAAU,CAAC;AAGlB,YAAY,EACV,GAAG,EACH,OAAO,EACP,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC,YAAY,EACV,YAAY,EACZ,SAAS,EACT,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,YAAY,CAAC;AAGpB,YAAY,EACV,UAAU,EACV,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,cAAc,GACf,MAAM,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,YAAY,EACV,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,OAAO,EACP,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAGlB,YAAY,EACV,GAAG,EACH,OAAO,EACP,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC,YAAY,EACV,YAAY,EACZ,SAAS,EACT,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAGpB,YAAY,EACV,UAAU,EACV,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,cAAc,GACf,MAAM,OAAO,CAAC"}
@@ -1,6 +1,10 @@
1
1
  /**
2
2
  * @fileoverview Type exports for @heavymath/types
3
3
  */
4
+ // Common validation utilities
5
+ export { isChainPrefixedId, isPredictionId, isTxLogId, parseChainPrefixedId, } from './common';
4
6
  // Export const values separately
5
7
  export { OracleType } from './events';
8
+ // Entity runtime const arrays and type guards
9
+ export { MarketStatusValues, ClaimTypeValues, WithdrawalTypeValues, isMarketStatus, isClaimType, isWithdrawalType, } from './entities';
6
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAmCH,iCAAiC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH,8BAA8B;AAC9B,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,oBAAoB,GACrB,MAAM,UAAU,CAAC;AA2BlB,iCAAiC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAmBtC,8CAA8C;AAC9C,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@sudobility/heavymath_types",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "Comprehensive TypeScript types, interfaces, and utilities for Heavymath prediction market applications",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
+ "types": "./dist/index.d.ts",
10
11
  "import": "./dist/index.js",
11
- "require": "./dist/index.cjs",
12
- "types": "./dist/index.d.ts"
12
+ "require": "./dist/index.cjs"
13
13
  }
14
14
  },
15
15
  "scripts": {