list-market.js 618 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env node
  2. // Script to list a market, logging the address to stdout.
  3. const utils = require("../tests/utils");
  4. const fs = require("fs");
  5. const anchor = require("@coral-xyz/anchor");
  6. const provider = anchor.AnchorProvider.local();
  7. // hack so we don't have to update serum-common library
  8. // to the new AnchorProvider class and Provider interface
  9. provider.send = provider.sendAndConfirm;
  10. async function main() {
  11. ORDERBOOK_ENV = await utils.initMarket({
  12. provider,
  13. });
  14. const out = {
  15. market: ORDERBOOK_ENV.marketA._decoded.ownAddress.toString(),
  16. };
  17. console.log(JSON.stringify(out));
  18. }
  19. main();