Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@xyo-network/payload-model

Package Overview
Dependencies
Maintainers
0
Versions
747
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xyo-network/payload-model - npm Package Compare versions

Comparing version 3.6.0-rc.7 to 3.6.0-rc.8

2

dist/browser/Error.d.ts

@@ -14,3 +14,3 @@ import type { Hash } from '@xylabs/hex';

}>;
export declare const isModuleError: (x?: unknown | null) => x is import("./Payload.ts").DeepRestrictToStringKeys<{
export declare const isModuleError: (x?: unknown | null) => x is import("@xylabs/object").DeepRestrictToStringKeys<{
schema: "network.xyo.error.module";

@@ -17,0 +17,0 @@ details?: string | number | boolean | {

import type { Payload } from './Payload.ts';
export declare const isAnyPayload: (value: unknown) => value is Payload;
export declare const asAnyPayload: {
<TType extends import("./Payload.ts").DeepRestrictToStringKeys<{
<TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
schema: import("./Schema.ts").Schema;
}>>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends import("./Payload.ts").DeepRestrictToStringKeys<{
}>>(value: import(".store/@xylabs-promise-npm-4.4.16-991629d558/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
schema: import("./Schema.ts").Schema;
}>>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("./Payload.ts").DeepRestrictToStringKeys<{
}>>(value: import(".store/@xylabs-promise-npm-4.4.16-991629d558/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xylabs/object").DeepRestrictToStringKeys<{
schema: import("./Schema.ts").Schema;

@@ -15,5 +15,5 @@ }>>, config?: import("@xylabs/object").TypeCheckConfig): TType;

export declare const asPayload: <T extends Payload>(schema: string[]) => {
<TType extends T>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends T>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<T>, config?: import("@xylabs/object").TypeCheckConfig): TType;
<TType extends T>(value: import(".store/@xylabs-promise-npm-4.4.16-991629d558/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends T>(value: import(".store/@xylabs-promise-npm-4.4.16-991629d558/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<T>, config?: import("@xylabs/object").TypeCheckConfig): TType;
};
//# sourceMappingURL=isPayload.d.ts.map
import type { Hash } from '@xylabs/hex';
import type { EmptyObject } from '@xylabs/object';
import type { DeepOmitStartsWith, DeepRestrictToStringKeys, EmptyObject } from '@xylabs/object';
import type { Schema, WithSchema } from './Schema.ts';

@@ -20,13 +20,10 @@ export interface SchemaField<T extends Schema = Schema> {

export type OverridablePayload<T extends Payload> = WithoutMeta<Omit<T, 'schema'> & PayloadFields>;
export type WithSources<T extends EmptyObject> = T & {
sources?: Hash[];
export type SourcesMetaField = {
$sources: Hash[];
};
export type WithSources<T extends EmptyObject> = T & SourcesMetaField;
export type WithOptionalSources<T extends EmptyObject> = (T & SourcesMetaField) | T;
export type PayloadWithSources<T extends void | EmptyObject | WithSchema = void, S extends Schema | void = void> = WithSources<Payload<T, S>>;
export type PayloadWithOptionalSources<T extends void | EmptyObject | WithSchema = void, S extends Schema | void = void> = WithOptionalSources<Payload<T, S>>;
export type WithAnySchema<T extends Payload> = OverridablePayload<T>;
export type DeepOmitStartsWith<T, Prefix extends string> = T extends (infer U)[] ? DeepOmitStartsWith<U, Prefix>[] : T extends object ? {
[K in keyof T as K extends string ? K extends `${Prefix}${string}` ? never : K : K]: DeepOmitStartsWith<T[K], Prefix>;
} : T;
export type DeepRestrictToStringKeys<T> = {
[K in keyof T as K extends string ? K : never]: T[K] extends (infer U)[] ? DeepRestrictToStringKeys<U>[] : T[K] extends object ? DeepRestrictToStringKeys<T[K]> : T[K];
};
export type WithoutClientMeta<T extends EmptyObject> = DeepOmitStartsWith<T, '$'>;

@@ -33,0 +30,0 @@ export type WithoutStorageMeta<T extends EmptyObject> = DeepOmitStartsWith<T, '_'>;

@@ -8,4 +8,4 @@ import type { EmptyObject } from '@xylabs/object';

export declare const asSchema: {
<TType extends string>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends string>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<string>, config?: import("@xylabs/object").TypeCheckConfig): TType;
<TType extends string>(value: import(".store/@xylabs-promise-npm-4.4.16-991629d558/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends string>(value: import(".store/@xylabs-promise-npm-4.4.16-991629d558/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<string>, config?: import("@xylabs/object").TypeCheckConfig): TType;
};

@@ -12,0 +12,0 @@ /** Schema fields for a Payload */

@@ -14,3 +14,3 @@ import type { Hash } from '@xylabs/hex';

}>;
export declare const isModuleError: (x?: unknown | null) => x is import("./Payload.ts").DeepRestrictToStringKeys<{
export declare const isModuleError: (x?: unknown | null) => x is import("@xylabs/object").DeepRestrictToStringKeys<{
schema: "network.xyo.error.module";

@@ -17,0 +17,0 @@ details?: string | number | boolean | {

import type { Payload } from './Payload.ts';
export declare const isAnyPayload: (value: unknown) => value is Payload;
export declare const asAnyPayload: {
<TType extends import("./Payload.ts").DeepRestrictToStringKeys<{
<TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
schema: import("./Schema.ts").Schema;
}>>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends import("./Payload.ts").DeepRestrictToStringKeys<{
}>>(value: import(".store/@xylabs-promise-npm-4.4.16-991629d558/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
schema: import("./Schema.ts").Schema;
}>>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("./Payload.ts").DeepRestrictToStringKeys<{
}>>(value: import(".store/@xylabs-promise-npm-4.4.16-991629d558/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xylabs/object").DeepRestrictToStringKeys<{
schema: import("./Schema.ts").Schema;

@@ -15,5 +15,5 @@ }>>, config?: import("@xylabs/object").TypeCheckConfig): TType;

export declare const asPayload: <T extends Payload>(schema: string[]) => {
<TType extends T>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends T>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<T>, config?: import("@xylabs/object").TypeCheckConfig): TType;
<TType extends T>(value: import(".store/@xylabs-promise-npm-4.4.16-991629d558/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends T>(value: import(".store/@xylabs-promise-npm-4.4.16-991629d558/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<T>, config?: import("@xylabs/object").TypeCheckConfig): TType;
};
//# sourceMappingURL=isPayload.d.ts.map
import type { Hash } from '@xylabs/hex';
import type { EmptyObject } from '@xylabs/object';
import type { DeepOmitStartsWith, DeepRestrictToStringKeys, EmptyObject } from '@xylabs/object';
import type { Schema, WithSchema } from './Schema.ts';

@@ -20,13 +20,10 @@ export interface SchemaField<T extends Schema = Schema> {

export type OverridablePayload<T extends Payload> = WithoutMeta<Omit<T, 'schema'> & PayloadFields>;
export type WithSources<T extends EmptyObject> = T & {
sources?: Hash[];
export type SourcesMetaField = {
$sources: Hash[];
};
export type WithSources<T extends EmptyObject> = T & SourcesMetaField;
export type WithOptionalSources<T extends EmptyObject> = (T & SourcesMetaField) | T;
export type PayloadWithSources<T extends void | EmptyObject | WithSchema = void, S extends Schema | void = void> = WithSources<Payload<T, S>>;
export type PayloadWithOptionalSources<T extends void | EmptyObject | WithSchema = void, S extends Schema | void = void> = WithOptionalSources<Payload<T, S>>;
export type WithAnySchema<T extends Payload> = OverridablePayload<T>;
export type DeepOmitStartsWith<T, Prefix extends string> = T extends (infer U)[] ? DeepOmitStartsWith<U, Prefix>[] : T extends object ? {
[K in keyof T as K extends string ? K extends `${Prefix}${string}` ? never : K : K]: DeepOmitStartsWith<T[K], Prefix>;
} : T;
export type DeepRestrictToStringKeys<T> = {
[K in keyof T as K extends string ? K : never]: T[K] extends (infer U)[] ? DeepRestrictToStringKeys<U>[] : T[K] extends object ? DeepRestrictToStringKeys<T[K]> : T[K];
};
export type WithoutClientMeta<T extends EmptyObject> = DeepOmitStartsWith<T, '$'>;

@@ -33,0 +30,0 @@ export type WithoutStorageMeta<T extends EmptyObject> = DeepOmitStartsWith<T, '_'>;

@@ -8,4 +8,4 @@ import type { EmptyObject } from '@xylabs/object';

export declare const asSchema: {
<TType extends string>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends string>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<string>, config?: import("@xylabs/object").TypeCheckConfig): TType;
<TType extends string>(value: import(".store/@xylabs-promise-npm-4.4.16-991629d558/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends string>(value: import(".store/@xylabs-promise-npm-4.4.16-991629d558/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<string>, config?: import("@xylabs/object").TypeCheckConfig): TType;
};

@@ -12,0 +12,0 @@ /** Schema fields for a Payload */

@@ -14,3 +14,3 @@ import type { Hash } from '@xylabs/hex';

}>;
export declare const isModuleError: (x?: unknown | null) => x is import("./Payload.ts").DeepRestrictToStringKeys<{
export declare const isModuleError: (x?: unknown | null) => x is import("@xylabs/object").DeepRestrictToStringKeys<{
schema: "network.xyo.error.module";

@@ -17,0 +17,0 @@ details?: string | number | boolean | {

import type { Payload } from './Payload.ts';
export declare const isAnyPayload: (value: unknown) => value is Payload;
export declare const asAnyPayload: {
<TType extends import("./Payload.ts").DeepRestrictToStringKeys<{
<TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
schema: import("./Schema.ts").Schema;
}>>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends import("./Payload.ts").DeepRestrictToStringKeys<{
}>>(value: import(".store/@xylabs-promise-npm-4.4.16-991629d558/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
schema: import("./Schema.ts").Schema;
}>>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("./Payload.ts").DeepRestrictToStringKeys<{
}>>(value: import(".store/@xylabs-promise-npm-4.4.16-991629d558/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xylabs/object").DeepRestrictToStringKeys<{
schema: import("./Schema.ts").Schema;

@@ -15,5 +15,5 @@ }>>, config?: import("@xylabs/object").TypeCheckConfig): TType;

export declare const asPayload: <T extends Payload>(schema: string[]) => {
<TType extends T>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends T>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<T>, config?: import("@xylabs/object").TypeCheckConfig): TType;
<TType extends T>(value: import(".store/@xylabs-promise-npm-4.4.16-991629d558/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends T>(value: import(".store/@xylabs-promise-npm-4.4.16-991629d558/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<T>, config?: import("@xylabs/object").TypeCheckConfig): TType;
};
//# sourceMappingURL=isPayload.d.ts.map
import type { Hash } from '@xylabs/hex';
import type { EmptyObject } from '@xylabs/object';
import type { DeepOmitStartsWith, DeepRestrictToStringKeys, EmptyObject } from '@xylabs/object';
import type { Schema, WithSchema } from './Schema.ts';

@@ -20,13 +20,10 @@ export interface SchemaField<T extends Schema = Schema> {

export type OverridablePayload<T extends Payload> = WithoutMeta<Omit<T, 'schema'> & PayloadFields>;
export type WithSources<T extends EmptyObject> = T & {
sources?: Hash[];
export type SourcesMetaField = {
$sources: Hash[];
};
export type WithSources<T extends EmptyObject> = T & SourcesMetaField;
export type WithOptionalSources<T extends EmptyObject> = (T & SourcesMetaField) | T;
export type PayloadWithSources<T extends void | EmptyObject | WithSchema = void, S extends Schema | void = void> = WithSources<Payload<T, S>>;
export type PayloadWithOptionalSources<T extends void | EmptyObject | WithSchema = void, S extends Schema | void = void> = WithOptionalSources<Payload<T, S>>;
export type WithAnySchema<T extends Payload> = OverridablePayload<T>;
export type DeepOmitStartsWith<T, Prefix extends string> = T extends (infer U)[] ? DeepOmitStartsWith<U, Prefix>[] : T extends object ? {
[K in keyof T as K extends string ? K extends `${Prefix}${string}` ? never : K : K]: DeepOmitStartsWith<T[K], Prefix>;
} : T;
export type DeepRestrictToStringKeys<T> = {
[K in keyof T as K extends string ? K : never]: T[K] extends (infer U)[] ? DeepRestrictToStringKeys<U>[] : T[K] extends object ? DeepRestrictToStringKeys<T[K]> : T[K];
};
export type WithoutClientMeta<T extends EmptyObject> = DeepOmitStartsWith<T, '$'>;

@@ -33,0 +30,0 @@ export type WithoutStorageMeta<T extends EmptyObject> = DeepOmitStartsWith<T, '_'>;

@@ -8,4 +8,4 @@ import type { EmptyObject } from '@xylabs/object';

export declare const asSchema: {
<TType extends string>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends string>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<string>, config?: import("@xylabs/object").TypeCheckConfig): TType;
<TType extends string>(value: import(".store/@xylabs-promise-npm-4.4.16-991629d558/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends string>(value: import(".store/@xylabs-promise-npm-4.4.16-991629d558/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<string>, config?: import("@xylabs/object").TypeCheckConfig): TType;
};

@@ -12,0 +12,0 @@ /** Schema fields for a Payload */

{
"name": "@xyo-network/payload-model",
"version": "3.6.0-rc.7",
"version": "3.6.0-rc.8",
"description": "Primary SDK for using XYO Protocol 2.0",

@@ -40,6 +40,6 @@ "homepage": "https://xyo.network",

"dependencies": {
"@xylabs/arraybuffer": "^4.4.15",
"@xylabs/assert": "^4.4.15",
"@xylabs/hex": "^4.4.15",
"@xylabs/object": "^4.4.15"
"@xylabs/arraybuffer": "^4.4.16",
"@xylabs/assert": "^4.4.16",
"@xylabs/hex": "^4.4.16",
"@xylabs/object": "^4.4.16"
},

@@ -49,3 +49,3 @@ "devDependencies": {

"@xylabs/tsconfig": "^4.2.4",
"@xylabs/vitest-extended": "^4.4.15",
"@xylabs/vitest-extended": "^4.4.16",
"typescript": "^5.7.2",

@@ -52,0 +52,0 @@ "vitest": "^2.1.8"

@@ -10,3 +10,3 @@ import { isAnyPayload } from './isPayload.ts'

return (x?: unknown | null): x is WithSources<T> =>
isPayloadOfSchemaType<WithSources<T>>(schema)(x) && x.sources !== undefined && Array.isArray(x.sources)
isPayloadOfSchemaType<WithSources<T>>(schema)(x) && x.$sources !== undefined && Array.isArray(x.$sources)
}

@@ -13,0 +13,0 @@

import type { Hash } from '@xylabs/hex'
import type { EmptyObject } from '@xylabs/object'
import type {
DeepOmitStartsWith, DeepRestrictToStringKeys, EmptyObject,
} from '@xylabs/object'

@@ -35,27 +37,12 @@ import type { Schema, WithSchema } from './Schema.ts'

export type WithSources<T extends EmptyObject> = T & { sources?: Hash[] }
export type SourcesMetaField = { $sources: Hash[] }
export type WithSources<T extends EmptyObject> = T & SourcesMetaField
export type WithOptionalSources<T extends EmptyObject> = (T & SourcesMetaField) | T
export type PayloadWithSources<T extends void | EmptyObject | WithSchema = void, S extends Schema | void = void> = WithSources<Payload<T, S>>
export type PayloadWithOptionalSources<T extends void | EmptyObject | WithSchema = void, S extends Schema | void = void> = WithOptionalSources<Payload<T, S>>
export type WithAnySchema<T extends Payload> = OverridablePayload<T>
export type DeepOmitStartsWith<T, Prefix extends string> = T extends (infer U)[]
? DeepOmitStartsWith<U, Prefix>[] // Special handling for arrays
: T extends object
? {
[K in keyof T as K extends string
? K extends `${Prefix}${string}`
? never
: K
: K]: DeepOmitStartsWith<T[K], Prefix>;
}
: T
export type DeepRestrictToStringKeys<T> = {
[K in keyof T as K extends string ? K : never]: T[K] extends (infer U)[]
? DeepRestrictToStringKeys<U>[] // Handle arrays recursively
: T[K] extends object
? DeepRestrictToStringKeys<T[K]> // Handle objects recursively
: T[K]; // Leave other types untouched
}
export type WithoutClientMeta<T extends EmptyObject> = DeepOmitStartsWith<T, '$'>

@@ -67,3 +54,2 @@ export type WithoutStorageMeta<T extends EmptyObject> = DeepOmitStartsWith<T, '_'>

export type WithoutSchema<T extends WithOptionalSchema<Payload>> = Omit<T, 'schema'>
export type WithOptionalSchema<T extends EmptyObject = EmptyObject> = WithoutSchema<T> & Partial<T & SchemaField>

@@ -82,3 +82,3 @@ import { toUint8Array } from '@xylabs/arraybuffer'

const nonce = SequenceParser.toNonce(nonceOrAddress)
const addressHex: Hex = address ? toHex(address, { bitLength: SequenceConstants.addressBytes * 8 }) : '' as Hex
const addressHex: Hex = address ? toHex(address, { bitLength: SequenceConstants.addressBytes * 8 }) : SequenceConstants.minAddress
const hexString = (epoch + nonce + addressHex) as Hex

@@ -85,0 +85,0 @@ assertEx(isSequence(hexString), () => `Invalid sequence [${hexString}] [${epoch}, ${nonce}, ${addressHex}]`)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc