Skip to main content
The Crypto component manages cryptocurrency coins, player wallets, and exchange operations (buying, selling, transferring).

Overview

Access via Crypto (server-side only).

Coin Management

Create and manage coin types

Wallets

Player crypto holdings

Exchange

Buy, sell, and transfer crypto
Crypto balances are stored in the character’s data as Crypto[ACRONYM] = amount. Players access crypto through a CryptoWallet ID linked to their character.

Coin Management

Crypto.Coin:Create

Register or update a cryptocurrency type.
string
required
Full coin name (e.g., “Bitcoin”)
string
required
Short identifier (e.g., “BTC”)
number
required
Price per unit in dollars
boolean
required
Whether players can buy this coin
boolean
required
Whether players can sell this coin
Example:

Crypto.Coin:Get

Get data for a specific coin.
table|nil
Coin data or nil if not registered

Crypto.Coin:GetAll

Get all registered coins.
table
Array of all registered coin data

Wallet Operations

Crypto:Has

Check if a player owns a minimum amount of a coin.
number
required
Player server ID
string
required
Coin acronym (e.g., “BTC”)
number
required
Minimum amount to check
boolean
true if player owns >= amount
Example:

Exchange Operations

Crypto.Exchange:IsListed

Check if a coin is tradeable on the exchange.

Crypto.Exchange:Buy

Purchase cryptocurrency using the player’s bank account.
string
required
Coin acronym
number
required
Character State ID (SID) of the buyer
number
required
Amount of coin to buy
boolean
true if purchase was successful
Example:

Crypto.Exchange:Sell

Sell cryptocurrency back for bank balance.
string
required
Coin acronym (must be sellable)
number
required
Character State ID (SID) of the seller
number
required
Amount of coin to sell
number|boolean
New balance or false if failed

Crypto.Exchange:Add

Add cryptocurrency directly to a wallet (no bank charge).
string
required
Coin acronym
string
required
CryptoWallet ID (from char:GetData('CryptoWallet'))
number
required
Amount to add
boolean
Skip phone notification
Example:

Crypto.Exchange:Remove

Remove cryptocurrency from a wallet.
boolean
true if successfully removed

Crypto.Exchange:Transfer

Transfer cryptocurrency between two wallets.
string
required
Coin acronym
number
required
Sender’s State ID (SID)
string
required
Recipient’s CryptoWallet ID
number
required
Amount to transfer
boolean
true if transfer was successful
Example:

Next Steps

Finance - Banking

Bank account operations

Finance - Payments

Bills and fines

Characters API

Character data access