simple json stuff
This commit is contained in:
parent
054cc5c82e
commit
dcbb37fbb7
|
@ -38,7 +38,7 @@ const MarketSelect = () => {
|
|||
</div>
|
||||
))}
|
||||
|
||||
{groupConfig.spot_markets.map((s) => (
|
||||
{groupConfig.spotMarkets.map((s) => (
|
||||
<div
|
||||
className={`border-r border-th-fgd-4 cursor-pointer default-transition flex font-semibold px-4 text-xs hover:text-th-primary
|
||||
${
|
||||
|
|
|
@ -68,7 +68,7 @@ const NewAccount: FunctionComponent<NewAccountProps> = ({
|
|||
|
||||
initMarginAccountAndDeposit(
|
||||
connection,
|
||||
groupConfig.merps_program_id,
|
||||
groupConfig.merpsProgramId,
|
||||
mangoGroup,
|
||||
wallet,
|
||||
selectedAccount.account.mint,
|
||||
|
|
|
@ -40,7 +40,7 @@ const useHydrateStore = () => {
|
|||
connection,
|
||||
marketConfig.key,
|
||||
{},
|
||||
groupConfig.serum_program_id
|
||||
groupConfig.serumProgramId
|
||||
)
|
||||
.then(async (market) => {
|
||||
const bidAccount = market['_decoded'].bids
|
||||
|
|
|
@ -27,7 +27,7 @@ export function useOpenOrders() {
|
|||
const marketIndex = mangoGroup.getSpotMarketIndex(new PublicKey(address))
|
||||
const openOrdersAccount = marginAccount.spotOpenOrdersAccounts[marketIndex]
|
||||
|
||||
const marketName = mangoGroupConfig.spot_markets.find(
|
||||
const marketName = mangoGroupConfig.spotMarkets.find(
|
||||
(mkt) => mkt.key.toString() === address
|
||||
).name
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ export const WEBSOCKET_CONNECTION = new Connection(
|
|||
'processed' as Commitment
|
||||
)
|
||||
|
||||
const DEFAULT_MANGO_GROUP_NAME = 'merps_test_v2'
|
||||
const DEFAULT_MANGO_GROUP_NAME = 'merps_test_v2.1'
|
||||
const DEFAULT_MANGO_GROUP_CONFIG = Config.ids().getGroup(
|
||||
CLUSTER,
|
||||
DEFAULT_MANGO_GROUP_NAME
|
||||
|
@ -75,11 +75,11 @@ const defaultMangoGroupIds = IDS['groups'].find(
|
|||
(group) => group.name === DEFAULT_MANGO_GROUP_NAME
|
||||
)
|
||||
|
||||
export const programId = new PublicKey(defaultMangoGroupIds.merps_program_id)
|
||||
export const programId = new PublicKey(defaultMangoGroupIds.merpsProgramId)
|
||||
export const serumProgramId = new PublicKey(
|
||||
defaultMangoGroupIds.serum_program_id
|
||||
defaultMangoGroupIds.serumProgramId
|
||||
)
|
||||
const merpsGroupPk = new PublicKey(defaultMangoGroupIds.key)
|
||||
const merpsGroupPk = new PublicKey(defaultMangoGroupIds.publicKey)
|
||||
|
||||
export const mangoClient = new MangoClient(DEFAULT_CONNECTION, programId)
|
||||
|
||||
|
@ -321,7 +321,7 @@ const useMangoStore = create<MangoStore>((set, get) => ({
|
|||
|
||||
const spotMarketAccountInfos = await getMultipleAccounts(
|
||||
DEFAULT_CONNECTION,
|
||||
mangoGroupConfig.spot_markets.map((mkt) => mkt.key)
|
||||
mangoGroupConfig.spotMarkets.map((mkt) => mkt.publicKey)
|
||||
)
|
||||
const spotOrderBookAccountInfos = await getOrderBookAccountInfos(
|
||||
mangoGroup.dexProgramId,
|
||||
|
@ -338,7 +338,7 @@ const useMangoStore = create<MangoStore>((set, get) => ({
|
|||
state.selectedMangoGroup.cache = merpsCache
|
||||
state.selectedMangoGroup.markets = spotMarkets
|
||||
state.selectedMarket.current =
|
||||
spotMarkets[selectedMarketConfig.key.toString()]
|
||||
spotMarkets[selectedMarketConfig.publicKey.toString()]
|
||||
|
||||
spotMarketAccountInfos
|
||||
.concat(spotOrderBookAccountInfos)
|
||||
|
|
|
@ -237,7 +237,7 @@ export async function decodeAndLoadMarkets(
|
|||
for (let i = 0; i < marketAccountInfos.length; i++) {
|
||||
const { publicKey, accountInfo } = marketAccountInfos[i]
|
||||
const decodedAcc = await Market.getLayout(
|
||||
groupConfig.serum_program_id
|
||||
groupConfig.serumProgramId
|
||||
).decode(accountInfo.data)
|
||||
|
||||
console.log('decoded accs===', decodedAcc)
|
||||
|
@ -255,7 +255,7 @@ export async function decodeAndLoadMarkets(
|
|||
baseMintDecimals,
|
||||
quoteMintDecimals,
|
||||
{},
|
||||
groupConfig.serum_program_id
|
||||
groupConfig.serumProgramId
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -988,7 +988,7 @@
|
|||
|
||||
"@blockworks-foundation/mango-client@git+ssh://git@github.com/blockworks-foundation/merps-ts#main":
|
||||
version "0.0.0"
|
||||
resolved "git+ssh://git@github.com/blockworks-foundation/merps-ts#a7c3e823fd6cdb656b6dced813fe1424a86af1d6"
|
||||
resolved "git+ssh://git@github.com/blockworks-foundation/merps-ts#c83f4bc50ec0c7f535320936297ca902a5df1488"
|
||||
dependencies:
|
||||
"@project-serum/serum" "^0.13.38"
|
||||
"@project-serum/sol-wallet-adapter" "^0.2.0"
|
||||
|
|
Loading…
Reference in New Issue