Delay Blockchain Account Creation
Control when a user's blockchain account is created.
Overview
When a new user authenticates for the first time, blockchain accounts are automatically created. It is possible to modify this behavior and trigger the wallet creation process when desired. An example is to engage blockchain account creation after a user's successfully completes a pay wall.
Creating accounts on some blockchains costs a fee or resources. You can avoid paying these fees upon the creation of a new user and instead wait until the user does something of value (e.g. buy an NFT) before having the blockchain accounts created.
Delay Blockchain Account Creation using OreId-js
To not automatically create blockchain accounts on first login, pass-in the ‘delayWalletSetup’ option on auth.
The user may log in as many times as they wish - they will not be prompted to set up their wallet (e.g. enter their password to create their wallet)
To disable delayed wallet setup for a user, call disableDelayedWalletSetup()
on the user object. Example:
The next time the user authenticates, they will be prompted to set up their wallet.
Hint: If this setting is in force for a user, you’ll see a property in their user data called delayWalletSetup:
Also, user.chainAccounts.permissions may have an accountType of ‘pending’.
These blockchain account will be created in the future when the wallet is set up - however, only some future accounts may appear here.
The following OreId-js functions also now support the delayWalletSetup option:
Using the API
The following API endpoints now supports a property to enable delayedWalletSetup when a user’s account is created:
Create a new custodial user on the ORE ID Service
POST
https://service.oreid.io/api/custodial/new-user
Returns the 12 character ORE ID account name of the custodial account created.
Headers
Name | Type | Description |
---|---|---|
api-key* | String | The api-key for your application on ORE ID. |
service-key | String | The service account key for ORE ID Enterprise. |
Content-Type* | String | application/json |
Request Body
Name | Type | Description |
---|---|---|
access_token | String | Access Token returned from successful login with Oauth provider. |
access_token_provider | String | Login provider that produced the above |
account_type* | String |
|
user_password* | String | Password to encrypt the private keys. |
name* | String | User's full name. |
user_name* | String | User's display name. |
email* | String | User's email address. |
picture* | String | URL of the user's profile picture. |
phone* | String | User's phone number in the following format: |
email_verified* | Boolean | The status of the email address being verified by the Oauth provider. |
is_test_user* | Boolean | |
delay_wallet_setup* | Boolean | Enables/disables to the blockchain wallet creation when the account logs in to ORE ID. |
Create a new ORE ID Account
POST
https://service.oreid.io/api/account/new-user-wth-token
Returns an OAuth accessToken
which may be included in the header of future requests to other api endpoints. The access token is scoped to a single user
Headers
Name | Type | Description |
---|---|---|
api-key* | String | The api-key for your application on ORE ID. |
service-key | String | The service account key for ORE ID Enterprise. |
Request Body
Name | Type | Description |
---|---|---|
id_token* | String | Issued by an Oauth provider. The Oauth provider domain (iss) must be registered in your ORE ID app registration. |
delay_wallet_setup | Boolean | Enables/disables to the blockchain wallet creation when the account logs in to ORE ID. |
The endpoint to reset the delayed account creation flag is:
Update the delay_wallet_setup flag
POST
https://service.oreid.io/api/account/update-delay-wallet-setup
If delay_wallet_setup value is True, the blockchain wallet will not be created.
Headers
Name | Type | Description |
---|---|---|
api-key* | String | The api-key for your application on ORE ID. |
Content-Type* | String | application/json |
Request Body
Name | Type | Description |
---|---|---|
account* | String | The ORE ID account that will be targeted. |
delay_wallet_setup* | Boolean |
|
Note: You can only change this value on an account that has not had a wallet setup yet.
Last updated