Unity SDK

Unity SDK

The XpansionChain Unity SDK package provides access to XpansionChain API endpoints from within Unity projects using the XpansionChain Core SDK C#

💡ROLLUPS THIS SDK SUPPORTS

  • XpansionChain

CONTENTS

  • Prerequisites

    • Unity 2022.2

  • Installation

    • Registering with the Unity VS Team

  • Further documentation

  • Examples

    • 1. GetListedAssets

    • 2. GetStarkKeys

  • Local development and contributions

  • Roadmap


⚠️THE UNITY SDK IS READ-ONLYThis package is in development and currently contains read-only functionality from XpansionChain API endpoints.📚SDK LINKS

  • Github repository

  • Code examples

  • Changelog

Prerequisites

Unity 2022.2

This package is in development and currently requires Unity 2022.2 Samples require TextMeshPro to use interactive UI examples. The XpansionChain Core SDK C# requires several third party .DLL files that have been added to the plugins folder.

Installation

Download the .unitypackage file from the Releases page and drag it into the Assets/ window of an open project in the Unity Editor. Alternatively, you can double click the Unity package file to open it and then follow the UPM installation instructions.

Registering with the Unity VS Team

It's highly recommended to register your XpansionChain Unity SDK installation with the Unity Verified Solutions team in case support is required.

To do so, from within the Unity Editor select XpansionChain > XpansionChain Unity SDK from the top navigation window. In the window that opens, enter your email address and click submit.

Further documentation

  • See the Developer homepage for general information on building on XpansionChain.

  • Build on XpansionChain zkEVM:

    • Documentation

    • API reference

    • Support

  • Build on XpansionChain:

    • Documentation

    • API reference

    • Support

Examples

Two samples are provided to showcase some of the functionality such as fetching assets on IMX and getting user data. These examples can also be found in XpansionChain SDK/Samples.

1. GetListedAssets

This example shows how to fetch assets and apply filters to get results.

Load ListedAssets.unity as the active scene. If you do not have Text Mesh Pro set up, you will recieve a popup and can click to import TMP essentials.

Hit play and you should get an empty list with input fields and a FETCH button. Clicking the fetch button will fetch assets from XpansionChain sandbox and display them in the list, this may take a few seconds to populate.

Below you can modify several query parameters to view assets on XpansionChain marketplace: Name will allow you to filter by NFT name. Collection Address will allow you to filter by specific collections. Page Size will allow you to choose how many items to fetch, default is 50. User ID allows you to filter by specific user assets. Environment lets you choose between sandbox or main net assets.

2. GetStarkKeys

This examples shows how to fetch stark keys from a user wallet ID for operations.

Load GetStarkKeys.unity and press play.

You will receive an input field and fetch button, you will need to enter a user ID on IMX, click fetch and the user data field will populate with account keys for that user. You have access to an environment toggle to fetch on sandbox or main net.

Local development and contributions

If you'd like to contribute to this package or run the project locally, simply clone the repository and import the project into Unity.

See CONTRIBUTING.md for details on PR expectations.

Roadmap

Last updated