Exports

Terminology

identifier refers to the character, not the player.

  • ESX: identifier = identifier
  • QBCore: identifier = citizenid

OpenCEX

Opens the exchange.

exports['LuxuCEX']:OpenCEX()

GetAllPlayerAssets

Returns assets for all players.

local Players_CEX_Assets = exports['LuxuCEX']:GetAllPlayerAssets(identifier)
-- returns: {{identifier: "char:331415a231", assets: {"BTC": 10, "ETH": 100, ...}}}

GetPlayerAssets

Returns a specific player's CEX assets.

local PlayerCEXassets = exports['LuxuCEX']:GetPlayerAssets(identifier)
-- returns: {"BTC": 10, "ETH": 100, ...}

UpdatePlayerAssets

Updates a player's crypto balance.

-- @param data table
--   identifier (string) - Player's identifier
--   crypto (string)     - Asset to update (e.g. "BTC", "ETH")
--   amount (number)     - Amount to update
--   operation (string)  - "add", "remove", or "set"
-- @return true or nil
exports['LuxuCEX']:UpdatePlayerAssets(data)

Example:

local data = {
  identifier = "HHT94466",
  crypto = "BTC",
  amount = 1231234,
  operation = "set"
}

local success = exports['LuxuCEX']:UpdatePlayerAssets(data)

if success then
  -- success
else
  -- failed
end