Hooks

Quirks provides several useful hooks for integrating the library and its functionality within your vue codebase.

useConnect

Provides the methods and information required to use the wallets, connect to them, and obtain status information about the connection.

import {  } from "@quirks/vue";
 
const {
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  ,
} = ();

useChain

Provides information about the previously configured chain, along with the address for that wallet/chain pair if the wallet is connected.

Note

The list of supported chains depends on the wallet you are using; not all wallets allow you to add custom chains. Therefore, it may not be possible to get information for some chains.

import {  } from "@quirks/vue";
 
/**
 * The name of the chain for which you want to obtain
 * information corresponds to the one you have configured in the Config object.
 */
const  = "osmosis";
 
const {
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  ,
  ,
} = ();

useChains

Provides information about all connected chains, along with the address for those wallet/chain pairs if the wallet is connected.

Note

The list of supported chains depends on the wallet you are using; not all wallets allow you to add custom chains. Therefore, it may not be possible to get information for some chains.

import {  } from "@quirks/vue";
 
const { , , , ,  } =
  ();

useConfig

Returns information about the configuration of Quirks previously defined in the Config object.

import {  } from "@quirks/vue";
 
const { , ,  } = ();

useWalletConnect

Provides information about WalletConnect connection, including the pairing URI if connecting to a wallet that supports it.

import {  } from "@quirks/vue";
 
const { , ,  } = ();

useWalletEvents

A utility that allows you to subscribe to Quirks events to perform custom actions.

import {  } from "@quirks/vue";
 
const {  } = ("ac
  • accountsChanged
countsChanged", () => {
// your custom code });

On this page