Wallet Creation

Wallet Creation React & React Native Hooks

Import hooks

In order to use the function below, you need to import the hooks for React or React native.

Import React Hooks

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

Create Wallet

Description

Create wallet mutation allows you to create a new wallet.

Example of usage

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

createWallet()

Wallet exists

Description

Checks if the user already owns a wallet

Data type

boolean

Usage Example

const { data, error, loading } = hooks.useWalletExists()

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.

Data type

string

Usage Example

const new_wallet = hooks.recreate()

Last updated