-
Notifications
You must be signed in to change notification settings - Fork 242
Marketplace ux improvement #1105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
400c04e
9620fd3
976f5af
f80d7f8
7425858
d5532c3
39cc895
f610dd7
3ef43fd
8582a81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -279,21 +279,31 @@ public static async Task<TransactionReceipt> Mint721CollectionNft(string _bearer | |
| var path = "/nft?hash=blake2b-208"; | ||
| var collectionResponse = await CSServer.CreateData(_bearerToken, path, formData); | ||
| var collectionData = JsonConvert.DeserializeObject<ApiResponse>(collectionResponse); | ||
| Debug.Log($"CID: {collectionData.cid}"); | ||
| var method = "mint"; | ||
| object[] args = | ||
| { | ||
| Web3Accessor.Web3.Signer.PublicAddress, | ||
| collectionData.cid | ||
| }; | ||
| var contract = Web3Accessor.Web3.ContractBuilder.Build(ABI.GeneralErc721, _collectionContract); | ||
| var data = await contract.SendWithReceipt(method, args); | ||
| var txArgs = new TransactionRequest | ||
| { | ||
| GasLimit = new HexBigInteger(90000) | ||
| }; | ||
| var data = await contract.SendWithReceipt(method, args, txArgs); | ||
| return data.receipt; | ||
| } | ||
| catch (Web3Exception e) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can replace this with |
||
| { | ||
| Console.WriteLine(e); | ||
| throw; | ||
| } | ||
| catch (Exception e) | ||
| { | ||
| Debug.LogError("Error: " + e.Message); | ||
| throw; | ||
| } | ||
| } | ||
|
|
||
| /// <summary> | ||
|
|
@@ -319,13 +329,14 @@ public static async Task<TransactionReceipt> Mint1155CollectionNft(string _beare | |
| }; | ||
| if (!string.IsNullOrEmpty(_description)) | ||
| { | ||
| formData.Insert(2, new MultipartFormDataSection("description", _description)); | ||
| formData.Insert(1, new MultipartFormDataSection("description", _description)); | ||
| } | ||
| var path = "/nft?hash=blake2b-208"; | ||
| var collectionResponse = await CSServer.CreateData(_bearerToken, path, formData); | ||
| var collectionData = JsonConvert.DeserializeObject<ApiResponse>(collectionResponse); | ||
| var method = "mint"; | ||
| var amount = BigInteger.Parse(_amount); | ||
| Debug.Log($"Amount3: {amount}"); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this debug can be removed |
||
| object[] args = | ||
| { | ||
| Web3Accessor.Web3.Signer.PublicAddress, | ||
|
|
@@ -334,14 +345,23 @@ public static async Task<TransactionReceipt> Mint1155CollectionNft(string _beare | |
| }; | ||
|
|
||
| var contract = Web3Accessor.Web3.ContractBuilder.Build(ABI.GeneralErc1155, _collectionContract); | ||
| var data = await contract.SendWithReceipt(method, args); | ||
| var txArgs = new TransactionRequest | ||
| { | ||
| GasLimit = new HexBigInteger(90000) | ||
| }; | ||
| var data = await contract.SendWithReceipt(method, args, txArgs); | ||
| return data.receipt; | ||
| } | ||
| catch (Web3Exception e) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this can also be replaced with my suggestion above |
||
| { | ||
| Console.WriteLine(e); | ||
| throw; | ||
| } | ||
| catch (Exception e) | ||
| { | ||
| Debug.LogError("Error: " + e.Message); | ||
| throw; | ||
| } | ||
| } | ||
|
|
||
| /// <summary> | ||
|
|
@@ -435,7 +455,7 @@ public static async Task<TransactionReceipt> SetApprovalMarketplace(string _nftC | |
| _marketplaceContract, | ||
| _permission | ||
| }; | ||
| var abi = _type == "721" ? Token.ABI.GeneralErc721 : Token.ABI.GeneralErc1155; | ||
| var abi = _type == "ERC721" ? Token.ABI.GeneralErc721 : Token.ABI.GeneralErc1155; | ||
| var contract = Web3Accessor.Web3.ContractBuilder.Build(abi, _nftContract); | ||
| var data = await contract.SendWithReceipt(method, args); | ||
| return data.receipt; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can remove this debug