🛠️ Step 1: Install Sequence’s Unity SDK

Download v5.0.0 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: Add Your Project Access Key

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. Next, create a SequenceConfig.asset file in your Unity project and add the projectAccessKey to the configs Builder API Key field.

🌐 Step 3: Define your Ecosystem

Let’s start by defining an instance of the SequenceConnect interface.
EcosystemType ecosystem = EcosystemType.Sequence;
SequenceConnect connect = new SequenceConnect(ecosystem);

💼 Step 4: 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 use the SequenceConnect interface with these permissions to create a wallet session. Checkout other login options here.
IWallet wallet = await connect.SignInWithGoogle(permissions);

📨 Step 5: 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);