Tweed Docs
Ask or search…
K

Wallet Creation

Wallet Creation Functions

Create wallet

Description

Creates a wallet for the user using a transparent widget

Return type (Settings dependent)

{ settings: { returnUrl: true } } returns the widget URI { settings: { returnUrl: false } } returns the wallet addresses object

Usage Example

await sdk.wallet.create()

Wallet exists

Description

Checks if the user already owns a wallet

Return type

Promise<boolean>

Usage Example

const walletExists = await sdk.wallet.exists()
if (walletExists) {
// do something
} else {
await sdk.wallet.create()
}

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.

Return type

Promise<string>

Usage Example

await sdk.wallet.recreate()