Skip to content

Commit 85fe9f5

Browse files
committed
fix: usePyth hook
1 parent 6c1cbce commit 85fe9f5

File tree

1 file changed

+7
-6
lines changed
  • governance/xc_admin/packages/xc_admin_frontend/hooks

1 file changed

+7
-6
lines changed

governance/xc_admin/packages/xc_admin_frontend/hooks/usePyth.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { ClusterContext } from '../contexts/ClusterContext'
1010
import { deriveWsUrl, pythClusterApiUrls } from '../utils/pythClusterApiUrl'
1111
import {
1212
ProgramType,
13-
getConfigFromRawAccounts,
13+
getConfig,
1414
RawConfig,
1515
MappingRawConfig,
1616
ProductRawConfig,
@@ -57,10 +57,11 @@ export const usePyth = (): PythHookData => {
5757
if (cancelled) return
5858

5959
// Use the functional approach to parse the accounts
60-
const parsedConfig = getConfigFromRawAccounts[ProgramType.PYTH_CORE](
61-
allPythAccounts,
62-
cluster as PythCluster
63-
)
60+
const parsedConfig = getConfig[ProgramType.PYTH_CORE]({
61+
programType: ProgramType.PYTH_CORE,
62+
accounts: allPythAccounts,
63+
cluster: cluster as PythCluster,
64+
})
6465

6566
// Verify all accounts were processed
6667
const remainingAccounts = allPythAccounts.filter((account) => {
@@ -74,7 +75,7 @@ export const usePyth = (): PythHookData => {
7475
)
7576
}
7677

77-
setRawConfig(parsedConfig)
78+
setRawConfig(parsedConfig as RawConfig)
7879
setIsLoading(false)
7980
} catch (e) {
8081
if (cancelled) return

0 commit comments

Comments
 (0)