<CreateWallet>
is a React component that renders a button which initiates a flow to create a wallet tied to a user's email address. Paper does not have the ability to read the private keys of this wallet, and the user can choose to export the private keys of this wallet at any time by accessing a link that we can provide (please contact us for details of the export flow).
The flow works as follows:
- Paper sends the user a verification email (to the address provided to the emailAddressprop) to ensure that they own the email that is being passed in. This is the email address that the wallet will be tied to.
Optional event callback function onEmailVerificationInitiated
is called when the user clicks on the button. If nothing is passed in, we show default messages to prompt the user to check their email for verification.
- Paper calls
onSuccess
when email verification succeeds and passes through an object that contains the user's email address and wallet address. If verification failed,onError
is called with an error message.
Props
These props can be used as arguments within the <CreateWallet>
component. See the name, type, and description for each prop in the table below.
Prop | Type | Description |
---|---|---|
emailAddress | string | Required |
Callback Functions
The following callback function can be passed on as arguments within the <CreateWallet>
component. See the name, type, and description for each prop in the table below.
Callback Function | Description |
---|---|
onSuccess: | Optional |
onError: | Optional |
onClose: | Optional |
Types
export type PaperUser = {
/**
* The user's email address.
* This address is case-insensitive (i.e. different capitalizations map to the same wallet).
*/
emailAddress: string;
/**
* The Paper Wallet address associated with this user's email address.
*/
walletAddress: string;
};