This is a limited beta feature. Please contact us if you’re interested in using it.

The Rownd NEAR integration ensures that all of your users have a NEAR account either automatically or on-dmand.

NEAR Examples

Here are some basic examples of using the Rownd SDK and APIs to interact with NEAR. See the JavaScript API Reference for more details

Trigger an implicit account creation

If you wish to control when NEAR implicit accounts are created for your users, you can opt for the “on-demand” creation strategy. This improves sign-up time since Rownd does not have to wait for the execution of on-chain contract calls to complete. You will need to manually ensure that an implicit account exists for a user.

You can execute the following SDK call to ensure an implicit account exists

Prompt a user for named account creation

This call will open a dialog prompting the user to enter a name prior to creating the NEAR account. This name will end with .rownd.near by default. For instance, if a user specifies my-account-1, the full account name will be my-account-1.rownd.near. Work with the Rownd support team if you would like to change this account name suffix to another value.

Javascript
rownd.near.createNamedAccount();

Prompt a user to connect an account

This call will open a dialog prompting the user to connect a NEAR account. They will be presented with a list of supported wallet providers. Clicking on one of the providers will initiate a NEAR wallet sign-in, after which the NEAR account and wallet ID will be added to the Rownd user’s profile data.

Javascript
rownd.near.connectAccount();