mirror of
https://github.com/fdundjer/solana-sniper-bot.git
synced 2025-11-22 20:51:10 +10:00
tsc & prettier
This commit is contained in:
@ -1,22 +1,22 @@
|
||||
import { Commitment, Connection, PublicKey } from '@solana/web3.js';
|
||||
import { GetStructureSchema, MARKET_STATE_LAYOUT_V3, publicKey, struct } from '@raydium-io/raydium-sdk';
|
||||
import { Commitment, Connection, PublicKey } from "@solana/web3.js";
|
||||
import { GetStructureSchema, MARKET_STATE_LAYOUT_V3, publicKey, struct } from "@raydium-io/raydium-sdk";
|
||||
|
||||
export const MINIMAL_MARKET_STATE_LAYOUT_V3 = struct([publicKey('eventQueue'), publicKey('bids'), publicKey('asks')]);
|
||||
export const MINIMAL_MARKET_STATE_LAYOUT_V3 = struct([publicKey("eventQueue"), publicKey("bids"), publicKey("asks")]);
|
||||
export type MinimalMarketStateLayoutV3 = typeof MINIMAL_MARKET_STATE_LAYOUT_V3;
|
||||
export type MinimalMarketLayoutV3 = GetStructureSchema<MinimalMarketStateLayoutV3>;
|
||||
|
||||
export async function getMinimalMarketV3(
|
||||
connection: Connection,
|
||||
marketId: PublicKey,
|
||||
commitment?: Commitment,
|
||||
connection: Connection,
|
||||
marketId: PublicKey,
|
||||
commitment?: Commitment,
|
||||
): Promise<MinimalMarketLayoutV3> {
|
||||
const marketInfo = await connection.getAccountInfo(marketId, {
|
||||
commitment,
|
||||
dataSlice: {
|
||||
offset: MARKET_STATE_LAYOUT_V3.offsetOf('eventQueue'),
|
||||
length: 32 * 3,
|
||||
},
|
||||
});
|
||||
const marketInfo = await connection.getAccountInfo(marketId, {
|
||||
commitment,
|
||||
dataSlice: {
|
||||
offset: MARKET_STATE_LAYOUT_V3.offsetOf("eventQueue"),
|
||||
length: 32 * 3,
|
||||
},
|
||||
});
|
||||
|
||||
return MINIMAL_MARKET_STATE_LAYOUT_V3.decode(marketInfo!.data);
|
||||
return MINIMAL_MARKET_STATE_LAYOUT_V3.decode(marketInfo!.data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user