@xyo-network/core 2.20.38 → 2.20.39

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.
@@ -1,6 +1,11 @@
1
1
  import { XyoPayload } from '../Payload';
2
2
  export interface XyoQueryPayload extends XyoPayload {
3
+ /** @field The preferred schema to use for the answer */
4
+ targetSchema?: string;
5
+ /** @field The maximum XYO that can be spent executing the query */
3
6
  budget?: number;
7
+ /** @field The frequency on which this query can be rerun */
4
8
  maxFrequency?: 'once' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
9
+ /** @field The starting point for the bidding on the query */
5
10
  minBid?: number;
6
11
  }
@@ -0,0 +1,7 @@
1
+ import { XyoPayload } from '../Payload';
2
+ import { XyoQueryPayload } from '../Query';
3
+ export declare class XyoQueryWitness<Q extends XyoQueryPayload, T extends XyoPayload> {
4
+ query: Q;
5
+ constructor(query: Q);
6
+ observe(fields?: Partial<T>): Promise<T>;
7
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.XyoQueryWitness = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const sdk_js_1 = require("@xylabs/sdk-js");
6
+ const Payload_1 = require("../Payload");
7
+ class XyoQueryWitness {
8
+ constructor(query) {
9
+ this.query = query;
10
+ }
11
+ observe(fields) {
12
+ var _a;
13
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
14
+ yield (0, sdk_js_1.delay)(0);
15
+ return new Payload_1.XyoPayloadBuilder({ schema: (_a = this.query.targetSchema) !== null && _a !== void 0 ? _a : 'network.xyo.payload' }).fields(fields).build();
16
+ });
17
+ }
18
+ }
19
+ exports.XyoQueryWitness = XyoQueryWitness;
20
+ //# sourceMappingURL=QueryWitness.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryWitness.js","sourceRoot":"","sources":["../../../src/Witness/QueryWitness.ts"],"names":[],"mappings":";;;;AAAA,2CAAsC;AAEtC,wCAA0D;AAG1D,MAAa,eAAe;IAG1B,YAAY,KAAQ;QAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAEY,OAAO,CAAC,MAAmB;;;YACtC,MAAM,IAAA,cAAK,EAAC,CAAC,CAAC,CAAA;YACd,OAAO,IAAI,2BAAiB,CAAI,EAAE,MAAM,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,YAAY,mCAAI,qBAAqB,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,CAAA;;KACrH;CACF;AAXD,0CAWC"}
@@ -1 +1,2 @@
1
+ export * from './QueryWitness';
1
2
  export * from './Witness';
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./QueryWitness"), exports);
4
5
  tslib_1.__exportStar(require("./Witness"), exports);
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Witness/index.ts"],"names":[],"mappings":";;;AAAA,oDAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Witness/index.ts"],"names":[],"mappings":";;;AAAA,yDAA8B;AAC9B,oDAAyB"}