Wallet Creation

Wallet Creation Widgets and Modals


Get Method Widgets and Modals

To use the widgets in React components you need to import the Widget component:

import { Widget } from '@paytweed/frontend-sdk-react'

Every widget has an optional parameter called settings.

You can provide them to the widget like this:

<Widget settings={{hideMenu: false}}>


Recreate wallet

Description

Purges the user's existing wallet and opens a new one. There is no way to recover the purged wallet unless the user knows its seed phrase. Use this function if the user lost access to their wallet and recovery efforts were unsuccessful.

Parameters​

Usage Example​​

<Widget.Wallet.Recreate />

Post Method Widgets and Modals

Mutation Parameters​

Usage Example​​

const [sendCoin] = hooks.useSendCoinToUser({
  callbacks: {
    onSuccess: () => {
      console.log('Success')
    },
    onError: () => {
      console.log('Error')
    },
    settings: {
      preventClose: true,
    },
  },
})

Create Wallet​

Description​

Create wallet mutation allows you to create a new wallet.

Usage Example​​

const [createWallet] = hooks.useCreateWallet({
  callbacks: {
    onSuccess: ({ result }) => {
      console.log(result)
    },
    onError: () => {
      console.log('Error')
    },
  },
})

createWallet()

Recreate Wallet​

Description​

Purges the user's existing wallet and opens a new one. There is no way to recover the purged wallet unless the user knows its seed phrase. Use this function if the user lost access to their wallet and recovery efforts were unsuccessful.

Usage Example​​

const [createRecoveryKit] = hooks.useSignMessage({
  callbacks: {
    onSuccess: () => {
      console.log('Success')
    },
    onError: () => {
      console.log('Error')
    },
  },
})

createRecoveryKit()

Last updated