Use latest client with 'api' source id for group loading

This commit is contained in:
tjs 2023-09-05 11:05:29 -04:00
parent aa4ce4d085
commit 690c14156b
4 changed files with 9 additions and 16 deletions

View File

@ -58,7 +58,7 @@ const HydrateStore = () => {
() => {
actions.fetchGroup()
},
(slowNetwork ? 40 : 20) * SECONDS,
(slowNetwork ? 60 : 30) * SECONDS,
)
// refetches open orders every 30 seconds

View File

@ -22,7 +22,7 @@
},
"dependencies": {
"@blockworks-foundation/mango-feeds": "0.1.7",
"@blockworks-foundation/mango-v4": "^0.19.9",
"@blockworks-foundation/mango-v4": "^0.19.13",
"@blockworks-foundation/mango-v4-settings": "0.2.6",
"@headlessui/react": "1.6.6",
"@heroicons/react": "2.0.10",

View File

@ -118,7 +118,7 @@ const initMangoClient = (
): MangoClient => {
return MangoClient.connect(provider, CLUSTER, MANGO_V4_ID[CLUSTER], {
prioritizationFee: opts.prioritizationFee,
idsSource: 'get-program-accounts',
idsSource: 'api',
postSendTxCallback: ({ txid }: { txid: string }) => {
notify({
title: 'Transaction sent',
@ -130,7 +130,6 @@ const initMangoClient = (
})
}
let mangoGroupRetryAttempt = 0
export const DEFAULT_TRADE_FORM: TradeForm = {
side: 'buy',
price: undefined,
@ -581,15 +580,9 @@ const mangoStore = create<MangoStore>()(
)
}
})
mangoGroupRetryAttempt = 0
} catch (e) {
if (mangoGroupRetryAttempt < 2) {
// get().actions.fetchGroup()
mangoGroupRetryAttempt++
} else {
notify({ type: 'info', title: 'Unable to refresh data' })
console.error('Error fetching group', e)
}
notify({ type: 'info', title: 'Unable to refresh data' })
console.error('Error fetching group', e)
}
},
reloadMangoAccount: async (confirmationSlot) => {

View File

@ -34,10 +34,10 @@
bn.js "^5.2.1"
eslint-config-prettier "^9.0.0"
"@blockworks-foundation/mango-v4@^0.19.9":
version "0.19.9"
resolved "https://registry.yarnpkg.com/@blockworks-foundation/mango-v4/-/mango-v4-0.19.9.tgz#bd4bc770237f1dbdd234e6fe0289670dc2df1a06"
integrity sha512-p8ZdSNHNVS8sNFWX4UwRYTfxN2s9zT/pVlMQODVbn1iAbXazF9qwoWRYDQB22NZ8ST++YYHgqlCgediQoyCgiw==
"@blockworks-foundation/mango-v4@^0.19.13":
version "0.19.13"
resolved "https://registry.yarnpkg.com/@blockworks-foundation/mango-v4/-/mango-v4-0.19.13.tgz#9bfbdacb2f11edf7fbd4d2e15347b793a7ee48bd"
integrity sha512-kNijRYbTAS7V19R50MLTvZCWpRqjgmtL9c7PA1vNF/BmfLTo3e8pDtx44ER8PkPIX6Mjet56iHf81bk7Yyjr/Q==
dependencies:
"@coral-xyz/anchor" "^0.27.0"
"@project-serum/serum" "0.13.65"