ZEPETO.Multiplay.Currency
6 min
type description currencyerror /#currencyerror the error code specifies the reason for the failure of in world currency related requests currency /#currency currency manages operations associated with zepeto world currencies currencyerror enum the error code specifies the reason for the failure of in world currency related requests name value description unknown 1 error unknown error networkerror 0 error errors related to network issues, including disconnections or unstable connections currency interface currency manages operations associated with zepeto world currencies methods debit debit(id string, quantity? number, reason? string) → promise\<boolean> deducts the specified amount from the player's in world currency balance throws currencyerror parameter type description id string id of the currency to deduct quantity (optional) number the quantity of the currency to deduct defaults to 1 reason (optional) string optionally describes the reason for deduction returns promise\<boolean> — promise resolved upon completion, indicating success ( true ) or failure ( false ) credit credit(id string, quantity? number, reason? string) → promise\<boolean> increases the specified amount to the player's in world currency balance throws currencyerror parameter type description id string id of the currency to increase quantity (optional) number the quantity of the currency to increase defaults to 1 reason (optional) string optionally describes the reason for increase returns promise\<boolean> — promise resolved upon completion, indicating success ( true ) or failure ( false ) getbalance getbalance(id string) → promise\<number> retrieves the balance of the player's in world currency throws currencyerror parameter type description id string id of the currency to retrieve returns promise\<number> — promise resolved upon completion, with the retrieved balance amount getbalances getbalances() → promise<{ \[key string] number }> retrieves the balances of each in world currency the player has throws currencyerror returns promise<{ \[key string] number }> — promise resolved upon completion, with the object where each in world currency id is a key, and its corresponding balance is the associated value
