Craft and Burn Items
Learn how to craft new items and burn existing ones using HandCash Items
Craft and Burn Items
Overview
HandCash Items provides powerful functionality to manage the lifecycle of digital items within your application. Two key features are:
- Burning Items: Remove items from a user’s inventory, destroying them permanently.
- Crafting Items: Create new items by combining or upgrading existing ones.
These features allow you to implement complex item economies and upgrade systems in your applications.
Burning Items
Burning items removes them from a user’s inventory and destroys them permanently. This process automatically decreases the circulating supply of the particular group of items.
The HandcashMinter must be initialized with the users connect authorization token who owns the items in which you wish to burn
Example: Burn Items
Crafting Items
Crafting allows you to burn existing items and simultaneously create new ones. This is useful for implementing upgrade systems or item combinations in games.
Example: Craft Items
Important Considerations
- Supply Tracking: The supply of items is automatically tracked. When items are burned, the circulating supply decreases.
- Irreversible Process: Burning items is permanent and cannot be undone. Ensure proper validation before executing burn orders.
- User Authentication: Make sure you have the correct authentication key for the user whose items you’re manipulating.
- Error Handling: Implement proper error handling to manage cases where items might not exist or the user doesn’t have sufficient items to burn.
Best Practices
- Confirm Actions: Always confirm with users before burning their items, especially if it’s a valuable or rare item.
- Clear Communication: Clearly communicate the results of crafting to users, showing what items were used and what new item was created.
- Balanced Economy: Design your crafting system carefully to maintain a balanced item economy in your application.
- Logging: Keep detailed logs of all burn and craft operations for troubleshooting and auditing purposes.
Follow this example use case to create an Openable Card Pack