@xyo-network/boundwitness-model 5.2.22 → 5.2.24
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/BoundWitness/Signatures.d.ts.map +1 -1
- package/dist/browser/index.mjs +1 -1
- package/dist/browser/index.mjs.map +1 -1
- package/dist/neutral/BoundWitness/Signatures.d.ts.map +1 -1
- package/dist/neutral/index.mjs +1 -1
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/node/BoundWitness/Signatures.d.ts.map +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/node/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/BoundWitness/Signatures.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Signatures.d.ts","sourceRoot":"","sources":["../../../src/BoundWitness/Signatures.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,eAAO,MAAM,iBAAiB;;mBAAkE,CAAA;AAChG,eAAO,MAAM,yBAAyB;;mBAA+C,CAAA;AACrF,eAAO,MAAM,uBAAuB;;
|
|
1
|
+
{"version":3,"file":"Signatures.d.ts","sourceRoot":"","sources":["../../../src/BoundWitness/Signatures.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,eAAO,MAAM,iBAAiB;;mBAAkE,CAAA;AAChG,eAAO,MAAM,yBAAyB;;mBAA+C,CAAA;AACrF,eAAO,MAAM,uBAAuB;;mBAAoD,CAAA;AAExF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAC9D,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAC9E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE1E,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,IAAI,CAAC,CAAC,EAAE,aAAa,CAAC,GAAG,sBAAsB,CAAA;AAC7G,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,IAAI,CAAC,CAAC,EAAE,aAAa,CAAC,GAAG,oBAAoB,CAAA;AACzG,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA"}
|
package/dist/browser/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import { HexZod } from "@xylabs/sdk-js";
|
|
|
16
16
|
import z from "zod";
|
|
17
17
|
var SignaturesMetaZod = z.object({ $signatures: z.array(z.union([HexZod, z.null()])) });
|
|
18
18
|
var UnsignedSignaturesMetaZod = z.object({ $signatures: z.array(z.null()) });
|
|
19
|
-
var SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod) });
|
|
19
|
+
var SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod).min(1) });
|
|
20
20
|
|
|
21
21
|
// src/BoundWitness/BoundWitness.ts
|
|
22
22
|
var BoundWitnessRequiredFieldsZod = z2.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/BoundWitness/BoundWitness.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/BoundWitness/Signatures.ts","../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/SignedBoundWitness.ts","../../src/BoundWitness/UnsignedBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["import { AddressZod, HashZod } from '@xylabs/sdk-js'\nimport {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/zod'\nimport { PayloadZod, SchemaZod } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { BoundWitnessSchema } from './BoundWitnessSchema.ts'\nimport { SignaturesMetaZod } from './Signatures.ts'\n\nexport const BoundWitnessRequiredFieldsZod = z.object({\n addresses: z.array(AddressZod),\n payload_hashes: z.array(HashZod),\n payload_schemas: z.array(SchemaZod),\n previous_hashes: z.array(HashZod.nullable()),\n})\n\nexport type BoundWitnessRequiredFields = z.infer<typeof BoundWitnessRequiredFieldsZod>\n\nexport const BoundWitnessMetaZod = z.object({\n $destination: AddressZod.optional(),\n $sourceQuery: HashZod.optional(),\n}).extend(SignaturesMetaZod.shape)\n\nexport type BoundWitnessMeta = z.infer<typeof BoundWitnessMetaZod>\n\nexport const BoundWitnessZod = PayloadZod\n .safeExtend({ schema: z.literal(BoundWitnessSchema) })\n .safeExtend(BoundWitnessRequiredFieldsZod.shape)\n .safeExtend(BoundWitnessMetaZod.shape)\n // .refine(data => data.$signatures.length === data.addresses.length, { message: '$signatures length must equal addresses length' })\n\nexport type BoundWitness = z.infer<typeof BoundWitnessZod>\n\nexport const isBoundWitness = zodIsFactory(BoundWitnessZod)\nexport const asBoundWitness = zodAsFactory(BoundWitnessZod, 'asBoundWitness')\nexport const toBoundWitness = zodToFactory(BoundWitnessZod, 'toBoundWitness')\n\nexport const AnyBoundWitnessZod = BoundWitnessZod.loose()\nexport type AnyBoundWitness = z.infer<typeof AnyBoundWitnessZod>\n","export const BoundWitnessSchema = 'network.xyo.boundwitness' as const\nexport type BoundWitnessSchema = typeof BoundWitnessSchema\n","import { HexZod } from '@xylabs/sdk-js'\nimport z from 'zod'\n\nimport type { BoundWitness } from './BoundWitness.ts'\n\nexport const SignaturesMetaZod = z.object({ $signatures: z.array(z.union([HexZod, z.null()])) })\nexport const UnsignedSignaturesMetaZod = z.object({ $signatures: z.array(z.null()) })\nexport const SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod) })\n\nexport type SignaturesMeta = z.infer<typeof SignaturesMetaZod>\nexport type UnsignedSignaturesMeta = z.infer<typeof UnsignedSignaturesMetaZod>\nexport type SignedSignaturesMeta = z.infer<typeof SignedSignaturesMetaZod>\n\nexport type Unsigned<T extends BoundWitness = BoundWitness> = Omit<T, '$signatures'> & UnsignedSignaturesMeta\nexport type Signed<T extends BoundWitness = BoundWitness> = Omit<T, '$signatures'> & SignedSignaturesMeta\nexport type PossiblySigned<T extends BoundWitness = BoundWitness> = Unsigned<T> | Signed<T>\n","// Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n// https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { SignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const SignedBoundWitnessZod = BoundWitnessZod.extend(SignedSignaturesMetaZod.shape)\nexport type SignedBoundWitness = z.infer<typeof SignedBoundWitnessZod>\n\nexport const AnySignedBoundWitnessZod = SignedBoundWitnessZod.loose()\nexport type AnySignedBoundWitness = z.infer<typeof AnySignedBoundWitnessZod>\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { UnsignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const UnsignedBoundWitnessZod = BoundWitnessZod.extend(UnsignedSignaturesMetaZod.shape)\nexport type UnsignedBoundWitness = z.infer<typeof UnsignedBoundWitnessZod>\n\nexport const AnyUnsignedBoundWitnessZod = UnsignedBoundWitnessZod.loose()\nexport type AnyUnsignedBoundWitness = z.infer<typeof AnyUnsignedBoundWitnessZod>\n","import type { Hash } from '@xylabs/sdk-js'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport { type BoundWitness, isBoundWitness } from './BoundWitness/index.ts'\n\nexport type QueryBoundWitnessFields = {\n error_hashes?: Hash[]\n query: Hash\n}\n\nexport type UnsignedQueryBoundWitness = BoundWitness & QueryBoundWitnessFields\n\nexport type QueryBoundWitness = UnsignedQueryBoundWitness\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithStorageMeta = (x?: unknown): x is WithStorageMeta<QueryBoundWitness> => isQueryBoundWitness(x) && isStorageMeta(x)\n"],"mappings":";AAAA,SAAS,YAAY,eAAe;AACpC;AAAA,EACE;AAAA,EAAc;AAAA,EAAc;AAAA,OACvB;AACP,SAAS,YAAY,iBAAiB;AACtC,OAAOA,QAAO;;;ACLP,IAAM,qBAAqB;;;ACAlC,SAAS,cAAc;AACvB,OAAO,OAAO;AAIP,IAAM,oBAAoB,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACxF,IAAM,4BAA4B,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;AAC7E,IAAM,0BAA0B,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,EAAE,CAAC;;;
|
|
1
|
+
{"version":3,"sources":["../../src/BoundWitness/BoundWitness.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/BoundWitness/Signatures.ts","../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/SignedBoundWitness.ts","../../src/BoundWitness/UnsignedBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["import { AddressZod, HashZod } from '@xylabs/sdk-js'\nimport {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/zod'\nimport { PayloadZod, SchemaZod } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { BoundWitnessSchema } from './BoundWitnessSchema.ts'\nimport { SignaturesMetaZod } from './Signatures.ts'\n\nexport const BoundWitnessRequiredFieldsZod = z.object({\n addresses: z.array(AddressZod),\n payload_hashes: z.array(HashZod),\n payload_schemas: z.array(SchemaZod),\n previous_hashes: z.array(HashZod.nullable()),\n})\n\nexport type BoundWitnessRequiredFields = z.infer<typeof BoundWitnessRequiredFieldsZod>\n\nexport const BoundWitnessMetaZod = z.object({\n $destination: AddressZod.optional(),\n $sourceQuery: HashZod.optional(),\n}).extend(SignaturesMetaZod.shape)\n\nexport type BoundWitnessMeta = z.infer<typeof BoundWitnessMetaZod>\n\nexport const BoundWitnessZod = PayloadZod\n .safeExtend({ schema: z.literal(BoundWitnessSchema) })\n .safeExtend(BoundWitnessRequiredFieldsZod.shape)\n .safeExtend(BoundWitnessMetaZod.shape)\n // .refine(data => data.$signatures.length === data.addresses.length, { message: '$signatures length must equal addresses length' })\n\nexport type BoundWitness = z.infer<typeof BoundWitnessZod>\n\nexport const isBoundWitness = zodIsFactory(BoundWitnessZod)\nexport const asBoundWitness = zodAsFactory(BoundWitnessZod, 'asBoundWitness')\nexport const toBoundWitness = zodToFactory(BoundWitnessZod, 'toBoundWitness')\n\nexport const AnyBoundWitnessZod = BoundWitnessZod.loose()\nexport type AnyBoundWitness = z.infer<typeof AnyBoundWitnessZod>\n","export const BoundWitnessSchema = 'network.xyo.boundwitness' as const\nexport type BoundWitnessSchema = typeof BoundWitnessSchema\n","import { HexZod } from '@xylabs/sdk-js'\nimport z from 'zod'\n\nimport type { BoundWitness } from './BoundWitness.ts'\n\nexport const SignaturesMetaZod = z.object({ $signatures: z.array(z.union([HexZod, z.null()])) })\nexport const UnsignedSignaturesMetaZod = z.object({ $signatures: z.array(z.null()) })\nexport const SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod).min(1) })\n\nexport type SignaturesMeta = z.infer<typeof SignaturesMetaZod>\nexport type UnsignedSignaturesMeta = z.infer<typeof UnsignedSignaturesMetaZod>\nexport type SignedSignaturesMeta = z.infer<typeof SignedSignaturesMetaZod>\n\nexport type Unsigned<T extends BoundWitness = BoundWitness> = Omit<T, '$signatures'> & UnsignedSignaturesMeta\nexport type Signed<T extends BoundWitness = BoundWitness> = Omit<T, '$signatures'> & SignedSignaturesMeta\nexport type PossiblySigned<T extends BoundWitness = BoundWitness> = Unsigned<T> | Signed<T>\n","// Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n// https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { SignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const SignedBoundWitnessZod = BoundWitnessZod.extend(SignedSignaturesMetaZod.shape)\nexport type SignedBoundWitness = z.infer<typeof SignedBoundWitnessZod>\n\nexport const AnySignedBoundWitnessZod = SignedBoundWitnessZod.loose()\nexport type AnySignedBoundWitness = z.infer<typeof AnySignedBoundWitnessZod>\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { UnsignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const UnsignedBoundWitnessZod = BoundWitnessZod.extend(UnsignedSignaturesMetaZod.shape)\nexport type UnsignedBoundWitness = z.infer<typeof UnsignedBoundWitnessZod>\n\nexport const AnyUnsignedBoundWitnessZod = UnsignedBoundWitnessZod.loose()\nexport type AnyUnsignedBoundWitness = z.infer<typeof AnyUnsignedBoundWitnessZod>\n","import type { Hash } from '@xylabs/sdk-js'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport { type BoundWitness, isBoundWitness } from './BoundWitness/index.ts'\n\nexport type QueryBoundWitnessFields = {\n error_hashes?: Hash[]\n query: Hash\n}\n\nexport type UnsignedQueryBoundWitness = BoundWitness & QueryBoundWitnessFields\n\nexport type QueryBoundWitness = UnsignedQueryBoundWitness\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithStorageMeta = (x?: unknown): x is WithStorageMeta<QueryBoundWitness> => isQueryBoundWitness(x) && isStorageMeta(x)\n"],"mappings":";AAAA,SAAS,YAAY,eAAe;AACpC;AAAA,EACE;AAAA,EAAc;AAAA,EAAc;AAAA,OACvB;AACP,SAAS,YAAY,iBAAiB;AACtC,OAAOA,QAAO;;;ACLP,IAAM,qBAAqB;;;ACAlC,SAAS,cAAc;AACvB,OAAO,OAAO;AAIP,IAAM,oBAAoB,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACxF,IAAM,4BAA4B,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;AAC7E,IAAM,0BAA0B,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;;;AFGhF,IAAM,gCAAgCC,GAAE,OAAO;AAAA,EACpD,WAAWA,GAAE,MAAM,UAAU;AAAA,EAC7B,gBAAgBA,GAAE,MAAM,OAAO;AAAA,EAC/B,iBAAiBA,GAAE,MAAM,SAAS;AAAA,EA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sBAAsB,CAAC,MAAwC,eAAe,CAAC,KAAM,GAAyB,UAAU;AAC9H,IAAM,qCAAqC,CAAC,MAAyD,oBAAoB,CAAC,KAAK,cAAc,CAAC;","names":["z","z"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Signatures.d.ts","sourceRoot":"","sources":["../../../src/BoundWitness/Signatures.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,eAAO,MAAM,iBAAiB;;mBAAkE,CAAA;AAChG,eAAO,MAAM,yBAAyB;;mBAA+C,CAAA;AACrF,eAAO,MAAM,uBAAuB;;
|
|
1
|
+
{"version":3,"file":"Signatures.d.ts","sourceRoot":"","sources":["../../../src/BoundWitness/Signatures.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,eAAO,MAAM,iBAAiB;;mBAAkE,CAAA;AAChG,eAAO,MAAM,yBAAyB;;mBAA+C,CAAA;AACrF,eAAO,MAAM,uBAAuB;;mBAAoD,CAAA;AAExF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAC9D,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAC9E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE1E,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,IAAI,CAAC,CAAC,EAAE,aAAa,CAAC,GAAG,sBAAsB,CAAA;AAC7G,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,IAAI,CAAC,CAAC,EAAE,aAAa,CAAC,GAAG,oBAAoB,CAAA;AACzG,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA"}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import { HexZod } from "@xylabs/sdk-js";
|
|
|
16
16
|
import z from "zod";
|
|
17
17
|
var SignaturesMetaZod = z.object({ $signatures: z.array(z.union([HexZod, z.null()])) });
|
|
18
18
|
var UnsignedSignaturesMetaZod = z.object({ $signatures: z.array(z.null()) });
|
|
19
|
-
var SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod) });
|
|
19
|
+
var SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod).min(1) });
|
|
20
20
|
|
|
21
21
|
// src/BoundWitness/BoundWitness.ts
|
|
22
22
|
var BoundWitnessRequiredFieldsZod = z2.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/BoundWitness/BoundWitness.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/BoundWitness/Signatures.ts","../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/SignedBoundWitness.ts","../../src/BoundWitness/UnsignedBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["import { AddressZod, HashZod } from '@xylabs/sdk-js'\nimport {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/zod'\nimport { PayloadZod, SchemaZod } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { BoundWitnessSchema } from './BoundWitnessSchema.ts'\nimport { SignaturesMetaZod } from './Signatures.ts'\n\nexport const BoundWitnessRequiredFieldsZod = z.object({\n addresses: z.array(AddressZod),\n payload_hashes: z.array(HashZod),\n payload_schemas: z.array(SchemaZod),\n previous_hashes: z.array(HashZod.nullable()),\n})\n\nexport type BoundWitnessRequiredFields = z.infer<typeof BoundWitnessRequiredFieldsZod>\n\nexport const BoundWitnessMetaZod = z.object({\n $destination: AddressZod.optional(),\n $sourceQuery: HashZod.optional(),\n}).extend(SignaturesMetaZod.shape)\n\nexport type BoundWitnessMeta = z.infer<typeof BoundWitnessMetaZod>\n\nexport const BoundWitnessZod = PayloadZod\n .safeExtend({ schema: z.literal(BoundWitnessSchema) })\n .safeExtend(BoundWitnessRequiredFieldsZod.shape)\n .safeExtend(BoundWitnessMetaZod.shape)\n // .refine(data => data.$signatures.length === data.addresses.length, { message: '$signatures length must equal addresses length' })\n\nexport type BoundWitness = z.infer<typeof BoundWitnessZod>\n\nexport const isBoundWitness = zodIsFactory(BoundWitnessZod)\nexport const asBoundWitness = zodAsFactory(BoundWitnessZod, 'asBoundWitness')\nexport const toBoundWitness = zodToFactory(BoundWitnessZod, 'toBoundWitness')\n\nexport const AnyBoundWitnessZod = BoundWitnessZod.loose()\nexport type AnyBoundWitness = z.infer<typeof AnyBoundWitnessZod>\n","export const BoundWitnessSchema = 'network.xyo.boundwitness' as const\nexport type BoundWitnessSchema = typeof BoundWitnessSchema\n","import { HexZod } from '@xylabs/sdk-js'\nimport z from 'zod'\n\nimport type { BoundWitness } from './BoundWitness.ts'\n\nexport const SignaturesMetaZod = z.object({ $signatures: z.array(z.union([HexZod, z.null()])) })\nexport const UnsignedSignaturesMetaZod = z.object({ $signatures: z.array(z.null()) })\nexport const SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod) })\n\nexport type SignaturesMeta = z.infer<typeof SignaturesMetaZod>\nexport type UnsignedSignaturesMeta = z.infer<typeof UnsignedSignaturesMetaZod>\nexport type SignedSignaturesMeta = z.infer<typeof SignedSignaturesMetaZod>\n\nexport type Unsigned<T extends BoundWitness = BoundWitness> = Omit<T, '$signatures'> & UnsignedSignaturesMeta\nexport type Signed<T extends BoundWitness = BoundWitness> = Omit<T, '$signatures'> & SignedSignaturesMeta\nexport type PossiblySigned<T extends BoundWitness = BoundWitness> = Unsigned<T> | Signed<T>\n","// Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n// https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { SignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const SignedBoundWitnessZod = BoundWitnessZod.extend(SignedSignaturesMetaZod.shape)\nexport type SignedBoundWitness = z.infer<typeof SignedBoundWitnessZod>\n\nexport const AnySignedBoundWitnessZod = SignedBoundWitnessZod.loose()\nexport type AnySignedBoundWitness = z.infer<typeof AnySignedBoundWitnessZod>\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { UnsignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const UnsignedBoundWitnessZod = BoundWitnessZod.extend(UnsignedSignaturesMetaZod.shape)\nexport type UnsignedBoundWitness = z.infer<typeof UnsignedBoundWitnessZod>\n\nexport const AnyUnsignedBoundWitnessZod = UnsignedBoundWitnessZod.loose()\nexport type AnyUnsignedBoundWitness = z.infer<typeof AnyUnsignedBoundWitnessZod>\n","import type { Hash } from '@xylabs/sdk-js'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport { type BoundWitness, isBoundWitness } from './BoundWitness/index.ts'\n\nexport type QueryBoundWitnessFields = {\n error_hashes?: Hash[]\n query: Hash\n}\n\nexport type UnsignedQueryBoundWitness = BoundWitness & QueryBoundWitnessFields\n\nexport type QueryBoundWitness = UnsignedQueryBoundWitness\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithStorageMeta = (x?: unknown): x is WithStorageMeta<QueryBoundWitness> => isQueryBoundWitness(x) && isStorageMeta(x)\n"],"mappings":";AAAA,SAAS,YAAY,eAAe;AACpC;AAAA,EACE;AAAA,EAAc;AAAA,EAAc;AAAA,OACvB;AACP,SAAS,YAAY,iBAAiB;AACtC,OAAOA,QAAO;;;ACLP,IAAM,qBAAqB;;;ACAlC,SAAS,cAAc;AACvB,OAAO,OAAO;AAIP,IAAM,oBAAoB,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACxF,IAAM,4BAA4B,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;AAC7E,IAAM,0BAA0B,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,EAAE,CAAC;;;
|
|
1
|
+
{"version":3,"sources":["../../src/BoundWitness/BoundWitness.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/BoundWitness/Signatures.ts","../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/SignedBoundWitness.ts","../../src/BoundWitness/UnsignedBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["import { AddressZod, HashZod } from '@xylabs/sdk-js'\nimport {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/zod'\nimport { PayloadZod, SchemaZod } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { BoundWitnessSchema } from './BoundWitnessSchema.ts'\nimport { SignaturesMetaZod } from './Signatures.ts'\n\nexport const BoundWitnessRequiredFieldsZod = z.object({\n addresses: z.array(AddressZod),\n payload_hashes: z.array(HashZod),\n payload_schemas: z.array(SchemaZod),\n previous_hashes: z.array(HashZod.nullable()),\n})\n\nexport type BoundWitnessRequiredFields = z.infer<typeof BoundWitnessRequiredFieldsZod>\n\nexport const BoundWitnessMetaZod = z.object({\n $destination: AddressZod.optional(),\n $sourceQuery: HashZod.optional(),\n}).extend(SignaturesMetaZod.shape)\n\nexport type BoundWitnessMeta = z.infer<typeof BoundWitnessMetaZod>\n\nexport const BoundWitnessZod = PayloadZod\n .safeExtend({ schema: z.literal(BoundWitnessSchema) })\n .safeExtend(BoundWitnessRequiredFieldsZod.shape)\n .safeExtend(BoundWitnessMetaZod.shape)\n // .refine(data => data.$signatures.length === data.addresses.length, { message: '$signatures length must equal addresses length' })\n\nexport type BoundWitness = z.infer<typeof BoundWitnessZod>\n\nexport const isBoundWitness = zodIsFactory(BoundWitnessZod)\nexport const asBoundWitness = zodAsFactory(BoundWitnessZod, 'asBoundWitness')\nexport const toBoundWitness = zodToFactory(BoundWitnessZod, 'toBoundWitness')\n\nexport const AnyBoundWitnessZod = BoundWitnessZod.loose()\nexport type AnyBoundWitness = z.infer<typeof AnyBoundWitnessZod>\n","export const BoundWitnessSchema = 'network.xyo.boundwitness' as const\nexport type BoundWitnessSchema = typeof BoundWitnessSchema\n","import { HexZod } from '@xylabs/sdk-js'\nimport z from 'zod'\n\nimport type { BoundWitness } from './BoundWitness.ts'\n\nexport const SignaturesMetaZod = z.object({ $signatures: z.array(z.union([HexZod, z.null()])) })\nexport const UnsignedSignaturesMetaZod = z.object({ $signatures: z.array(z.null()) })\nexport const SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod).min(1) })\n\nexport type SignaturesMeta = z.infer<typeof SignaturesMetaZod>\nexport type UnsignedSignaturesMeta = z.infer<typeof UnsignedSignaturesMetaZod>\nexport type SignedSignaturesMeta = z.infer<typeof SignedSignaturesMetaZod>\n\nexport type Unsigned<T extends BoundWitness = BoundWitness> = Omit<T, '$signatures'> & UnsignedSignaturesMeta\nexport type Signed<T extends BoundWitness = BoundWitness> = Omit<T, '$signatures'> & SignedSignaturesMeta\nexport type PossiblySigned<T extends BoundWitness = BoundWitness> = Unsigned<T> | Signed<T>\n","// Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n// https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { SignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const SignedBoundWitnessZod = BoundWitnessZod.extend(SignedSignaturesMetaZod.shape)\nexport type SignedBoundWitness = z.infer<typeof SignedBoundWitnessZod>\n\nexport const AnySignedBoundWitnessZod = SignedBoundWitnessZod.loose()\nexport type AnySignedBoundWitness = z.infer<typeof AnySignedBoundWitnessZod>\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { UnsignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const UnsignedBoundWitnessZod = BoundWitnessZod.extend(UnsignedSignaturesMetaZod.shape)\nexport type UnsignedBoundWitness = z.infer<typeof UnsignedBoundWitnessZod>\n\nexport const AnyUnsignedBoundWitnessZod = UnsignedBoundWitnessZod.loose()\nexport type AnyUnsignedBoundWitness = z.infer<typeof AnyUnsignedBoundWitnessZod>\n","import type { Hash } from '@xylabs/sdk-js'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport { type BoundWitness, isBoundWitness } from './BoundWitness/index.ts'\n\nexport type QueryBoundWitnessFields = {\n error_hashes?: Hash[]\n query: Hash\n}\n\nexport type UnsignedQueryBoundWitness = BoundWitness & QueryBoundWitnessFields\n\nexport type QueryBoundWitness = UnsignedQueryBoundWitness\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithStorageMeta = (x?: unknown): x is WithStorageMeta<QueryBoundWitness> => isQueryBoundWitness(x) && isStorageMeta(x)\n"],"mappings":";AAAA,SAAS,YAAY,eAAe;AACpC;AAAA,EACE;AAAA,EAAc;AAAA,EAAc;AAAA,OACvB;AACP,SAAS,YAAY,iBAAiB;AACtC,OAAOA,QAAO;;;ACLP,IAAM,qBAAqB;;;ACAlC,SAAS,cAAc;AACvB,OAAO,OAAO;AAIP,IAAM,oBAAoB,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACxF,IAAM,4BAA4B,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;AAC7E,IAAM,0BAA0B,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;;;AFGhF,IAAM,gCAAgCC,GAAE,OAAO;AAAA,EACpD,WAAWA,GAAE,MAAM,UAAU;AAAA,EAC7B,gBAAgBA,GAAE,MAAM,OAAO;AAAA,EAC/B,iBAAiBA,GAAE,MAAM,SAAS;AAAA,EAClC,iBAAiBA,GAAE,MAAM,QAAQ,SAAS,CAAC;AAC7C,CAAC;AAIM,IAAM,sBAAsBA,GAAE,OAAO;AAAA,EAC1C,cAAc,WAAW,SAAS;AAAA,EAClC,cAAc,QAAQ,SAAS;AACjC,CAAC,EAAE,OAAO,kBAAkB,KAAK;AAI1B,IAAM,kBAAkB,WAC5B,WAAW,EAAE,QAAQA,GAAE,QAAQ,kBAAkB,EAAE,CAAC,EACpD,WAAW,8BAA8B,K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AK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,eAAO,MAAM,iBAAiB;;mBAAkE,CAAA;AAChG,eAAO,MAAM,yBAAyB;;mBAA+C,CAAA;AACrF,eAAO,MAAM,uBAAuB;;
|
|
1
|
+
{"version":3,"file":"Signatures.d.ts","sourceRoot":"","sources":["../../../src/BoundWitness/Signatures.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,eAAO,MAAM,iBAAiB;;mBAAkE,CAAA;AAChG,eAAO,MAAM,yBAAyB;;mBAA+C,CAAA;AACrF,eAAO,MAAM,uBAAuB;;mBAAoD,CAAA;AAExF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAC9D,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAC9E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE1E,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,IAAI,CAAC,CAAC,EAAE,aAAa,CAAC,GAAG,sBAAsB,CAAA;AAC7G,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,IAAI,CAAC,CAAC,EAAE,aAAa,CAAC,GAAG,oBAAoB,CAAA;AACzG,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA"}
|
package/dist/node/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import { HexZod } from "@xylabs/sdk-js";
|
|
|
16
16
|
import z from "zod";
|
|
17
17
|
var SignaturesMetaZod = z.object({ $signatures: z.array(z.union([HexZod, z.null()])) });
|
|
18
18
|
var UnsignedSignaturesMetaZod = z.object({ $signatures: z.array(z.null()) });
|
|
19
|
-
var SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod) });
|
|
19
|
+
var SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod).min(1) });
|
|
20
20
|
|
|
21
21
|
// src/BoundWitness/BoundWitness.ts
|
|
22
22
|
var BoundWitnessRequiredFieldsZod = z2.object({
|
package/dist/node/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/BoundWitness/BoundWitness.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/BoundWitness/Signatures.ts","../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/SignedBoundWitness.ts","../../src/BoundWitness/UnsignedBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["import { AddressZod, HashZod } from '@xylabs/sdk-js'\nimport {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/zod'\nimport { PayloadZod, SchemaZod } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { BoundWitnessSchema } from './BoundWitnessSchema.ts'\nimport { SignaturesMetaZod } from './Signatures.ts'\n\nexport const BoundWitnessRequiredFieldsZod = z.object({\n addresses: z.array(AddressZod),\n payload_hashes: z.array(HashZod),\n payload_schemas: z.array(SchemaZod),\n previous_hashes: z.array(HashZod.nullable()),\n})\n\nexport type BoundWitnessRequiredFields = z.infer<typeof BoundWitnessRequiredFieldsZod>\n\nexport const BoundWitnessMetaZod = z.object({\n $destination: AddressZod.optional(),\n $sourceQuery: HashZod.optional(),\n}).extend(SignaturesMetaZod.shape)\n\nexport type BoundWitnessMeta = z.infer<typeof BoundWitnessMetaZod>\n\nexport const BoundWitnessZod = PayloadZod\n .safeExtend({ schema: z.literal(BoundWitnessSchema) })\n .safeExtend(BoundWitnessRequiredFieldsZod.shape)\n .safeExtend(BoundWitnessMetaZod.shape)\n // .refine(data => data.$signatures.length === data.addresses.length, { message: '$signatures length must equal addresses length' })\n\nexport type BoundWitness = z.infer<typeof BoundWitnessZod>\n\nexport const isBoundWitness = zodIsFactory(BoundWitnessZod)\nexport const asBoundWitness = zodAsFactory(BoundWitnessZod, 'asBoundWitness')\nexport const toBoundWitness = zodToFactory(BoundWitnessZod, 'toBoundWitness')\n\nexport const AnyBoundWitnessZod = BoundWitnessZod.loose()\nexport type AnyBoundWitness = z.infer<typeof AnyBoundWitnessZod>\n","export const BoundWitnessSchema = 'network.xyo.boundwitness' as const\nexport type BoundWitnessSchema = typeof BoundWitnessSchema\n","import { HexZod } from '@xylabs/sdk-js'\nimport z from 'zod'\n\nimport type { BoundWitness } from './BoundWitness.ts'\n\nexport const SignaturesMetaZod = z.object({ $signatures: z.array(z.union([HexZod, z.null()])) })\nexport const UnsignedSignaturesMetaZod = z.object({ $signatures: z.array(z.null()) })\nexport const SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod) })\n\nexport type SignaturesMeta = z.infer<typeof SignaturesMetaZod>\nexport type UnsignedSignaturesMeta = z.infer<typeof UnsignedSignaturesMetaZod>\nexport type SignedSignaturesMeta = z.infer<typeof SignedSignaturesMetaZod>\n\nexport type Unsigned<T extends BoundWitness = BoundWitness> = Omit<T, '$signatures'> & UnsignedSignaturesMeta\nexport type Signed<T extends BoundWitness = BoundWitness> = Omit<T, '$signatures'> & SignedSignaturesMeta\nexport type PossiblySigned<T extends BoundWitness = BoundWitness> = Unsigned<T> | Signed<T>\n","// Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n// https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { SignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const SignedBoundWitnessZod = BoundWitnessZod.extend(SignedSignaturesMetaZod.shape)\nexport type SignedBoundWitness = z.infer<typeof SignedBoundWitnessZod>\n\nexport const AnySignedBoundWitnessZod = SignedBoundWitnessZod.loose()\nexport type AnySignedBoundWitness = z.infer<typeof AnySignedBoundWitnessZod>\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { UnsignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const UnsignedBoundWitnessZod = BoundWitnessZod.extend(UnsignedSignaturesMetaZod.shape)\nexport type UnsignedBoundWitness = z.infer<typeof UnsignedBoundWitnessZod>\n\nexport const AnyUnsignedBoundWitnessZod = UnsignedBoundWitnessZod.loose()\nexport type AnyUnsignedBoundWitness = z.infer<typeof AnyUnsignedBoundWitnessZod>\n","import type { Hash } from '@xylabs/sdk-js'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport { type BoundWitness, isBoundWitness } from './BoundWitness/index.ts'\n\nexport type QueryBoundWitnessFields = {\n error_hashes?: Hash[]\n query: Hash\n}\n\nexport type UnsignedQueryBoundWitness = BoundWitness & QueryBoundWitnessFields\n\nexport type QueryBoundWitness = UnsignedQueryBoundWitness\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithStorageMeta = (x?: unknown): x is WithStorageMeta<QueryBoundWitness> => isQueryBoundWitness(x) && isStorageMeta(x)\n"],"mappings":";AAAA,SAAS,YAAY,eAAe;AACpC;AAAA,EACE;AAAA,EAAc;AAAA,EAAc;AAAA,OACvB;AACP,SAAS,YAAY,iBAAiB;AACtC,OAAOA,QAAO;;;ACLP,IAAM,qBAAqB;;;ACAlC,SAAS,cAAc;AACvB,OAAO,OAAO;AAIP,IAAM,oBAAoB,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACxF,IAAM,4BAA4B,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;AAC7E,IAAM,0BAA0B,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,EAAE,CAAC;;;
|
|
1
|
+
{"version":3,"sources":["../../src/BoundWitness/BoundWitness.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/BoundWitness/Signatures.ts","../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/SignedBoundWitness.ts","../../src/BoundWitness/UnsignedBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["import { AddressZod, HashZod } from '@xylabs/sdk-js'\nimport {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/zod'\nimport { PayloadZod, SchemaZod } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { BoundWitnessSchema } from './BoundWitnessSchema.ts'\nimport { SignaturesMetaZod } from './Signatures.ts'\n\nexport const BoundWitnessRequiredFieldsZod = z.object({\n addresses: z.array(AddressZod),\n payload_hashes: z.array(HashZod),\n payload_schemas: z.array(SchemaZod),\n previous_hashes: z.array(HashZod.nullable()),\n})\n\nexport type BoundWitnessRequiredFields = z.infer<typeof BoundWitnessRequiredFieldsZod>\n\nexport const BoundWitnessMetaZod = z.object({\n $destination: AddressZod.optional(),\n $sourceQuery: HashZod.optional(),\n}).extend(SignaturesMetaZod.shape)\n\nexport type BoundWitnessMeta = z.infer<typeof BoundWitnessMetaZod>\n\nexport const BoundWitnessZod = PayloadZod\n .safeExtend({ schema: z.literal(BoundWitnessSchema) })\n .safeExtend(BoundWitnessRequiredFieldsZod.shape)\n .safeExtend(BoundWitnessMetaZod.shape)\n // .refine(data => data.$signatures.length === data.addresses.length, { message: '$signatures length must equal addresses length' })\n\nexport type BoundWitness = z.infer<typeof BoundWitnessZod>\n\nexport const isBoundWitness = zodIsFactory(BoundWitnessZod)\nexport const asBoundWitness = zodAsFactory(BoundWitnessZod, 'asBoundWitness')\nexport const toBoundWitness = zodToFactory(BoundWitnessZod, 'toBoundWitness')\n\nexport const AnyBoundWitnessZod = BoundWitnessZod.loose()\nexport type AnyBoundWitness = z.infer<typeof AnyBoundWitnessZod>\n","export const BoundWitnessSchema = 'network.xyo.boundwitness' as const\nexport type BoundWitnessSchema = typeof BoundWitnessSchema\n","import { HexZod } from '@xylabs/sdk-js'\nimport z from 'zod'\n\nimport type { BoundWitness } from './BoundWitness.ts'\n\nexport const SignaturesMetaZod = z.object({ $signatures: z.array(z.union([HexZod, z.null()])) })\nexport const UnsignedSignaturesMetaZod = z.object({ $signatures: z.array(z.null()) })\nexport const SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod).min(1) })\n\nexport type SignaturesMeta = z.infer<typeof SignaturesMetaZod>\nexport type UnsignedSignaturesMeta = z.infer<typeof UnsignedSignaturesMetaZod>\nexport type SignedSignaturesMeta = z.infer<typeof SignedSignaturesMetaZod>\n\nexport type Unsigned<T extends BoundWitness = BoundWitness> = Omit<T, '$signatures'> & UnsignedSignaturesMeta\nexport type Signed<T extends BoundWitness = BoundWitness> = Omit<T, '$signatures'> & SignedSignaturesMeta\nexport type PossiblySigned<T extends BoundWitness = BoundWitness> = Unsigned<T> | Signed<T>\n","// Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n// https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { SignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const SignedBoundWitnessZod = BoundWitnessZod.extend(SignedSignaturesMetaZod.shape)\nexport type SignedBoundWitness = z.infer<typeof SignedBoundWitnessZod>\n\nexport const AnySignedBoundWitnessZod = SignedBoundWitnessZod.loose()\nexport type AnySignedBoundWitness = z.infer<typeof AnySignedBoundWitnessZod>\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { UnsignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const UnsignedBoundWitnessZod = BoundWitnessZod.extend(UnsignedSignaturesMetaZod.shape)\nexport type UnsignedBoundWitness = z.infer<typeof UnsignedBoundWitnessZod>\n\nexport const AnyUnsignedBoundWitnessZod = UnsignedBoundWitnessZod.loose()\nexport type AnyUnsignedBoundWitness = z.infer<typeof AnyUnsignedBoundWitnessZod>\n","import type { Hash } from '@xylabs/sdk-js'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport { type BoundWitness, isBoundWitness } from './BoundWitness/index.ts'\n\nexport type QueryBoundWitnessFields = {\n error_hashes?: Hash[]\n query: Hash\n}\n\nexport type UnsignedQueryBoundWitness = BoundWitness & QueryBoundWitnessFields\n\nexport type QueryBoundWitness = UnsignedQueryBoundWitness\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithStorageMeta = (x?: unknown): x is WithStorageMeta<QueryBoundWitness> => isQueryBoundWitness(x) && isStorageMeta(x)\n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,IACtB,YAAY;AAAA,MACV,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MACtD,gBAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC3D,iBAAiB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5D,iBAAiB,EAAE,OAAO,EAAE,UAAU,MAAM,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5E,QAAQ,EAAE,MAAM,SAAS;AAAA,IAC3B;AAAA,IACA,UAAU,CAAC,aAAa,kBAAkB,mBAAmB,mBAAmB,QAAQ;AAAA,IACxF,MAAM;AAAA,EACR;AACF;;;ACZO,IAAM,wBAAwB,gBAAgB,OAAO,wBAAwB,KAAK;AAGlF,IAAM,2BAA2B,sBAAsB,MAAM;;;ACH7D,IAAM,0BAA0B,gBAAgB,OAAO,0BAA0B,KAAK;AAGtF,IAAM,6BAA6B,wBAAwB,MAAM;;;ACNxE,SAAS,qBAAqB;AAavB,IAAM,sBAAsB,CAAC,MAAwC,eAAe,CAAC,KAAM,GAAyB,UAAU;AAC9H,IAAM,qCAAqC,CAAC,MAAyD,oBAAoB,CAAC,KAAK,cAAc,CAAC;","names":["z","z"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/boundwitness-model",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.24",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@xylabs/sdk-js": "~5.0.61",
|
|
40
40
|
"@xylabs/zod": "~5.0.61",
|
|
41
|
-
"@xyo-network/payload-model": "~5.2.
|
|
41
|
+
"@xyo-network/payload-model": "~5.2.24",
|
|
42
42
|
"zod": "~4.2.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
@@ -5,7 +5,7 @@ import type { BoundWitness } from './BoundWitness.ts'
|
|
|
5
5
|
|
|
6
6
|
export const SignaturesMetaZod = z.object({ $signatures: z.array(z.union([HexZod, z.null()])) })
|
|
7
7
|
export const UnsignedSignaturesMetaZod = z.object({ $signatures: z.array(z.null()) })
|
|
8
|
-
export const SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod) })
|
|
8
|
+
export const SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod).min(1) })
|
|
9
9
|
|
|
10
10
|
export type SignaturesMeta = z.infer<typeof SignaturesMetaZod>
|
|
11
11
|
export type UnsignedSignaturesMeta = z.infer<typeof UnsignedSignaturesMetaZod>
|