import { Host, h } from "@stencil/core";
import { watchBlockNumber } from "@wagmi/core";
import state from "../../stores/wallet";
import { ethers } from "ethers";
export class NKEditionPriceText {
  constructor() {
    this.price = undefined;
    this.editionId = undefined;
  }
  componentWillLoad() {
    this.disconnect = watchBlockNumber({ listen: true }, async () => {
      this.price = ethers.utils.formatEther(await state.diamond.apps.edition.getEditionPrice(this.editionId));
    });
  }
  disconnectedCallback() {
    this.disconnect();
  }
  render() {
    return (h(Host, null, this.price, h("slot", null)));
  }
  static get is() { return "nk-edition-price-text"; }
  static get encapsulation() { return "shadow"; }
  static get properties() {
    return {
      "editionId": {
        "type": "number",
        "mutable": false,
        "complexType": {
          "original": "number",
          "resolved": "number",
          "references": {}
        },
        "required": true,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Edition ID"
        },
        "attribute": "edition-id",
        "reflect": false
      }
    };
  }
  static get states() {
    return {
      "price": {}
    };
  }
}
//# sourceMappingURL=nk-edition-price-text.js.map
