@xyo-network/diviner-forecasting-model 2.56.0

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 (88) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +13 -0
  3. package/dist/cjs/Config/Config.js +6 -0
  4. package/dist/cjs/Config/Config.js.map +1 -0
  5. package/dist/cjs/Config/ForecastingSettings.js +3 -0
  6. package/dist/cjs/Config/ForecastingSettings.js.map +1 -0
  7. package/dist/cjs/Config/TransformerSettings.js +3 -0
  8. package/dist/cjs/Config/TransformerSettings.js.map +1 -0
  9. package/dist/cjs/Config/index.js +7 -0
  10. package/dist/cjs/Config/index.js.map +1 -0
  11. package/dist/cjs/ForecastingMethod.js +3 -0
  12. package/dist/cjs/ForecastingMethod.js.map +1 -0
  13. package/dist/cjs/Payload/Forecast.js +3 -0
  14. package/dist/cjs/Payload/Forecast.js.map +1 -0
  15. package/dist/cjs/Payload/Payload.js +8 -0
  16. package/dist/cjs/Payload/Payload.js.map +1 -0
  17. package/dist/cjs/Payload/index.js +6 -0
  18. package/dist/cjs/Payload/index.js.map +1 -0
  19. package/dist/cjs/PayloadValueTransformer.js +3 -0
  20. package/dist/cjs/PayloadValueTransformer.js.map +1 -0
  21. package/dist/cjs/Query.js +8 -0
  22. package/dist/cjs/Query.js.map +1 -0
  23. package/dist/cjs/Schema.js +5 -0
  24. package/dist/cjs/Schema.js.map +1 -0
  25. package/dist/cjs/index.js +10 -0
  26. package/dist/cjs/index.js.map +1 -0
  27. package/dist/docs.json +1385 -0
  28. package/dist/esm/Config/Config.js +3 -0
  29. package/dist/esm/Config/Config.js.map +1 -0
  30. package/dist/esm/Config/ForecastingSettings.js +2 -0
  31. package/dist/esm/Config/ForecastingSettings.js.map +1 -0
  32. package/dist/esm/Config/TransformerSettings.js +2 -0
  33. package/dist/esm/Config/TransformerSettings.js.map +1 -0
  34. package/dist/esm/Config/index.js +4 -0
  35. package/dist/esm/Config/index.js.map +1 -0
  36. package/dist/esm/ForecastingMethod.js +2 -0
  37. package/dist/esm/ForecastingMethod.js.map +1 -0
  38. package/dist/esm/Payload/Forecast.js +2 -0
  39. package/dist/esm/Payload/Forecast.js.map +1 -0
  40. package/dist/esm/Payload/Payload.js +4 -0
  41. package/dist/esm/Payload/Payload.js.map +1 -0
  42. package/dist/esm/Payload/index.js +3 -0
  43. package/dist/esm/Payload/index.js.map +1 -0
  44. package/dist/esm/PayloadValueTransformer.js +2 -0
  45. package/dist/esm/PayloadValueTransformer.js.map +1 -0
  46. package/dist/esm/Query.js +4 -0
  47. package/dist/esm/Query.js.map +1 -0
  48. package/dist/esm/Schema.js +2 -0
  49. package/dist/esm/Schema.js.map +1 -0
  50. package/dist/esm/index.js +7 -0
  51. package/dist/esm/index.js.map +1 -0
  52. package/dist/types/Config/Config.d.ts +13 -0
  53. package/dist/types/Config/Config.d.ts.map +1 -0
  54. package/dist/types/Config/ForecastingSettings.d.ts +8 -0
  55. package/dist/types/Config/ForecastingSettings.d.ts.map +1 -0
  56. package/dist/types/Config/TransformerSettings.d.ts +4 -0
  57. package/dist/types/Config/TransformerSettings.d.ts.map +1 -0
  58. package/dist/types/Config/index.d.ts +4 -0
  59. package/dist/types/Config/index.d.ts.map +1 -0
  60. package/dist/types/ForecastingMethod.d.ts +6 -0
  61. package/dist/types/ForecastingMethod.d.ts.map +1 -0
  62. package/dist/types/Payload/Forecast.d.ts +6 -0
  63. package/dist/types/Payload/Forecast.d.ts.map +1 -0
  64. package/dist/types/Payload/Payload.d.ts +14 -0
  65. package/dist/types/Payload/Payload.d.ts.map +1 -0
  66. package/dist/types/Payload/index.d.ts +3 -0
  67. package/dist/types/Payload/index.d.ts.map +1 -0
  68. package/dist/types/PayloadValueTransformer.d.ts +3 -0
  69. package/dist/types/PayloadValueTransformer.d.ts.map +1 -0
  70. package/dist/types/Query.d.ts +13 -0
  71. package/dist/types/Query.d.ts.map +1 -0
  72. package/dist/types/Schema.d.ts +3 -0
  73. package/dist/types/Schema.d.ts.map +1 -0
  74. package/dist/types/index.d.ts +7 -0
  75. package/dist/types/index.d.ts.map +1 -0
  76. package/package.json +57 -0
  77. package/src/Config/Config.ts +18 -0
  78. package/src/Config/ForecastingSettings.ts +7 -0
  79. package/src/Config/TransformerSettings.ts +3 -0
  80. package/src/Config/index.ts +3 -0
  81. package/src/ForecastingMethod.ts +7 -0
  82. package/src/Payload/Forecast.ts +5 -0
  83. package/src/Payload/Payload.ts +13 -0
  84. package/src/Payload/index.ts +2 -0
  85. package/src/PayloadValueTransformer.ts +3 -0
  86. package/src/Query.ts +12 -0
  87. package/src/Schema.ts +2 -0
  88. package/src/index.ts +6 -0
@@ -0,0 +1,3 @@
1
+ import { ForecastingDivinerSchema } from '../Schema';
2
+ export const ForecastingDivinerConfigSchema = `${ForecastingDivinerSchema}.config`;
3
+ //# sourceMappingURL=Config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Config.js","sourceRoot":"","sources":["../../../src/Config/Config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAKpD,MAAM,CAAC,MAAM,8BAA8B,GAAmC,GAAG,wBAAwB,SAAS,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ForecastingSettings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ForecastingSettings.js","sourceRoot":"","sources":["../../../src/Config/ForecastingSettings.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TransformerSettings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TransformerSettings.js","sourceRoot":"","sources":["../../../src/Config/TransformerSettings.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export * from './Config';
2
+ export * from './ForecastingSettings';
3
+ export * from './TransformerSettings';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Config/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ForecastingMethod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ForecastingMethod.js","sourceRoot":"","sources":["../../src/ForecastingMethod.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Forecast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Forecast.js","sourceRoot":"","sources":["../../../src/Payload/Forecast.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { ForecastingDivinerSchema } from '../Schema';
2
+ export const ForecastPayloadSchema = `${ForecastingDivinerSchema}.forecast`;
3
+ export const isForecastPayload = (x) => x?.schema === ForecastPayloadSchema;
4
+ //# sourceMappingURL=Payload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Payload.js","sourceRoot":"","sources":["../../../src/Payload/Payload.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAIpD,MAAM,CAAC,MAAM,qBAAqB,GAA0B,GAAG,wBAAwB,WAAW,CAAA;AAMlG,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAkB,EAAwB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,qBAAqB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './Forecast';
2
+ export * from './Payload';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Payload/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=PayloadValueTransformer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PayloadValueTransformer.js","sourceRoot":"","sources":["../../src/PayloadValueTransformer.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { ForecastingDivinerSchema } from './Schema';
2
+ export const ForecastingDivinerQuerySchema = `${ForecastingDivinerSchema}.query`;
3
+ export const isForecastingDivinerQueryPayload = (x) => x?.schema === ForecastingDivinerQuerySchema;
4
+ //# sourceMappingURL=Query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Query.js","sourceRoot":"","sources":["../../src/Query.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAA;AAGnD,MAAM,CAAC,MAAM,6BAA6B,GAAkC,GAAG,wBAAwB,QAAQ,CAAA;AAG/G,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAkB,EAAuC,EAAE,CAC1G,CAAC,EAAE,MAAM,KAAK,6BAA6B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export const ForecastingDivinerSchema = 'network.xyo.diviner.forecasting';
2
+ //# sourceMappingURL=Schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.js","sourceRoot":"","sources":["../../src/Schema.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,wBAAwB,GAA6B,iCAAiC,CAAA"}
@@ -0,0 +1,7 @@
1
+ export * from './Config';
2
+ export * from './ForecastingMethod';
3
+ export * from './Payload';
4
+ export * from './PayloadValueTransformer';
5
+ export * from './Query';
6
+ export * from './Schema';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,qBAAqB,CAAA;AACnC,cAAc,WAAW,CAAA;AACzB,cAAc,2BAA2B,CAAA;AACzC,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { DivinerConfig } from '@xyo-network/diviner-model';
2
+ import { ModuleFilter } from '@xyo-network/module-model';
3
+ import { ForecastingDivinerSchema } from '../Schema';
4
+ import { ForecastingSettings } from './ForecastingSettings';
5
+ import { TransformerSettings } from './TransformerSettings';
6
+ export type ForecastingDivinerConfigSchema = `${ForecastingDivinerSchema}.config`;
7
+ export declare const ForecastingDivinerConfigSchema: ForecastingDivinerConfigSchema;
8
+ export type ForecastingDivinerConfig = DivinerConfig<{
9
+ archivist?: ModuleFilter;
10
+ boundWitnessDiviner?: ModuleFilter;
11
+ schema: ForecastingDivinerConfigSchema;
12
+ } & ForecastingSettings & TransformerSettings>;
13
+ //# sourceMappingURL=Config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../../src/Config/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAExD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAE3D,MAAM,MAAM,8BAA8B,GAAG,GAAG,wBAAwB,SAAS,CAAA;AACjF,eAAO,MAAM,8BAA8B,EAAE,8BAAqE,CAAA;AAElH,MAAM,MAAM,wBAAwB,GAAG,aAAa,CAClD;IACE,SAAS,CAAC,EAAE,YAAY,CAAA;IACxB,mBAAmB,CAAC,EAAE,YAAY,CAAA;IAClC,MAAM,EAAE,8BAA8B,CAAA;CACvC,GAAG,mBAAmB,GACrB,mBAAmB,CACtB,CAAA"}
@@ -0,0 +1,8 @@
1
+ export interface ForecastingSettings {
2
+ forecastingMethod?: string;
3
+ forecastingSteps?: number;
4
+ windowSize?: number;
5
+ witnessAddresses?: string[];
6
+ witnessSchema?: string;
7
+ }
8
+ //# sourceMappingURL=ForecastingSettings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ForecastingSettings.d.ts","sourceRoot":"","sources":["../../../src/Config/ForecastingSettings.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB"}
@@ -0,0 +1,4 @@
1
+ export interface TransformerSettings {
2
+ jsonPathExpression?: string;
3
+ }
4
+ //# sourceMappingURL=TransformerSettings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TransformerSettings.d.ts","sourceRoot":"","sources":["../../../src/Config/TransformerSettings.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B"}
@@ -0,0 +1,4 @@
1
+ export * from './Config';
2
+ export * from './ForecastingSettings';
3
+ export * from './TransformerSettings';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Config/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { Payload } from '@xyo-network/payload-model';
2
+ import { Promisable } from '@xyo-network/promise';
3
+ import { Forecast } from './Payload';
4
+ import { PayloadValueTransformer } from './PayloadValueTransformer';
5
+ export type ForecastingMethod = (payloads: Payload[], transformers: PayloadValueTransformer) => Promisable<Forecast[]>;
6
+ //# sourceMappingURL=ForecastingMethod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ForecastingMethod.d.ts","sourceRoot":"","sources":["../../src/ForecastingMethod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAEnE,MAAM,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,YAAY,EAAE,uBAAuB,KAAK,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ export interface Forecast {
2
+ error?: number;
3
+ timestamp?: number;
4
+ value: number;
5
+ }
6
+ //# sourceMappingURL=Forecast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Forecast.d.ts","sourceRoot":"","sources":["../../../src/Payload/Forecast.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;CACd"}
@@ -0,0 +1,14 @@
1
+ import { Payload } from '@xyo-network/payload-model';
2
+ import { ForecastingDivinerSchema } from '../Schema';
3
+ import { Forecast } from './Forecast';
4
+ export type ForecastPayloadSchema = `${ForecastingDivinerSchema}.forecast`;
5
+ export declare const ForecastPayloadSchema: ForecastPayloadSchema;
6
+ export type ForecastPayload = Payload<{
7
+ schema: ForecastPayloadSchema;
8
+ values: Forecast[];
9
+ }>;
10
+ export declare const isForecastPayload: (x?: Payload | null) => x is import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
11
+ schema: ForecastPayloadSchema;
12
+ values: Forecast[];
13
+ };
14
+ //# sourceMappingURL=Payload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../src/Payload/Payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,MAAM,MAAM,qBAAqB,GAAG,GAAG,wBAAwB,WAAW,CAAA;AAC1E,eAAO,MAAM,qBAAqB,EAAE,qBAA8D,CAAA;AAElG,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC;IACpC,MAAM,EAAE,qBAAqB,CAAA;IAC7B,MAAM,EAAE,QAAQ,EAAE,CAAA;CACnB,CAAC,CAAA;AACF,eAAO,MAAM,iBAAiB,OAAQ,OAAO,GAAG,IAAI;YAH1C,qBAAqB;YACrB,QAAQ,EAAE;CAE8F,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './Forecast';
2
+ export * from './Payload';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Payload/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { Payload } from '@xyo-network/payload-model';
2
+ export type PayloadValueTransformer = (payload: Payload) => number;
3
+ //# sourceMappingURL=PayloadValueTransformer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PayloadValueTransformer.d.ts","sourceRoot":"","sources":["../../src/PayloadValueTransformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { Query } from '@xyo-network/module-model';
2
+ import { Payload } from '@xyo-network/payload-model';
3
+ import { ForecastingSettings } from './Config';
4
+ import { ForecastingDivinerSchema } from './Schema';
5
+ export type ForecastingDivinerQuerySchema = `${ForecastingDivinerSchema}.query`;
6
+ export declare const ForecastingDivinerQuerySchema: ForecastingDivinerQuerySchema;
7
+ export type ForecastingDivinerQueryPayload = Query<{
8
+ schema: ForecastingDivinerQuerySchema;
9
+ } & Partial<ForecastingSettings>>;
10
+ export declare const isForecastingDivinerQueryPayload: (x?: Payload | null) => x is import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & {
11
+ schema: ForecastingDivinerQuerySchema;
12
+ } & Partial<ForecastingSettings> & import("@xyo-network/module-model").QueryFields;
13
+ //# sourceMappingURL=Query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../src/Query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAA;AAEnD,MAAM,MAAM,6BAA6B,GAAG,GAAG,wBAAwB,QAAQ,CAAA;AAC/E,eAAO,MAAM,6BAA6B,EAAE,6BAAmE,CAAA;AAE/G,MAAM,MAAM,8BAA8B,GAAG,KAAK,CAAC;IAAE,MAAM,EAAE,6BAA6B,CAAA;CAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAA;AAC5H,eAAO,MAAM,gCAAgC,OAAQ,OAAO,GAAG,IAAI;YADN,6BAA6B;kFAE7C,CAAA"}
@@ -0,0 +1,3 @@
1
+ export type ForecastingDivinerSchema = 'network.xyo.diviner.forecasting';
2
+ export declare const ForecastingDivinerSchema: ForecastingDivinerSchema;
3
+ //# sourceMappingURL=Schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../src/Schema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAAG,iCAAiC,CAAA;AACxE,eAAO,MAAM,wBAAwB,EAAE,wBAA4D,CAAA"}
@@ -0,0 +1,7 @@
1
+ export * from './Config';
2
+ export * from './ForecastingMethod';
3
+ export * from './Payload';
4
+ export * from './PayloadValueTransformer';
5
+ export * from './Query';
6
+ export * from './Schema';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,qBAAqB,CAAA;AACnC,cAAc,WAAW,CAAA;AACzB,cAAc,2BAA2B,CAAA;AACzC,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA"}
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@xyo-network/diviner-forecasting-model",
3
+ "author": {
4
+ "email": "support@xyo.network",
5
+ "name": "XYO Development Team",
6
+ "url": "https://xyo.network"
7
+ },
8
+ "bugs": {
9
+ "email": "support@xyo.network",
10
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
11
+ },
12
+ "dependencies": {
13
+ "@xyo-network/diviner-model": "^2.56.0",
14
+ "@xyo-network/module-model": "^2.56.0",
15
+ "@xyo-network/payload-model": "^2.56.0",
16
+ "@xyo-network/promise": "^2.56.0"
17
+ },
18
+ "devDependencies": {
19
+ "@xylabs/ts-scripts-yarn3": "^2.16.5",
20
+ "@xylabs/tsconfig": "^2.16.5",
21
+ "typescript": "^4.9.5"
22
+ },
23
+ "description": "Primary SDK for using XYO Protocol 2.0",
24
+ "browser": "dist/esm/index.js",
25
+ "docs": "dist/docs.json",
26
+ "exports": {
27
+ ".": {
28
+ "node": {
29
+ "import": "./dist/esm/index.js",
30
+ "require": "./dist/cjs/index.js"
31
+ },
32
+ "browser": {
33
+ "import": "./dist/esm/index.js",
34
+ "require": "./dist/cjs/index.js"
35
+ },
36
+ "default": "./dist/esm/index.js"
37
+ },
38
+ "./dist/docs.json": {
39
+ "default": "./dist/docs.json"
40
+ },
41
+ "./package.json": "./package.json"
42
+ },
43
+ "main": "dist/cjs/index.js",
44
+ "module": "dist/esm/index.js",
45
+ "homepage": "https://xyo.network",
46
+ "license": "LGPL-3.0",
47
+ "publishConfig": {
48
+ "access": "public"
49
+ },
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
53
+ },
54
+ "sideEffects": false,
55
+ "types": "dist/types/index.d.ts",
56
+ "version": "2.56.0"
57
+ }
@@ -0,0 +1,18 @@
1
+ import { DivinerConfig } from '@xyo-network/diviner-model'
2
+ import { ModuleFilter } from '@xyo-network/module-model'
3
+
4
+ import { ForecastingDivinerSchema } from '../Schema'
5
+ import { ForecastingSettings } from './ForecastingSettings'
6
+ import { TransformerSettings } from './TransformerSettings'
7
+
8
+ export type ForecastingDivinerConfigSchema = `${ForecastingDivinerSchema}.config`
9
+ export const ForecastingDivinerConfigSchema: ForecastingDivinerConfigSchema = `${ForecastingDivinerSchema}.config`
10
+
11
+ export type ForecastingDivinerConfig = DivinerConfig<
12
+ {
13
+ archivist?: ModuleFilter
14
+ boundWitnessDiviner?: ModuleFilter
15
+ schema: ForecastingDivinerConfigSchema
16
+ } & ForecastingSettings &
17
+ TransformerSettings
18
+ >
@@ -0,0 +1,7 @@
1
+ export interface ForecastingSettings {
2
+ forecastingMethod?: string
3
+ forecastingSteps?: number
4
+ windowSize?: number
5
+ witnessAddresses?: string[]
6
+ witnessSchema?: string
7
+ }
@@ -0,0 +1,3 @@
1
+ export interface TransformerSettings {
2
+ jsonPathExpression?: string
3
+ }
@@ -0,0 +1,3 @@
1
+ export * from './Config'
2
+ export * from './ForecastingSettings'
3
+ export * from './TransformerSettings'
@@ -0,0 +1,7 @@
1
+ import { Payload } from '@xyo-network/payload-model'
2
+ import { Promisable } from '@xyo-network/promise'
3
+
4
+ import { Forecast } from './Payload'
5
+ import { PayloadValueTransformer } from './PayloadValueTransformer'
6
+
7
+ export type ForecastingMethod = (payloads: Payload[], transformers: PayloadValueTransformer) => Promisable<Forecast[]>
@@ -0,0 +1,5 @@
1
+ export interface Forecast {
2
+ error?: number
3
+ timestamp?: number
4
+ value: number
5
+ }
@@ -0,0 +1,13 @@
1
+ import { Payload } from '@xyo-network/payload-model'
2
+
3
+ import { ForecastingDivinerSchema } from '../Schema'
4
+ import { Forecast } from './Forecast'
5
+
6
+ export type ForecastPayloadSchema = `${ForecastingDivinerSchema}.forecast`
7
+ export const ForecastPayloadSchema: ForecastPayloadSchema = `${ForecastingDivinerSchema}.forecast`
8
+
9
+ export type ForecastPayload = Payload<{
10
+ schema: ForecastPayloadSchema
11
+ values: Forecast[]
12
+ }>
13
+ export const isForecastPayload = (x?: Payload | null): x is ForecastPayload => x?.schema === ForecastPayloadSchema
@@ -0,0 +1,2 @@
1
+ export * from './Forecast'
2
+ export * from './Payload'
@@ -0,0 +1,3 @@
1
+ import { Payload } from '@xyo-network/payload-model'
2
+
3
+ export type PayloadValueTransformer = (payload: Payload) => number
package/src/Query.ts ADDED
@@ -0,0 +1,12 @@
1
+ import { Query } from '@xyo-network/module-model'
2
+ import { Payload } from '@xyo-network/payload-model'
3
+
4
+ import { ForecastingSettings } from './Config'
5
+ import { ForecastingDivinerSchema } from './Schema'
6
+
7
+ export type ForecastingDivinerQuerySchema = `${ForecastingDivinerSchema}.query`
8
+ export const ForecastingDivinerQuerySchema: ForecastingDivinerQuerySchema = `${ForecastingDivinerSchema}.query`
9
+
10
+ export type ForecastingDivinerQueryPayload = Query<{ schema: ForecastingDivinerQuerySchema } & Partial<ForecastingSettings>>
11
+ export const isForecastingDivinerQueryPayload = (x?: Payload | null): x is ForecastingDivinerQueryPayload =>
12
+ x?.schema === ForecastingDivinerQuerySchema
package/src/Schema.ts ADDED
@@ -0,0 +1,2 @@
1
+ export type ForecastingDivinerSchema = 'network.xyo.diviner.forecasting'
2
+ export const ForecastingDivinerSchema: ForecastingDivinerSchema = 'network.xyo.diviner.forecasting'
package/src/index.ts ADDED
@@ -0,0 +1,6 @@
1
+ export * from './Config'
2
+ export * from './ForecastingMethod'
3
+ export * from './Payload'
4
+ export * from './PayloadValueTransformer'
5
+ export * from './Query'
6
+ export * from './Schema'