wallet-module

Manage in-game currency wallets with BigDouble arithmetic, reactive updates, atomic transactions, caps, and versioned saves for Unity via ISaveService and MessagePipe events.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/punkfuncgames/tetris-clone --skill wallet-module
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wallet-module
Source: https://github.com/punkfuncgames/tetris-clone/tree/main/.claude/skills/wallet-module
Command: npx skills add https://github.com/punkfuncgames/tetris-clone --skill wallet-module

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a production-ready system to manage in-game currencies reliably, solving issues around precision, caps, persistence, and reactive UI updates so values remain consistent across gameplay, saves, and edge-case flows like prestige or bulk transactions.

Core Features & Use Cases

  • Reactive Currency Containers: ReadOnlyReactiveProperty bindings for live UI updates and direct subscription to amount and cap changes.
  • BigNumber Precision: BigDouble storage and arithmetic to support very large values without precision loss.
  • Persistence & Versioning: Batched and immediate saves, lazy load into pending buffers, and versioned WalletData serialization for robust save/load behavior.
  • Atomic Transactions & Caps: Atomic multi-currency consumption, cap enforcement with events on clamps, and lifetime earned/spent statistics persisted for analytics.
  • Event-Driven Integration: MessagePipe events for CurrencyChangedEvent, CurrencyCapChangedEvent, and CurrencyInsufficientFundsEvent to decouple systems like shops, production, and prestige.
  • Use Cases: Implementing in-game shops, idle/production reward systems, prestige/reset mechanics, and multi-currency economies that require accurate accounting and UI binding.

Quick Start

Register your CurrencyDefinition assets, call InitializeAsync on IWalletService to apply pending save data, bind CurrencyContainer.Amount to your UI, and use IWalletService.Add or Consume to modify balances.

Frequently Asked Questions about wallet-module

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage large in-game currency balances without precision loss in Unity?

Managing large in-game currency balances without precision loss in Unity requires BigDouble arithmetic storage. This wallet system uses BigDouble to support very large values, preventing floating-point errors during idle or production reward calculations.

How do I update Unity UI elements automatically when in-game currency changes?

Updating Unity UI elements automatically when in-game currency changes uses ReadOnlyReactiveProperty bindings. The reactive currency containers expose Amount properties for direct UI subscription, delivering live updates without manual refresh calls.

Can I execute atomic multi-currency transactions for in-game shop purchases?

Executing atomic multi-currency transactions for in-game shop purchases is supported natively. The system ensures multi-currency consumption happens atomically, enforcing caps and publishing insufficient funds events if the operation cannot complete.

Does this Unity wallet system support persistent saves and versioned serialization?

Persistent saves and versioned serialization are supported via the ISaveService interface. The system handles batched and immediate saves, lazy loading into pending buffers, and persists WalletData with versioning for robust save and load behavior.

How do I decouple Unity shop and prestige systems from currency management logic?

Decoupling Unity shop and prestige systems from currency management logic uses MessagePipe event publishing. The system broadcasts CurrencyChangedEvent and CurrencyInsufficientFundsEvent so external systems react without direct dependencies.

What is the best way to track lifetime earned and spent statistics for game economy analytics?

Tracking lifetime earned and spent statistics for game economy analytics is handled internally. The system persists lifetime earned and spent totals automatically during add and consume operations, providing accurate data for analytics without manual aggregation.