Currency module summary

← Back to docs · Architecture

Status: accepted (23 of 23 tasks, 3 phases). Change: openspec/changes/currency-module/.

What was built

The economy system that lets existing OpenSim currency providers (Gloebit, DTL/NSL Money Server, Podex) work with Welkin grids. The implementation covers the IMoneyModule interface contract, five UDP packet handlers, four XML-RPC methods, three LSL money functions, and native clients for the two major currency systems.

Grid operators choose a money module by name in config: sample (default, zero-cost everything), dtl (proxy to external MoneyServer), or gloebit (native REST client with OAuth2).

Architecture

ModuleResponsibility
MoneyModule traitRust equivalent of IMoneyModule: 8 methods plus upload_charge and group_creation_charge
MoneyTransactionTypeEnum of transaction categories (ClassifiedCharge, GroupCreate, LandPassSale, etc.)
SampleMoneyModuleDefault: zero balance, allow all transactions, matches C# OpenSimulator behavior
EconomyData handlerSends 16 economy constants to the viewer on request
MoneyBalanceRequest handlerQueries money module, sends MoneyBalanceReply
MoneyTransferRequest handlerValidates via money module, sends balance result
RequestPayPrice handlerQueries object pay price, sends PayPriceReply
ObjectBuy handlerValidates sale type and price, delivers a copy or the original to the buyer's inventory; the sample economy charges nothing
/currency.phpXML-RPC: getCurrencyQuote and buyCurrency
/landtool.phpXML-RPC: preflightBuyLandPrep and buyLandPrep
SimulatorFeaturescurrency-base-uri in OpenSimExtras
LSL bindingsllGiveMoney, llTransferLindenDollars, llSetPayPrice, money() event
EventManager hooksOnMoneyTransfer, OnObjectPaid, OnValidateLandBuy, OnLandBuy
DTL/NSL proxyForwards all money calls to external CurrencyServer URL via XML-RPC
Gloebit clientNative Rust HTTP client: OAuth2 flow, balance queries, transfers, hypergrid-aware

Key decisions

  1. Plugin interface is trait-based, selected by config string. No WASM or dynamic loading needed.
  2. SampleMoneyModule is the default for grids without commerce. Zero cost for everything, matching OpenSimulator behavior exactly.
  3. Economy constants (16 fields in EconomyData) are configurable via the [Economy] config section, not hardcoded.
  4. DTL/NSL proxy mode forwards to the existing MoneyServer.exe without changes on the currency server side.
  5. Gloebit client handles the full OAuth2 flow natively in Rust, including sandbox mode for testing.

Tests

DTL/NSL proxy tested against reference MoneyServer.exe. Gloebit module tested against the Gloebit sandbox API.

Commits

HashDescription
dcc3e8bPhase 1: MoneyModule trait, packet handlers, XML-RPC endpoints (14 tasks)
053819dPhase 2: LSL money API and money() event (4 tasks)
cc9520aPhase 3: DTL/NSL proxy and Gloebit client (5 tasks)