@xyo-network/witness-timestamp 2.75.14 → 2.75.16
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.
- package/dist/browser/Params.d.cts +1 -1
- package/dist/browser/Params.d.cts.map +1 -1
- package/dist/browser/Params.d.mts +1 -1
- package/dist/browser/Params.d.mts.map +1 -1
- package/dist/browser/Params.d.ts +1 -1
- package/dist/browser/Params.d.ts.map +1 -1
- package/dist/docs.json +659 -316
- package/dist/node/Params.d.cts +1 -1
- package/dist/node/Params.d.cts.map +1 -1
- package/dist/node/Params.d.mts +1 -1
- package/dist/node/Params.d.mts.map +1 -1
- package/dist/node/Params.d.ts +1 -1
- package/dist/node/Params.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/Params.ts +1 -1
- package/dist/browser/Config.cjs +0 -27
- package/dist/browser/Config.cjs.map +0 -1
- package/dist/browser/Config.js +0 -6
- package/dist/browser/Config.js.map +0 -1
- package/dist/browser/Params.cjs +0 -19
- package/dist/browser/Params.cjs.map +0 -1
- package/dist/browser/Params.js +0 -1
- package/dist/browser/Params.js.map +0 -1
- package/dist/browser/Payload.cjs +0 -30
- package/dist/browser/Payload.cjs.map +0 -1
- package/dist/browser/Payload.js +0 -9
- package/dist/browser/Payload.js.map +0 -1
- package/dist/browser/Witness.cjs +0 -60
- package/dist/browser/Witness.cjs.map +0 -1
- package/dist/browser/Witness.js +0 -41
- package/dist/browser/Witness.js.map +0 -1
- package/dist/node/Config.js +0 -31
- package/dist/node/Config.js.map +0 -1
- package/dist/node/Config.mjs +0 -6
- package/dist/node/Config.mjs.map +0 -1
- package/dist/node/Params.js +0 -19
- package/dist/node/Params.js.map +0 -1
- package/dist/node/Params.mjs +0 -1
- package/dist/node/Params.mjs.map +0 -1
- package/dist/node/Payload.js +0 -35
- package/dist/node/Payload.js.map +0 -1
- package/dist/node/Payload.mjs +0 -9
- package/dist/node/Payload.mjs.map +0 -1
- package/dist/node/Witness.js +0 -68
- package/dist/node/Witness.js.map +0 -1
- package/dist/node/Witness.mjs +0 -45
- package/dist/node/Witness.mjs.map +0 -1
package/dist/node/Params.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyConfigSchema } from '@xyo-network/module';
|
|
1
|
+
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
2
2
|
import { WitnessParams } from '@xyo-network/witness-model';
|
|
3
3
|
import { TimestampWitnessConfig } from './Config';
|
|
4
4
|
export type TimestampWitnessParams<TConfig extends AnyConfigSchema<TimestampWitnessConfig> = AnyConfigSchema<TimestampWitnessConfig>> = WitnessParams<TConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Params.d.ts","sourceRoot":"","sources":["../../src/Params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Params.d.ts","sourceRoot":"","sources":["../../src/Params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAEjD,MAAM,MAAM,sBAAsB,CAAC,OAAO,SAAS,eAAe,CAAC,sBAAsB,CAAC,GAAG,eAAe,CAAC,sBAAsB,CAAC,IAClI,aAAa,CAAC,OAAO,CAAC,CAAA"}
|
package/dist/node/Params.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyConfigSchema } from '@xyo-network/module';
|
|
1
|
+
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
2
2
|
import { WitnessParams } from '@xyo-network/witness-model';
|
|
3
3
|
import { TimestampWitnessConfig } from './Config';
|
|
4
4
|
export type TimestampWitnessParams<TConfig extends AnyConfigSchema<TimestampWitnessConfig> = AnyConfigSchema<TimestampWitnessConfig>> = WitnessParams<TConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Params.d.ts","sourceRoot":"","sources":["../../src/Params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Params.d.ts","sourceRoot":"","sources":["../../src/Params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAEjD,MAAM,MAAM,sBAAsB,CAAC,OAAO,SAAS,eAAe,CAAC,sBAAsB,CAAC,GAAG,eAAe,CAAC,sBAAsB,CAAC,IAClI,aAAa,CAAC,OAAO,CAAC,CAAA"}
|
package/dist/node/Params.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyConfigSchema } from '@xyo-network/module';
|
|
1
|
+
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
2
2
|
import { WitnessParams } from '@xyo-network/witness-model';
|
|
3
3
|
import { TimestampWitnessConfig } from './Config';
|
|
4
4
|
export type TimestampWitnessParams<TConfig extends AnyConfigSchema<TimestampWitnessConfig> = AnyConfigSchema<TimestampWitnessConfig>> = WitnessParams<TConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Params.d.ts","sourceRoot":"","sources":["../../src/Params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Params.d.ts","sourceRoot":"","sources":["../../src/Params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAEjD,MAAM,MAAM,sBAAsB,CAAC,OAAO,SAAS,eAAe,CAAC,sBAAsB,CAAC,GAAG,eAAe,CAAC,sBAAsB,CAAC,IAClI,aAAa,CAAC,OAAO,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xyo-network/abstract-witness": "~2.75.
|
|
14
|
-
"@xyo-network/core": "~2.75.
|
|
15
|
-
"@xyo-network/module": "~2.75.
|
|
16
|
-
"@xyo-network/payload-model": "~2.75.
|
|
17
|
-
"@xyo-network/payload-wrapper": "~2.75.
|
|
18
|
-
"@xyo-network/witness-model": "~2.75.
|
|
13
|
+
"@xyo-network/abstract-witness": "~2.75.16",
|
|
14
|
+
"@xyo-network/core": "~2.75.16",
|
|
15
|
+
"@xyo-network/module-model": "~2.75.16",
|
|
16
|
+
"@xyo-network/payload-model": "~2.75.16",
|
|
17
|
+
"@xyo-network/payload-wrapper": "~2.75.16",
|
|
18
|
+
"@xyo-network/witness-model": "~2.75.16"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@xylabs/ts-scripts-yarn3": "^3.
|
|
22
|
-
"@xylabs/tsconfig": "^3.
|
|
21
|
+
"@xylabs/ts-scripts-yarn3": "^3.1.3",
|
|
22
|
+
"@xylabs/tsconfig": "^3.1.3",
|
|
23
23
|
"typescript": "^5.2.2"
|
|
24
24
|
},
|
|
25
25
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
66
66
|
},
|
|
67
67
|
"sideEffects": false,
|
|
68
|
-
"version": "2.75.
|
|
68
|
+
"version": "2.75.16"
|
|
69
69
|
}
|
package/src/Params.ts
CHANGED
package/dist/browser/Config.cjs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/Config.ts
|
|
21
|
-
var Config_exports = {};
|
|
22
|
-
__export(Config_exports, {
|
|
23
|
-
TimestampWitnessConfigSchema: () => TimestampWitnessConfigSchema
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(Config_exports);
|
|
26
|
-
var TimestampWitnessConfigSchema = "network.xyo.witness.timestamp.config";
|
|
27
|
-
//# sourceMappingURL=Config.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Config.ts"],"sourcesContent":["import { WithAdditional } from '@xyo-network/core'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport const TimestampWitnessConfigSchema = 'network.xyo.witness.timestamp.config'\nexport type TimestampWitnessConfigSchema = typeof TimestampWitnessConfigSchema\n\nexport type TimestampWitnessConfig<TConfig extends Payload | undefined = undefined> = WitnessConfig<\n WithAdditional<\n {\n schema: TConfig extends Payload ? TConfig['schema'] : TimestampWitnessConfigSchema\n },\n TConfig\n >\n>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA;;;;;AAAO,IAAMA,+BAA+B;","names":["TimestampWitnessConfigSchema"]}
|
package/dist/browser/Config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Config.ts"],"sourcesContent":["import { WithAdditional } from '@xyo-network/core'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport const TimestampWitnessConfigSchema = 'network.xyo.witness.timestamp.config'\nexport type TimestampWitnessConfigSchema = typeof TimestampWitnessConfigSchema\n\nexport type TimestampWitnessConfig<TConfig extends Payload | undefined = undefined> = WitnessConfig<\n WithAdditional<\n {\n schema: TConfig extends Payload ? TConfig['schema'] : TimestampWitnessConfigSchema\n },\n TConfig\n >\n>\n"],"mappings":";AAIO,IAAMA,+BAA+B;","names":["TimestampWitnessConfigSchema"]}
|
package/dist/browser/Params.cjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/Params.ts
|
|
17
|
-
var Params_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(Params_exports);
|
|
19
|
-
//# sourceMappingURL=Params.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Params.ts"],"sourcesContent":["import { AnyConfigSchema } from '@xyo-network/module'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { TimestampWitnessConfig } from './Config'\n\nexport type TimestampWitnessParams<TConfig extends AnyConfigSchema<TimestampWitnessConfig> = AnyConfigSchema<TimestampWitnessConfig>> =\n WitnessParams<TConfig>\n"],"mappings":";;;;;;;;;;;;;;;;AAKA;;","names":[]}
|
package/dist/browser/Params.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=Params.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/browser/Payload.cjs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/Payload.ts
|
|
21
|
-
var Payload_exports = {};
|
|
22
|
-
__export(Payload_exports, {
|
|
23
|
-
TimestampSchema: () => TimestampSchema,
|
|
24
|
-
isTimestamp: () => isTimestamp
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(Payload_exports);
|
|
27
|
-
var import_payload_model = require("@xyo-network/payload-model");
|
|
28
|
-
var TimestampSchema = "network.xyo.timestamp";
|
|
29
|
-
var isTimestamp = (0, import_payload_model.isPayloadOfSchemaType)(TimestampSchema);
|
|
30
|
-
//# sourceMappingURL=Payload.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Payload.ts"],"sourcesContent":["import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'\n\nexport const TimestampSchema = 'network.xyo.timestamp'\nexport type TimestampSchema = typeof TimestampSchema\n\nexport type TimeStamp = Payload<\n {\n timestamp: number\n },\n TimestampSchema\n>\n\nexport const isTimestamp = isPayloadOfSchemaType<TimeStamp>(TimestampSchema)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;2BAA+C;AAExC,IAAMA,kBAAkB;AAUxB,IAAMC,kBAAcC,4CAAiCF,eAAAA;","names":["TimestampSchema","isTimestamp","isPayloadOfSchemaType"]}
|
package/dist/browser/Payload.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// src/Payload.ts
|
|
2
|
-
import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
|
|
3
|
-
var TimestampSchema = "network.xyo.timestamp";
|
|
4
|
-
var isTimestamp = isPayloadOfSchemaType(TimestampSchema);
|
|
5
|
-
export {
|
|
6
|
-
TimestampSchema,
|
|
7
|
-
isTimestamp
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=Payload.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Payload.ts"],"sourcesContent":["import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'\n\nexport const TimestampSchema = 'network.xyo.timestamp'\nexport type TimestampSchema = typeof TimestampSchema\n\nexport type TimeStamp = Payload<\n {\n timestamp: number\n },\n TimestampSchema\n>\n\nexport const isTimestamp = isPayloadOfSchemaType<TimeStamp>(TimestampSchema)\n"],"mappings":";AAAA,SAASA,6BAAsC;AAExC,IAAMC,kBAAkB;AAUxB,IAAMC,cAAcF,sBAAiCC,eAAAA;","names":["isPayloadOfSchemaType","TimestampSchema","isTimestamp"]}
|
package/dist/browser/Witness.cjs
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/Witness.ts
|
|
22
|
-
var Witness_exports = {};
|
|
23
|
-
__export(Witness_exports, {
|
|
24
|
-
TimestampWitness: () => TimestampWitness
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(Witness_exports);
|
|
27
|
-
var import_abstract_witness = require("@xyo-network/abstract-witness");
|
|
28
|
-
var import_payload_wrapper = require("@xyo-network/payload-wrapper");
|
|
29
|
-
var import_witness_model = require("@xyo-network/witness-model");
|
|
30
|
-
|
|
31
|
-
// src/Config.ts
|
|
32
|
-
var TimestampWitnessConfigSchema = "network.xyo.witness.timestamp.config";
|
|
33
|
-
|
|
34
|
-
// src/Payload.ts
|
|
35
|
-
var import_payload_model = require("@xyo-network/payload-model");
|
|
36
|
-
var TimestampSchema = "network.xyo.timestamp";
|
|
37
|
-
var isTimestamp = (0, import_payload_model.isPayloadOfSchemaType)(TimestampSchema);
|
|
38
|
-
|
|
39
|
-
// src/Witness.ts
|
|
40
|
-
var TimestampWitness = class extends import_abstract_witness.AbstractWitness {
|
|
41
|
-
static {
|
|
42
|
-
__name(this, "TimestampWitness");
|
|
43
|
-
}
|
|
44
|
-
static configSchemas = [
|
|
45
|
-
TimestampWitnessConfigSchema,
|
|
46
|
-
import_witness_model.WitnessConfigSchema
|
|
47
|
-
];
|
|
48
|
-
async observeHandler(payloads) {
|
|
49
|
-
const sources = await import_payload_wrapper.PayloadWrapper.hashes(payloads ?? []);
|
|
50
|
-
const payload = {
|
|
51
|
-
schema: TimestampSchema,
|
|
52
|
-
sources,
|
|
53
|
-
timestamp: Date.now()
|
|
54
|
-
};
|
|
55
|
-
return [
|
|
56
|
-
payload
|
|
57
|
-
];
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
//# sourceMappingURL=Witness.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Witness.ts","../../src/Config.ts","../../src/Payload.ts"],"sourcesContent":["import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { Payload } from '@xyo-network/payload-model'\nimport { PayloadWrapper } from '@xyo-network/payload-wrapper'\nimport { WitnessConfigSchema } from '@xyo-network/witness-model'\n\nimport { TimestampWitnessConfigSchema } from './Config'\nimport { TimestampWitnessParams } from './Params'\nimport { TimeStamp, TimestampSchema } from './Payload'\n\nexport class TimestampWitness<P extends TimestampWitnessParams = TimestampWitnessParams> extends AbstractWitness<P> {\n static override configSchemas = [TimestampWitnessConfigSchema, WitnessConfigSchema]\n protected override async observeHandler(payloads?: Payload[]): Promise<Payload[]> {\n const sources = await PayloadWrapper.hashes(payloads ?? [])\n const payload: TimeStamp = { schema: TimestampSchema, sources, timestamp: Date.now() }\n return [payload]\n }\n}\n","import { WithAdditional } from '@xyo-network/core'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport const TimestampWitnessConfigSchema = 'network.xyo.witness.timestamp.config'\nexport type TimestampWitnessConfigSchema = typeof TimestampWitnessConfigSchema\n\nexport type TimestampWitnessConfig<TConfig extends Payload | undefined = undefined> = WitnessConfig<\n WithAdditional<\n {\n schema: TConfig extends Payload ? TConfig['schema'] : TimestampWitnessConfigSchema\n },\n TConfig\n >\n>\n","import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'\n\nexport const TimestampSchema = 'network.xyo.timestamp'\nexport type TimestampSchema = typeof TimestampSchema\n\nexport type TimeStamp = Payload<\n {\n timestamp: number\n },\n TimestampSchema\n>\n\nexport const isTimestamp = isPayloadOfSchemaType<TimeStamp>(TimestampSchema)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;8BAAgC;AAEhC,6BAA+B;AAC/B,2BAAoC;;;ACC7B,IAAMA,+BAA+B;;;ACJ5C,2BAA+C;AAExC,IAAMC,kBAAkB;AAUxB,IAAMC,kBAAcC,4CAAiCF,eAAAA;;;AFHrD,IAAMG,mBAAN,cAA0FC,wCAAAA;EATjG,OASiGA;;;EAC/F,OAAgBC,gBAAgB;IAACC;IAA8BC;;EAC/D,MAAyBC,eAAeC,UAA0C;AAChF,UAAMC,UAAU,MAAMC,sCAAeC,OAAOH,YAAY,CAAA,CAAE;AAC1D,UAAMI,UAAqB;MAAEC,QAAQC;MAAiBL;MAASM,WAAWC,KAAKC,IAAG;IAAG;AACrF,WAAO;MAACL;;EACV;AACF;","names":["TimestampWitnessConfigSchema","TimestampSchema","isTimestamp","isPayloadOfSchemaType","TimestampWitness","AbstractWitness","configSchemas","TimestampWitnessConfigSchema","WitnessConfigSchema","observeHandler","payloads","sources","PayloadWrapper","hashes","payload","schema","TimestampSchema","timestamp","Date","now"]}
|
package/dist/browser/Witness.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/Witness.ts
|
|
5
|
-
import { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
6
|
-
import { PayloadWrapper } from "@xyo-network/payload-wrapper";
|
|
7
|
-
import { WitnessConfigSchema } from "@xyo-network/witness-model";
|
|
8
|
-
|
|
9
|
-
// src/Config.ts
|
|
10
|
-
var TimestampWitnessConfigSchema = "network.xyo.witness.timestamp.config";
|
|
11
|
-
|
|
12
|
-
// src/Payload.ts
|
|
13
|
-
import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
|
|
14
|
-
var TimestampSchema = "network.xyo.timestamp";
|
|
15
|
-
var isTimestamp = isPayloadOfSchemaType(TimestampSchema);
|
|
16
|
-
|
|
17
|
-
// src/Witness.ts
|
|
18
|
-
var TimestampWitness = class extends AbstractWitness {
|
|
19
|
-
static {
|
|
20
|
-
__name(this, "TimestampWitness");
|
|
21
|
-
}
|
|
22
|
-
static configSchemas = [
|
|
23
|
-
TimestampWitnessConfigSchema,
|
|
24
|
-
WitnessConfigSchema
|
|
25
|
-
];
|
|
26
|
-
async observeHandler(payloads) {
|
|
27
|
-
const sources = await PayloadWrapper.hashes(payloads ?? []);
|
|
28
|
-
const payload = {
|
|
29
|
-
schema: TimestampSchema,
|
|
30
|
-
sources,
|
|
31
|
-
timestamp: Date.now()
|
|
32
|
-
};
|
|
33
|
-
return [
|
|
34
|
-
payload
|
|
35
|
-
];
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
export {
|
|
39
|
-
TimestampWitness
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=Witness.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Witness.ts","../../src/Config.ts","../../src/Payload.ts"],"sourcesContent":["import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { Payload } from '@xyo-network/payload-model'\nimport { PayloadWrapper } from '@xyo-network/payload-wrapper'\nimport { WitnessConfigSchema } from '@xyo-network/witness-model'\n\nimport { TimestampWitnessConfigSchema } from './Config'\nimport { TimestampWitnessParams } from './Params'\nimport { TimeStamp, TimestampSchema } from './Payload'\n\nexport class TimestampWitness<P extends TimestampWitnessParams = TimestampWitnessParams> extends AbstractWitness<P> {\n static override configSchemas = [TimestampWitnessConfigSchema, WitnessConfigSchema]\n protected override async observeHandler(payloads?: Payload[]): Promise<Payload[]> {\n const sources = await PayloadWrapper.hashes(payloads ?? [])\n const payload: TimeStamp = { schema: TimestampSchema, sources, timestamp: Date.now() }\n return [payload]\n }\n}\n","import { WithAdditional } from '@xyo-network/core'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport const TimestampWitnessConfigSchema = 'network.xyo.witness.timestamp.config'\nexport type TimestampWitnessConfigSchema = typeof TimestampWitnessConfigSchema\n\nexport type TimestampWitnessConfig<TConfig extends Payload | undefined = undefined> = WitnessConfig<\n WithAdditional<\n {\n schema: TConfig extends Payload ? TConfig['schema'] : TimestampWitnessConfigSchema\n },\n TConfig\n >\n>\n","import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'\n\nexport const TimestampSchema = 'network.xyo.timestamp'\nexport type TimestampSchema = typeof TimestampSchema\n\nexport type TimeStamp = Payload<\n {\n timestamp: number\n },\n TimestampSchema\n>\n\nexport const isTimestamp = isPayloadOfSchemaType<TimeStamp>(TimestampSchema)\n"],"mappings":";;;;AAAA,SAASA,uBAAuB;AAEhC,SAASC,sBAAsB;AAC/B,SAASC,2BAA2B;;;ACC7B,IAAMC,+BAA+B;;;ACJ5C,SAASC,6BAAsC;AAExC,IAAMC,kBAAkB;AAUxB,IAAMC,cAAcF,sBAAiCC,eAAAA;;;AFHrD,IAAME,mBAAN,cAA0FC,gBAAAA;EATjG,OASiGA;;;EAC/F,OAAgBC,gBAAgB;IAACC;IAA8BC;;EAC/D,MAAyBC,eAAeC,UAA0C;AAChF,UAAMC,UAAU,MAAMC,eAAeC,OAAOH,YAAY,CAAA,CAAE;AAC1D,UAAMI,UAAqB;MAAEC,QAAQC;MAAiBL;MAASM,WAAWC,KAAKC,IAAG;IAAG;AACrF,WAAO;MAACL;;EACV;AACF;","names":["AbstractWitness","PayloadWrapper","WitnessConfigSchema","TimestampWitnessConfigSchema","isPayloadOfSchemaType","TimestampSchema","isTimestamp","TimestampWitness","AbstractWitness","configSchemas","TimestampWitnessConfigSchema","WitnessConfigSchema","observeHandler","payloads","sources","PayloadWrapper","hashes","payload","schema","TimestampSchema","timestamp","Date","now"]}
|
package/dist/node/Config.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/Config.ts
|
|
21
|
-
var Config_exports = {};
|
|
22
|
-
__export(Config_exports, {
|
|
23
|
-
TimestampWitnessConfigSchema: () => TimestampWitnessConfigSchema
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(Config_exports);
|
|
26
|
-
var TimestampWitnessConfigSchema = "network.xyo.witness.timestamp.config";
|
|
27
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
-
0 && (module.exports = {
|
|
29
|
-
TimestampWitnessConfigSchema
|
|
30
|
-
});
|
|
31
|
-
//# sourceMappingURL=Config.js.map
|
package/dist/node/Config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Config.ts"],"sourcesContent":["import { WithAdditional } from '@xyo-network/core'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport const TimestampWitnessConfigSchema = 'network.xyo.witness.timestamp.config'\nexport type TimestampWitnessConfigSchema = typeof TimestampWitnessConfigSchema\n\nexport type TimestampWitnessConfig<TConfig extends Payload | undefined = undefined> = WitnessConfig<\n WithAdditional<\n {\n schema: TConfig extends Payload ? TConfig['schema'] : TimestampWitnessConfigSchema\n },\n TConfig\n >\n>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA;;;;;AAAO,IAAMA,+BAA+B;","names":["TimestampWitnessConfigSchema"]}
|
package/dist/node/Config.mjs
DELETED
package/dist/node/Config.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Config.ts"],"sourcesContent":["import { WithAdditional } from '@xyo-network/core'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport const TimestampWitnessConfigSchema = 'network.xyo.witness.timestamp.config'\nexport type TimestampWitnessConfigSchema = typeof TimestampWitnessConfigSchema\n\nexport type TimestampWitnessConfig<TConfig extends Payload | undefined = undefined> = WitnessConfig<\n WithAdditional<\n {\n schema: TConfig extends Payload ? TConfig['schema'] : TimestampWitnessConfigSchema\n },\n TConfig\n >\n>\n"],"mappings":";AAIO,IAAMA,+BAA+B;","names":["TimestampWitnessConfigSchema"]}
|
package/dist/node/Params.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/Params.ts
|
|
17
|
-
var Params_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(Params_exports);
|
|
19
|
-
//# sourceMappingURL=Params.js.map
|
package/dist/node/Params.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Params.ts"],"sourcesContent":["import { AnyConfigSchema } from '@xyo-network/module'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { TimestampWitnessConfig } from './Config'\n\nexport type TimestampWitnessParams<TConfig extends AnyConfigSchema<TimestampWitnessConfig> = AnyConfigSchema<TimestampWitnessConfig>> =\n WitnessParams<TConfig>\n"],"mappings":";;;;;;;;;;;;;;;;AAKA;;","names":[]}
|
package/dist/node/Params.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=Params.mjs.map
|
package/dist/node/Params.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/node/Payload.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/Payload.ts
|
|
21
|
-
var Payload_exports = {};
|
|
22
|
-
__export(Payload_exports, {
|
|
23
|
-
TimestampSchema: () => TimestampSchema,
|
|
24
|
-
isTimestamp: () => isTimestamp
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(Payload_exports);
|
|
27
|
-
var import_payload_model = require("@xyo-network/payload-model");
|
|
28
|
-
var TimestampSchema = "network.xyo.timestamp";
|
|
29
|
-
var isTimestamp = (0, import_payload_model.isPayloadOfSchemaType)(TimestampSchema);
|
|
30
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
-
0 && (module.exports = {
|
|
32
|
-
TimestampSchema,
|
|
33
|
-
isTimestamp
|
|
34
|
-
});
|
|
35
|
-
//# sourceMappingURL=Payload.js.map
|
package/dist/node/Payload.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Payload.ts"],"sourcesContent":["import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'\n\nexport const TimestampSchema = 'network.xyo.timestamp'\nexport type TimestampSchema = typeof TimestampSchema\n\nexport type TimeStamp = Payload<\n {\n timestamp: number\n },\n TimestampSchema\n>\n\nexport const isTimestamp = isPayloadOfSchemaType<TimeStamp>(TimestampSchema)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;2BAA+C;AAExC,IAAMA,kBAAkB;AAUxB,IAAMC,kBAAcC,4CAAiCF,eAAAA;","names":["TimestampSchema","isTimestamp","isPayloadOfSchemaType"]}
|
package/dist/node/Payload.mjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// src/Payload.ts
|
|
2
|
-
import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
|
|
3
|
-
var TimestampSchema = "network.xyo.timestamp";
|
|
4
|
-
var isTimestamp = isPayloadOfSchemaType(TimestampSchema);
|
|
5
|
-
export {
|
|
6
|
-
TimestampSchema,
|
|
7
|
-
isTimestamp
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=Payload.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Payload.ts"],"sourcesContent":["import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'\n\nexport const TimestampSchema = 'network.xyo.timestamp'\nexport type TimestampSchema = typeof TimestampSchema\n\nexport type TimeStamp = Payload<\n {\n timestamp: number\n },\n TimestampSchema\n>\n\nexport const isTimestamp = isPayloadOfSchemaType<TimeStamp>(TimestampSchema)\n"],"mappings":";AAAA,SAASA,6BAAsC;AAExC,IAAMC,kBAAkB;AAUxB,IAAMC,cAAcF,sBAAiCC,eAAAA;","names":["isPayloadOfSchemaType","TimestampSchema","isTimestamp"]}
|
package/dist/node/Witness.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
-
var __publicField = (obj, key, value) => {
|
|
22
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
23
|
-
return value;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
// src/Witness.ts
|
|
27
|
-
var Witness_exports = {};
|
|
28
|
-
__export(Witness_exports, {
|
|
29
|
-
TimestampWitness: () => TimestampWitness
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(Witness_exports);
|
|
32
|
-
var import_abstract_witness = require("@xyo-network/abstract-witness");
|
|
33
|
-
var import_payload_wrapper = require("@xyo-network/payload-wrapper");
|
|
34
|
-
var import_witness_model = require("@xyo-network/witness-model");
|
|
35
|
-
|
|
36
|
-
// src/Config.ts
|
|
37
|
-
var TimestampWitnessConfigSchema = "network.xyo.witness.timestamp.config";
|
|
38
|
-
|
|
39
|
-
// src/Payload.ts
|
|
40
|
-
var import_payload_model = require("@xyo-network/payload-model");
|
|
41
|
-
var TimestampSchema = "network.xyo.timestamp";
|
|
42
|
-
var isTimestamp = (0, import_payload_model.isPayloadOfSchemaType)(TimestampSchema);
|
|
43
|
-
|
|
44
|
-
// src/Witness.ts
|
|
45
|
-
var _TimestampWitness = class _TimestampWitness extends import_abstract_witness.AbstractWitness {
|
|
46
|
-
async observeHandler(payloads) {
|
|
47
|
-
const sources = await import_payload_wrapper.PayloadWrapper.hashes(payloads ?? []);
|
|
48
|
-
const payload = {
|
|
49
|
-
schema: TimestampSchema,
|
|
50
|
-
sources,
|
|
51
|
-
timestamp: Date.now()
|
|
52
|
-
};
|
|
53
|
-
return [
|
|
54
|
-
payload
|
|
55
|
-
];
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
__name(_TimestampWitness, "TimestampWitness");
|
|
59
|
-
__publicField(_TimestampWitness, "configSchemas", [
|
|
60
|
-
TimestampWitnessConfigSchema,
|
|
61
|
-
import_witness_model.WitnessConfigSchema
|
|
62
|
-
]);
|
|
63
|
-
var TimestampWitness = _TimestampWitness;
|
|
64
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
-
0 && (module.exports = {
|
|
66
|
-
TimestampWitness
|
|
67
|
-
});
|
|
68
|
-
//# sourceMappingURL=Witness.js.map
|
package/dist/node/Witness.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Witness.ts","../../src/Config.ts","../../src/Payload.ts"],"sourcesContent":["import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { Payload } from '@xyo-network/payload-model'\nimport { PayloadWrapper } from '@xyo-network/payload-wrapper'\nimport { WitnessConfigSchema } from '@xyo-network/witness-model'\n\nimport { TimestampWitnessConfigSchema } from './Config'\nimport { TimestampWitnessParams } from './Params'\nimport { TimeStamp, TimestampSchema } from './Payload'\n\nexport class TimestampWitness<P extends TimestampWitnessParams = TimestampWitnessParams> extends AbstractWitness<P> {\n static override configSchemas = [TimestampWitnessConfigSchema, WitnessConfigSchema]\n protected override async observeHandler(payloads?: Payload[]): Promise<Payload[]> {\n const sources = await PayloadWrapper.hashes(payloads ?? [])\n const payload: TimeStamp = { schema: TimestampSchema, sources, timestamp: Date.now() }\n return [payload]\n }\n}\n","import { WithAdditional } from '@xyo-network/core'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport const TimestampWitnessConfigSchema = 'network.xyo.witness.timestamp.config'\nexport type TimestampWitnessConfigSchema = typeof TimestampWitnessConfigSchema\n\nexport type TimestampWitnessConfig<TConfig extends Payload | undefined = undefined> = WitnessConfig<\n WithAdditional<\n {\n schema: TConfig extends Payload ? TConfig['schema'] : TimestampWitnessConfigSchema\n },\n TConfig\n >\n>\n","import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'\n\nexport const TimestampSchema = 'network.xyo.timestamp'\nexport type TimestampSchema = typeof TimestampSchema\n\nexport type TimeStamp = Payload<\n {\n timestamp: number\n },\n TimestampSchema\n>\n\nexport const isTimestamp = isPayloadOfSchemaType<TimeStamp>(TimestampSchema)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;8BAAgC;AAEhC,6BAA+B;AAC/B,2BAAoC;;;ACC7B,IAAMA,+BAA+B;;;ACJ5C,2BAA+C;AAExC,IAAMC,kBAAkB;AAUxB,IAAMC,kBAAcC,4CAAiCF,eAAAA;;;AFHrD,IAAMG,oBAAN,MAAMA,0BAAoFC,wCAAAA;EAE/F,MAAyBC,eAAeC,UAA0C;AAChF,UAAMC,UAAU,MAAMC,sCAAeC,OAAOH,YAAY,CAAA,CAAE;AAC1D,UAAMI,UAAqB;MAAEC,QAAQC;MAAiBL;MAASM,WAAWC,KAAKC,IAAG;IAAG;AACrF,WAAO;MAACL;;EACV;AACF;AAPiGN;AAC/F,cADWD,mBACKa,iBAAgB;EAACC;EAA8BC;;AAD1D,IAAMf,mBAAN;","names":["TimestampWitnessConfigSchema","TimestampSchema","isTimestamp","isPayloadOfSchemaType","TimestampWitness","AbstractWitness","observeHandler","payloads","sources","PayloadWrapper","hashes","payload","schema","TimestampSchema","timestamp","Date","now","configSchemas","TimestampWitnessConfigSchema","WitnessConfigSchema"]}
|
package/dist/node/Witness.mjs
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
|
-
var __publicField = (obj, key, value) => {
|
|
5
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
|
-
return value;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
// src/Witness.ts
|
|
10
|
-
import { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
11
|
-
import { PayloadWrapper } from "@xyo-network/payload-wrapper";
|
|
12
|
-
import { WitnessConfigSchema } from "@xyo-network/witness-model";
|
|
13
|
-
|
|
14
|
-
// src/Config.ts
|
|
15
|
-
var TimestampWitnessConfigSchema = "network.xyo.witness.timestamp.config";
|
|
16
|
-
|
|
17
|
-
// src/Payload.ts
|
|
18
|
-
import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
|
|
19
|
-
var TimestampSchema = "network.xyo.timestamp";
|
|
20
|
-
var isTimestamp = isPayloadOfSchemaType(TimestampSchema);
|
|
21
|
-
|
|
22
|
-
// src/Witness.ts
|
|
23
|
-
var _TimestampWitness = class _TimestampWitness extends AbstractWitness {
|
|
24
|
-
async observeHandler(payloads) {
|
|
25
|
-
const sources = await PayloadWrapper.hashes(payloads ?? []);
|
|
26
|
-
const payload = {
|
|
27
|
-
schema: TimestampSchema,
|
|
28
|
-
sources,
|
|
29
|
-
timestamp: Date.now()
|
|
30
|
-
};
|
|
31
|
-
return [
|
|
32
|
-
payload
|
|
33
|
-
];
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
__name(_TimestampWitness, "TimestampWitness");
|
|
37
|
-
__publicField(_TimestampWitness, "configSchemas", [
|
|
38
|
-
TimestampWitnessConfigSchema,
|
|
39
|
-
WitnessConfigSchema
|
|
40
|
-
]);
|
|
41
|
-
var TimestampWitness = _TimestampWitness;
|
|
42
|
-
export {
|
|
43
|
-
TimestampWitness
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=Witness.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Witness.ts","../../src/Config.ts","../../src/Payload.ts"],"sourcesContent":["import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { Payload } from '@xyo-network/payload-model'\nimport { PayloadWrapper } from '@xyo-network/payload-wrapper'\nimport { WitnessConfigSchema } from '@xyo-network/witness-model'\n\nimport { TimestampWitnessConfigSchema } from './Config'\nimport { TimestampWitnessParams } from './Params'\nimport { TimeStamp, TimestampSchema } from './Payload'\n\nexport class TimestampWitness<P extends TimestampWitnessParams = TimestampWitnessParams> extends AbstractWitness<P> {\n static override configSchemas = [TimestampWitnessConfigSchema, WitnessConfigSchema]\n protected override async observeHandler(payloads?: Payload[]): Promise<Payload[]> {\n const sources = await PayloadWrapper.hashes(payloads ?? [])\n const payload: TimeStamp = { schema: TimestampSchema, sources, timestamp: Date.now() }\n return [payload]\n }\n}\n","import { WithAdditional } from '@xyo-network/core'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport const TimestampWitnessConfigSchema = 'network.xyo.witness.timestamp.config'\nexport type TimestampWitnessConfigSchema = typeof TimestampWitnessConfigSchema\n\nexport type TimestampWitnessConfig<TConfig extends Payload | undefined = undefined> = WitnessConfig<\n WithAdditional<\n {\n schema: TConfig extends Payload ? TConfig['schema'] : TimestampWitnessConfigSchema\n },\n TConfig\n >\n>\n","import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'\n\nexport const TimestampSchema = 'network.xyo.timestamp'\nexport type TimestampSchema = typeof TimestampSchema\n\nexport type TimeStamp = Payload<\n {\n timestamp: number\n },\n TimestampSchema\n>\n\nexport const isTimestamp = isPayloadOfSchemaType<TimeStamp>(TimestampSchema)\n"],"mappings":";;;;;;;;;AAAA,SAASA,uBAAuB;AAEhC,SAASC,sBAAsB;AAC/B,SAASC,2BAA2B;;;ACC7B,IAAMC,+BAA+B;;;ACJ5C,SAASC,6BAAsC;AAExC,IAAMC,kBAAkB;AAUxB,IAAMC,cAAcF,sBAAiCC,eAAAA;;;AFHrD,IAAME,oBAAN,MAAMA,0BAAoFC,gBAAAA;EAE/F,MAAyBC,eAAeC,UAA0C;AAChF,UAAMC,UAAU,MAAMC,eAAeC,OAAOH,YAAY,CAAA,CAAE;AAC1D,UAAMI,UAAqB;MAAEC,QAAQC;MAAiBL;MAASM,WAAWC,KAAKC,IAAG;IAAG;AACrF,WAAO;MAACL;;EACV;AACF;AAPiGN;AAC/F,cADWD,mBACKa,iBAAgB;EAACC;EAA8BC;;AAD1D,IAAMf,mBAAN;","names":["AbstractWitness","PayloadWrapper","WitnessConfigSchema","TimestampWitnessConfigSchema","isPayloadOfSchemaType","TimestampSchema","isTimestamp","TimestampWitness","AbstractWitness","observeHandler","payloads","sources","PayloadWrapper","hashes","payload","schema","TimestampSchema","timestamp","Date","now","configSchemas","TimestampWitnessConfigSchema","WitnessConfigSchema"]}
|