1.2.1 • Published 1 year ago

vuiet v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Vuiet npm.io npm.io

Vuiet is a minimal wallet manager built on the Sui blockchain for Vue 3.

Demo

Basic code examples can be found on our demo page - vuiet.dev

Getting Started

Installation:

npm install -S vuiet

Setup

// main.ts (App entry point)
import { createApp } from 'vue'
import Vuiet from 'vuiet'

// Needed to load tailwind classes for the components.
// If you're not planning on using the built-in components there's no need to import it.
import 'vuiet/dist/style.css'

const app = createApp(App)

app.use(SuiWallet, {
  autoConnect: true,
  chainOverwrite: {
    SUI_DEVNET: {
      faucetUrl: 'https://faucet.devnet.sui.io/gas'
    }
  }
})

app.mount('#app')

Options

autoConnect (default true, optional)

Whenever to connect to the previous wallet on page reload.

When enabled the wallet name is store in local storage with key VUIET__PREV_WALLET_NAME. Deleting the entry will make the lib "forget" it, but will not auto-disconnect the user.

chain (default SUI_DEVNET)

What chain to use - this option is subject to change.

chainOverwrite (optional)

Overwrites the chain defaults. Can be useful to specify faucet urls since by default they're not specified.

Values that can be overwritten: nodeUrl, displayName, key and faucetUrl

  • Valid chains are SUI_DEVNET, SUI_TESTNET and SUI_MAINNET

Basic Usage

<template>
  <p @click="$wallet.disconnect()">Address: {{ $wallet.address }}</p>
  <p>Balance: {{ balance }}</p>
  <!-- Balance is by default SUI -->
  <!-- If you want to normalize it divide by 1e9 -->

  <button @click="$wallet.select('Suiet')">Connect (Suiet)</button>
</template>

<script setup>
  import { useWallet, useCoinBalance } from 'vuiet'
  const $wallet = useWallet()
  const { balance } = useCoinBalance()
</script>

Component Usage

⚠️ Components aren't as tested and modular as I wanted them to be at the moment. If you have any suggestions or found a bug feel free to open an issue.

<template>
  <p @click="$wallet.disconnect()">Address: {{ $wallet.address }}</p>

  <WalletMultiButton />
</template>

<script setup>
  import { useWallet, WalletMultiButton } from 'vuiet'
  const $wallet = useWallet()
</script>
1.2.1

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago

0.2.4

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2-alpha

1 year ago

0.0.1-alpha

1 year ago