Methods
# async getUserByReferrerId(userType, referrerId, limitnullable, lastEvaluatedKeynullable) → {UserDataResponse|undefined}
Perform the retrieve full user information by the Wallet address
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userType |
UserType
|
Type of user references (CUSTOMER/PARTNER) |
|
referrerId |
string
|
Project ID/ReferrerID of referrer that end users have onboard to myria via invitation or games |
|
limit |
string
|
<nullable> |
Limit records per page for paging data |
lastEvaluatedKey |
UserLastEvaluatedKey
|
<nullable> |
Last evaluated key to support paging for users |
Exception: Eth address is required!
string
Http Status Code 404: User 0x... is not registered
string
Http Status Code 500: Get user data failed - unexpected with internal server error
string
Http Status Code 500: Internal Server Error with ${Exception}
string
The details user data response for registration progress (including signature, stark key, wallet address)
UserDataResponse
|
undefined
Example
// Sample code on staging:
const developerAccountManager = new DeveloperAccountManager(EnvTypes.STAGING);
const partnerIdOfGameA = '10'; // Project game ID A
const userWalletData = await developerAccountManager.getUserByReferrerId(UserType.PARTNER, partnerIdOfGameA);
console.log('Testnet Data ->', userWalletData);
// Sample code on Production:
const developerAccountManager = new DeveloperAccountManager(EnvTypes.PRODUCTION);
const partnerIdOfGameA = '15'; // Project game ID A
const userWalletData = await developerAccountManager.getUserByReferrerId(UserType.PARTNER, partnerIdOfGameA);
console.log('Production Data ->', userWalletData);
# async getUserInfoByWalletAddress(ethAddress) → {UserDataResponse|undefined}
Perform the retrieve full user information by the Wallet address
Parameters:
Name | Type | Description |
---|---|---|
ethAddress |
string
|
The ether wallet address of user (such as Metamask wallet address) |
Exception: Eth address is required!
string
Http Status Code 404: User 0x... is not registered
string
Http Status Code 500: Get user data failed - unexpected with internal server error
string
Http Status Code 500: Internal Server Error with ${Exception}
string
The details user data response for registration progress (including signature, stark key, wallet address)
UserDataResponse
|
undefined
Example
// Sample code on staging:
const developerAccountManager = new DeveloperAccountManager(EnvTypes.STAGING);
const ethWalletAddress = '0x.....';
const userWalletData = await developerAccountManager.getUserInfoByWalletAddress(ethWalletAddress);
console.log('Testnet Data ->', userWalletData);
// Sample code on Production:
const developerAccountManager = new DeveloperAccountManager(EnvTypes.PRODUCTION);
const ethWalletAddress = '0x.....';
const userWalletData = await developerAccountManager.getUserInfoByWalletAddress(ethWalletAddress);
console.log('Production Data ->', userWalletData);
# async getUserWalletByStarkKey(starkKey) → {UserDataResponse|undefined}
Perform the retrieve user wallet by the Stark Key
Parameters:
Name | Type | Description |
---|---|---|
starkKey |
string
|
Stark Key of user in L2 system of Myria |
Exception: Stark Key is required!
string
Http Status Code 404: User 0x... is not registered
string
Http Status Code 500: Get user data failed - unexpected with internal server error
string
Http Status Code 500: Internal Server Error with ${Exception}
string
The details user data response for registration progress (including signature, stark key, wallet address)
UserDataResponse
|
undefined
Example
// Sample code on staging:
const developerAccountManager = new DeveloperAccountManager(EnvTypes.STAGING);
const starkKey = '0x.....';
const userWalletData = await developerAccountManager.getUserWalletByStarkKey(starkKey);
console.log('Testnet Data ->', userWalletData);
// Sample code on Production:
const developerAccountManager = new DeveloperAccountManager(EnvTypes.PRODUCTION);
const starkKey = '0x.....';
const userWalletData = await developerAccountManager.getUserWalletByStarkKey(starkKey);
console.log('Production Data ->', userWalletData);