Skip to content

Commit

Permalink
fix(client-utils): query-all-chians
Browse files Browse the repository at this point in the history
  • Loading branch information
javadkh2 committed May 31, 2024
1 parent 2c4fb02 commit 452ed4f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
5 changes: 4 additions & 1 deletion packages/libs/client-utils/src/core/query-all-chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ export const queryAllChains =
command,
setMeta({ chainId }),
);
return query<T>({ host }, client)(emit)(chainCommand);
return query<T>(
{ host, defaults: { meta: { chainId } } },
client,
)(emit)(chainCommand);
}),
);
},
Expand Down
19 changes: 10 additions & 9 deletions packages/libs/client-utils/src/core/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,26 @@ export type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
export type First<T extends Any[]> = T extends [infer One]
? One
: T extends [infer HD, ...Any[]]
? HD
: never;
? HD
: never;

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export type Tail<T extends Any[]> = T extends [infer _]
? []
: // eslint-disable-next-line @typescript-eslint/no-unused-vars
T extends [infer _, ...infer TL]
? TL
: never;
T extends [infer _, ...infer TL]
? TL
: never;

export type Prettify<T> = {
[K in keyof T]: T[K];
} & {};

export type Assert<T, U> =
(<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2
? true
: { error: 'Types are not equal'; received: T; expected: U };
export type Assert<T, U> = (<V>() => V extends T ? 1 : 2) extends <
V,
>() => V extends U ? 1 : 2
? true
: { error: 'Types are not equal'; received: T; expected: U };

export type UnionToIntersection<T> = (
T extends unknown ? (k: T) => void : never
Expand Down

0 comments on commit 452ed4f

Please sign in to comment.