@xyo-network/module-model
Advanced tools
Comparing version
import type { Address } from '@xylabs/hex'; | ||
import type { Payload } from '@xyo-network/payload-model'; | ||
import { type Payload } from '@xyo-network/payload-model'; | ||
export declare const AddressSchema: "network.xyo.address"; | ||
@@ -11,2 +11,11 @@ export type AddressSchema = typeof AddressSchema; | ||
export type AddressPayload = Payload<AddressFields, AddressSchema>; | ||
/** | ||
* Identity function for determining if an object is an Address | ||
*/ | ||
export declare const isAddressPayload: (x?: unknown | null) => x is AddressPayload; | ||
export declare const asAddressPayload: { | ||
<TType extends AddressPayload>(value: import("@xylabs/promise").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined; | ||
<TType extends AddressPayload>(value: import("@xylabs/promise").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<AddressPayload>, config?: import("@xylabs/object").TypeCheckConfig): TType; | ||
}; | ||
export declare const asOptionalAddressPayload: <TType extends AddressPayload>(value: import("@xylabs/promise").AnyNonPromise) => TType | undefined; | ||
export interface AddressChildFields extends AddressFields { | ||
@@ -13,0 +22,0 @@ /** |
{ | ||
"name": "@xyo-network/module-model", | ||
"version": "3.9.25", | ||
"version": "3.9.26", | ||
"description": "Primary SDK for using XYO Protocol 2.0", | ||
@@ -40,7 +40,7 @@ "homepage": "https://xyo.network", | ||
"@xylabs/typeof": "^4.5.4", | ||
"@xyo-network/account-model": "^3.9.25", | ||
"@xyo-network/boundwitness-model": "^3.9.25", | ||
"@xyo-network/manifest-model": "^3.9.25", | ||
"@xyo-network/module-events": "^3.9.25", | ||
"@xyo-network/payload-model": "^3.9.25" | ||
"@xyo-network/account-model": "^3.9.26", | ||
"@xyo-network/boundwitness-model": "^3.9.26", | ||
"@xyo-network/manifest-model": "^3.9.26", | ||
"@xyo-network/module-events": "^3.9.26", | ||
"@xyo-network/payload-model": "^3.9.26" | ||
}, | ||
@@ -47,0 +47,0 @@ "devDependencies": { |
import type { Address } from '@xylabs/hex' | ||
import type { Payload } from '@xyo-network/payload-model' | ||
import { AsObjectFactory } from '@xylabs/object' | ||
import { isPayloadOfSchemaType, type Payload } from '@xyo-network/payload-model' | ||
@@ -16,2 +17,9 @@ export const AddressSchema = 'network.xyo.address' as const | ||
/** | ||
* Identity function for determining if an object is an Address | ||
*/ | ||
export const isAddressPayload = isPayloadOfSchemaType<AddressPayload>(AddressSchema) | ||
export const asAddressPayload = AsObjectFactory.create(isAddressPayload) | ||
export const asOptionalAddressPayload = AsObjectFactory.createOptional(isAddressPayload) | ||
export interface AddressChildFields extends AddressFields { | ||
@@ -18,0 +26,0 @@ /** |
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
293836
0.8%3316
0.73%