Skip to content

Commit

Permalink
fixing typescript errors (#741)
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev committed Feb 13, 2023
1 parent 13a5d73 commit e9635e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/types/transactions/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ export type TransactionBase =
* - A: Additional parameters on top of the base transaction parameters
* - O: A set of overwrites for transaction parameters
*/
export type ConstructTransaction<A = {}, O = {}> = DistributiveOverwrite<
TransactionBase & A,
O
>;
export type ConstructTransaction<
A = {},
O extends Partial<TransactionBase & A> = {}
> = DistributiveOverwrite<TransactionBase & A, O>;

/**
* Only accept transaction objects that include suggestedParams as an object
Expand Down
2 changes: 1 addition & 1 deletion src/types/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export type Overwrite<T, U extends Partial<T>> = Pick<
/**
* Same as Overwrite, but will distribute the Overwrite over unions
*/
export type DistributiveOverwrite<T, K> = T extends unknown
export type DistributiveOverwrite<T, K extends Partial<T>> = T extends unknown
? Overwrite<T, K>
: never;

Expand Down

0 comments on commit e9635e9

Please sign in to comment.