{"size": 723, "ext": "js", "max_stars_repo_path": "scripts/list_on_market.js", "max_stars_repo_name": "parkdao/parkdao", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "scripts/list_on_market.js", "max_issues_repo_name": "parkdao/parkdao", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "scripts/list_on_market.js", "max_forks_repo_name": "parkdao/parkdao", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.1, "max_line_length": 64, "alphanum_fraction": 0.6099585062}
import * as utils from "./utils.js";
import * as constants from "./constants.js";
import Big from "big.js";
import { NFTS } from "./nfts.js";

const LIST_GAS = Big(45).times(10 ** 19);

async function list(token_id) {
  const { nft } = await utils.contracts();
  const extra = parseInt(token_id);
  const args = {
    price: 10 + extra * 2,
    exp: 0, // Date.now() + 10000, // in 10 seconds
  };
  const listed = await nft.nft_approve({
    amount: LIST_GAS.toFixed(),
    args: {
      token_id,
      account_id: constants.MARKET_ID, // approve for the market
      msg: JSON.stringify(args),
    },
  });
  console.log(listed);
}

for (let i = 0; i < NFTS.length; i++) {
  const nft = NFTS[i];
  await list(nft.id);
}
