- Notifications
You must be signed in to change notification settings - Fork5
License
greymass/create-account
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This library allows you to prompt the user to create and initialize an account using Anchor.
The@greymass/create-account
package is distributed as a module onnpm.
yarn add @greymass/create-account# ornpm install --save @greymass/create-account
This function will automatically open a popup window prompting the user to buy an account. Once the payment is received,the account will be redirected to Anchor with an account creation code. Anchor is then expected to send a confirmation orerror message back before sending the user back to the defined url.
import { AccountCreator } from '@greymass/create-account';// Initialize the account creator objectconst accountCreator = new AccountCreator({ supportedChains: [], // List of supported chains. scope: 'wallet', // A string representing the scope of the account creation. returnUrl: 'http://wallet.greymass.com', // Url to return the user to once the account is created.})// Open a popup window prompting the user to create an account.accountCreator.createAccount().then((creationResult) => { // Handle success, the creationResult will be an esr callback object.}).catch((error) => { // Handle error})
You needMake,node.js andyarn installed.
Clone the repository and runmake
to checkout all dependencies and build the project. See theMakefile for other useful targets. Before submitting a pull request make sure to runmake lint
.
Made with ☕️ & ❤️ byGreymass, if you find this useful please considersupporting us.