Ramper Documentation
  • 🌟WELCOME
  • 👨‍💻Developer Guide
    • Developer Dashboard
  • 🔐EMBEDDED WALLET SDK
    • Quickstart
      • For Web Apps
        • Multichain Supported
          • Wallet Integration
          • Approve NFT
          • Approve Token
          • Sign Typed
        • Get Started on Viction
      • For Unity Apps
      • For Telegram Mini Apps
        • Set up Telegram bot
        • Implement Ramper Telegram SDK
      • For React Native Apps
        • Installation
        • Getting Started
        • Wallet Integration
        • Sign Typed
        • Approve
    • Terms & Conditions
    • Privacy Policy
  • 💜RAMPER WALLET
    • About Ramper Wallet
    • 📖User Guides
      • Authentication
      • How to send NFTs
      • How to sign in to a new account
      • Wallet settings
      • How to Send & Receive tokens
      • How to add custom tokens
      • Manage Tokens
      • General settings
      • How to send assets via email
      • How to use Vault
      • How to send assets via OneID
      • How to migrate accounts from Old version to New version
    • ❓User FAQs
      • Which networks are supported on Ramper?
      • What social accounts can I use to log in to Ramper?
      • What is the difference between a Password and a Passphrase?
      • Zero-gas transactions
      • Does Ramper hold my funds?
      • Can I import my wallet from Ramper to another Web3 wallet?
      • Can I import my wallet to Ramper?
      • Why can't I see my assets?
      • What is gas fee?
      • Can I get my assets back if I send them to the wrong addresses?
      • I forgot the password of my social accounts. How can I access my funds on Ramper?
      • What happens if my social account is compromised?
      • Can I recover my wallet if I lose my social account?
      • Can I change the email that is associated with my wallet address?
      • I can't find the answer to my question. How can I get support?
      • What is a Protected Account?
      • I forgot the PIN code to log in to Ramper Wallet. How can I access my funds?
      • Which email domains are blocked?
    • Ramper Wallet (Extension) Integration
      • EVM Dapp Integration
      • Sei Dapp Integration
    • Privacy Policy
    • Terms of Service
  • 💸NFT CHECKOUT SDK
    • About Ramper NFT Checkout
    • Get Started on EVM
    • Get Started on NEAR
    • Setting Up Your Collection
    • Moving Your Collection to Production
    • Purchase History
    • Terms of Service
    • Privacy Policy
  • Import
Powered by GitBook
On this page
  • Supported platform
  • Installation
  • Setup
  • Usage
  • Connecting to a Wallet
  • Dependencies
  1. EMBEDDED WALLET SDK
  2. Quickstart

For Unity Apps

PreviousGet Started on VictionNextFor Telegram Mini Apps

Last updated 6 months ago

Overview

The Ramper Unity SDK is a no-code integration solution for Unity projects to have embedded Web3 wallet and dapp-to-wallet signatures signing within their app, allowing their users to instantly own a self-custodial wallet just by signing in with Email or SSO (Gmail, Facebook, Twitter, Apple ID, Telegram). Onboarding Web2 users to onchain games has been never this easy!

Supported platform

  • Android

  • iOS

Installation

Download and Import: Download the unity-ramper-latest.unitypackage and import it into your Unity project.

Setup

After installation, you need to configure the SDK settings.

1. Open the Settings Asset:

Go to the Unity top menu and select Ninety Eight > Ramper SDK Setting.

2. Configure the Settings:

  • App ID: Enter the appId provided by Ramper.

  • Game Slug (Optional for Games not connected to Ninety Eight game server): Enter the gameSlug provided by Ninety Eight.

  • Is Debug: Toggle this option to enable or disable debug logs.

Demo Wallet: For testing in the Unity editor, enter a fixed wallet address to simulate wallet interactions. These settings ensure that your SDK is properly configured for use within your Unity project.

Usage

Connecting to a Wallet

Basic login method

Use the Login method to connect to a Web3 wallet. This method opens a web view for the user to authenticate their wallet.

Parameters

  • message: The message to sign with the wallet. An empty string is acceptable.

C98SDK.Ins.Login(message, dataCallback =>
{
   if (connectCallback.success)
    {
        Debug.Log("Successfully connected: " + connectCallback.data.wallets.ethereum.publicKey);
    }
    else
    {
        Debug.LogError("Failed to connect. error: " + connectCallback.error);
    }
});

Login direct with Provider

LoginDirect is a function that supports custom social login buttons in your app.

Parameters

  • provider: The provider directs to the login method for Ramper.

  • message: The message to sign with the wallet. An empty string is acceptable.

C98SDK.Ins.LoginDirect("google", message, dataCallback =>
{
   if (connectCallback.success)
    {
        Debug.Log("Successfully connected: " + connectCallback.data.wallets.ethereum.publicKey);
    }
    else
    {
        Debug.LogError("Failed to connect. error: " + connectCallback.error);
    }
});

We support the most popular providers: Google, Apple, Facebook, Telegram and Email.

Signing a Message

The SignMessage method allows you to sign messages, which is essential for authentication and transaction verification in Web3 applications.

C98SDK.Ins.SignMessage("Your message here", (signMessageCallback) =>
{
    if (signMessageCallback.success)
    {
        Debug.Log("Message signed: " + signMessageCallback.signature);
    }
    else
    {
        Debug.LogError("Failed to sign message.");
    }
});

Signing a Transaction

You can sign transactions using the SignTransaction method. This is critical for executing actions on the blockchain.

C98SDK.Ins.SignTransaction(transactionData, (signTransactionCallback) =>
{
    if (signTransactionCallback.success)
    {
        Debug.Log("Transaction signed: " + signTransactionCallback.transactionHash);
    }
    else
    {
        Debug.LogError("Failed to sign transaction.");
    }
});

Dependencies

  • Unity: Version 2020.3 or higher.

  • WebView: The SDK leverages a web view for user authentication.

🔐
https://game-sdk.static.cyborg.game/unity-ramper-v2.1.2_b.unitypackage