Skip to content

Commit b1f047e

Browse files
Update README
1 parent ffc9658 commit b1f047e

File tree

3 files changed

+69
-6
lines changed

3 files changed

+69
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,5 @@ crashlytics-build.properties
6767
.DS_Store
6868

6969
build/
70+
releases/
7071

Assets/ThirdwebSDKDemos.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,11 @@ public async void MintERC721()
101101

102102
// sig mint
103103
var contract = sdk.GetContract("0x8bFD00BD1D3A2778BDA12AFddE5E65Cca95082DF"); // NFT Collection
104-
var meta = new NFTMetadata();
105-
meta.name = "Unity NFT";
106-
meta.description = "Minted From Unity (signature)";
107-
meta.image = "ipfs://QmbpciV7R5SSPb6aT9kEBAxoYoXBUsStJkMpxzymV4ZcVc";
104+
var meta = new NFTMetadata() {
105+
name = "Unity NFT",
106+
description = "Minted From Unity (signature)",
107+
image = "ipfs://QmbpciV7R5SSPb6aT9kEBAxoYoXBUsStJkMpxzymV4ZcVc"
108+
};
108109
string connectedAddress = await sdk.wallet.GetAddress();
109110
var payload = new ERC721MintPayload(connectedAddress, meta);
110111
var p = await contract.ERC721.signature.Generate(payload); // typically generated on the backend

README.md

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,66 @@
1-
# thirdweb Unity SDK
1+
<p align="center">
2+
<br />
3+
<a href="https://thirdweb.com"><img src="https://github.com/thirdweb-dev/js/blob/main/packages/sdk/logo.svg?raw=true" width="200" alt=""/></a>
4+
<br />
5+
</p>
6+
<h1 align="center">thirdweb Unity SDK</h1>
7+
<p align="center">
8+
<a href="https://discord.gg/thirdweb"><img alt="Join our Discord!" src="https://img.shields.io/discord/834227967404146718.svg?color=7289da&label=discord&logo=discord&style=flat"/></a>
9+
10+
</p>
11+
<p align="center"><strong>Best in class Web3 SDK for Unity games</strong></p>
12+
<br />
13+
14+
## Supported platforms
15+
16+
- [x] WebGL
17+
- [ ] Desktop (coming soon)
18+
- [ ] Android (coming soon)
19+
- [ ] iOS (coming soon)
220

321
## Installation
422

5-
See [Unity docs](https://docs.unity3d.com/Manual/webgl-templates.html) on how to customize WebGL Templates.
23+
Head over to the [releases](/releases) page and download the latest `.unitypackage` file.
24+
25+
Drag and drop the file into your project.
26+
27+
The package comes with a sample Scene showcasing the different capabilities of the SDK.
28+
29+
## Build
30+
31+
- Open your `Build settings`, select `WebGL` as the target platform.
32+
- Open `Player settings` > `Resolution and Presentation` and under `WebGLTemplate` choose `Thirdweb`.
33+
- Save and click `Build and Run` to test out your game in a browser.
34+
35+
## Usage
36+
37+
```csharp
38+
// instantiate a read only SDK on any EVM chain
39+
var sdk = new ThirdwebSDK("goerli");
40+
41+
// connect a wallet via browser extension
42+
var walletAddress = await sdk.wallet.Connect();
43+
44+
// get an instance of a deployed contract (no ABI requried!)
45+
var contract = sdk.GetContract("0x...");
46+
47+
// fetch data from any ERC20/721/1155 or marketplace contract
48+
CurrencyValue currencyValue = await contract.ERC20.TotalSupply();
49+
NFT erc721NFT = await contract.ERC721.Get(tokenId);
50+
List<NFT> erc1155NFTs = await contract.ERC1155.GetAll();
51+
List<Listing> listings = await marketplace.GetAllListings();
52+
53+
// execute transactions from the connected wallet
54+
await contract.ERC20.Mint("1.2");
55+
await contract.ERC721.signature.Mint(signedPayload);
56+
await contract.ERC1155.Claim(tokenId, quantity);
57+
await marketplace.BuyListing(listingId, quantity);
58+
59+
// deploy contracts from the connected wallet
60+
var address = await sdk.deployer.DeployNFTCollection(new NFTContractDeployMetadata {
61+
name = "My Personal Unity Collection",
62+
primary_sale_recipient = await sdk.wallet.GetAddress(),
63+
});
64+
```
65+
66+
See full documentation on the [thirdweb portal](https://portal.thirdweb.com).

0 commit comments

Comments
 (0)