🛠️ Step 1: Install Sequence’s Unity SDK

Download v5 from the SDK’s GitHub Releases to access Ecosystem Wallets. You can download it as a .unitypackage file and simply add it to your Unity project. To see Ecosystem Wallets in action, try our Built-In Demo.

🔑 Step 2: Configure your Unity Project

Go to sequence.build, sign up or log in, and create a new project. You can follow the Builder Getting Started guide to get a step by step flow. Follow our Unity Setup to configure the Unity SDK.

💼 Step 3: Create a Session with Permissions

To send a transaction to a specific contract, you must first create a session with the required permissions.
Chain chain = Chain.TestnetAbitrumSepolia;
Address contractAddress = new Address("0x33985d320809E26274a72E03268c8a29927Bc6dA");
BigInteger deadline = new BigInteger(DateTimeOffset.UtcNow.ToUnixTimeSeconds() * 1000 + 1000 * 60 * 5000);
BigInteger valueLimit = 0;

IPermissions permissions = new ContractPermissions(chain, contractAddress, deadline, valueLimit);
Next, let’s create the SequenceConnect interface with these permissions to create a wallet session. Checkout other login options here.
SequenceConnect connect = new SequenceConnect();
IWallet wallet = await connect.SignInWithGoogle(permissions);

📨 Step 4: Send Transactions

Finally, let’s use our wallet session to send a transaction to the contract address specified in our permissions.
Chain chain = Chain.TestnetAbitrumSepolia;
Address to = new Address("0x33985d320809E26274a72E03268c8a29927Bc6dA");

ITransaction[] transactions = new Transaction[]
{
    new Transaction(to, 0, "explicitEmit()")
};

string txnHash = await wallet.SendTransaction(chain, transactions);