Class MozartManager

Hierarchy

  • MozartManager

Constructors

  • Parameters

    • gameId: string
    • currencyId: string

    Returns MozartManager

Properties

authState: string = ""
balances: V1FtsBalances = ...
currencyId: string = ""
gameId: string = ""
inventoryItems: NFTItem[] = ...

This is a list of items the user actually has in their inventory for this app

isLoggedIn: boolean = false
jwtToken: string = ""
onInventoryLoaded: Function[] = ...

Fires when the inventory is loaded

onLoggedIn: Function[] = ...

Fires when user logs in

onPurchaseComplete: Function[] = ...

Fires when purchase is completed

onStoreLoaded: Function[] = ...

Fires when the store is loaded

onUserDataLoaded: Function[] = ...

Fires when userData is loaded

storeItems: NFTItem[] = ...

This is a list of items loaded from the store for this app

userData: User = ...
API_URL_BASE: string = "https://testnet-api.mozart.xyz"

URL for the API

APP_URL_BASE: string = "https://testnet-dashboard.mozart.xyz"

URL For the dashboard app

AUTH_URL_BASE: string = "https://testnet-api.mozart.xyz/v1/auth"

URL for the auth service

instance: MozartManager = null

Methods

  • This returns the URL to redirect the user to to add funds to their account

    Returns

    The URL to redirect the user to to add funds to their account

    Returns string

  • Returns

    Parameters

    • ItemTemplateID: string

      The ID of the item to buy

    Returns Promise<any>

  • Helper function to fire events to all listeners

    Parameters

    • event: Function[]
    • data: any

    Returns void

  • This loads the store items from the Mozart API

    Returns

    store items

    Returns Promise<any>

  • Login to Mozart using OAuth

    Returns

    The URL to redirect the user to

    Parameters

    • authMethod: string = "google"

      The OAuth method to use (google, facebook, github)

    Returns Promise<string>

  • Requests additional user data like balances, nfts, and user info The MozartSDKLoginButton has logic to automatically call this.

    Returns Promise<any>

  • This is called after LoginOAuthAndGetLoginURL() is called and it checks periodically to see if the user has logged in

    Parameters

    • maxRetryCount: number = 30

      The maximum number of times to check for login status

    • timeBetweenRetriesInSeconds: number = 2

      The number of seconds to wait between each check

    • callback: Function = null

      The function to call when the user has logged in or the login has timed out

    Returns Promise<void>

Generated using TypeDoc