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.

NameTypeRequiredDefaultDescription

fullScreen

Boolean

true

Should widget be shown fullscreen

hideMenu

Boolean

true

Deprecated

preventClose

Boolean

true

Hides close button

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

NameTypeRequiredDefaultDescription

onClose

() => void

Close callback

onError

() => void

Error callback

onSuccess

() => void

Success callback

Usage Example

<Widget.Wallet.Recreate />

Post Method Widgets and Modals

Mutation Parameters

NameTypeRequiredDefaultDescription

widget parameters

Widget 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