@xyo-network/diviner-forecasting-abstract 5.3.20 → 5.3.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/diviner-forecasting-abstract",
3
- "version": "5.3.20",
3
+ "version": "5.3.24",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -30,32 +30,47 @@
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "files": [
32
32
  "dist",
33
- "src",
34
33
  "!**/*.bench.*",
35
34
  "!**/*.spec.*",
36
- "!**/*.test.*"
35
+ "!**/*.test.*",
36
+ "README.md"
37
37
  ],
38
38
  "dependencies": {
39
- "@xyo-network/diviner-abstract": "~5.3.20",
40
- "@xyo-network/diviner-forecasting-model": "~5.3.20",
41
- "@xyo-network/diviner-model": "~5.3.20",
42
- "@xyo-network/module-model": "~5.3.20",
43
- "@xyo-network/payload-builder": "~5.3.20",
44
- "@xyo-network/payload-model": "~5.3.20"
39
+ "@xyo-network/diviner-abstract": "~5.3.24",
40
+ "@xyo-network/diviner-model": "~5.3.24",
41
+ "@xyo-network/diviner-forecasting-model": "~5.3.24",
42
+ "@xyo-network/payload-model": "~5.3.24",
43
+ "@xyo-network/payload-builder": "~5.3.24",
44
+ "@xyo-network/module-model": "~5.3.24"
45
45
  },
46
46
  "devDependencies": {
47
- "@xylabs/sdk-js": "^5.0.90",
48
- "@xylabs/ts-scripts-common": "~7.5.6",
49
- "@xylabs/ts-scripts-yarn3": "~7.5.6",
50
- "@xylabs/tsconfig": "~7.5.6",
47
+ "@opentelemetry/api": "^1.9.1",
48
+ "@types/node": "^25.5.0",
49
+ "@xylabs/sdk-js": "^5.0.93",
50
+ "@xylabs/ts-scripts-common": "~7.6.16",
51
+ "@xylabs/ts-scripts-pnpm": "~7.6.16",
52
+ "@xylabs/tsconfig": "~7.6.16",
53
+ "acorn": "^8.16.0",
54
+ "axios": "^1.14.0",
55
+ "esbuild": "^0.28.0",
56
+ "ethers": "^6.16.0",
57
+ "tslib": "^2.8.1",
51
58
  "typescript": "~5.9.3",
52
- "zod": "^4.3.6"
59
+ "zod": "^4.3.6",
60
+ "@xyo-network/diviner-abstract": "~5.3.24",
61
+ "@xyo-network/diviner-forecasting-model": "~5.3.24",
62
+ "@xyo-network/diviner-model": "~5.3.24",
63
+ "@xyo-network/payload-builder": "~5.3.24",
64
+ "@xyo-network/payload-model": "~5.3.24",
65
+ "@xyo-network/module-model": "~5.3.24"
53
66
  },
54
67
  "peerDependencies": {
55
68
  "@xylabs/sdk-js": "^5",
69
+ "ethers": "^6",
70
+ "tslib": "^2.8.1",
56
71
  "zod": "^4"
57
72
  },
58
73
  "publishConfig": {
59
74
  "access": "public"
60
75
  }
61
- }
76
+ }
@@ -1,57 +0,0 @@
1
- import type { Promisable } from '@xylabs/sdk-js'
2
- import { AbstractDiviner } from '@xyo-network/diviner-abstract'
3
- import type {
4
- ForecastingDivinerConfig,
5
- ForecastingDivinerQueryPayload,
6
- ForecastingMethod,
7
- ForecastingSettings,
8
- ForecastPayload,
9
- PayloadValueTransformer,
10
- } from '@xyo-network/diviner-forecasting-model'
11
- import {
12
- ForecastingDivinerConfigSchema,
13
- ForecastPayloadSchema,
14
- isForecastingDivinerQueryPayload,
15
- } from '@xyo-network/diviner-forecasting-model'
16
- import type {
17
- DivinerInstance, DivinerModuleEventData, DivinerParams,
18
- } from '@xyo-network/diviner-model'
19
- import type { AnyConfigSchema } from '@xyo-network/module-model'
20
- import { PayloadBuilder } from '@xyo-network/payload-builder'
21
- import type { Payload, Schema } from '@xyo-network/payload-model'
22
-
23
- export type ForecastingDivinerParams = DivinerParams<AnyConfigSchema<ForecastingDivinerConfig>>
24
-
25
- export abstract class AbstractForecastingDiviner<
26
- TParams extends ForecastingDivinerParams = ForecastingDivinerParams,
27
- TIn extends ForecastingDivinerQueryPayload = ForecastingDivinerQueryPayload,
28
- TOut extends ForecastPayload = ForecastPayload,
29
- TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<
30
- DivinerInstance<TParams, TIn, TOut>,
31
- TIn,
32
- TOut
33
- >,
34
- > extends AbstractDiviner<TParams, TIn, TOut, TEventData> {
35
- static override readonly configSchemas: Schema[] = [...super.configSchemas, ForecastingDivinerConfigSchema]
36
- static override readonly defaultConfigSchema: Schema = ForecastingDivinerConfigSchema
37
-
38
- protected abstract get forecastingMethod(): ForecastingMethod
39
- protected abstract get transformer(): PayloadValueTransformer
40
-
41
- protected override async divineHandler(payloads?: TIn[]) {
42
- const query = payloads?.find(isForecastingDivinerQueryPayload)
43
- if (!query) return []
44
- const windowSettings: ForecastingSettings = { ...this.config, ...this.query }
45
- const stopTimestamp = query.timestamp || Date.now()
46
- const startTimestamp = windowSettings.windowSize ? stopTimestamp - windowSettings.windowSize : 0
47
- const data = await this.getPayloadsInWindow(startTimestamp, stopTimestamp)
48
- const sources = await PayloadBuilder.dataHashes(data)
49
- const values = await this.forecastingMethod(data, this.transformer)
50
- const response: ForecastPayload = {
51
- schema: ForecastPayloadSchema, sources, values,
52
- }
53
- return [response as TOut]
54
- }
55
-
56
- protected abstract getPayloadsInWindow(startTimestamp: number, stopTimestamp: number): Promisable<Payload[]>
57
- }
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './AbstractForecasting.ts'