@@ -69,9 +69,10 @@ Important: If you're uploading your build, set `Compression Format` to `Disabled
69
69
70
70
Please note that Embedded Wallets (OAuth version) may not work when testing locally using Unity's default Build and Run feature for WebGL.
71
71
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 ` .
73
73
74
74
Here's a simple way to do so, assuming you are in your WebGL build output folder:
75
+
75
76
``` csharp
76
77
const express = require ('express' );
77
78
const app = express ();
@@ -85,6 +86,7 @@ app.use(function(req, res, next) {
85
86
app .use (express .static ('.' ));
86
87
app .listen (port , () => console .log (`Server running on http :// localhost:${port}`));
87
88
```
89
+
88
90
Once again , please note that no action is needed for hosted builds .
89
91
90
92
## Mobile
@@ -98,9 +100,6 @@ Once again, please note that no action is needed for hosted builds.
98
100
In order to access the SDK , you only need to have a [ThirdwebManager ](https :// portal.thirdweb.com/unity/thirdwebmanager) in your scene.
99
101
100
102
```csharp
101
- // Reference to your Thirdweb SDK
102
- var sdk = ThirdwebManager .Instance .SDK ;
103
-
104
103
// Configure the connection
105
104
var connection = new WalletConnection (
106
105
provider : WalletProvider .EmbeddedWallet , // The wallet provider you want to connect to (Required)
@@ -109,26 +108,26 @@ var connection = new WalletConnection(
109
108
);
110
109
111
110
// Connect the wallet
112
- string address = await sdk . wallet .Connect (connection );
111
+ string address = await ThirdwebManager . Instance . SDK . Wallet .Connect (connection );
113
112
114
113
// 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" );
117
116
118
117
// Get an instance of a deployed contract (no ABI required!)
119
- var contract = sdk .GetContract (" 0x..." );
118
+ var contract = ThirdwebManager . Instance . SDK .GetContract (" 0x..." );
120
119
121
- // Fetch data from any ERC20/721/1155 or marketplace contract
120
+ // Fetch data from any ERC20/721/1155 or Marketplace contract
122
121
CurrencyValue currencyValue = await contract .ERC20 .TotalSupply ();
123
122
NFT erc721NFT = await contract .ERC721 .Get (tokenId );
124
123
List < NFT > erc1155NFTs = await contract .ERC1155 .GetAll ();
125
- List < Listing > listings = await marketplace .GetAllListings ();
124
+ List < Listing > listings = await contract . Marketplace . DirectListings .GetAllListings ();
126
125
127
126
// Execute transactions from the connected wallet
128
127
await contract .ERC20 .Mint (" 1.2" );
129
- await contract .ERC721 .signature .Mint (signedPayload );
128
+ await contract .ERC721 .Signature .Mint (signedPayload );
130
129
await contract .ERC1155 .Claim (tokenId , quantity );
131
- await marketplace .BuyListing (listingId , quantity );
130
+ await contract . Marketplace . DirectListings .BuyListing (listingId , quantity );
132
131
133
132
// Custom interactions
134
133
var res = await contract .Read <string >(" myReadFunction" , arg1 , arg2 , .. .);
0 commit comments