@cityofzion/wallet-connect-sdk-svelte
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

WalletConnect SDK Svelte

Installation

Install the dependencies on your application

NPM

npm i @cityofzion/wallet-connect-sdk-svelte

YARN

yarn add @cityofzion/wallet-connect-sdk-svelte

Setup

To begin development, first establish an account on the Wallet Connect website. Next, generate a new Project. This process is straightforward, requiring only a few form fields.

Instantiate an object of the WCSDKStore class

<script>
    import { WCSDKStore } from '@cityofzion/wallet-connect-sdk-svelte'
    
    const wcOptions = {
        projectId: '<your wc project id>', // the ID of your project on Wallet Connect website
        relayUrl: 'wss://relay.walletconnect.com', // we are using walletconnect's official relay server
        metadata: {
            name: 'MyApplicationName', // your application name to be displayed on the wallet
            description: 'My Application description', // description to be shown on the wallet
            url: 'https://myapplicationdescription.app/', // url to be linked on the wallet
            icons: ['https://myapplicationdescription.app/myappicon.png'] // icon to be shown on the wallet
        }
    };

    const autoManageSession = true
    const wcSdk = new WCSDKStore(wcOptions, autoManageSession)
</script>

autoManageSession will reload the user's connected session and subscribe to the disconnect event. It is true by default and if you don't want this at startup, set the second constructor parameter to false and call the manageSession method at the correct time.

Usage

Check this Usage Guide to see how to use this SDK on your application.

Package Sidebar

Install

npm i @cityofzion/wallet-connect-sdk-svelte

Weekly Downloads

79

Version

0.3.1

License

none

Unpacked Size

10.9 kB

Total Files

4

Last publish

Collaborators

  • ethanfast
  • snowypowers
  • rockacola
  • lllwvlvwlll
  • hal0x2328
  • melanke