@cks-systems/manifest-sdk
Version:
TypeScript SDK for Manifest
23 lines (22 loc) • 893 B
JavaScript
import { Connection, Keypair } from '@solana/web3.js';
import { ManifestClient } from '../src/client';
import { Market } from '../src/market';
import { assert } from 'chai';
import { createMarket } from './createMarket';
async function testListMarket() {
const connection = new Connection('http://127.0.0.1:8899', 'confirmed');
const payerKeypair = Keypair.generate();
const marketAddress = await createMarket(connection, payerKeypair);
const market = await Market.loadFromAddress({
connection,
address: marketAddress,
});
const marketPks = await ManifestClient.listMarketsForMints(connection, market.baseMint(), market.quoteMint());
assert(marketPks.length == 1);
assert(marketPks[0].toBase58() == marketAddress.toBase58());
}
describe('List Market test', () => {
it('List Market', async () => {
await testListMarket();
});
});