WalletConnect 2.0 and Unreal Engine 5: Hello World Example

This is a straightforward blueprint example that demonstrates how to send transactions using WalletConnect 2.0 in Unreal Engine 5.

Hello World

  1. Prepare DeFi wallet or MetaMask.

  2. Open the "ThirdPerson/Code/MyWallet" file and navigate to the "Setup" function

    1. ProjectID:

      • Visit WalletConnect Cloud.

      • Go to the Projects section.

      • Click on Create to generate a new project ID.

    2. From Address:

      • Enter the signing address (the address from which the transaction will be signed).

    3. To Address:

      • Enter the receiver address (the address to which the transaction will be sent).

  3. Run the project.

    • You can sign transactions using a DeFi wallet or MetaMask.

Basic Flow

  1. Initialize

    • Prepare the session to connect.

    • Initialize WalletConnect 2.0 in the game.

    • Sample values

      • relay server: wss://relay.walletconnect.com

      • walletnamespace: {"eip155":{"methods":["eth_sendTransaction","eth_signTransaction","eth_sign","personal_sign","eth_signTypedData"],"chains":["eip155:338"],"events":["chainChanged","accountsChanged"]}}

      • clientmeta: {"description":"Defi WalletConnect v2 example.","url":"http://localhost:8080/","icons":[],"name":"Defi WalletConnect Web3 Example"}

  1. ShowQR

    • Update the texture by rendering the QR code image onto it

  1. EnsureSession

    • Connect to the WalletConnect session and wait until the user approves the connection.

    • To connect using WalletConnect 2.0, open your DeFi wallet or MetaMask and scan the QR code.

  1. SendTX

    • Once the WalletConnect session is established, the SendTX screen appears in the user's wallet.

    • If the user approves, the transaction is signed and broadcast.

    • Sample Values

      • gas: 1100000

      • gas price: 10646859727182

      • value: 190012345678912

      • data: none

      • nonce: none

Last updated