Skip to content

Commit 6a1f4fc

Browse files
committed
Update README.md
1 parent f87d9f6 commit 6a1f4fc

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ Important: If you're uploading your build, set `Compression Format` to `Disabled
6969

7070
Please 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

7474
Here's a simple way to do so, assuming you are in your WebGL build output folder:
75+
7576
```csharp
7677
const express = require('express');
7778
const app = express();
@@ -85,6 +86,7 @@ app.use(function(req, res, next) {
8586
app.use(express.static('.'));
8687
app.listen(port, () => console.log(`Server running on http://localhost:${port}`));
8788
```
89+
8890
Once 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.
98100
In 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
105104
var 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
122121
CurrencyValue currencyValue = await contract.ERC20.TotalSupply();
123122
NFT erc721NFT = await contract.ERC721.Get(tokenId);
124123
List<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
128127
await contract.ERC20.Mint("1.2");
129-
await contract.ERC721.signature.Mint(signedPayload);
128+
await contract.ERC721.Signature.Mint(signedPayload);
130129
await contract.ERC1155.Claim(tokenId, quantity);
131-
await marketplace.BuyListing(listingId, quantity);
130+
await contract.Marketplace.DirectListings.BuyListing(listingId, quantity);
132131

133132
// Custom interactions
134133
var res = await contract.Read<string>("myReadFunction", arg1, arg2, ...);

0 commit comments

Comments
 (0)