Skip to content
ct

Class

Wallet

Generated GDScript class reference for ItemVault.Wallet.

Status
Current
Version
v1.0
Updated
2026-07-31

Currency container. Sub-component of ItemContainer, but also usable standalone. Currencies are identified by StringName (e.g. &"coins", &"gems", &"research_points"). The wallet tracks a balance per currency id. There is no implicit cap; cap logic lives in the game (e.g. weight, level, quest progress) and is enforced externally via can_afford / add / remove round-trips. A wallet may be a sub-component of an Inventory (so a player has one container holding both items and currencies) or a standalone instance (e.g. an NPC's quest reward pool). The class doesn't care. Buy/sell transactions move currencies atomically: add_coins() and remove_coins() return the new balance or a negative number on failure, so callers can roll back on partial failure.

Source: addons/item_vault/inventory/wallet.gd

Syntax

class Wallet extends RefCounted

Members

NameKindSummary
currency_changedSignalEmitted whenever any currency's balance changes. payload: { "currency": StringName, "old": int, "new": int }
get_balanceMethod
can_affordMethod
balancesMethod
currenciesMethod
addMethod
removeMethod
set_balanceMethod
clearMethod
transfer_fromMethod
merge_fromMethod
to_dictMethod
from_dictMethod