crossx-20-unreal

CROSSx Unreal Skill

Documentation

Instructions

Identify the request category first, then make the smallest C++ changes that fit the existing Unreal project structure.

Treat the CROSSx Unreal documentation linked above as the primary source for SDK usage, integration flow, and sample patterns.

If the bundled Unreal docs do not fully answer the question or the latest SDK behavior is unclear, prefer the official cross MCP server before unrelated documentation sources.

File Discovery

Before editing, find the existing integration points for plugin setup, deep link callback, SDK configuration, authentication flow, and wallet-related actions.

Check these first when they exist:

  • .Build.cs file (module dependency setup)
  • AndroidManifest.xml (deep link intent filter for Android)
  • Info.plist (URL scheme for iOS)
  • GameInstance or GameMode holding SDK initialization
  • Existing actor or subsystem calls to UCrossySdkSubsystem

Prefer extending existing integration points over introducing new actors or subsystem wrappers.

Request Classification

Classify each request into one or more of these categories before writing code:

  • SDK setup: plugin install, .Build.cs module dependency, FCrossySdkConfig values, Configure() + InitializeSdk(), deep link registration (Windows registry, Android manifest, iOS URL scheme)
  • Authentication: login provider (ECrossyLoginProvider), SignInAsync / SignInWithCreateAsync, session restore via InitializeSdk, EnsureLoggedInAndRefresh, sign-out, SignInAgainAsync
  • Wallet: wallet state check (CheckWalletAsync), wallet setup (SetupWalletWithUIAsync / CreateWalletWithMigrateAsync), address lookup, wallet selection (SelectWalletWithUIAsync)
  • Signing and transactions: sign message, sign typed data (on-chain vs off-chain), sign transaction, send transaction, wait for receipt — always use UI-integrated (WithUIAsync) variants
  • RPC and chain access: WalletRpc / WalletRpcAsync, GetBalance, GetNonce, chain-specific read operations
  • UI and confirmation: EnableSignConfirmation, ApplyTheme, theme tokens, biometrics
  • Events: OnSignInComplete, OnSignOutComplete, OnSessionExpired
  • Locale: SetLocale, GetLocale

If a request spans multiple categories, handle setup and authentication prerequisites before wallet, signing, transaction, or RPC work.

Preconditions

Confirm the required setup before implementing a feature.

  • SDK setup requires a real ProjectId, AppId, and AppName provided by the user or already present in project configuration.
  • AppId is required — it is used as the gateway whitelist identifier (X-App-Id header).
  • The deep link callback scheme is crossy-{ProjectId} — use FCrossySdkConfig::GetCustomUriScheme().
  • Android requires an intent filter in AndroidManifest.xml with android:scheme="crossy-{ProjectId}" on com.epicgames.unreal.GameActivity.
  • iOS requires URL scheme registration in Info.plist under URL Types.
  • Windows registry entries are handled by the SDK's deep link adapter automatically.
  • Use ECrossySdkEnvironment::Development / Staging / Production for automatic URL resolution. Use Custom only when overriding URLs manually.
  • Call Configure(Config) then InitializeSdk() on app start to attempt session restore.
  • Call EnableSignConfirmation(AppName) before any sign/send operations to enable the confirmation modal UI.
  • Wallet and RPC work require a valid login state and the correct CAIP-2 chain ID (eip155:<number>).
  • After login, wallet-dependent flows may still require wallet setup. Use SetupWalletWithUIAsync() as the primary wallet setup method; it handles creation, migration, and verification internally.
  • CreateWalletWithMigrateAsync(bMigrateAutomatically, ...) is the lower-level alternative — pass true to auto-migrate, false to surface migration errors for manual handling.
  • Always use UI-integrated signing/sending APIs (SignMessageWithUIAsync, SignTransactionWithUIAsync, etc.). Low-level sync APIs require a private internal Prepare() call and should not be used directly.
  • From must not be empty for all sign and send flows.
  • Use SignTypedDataOffchainWithUIAsync when the typed data has no domain.chainId; use SignTypedDataWithUIAsync when it does.

Guardrails

  • Do not assume authentication is complete unless Configure() + InitializeSdk() are called and the session flow is wired correctly.
  • Do not use wallet or RPC features as the default path before confirming login state.
  • Do not use WalletRpc / WalletRpcAsync for transaction signing or sending — they are read-only.
  • Do not use low-level sync signing APIs (SignTransaction, SignMessage, etc.) directly — they require a private Prepare() call. Always use the WithUIAsync variants instead.
  • Do not add new subsystem wrappers or actor layers when the feature can fit existing integration points.
  • Do not guess unclear SDK behavior when the latest documentation or MCP resources should be checked first.
  • Do not generate fallback values such as unreal-host, placeholder app IDs, or sample project IDs for ProjectId or AppId.
  • If ProjectId or AppId is missing, ask the user for them before writing SDK setup code.

Implementation Workflow

  1. Identify the feature category and the affected Unreal files.
  2. Inspect the existing project structure before making changes.
  3. Confirm the required setup before adding feature code.
  4. Apply the smallest code change that fits the existing architecture and style.
  5. Use the correct SDK APIs, CAIP-2 chain IDs, and delegate patterns.
  6. Review the affected files for integration gaps before finalizing.

Validation Checklist

Before finalizing CROSSx Unreal SDK changes, verify the following:

  • The change matches the requested feature scope without unnecessary refactoring.
  • FCrossySdkConfig includes a real ProjectId, AppId, and AppName.
  • Android manifest has the correct deep link scheme (crossy-{ProjectId}) when auth flows are used.
  • Configure(Config) and InitializeSdk() are called on app start.
  • EnableSignConfirmation(AppName) is called before sign/send operations.
  • Authentication, wallet, and RPC flows satisfy login and session requirements.
  • After login, wallet state is handled via SetupWalletWithUIAsync() or CreateWalletWithMigrateAsync() for wallet-dependent flows.
  • All signing/sending uses UI-integrated (WithUIAsync) variants, not low-level sync APIs.
  • From is non-empty in all sign and send calls.
  • On-chain vs off-chain typed data uses the correct method (SignTypedDataWithUIAsync vs SignTypedDataOffchainWithUIAsync).
  • WalletRpc is only used for read-only call scenarios.
  • Errors are handled via result structs (bSuccess, ErrorCode, ErrorMessage); handle SessionExpired (session expired modal shown by SDK) and AccountMismatch (re-auth returned different account) separately from other errors.

© 2025 NEXUS Co., Ltd. All Rights Reserved.