UNPKG

axie-ronin-ethers-js-tools

Version:

A set of functions that make it easier for developers to interact with their Axies on the Ronin network and the maketplace.

22 lines (21 loc) 916 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = unlistAllAxies; const axie_1 = require("../lib/axie"); const unlist_axie_1 = __importDefault(require("./unlist-axie")); async function unlistAllAxies(taskArgs, hre) { // get address const accounts = await hre.ethers.getSigners(); const signer = accounts[0]; const address = signer.address.toLowerCase(); console.log(`Unlisting all axies of ${address.replace('0x', 'ronin:')}`); // get axie ids from the account const axieIds = await (0, axie_1.getAxieIdsFromAccount)(address, hre.ethers.provider); for (let i = 0; i < axieIds.length; i++) { const axie = axieIds[i].toString(); await (0, unlist_axie_1.default)({ axie }, hre); } }