import { pad0xBegin } from "../../../utils/common/utils";
import { triggerContractByContractName } from "../../../utils/ethers/contractHelper";
/**
 * Transfer Drill
 * @param landId Land Id
 * @param signer Signer
 * @param from Drill owner
 * @param to Recipient
 * @param tokenId Drill tokenId
 * @param callback Callback
 * @returns any
 */
export const drillTransfer = (landId, signer, from, to, tokenId, callback) => {
    return triggerContractByContractName(landId, signer, "objectOwnership", "transferFrom", [from, to, pad0xBegin(tokenId)], callback);
};
/**
 * Divest the props on the index slot on the tokenid land
 * @param landId The tokenId of land
 * @param signer Signer
 * @param tokenId Drill tokenId
 * @param index The index slot
 * @param callback Callback
 * @returns any
 */
export const drillStopWork = (landId, signer, tokenId, index, callback) => {
    return triggerContractByContractName(landId, signer, "apostleLandResource", "divest", [pad0xBegin(tokenId), index], callback);
};
/**
 * Equip function, A NFT can equip to EVO Bar (LandBar or ApostleBar).
 * @param landId Land Id
 * @param signer Signer
 * @param landTokenId Land token Id which to be quiped
 * @param drillContractAddress Drill contract address
 * @param drillTokenId Props token address which to quip
 * @param resourceContractAddress Which resouce appply to
 * @param slotIndex Index of the Bar
 * @param callback Callback
 * @returns any
 */
export const drillWork = (landId, signer, landTokenId, drillContractAddress, drillTokenId, resourceContractAddress, slotIndex, callback) => {
    return triggerContractByContractName(landId, signer, "apostleLandResource", "equip", [pad0xBegin(landTokenId), resourceContractAddress, slotIndex, drillContractAddress, pad0xBegin(drillTokenId)], callback);
};
