Futurepass Inventory
A demonstration of how to use emergence to Access and Display the inventory of a Futureverse Connected wallet.
Last updated
A demonstration of how to use emergence to Access and Display the inventory of a Futureverse Connected wallet.
Last updated
This demonstrations shows how to utilise the FutureverseInventoryService to display the contents of a Futureverse Inventory in an in game UI. All that's required to do this is an active FV wallet connection (as shown in the Furepass Login demo)
FutureverseInventoryService is a service managed by our EmergenceServiceProvider the service provider dynamically returns the appropriate inventory service when accessed.
Firstly we call the emergence service provider to get the current IInventory service. Because we've connected with the FV login flow this will be the FutreverseInventoryService. As with other functions in the Emergence SDK we can do this using Event binding. here you can see we cache our services as variables within the script.
Now that we've cahced those services we can utilise them to retreive an inventory. We call the InventoryByOwner method on our inventory service.
We pass: - our wallet address - the chain we want to pull NFT's from (in this case any compatible chain) - A callback method to be fired on successful execution - A callback method for error handling.
Our successful callback method will cache all of our inventory items, and then generate some UI elements to represent those items.
This dynamically generated inventory will be displayed in scene!