@@ -69,9 +69,10 @@ Important: If you're uploading your build, set `Compression Format` to `Disabled
6969
7070Please note that Embedded Wallets (OAuth version) may not work when testing locally using Unity's default Build and Run feature for WebGL.
7171
72- You must host the build or run it locally yourself after adding the ` Cross-Origin-Opener-Policy ` header and setting it to ` same-origin-allow-popups ` .
72+ You must host the build or run it locally yourself after adding the ` Cross-Origin-Opener-Policy ` header and setting it to ` same-origin-allow-popups ` .
7373
7474Here's a simple way to do so, assuming you are in your WebGL build output folder:
75+
7576``` csharp
7677const express = require ('express' );
7778const app = express ();
@@ -85,6 +86,7 @@ app.use(function(req, res, next) {
8586app .use (express .static ('.' ));
8687app .listen (port , () => console .log (`Server running on http :// localhost:${port}`));
8788 ```
89+
8890Once again , please note that no action is needed for hosted builds .
8991
9092## Mobile
@@ -98,9 +100,6 @@ Once again, please note that no action is needed for hosted builds.
98100In order to access the SDK , you only need to have a [ThirdwebManager ](https :// portal.thirdweb.com/unity/thirdwebmanager) in your scene.
99101
100102```csharp
101- // Reference to your Thirdweb SDK
102- var sdk = ThirdwebManager .Instance .SDK ;
103-
104103// Configure the connection
105104var connection = new WalletConnection (
106105 provider : WalletProvider .EmbeddedWallet , // The wallet provider you want to connect to (Required)
@@ -109,26 +108,26 @@ var connection = new WalletConnection(
109108 );
110109
111110// Connect the wallet
112- string address = await sdk . wallet .Connect (connection );
111+ string address = await ThirdwebManager . Instance . SDK . Wallet .Connect (connection );
113112
114113// Interact with the wallet
115- CurrencyValue balance = await sdk . wallet .GetBalance ();
116- var signature = await sdk . wallet .Sign (" message to sign" );
114+ CurrencyValue balance = await ThirdwebManager . Instance . SDK . Wallet .GetBalance ();
115+ var signature = await ThirdwebManager . Instance . SDK . Wallet .Sign (" message to sign" );
117116
118117// Get an instance of a deployed contract (no ABI required!)
119- var contract = sdk .GetContract (" 0x..." );
118+ var contract = ThirdwebManager . Instance . SDK .GetContract (" 0x..." );
120119
121- // Fetch data from any ERC20/721/1155 or marketplace contract
120+ // Fetch data from any ERC20/721/1155 or Marketplace contract
122121CurrencyValue currencyValue = await contract .ERC20 .TotalSupply ();
123122NFT erc721NFT = await contract .ERC721 .Get (tokenId );
124123List < NFT > erc1155NFTs = await contract .ERC1155 .GetAll ();
125- List < Listing > listings = await marketplace .GetAllListings ();
124+ List < Listing > listings = await contract . Marketplace . DirectListings .GetAllListings ();
126125
127126// Execute transactions from the connected wallet
128127await contract .ERC20 .Mint (" 1.2" );
129- await contract .ERC721 .signature .Mint (signedPayload );
128+ await contract .ERC721 .Signature .Mint (signedPayload );
130129await contract .ERC1155 .Claim (tokenId , quantity );
131- await marketplace .BuyListing (listingId , quantity );
130+ await contract . Marketplace . DirectListings .BuyListing (listingId , quantity );
132131
133132// Custom interactions
134133var res = await contract .Read <string >(" myReadFunction" , arg1 , arg2 , .. .);
0 commit comments