@xyo-network/signature-payload-plugin 6.0.3 → 7.0.0

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/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![logo][]](https://xyo.network)
2
+
1
3
  # @xyo-network/signature-payload-plugin
2
4
 
3
5
  [![npm][npm-badge]][npm-link]
@@ -36,9 +38,12 @@ bun add {{name}}
36
38
 
37
39
  See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
38
40
 
41
+ ## Credits
39
42
 
43
+ [Made with 🔥 and ❄️ by XYO Foundation](https://xyo.network)
40
44
 
41
45
  [npm-badge]: https://img.shields.io/npm/v/@xyo-network/signature-payload-plugin.svg
42
46
  [npm-link]: https://www.npmjs.com/package/@xyo-network/signature-payload-plugin
43
47
  [license-badge]: https://img.shields.io/npm/l/@xyo-network/signature-payload-plugin.svg
44
48
  [license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
49
+ [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
@@ -1,26 +1,68 @@
1
- import type { Payload } from '@xyo-network/sdk-js';
2
- import { SignatureSchema } from './Schema.ts';
3
- export type Digest = 'sha512' | 'sha3-256';
4
- export interface SignatureFields {
5
- /**
6
- * The digest algorithm used to create the signature
7
- */
8
- digestAlgorithm: Digest;
9
- /**
10
- * The signature
11
- */
12
- signature: string;
13
- }
1
+ import * as z from 'zod/mini';
2
+ export declare const DigestZod: z.ZodMiniEnum<{
3
+ sha512: "sha512";
4
+ "sha3-256": "sha3-256";
5
+ }>;
6
+ export type Digest = z.infer<typeof DigestZod>;
7
+ export declare const SignatureFieldsZod: z.ZodMiniObject<{
8
+ digestAlgorithm: z.ZodMiniEnum<{
9
+ sha512: "sha512";
10
+ "sha3-256": "sha3-256";
11
+ }>;
12
+ signature: z.ZodMiniString<string>;
13
+ }, z.core.$strip>;
14
+ export type SignatureFields = z.infer<typeof SignatureFieldsZod>;
14
15
  /**
15
16
  * A Signature Payload
16
17
  */
17
- export type Signature = Payload<SignatureFields, SignatureSchema>;
18
- /**
19
- * Identity function for determine if an object is a Signature
20
- */
21
- export declare const isSignature: (x?: unknown) => x is Signature;
22
- /**
23
- * Identity function for determine if an object is a Signature with sources
24
- */
25
- export declare const isSignatureWithSources: (x?: unknown) => x is import("@xyo-network/sdk-js").WithSources<Signature>;
18
+ export declare const SignatureZod: z.ZodMiniObject<{
19
+ schema: z.ZodMiniLiteral<"network.xyo.signing.signature" & {
20
+ readonly __schema: true;
21
+ }>;
22
+ digestAlgorithm: z.ZodMiniEnum<{
23
+ sha512: "sha512";
24
+ "sha3-256": "sha3-256";
25
+ }>;
26
+ signature: z.ZodMiniString<string>;
27
+ }, z.core.$strip>;
28
+ export type Signature = z.infer<typeof SignatureZod>;
29
+ export declare const isSignature: <T>(value: T) => value is T & {
30
+ schema: "network.xyo.signing.signature" & {
31
+ readonly __schema: true;
32
+ };
33
+ digestAlgorithm: "sha512" | "sha3-256";
34
+ signature: string;
35
+ };
36
+ export declare const asSignature: {
37
+ <T>(value: T): (T & {
38
+ schema: "network.xyo.signing.signature" & {
39
+ readonly __schema: true;
40
+ };
41
+ digestAlgorithm: "sha512" | "sha3-256";
42
+ signature: string;
43
+ }) | undefined;
44
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
45
+ schema: "network.xyo.signing.signature" & {
46
+ readonly __schema: true;
47
+ };
48
+ digestAlgorithm: "sha512" | "sha3-256";
49
+ signature: string;
50
+ };
51
+ };
52
+ export declare const toSignature: {
53
+ <T>(value: T): (T & {
54
+ schema: "network.xyo.signing.signature" & {
55
+ readonly __schema: true;
56
+ };
57
+ digestAlgorithm: "sha512" | "sha3-256";
58
+ signature: string;
59
+ }) | undefined;
60
+ <T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
61
+ schema: "network.xyo.signing.signature" & {
62
+ readonly __schema: true;
63
+ };
64
+ digestAlgorithm: "sha512" | "sha3-256";
65
+ signature: string;
66
+ };
67
+ };
26
68
  //# sourceMappingURL=Payload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../src/Payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAM7C,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAA;AAE1C,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAA;IACvB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,eAAe,EAAE,eAAe,CAAC,CAAA;AAEjE;;GAEG;AACH,eAAO,MAAM,WAAW,iCAAoD,CAAA;AAE5E;;GAEG;AACH,eAAO,MAAM,sBAAsB,4EAA+D,CAAA"}
1
+ {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../src/Payload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAQ7B,eAAO,MAAM,SAAS;;;EAGpB,CAAA;AAEF,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AAE9C,eAAO,MAAM,kBAAkB;;;;;;iBAS7B,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEhE;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;iBAAiF,CAAA;AAE1G,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAEpD,eAAO,MAAM,WAAW;;;;;;CAA6B,CAAA;AACrD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;CAA4C,CAAA;AACpE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;CAA4C,CAAA"}
@@ -1,16 +1,42 @@
1
1
  // src/Payload.ts
2
- import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from "@xyo-network/sdk-js";
2
+ import {
3
+ zodAsFactory,
4
+ zodIsFactory,
5
+ zodToFactory
6
+ } from "@xylabs/sdk-js";
7
+ import { PayloadZodOfSchema } from "@xyo-network/sdk-js";
8
+ import * as z from "zod/mini";
3
9
 
4
10
  // src/Schema.ts
5
11
  import { asSchema } from "@xyo-network/sdk-js";
6
12
  var SignatureSchema = asSchema("network.xyo.signing.signature", true);
7
13
 
8
14
  // src/Payload.ts
9
- var isSignature = isPayloadOfSchemaType(SignatureSchema);
10
- var isSignatureWithSources = isPayloadOfSchemaTypeWithSources(SignatureSchema);
15
+ var DigestZod = z.enum([
16
+ "sha512",
17
+ "sha3-256"
18
+ ]);
19
+ var SignatureFieldsZod = z.object({
20
+ /**
21
+ * The digest algorithm used to create the signature
22
+ */
23
+ digestAlgorithm: DigestZod,
24
+ /**
25
+ * The signature
26
+ */
27
+ signature: z.string()
28
+ });
29
+ var SignatureZod = z.extend(PayloadZodOfSchema(SignatureSchema), { ...SignatureFieldsZod.shape });
30
+ var isSignature = zodIsFactory(SignatureZod);
31
+ var asSignature = zodAsFactory(SignatureZod, "asSignature");
32
+ var toSignature = zodToFactory(SignatureZod, "toSignature");
11
33
  export {
34
+ DigestZod,
35
+ SignatureFieldsZod,
12
36
  SignatureSchema,
37
+ SignatureZod,
38
+ asSignature,
13
39
  isSignature,
14
- isSignatureWithSources
40
+ toSignature
15
41
  };
16
42
  //# sourceMappingURL=index.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Payload.ts", "../../src/Schema.ts"],
4
- "sourcesContent": ["import type { Payload } from '@xyo-network/sdk-js'\nimport { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/sdk-js'\n\nimport { SignatureSchema } from './Schema.ts'\n\n// TODO: Overlap of outputs from:\n// openssl list -digest-algorithms\n// AND\n// inputs to node.js crypto.createHash\nexport type Digest = 'sha512' | 'sha3-256'\n\nexport interface SignatureFields {\n /**\n * The digest algorithm used to create the signature\n */\n digestAlgorithm: Digest\n /**\n * The signature\n */\n signature: string\n}\n\n/**\n * A Signature Payload\n */\nexport type Signature = Payload<SignatureFields, SignatureSchema>\n\n/**\n * Identity function for determine if an object is a Signature\n */\nexport const isSignature = isPayloadOfSchemaType<Signature>(SignatureSchema)\n\n/**\n * Identity function for determine if an object is a Signature with sources\n */\nexport const isSignatureWithSources = isPayloadOfSchemaTypeWithSources<Signature>(SignatureSchema)\n", "import { asSchema } from '@xyo-network/sdk-js'\n\nexport const SignatureSchema = asSchema('network.xyo.signing.signature', true)\nexport type SignatureSchema = typeof SignatureSchema\n"],
5
- "mappings": ";AACA,SAAS,uBAAuB,wCAAwC;;;ACDxE,SAAS,gBAAgB;AAElB,IAAM,kBAAkB,SAAS,iCAAiC,IAAI;;;AD4BtE,IAAM,cAAc,sBAAiC,eAAe;AAKpE,IAAM,yBAAyB,iCAA4C,eAAe;",
4
+ "sourcesContent": ["import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport { PayloadZodOfSchema } from '@xyo-network/sdk-js'\nimport * as z from 'zod/mini'\n\nimport { SignatureSchema } from './Schema.ts'\n\n// TODO: Overlap of outputs from:\n// openssl list -digest-algorithms\n// AND\n// inputs to Node.js crypto.createHash\nexport const DigestZod = z.enum([\n 'sha512',\n 'sha3-256',\n])\n\nexport type Digest = z.infer<typeof DigestZod>\n\nexport const SignatureFieldsZod = z.object({\n /**\n * The digest algorithm used to create the signature\n */\n digestAlgorithm: DigestZod,\n /**\n * The signature\n */\n signature: z.string(),\n})\n\nexport type SignatureFields = z.infer<typeof SignatureFieldsZod>\n\n/**\n * A Signature Payload\n */\nexport const SignatureZod = z.extend(PayloadZodOfSchema(SignatureSchema), { ...SignatureFieldsZod.shape })\n\nexport type Signature = z.infer<typeof SignatureZod>\n\nexport const isSignature = zodIsFactory(SignatureZod)\nexport const asSignature = zodAsFactory(SignatureZod, 'asSignature')\nexport const toSignature = zodToFactory(SignatureZod, 'toSignature')\n", "import { asSchema } from '@xyo-network/sdk-js'\n\nexport const SignatureSchema = asSchema('network.xyo.signing.signature', true)\nexport type SignatureSchema = typeof SignatureSchema\n"],
5
+ "mappings": ";AAAA;AAAA,EACE;AAAA,EAAc;AAAA,EAAc;AAAA,OACvB;AACP,SAAS,0BAA0B;AACnC,YAAY,OAAO;;;ACJnB,SAAS,gBAAgB;AAElB,IAAM,kBAAkB,SAAS,iCAAiC,IAAI;;;ADUtE,IAAM,YAAc,OAAK;AAAA,EAC9B;AAAA,EACA;AACF,CAAC;AAIM,IAAM,qBAAuB,SAAO;AAAA;AAAA;AAAA;AAAA,EAIzC,iBAAiB;AAAA;AAAA;AAAA;AAAA,EAIjB,WAAa,SAAO;AACtB,CAAC;AAOM,IAAM,eAAiB,SAAO,mBAAmB,eAAe,GAAG,EAAE,GAAG,mBAAmB,MAAM,CAAC;AAIlG,IAAM,cAAc,aAAa,YAAY;AAC7C,IAAM,cAAc,aAAa,cAAc,aAAa;AAC5D,IAAM,cAAc,aAAa,cAAc,aAAa;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/signature-payload-plugin",
3
- "version": "6.0.3",
3
+ "version": "7.0.0",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -35,22 +35,20 @@
35
35
  "@metamask/providers": "^22.1.1",
36
36
  "@noble/post-quantum": "~0.6.1",
37
37
  "@opentelemetry/api": "^1.9.1",
38
- "@opentelemetry/sdk-trace-base": "^2.7.1",
38
+ "@opentelemetry/sdk-trace-base": "^2.8.0",
39
39
  "@scure/base": "^2.2.0",
40
40
  "@scure/bip39": "~2.2.0",
41
- "@xylabs/geo": "^6.0.8",
42
- "@xylabs/sdk-js": "^6.0.8",
43
- "@xylabs/threads": "^6.0.8",
44
- "@xylabs/toolchain": "~8.1.16",
45
- "@xylabs/tsconfig": "~8.1.16",
46
- "@xyo-network/sdk-js": "^6.0.4",
47
- "@xyo-network/sdk-protocol-js": "~6.0.9",
41
+ "@xylabs/geo": "^6.1.3",
42
+ "@xylabs/sdk-js": "^6.1.3",
43
+ "@xylabs/threads": "^6.1.3",
44
+ "@xylabs/toolchain": "~8.2.7",
45
+ "@xylabs/tsconfig": "~8.2.7",
46
+ "@xyo-network/sdk-js": "^7.0.0",
47
+ "@xyo-network/sdk-protocol-js": "~7.0",
48
48
  "ajv": "^8.20.0",
49
49
  "async-mutex": "^0.5.0",
50
- "bn.js": "^5.2.3",
51
- "buffer": "^6.0.3",
52
50
  "debug": "~4.4.3",
53
- "eslint": "^10.4.1",
51
+ "eslint": "^10.5.0",
54
52
  "ethers": "^6.16.0",
55
53
  "hash-wasm": "^4.12.0",
56
54
  "idb": "^8.0.3",
@@ -71,12 +69,10 @@
71
69
  "@xylabs/geo": "^6.0",
72
70
  "@xylabs/sdk-js": "^6.0",
73
71
  "@xylabs/threads": "^6.0",
74
- "@xyo-network/sdk-js": "^6.0",
75
- "@xyo-network/sdk-protocol-js": "~6.0",
72
+ "@xyo-network/sdk-js": "^7.0",
73
+ "@xyo-network/sdk-protocol-js": "~7.0",
76
74
  "ajv": "^8.20",
77
75
  "async-mutex": "^0.5",
78
- "bn.js": "^5.2",
79
- "buffer": "^6.0",
80
76
  "debug": "~4.4",
81
77
  "ethers": "^6.16",
82
78
  "hash-wasm": "^4.12",
@@ -86,6 +82,9 @@
86
82
  "webextension-polyfill": "^0.12",
87
83
  "zod": "^4.4"
88
84
  },
85
+ "engines": {
86
+ "node": "^24"
87
+ },
89
88
  "publishConfig": {
90
89
  "access": "public"
91
90
  }