Skip to main content
The Immutable SDK exposes all functionality to Blueprints, enabling full integration without C++ code.

Getting Started

Access the Immutable Subsystem

The ImmutableSubsystem is your entry point for all SDK operations:
Event BeginPlay
    └── Get Game Instance
        └── Get Subsystem (Class: ImmutableSubsystem)
            └── Store as variable "Immutable"

Initialize the SDK

Call Initialize before any other operations:
Event BeginPlay
    └── Immutable → Initialize

Authentication

Login Flow

Event OnLoginButtonClicked
    └── Immutable → Login
        ├── On Success → Set "WalletAddress" variable
        │              └── Update UI
        └── On Failure → Show error message

Check Existing Session

For returning users:
Event BeginPlay
    └── Immutable → Is Logged In
        ├── True → Skip to main menu
        └── False → Show login screen

Get Wallet Address

Immutable → Get Wallet Address
    └── Store as "WalletAddress"

Logout

Event OnLogoutButtonClicked
    └── Immutable → Logout
        └── On Complete → Return to login screen

Wallet Operations

Get User Info

Immutable → Get User Info
    ├── On Success → Display email, user ID
    └── On Failure → Handle error

Send Transaction

Make Transaction Request
    ├── To: "0xRecipient..."
    ├── Value: "1000000000000000000"  (1 IMX in wei)
    └── Data: "0x"

Immutable → Send Transaction (Request)
    ├── On Success → Show "Transaction: {TxHash}"
    └── On Failure → Show error

Sign Message

Immutable → Sign Message ("Hello World")
    ├── On Success → Use signature
    └── On Failure → Handle error

Indexer Queries

Get Player’s NFTs

Immutable → List NFTs By Owner (WalletAddress, ContractAddress)
    ├── On Success → For Each NFT
    │              └── Create inventory slot widget
    │                  └── Set NFT data (Name, Image, TokenId)
    └── On Failure → Show error

Get Collection Info

Immutable → Get Collection (ContractAddress)
    ├── On Success → Display collection name, total supply
    └── On Failure → Handle error

Orderbook (Alpha)

List NFTs for Sale

Immutable → List Listings (ContractAddress, Status: Active)
    ├── On Success → For Each Listing
    │              └── Create marketplace card
    │                  └── Set price, seller, token info
    └── On Failure → Show error

Create Listing

Make Prepare Listing Request
    ├── Maker Address: WalletAddress
    ├── Sell: ERC721 Item (Contract, TokenId)
    └── Buy: Native Item (Amount in wei)

Immutable → Prepare Listing (Request)
    └── On Success → Sign Typed Data
                    └── Create Listing (with signature)
                        └── Show "Listing created"

Buy NFT

Immutable → Fulfill Order (ListingId, BuyerAddress)
    └── On Success → For Each Action
                    └── If Action Type == Transaction
                        └── Send Transaction
                            └── Wait for confirmation

UI Patterns

Inventory Grid

Widget Blueprint: W_InventoryGrid

Event Construct
    └── Load Inventory

Function: Load Inventory
    └── Clear Grid
    └── Immutable → List NFTs By Owner
        └── On Success → For Each NFT
                        └── Create Widget (W_InventorySlot)
                        └── Add to Scroll Box

Marketplace Listing Card

Widget Blueprint: W_ListingCard

Variables:
- ListingId (String)
- TokenId (String)
- Price (String)
- SellerAddress (String)

Function: Set Data (Listing)
    └── Set ListingId = Listing.Id
    └── Set TokenId = Listing.Sell.TokenId
    └── Set Price = Format as IMX
    └── Set SellerAddress = Listing.AccountAddress
    └── Load image from Listing.Sell.ImageUrl

Event OnBuyClicked
    └── Buy NFT (ListingId)

Error Handling

Generic Error Handler

Function: Handle Immutable Error (Error Message)
    └── Print String: Error Message
    └── Show UI notification
    └── Log to analytics (optional)

Retry Pattern

Function: Login With Retry (Attempts Remaining)
    └── If Attempts Remaining <= 0
        └── Show "Login failed" → Return
    └── Immutable → Login
        ├── On Success → Continue to game
        └── On Failure → Delay 2 seconds
                        └── Login With Retry (Attempts - 1)

Best Practices

Store Subsystem Reference

Get the subsystem once and store it:
Event BeginPlay
    └── Get Immutable Subsystem
    └── Store as variable (Immutable)
    └── Use variable for all subsequent calls

Handle Loading States

Show feedback during async operations:
Event OnLoginClicked
    └── Set "IsLoading" = True
    └── Disable login button
    └── Immutable → Login
        ├── On Success → Set "IsLoading" = False
        │              └── Enable button
        └── On Failure → Set "IsLoading" = False
                        └── Enable button

Validate Before Operations

Check prerequisites before calling SDK:
Function: Create Listing
    └── Is Valid (WalletAddress)?
        ├── False → Show "Please login first" → Return
        └── True → Continue with listing creation

Debugging Blueprints

  1. Print String nodes at key points
  2. Use Breakpoints (F9) on nodes
  3. Check Output Log for SDK messages
  4. Enable Blueprint Debugger in editor

Next Steps