0.4.6 • Published 10 months ago

use-rainbowkit-vue v0.4.6

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Rainbowkit Vue Plugin

A vue plugin for rainbowkit. (Not official) Based on @wagmi/vue

Installation

Install rainbowkit-vue and its wagmi vue, viem peer dependencies.

npm install @wagmi/vue viem @tanstack/vue-query use-rainbowkit-vue 

Setup

If found error such as buffer not defined or any node module not defined, install or setup polyfill.

import { createApp } from 'vue'
import { 
    RainbowKitVuePlugin,
    mainnet,
    zkSync,
    scroll,
    polygonZkEvm,
    immutableZkEvm,
    avalanche
 } from 'use-rainbowkit-vue'
import 'use-rainbowkit-vue/style.css';

///All options are optional, except 'appName', 'projectId' and 'chains' options. 
createApp(App).use(RainbowKitVuePlugin,{ 
    appName: 'RainbowKit demo', 
    projectId: "YOUR_PROJECT_ID",
    chains: [
        mainnet,
        zkSync,
        scroll,
        polygonZkEvm,
        immutableZkEvm,
        avalanche
    ],
    ///Extra options
    enableChainModalOnConnect: false, /// by default is true
    connectModalTeleportTarget: '#rainbowkit-modal', /// Make sure this element exists
    chainModalTeleportTarget: '#rainbowkit-modal', /// Make sure this element exists
    accountModalTeleportTarget: "#rainbowkit-modal", /// Make sure this element exists
    currencyAddress: '0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce',           
    connectModalIntro: (/*{ compactModalEnabled, getWallet }*/)=>{
        return ()=>{
            return h('div','You can start your journey here by using web3 wallet.');
        }
    },
})

Use of Rainbowkit Components with <script setup>

<script lang="ts" setup>
import { RainbowKitProvider, ConnectButton } from "use-rainbowkit-vue";
</script>
<template>
    <div class="content">
        <RainbowKitProvider>
            <ConnectButton />
        </RainbowKitProvider>
    </div>
</template>

Credits

License

Licensed under the MIT License.

0.4.6

10 months ago

0.4.5

11 months ago

0.4.4

11 months ago

0.4.3

11 months ago

0.4.2

11 months ago

0.4.1

11 months ago

0.4.0

11 months ago

0.3.0

12 months ago

0.2.3

12 months ago

0.2.2

12 months ago

0.2.1

12 months ago

0.2.0

12 months ago

0.1.0

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago