File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
packages/sdk-redux/src/reduxSlices/transactionTrackerSlice Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { ThunkDispatch } from '@reduxjs/toolkit' ;
2
- import { ethers , Transaction } from 'ethers' ;
2
+ import { providers } from 'ethers' ;
3
3
4
4
import { initiateNewTransactionTrackingThunk } from './thunks/initiateNewTransactionTrackingThunk' ;
5
5
import { TransactionTitle } from './transactionTitle' ;
6
6
7
7
/**
8
8
* A simpler TransactionResponse type, similar to wagmi's SendTransactionResult,
9
9
*/
10
- export type NewTransactionResponse = Pick < ethers . providers . TransactionResponse , 'hash' | 'wait' > & Transaction ;
10
+ export type NewTransactionResponse = Flatten <
11
+ Pick < providers . TransactionResponse , 'hash' | 'wait' > & Partial < providers . TransactionResponse >
12
+ > ;
11
13
12
14
export interface RegisterNewTransactionArg {
13
15
/**
@@ -57,3 +59,8 @@ export const registerNewTransactionAndReturnQueryFnResult = async (arg: Register
57
59
} ,
58
60
} ;
59
61
} ;
62
+
63
+ // Prefer flattened/spread syntax for IDE-s. Example: `A: { hash: string } vs B: Pick<TransactionResponse, "hash">`. A is the flattened syntax.
64
+ type Flatten < T > = {
65
+ [ K in keyof T ] : T [ K ] ;
66
+ } ;
You can’t perform that action at this time.
0 commit comments