Skip to main content

Get user profile and wallet addresses from Ronin Waypoint

Overview

This guide walks you through the steps to retrieve user information and wallet addresses associated with a Ronin Waypoint account by sending a request to the user profile endpoint. Based on the number of wallet addresses associated with the account, you can choose how to handle the wallets in your game.

Prerequisites

  • An app created in the Developer Console.
  • Permission to use the Sky Mavis Account service. Request in the Developer Console under your app > App Permission > Sky Mavis Account (OAuth 2.0) > Request Access.
  • The unique ID of the Ronin Waypoint account whose information you want to retrieve. You can retrieve this ID from the sub claim in the JWT token returned by Ronin Waypoint after authentication.

Steps

Step 1. Understand the user's account and wallets

The user's Ronin Waypoint account includes the following information:

{
"account.wallet.default":"wallet.secondary", // Default wallet set by the user
"account.wallet.identity":"0x123...", // Keyless wallet address
"account.wallet.identity.has_backup":"true", // Whether the keyless wallet is backed up
"account.wallet.secondary":"0x456...", // Optional seed-phrase Ronin Wallet, if linked by the user
"profile.name":"Lunacian" // User's profile name
}
KeyDescriptionUse for
account.wallet.defaultThe default wallet for the user's account as set by the user on the account management page.Use this wallet as the primary wallet for the user's account.
account.wallet.identityThe user's keyless wallet created either through the waypoint.roninchain.com page, or in the Ronin Wallet mobile app or browser extension.Treat this wallet as the user's spending account for in-game transactions and purchases, enabling the user to purchase, swap, and mint assets across Ronin games. It also supports actions like collecting daily check-ins and sending tokens or NFTs to other users.
account.wallet.identity.has_backupIndicates if a shard of the keyless wallet is backed up to the Sky Mavis server.The service will prompt the user to continue the setup process if the wallet isn't backed up.
account.wallet.secondaryA seed phrase Ronin Wallet that is present if the user linked it on the account management page.Treat this wallet as the user's savings account for staking tokens or NFTs for rewards and governance, and storing valuable assets.
profile.nameThe user's display name that appears in games such as Axie Infinity.Use this name to personalize the user experience.

Step 2. Send the request

To retrieve user information and wallet addresses, send a GET request to the user profile endpoint with the user ID.

warning

Make sure to send the request server-side to protect your API key from being exposed and misused.

Request:

curl --location 'https://api-gateway.skymavis.com/account/v2/rpc/get-user-profile/{user_id}' \
--header 'X-api-key: {YOUR_API_KEY}' \
--header 'X-app-id: {YOUR_APP_ID}'

Parameters:

  • {user_id}: the user ID of the account you want to retrieve information for. For example, 1eda5fc0-76e1-6de4-8449-b3a0fde29125.
  • {YOUR_API_KEY}: your app's API key from the Developer Console.
  • {YOUR_APP_ID}: your app's unique ID from the Developer Console.

Response:

{
"account.wallet.default":"wallet.secondary", // Default wallet set by the user
"account.wallet.identity":"0x123...", // Keyless wallet address
"account.wallet.identity.has_backup":"true", // Whether the keyless wallet is backed up
"account.wallet.secondary":"0x456...", // Optional seed-phrase Ronin Wallet, if linked by the user
"profile.name":"Lunacian" // User's profile name
}

Step 3. Choose how to handle the wallets

Depending on the number of wallet addresses associated with a Ronin Waypoint account, you can choose one of the following implementations:

  • One wallet address: query this wallet for all transactions and authentication needs.
  • Two wallet addresses: choose one of the following:
    • Query both wallets: retrieve information from both the identity and secondary wallets.
    • Pick only one wallet: prioritize the identity wallet over the secondary wallet.
    • Let the user choose which wallet to use: provide an interface allowing the user to select which wallet to use.