@xyo-network/diviner-hash-lease 3.6.0 → 3.6.2

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"}
@@ -9,18 +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 { AsObjectFactory } from "@xylabs/object";
16
- 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";
17
25
  var HashLeaseEstimateSchema = "network.xyo.hash.lease.estimate";
18
- var isHashLeaseEstimate = isPayloadOfSchemaType(HashLeaseEstimateSchema);
19
- var asHashLeaseEstimate = AsObjectFactory.create(isHashLeaseEstimate);
20
- var asOptionalHashLeaseEstimate = AsObjectFactory.createOptional(isHashLeaseEstimate);
21
- var isHashLeaseEstimateWithSources = isPayloadOfSchemaTypeWithSources(HashLeaseEstimateSchema);
22
- var asHashLeaseEstimateWithSources = AsObjectFactory.create(isHashLeaseEstimateWithSources);
23
- var asOptionalHashLeaseEstimateWithSources = AsObjectFactory.createOptional(isHashLeaseEstimateWithSources);
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);
24
32
 
25
33
  // src/Diviner.ts
26
34
  function _ts_decorate(decorators, target, key, desc) {
@@ -52,11 +60,17 @@ export {
52
60
  HashLeaseEstimateDivinerConfigSchema,
53
61
  HashLeaseEstimateSchema,
54
62
  HashLeaseSchema,
63
+ asHashLease,
55
64
  asHashLeaseEstimate,
56
65
  asHashLeaseEstimateWithSources,
66
+ asHashLeaseWithSources,
67
+ asOptionalHashLease,
57
68
  asOptionalHashLeaseEstimate,
58
69
  asOptionalHashLeaseEstimateWithSources,
70
+ asOptionalHashLeaseWithSources,
71
+ isHashLease,
59
72
  isHashLeaseEstimate,
60
- isHashLeaseEstimateWithSources
73
+ isHashLeaseEstimateWithSources,
74
+ isHashLeaseWithSources
61
75
  };
62
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 { 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;;;ACAzB,IAAMC,kBAAkB;;;ACF/B,SAASC,uBAAuB;AAEhC,SAASC,uBAAuBC,wCAAwC;AAEjE,IAAMC,0BAA0B;AA2BhC,IAAMC,sBAAsBH,sBAAyCE,uBAAAA;AACrE,IAAME,sBAAsBL,gBAAgBM,OAA0BF,mBAAAA;AACtE,IAAMG,8BAA8BP,gBAAgBQ,eAAkCJ,mBAAAA;AAKtF,IAAMK,iCAAiCP,iCAAiEC,uBAAAA;AACxG,IAAMO,iCAAiCV,gBAAgBM,OAAuCG,8BAAAA;AAC9F,IAAME,yCAAyCX,gBAAgBQ,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","HashLeaseSchema","AsObjectFactory","isPayloadOfSchemaType","isPayloadOfSchemaTypeWithSources","HashLeaseEstimateSchema","isHashLeaseEstimate","asHashLeaseEstimate","create","asOptionalHashLeaseEstimate","createOptional","isHashLeaseEstimateWithSources","asHashLeaseEstimateWithSources","asOptionalHashLeaseEstimateWithSources","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",
3
+ "version": "3.6.2",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -30,10 +30,10 @@
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "dependencies": {
32
32
  "@xylabs/object": "^4.4.26",
33
- "@xyo-network/diviner-abstract": "^3.6.0",
34
- "@xyo-network/diviner-model": "^3.6.0",
35
- "@xyo-network/module-model": "^3.6.0",
36
- "@xyo-network/payload-model": "^3.6.0"
33
+ "@xyo-network/diviner-abstract": "^3.6.2",
34
+ "@xyo-network/diviner-model": "^3.6.2",
35
+ "@xyo-network/module-model": "^3.6.2",
36
+ "@xyo-network/payload-model": "^3.6.2"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@xylabs/ts-scripts-yarn3": "^4.2.6",
@@ -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)