getOrCreateHallidayAAWallet
To retrieve the logged-in user's Halliday Account details, such as their Halliday account address, call getOrCreateHallidayAAWallet()
. This function will return the Smart Account for a user based on the their unique id in your application. You can confirm a user has been logged in by calling hallidayClient.getUserInfo()
. If the user is using our system for the first time, the function will automatically create a new Smart Account for the user and return its details.
Example Usage
import {Halliday} from "halliday-sdk";
/**
* After logging in using one of the above options, you can call getUserInfo
* and use the returned info to create an account on your end. Then, call
* this function, getOrCreateHallidayAAWallet, with the user's id in your
* system. This function will get or create the Halliday AA wallet, that
* the non-custodial wallet will be the owner of.
*
* Need to call this before any of the below methods to make sure the user
* has a Halliday AA Wallet
*
*/
const getAccountResponse = await hallidayClient.getOrCreateHallidayAAWallet(userInGameId)
Inputs
Name | Type | Description |
---|---|---|
userInGameId | string | User's id in your application (must be unique) |
(optional) email | string | The user's email. This parameter is not required if the social login client is used. |
Outputs
Promise to a GetWalletResponse object.
Name | Type | Description |
---|---|---|
blockchain_type | string | The blockchain the user's Halliday Account is on. |
in_game_user_id | string | Your in-app ID for this user |
gas_sponsored | string | How much gas you have sponsored for this user |
sponsorship_limit | string | The upper limit for how much gas you have chosen to sponsor for this user |
account_address | string | The Halliday account address corresponding to this user |
Updated about 14 hours ago
What’s Next