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.
Property | Description |
---|---|
tonConnect | TonConnect UI instance. |
tonClient | TonClient instance wrapped in Vue ref. May be null if initialized with an async function and not completed yet. |
isConnected | Indicates if the plugin is connected to a wallet application / browser extension. |
tonWallet | Currently connected user wallet. |
tonAddress | TON address of the currently connected wallet in hex format. |
tonAddressUserFriendly | TON address of the currently connected wallet in user-friendly format. |
tonNetwork | Network of the connected wallet. |
sendTransaction | Wrapper to send transaction using TonConnectUI with core interface. |
cleanupSubscriptions | Cleanup all subscriptions and listeners under the hood. |
sender | Sender 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)
})