ts: Add bool, u128, i128 for idl types (#1042)

This commit is contained in:
Armani Ferrante 2021-11-19 15:14:43 +00:00 committed by GitHub
parent 9bee113fa4
commit c868b91e93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -81,11 +81,13 @@ export type InstructionContextFnArgs<
type TypeMap = { type TypeMap = {
publicKey: PublicKey; publicKey: PublicKey;
u64: BN; bool: boolean;
i64: BN;
} & { } & {
[K in "u8" | "i8" | "u16" | "i16" | "u32" | "i32"]: number; [K in "u8" | "i8" | "u16" | "i16" | "u32" | "i32"]: number;
}; } &
{
[K in "u64" | "i64" | "u128" | "i128"]: BN;
};
export type DecodeType<T extends IdlType, Defined> = T extends keyof TypeMap export type DecodeType<T extends IdlType, Defined> = T extends keyof TypeMap
? TypeMap[T] ? TypeMap[T]