Skip to content

Commit

Permalink
add a test for testFindAccountsByMints
Browse files Browse the repository at this point in the history
  • Loading branch information
mschneider committed Feb 17, 2024
1 parent 887b9da commit eb9c479
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions ts/client/src/test/market.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
import { OPENBOOK_PROGRAM_ID, findAllMarkets, initReadOnlyOpenbookClient } from "..";
import { PublicKey } from "@solana/web3.js";
import { OPENBOOK_PROGRAM_ID, findAccountsByMints, findAllMarkets, initReadOnlyOpenbookClient } from "..";

async function testListAll(): Promise<void> {

async function testFindAccountsByMints(): Promise<void> {
const client = initReadOnlyOpenbookClient(process.env.SOL_RPC_URL as any);
const accounts = await findAccountsByMints(client.connection, new PublicKey("So11111111111111111111111111111111111111112"), new PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"), OPENBOOK_PROGRAM_ID);
console.log(accounts.map(a => a.publicKey.toBase58()));
}

async function testFindAllMarkets(): Promise<void> {
const client = initReadOnlyOpenbookClient(process.env.SOL_RPC_URL as any);
const markets = await findAllMarkets(client.connection, OPENBOOK_PROGRAM_ID, client.provider);
console.log('markets', markets);
}

void testListAll();
void testFindAccountsByMints();
void testFindAllMarkets();

0 comments on commit eb9c479

Please sign in to comment.