@xyo-network/diviner-hash-lease 3.6.0-rc.9 → 3.6.1

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,4 +1,4 @@
1
- import type { Payload } from '@xyo-network/payload-model';
1
+ import { type Payload, type WithSources } from '@xyo-network/payload-model';
2
2
  export declare const HashLeaseSchema: "network.xyo.hash.lease";
3
3
  export type HashLeaseSchema = typeof HashLeaseSchema;
4
4
  export type HashLease = Payload<{
@@ -7,4 +7,52 @@ export type HashLease = Payload<{
7
7
  */
8
8
  duration: number;
9
9
  }, HashLeaseSchema>;
10
+ /**
11
+ * Identity function for HashLease payload
12
+ */
13
+ export declare const isHashLease: (x?: unknown | null) => x is import("@xylabs/object").DeepRestrictToStringKeys<{
14
+ schema: "network.xyo.hash.lease";
15
+ duration: number;
16
+ }>;
17
+ export declare const asHashLease: {
18
+ <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
19
+ schema: "network.xyo.hash.lease";
20
+ duration: number;
21
+ }>>(value: import("@xylabs/promise").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
22
+ <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
23
+ schema: "network.xyo.hash.lease";
24
+ duration: number;
25
+ }>>(value: import("@xylabs/promise").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xylabs/object").DeepRestrictToStringKeys<{
26
+ schema: "network.xyo.hash.lease";
27
+ duration: number;
28
+ }>>, config?: import("@xylabs/object").TypeCheckConfig): TType;
29
+ };
30
+ export declare const asOptionalHashLease: <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
31
+ schema: "network.xyo.hash.lease";
32
+ duration: number;
33
+ }>>(value: import("@xylabs/promise").AnyNonPromise) => TType | undefined;
34
+ /**
35
+ * Identity function for HashLease payload with sources
36
+ */
37
+ export declare const isHashLeaseWithSources: (x?: unknown | null) => x is WithSources<WithSources<import("@xylabs/object").DeepRestrictToStringKeys<{
38
+ schema: "network.xyo.hash.lease";
39
+ duration: number;
40
+ }>>>;
41
+ export declare const asHashLeaseWithSources: {
42
+ <TType extends WithSources<import("@xylabs/object").DeepRestrictToStringKeys<{
43
+ schema: "network.xyo.hash.lease";
44
+ duration: number;
45
+ }>>>(value: import("@xylabs/promise").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
46
+ <TType extends WithSources<import("@xylabs/object").DeepRestrictToStringKeys<{
47
+ schema: "network.xyo.hash.lease";
48
+ duration: number;
49
+ }>>>(value: import("@xylabs/promise").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<WithSources<import("@xylabs/object").DeepRestrictToStringKeys<{
50
+ schema: "network.xyo.hash.lease";
51
+ duration: number;
52
+ }>>>, config?: import("@xylabs/object").TypeCheckConfig): TType;
53
+ };
54
+ export declare const asOptionalHashLeaseWithSources: <TType extends WithSources<import("@xylabs/object").DeepRestrictToStringKeys<{
55
+ schema: "network.xyo.hash.lease";
56
+ duration: number;
57
+ }>>>(value: import("@xylabs/promise").AnyNonPromise) => TType | undefined;
10
58
  //# sourceMappingURL=HashLease.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HashLease.d.ts","sourceRoot":"","sources":["../../../src/Payload/HashLease.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,eAAO,MAAM,eAAe,EAAG,wBAAiC,CAAA;AAChE,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAA;AAEpD,MAAM,MAAM,SAAS,GAAG,OAAO,CAC7B;IACE;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;CACjB,EACD,eAAe,CAChB,CAAA"}
1
+ {"version":3,"file":"HashLease.d.ts","sourceRoot":"","sources":["../../../src/Payload/HashLease.ts"],"names":[],"mappings":"AACA,OAAO,EACoD,KAAK,OAAO,EAAE,KAAK,WAAW,EACxF,MAAM,4BAA4B,CAAA;AAEnC,eAAO,MAAM,eAAe,EAAG,wBAAiC,CAAA;AAChE,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAA;AAEpD,MAAM,MAAM,SAAS,GAAG,OAAO,CAC7B;IACE;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;CACjB,EACD,eAAe,CAChB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,WAAW;;cARV,MAAM;EAQwD,CAAA;AAC5E,eAAO,MAAM,WAAW;;;kBATV,MAAM;sBAPpB,iBAAgB,iCAAiC,gBAElC;;;kBAKD,MAAM;sBAAhB,iBAAa;;kBAAH,MAAM;yBAQL,gBAAoB;CACsC,CAAA;AACzE,eAAO,MAAM,mBAAmB;;cAVlB,MAAM;kBAUE,iBAAiB,qCAAkD,CAAA;AAEzF;;GAEG;AACH,eAAO,MAAM,sBAAsB;;cAfrB,MAAM;IAe2F,CAAA;AAC/G,eAAO,MAAM,sBAAsB;;;kBAhBrB,MAAM;uBAPpB,iBAAgB,iCAAiC,gBAElC;;;kBAKD,MAAM;uBAAhB,iBAAa;;kBAAH,MAAM;0BAQL,gBAAoB;CAQyE,CAAA;AAC5G,eAAO,MAAM,8BAA8B;;cAjB7B,MAAM;mBAUE,iBAAiB,qCAOqF,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Payload } from '@xyo-network/payload-model';
1
+ import type { Payload, WithSources } from '@xyo-network/payload-model';
2
2
  export declare const HashLeaseEstimateSchema: "network.xyo.hash.lease.estimate";
3
3
  export type HashLeaseEstimateSchema = typeof HashLeaseEstimateSchema;
4
4
  export interface HashLeaseEstimateFields {
@@ -30,14 +30,76 @@ export declare const isHashLeaseEstimate: (x?: unknown | null) => x is import("@
30
30
  nbf: number;
31
31
  price: number;
32
32
  }>;
33
+ export declare const asHashLeaseEstimate: {
34
+ <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
35
+ schema: "network.xyo.hash.lease.estimate";
36
+ currency: string;
37
+ exp: number;
38
+ nbf: number;
39
+ price: number;
40
+ }>>(value: import("@xylabs/promise").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
41
+ <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
42
+ schema: "network.xyo.hash.lease.estimate";
43
+ currency: string;
44
+ exp: number;
45
+ nbf: number;
46
+ price: number;
47
+ }>>(value: import("@xylabs/promise").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xylabs/object").DeepRestrictToStringKeys<{
48
+ schema: "network.xyo.hash.lease.estimate";
49
+ currency: string;
50
+ exp: number;
51
+ nbf: number;
52
+ price: number;
53
+ }>>, config?: import("@xylabs/object" /**
54
+ * When the lease begins
55
+ */).TypeCheckConfig): TType;
56
+ };
57
+ export declare const asOptionalHashLeaseEstimate: <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
58
+ schema: "network.xyo.hash.lease.estimate";
59
+ currency: string;
60
+ exp: number;
61
+ nbf: number;
62
+ price: number;
63
+ }>>(value: import("@xylabs/promise").AnyNonPromise) => TType | undefined;
33
64
  /**
34
65
  * Identity function for HashLeaseEstimate payload with sources
35
66
  */
36
- export declare const isHashLeaseEstimateWithSources: (x?: unknown | null) => x is import("@xyo-network/payload-model").WithSources<import("@xylabs/object").DeepRestrictToStringKeys<{
67
+ export declare const isHashLeaseEstimateWithSources: (x?: unknown | null) => x is WithSources<WithSources<import("@xylabs/object").DeepRestrictToStringKeys<{
68
+ schema: "network.xyo.hash.lease.estimate";
69
+ currency: string;
70
+ exp: number;
71
+ nbf: number;
72
+ price: number;
73
+ }>>>;
74
+ export declare const asHashLeaseEstimateWithSources: {
75
+ <TType extends WithSources<import("@xylabs/object").DeepRestrictToStringKeys<{
76
+ schema: "network.xyo.hash.lease.estimate";
77
+ currency: string;
78
+ exp: number;
79
+ nbf: number;
80
+ price: number;
81
+ }>>>(value: import("@xylabs/promise").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
82
+ <TType extends WithSources<import("@xylabs/object").DeepRestrictToStringKeys<{
83
+ schema: "network.xyo.hash.lease.estimate";
84
+ currency: string;
85
+ exp: number;
86
+ nbf: number;
87
+ price: number;
88
+ }>>>(value: import("@xylabs/promise").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<WithSources<import("@xylabs/object").DeepRestrictToStringKeys<{
89
+ schema: "network.xyo.hash.lease.estimate";
90
+ currency: string;
91
+ exp: number;
92
+ nbf: number;
93
+ price: number;
94
+ }>>>, config?: import("@xylabs/object" /**
95
+ * When the lease begins
96
+ */).TypeCheckConfig): TType;
97
+ };
98
+ export declare const asOptionalHashLeaseEstimateWithSources: <TType extends WithSources<import("@xylabs/object").DeepRestrictToStringKeys<{
37
99
  schema: "network.xyo.hash.lease.estimate";
38
100
  currency: string;
39
101
  exp: number;
40
102
  nbf: number;
41
103
  price: number;
42
- }>>;
104
+ }>>>(value: import("@xylabs/promise").AnyNonPromise) => TType | undefined;
43
105
  //# sourceMappingURL=HashLeaseEstimate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HashLeaseEstimate.d.ts","sourceRoot":"","sources":["../../../src/Payload/HashLeaseEstimate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGzD,eAAO,MAAM,uBAAuB,EAAG,iCAA0C,CAAA;AACjF,MAAM,MAAM,uBAAuB,GAAG,OAAO,uBAAuB,CAAA;AAEpE,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,uBAAuB,EAAE,uBAAuB,CAAC,CAAA;AAEzF;;GAEG;AACH,eAAO,MAAM,mBAAmB;;cApBpB,MAAM;SAIX,MAAM;SAIN,MAAM;WAIJ,MAAM;EAQqF,CAAA;AAEpG;;GAEG;AACH,eAAO,MAAM,8BAA8B;;cAzB/B,MAAM;SAIX,MAAM;SAIN,MAAM;WAIJ,MAAM;GAa2G,CAAA"}
1
+ {"version":3,"file":"HashLeaseEstimate.d.ts","sourceRoot":"","sources":["../../../src/Payload/HashLeaseEstimate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAGtE,eAAO,MAAM,uBAAuB,EAAG,iCAA0C,CAAA;AACjF,MAAM,MAAM,uBAAuB,GAAG,OAAO,uBAAuB,CAAA;AAEpE,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,uBAAuB,EAAE,uBAAuB,CAAC,CAAA;AAEzF;;GAEG;AACH,eAAO,MAAM,mBAAmB;;cApBpB,MAAM;SAIX,MAAM;SAIN,MAAM;WAIJ,MAAM;EAQqF,CAAA;AACpG,eAAO,MAAM,mBAAmB;;;kBArBpB,MAAM;aAIX,MAAM;aAIN,MAAM;eAIJ,MAAM;sBAnBa,iBAAiB,iCAAiC,gBAC9D;;;kBAMJ,MAAM;aAIX,MAAM;aAIN,MAAM;eAIJ,MAAM;sBAhBU,iBAAiB;;kBAI9B,MAAM;aAIX,MAAM;aAIN,MAAM;eAIJ,MAAM;yBATZ,gBAED,CAAA;;OAEG;CAc4F,CAAA;AACjG,eAAO,MAAM,2BAA2B;;cAtB5B,MAAM;SAIX,MAAM;SAIN,MAAM;WAIJ,MAAM;kBAGG,iBAAiB,qCAO8E,CAAA;AAEjH;;GAEG;AACH,eAAO,MAAM,8BAA8B;;cA3B/B,MAAM;SAIX,MAAM;SAIN,MAAM;WAIJ,MAAM;IAewH,CAAA;AACvI,eAAO,MAAM,8BAA8B;;;kBA5B/B,MAAM;aAIX,MAAM;aAIN,MAAM;eAIJ,MAAM;uBAnBa,iBAAiB,iCAAiC,gBAC9D;;;kBAMJ,MAAM;aAIX,MAAM;aAIN,MAAM;eAIJ,MAAM;uBAhBU,iBAAiB;;kBAI9B,MAAM;aAIX,MAAM;aAIN,MAAM;eAIJ,MAAM;0BATZ,gBAED,CAAA;;OAEG;CAqB+H,CAAA;AACpI,eAAO,MAAM,sCAAsC;;cA7BvC,MAAM;SAIX,MAAM;SAIN,MAAM;WAIJ,MAAM;mBAGG,iBAAiB,qCAciH,CAAA"}
@@ -9,13 +9,26 @@ import { AbstractDiviner } from "@xyo-network/diviner-abstract";
9
9
  import { creatableModule } from "@xyo-network/module-model";
10
10
 
11
11
  // src/Payload/HashLease.ts
12
+ import { AsObjectFactory } from "@xylabs/object";
13
+ import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from "@xyo-network/payload-model";
12
14
  var HashLeaseSchema = "network.xyo.hash.lease";
15
+ var isHashLease = isPayloadOfSchemaType(HashLeaseSchema);
16
+ var asHashLease = AsObjectFactory.create(isHashLease);
17
+ var asOptionalHashLease = AsObjectFactory.createOptional(isHashLease);
18
+ var isHashLeaseWithSources = isPayloadOfSchemaTypeWithSources(HashLeaseSchema);
19
+ var asHashLeaseWithSources = AsObjectFactory.create(isHashLeaseWithSources);
20
+ var asOptionalHashLeaseWithSources = AsObjectFactory.createOptional(isHashLeaseWithSources);
13
21
 
14
22
  // src/Payload/HashLeaseEstimate.ts
15
- import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from "@xyo-network/payload-model";
23
+ import { AsObjectFactory as AsObjectFactory2 } from "@xylabs/object";
24
+ import { isPayloadOfSchemaType as isPayloadOfSchemaType2, isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources2 } from "@xyo-network/payload-model";
16
25
  var HashLeaseEstimateSchema = "network.xyo.hash.lease.estimate";
17
- var isHashLeaseEstimate = isPayloadOfSchemaType(HashLeaseEstimateSchema);
18
- var isHashLeaseEstimateWithSources = isPayloadOfSchemaTypeWithSources(HashLeaseEstimateSchema);
26
+ var isHashLeaseEstimate = isPayloadOfSchemaType2(HashLeaseEstimateSchema);
27
+ var asHashLeaseEstimate = AsObjectFactory2.create(isHashLeaseEstimate);
28
+ var asOptionalHashLeaseEstimate = AsObjectFactory2.createOptional(isHashLeaseEstimate);
29
+ var isHashLeaseEstimateWithSources = isPayloadOfSchemaTypeWithSources2(HashLeaseEstimateSchema);
30
+ var asHashLeaseEstimateWithSources = AsObjectFactory2.create(isHashLeaseEstimateWithSources);
31
+ var asOptionalHashLeaseEstimateWithSources = AsObjectFactory2.createOptional(isHashLeaseEstimateWithSources);
19
32
 
20
33
  // src/Diviner.ts
21
34
  function _ts_decorate(decorators, target, key, desc) {
@@ -47,7 +60,17 @@ export {
47
60
  HashLeaseEstimateDivinerConfigSchema,
48
61
  HashLeaseEstimateSchema,
49
62
  HashLeaseSchema,
63
+ asHashLease,
64
+ asHashLeaseEstimate,
65
+ asHashLeaseEstimateWithSources,
66
+ asHashLeaseWithSources,
67
+ asOptionalHashLease,
68
+ asOptionalHashLeaseEstimate,
69
+ asOptionalHashLeaseEstimateWithSources,
70
+ asOptionalHashLeaseWithSources,
71
+ isHashLease,
50
72
  isHashLeaseEstimate,
51
- isHashLeaseEstimateWithSources
73
+ isHashLeaseEstimateWithSources,
74
+ isHashLeaseWithSources
52
75
  };
53
76
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Config.ts","../../src/Diviner.ts","../../src/Payload/HashLease.ts","../../src/Payload/HashLeaseEstimate.ts"],"sourcesContent":["import type { DivinerConfig } from '@xyo-network/diviner-model'\n\nexport const HashLeaseEstimateDivinerConfigSchema = 'network.xyo.diviner.hash.lease.estimate.config' as const\nexport type HashLeaseEstimateDivinerConfigSchema = typeof HashLeaseEstimateDivinerConfigSchema\n\nexport type HashLeaseEstimateDivinerConfig = DivinerConfig<\n\n {\n //\n },\n HashLeaseEstimateDivinerConfigSchema\n>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model'\nimport { creatableModule } from '@xyo-network/module-model'\nimport { Payload, Schema } from '@xyo-network/payload-model'\n\nimport { HashLeaseEstimateDivinerConfigSchema } from './Config.ts'\nimport { HashLeaseEstimateDivinerParams } from './Params.ts'\nimport { HashLeaseEstimate, HashLeaseEstimateSchema } from './Payload/index.ts'\n\n@creatableModule()\nexport class HashLeaseEstimateDiviner<\n TParams extends HashLeaseEstimateDivinerParams = HashLeaseEstimateDivinerParams,\n TIn extends Payload = Payload,\n TOut extends HashLeaseEstimate | Payload = HashLeaseEstimate | Payload,\n TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<\n DivinerInstance<TParams, TIn, TOut>,\n TIn,\n TOut\n >,\n> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, HashLeaseEstimateDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = HashLeaseEstimateDivinerConfigSchema\n static override targetSchema = HashLeaseEstimateSchema\n\n protected override async divineHandler(_payloads: TIn[] = []): Promise<TOut[]> {\n return await Promise.resolve([])\n }\n}\n","import type { Payload } from '@xyo-network/payload-model'\n\nexport const HashLeaseSchema = 'network.xyo.hash.lease' as const\nexport type HashLeaseSchema = typeof HashLeaseSchema\n\nexport type HashLease = Payload<\n {\n /**\n * The desired duration of the lease\n */\n duration: number\n },\n HashLeaseSchema\n>\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'\n\nexport const HashLeaseEstimateSchema = 'network.xyo.hash.lease.estimate' as const\nexport type HashLeaseEstimateSchema = typeof HashLeaseEstimateSchema\n\nexport interface HashLeaseEstimateFields {\n /**\n * The currency of the price\n */\n currency: string\n /**\n * When the lease ends\n */\n exp: number\n /**\n * When the lease begins\n */\n nbf: number\n /**\n * The estimated price of the lease\n */\n price: number\n}\n\nexport type HashLeaseEstimate = Payload<HashLeaseEstimateFields, HashLeaseEstimateSchema>\n\n/**\n * Identity function for HashLeaseEstimate payload\n */\nexport const isHashLeaseEstimate = isPayloadOfSchemaType<HashLeaseEstimate>(HashLeaseEstimateSchema)\n\n/**\n * Identity function for HashLeaseEstimate payload with sources\n */\nexport const isHashLeaseEstimateWithSources = isPayloadOfSchemaTypeWithSources<HashLeaseEstimate>(HashLeaseEstimateSchema)\n"],"mappings":";;;;AAEO,IAAMA,uCAAuC;;;ACFpD,SAASC,uBAAuB;AAEhC,SAASC,uBAAuB;;;ACAzB,IAAMC,kBAAkB;;;ACD/B,SAASC,uBAAuBC,wCAAwC;AAEjE,IAAMC,0BAA0B;AA2BhC,IAAMC,sBAAsBH,sBAAyCE,uBAAAA;AAKrE,IAAME,iCAAiCH,iCAAoDC,uBAAAA;;;;;;;;;;AFzB3F,IAAMG,2BAAN,cASGC,gBAAAA;SAAAA;;;EACR,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;EACvD,OAAgBE,eAAeC;EAE/B,MAAyBC,cAAcC,YAAmB,CAAA,GAAqB;AAC7E,WAAO,MAAMC,QAAQC,QAAQ,CAAA,CAAE;EACjC;AACF;;;;","names":["HashLeaseEstimateDivinerConfigSchema","AbstractDiviner","creatableModule","HashLeaseSchema","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","HashLeaseEstimateSchema","isHashLeaseEstimate","isHashLeaseEstimateWithSources","HashLeaseEstimateDiviner","AbstractDiviner","configSchemas","HashLeaseEstimateDivinerConfigSchema","defaultConfigSchema","targetSchema","HashLeaseEstimateSchema","divineHandler","_payloads","Promise","resolve"]}
1
+ {"version":3,"sources":["../../src/Config.ts","../../src/Diviner.ts","../../src/Payload/HashLease.ts","../../src/Payload/HashLeaseEstimate.ts"],"sourcesContent":["import type { DivinerConfig } from '@xyo-network/diviner-model'\n\nexport const HashLeaseEstimateDivinerConfigSchema = 'network.xyo.diviner.hash.lease.estimate.config' as const\nexport type HashLeaseEstimateDivinerConfigSchema = typeof HashLeaseEstimateDivinerConfigSchema\n\nexport type HashLeaseEstimateDivinerConfig = DivinerConfig<\n\n {\n //\n },\n HashLeaseEstimateDivinerConfigSchema\n>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model'\nimport { creatableModule } from '@xyo-network/module-model'\nimport { Payload, Schema } from '@xyo-network/payload-model'\n\nimport { HashLeaseEstimateDivinerConfigSchema } from './Config.ts'\nimport { HashLeaseEstimateDivinerParams } from './Params.ts'\nimport { HashLeaseEstimate, HashLeaseEstimateSchema } from './Payload/index.ts'\n\n@creatableModule()\nexport class HashLeaseEstimateDiviner<\n TParams extends HashLeaseEstimateDivinerParams = HashLeaseEstimateDivinerParams,\n TIn extends Payload = Payload,\n TOut extends HashLeaseEstimate | Payload = HashLeaseEstimate | Payload,\n TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<\n DivinerInstance<TParams, TIn, TOut>,\n TIn,\n TOut\n >,\n> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, HashLeaseEstimateDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = HashLeaseEstimateDivinerConfigSchema\n static override targetSchema = HashLeaseEstimateSchema\n\n protected override async divineHandler(_payloads: TIn[] = []): Promise<TOut[]> {\n return await Promise.resolve([])\n }\n}\n","import { AsObjectFactory } from '@xylabs/object'\nimport {\n isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources, type Payload, type WithSources,\n} from '@xyo-network/payload-model'\n\nexport const HashLeaseSchema = 'network.xyo.hash.lease' as const\nexport type HashLeaseSchema = typeof HashLeaseSchema\n\nexport type HashLease = Payload<\n {\n /**\n * The desired duration of the lease\n */\n duration: number\n },\n HashLeaseSchema\n>\n\n/**\n * Identity function for HashLease payload\n */\nexport const isHashLease = isPayloadOfSchemaType<HashLease>(HashLeaseSchema)\nexport const asHashLease = AsObjectFactory.create<HashLease>(isHashLease)\nexport const asOptionalHashLease = AsObjectFactory.createOptional<HashLease>(isHashLease)\n\n/**\n * Identity function for HashLease payload with sources\n */\nexport const isHashLeaseWithSources = isPayloadOfSchemaTypeWithSources<WithSources<HashLease>>(HashLeaseSchema)\nexport const asHashLeaseWithSources = AsObjectFactory.create<WithSources<HashLease>>(isHashLeaseWithSources)\nexport const asOptionalHashLeaseWithSources = AsObjectFactory.createOptional<WithSources<HashLease>>(isHashLeaseWithSources)\n","import { AsObjectFactory } from '@xylabs/object'\nimport type { Payload, WithSources } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'\n\nexport const HashLeaseEstimateSchema = 'network.xyo.hash.lease.estimate' as const\nexport type HashLeaseEstimateSchema = typeof HashLeaseEstimateSchema\n\nexport interface HashLeaseEstimateFields {\n /**\n * The currency of the price\n */\n currency: string\n /**\n * When the lease ends\n */\n exp: number\n /**\n * When the lease begins\n */\n nbf: number\n /**\n * The estimated price of the lease\n */\n price: number\n}\n\nexport type HashLeaseEstimate = Payload<HashLeaseEstimateFields, HashLeaseEstimateSchema>\n\n/**\n * Identity function for HashLeaseEstimate payload\n */\nexport const isHashLeaseEstimate = isPayloadOfSchemaType<HashLeaseEstimate>(HashLeaseEstimateSchema)\nexport const asHashLeaseEstimate = AsObjectFactory.create<HashLeaseEstimate>(isHashLeaseEstimate)\nexport const asOptionalHashLeaseEstimate = AsObjectFactory.createOptional<HashLeaseEstimate>(isHashLeaseEstimate)\n\n/**\n * Identity function for HashLeaseEstimate payload with sources\n */\nexport const isHashLeaseEstimateWithSources = isPayloadOfSchemaTypeWithSources<WithSources<HashLeaseEstimate>>(HashLeaseEstimateSchema)\nexport const asHashLeaseEstimateWithSources = AsObjectFactory.create<WithSources<HashLeaseEstimate>>(isHashLeaseEstimateWithSources)\nexport const asOptionalHashLeaseEstimateWithSources = AsObjectFactory.createOptional<WithSources<HashLeaseEstimate>>(isHashLeaseEstimateWithSources)\n"],"mappings":";;;;AAEO,IAAMA,uCAAuC;;;ACFpD,SAASC,uBAAuB;AAEhC,SAASC,uBAAuB;;;ACFhC,SAASC,uBAAuB;AAChC,SACEC,uBAAuBC,wCAClB;AAEA,IAAMC,kBAAkB;AAgBxB,IAAMC,cAAcH,sBAAiCE,eAAAA;AACrD,IAAME,cAAcL,gBAAgBM,OAAkBF,WAAAA;AACtD,IAAMG,sBAAsBP,gBAAgBQ,eAA0BJ,WAAAA;AAKtE,IAAMK,yBAAyBP,iCAAyDC,eAAAA;AACxF,IAAMO,yBAAyBV,gBAAgBM,OAA+BG,sBAAAA;AAC9E,IAAME,iCAAiCX,gBAAgBQ,eAAuCC,sBAAAA;;;AC9BrG,SAASG,mBAAAA,wBAAuB;AAEhC,SAASC,yBAAAA,wBAAuBC,oCAAAA,yCAAwC;AAEjE,IAAMC,0BAA0B;AA2BhC,IAAMC,sBAAsBH,uBAAyCE,uBAAAA;AACrE,IAAME,sBAAsBL,iBAAgBM,OAA0BF,mBAAAA;AACtE,IAAMG,8BAA8BP,iBAAgBQ,eAAkCJ,mBAAAA;AAKtF,IAAMK,iCAAiCP,kCAAiEC,uBAAAA;AACxG,IAAMO,iCAAiCV,iBAAgBM,OAAuCG,8BAAAA;AAC9F,IAAME,yCAAyCX,iBAAgBQ,eAA+CC,8BAAAA;;;;;;;;;;AF9B9G,IAAMG,2BAAN,cASGC,gBAAAA;SAAAA;;;EACR,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;EACvD,OAAgBE,eAAeC;EAE/B,MAAyBC,cAAcC,YAAmB,CAAA,GAAqB;AAC7E,WAAO,MAAMC,QAAQC,QAAQ,CAAA,CAAE;EACjC;AACF;;;;","names":["HashLeaseEstimateDivinerConfigSchema","AbstractDiviner","creatableModule","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","HashLeaseSchema","isHashLease","asHashLease","create","asOptionalHashLease","createOptional","isHashLeaseWithSources","asHashLeaseWithSources","asOptionalHashLeaseWithSources","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","HashLeaseEstimateSchema","isHashLeaseEstimate","asHashLeaseEstimate","create","asOptionalHashLeaseEstimate","createOptional","isHashLeaseEstimateWithSources","asHashLeaseEstimateWithSources","asOptionalHashLeaseEstimateWithSources","HashLeaseEstimateDiviner","AbstractDiviner","configSchemas","HashLeaseEstimateDivinerConfigSchema","defaultConfigSchema","targetSchema","HashLeaseEstimateSchema","divineHandler","_payloads","Promise","resolve"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/diviner-hash-lease",
3
- "version": "3.6.0-rc.9",
3
+ "version": "3.6.1",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -29,18 +29,18 @@
29
29
  "module": "dist/neutral/index.mjs",
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "dependencies": {
32
- "@xyo-network/diviner-abstract": "^3.6.0-rc.9",
33
- "@xyo-network/diviner-model": "^3.6.0-rc.9",
34
- "@xyo-network/module-model": "^3.6.0-rc.9",
35
- "@xyo-network/payload-model": "^3.6.0-rc.9"
32
+ "@xylabs/object": "^4.4.26",
33
+ "@xyo-network/diviner-abstract": "^3.6.1",
34
+ "@xyo-network/diviner-model": "^3.6.1",
35
+ "@xyo-network/module-model": "^3.6.1",
36
+ "@xyo-network/payload-model": "^3.6.1"
36
37
  },
37
38
  "devDependencies": {
38
- "@xylabs/ts-scripts-yarn3": "^4.2.4",
39
- "@xylabs/tsconfig": "^4.2.4",
39
+ "@xylabs/ts-scripts-yarn3": "^4.2.6",
40
+ "@xylabs/tsconfig": "^4.2.6",
40
41
  "typescript": "^5.7.2"
41
42
  },
42
43
  "publishConfig": {
43
44
  "access": "public"
44
- },
45
- "stableVersion": "3.5.2"
45
+ }
46
46
  }
@@ -1,4 +1,7 @@
1
- import type { Payload } from '@xyo-network/payload-model'
1
+ import { AsObjectFactory } from '@xylabs/object'
2
+ import {
3
+ isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources, type Payload, type WithSources,
4
+ } from '@xyo-network/payload-model'
2
5
 
3
6
  export const HashLeaseSchema = 'network.xyo.hash.lease' as const
4
7
  export type HashLeaseSchema = typeof HashLeaseSchema
@@ -12,3 +15,17 @@ export type HashLease = Payload<
12
15
  },
13
16
  HashLeaseSchema
14
17
  >
18
+
19
+ /**
20
+ * Identity function for HashLease payload
21
+ */
22
+ export const isHashLease = isPayloadOfSchemaType<HashLease>(HashLeaseSchema)
23
+ export const asHashLease = AsObjectFactory.create<HashLease>(isHashLease)
24
+ export const asOptionalHashLease = AsObjectFactory.createOptional<HashLease>(isHashLease)
25
+
26
+ /**
27
+ * Identity function for HashLease payload with sources
28
+ */
29
+ export const isHashLeaseWithSources = isPayloadOfSchemaTypeWithSources<WithSources<HashLease>>(HashLeaseSchema)
30
+ export const asHashLeaseWithSources = AsObjectFactory.create<WithSources<HashLease>>(isHashLeaseWithSources)
31
+ export const asOptionalHashLeaseWithSources = AsObjectFactory.createOptional<WithSources<HashLease>>(isHashLeaseWithSources)
@@ -1,4 +1,5 @@
1
- import type { Payload } from '@xyo-network/payload-model'
1
+ import { AsObjectFactory } from '@xylabs/object'
2
+ import type { Payload, WithSources } from '@xyo-network/payload-model'
2
3
  import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'
3
4
 
4
5
  export const HashLeaseEstimateSchema = 'network.xyo.hash.lease.estimate' as const
@@ -29,8 +30,12 @@ export type HashLeaseEstimate = Payload<HashLeaseEstimateFields, HashLeaseEstima
29
30
  * Identity function for HashLeaseEstimate payload
30
31
  */
31
32
  export const isHashLeaseEstimate = isPayloadOfSchemaType<HashLeaseEstimate>(HashLeaseEstimateSchema)
33
+ export const asHashLeaseEstimate = AsObjectFactory.create<HashLeaseEstimate>(isHashLeaseEstimate)
34
+ export const asOptionalHashLeaseEstimate = AsObjectFactory.createOptional<HashLeaseEstimate>(isHashLeaseEstimate)
32
35
 
33
36
  /**
34
37
  * Identity function for HashLeaseEstimate payload with sources
35
38
  */
36
- export const isHashLeaseEstimateWithSources = isPayloadOfSchemaTypeWithSources<HashLeaseEstimate>(HashLeaseEstimateSchema)
39
+ export const isHashLeaseEstimateWithSources = isPayloadOfSchemaTypeWithSources<WithSources<HashLeaseEstimate>>(HashLeaseEstimateSchema)
40
+ export const asHashLeaseEstimateWithSources = AsObjectFactory.create<WithSources<HashLeaseEstimate>>(isHashLeaseEstimateWithSources)
41
+ export const asOptionalHashLeaseEstimateWithSources = AsObjectFactory.createOptional<WithSources<HashLeaseEstimate>>(isHashLeaseEstimateWithSources)