File tree Expand file tree Collapse file tree 6 files changed +592
-14
lines changed
WebGLTemplates/Better2020 Expand file tree Collapse file tree 6 files changed +592
-14
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments