@plyaz/types 1.7.15 → 1.7.17

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 (71) hide show
  1. package/dist/api/cache/index.d.ts +5 -0
  2. package/dist/api/cache/types.d.ts +22 -0
  3. package/dist/api/client/index.d.ts +5 -0
  4. package/dist/api/client/types.d.ts +31 -0
  5. package/dist/api/config/index.d.ts +5 -0
  6. package/dist/api/config/types.d.ts +634 -0
  7. package/dist/api/errors/index.d.ts +5 -0
  8. package/dist/api/errors/types.d.ts +129 -0
  9. package/dist/api/events/index.d.ts +5 -0
  10. package/dist/api/events/types.d.ts +723 -0
  11. package/dist/api/headers/index.d.ts +5 -0
  12. package/dist/api/headers/types.d.ts +59 -0
  13. package/dist/api/index.d.ts +19 -1
  14. package/dist/api/network/enums.d.ts +14 -0
  15. package/dist/api/network/index.d.ts +6 -0
  16. package/dist/api/network/types.d.ts +121 -0
  17. package/dist/api/performance/index.d.ts +5 -0
  18. package/dist/api/performance/types.d.ts +137 -0
  19. package/dist/api/polling/index.d.ts +5 -0
  20. package/dist/api/polling/types.d.ts +74 -0
  21. package/dist/api/queue/enums.d.ts +31 -0
  22. package/dist/api/queue/index.d.ts +6 -0
  23. package/dist/api/queue/types.d.ts +65 -0
  24. package/dist/api/regional/index.d.ts +5 -0
  25. package/dist/api/regional/types.d.ts +50 -0
  26. package/dist/api/retry/index.d.ts +5 -0
  27. package/dist/api/retry/types.d.ts +26 -0
  28. package/dist/api/revalidation/index.d.ts +5 -0
  29. package/dist/api/revalidation/types.d.ts +33 -0
  30. package/dist/api/strategies/index.d.ts +5 -0
  31. package/dist/api/strategies/types.d.ts +27 -0
  32. package/dist/api/utils/enums.d.ts +23 -0
  33. package/dist/api/utils/index.d.ts +5 -0
  34. package/dist/auth/index.cjs +0 -41
  35. package/dist/auth/index.cjs.map +1 -1
  36. package/dist/auth/index.d.ts +1 -1
  37. package/dist/auth/index.js +0 -38
  38. package/dist/auth/index.js.map +1 -1
  39. package/dist/common/types.d.ts +1 -4
  40. package/dist/errors/enums.d.ts +27 -0
  41. package/dist/errors/index.cjs +0 -43
  42. package/dist/errors/index.cjs.map +1 -1
  43. package/dist/errors/index.d.ts +1 -1
  44. package/dist/errors/index.js +0 -40
  45. package/dist/errors/index.js.map +1 -1
  46. package/dist/errors/types.d.ts +2 -2
  47. package/dist/events/index.cjs +0 -33
  48. package/dist/events/index.cjs.map +1 -1
  49. package/dist/events/index.d.ts +1 -1
  50. package/dist/events/index.js +0 -30
  51. package/dist/events/index.js.map +1 -1
  52. package/dist/events/types.d.ts +2 -2
  53. package/dist/index.cjs +0 -138
  54. package/dist/index.cjs.map +1 -1
  55. package/dist/index.d.ts +5 -5
  56. package/dist/index.js +0 -128
  57. package/dist/index.js.map +1 -1
  58. package/dist/logger/index.d.ts +1 -1
  59. package/dist/testing/common/assertions/types.d.ts +66 -0
  60. package/dist/testing/common/mocks/types.d.ts +67 -0
  61. package/dist/testing/common/utils/types.d.ts +2 -1
  62. package/dist/testing/features/api/index.d.ts +1 -0
  63. package/dist/testing/features/api/types.d.ts +292 -0
  64. package/dist/testing/features/index.d.ts +1 -0
  65. package/dist/web3/index.cjs +0 -27
  66. package/dist/web3/index.cjs.map +1 -1
  67. package/dist/web3/index.d.ts +1 -1
  68. package/dist/web3/index.js +0 -26
  69. package/dist/web3/index.js.map +1 -1
  70. package/package.json +3 -2
  71. package/dist/api/types.d.ts +0 -51
@@ -0,0 +1,292 @@
1
+ import type * as Vitest from 'vitest';
2
+ import type { ConnectionType, EffectiveConnectionType, NetworkInfo } from '../../../api';
3
+ /**
4
+ * Options for setupApiTest helper
5
+ */
6
+ export interface SetupApiTestOptions {
7
+ /**
8
+ * EventManager singleton to reset between tests
9
+ * Pass the EventManager class if you want automatic reset
10
+ * @default undefined
11
+ */
12
+ eventManager?: {
13
+ reset: () => void;
14
+ };
15
+ /**
16
+ * Whether to use fake timers in tests
17
+ * @default false
18
+ */
19
+ useFakeTimers?: boolean;
20
+ /**
21
+ * Whether to clear all mocks before each test
22
+ * @default true
23
+ */
24
+ clearMocks?: boolean;
25
+ /**
26
+ * Whether to clear all spies before each test
27
+ * Requires spies utility that has clearAll method
28
+ * @default false
29
+ */
30
+ clearSpies?: boolean | {
31
+ clearAll: () => void;
32
+ };
33
+ /**
34
+ * Custom setup function to run before each test
35
+ * Runs after built-in setup
36
+ * @default undefined
37
+ */
38
+ beforeEach?: () => void | Promise<void>;
39
+ /**
40
+ * Custom teardown function to run after each test
41
+ * Runs before built-in teardown
42
+ * @default undefined
43
+ */
44
+ afterEach?: () => void | Promise<void>;
45
+ }
46
+ /**
47
+ * Creates tracked spies for fetchff module
48
+ */
49
+ export interface FetchffSpies {
50
+ createApiFetcher: Vitest.Mock;
51
+ isSlowConnection: Vitest.Mock;
52
+ fetchf: Vitest.Mock;
53
+ mutate: Vitest.Mock;
54
+ revalidate: Vitest.Mock;
55
+ getCache: Vitest.Mock;
56
+ setCache: Vitest.Mock;
57
+ deleteCache: Vitest.Mock;
58
+ }
59
+ /**
60
+ * Return type for setupFetchffMocks utility
61
+ * Provides spies and setup functions for testing fetchff module
62
+ */
63
+ export interface SetupFetchffMocksReturn {
64
+ spies: ApiMockSpies;
65
+ setupMocks: {
66
+ fetchff: () => FetchffSpies;
67
+ adapter: () => ConfigAdapterSpies;
68
+ builder: () => ConfigBuilderSpies;
69
+ };
70
+ }
71
+ /**
72
+ * Combined API mock spies for convenience
73
+ */
74
+ export interface ApiMockSpies {
75
+ fetchff: FetchffSpies;
76
+ adapter: ConfigAdapterSpies;
77
+ builder: ConfigBuilderSpies;
78
+ }
79
+ /**
80
+ * Config builder spies
81
+ */
82
+ export interface ConfigBuilderSpies {
83
+ mergeConfigs: Vitest.Mock;
84
+ buildApiConfig: Vitest.Mock;
85
+ applyDefaults: Vitest.Mock;
86
+ validateConfig: Vitest.Mock;
87
+ }
88
+ /**
89
+ * Config adapter spies
90
+ */
91
+ export interface ConfigAdapterSpies {
92
+ toFetchffConfig: Vitest.Mock;
93
+ fromFetchffResponse: Vitest.Mock;
94
+ mergeHeaders: Vitest.Mock;
95
+ parseRetryConfig: Vitest.Mock;
96
+ parseCacheConfig: Vitest.Mock;
97
+ }
98
+ /**
99
+ * Network connection information interface
100
+ * Represents the connection property of navigator for testing
101
+ */
102
+ export interface NetworkInfoConnection {
103
+ type: ConnectionType;
104
+ effectiveType: EffectiveConnectionType;
105
+ downlink: number | null;
106
+ downlinkMax: number | null;
107
+ rtt: number | null;
108
+ saveData: boolean;
109
+ }
110
+ /**
111
+ * Mock navigator interface for testing network information
112
+ * Includes connection details and language settings
113
+ */
114
+ export interface NetworkInfoNavigatorMock {
115
+ type?: ConnectionType;
116
+ onLine: boolean;
117
+ connection: NetworkInfoConnection;
118
+ language: string;
119
+ languages: string[];
120
+ }
121
+ export interface CreateMockEventFactoryReturn {
122
+ on: ReturnType<Vitest.Mock>;
123
+ off: ReturnType<Vitest.Mock>;
124
+ emit: ReturnType<Vitest.Mock>;
125
+ emitGeneric: ReturnType<Vitest.Mock>;
126
+ onAny: ReturnType<Vitest.Mock>;
127
+ offAny: ReturnType<Vitest.Mock>;
128
+ }
129
+ export interface CreateMockNetworkFactory {
130
+ emitQualityChanged: ReturnType<Vitest.Mock>;
131
+ emitQualityChange: ReturnType<Vitest.Mock>;
132
+ emitConfigOverride: ReturnType<Vitest.Mock>;
133
+ emitConfigRestored: ReturnType<Vitest.Mock>;
134
+ emitInfoUpdate: ReturnType<Vitest.Mock>;
135
+ emitPresetApplied: ReturnType<Vitest.Mock>;
136
+ emitPresetChanged: ReturnType<Vitest.Mock>;
137
+ emitHintsUpdated: ReturnType<Vitest.Mock>;
138
+ emitAutoDetection: ReturnType<Vitest.Mock>;
139
+ emitManualUpdate: ReturnType<Vitest.Mock>;
140
+ }
141
+ export interface CreateMockErrorFactory {
142
+ emitError: ReturnType<Vitest.Mock>;
143
+ emitNetworkError: ReturnType<Vitest.Mock>;
144
+ emitTimeoutError: ReturnType<Vitest.Mock>;
145
+ emitClientError: ReturnType<Vitest.Mock>;
146
+ emitServerError: ReturnType<Vitest.Mock>;
147
+ emitValidationError: ReturnType<Vitest.Mock>;
148
+ emitHeadersError: ReturnType<Vitest.Mock>;
149
+ emitCritical: ReturnType<Vitest.Mock>;
150
+ }
151
+ export interface CreateMockHeaderFactory {
152
+ emitChanged: ReturnType<Vitest.Mock>;
153
+ emitEnriched: ReturnType<Vitest.Mock>;
154
+ emitConflict: ReturnType<Vitest.Mock>;
155
+ emitOverride: ReturnType<Vitest.Mock>;
156
+ emitMerged: ReturnType<Vitest.Mock>;
157
+ emitFiltered: ReturnType<Vitest.Mock>;
158
+ emitValidated: ReturnType<Vitest.Mock>;
159
+ emitCached: ReturnType<Vitest.Mock>;
160
+ emitCacheHit: ReturnType<Vitest.Mock>;
161
+ emitCacheMiss: ReturnType<Vitest.Mock>;
162
+ }
163
+ export interface CreateMockDebugFactory {
164
+ emitConfigConflict: ReturnType<Vitest.Mock>;
165
+ emitConflict: ReturnType<Vitest.Mock>;
166
+ emitConfigChange: ReturnType<Vitest.Mock>;
167
+ emitHeadersTracked: ReturnType<Vitest.Mock>;
168
+ emitNetworkOverride: ReturnType<Vitest.Mock>;
169
+ emitNetworkStateChanged: ReturnType<Vitest.Mock>;
170
+ emitNetworkDataCleared: ReturnType<Vitest.Mock>;
171
+ emitDebugInfo: ReturnType<Vitest.Mock>;
172
+ emitTracking: ReturnType<Vitest.Mock>;
173
+ emitPerformance: ReturnType<Vitest.Mock>;
174
+ emitMonitoringAlert: ReturnType<Vitest.Mock>;
175
+ }
176
+ export interface CreateMockConfigFactory {
177
+ emitGlobalUpdated: ReturnType<Vitest.Mock>;
178
+ emitConfigChanged: ReturnType<Vitest.Mock>;
179
+ emitConfigOverride: ReturnType<Vitest.Mock>;
180
+ emitConfigRestored: ReturnType<Vitest.Mock>;
181
+ emitConfigValidated: ReturnType<Vitest.Mock>;
182
+ emitPresetApplied: ReturnType<Vitest.Mock>;
183
+ }
184
+ export interface CreateMockPerformanceFactory {
185
+ emitMetric: ReturnType<Vitest.Mock>;
186
+ emitTiming: ReturnType<Vitest.Mock>;
187
+ emitThreshold: ReturnType<Vitest.Mock>;
188
+ emitCacheHit: ReturnType<Vitest.Mock>;
189
+ emitCacheMiss: ReturnType<Vitest.Mock>;
190
+ emitRequestStart: ReturnType<Vitest.Mock>;
191
+ emitRequestComplete: ReturnType<Vitest.Mock>;
192
+ emitRetry: ReturnType<Vitest.Mock>;
193
+ emitThresholdExceeded: ReturnType<Vitest.Mock>;
194
+ emitOptimizationApplied: ReturnType<Vitest.Mock>;
195
+ emitMetricRecorded: ReturnType<Vitest.Mock>;
196
+ }
197
+ export interface CreateMockCacheFactory {
198
+ emitHit: ReturnType<Vitest.Mock>;
199
+ emitMiss: ReturnType<Vitest.Mock>;
200
+ emitSet: ReturnType<Vitest.Mock>;
201
+ emitDelete: ReturnType<Vitest.Mock>;
202
+ emitClear: ReturnType<Vitest.Mock>;
203
+ emitExpire: ReturnType<Vitest.Mock>;
204
+ emitCacheHit: ReturnType<Vitest.Mock>;
205
+ emitCacheMiss: ReturnType<Vitest.Mock>;
206
+ emitCacheSet: ReturnType<Vitest.Mock>;
207
+ emitCacheDelete: ReturnType<Vitest.Mock>;
208
+ emitCacheClear: ReturnType<Vitest.Mock>;
209
+ emitCacheExpire: ReturnType<Vitest.Mock>;
210
+ }
211
+ export interface CreateMockBaseFactory {
212
+ emitInitialized: ReturnType<Vitest.Mock>;
213
+ emitDestroyed: ReturnType<Vitest.Mock>;
214
+ emitReady: ReturnType<Vitest.Mock>;
215
+ }
216
+ export interface CreateMockClientFactory {
217
+ emitRequest: ReturnType<Vitest.Mock>;
218
+ emitResponse: ReturnType<Vitest.Mock>;
219
+ emitError: ReturnType<Vitest.Mock>;
220
+ emitRetry: ReturnType<Vitest.Mock>;
221
+ emitTimeout: ReturnType<Vitest.Mock>;
222
+ emitConflict: ReturnType<Vitest.Mock>;
223
+ emitDebug: ReturnType<Vitest.Mock>;
224
+ emitCreated: ReturnType<Vitest.Mock>;
225
+ emitDestroyed: ReturnType<Vitest.Mock>;
226
+ }
227
+ /**
228
+ * Base event factory class for testing
229
+ * Provides minimal event functionality
230
+ */
231
+ export interface BaseEventFactoryClass {
232
+ new (): {
233
+ emit(): void;
234
+ on(): ReturnType<Vitest.Mock>;
235
+ off(): void;
236
+ createAndEmit(): void;
237
+ createBaseEvent(): {
238
+ type: string;
239
+ timestamp: number;
240
+ };
241
+ };
242
+ }
243
+ /**
244
+ * Return type for createAllMockFactories
245
+ * Provides access to all mock event factories and reset functionality
246
+ */
247
+ export interface CreateAllMockFactoriesReturn {
248
+ BaseEventFactory: BaseEventFactoryClass;
249
+ getNetworkEventFactory: ReturnType<Vitest.Mock>;
250
+ getHeaderEventFactory: ReturnType<Vitest.Mock>;
251
+ getErrorEventFactory: ReturnType<Vitest.Mock>;
252
+ getDebugEventFactory: ReturnType<Vitest.Mock>;
253
+ getConfigEventFactory: ReturnType<Vitest.Mock>;
254
+ getPerformanceEventFactory: ReturnType<Vitest.Mock>;
255
+ getCacheEventFactory: ReturnType<Vitest.Mock>;
256
+ getBaseEventFactory: ReturnType<Vitest.Mock>;
257
+ getClientEventFactory: ReturnType<Vitest.Mock>;
258
+ resetFactories: ReturnType<Vitest.Mock>;
259
+ }
260
+ /**
261
+ * Return type for createTrackableApiClient
262
+ * Provides mock client with event tracking utilities
263
+ *
264
+ * @template TClient - Type of the mock client being tracked
265
+ */
266
+ export interface CreateTrackableApiClientReturn<TClient = unknown> {
267
+ client: TClient;
268
+ getEventHandlers: (event: string) => Array<(...args: unknown[]) => void>;
269
+ triggerEvent: (event: string, ...args: unknown[]) => void;
270
+ clearHandlers: () => void;
271
+ }
272
+ /**
273
+ * Options for createMockNavigator function
274
+ * Additional navigator properties to configure
275
+ */
276
+ export interface CreateMockNavigatorOptions {
277
+ onLine?: boolean;
278
+ language?: string;
279
+ languages?: string[];
280
+ }
281
+ /**
282
+ * Return type for setupNetworkMockHelper
283
+ * Provides utilities to switch between network conditions in tests
284
+ */
285
+ export interface SetupNetworkMockHelperReturn {
286
+ setExcellent: () => NetworkInfoNavigatorMock;
287
+ setGood: () => NetworkInfoNavigatorMock;
288
+ setSlow: () => NetworkInfoNavigatorMock;
289
+ setOffline: () => NetworkInfoNavigatorMock;
290
+ setCustom: (networkInfo: Partial<NetworkInfo>) => NetworkInfoNavigatorMock;
291
+ getNavigator: () => NetworkInfoNavigatorMock;
292
+ }
@@ -1,2 +1,3 @@
1
1
  export type * from './cache';
2
2
  export type * from './feature-flags';
3
+ export type * from './api';
@@ -1,31 +1,4 @@
1
1
  'use strict';
2
2
 
3
- // @plyaz package - Built with tsup
4
-
5
- // src/web3/enums.ts
6
- var CHAIN_ID = {
7
- /** Ethereum Mainnet (Chain ID: 1). */
8
- EthereumMainnet: 1,
9
- /** Ethereum Sepolia Testnet (Chain ID: 11155111). */
10
- EthereumSepolia: 11155111,
11
- /** Optimism Mainnet (Chain ID: 10). */
12
- Optimism: 10,
13
- /** Optimism Sepolia Testnet (Chain ID: 11155420). */
14
- OptimismSepolia: 11155420,
15
- /** Arbitrum One Mainnet (Chain ID: 42161). */
16
- Arbitrum: 42161,
17
- /** Arbitrum Sepolia Testnet (Chain ID: 421614). */
18
- ArbitrumSepolia: 421614,
19
- /** Polygon Mainnet (Chain ID: 137). */
20
- Polygon: 137,
21
- /** Polygon Amoy Testnet (Chain ID: 80002). */
22
- PolygonAmoy: 80002,
23
- /** Base Mainnet (Chain ID: 8453). */
24
- Base: 8453,
25
- /** Base Sepolia Testnet (Chain ID: 84532). */
26
- BaseSepolia: 84532
27
- };
28
-
29
- exports.CHAIN_ID = CHAIN_ID;
30
3
  //# sourceMappingURL=index.cjs.map
31
4
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/web3/enums.ts"],"names":[],"mappings":";;;;;AAaO,IAAM,QAAA,GAAW;AAAA;AAAA,EAEtB,eAAA,EAAiB,CAAA;AAAA;AAAA,EAGjB,eAAA,EAAiB,QAAA;AAAA;AAAA,EAGjB,QAAA,EAAU,EAAA;AAAA;AAAA,EAGV,eAAA,EAAiB,QAAA;AAAA;AAAA,EAGjB,QAAA,EAAU,KAAA;AAAA;AAAA,EAGV,eAAA,EAAiB,MAAA;AAAA;AAAA,EAGjB,OAAA,EAAS,GAAA;AAAA;AAAA,EAGT,WAAA,EAAa,KAAA;AAAA;AAAA,EAGb,IAAA,EAAM,IAAA;AAAA;AAAA,EAGN,WAAA,EAAa;AACf","file":"index.cjs","sourcesContent":["/**\n * Enum representing supported EVM-compatible blockchain networks by their numeric chain IDs.\n * @description These IDs are used to identify the specific network when interacting with wallets or smart contracts.\n * @see https://chainlist.org for reference chain IDs\n *\n * @example\n * ```typescript\n * import { CHAIN_ID } from '@plyaz/types';\n *\n * const chainId = CHAIN_ID.EthereumMainnet; // 1\n * const isTestnet = chainId === CHAIN_ID.EthereumSepolia || chainId === CHAIN_ID.PolygonAmoy;\n * ```\n */\nexport const CHAIN_ID = {\n /** Ethereum Mainnet (Chain ID: 1). */\n EthereumMainnet: 1,\n\n /** Ethereum Sepolia Testnet (Chain ID: 11155111). */\n EthereumSepolia: 11_155_111,\n\n /** Optimism Mainnet (Chain ID: 10). */\n Optimism: 10,\n\n /** Optimism Sepolia Testnet (Chain ID: 11155420). */\n OptimismSepolia: 11_155_420,\n\n /** Arbitrum One Mainnet (Chain ID: 42161). */\n Arbitrum: 42_161,\n\n /** Arbitrum Sepolia Testnet (Chain ID: 421614). */\n ArbitrumSepolia: 421_614,\n\n /** Polygon Mainnet (Chain ID: 137). */\n Polygon: 137,\n\n /** Polygon Amoy Testnet (Chain ID: 80002). */\n PolygonAmoy: 80_002,\n\n /** Base Mainnet (Chain ID: 8453). */\n Base: 8_453,\n\n /** Base Sepolia Testnet (Chain ID: 84532). */\n BaseSepolia: 84_532,\n} as const;\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -1,2 +1,2 @@
1
- export * from './enums';
1
+ export type * from './enums';
2
2
  export type * from './types';
@@ -1,29 +1,3 @@
1
- // @plyaz package - Built with tsup
2
1
 
3
- // src/web3/enums.ts
4
- var CHAIN_ID = {
5
- /** Ethereum Mainnet (Chain ID: 1). */
6
- EthereumMainnet: 1,
7
- /** Ethereum Sepolia Testnet (Chain ID: 11155111). */
8
- EthereumSepolia: 11155111,
9
- /** Optimism Mainnet (Chain ID: 10). */
10
- Optimism: 10,
11
- /** Optimism Sepolia Testnet (Chain ID: 11155420). */
12
- OptimismSepolia: 11155420,
13
- /** Arbitrum One Mainnet (Chain ID: 42161). */
14
- Arbitrum: 42161,
15
- /** Arbitrum Sepolia Testnet (Chain ID: 421614). */
16
- ArbitrumSepolia: 421614,
17
- /** Polygon Mainnet (Chain ID: 137). */
18
- Polygon: 137,
19
- /** Polygon Amoy Testnet (Chain ID: 80002). */
20
- PolygonAmoy: 80002,
21
- /** Base Mainnet (Chain ID: 8453). */
22
- Base: 8453,
23
- /** Base Sepolia Testnet (Chain ID: 84532). */
24
- BaseSepolia: 84532
25
- };
26
-
27
- export { CHAIN_ID };
28
2
  //# sourceMappingURL=index.js.map
29
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/web3/enums.ts"],"names":[],"mappings":";;;AAaO,IAAM,QAAA,GAAW;AAAA;AAAA,EAEtB,eAAA,EAAiB,CAAA;AAAA;AAAA,EAGjB,eAAA,EAAiB,QAAA;AAAA;AAAA,EAGjB,QAAA,EAAU,EAAA;AAAA;AAAA,EAGV,eAAA,EAAiB,QAAA;AAAA;AAAA,EAGjB,QAAA,EAAU,KAAA;AAAA;AAAA,EAGV,eAAA,EAAiB,MAAA;AAAA;AAAA,EAGjB,OAAA,EAAS,GAAA;AAAA;AAAA,EAGT,WAAA,EAAa,KAAA;AAAA;AAAA,EAGb,IAAA,EAAM,IAAA;AAAA;AAAA,EAGN,WAAA,EAAa;AACf","file":"index.js","sourcesContent":["/**\n * Enum representing supported EVM-compatible blockchain networks by their numeric chain IDs.\n * @description These IDs are used to identify the specific network when interacting with wallets or smart contracts.\n * @see https://chainlist.org for reference chain IDs\n *\n * @example\n * ```typescript\n * import { CHAIN_ID } from '@plyaz/types';\n *\n * const chainId = CHAIN_ID.EthereumMainnet; // 1\n * const isTestnet = chainId === CHAIN_ID.EthereumSepolia || chainId === CHAIN_ID.PolygonAmoy;\n * ```\n */\nexport const CHAIN_ID = {\n /** Ethereum Mainnet (Chain ID: 1). */\n EthereumMainnet: 1,\n\n /** Ethereum Sepolia Testnet (Chain ID: 11155111). */\n EthereumSepolia: 11_155_111,\n\n /** Optimism Mainnet (Chain ID: 10). */\n Optimism: 10,\n\n /** Optimism Sepolia Testnet (Chain ID: 11155420). */\n OptimismSepolia: 11_155_420,\n\n /** Arbitrum One Mainnet (Chain ID: 42161). */\n Arbitrum: 42_161,\n\n /** Arbitrum Sepolia Testnet (Chain ID: 421614). */\n ArbitrumSepolia: 421_614,\n\n /** Polygon Mainnet (Chain ID: 137). */\n Polygon: 137,\n\n /** Polygon Amoy Testnet (Chain ID: 80002). */\n PolygonAmoy: 80_002,\n\n /** Base Mainnet (Chain ID: 8453). */\n Base: 8_453,\n\n /** Base Sepolia Testnet (Chain ID: 84532). */\n BaseSepolia: 84_532,\n} as const;\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plyaz/types",
3
- "version": "1.7.15",
3
+ "version": "1.7.17",
4
4
  "author": "Redeemer Pace",
5
5
  "license": "ISC",
6
6
  "description": "Provides shared TypeScript types and schema utilities for validation and parsing in the @playz ecosystem.",
@@ -182,7 +182,8 @@
182
182
  "@eslint/markdown": "^6.5.0",
183
183
  "@nestjs/common": "^11.1.3",
184
184
  "@next/eslint-plugin-next": "^15.0.3",
185
- "@plyaz/config": "^1.4.1",
185
+ "@plyaz/config": "^1.5.2",
186
+ "fetchff": "^4.1.0",
186
187
  "@plyaz/devtools": "^1.9.4",
187
188
  "@testing-library/react": "^16.3.0",
188
189
  "@testing-library/user-event": "^14.6.1",
@@ -1,51 +0,0 @@
1
- import type { Simplify } from 'type-fest';
2
- import type { WithTimestamp, WithCorrelationId, Pageable, Versioned, NavigablePaginationMetadata, WithRequestId, WithItems } from '../common/types';
3
- /**
4
- * Standard structure for API responses.
5
- * @template Data - The main payload/data returned by the API.
6
- * @template Meta - Optional metadata object extending the default {@link ApiResponseMeta}.
7
- */
8
- export interface ApiResponse<Data, Meta = Record<string, string>> {
9
- /**
10
- * The core data returned by the API.
11
- */
12
- readonly data: Data;
13
- /**
14
- * Optional metadata object containing request-related information.
15
- */
16
- readonly meta?: ApiResponseMeta & Meta;
17
- }
18
- /**
19
- * Metadata included in API responses.
20
- * @description Provides useful context such as timestamps, request tracking, and API versioning.
21
- */
22
- export type ApiResponseMeta = WithTimestamp & Versioned & WithCorrelationId & WithRequestId;
23
- /**
24
- * Generic structure for paginated API responses.
25
- * @template Item - The type of items in the paginated result.
26
- */
27
- /**
28
- * Common pagination information shared by paginated API results.
29
- * Type alias for NavigablePaginationMetadata to maintain consistency.
30
- */
31
- export type PaginationInfo = NavigablePaginationMetadata;
32
- /**
33
- * Items wrapper used in paginated results.
34
- * Extends WithItems with readonly array for API immutability.
35
- */
36
- export type Paginated<Item> = WithItems<Item>;
37
- /**
38
- * Generic structure for paginated API responses.
39
- * Combines items with pagination metadata.
40
- * @template Item - The type of items in the paginated result.
41
- */
42
- export type PaginatedResponse<Item> = Simplify<Paginated<Item> & PaginationInfo>;
43
- /**
44
- * Parameters used to control pagination in API requests.
45
- */
46
- export interface PaginationParameters extends Partial<Pageable> {
47
- /**
48
- * Optional cursor string for cursor-based pagination.
49
- */
50
- readonly cursor?: string;
51
- }