Connect
Cometh ConnectCometh MarketplaceCometh Checkout
  • Demo
  • 🚀QUICKSTART
    • What is Connect
    • Getting started
    • Supported Networks
    • Connect 4337
  • ⚒️FEATURES
    • Create a wallet
    • Send transactions
    • Sign/Verify a message
    • Retrieve a wallet Address
    • Import a Safe wallet
    • Handle wallet owners
  • 🔌Integrations
    • Ethers
    • Wagmi - Viem
      • Viem
      • Wagmi
      • Wagmi + Rainbowkit
      • Wagmi + Web3modal
    • Unity
    • React issues
      • Vite
      • Create React App
  • 📖RESOURCES
    • FAQ
    • Advanced features
      • Add a new device
      • Recover users wallets
    • General concepts
      • Biometric signers
      • Multiple devices
      • Account Recovery
      • Gasless transaction
Powered by GitBook
On this page
  • Install
  • Instantiate a Connect Wallet
  • Available methods
  • Signer Requests
  1. Integrations

Unity

Unity version of the connect sdk

Last updated 1 year ago

Install

see

Instantiate a Connect Wallet

private const string API_KEY = "my_api_key";
private int _chainId = 80001;
private ConnectAdaptor _connectAuthAdaptor;
private ComethWallet _wallet;

private void Start()
{
    if (string.IsNullOrEmpty(apiKey) || chainId == 0)
    {
	Debug.LogError("Please set the apiKey and chainId serialised variables");
	return;
    }
    _connectAuthAdaptor = new ConnectAdaptor(chainId, apiKey, baseUrl);
    _wallet = string.IsNullOrEmpty(baseUrl)
	? new ComethWallet(_connectAuthAdaptor, apiKey)
	: new ComethWallet(_connectAuthAdaptor, apiKey, baseUrl);
}

Available methods

  • Create a Wallet

await _wallet.Connect()
  • Connect to Wallet

await _wallet.Connect(WALLET_ADDRESS)
  • Get Address

await _wallet.GetAddress()
  • Send transaction

var safeTxHash = await _wallet.SendTransaction(to, value, data);
  • Get Transaction Receipt

var transactionReceipt = await _wallet.Wait(safeTxHash);
  • Sign Message

var messageSigned = await _wallet.SignMessage("Hello World!");
  • Init a new Signer Request

var addSignerRequest = await connectAuthAdaptor.InitNewSignerRequest(walletAddress);
  • Get all Signer Requests

var newSignerRequests = await connectAuthAdaptor.GetNewSignerRequests();

🔌
github
Signer Requests