Skip to content

Commit e86cce1

Browse files
committed
Merge remote-tracking branch 'origin/main' into altendky-patch-1
2 parents 1675cd3 + 4c429af commit e86cce1

File tree

253 files changed

+605
-602
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

253 files changed

+605
-602
lines changed

package-lock.json

+11-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"lerna-audit": "^1.3.3",
6565
"lint-staged": "14.0.1",
6666
"nyc": "15.1.0",
67-
"prettier": "2.8.8",
67+
"prettier": "3.1.0",
6868
"typescript": "^5.1.6"
6969
},
7070
"version": "1.2.10-dev132"
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
type MethodFirstParameter<
22
TClass extends new (...args: any) => any,
3-
Method extends keyof InstanceType<TClass> & string
3+
Method extends keyof InstanceType<TClass> & string,
44
> = Parameters<InstanceType<TClass>[Method]>[0];
55

66
export default MethodFirstParameter;
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
type MethodReturnType<
22
TClass extends new (...args: any) => any,
3-
Method extends keyof InstanceType<TClass> & string
3+
Method extends keyof InstanceType<TClass> & string,
44
> = Awaited<ReturnType<InstanceType<TClass>[Method]>>;
55

66
export default MethodReturnType;

packages/api-react/src/chiaLazyBaseQuery.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const instances = new Map<ServiceConstructor, InstanceType<ServiceConstructor>>(
77

88
async function getInstance<TService extends ServiceConstructor>(
99
service: TService,
10-
api: any
10+
api: any,
1111
): Promise<InstanceType<TService>> {
1212
if (!instances.has(service)) {
1313
if (service.isClient) {
@@ -40,7 +40,7 @@ const chiaLazyBaseQuery = async <
4040
TService extends ServiceConstructor,
4141
TMethod extends keyof InstanceType<TService> & string,
4242
// TParameter extends Parameters<InstanceType<TService>[TMethod]>[0],
43-
TResult extends ReturnType<InstanceType<TService>[TMethod]>
43+
TResult extends ReturnType<InstanceType<TService>[TMethod]>,
4444
>(
4545
options: {
4646
service: TService;
@@ -49,7 +49,7 @@ const chiaLazyBaseQuery = async <
4949
args?: any;
5050
mockResponse?: any;
5151
},
52-
api: any
52+
api: any,
5353
) => {
5454
const { service, command, args = [], mockResponse } = options;
5555

packages/api-react/src/hooks/useCurrentFingerprintSettings.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import { type Serializable } from './usePrefs';
55

66
export default function useCurrentFingerprintSettings<Type extends Serializable>(
77
key: string,
8-
defaultValue?: Type
8+
defaultValue?: Type,
99
): [
1010
Type | undefined,
1111
(value: Type | ((prevValue: Type) => Type)) => void,
1212
{
1313
fingerprint: number | undefined;
1414
isLoading: boolean;
1515
error?: Error;
16-
}
16+
},
1717
] {
1818
const { data: fingerprint, isLoading, error } = useGetLoggedInFingerprintQuery();
1919
const [data, setData] = useFingerprintSettings<Type>(fingerprint, key, defaultValue);

packages/api-react/src/hooks/useFingerprintSettings.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import usePrefs, { type Serializable } from './usePrefs';
55
export default function useFingerprintSettings<Type extends Serializable>(
66
fingerprint: number | undefined,
77
key: string,
8-
defaultValue?: Type
8+
defaultValue?: Type,
99
): [Type | undefined, (value: Type | ((preValue: Type) => Type)) => void] {
1010
type LocalStorageType = Record<string, Record<string, Serializable>>;
1111
const [settings, setSettings] = usePrefs<LocalStorageType>('fingerprintSettings', {});
@@ -40,7 +40,7 @@ export default function useFingerprintSettings<Type extends Serializable>(
4040
};
4141
});
4242
},
43-
[key, setSettings, fingerprint]
43+
[key, setSettings, fingerprint],
4444
);
4545

4646
if (!fingerprint) {

packages/api-react/src/hooks/useGetHarvesterQuery.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function useGetHarvesterQuery({ nodeId }: { nodeId: string }) {
77

88
const harvester = useMemo(
99
() => data?.find((harvesterItem) => harvesterItem.connection.nodeId === nodeId),
10-
[data, nodeId]
10+
[data, nodeId],
1111
);
1212

1313
const isLoading = isLoadingHarvesterSummary;

packages/api-react/src/hooks/useGetHarvesterStats.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function useGetHarvesterStats(nodeId: string) {
77

88
const harvester = useMemo(
99
() => data?.find((harvesterItem) => harvesterItem.connection.nodeId === nodeId),
10-
[data, nodeId]
10+
[data, nodeId],
1111
);
1212

1313
return {

packages/api-react/src/hooks/useGetLatestBlocksQuery.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function useGetLatestBlocksQuery(count = 10) {
1414
},
1515
{
1616
skip: !peakHeight,
17-
}
17+
},
1818
);
1919

2020
const isLoading = isLoadingBlockchainState || isLoadingBlocks;

packages/api-react/src/hooks/useGetLatestPeakTimestampQuery.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function useGetLatestPeakTimestampQuery() {
3434

3535
const newPeakTimestamp = useMemo(
3636
() => getLatestTimestamp(blocks, latestPeakTimestamp.current),
37-
[blocks, latestPeakTimestamp]
37+
[blocks, latestPeakTimestamp],
3838
);
3939

4040
latestPeakTimestamp.current = newPeakTimestamp;

packages/api-react/src/hooks/useLocalStorage.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function getValueFromLocalStorage<T>(key: string): T | undefined {
2424

2525
export default function useLocalStorage<T extends keyof (string | undefined)>(
2626
key: string,
27-
defaultValue?: T
27+
defaultValue?: T,
2828
): [T | undefined, (value: T | ((value: T | undefined) => T)) => void] {
2929
const [storedValue, setStoredValue] = useState<T | undefined>(getValueFromLocalStorage(key));
3030
const defaultValueRef = useRef(defaultValue);
@@ -57,7 +57,7 @@ export default function useLocalStorage<T extends keyof (string | undefined)>(
5757
return newValue;
5858
});
5959
},
60-
[key]
60+
[key],
6161
);
6262

6363
const changeHandler = useCallback(
@@ -67,7 +67,7 @@ export default function useLocalStorage<T extends keyof (string | undefined)>(
6767
setStoredValue(newValue);
6868
}
6969
},
70-
[key]
70+
[key],
7171
);
7272

7373
// Listen changes

packages/api-react/src/hooks/usePrefs.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function isEqual(a: Serializable, b: Serializable) {
3434

3535
export default function usePrefs<T extends Serializable>(
3636
key: string,
37-
defaultValue: T
37+
defaultValue: T,
3838
): [T, (value: T | ((value: T) => T)) => void] {
3939
const [value, setValue] = useState<T>(getPreferences(key));
4040
const valueRef = useRef(value);
@@ -65,7 +65,7 @@ export default function usePrefs<T extends Serializable>(
6565
// notify other hooks
6666
eventEmitter.emit('prefs', { key, newValue });
6767
},
68-
[key]
68+
[key],
6969
);
7070

7171
const handleOnChange = useCallback(
@@ -74,7 +74,7 @@ export default function usePrefs<T extends Serializable>(
7474
setValue(e.newValue);
7575
}
7676
},
77-
[key]
77+
[key],
7878
);
7979

8080
// The reason to use EventEmitter for updating prefs state:

packages/api-react/src/hooks/useService.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type Options = {
1818

1919
export default function useService(
2020
service: ServiceNameValue,
21-
options: Options = {}
21+
options: Options = {},
2222
): {
2323
isLoading: boolean;
2424
isRunning: boolean;

packages/api-react/src/hooks/useServices.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function getServiceOptions(service: ServiceNameValue, services: ServiceNameValue
4343

4444
export default function useMonitorServices(
4545
services: ServiceNameValue[],
46-
options: Options = {}
46+
options: Options = {},
4747
): {
4848
isLoading: boolean;
4949
error?: Error | unknown;
@@ -67,7 +67,7 @@ export default function useMonitorServices(
6767

6868
const introducerState = useService(
6969
ServiceName.INTRODUCER,
70-
getServiceOptions(ServiceName.INTRODUCER, services, options)
70+
getServiceOptions(ServiceName.INTRODUCER, services, options),
7171
);
7272

7373
const datalayerState = useService(ServiceName.DATALAYER, getServiceOptions(ServiceName.DATALAYER, services, options));

packages/api-react/src/hooks/useSubscribeToEvent.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function subscribe(event: string, service: ServiceConstructor, cb: Function) {
1111
service,
1212
args: [cb],
1313
},
14-
api
14+
api,
1515
);
1616

1717
return unsubscribe;

packages/api-react/src/hooks/useThrottleQuery.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function useThrottleQuery(
1313
wait?: number;
1414
leading?: boolean;
1515
trailing?: boolean;
16-
} = {}
16+
} = {},
1717
) {
1818
const { leading = true, trailing = true, wait = 0 } = throttleOptions;
1919

@@ -30,7 +30,7 @@ export default function useThrottleQuery(
3030
leading,
3131
trailing,
3232
}),
33-
[wait, leading, trailing, forceUpdate]
33+
[wait, leading, trailing, forceUpdate],
3434
);
3535

3636
queryHook(variables, {

packages/api-react/src/services/client.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const clientApi = apiWithTag.injectEndpoints({
3030
},
3131
],
3232
},
33-
apiLocal
33+
apiLocal,
3434
);
3535

3636
unsubscribe = response.data;

packages/api-react/src/services/daemon.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const daemonApi = apiWithTag.injectEndpoints({
2929
providesTags: (keys) =>
3030
keys
3131
? [
32-
...keys.map((key) => ({ type: 'DaemonKey', id: key.fingerprint } as const)),
32+
...keys.map((key) => ({ type: 'DaemonKey', id: key.fingerprint }) as const),
3333
{ type: 'DaemonKey', id: 'LIST' },
3434
]
3535
: [{ type: 'DaemonKey', id: 'LIST' }],
@@ -44,7 +44,7 @@ export const daemonApi = apiWithTag.injectEndpoints({
4444
walletAddresses[fingerprint].map((address) => ({
4545
type: 'WalletAddress',
4646
id: `${fingerprint}:${address.hdPath}`,
47-
}))
47+
})),
4848
),
4949
{ type: 'WalletAddress', id: 'LIST' },
5050
]

packages/api-react/src/services/farmer.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export const farmerApi = apiWithTag.injectEndpoints({
8787
providesTags: (plots) =>
8888
plots
8989
? [
90-
...plots.map(({ plotId }) => ({ type: 'HarvesterPlots', plotId } as const)),
90+
...plots.map(({ plotId }) => ({ type: 'HarvesterPlots', plotId }) as const),
9191
{ type: 'HarvesterPlots', id: 'LIST' },
9292
]
9393
: [{ type: 'HarvesterPlots', id: 'LIST' }],
@@ -106,7 +106,7 @@ export const farmerApi = apiWithTag.injectEndpoints({
106106
providesTags: (plots) =>
107107
plots
108108
? [
109-
...plots.map((filename) => ({ type: 'HarvesterPlotsInvalid', filename } as const)),
109+
...plots.map((filename) => ({ type: 'HarvesterPlotsInvalid', filename }) as const),
110110
{ type: 'HarvesterPlotsInvalid', id: 'LIST' },
111111
]
112112
: [{ type: 'HarvesterPlotsInvalid', id: 'LIST' }],
@@ -125,7 +125,7 @@ export const farmerApi = apiWithTag.injectEndpoints({
125125
providesTags: (plots) =>
126126
plots
127127
? [
128-
...plots.map((filename) => ({ type: 'HarvesterPlotsKeysMissing', filename } as const)),
128+
...plots.map((filename) => ({ type: 'HarvesterPlotsKeysMissing', filename }) as const),
129129
{ type: 'HarvesterPlotsKeysMissing', id: 'LIST' },
130130
]
131131
: [{ type: 'HarvesterPlotsKeysMissing', id: 'LIST' }],
@@ -144,7 +144,7 @@ export const farmerApi = apiWithTag.injectEndpoints({
144144
providesTags: (plots) =>
145145
plots
146146
? [
147-
...plots.map((filename) => ({ type: 'HarvesterPlotsDuplicates', filename } as const)),
147+
...plots.map((filename) => ({ type: 'HarvesterPlotsDuplicates', filename }) as const),
148148
{ type: 'HarvesterPlotsDuplicates', id: 'LIST' },
149149
]
150150
: [{ type: 'HarvesterPlotsDuplicates', id: 'LIST' }],
@@ -171,7 +171,7 @@ export const farmerApi = apiWithTag.injectEndpoints({
171171
providesTags: (connections) =>
172172
connections
173173
? [
174-
...connections.map(({ nodeId }) => ({ type: 'FarmerConnections', id: nodeId } as const)),
174+
...connections.map(({ nodeId }) => ({ type: 'FarmerConnections', id: nodeId }) as const),
175175
{ type: 'FarmerConnections', id: 'LIST' },
176176
]
177177
: [{ type: 'FarmerConnections', id: 'LIST' }],
@@ -212,7 +212,7 @@ export const farmerApi = apiWithTag.injectEndpoints({
212212
providesTags: (signagePoints) =>
213213
signagePoints
214214
? [
215-
...signagePoints.map(({ challengeHash }) => ({ type: 'SignagePoints', id: challengeHash } as const)),
215+
...signagePoints.map(({ challengeHash }) => ({ type: 'SignagePoints', id: challengeHash }) as const),
216216
{ type: 'SignagePoints', id: 'LIST' },
217217
]
218218
: [{ type: 'SignagePoints', id: 'LIST' }],
@@ -235,7 +235,7 @@ export const farmerApi = apiWithTag.injectEndpoints({
235235
providesTags: (poolsList) =>
236236
poolsList
237237
? [
238-
...poolsList.map(({ p2SingletonPuzzleHash }) => ({ type: 'Pools', id: p2SingletonPuzzleHash } as const)),
238+
...poolsList.map(({ p2SingletonPuzzleHash }) => ({ type: 'Pools', id: p2SingletonPuzzleHash }) as const),
239239
{ type: 'Pools', id: 'LIST' },
240240
]
241241
: [{ type: 'Pools', id: 'LIST' }],

packages/api-react/src/services/fullNode.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export const fullNodeApi = apiWithTag.injectEndpoints({
101101
providesTags: (connections) =>
102102
connections
103103
? [
104-
...connections.map(({ nodeId }) => ({ type: 'FullNodeConnections', id: nodeId } as const)),
104+
...connections.map(({ nodeId }) => ({ type: 'FullNodeConnections', id: nodeId }) as const),
105105
{ type: 'FullNodeConnections', id: 'LIST' },
106106
]
107107
: [{ type: 'FullNodeConnections', id: 'LIST' }],

packages/api-react/src/services/harvester.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const harvesterApi = apiWithTag2.injectEndpoints({
5555
providesTags: (directories) =>
5656
directories
5757
? [
58-
...directories.map((directory) => ({ type: 'PlotDirectories', id: directory } as const)),
58+
...directories.map((directory) => ({ type: 'PlotDirectories', id: directory }) as const),
5959
{ type: 'PlotDirectories', id: 'LIST' },
6060
]
6161
: [{ type: 'PlotDirectories', id: 'LIST' }],

0 commit comments

Comments
 (0)