<template>
  <main>You are using wax version: "{{ version }}"</main>
</template>

<script setup>
import { createWaxFoundation } from '@hiveio/wax/vite';
import { ref, onBeforeMount } from 'vue';

const version = ref();

onBeforeMount(async () => {
  try {
    const wax = await createWaxFoundation();

    version.value = wax.getVersion();

    window.waxLoaded = true;
  } catch (error) {
    console.error(error);

    window.waxLoaded = false;
  }
});
</script>