TON Connect

Here is a list of TON Connect utilities.

TonConnectButton

A button that provides the default TON Connect UI auth button.

<template>
  <TonConnectButton />
</template>

<script setup lang="ts">
import {TonConnectButton} from '@d0rich/vueton'
</script>

useTonConnect()

Main composable providing the most cruscial vueton functionality.

PropertyDescription
tonConnectTonConnect UI instance.
tonClientTonClient instance wrapped in Vue ref. May be null if initialized with an async function and not completed yet.
isConnectedIndicates if the plugin is connected to a wallet application / browser extension.
tonWalletCurrently connected user wallet.
tonAddressTON address of the currently connected wallet in hex format.
tonAddressUserFriendlyTON address of the currently connected wallet in user-friendly format.
tonNetworkNetwork of the connected wallet.
sendTransactionWrapper to send transaction using TonConnectUI with core interface.
cleanupSubscriptionsCleanup all subscriptions and listeners under the hood.
senderSender instance.

awaitConnected()

Hook to wait for the TON application to connect.

import { awaitConnected } from '@d0rich/vueton'

awaitConnected().then(() => {
  console.log('Connected!')
})

onWalletUpdate()

Hook to listen for user changing the wallet.

import { onWalletUpdate } from '@d0rich/vueton'

onWalletUpdate((wallet) => {
  console.log('Wallet updated:', wallet)
})