@saberhq/anchor-contrib
Advanced tools
Comparing version 1.2.6 to 1.2.7
@@ -107,8 +107,6 @@ /// <reference types="node" /> | ||
export declare type AnchorError<T extends Idl> = NonNullable<T["errors"]>[number]; | ||
declare type FieldsOfType<I extends { | ||
declare type FieldsOfType<I extends IdlTypeDef> = I extends { | ||
type: IdlTypeDefTyStruct; | ||
}> = I["type"]["fields"][number]; | ||
declare type AnchorTypeDefStruct<I extends { | ||
type: IdlTypeDefTyStruct; | ||
}, Defined> = { | ||
} ? NonNullable<I["type"]["fields"]>[number] : never; | ||
declare type AnchorTypeDef<I extends IdlTypeDef, Defined> = { | ||
[F in FieldsOfType<I>["name"]]: DecodeType<(FieldsOfType<I> & { | ||
@@ -118,5 +116,2 @@ name: F; | ||
}; | ||
declare type AnchorTypeDef<I extends IdlTypeDef, Defined> = I extends { | ||
type: IdlTypeDefTyStruct; | ||
} ? AnchorTypeDefStruct<I, Defined> : string; | ||
declare type AnchorTypeDefs<T extends IdlTypeDef[], Defined> = { | ||
@@ -129,5 +124,3 @@ [K in T[number]["name"]]: AnchorTypeDef<T[number] & { | ||
export declare type AnchorAccounts<T extends Idl, Defined> = AnchorTypeDefs<NonNullable<T["accounts"]>, Defined>; | ||
export declare type AnchorState<T extends Idl, Defined> = NonNullable<T["state"]>["struct"] extends { | ||
type: IdlTypeDefTyStruct; | ||
} ? AnchorTypeDef<NonNullable<T["state"]>["struct"], Defined> : never; | ||
export declare type AnchorState<T extends Idl, Defined> = AnchorTypeDef<NonNullable<T["state"]>["struct"], Defined>; | ||
export declare type AnchorTypes<T extends Idl, AccountMap = Record<string, never>, D = Record<string, never>, DEF = AnchorDefined<T, D>> = { | ||
@@ -134,0 +127,0 @@ Defined: DEF; |
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "1.2.6", | ||
"version": "1.2.7", | ||
"main": "dist/index.js", | ||
@@ -29,3 +29,3 @@ "author": "Ian Macalinao <ian@saber.so>", | ||
}, | ||
"gitHead": "b36251e378425a68386cc35b446e3bd96bd7ead4" | ||
"gitHead": "38c683bd918a9cd7daff771af29586e0ea056ad4" | ||
} |
@@ -177,9 +177,9 @@ import type { | ||
type FieldsOfType< | ||
I extends { | ||
type: IdlTypeDefTyStruct; | ||
} | ||
> = I["type"]["fields"][number]; | ||
type FieldsOfType<I extends IdlTypeDef> = I extends { | ||
type: IdlTypeDefTyStruct; | ||
} | ||
? NonNullable<I["type"]["fields"]>[number] | ||
: never; | ||
type AnchorTypeDefStruct<I extends { type: IdlTypeDefTyStruct }, Defined> = { | ||
type AnchorTypeDef<I extends IdlTypeDef, Defined> = { | ||
[F in FieldsOfType<I>["name"]]: DecodeType< | ||
@@ -191,8 +191,2 @@ (FieldsOfType<I> & { name: F })["type"], | ||
type AnchorTypeDef<I extends IdlTypeDef, Defined> = I extends { | ||
type: IdlTypeDefTyStruct; | ||
} | ||
? AnchorTypeDefStruct<I, Defined> | ||
: string; | ||
type AnchorTypeDefs<T extends IdlTypeDef[], Defined> = { | ||
@@ -212,7 +206,6 @@ [K in T[number]["name"]]: AnchorTypeDef<T[number] & { name: K }, Defined>; | ||
export type AnchorState<T extends Idl, Defined> = NonNullable< | ||
T["state"] | ||
>["struct"] extends { type: IdlTypeDefTyStruct } | ||
? AnchorTypeDef<NonNullable<T["state"]>["struct"], Defined> | ||
: never; | ||
export type AnchorState<T extends Idl, Defined> = AnchorTypeDef< | ||
NonNullable<T["state"]>["struct"], | ||
Defined | ||
>; | ||
@@ -219,0 +212,0 @@ export type AnchorTypes< |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33573
399