parent
b2cae745c8
commit
8a6e0e6e4b
|
@ -11,7 +11,6 @@ import {
|
||||||
getMultisigCluster,
|
getMultisigCluster,
|
||||||
isRemoteCluster,
|
isRemoteCluster,
|
||||||
mapKey,
|
mapKey,
|
||||||
OPS_KEY,
|
|
||||||
proposeInstructions,
|
proposeInstructions,
|
||||||
WORMHOLE_ADDRESS,
|
WORMHOLE_ADDRESS,
|
||||||
} from 'xc_admin_common'
|
} from 'xc_admin_common'
|
||||||
|
@ -414,29 +413,6 @@ const General = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const AddressChangesRow = ({ changes }: { changes: any }) => {
|
|
||||||
const key = 'address'
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{changes.prev !== changes.new && (
|
|
||||||
<tr key={key}>
|
|
||||||
<td className="base16 py-4 pl-6 pr-2 lg:pl-6">
|
|
||||||
{key
|
|
||||||
.split('_')
|
|
||||||
.map((word) => capitalizeFirstLetter(word))
|
|
||||||
.join(' ')}
|
|
||||||
</td>
|
|
||||||
<td className="base16 py-4 pl-1 pr-2 lg:pl-6">
|
|
||||||
<s>{changes.prev}</s>
|
|
||||||
<br />
|
|
||||||
{changes.new}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const MetadataChangesRows = ({ changes }: { changes: any }) => {
|
const MetadataChangesRows = ({ changes }: { changes: any }) => {
|
||||||
const addNewPriceFeed =
|
const addNewPriceFeed =
|
||||||
changes.prev === undefined && changes.new !== undefined
|
changes.prev === undefined && changes.new !== undefined
|
||||||
|
@ -571,20 +547,14 @@ const General = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const NewPriceFeedsRows = ({ priceFeedData }: { priceFeedData: any }) => {
|
const NewPriceFeedsRows = ({ priceFeedData }: { priceFeedData: any }) => {
|
||||||
const key =
|
|
||||||
priceFeedData.metadata.asset_type +
|
|
||||||
'.' +
|
|
||||||
priceFeedData.metadata.base +
|
|
||||||
'/' +
|
|
||||||
priceFeedData.metadata.quote_currency
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<MetadataChangesRows
|
<MetadataChangesRows
|
||||||
key={key + 'metadata'}
|
key={priceFeedData.key + 'metadata'}
|
||||||
changes={{ new: priceFeedData.metadata }}
|
changes={{ new: priceFeedData.metadata }}
|
||||||
/>
|
/>
|
||||||
<PriceAccountsChangesRows
|
<PriceAccountsChangesRows
|
||||||
key={key + 'priceAccounts'}
|
key={priceFeedData.key + 'priceAccounts'}
|
||||||
changes={{ new: priceFeedData.priceAccounts }}
|
changes={{ new: priceFeedData.priceAccounts }}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
@ -621,12 +591,7 @@ const General = () => {
|
||||||
<NewPriceFeedsRows key={key} priceFeedData={newChanges} />
|
<NewPriceFeedsRows key={key} priceFeedData={newChanges} />
|
||||||
) : (
|
) : (
|
||||||
diff.map((k) =>
|
diff.map((k) =>
|
||||||
k === 'address' ? (
|
k === 'metadata' ? (
|
||||||
<AddressChangesRow
|
|
||||||
key={k}
|
|
||||||
changes={{ prev: prev[k], new: newChanges[k] }}
|
|
||||||
/>
|
|
||||||
) : k === 'metadata' ? (
|
|
||||||
<MetadataChangesRows
|
<MetadataChangesRows
|
||||||
key={k}
|
key={k}
|
||||||
changes={{ prev: prev[k], new: newChanges[k] }}
|
changes={{ prev: prev[k], new: newChanges[k] }}
|
||||||
|
|
|
@ -114,7 +114,7 @@ const usePyth = (): PythHookData => {
|
||||||
case AccountType.Product:
|
case AccountType.Product:
|
||||||
const parsed = parseProductData(allPythAccounts[i].account.data)
|
const parsed = parseProductData(allPythAccounts[i].account.data)
|
||||||
|
|
||||||
if (parsed.priceAccountKey?.toBase58() == ONES) {
|
if (!parsed.priceAccountKey) {
|
||||||
productRawConfigs[allPythAccounts[i].pubkey.toBase58()] = {
|
productRawConfigs[allPythAccounts[i].pubkey.toBase58()] = {
|
||||||
priceAccounts: [],
|
priceAccounts: [],
|
||||||
metadata: parsed.product,
|
metadata: parsed.product,
|
||||||
|
@ -122,7 +122,7 @@ const usePyth = (): PythHookData => {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let priceAccountKey: string | undefined =
|
let priceAccountKey: string | undefined =
|
||||||
parsed.priceAccountKey?.toBase58()
|
parsed.priceAccountKey.toBase58()
|
||||||
let priceAccounts = []
|
let priceAccounts = []
|
||||||
while (priceAccountKey) {
|
while (priceAccountKey) {
|
||||||
const toAdd: PriceRawConfig = priceRawConfigs[priceAccountKey]
|
const toAdd: PriceRawConfig = priceRawConfigs[priceAccountKey]
|
||||||
|
|
Loading…
Reference in New Issue