-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a test for testFindAccountsByMints
- Loading branch information
1 parent
887b9da
commit eb9c479
Showing
1 changed file
with
12 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |