Skip to content

Wallet

Wallet

Digital wallet with in-app balance, card management, transfers, proximity payments (QR/NFC), payment requests, and invoice system (NFC and remote). Integrates with the framework's money system for invoice payments.

Database Tables

TablePurpose
phone_walletsWallet balances -- identifier, balance (DECIMAL 12,2)
phone_wallet_cardsSaved cards -- identifier, label, last4, color
phone_wallet_transactionsTransaction history -- identifier, amount, type (in/out/adjust), title, target_phone
phone_wallet_requestsPayment requests -- requester/target identifiers and phones, amount, title, method (qr/nfc), status, expires_at

Server Callbacks

CallbackPurpose
gcphone:wallet:getStateReturns balance, cards, and recent transactions
gcphone:wallet:addCardAdds a card to the wallet
gcphone:wallet:removeCardRemoves a card
gcphone:wallet:transferTransfers wallet balance to a phone number
gcphone:wallet:proximityTransferTransfers to a nearby player (proximity check)
gcphone:wallet:createRequestCreates a payment request to a nearby player
gcphone:wallet:getPendingRequestsReturns incoming and outgoing pending requests
gcphone:wallet:respondRequestAccept or decline a payment request (proximity re-check)
gcphone:wallet:createInvoiceCreates an invoice (NFC proximity or remote)
gcphone:wallet:respondInvoicePays or rejects an invoice (supports bank/cash for NFC)
gcphone:wallet:createNfcInvoiceCreates an NFC-only invoice (requires targetServerId)
gcphone:wallet:respondNfcInvoiceResponds to an NFC invoice

Config Options

lua
Config.Features.Wallet = true

Config.Wallet = {
    InitialBalance    = 2500,
    MaxTransferAmount = 500000,
    ProximityDistance  = 3.0,
}

Config.Security.RateLimits.wallet        = 900
Config.Security.RateLimits.walletRequest = 1300

Exports

ExportSignaturePurpose
CanUseProximityPayment(source, targetSource, maxDistance?) -> bool, string?, number?Check if two players are within proximity range
ProximityTransfer(source, targetSource, amount, title?, method?) -> GCWalletTransferResponseExecute a proximity wallet transfer between two players

Released under GPL-3.0 License