0.0.8 • Published 1 year ago

@crtxio/wallet v0.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

@crtxio/wallet

@crtxio/wallet is a Nuxt3 layer which provides Nuxt 3 components and composables to log into MetaMask or Magic accounts.

Setup

Make sure to install the dependencies:

npm install --save @crtxio/wallet

or

yarn add @crtxio/wallet

Add the dependency to your extends in nuxt.config:

defineNuxtConfig({
  extends: [
    '@crtxio/wallet'
  ]
})

How to use it

Components

<template>
  <Wallet 
    :rpc-url="rpcUrl" 
    :magic-key="magicKey" 
    :chainid="chainId" 
    connectPrompt="<your-connect-prompt>"
    connectClassProperties="<your-css-classes-for-connect-button>"
    expandedClassProperties="<your-css-classes-for-wallet-selection-frame>"
    :services="['metamask', 'magic']"
  />
</template>

Composables

// returns the provider or null
await getProvider(service: string, magicKey = '', rpcUrl = '', chainId= 1)

// returns signer or null
await getSigner(service: string, magicKey = '', rpcUrl = '', chainId= 1)

// returns account value
await getAccount()

// returns wallet state
await getWalletState()
0.0.3

1 year ago

0.0.8

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.2

2 years ago

0.0.1

2 years ago