Class

DeveloperAccountManager

DeveloperAccountManager(env)

Constructor

# new DeveloperAccountManager(env)

Create DeveloperAccountManager instance object

Parameters:
Name Type Description
env EnvTypes

Environment types enum params (Ex: EnvTypes.DEV / EnvTypes.STAGING / EnvTypes.PREPROD / EnvTypes.PROD)

View Source modules/DeveloperAccountManager.ts, line 3

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

View Source modules/DeveloperAccountManager.ts, line 251

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

    // 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)

View Source modules/DeveloperAccountManager.ts, line 218

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

      // 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

View Source modules/DeveloperAccountManager.ts, line 188

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

    // 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);