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.
24 lines (23 loc) • 996 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = listAllAxies;
const list_axie_1 = __importDefault(require("./list-axie"));
const axie_1 = require("../lib/axie");
// TODO: multisig to save gas
async function listAllAxies(taskArgs, hre) {
// get address
const accounts = await hre.ethers.getSigners();
const signer = accounts[0];
const address = signer.address.toLowerCase();
console.log(`Listing all axies of ${address.replace('0x', 'ronin:')}`);
// get all axies ids from the account
const axieIds = await (0, axie_1.getAxieIdsFromAccount)(address, hre.ethers.provider);
// list all axies, one by one
for (let i = 0; i < axieIds.length; i++) {
const axieId = axieIds[i];
await (0, list_axie_1.default)({ axie: axieId.toString(), ...taskArgs }, hre);
}
}