Skip to content

Commit 6169883

Browse files
working marketplace
1 parent 028f2f1 commit 6169883

File tree

6 files changed

+592
-14
lines changed

6 files changed

+592
-14
lines changed

Assets/SDKTest.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,26 @@ public async void MintERC20()
140140
// await contract.ERC20.signature.Mint(p);
141141
// resultText.text = "sigminted currency successfully";
142142
}
143+
144+
public async void GetListing()
145+
{
146+
Debug.Log("Get Listing button clicked");
147+
resultText.text = "fetching listing...";
148+
149+
// fetch listings
150+
var marketplace = sdk.GetContract("0xC7DBaD01B18403c041132C5e8c7e9a6542C4291A").marketplace; // Marketplace
151+
var result = await marketplace.GetAllListings();
152+
resultText.text = "Listing count: " + result.Count + " | " + result[0].asset.name + "(" + result[0].buyoutCurrencyValuePerToken.displayValue + ")";
153+
}
154+
155+
public async void BuyListing()
156+
{
157+
Debug.Log("Buy Listing button clicked");
158+
resultText.text = "Buying...";
159+
160+
// fetch listings
161+
var marketplace = sdk.GetContract("0xC7DBaD01B18403c041132C5e8c7e9a6542C4291A").marketplace; // Marketplace
162+
var result = await marketplace.BuyListing("0", 1);
163+
resultText.text = "NFT bought successfully";
164+
}
143165
}

0 commit comments

Comments
 (0)