description |
---|
This is a straightforward blueprint example that demonstrates how to send transactions using WalletConnect 2.0 in Unreal Engine 5. |
-
Prepare DeFi wallet or MetaMask.
- rpc: https://evm-dev-t3.cronos.org/
- chainid: 338
- currency symbol: tcro
- explorer: https://explorer.cronos.org/testnet/
-
Open the "ThirdPerson/Code/MyWallet" file and navigate to the "Setup" function
- ProjectID:
- Visit WalletConnect Cloud.
- Go to the Projects section.
- Click on Create to generate a new project ID.
- From Address:
- Enter the signing address (the address from which the transaction will be signed).
- To Address:
- Enter the receiver address (the address to which the transaction will be sent).\
enter
from address
,to address
, andproject id
- ProjectID:
-
Run the project.
- You can sign transactions using a DeFi wallet or MetaMask.
- 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
- ShowQR
- Update the texture by rendering the QR code image onto it
update the texture by rendering the QR code image onto it.
- 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
- 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