@xyo-network/diviner-hash-lease 3.6.0-rc.17 → 3.6.0-rc.18
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.
|
@@ -30,6 +30,35 @@ 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").TypeCheckConfig): TType;
|
|
54
|
+
};
|
|
55
|
+
export declare const asOptionalHashLeaseEstimate: <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
|
|
56
|
+
schema: "network.xyo.hash.lease.estimate";
|
|
57
|
+
currency: string;
|
|
58
|
+
exp: number;
|
|
59
|
+
nbf: number;
|
|
60
|
+
price: number;
|
|
61
|
+
}>>(value: import("@xylabs/promise").AnyNonPromise) => TType | undefined;
|
|
33
62
|
/**
|
|
34
63
|
* Identity function for HashLeaseEstimate payload with sources
|
|
35
64
|
*/
|
|
@@ -40,4 +69,33 @@ export declare const isHashLeaseEstimateWithSources: (x?: unknown | null) => x i
|
|
|
40
69
|
nbf: number;
|
|
41
70
|
price: number;
|
|
42
71
|
}>>;
|
|
72
|
+
export declare const asHashLeaseEstimateWithSources: {
|
|
73
|
+
<TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
|
|
74
|
+
schema: "network.xyo.hash.lease.estimate";
|
|
75
|
+
currency: string;
|
|
76
|
+
exp: number;
|
|
77
|
+
nbf: number;
|
|
78
|
+
price: number;
|
|
79
|
+
}>>(value: import("@xylabs/promise").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
|
|
80
|
+
<TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
|
|
81
|
+
schema: "network.xyo.hash.lease.estimate";
|
|
82
|
+
currency: string;
|
|
83
|
+
exp: number;
|
|
84
|
+
nbf: number;
|
|
85
|
+
price: number;
|
|
86
|
+
}>>(value: import("@xylabs/promise").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xylabs/object").DeepRestrictToStringKeys<{
|
|
87
|
+
schema: "network.xyo.hash.lease.estimate";
|
|
88
|
+
currency: string;
|
|
89
|
+
exp: number;
|
|
90
|
+
nbf: number;
|
|
91
|
+
price: number;
|
|
92
|
+
}>>, config?: import("@xylabs/object").TypeCheckConfig): TType;
|
|
93
|
+
};
|
|
94
|
+
export declare const asOptionalHashLeaseEstimateWithSources: <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
|
|
95
|
+
schema: "network.xyo.hash.lease.estimate";
|
|
96
|
+
currency: string;
|
|
97
|
+
exp: number;
|
|
98
|
+
nbf: number;
|
|
99
|
+
price: number;
|
|
100
|
+
}>>(value: import("@xylabs/promise").AnyNonPromise) => TType | undefined;
|
|
43
101
|
//# sourceMappingURL=HashLeaseEstimate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HashLeaseEstimate.d.ts","sourceRoot":"","sources":["../../../src/Payload/HashLeaseEstimate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HashLeaseEstimate.d.ts","sourceRoot":"","sources":["../../../src/Payload/HashLeaseEstimate.ts"],"names":[],"mappings":"AACA,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;AACpG,eAAO,MAAM,mBAAmB;;;kBArBpB,MAAM;aAIX,MAAM;aAIN,MAAM;eAIJ,MAAM;sBAnB0B,iBAAiB,iCACjD,gBAAoB;;;kBAMjB,MAAM;aAIX,MAAM;aAIN,MAAM;eAIJ,MAAM;sBAhBuB,iBAEhC;;kBAEM,MAAM;aAIX,MAAM;aAIN,MAAM;eAIJ,MAAM;yBARN,gBAEA;CAewF,CAAA;AACjG,eAAO,MAAM,2BAA2B;;cAtB5B,MAAM;SAIX,MAAM;SAIN,MAAM;WAIJ,MAAM;kBAGiB,iBAAgB,qCAOiE,CAAA;AAEjH;;GAEG;AACH,eAAO,MAAM,8BAA8B;;cA3B/B,MAAM;SAIX,MAAM;SAIN,MAAM;WAIJ,MAAM;GAe2G,CAAA;AAC1H,eAAO,MAAM,8BAA8B;;;kBA5B/B,MAAM;aAIX,MAAM;aAIN,MAAM;eAIJ,MAAM;sBAnB0B,iBAAiB,iCACjD,gBAAoB;;;kBAMjB,MAAM;aAIX,MAAM;aAIN,MAAM;eAIJ,MAAM;sBAhBuB,iBAEhC;;kBAEM,MAAM;aAIX,MAAM;aAIN,MAAM;eAIJ,MAAM;yBARN,gBAEA;CAsB8G,CAAA;AACvH,eAAO,MAAM,sCAAsC;;cA7BvC,MAAM;SAIX,MAAM;SAIN,MAAM;WAIJ,MAAM;kBAGiB,iBAAgB,qCAcuF,CAAA"}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -12,10 +12,15 @@ import { creatableModule } from "@xyo-network/module-model";
|
|
|
12
12
|
var HashLeaseSchema = "network.xyo.hash.lease";
|
|
13
13
|
|
|
14
14
|
// src/Payload/HashLeaseEstimate.ts
|
|
15
|
+
import { AsObjectFactory } from "@xylabs/object";
|
|
15
16
|
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from "@xyo-network/payload-model";
|
|
16
17
|
var HashLeaseEstimateSchema = "network.xyo.hash.lease.estimate";
|
|
17
18
|
var isHashLeaseEstimate = isPayloadOfSchemaType(HashLeaseEstimateSchema);
|
|
19
|
+
var asHashLeaseEstimate = AsObjectFactory.create(isHashLeaseEstimate);
|
|
20
|
+
var asOptionalHashLeaseEstimate = AsObjectFactory.createOptional(isHashLeaseEstimate);
|
|
18
21
|
var isHashLeaseEstimateWithSources = isPayloadOfSchemaTypeWithSources(HashLeaseEstimateSchema);
|
|
22
|
+
var asHashLeaseEstimateWithSources = AsObjectFactory.create(isHashLeaseEstimateWithSources);
|
|
23
|
+
var asOptionalHashLeaseEstimateWithSources = AsObjectFactory.createOptional(isHashLeaseEstimateWithSources);
|
|
19
24
|
|
|
20
25
|
// src/Diviner.ts
|
|
21
26
|
function _ts_decorate(decorators, target, key, desc) {
|
|
@@ -47,6 +52,10 @@ export {
|
|
|
47
52
|
HashLeaseEstimateDivinerConfigSchema,
|
|
48
53
|
HashLeaseEstimateSchema,
|
|
49
54
|
HashLeaseSchema,
|
|
55
|
+
asHashLeaseEstimate,
|
|
56
|
+
asHashLeaseEstimateWithSources,
|
|
57
|
+
asOptionalHashLeaseEstimate,
|
|
58
|
+
asOptionalHashLeaseEstimateWithSources,
|
|
50
59
|
isHashLeaseEstimate,
|
|
51
60
|
isHashLeaseEstimateWithSources
|
|
52
61
|
};
|
|
@@ -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;;;
|
|
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 } 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<HashLeaseEstimate>(HashLeaseEstimateSchema)\nexport const asHashLeaseEstimateWithSources = AsObjectFactory.create<HashLeaseEstimate>(isHashLeaseEstimateWithSources)\nexport const asOptionalHashLeaseEstimateWithSources = AsObjectFactory.createOptional<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,iCAAoDC,uBAAAA;AAC3F,IAAMO,iCAAiCV,gBAAgBM,OAA0BG,8BAAAA;AACjF,IAAME,yCAAyCX,gBAAgBQ,eAAkCC,8BAAAA;;;;;;;;;;AF9BjG,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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/diviner-hash-lease",
|
|
3
|
-
"version": "3.6.0-rc.
|
|
3
|
+
"version": "3.6.0-rc.18",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -29,10 +29,11 @@
|
|
|
29
29
|
"module": "dist/neutral/index.mjs",
|
|
30
30
|
"types": "dist/neutral/index.d.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@
|
|
33
|
-
"@xyo-network/diviner-
|
|
34
|
-
"@xyo-network/
|
|
35
|
-
"@xyo-network/
|
|
32
|
+
"@xylabs/object": "^4.4.25",
|
|
33
|
+
"@xyo-network/diviner-abstract": "^3.6.0-rc.18",
|
|
34
|
+
"@xyo-network/diviner-model": "^3.6.0-rc.18",
|
|
35
|
+
"@xyo-network/module-model": "^3.6.0-rc.18",
|
|
36
|
+
"@xyo-network/payload-model": "^3.6.0-rc.18"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@xylabs/ts-scripts-yarn3": "^4.2.6",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AsObjectFactory } from '@xylabs/object'
|
|
1
2
|
import type { Payload } from '@xyo-network/payload-model'
|
|
2
3
|
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'
|
|
3
4
|
|
|
@@ -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
39
|
export const isHashLeaseEstimateWithSources = isPayloadOfSchemaTypeWithSources<HashLeaseEstimate>(HashLeaseEstimateSchema)
|
|
40
|
+
export const asHashLeaseEstimateWithSources = AsObjectFactory.create<HashLeaseEstimate>(isHashLeaseEstimateWithSources)
|
|
41
|
+
export const asOptionalHashLeaseEstimateWithSources = AsObjectFactory.createOptional<HashLeaseEstimate>(isHashLeaseEstimateWithSources)
|