Asset API
Create, manage, and transfer digital assets across your applications.
Asset Types
- Fungible — Currencies, points, tokens
- Non-Fungible — Unique items, collectibles, characters
- Semi-Fungible — Stackable items with shared properties
Creating Assets
// Create an asset definition
const sword = await aethex.assets.create({
name: 'Legendary Sword',
type: 'non-fungible',
attributes: {
damage: 100,
rarity: 'legendary',
element: 'fire'
},
metadata: {
image: 'https://...',
description: 'A powerful blade forged in dragon fire'
}
});
Inventory Management
// Get user inventory
const inventory = await aethex.assets.getInventory();
// Grant asset to user
await aethex.assets.grant({
userId: 'user_abc',
assetId: 'sword_legendary_001',
quantity: 1
});
// Transfer between users
await aethex.assets.transfer({
from: 'user_abc',
to: 'user_xyz',
assetId: 'sword_legendary_001'
});