Skip to content

Latest commit

 

History

History
68 lines (51 loc) · 3.21 KB

walletconnect-2.0-and-unreal-engine-5-hello-world-example.md

File metadata and controls

68 lines (51 loc) · 3.21 KB
description
This is a straightforward blueprint example that demonstrates how to send transactions using WalletConnect 2.0 in Unreal Engine 5.

WalletConnect 2.0 and Unreal Engine 5: Hello World Example

Hello World

  1. Prepare DeFi wallet or MetaMask.

  2. Download walletconnect demo project

  3. 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).\

    enter from address , to address , and project id

  4. 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"}

initialize WalletConnect 2.0 in the game

  1. ShowQR
    • Update the texture by rendering the QR code image onto it

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.

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

after signing the transaction with a DeFi wallet or MetaMask, the transaction will be broadcast to the network