diff --git a/.gitbook/assets/image (10).png b/.gitbook/assets/image (10).png new file mode 100644 index 00000000..9729b9af Binary files /dev/null and b/.gitbook/assets/image (10).png differ diff --git a/.gitbook/assets/image (11).png b/.gitbook/assets/image (11).png new file mode 100644 index 00000000..81eea28a Binary files /dev/null and b/.gitbook/assets/image (11).png differ diff --git a/.gitbook/assets/image (12).png b/.gitbook/assets/image (12).png new file mode 100644 index 00000000..e74c477d Binary files /dev/null and b/.gitbook/assets/image (12).png differ diff --git a/.gitbook/assets/image (5).png b/.gitbook/assets/image (5).png new file mode 100644 index 00000000..9f23540a Binary files /dev/null and b/.gitbook/assets/image (5).png differ diff --git a/.gitbook/assets/image (7).png b/.gitbook/assets/image (7).png new file mode 100644 index 00000000..2a561256 Binary files /dev/null and b/.gitbook/assets/image (7).png differ diff --git a/.gitbook/assets/image (8).png b/.gitbook/assets/image (8).png new file mode 100644 index 00000000..c27a6cf8 Binary files /dev/null and b/.gitbook/assets/image (8).png differ diff --git a/.gitbook/assets/image (9).png b/.gitbook/assets/image (9).png new file mode 100644 index 00000000..c27a6cf8 Binary files /dev/null and b/.gitbook/assets/image (9).png differ diff --git a/SUMMARY.md b/SUMMARY.md index 8ab2a7fa..767acbaf 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -97,6 +97,7 @@ * [Connect Defi Wallet with URI](cronos-play/getting-started\_unreal/quick-start/connect-defi-wallet-with-uri.md) * [Connect Wallets with QR Code](cronos-play/getting-started\_unreal/quick-start/connect-wallets-with-qr-code.md) * [Connect WalletConnect Step by Step](cronos-play/getting-started\_unreal/quick-start/walletconnect.md) + * [WalletConnect 2.0 and Unreal Engine 5: Hello World Example](cronos-play/getting-started\_unreal/quick-start/walletconnect-2.0-and-unreal-engine-5-hello-world-example.md) * [Wallet](cronos-play/getting-started\_unreal/quick-start/wallet.md) * [ERC20](cronos-play/getting-started\_unreal/quick-start/erc20.md) * [ERC721](cronos-play/getting-started\_unreal/quick-start/erc721.md) diff --git a/cronos-play/getting-started_unreal/demo.md b/cronos-play/getting-started_unreal/demo.md index ec3c4082..b6cb7bdb 100644 --- a/cronos-play/getting-started_unreal/demo.md +++ b/cronos-play/getting-started_unreal/demo.md @@ -58,7 +58,7 @@ This demo shows the basic ERC721/ERC1155 usage on a first-character shooting gam * Plugin: Cronos Play For Unreal Engine in Epic Marketplace\ -### [walletconnect](https://github.com/cronos-labs/play-unreal-demo/tree/main/walletconnect) +## [walletconnect](https://github.com/cronos-labs/play-unreal-demo/tree/main/walletconnect) This demo shows walletconnect 2.0 signing with blueprint on unreal engine 5.4 diff --git a/cronos-play/getting-started_unreal/quick-start/walletconnect-2.0-and-unreal-engine-5-hello-world-example.md b/cronos-play/getting-started_unreal/quick-start/walletconnect-2.0-and-unreal-engine-5-hello-world-example.md new file mode 100644 index 00000000..0488d0b0 --- /dev/null +++ b/cronos-play/getting-started_unreal/quick-start/walletconnect-2.0-and-unreal-engine-5-hello-world-example.md @@ -0,0 +1,68 @@ +--- +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. + * rpc: [https://evm-dev-t3.cronos.org/](https://evm-dev-t3.cronos.org/) + * chainid: 338 + * currency symbol: tcro + * explorer: [https://explorer.cronos.org/testnet/](https://explorer.cronos.org/testnet/) +2. [Download walletconnect demo project ](https://github.com/cronos-labs/play-unreal-demo/releases/download/v0.0.11-alpha/CronosPlayWalletConnectDemo.zip) +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

+ + + +2. ShowQR + * Update the texture by rendering the QR code image onto it + +

update the texture by rendering the QR code image onto it.

+ +3. 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

+ +4. 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