fallback openbook market if there is only one
This commit is contained in:
parent
74bffa9b4f
commit
5078b6b1ef
|
@ -232,6 +232,16 @@ export const getBestMarket = async ({
|
|||
if (!markets.length) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
if (markets.length === 1) {
|
||||
notify({
|
||||
title: 'Only one openbook market exists check it carefully',
|
||||
description: ``,
|
||||
type: 'error',
|
||||
})
|
||||
return markets[0].publicKey
|
||||
}
|
||||
|
||||
const marketsDataJsons = await Promise.all([
|
||||
...markets.map((x) =>
|
||||
fetch(`/openSerumApi/market/${x.publicKey.toBase58()}`),
|
||||
|
|
Loading…
Reference in New Issue