@@ -11,9 +11,18 @@ public class ERC1155
1111 {
1212 public string chain ;
1313 public string address ;
14+ /// <summary>
15+ /// Handle signature minting functionality
16+ /// </summary>
1417 public ERC1155Signature signature ;
18+ /// <summary>
19+ /// Query claim conditions
20+ /// </summary>
1521 public ERC1155ClaimConditions claimConditions ;
1622
23+ /// <summary>
24+ /// Interact with any ERC1155 compatible contract.
25+ /// </summary>
1726 public ERC1155 ( string chain , string address )
1827 {
1928 this . chain = chain ;
@@ -22,38 +31,54 @@ public ERC1155(string chain, string address)
2231 this . claimConditions = new ERC1155ClaimConditions ( chain , address ) ;
2332 }
2433
25- /// READ FUNCTIONS
34+ // READ FUNCTIONS
2635
36+ /// <summary>
37+ /// Get a NFT in this contract by its ID
38+ /// </summary>
2739 public async Task < NFT > Get ( string tokenId )
2840 {
2941 return await Bridge . InvokeRoute < NFT > ( getRoute ( "get" ) , Utils . ToJsonStringArray ( tokenId ) ) ;
3042 }
3143
44+ /// <summary>
45+ /// Get a all NFTs in this contract
46+ /// </summary>
3247 public async Task < List < NFT > > GetAll ( )
3348 {
3449 return await Bridge . InvokeRoute < List < NFT > > ( getRoute ( "getAll" ) , new string [ ] { } ) ;
3550 }
3651
37- public async Task < List < NFT > > GetOwned ( )
38- {
39- return await Bridge . InvokeRoute < List < NFT > > ( getRoute ( "getOwned" ) , new string [ ] { } ) ;
40- }
41-
42- public async Task < List < NFT > > GetOwned ( string address )
52+ /// <summary>
53+ /// Get a all NFTs owned by the connected wallet
54+ /// </summary>
55+ /// <param name="address">Optional wallet address to query NFTs of</param>
56+ public async Task < List < NFT > > GetOwned ( string address = null )
4357 {
4458 return await Bridge . InvokeRoute < List < NFT > > ( getRoute ( "getOwned" ) , Utils . ToJsonStringArray ( address ) ) ;
4559 }
4660
61+ /// <summary>
62+ /// Get the balance of the given NFT for the connected wallet
63+ /// </summary>
4764 public async Task < string > Balance ( string tokenId )
4865 {
4966 return await Bridge . InvokeRoute < string > ( getRoute ( "balance" ) , new string [ ] { } ) ;
5067 }
5168
69+ /// <summary>
70+ /// Get the balance of the given NFT for the given wallet address
71+ /// </summary>
5272 public async Task < string > BalanceOf ( string address , string tokenId )
5373 {
5474 return await Bridge . InvokeRoute < string > ( getRoute ( "balanceOf" ) , Utils . ToJsonStringArray ( address , tokenId ) ) ;
5575 }
5676
77+ /// <summary>
78+ /// Check whether the given contract address has been approved to transfer NFTs on behalf of the given wallet address
79+ /// </summary>
80+ /// <param name="address">The wallet address</param>
81+ /// <param name="contractAddress">The contract address to check approval for</param>
5782 public async Task < string > IsApprovedForAll ( string address , string approvedContract )
5883 {
5984 return await Bridge . InvokeRoute < string > ( getRoute ( "isApproved" ) , Utils . ToJsonStringArray ( address , approvedContract ) ) ;
@@ -64,59 +89,89 @@ public async Task<int> TotalCount()
6489 return await Bridge . InvokeRoute < int > ( getRoute ( "totalCount" ) , new string [ ] { } ) ;
6590 }
6691
92+ /// <summary>
93+ /// Get the total suppply in circulation for thge given NFT
94+ /// </summary>
6795 public async Task < int > TotalSupply ( string tokenId )
6896 {
6997 return await Bridge . InvokeRoute < int > ( getRoute ( "totalUnclaimedSupply" ) , Utils . ToJsonStringArray ( tokenId ) ) ;
7098 }
7199
72- /// WRITE FUNCTIONS
100+ // WRITE FUNCTIONS
73101
102+ /// <summary>
103+ /// Set approval to the given contract to transfer NFTs on behalf of the connected wallet
104+ /// </summary>
74105 public async Task < TransactionResult > SetApprovalForAll ( string contractToApprove , bool approved )
75106 {
76107 return await Bridge . InvokeRoute < TransactionResult > ( getRoute ( "isApproved" ) , Utils . ToJsonStringArray ( contractToApprove , approved ) ) ;
77108 }
78109
110+ /// <summary>
111+ /// Transfer NFTs to the given address
112+ /// </summary>
79113 public async Task < TransactionResult > Transfer ( string to , string tokenId , int amount )
80114 {
81115 return await Bridge . InvokeRoute < TransactionResult > ( getRoute ( "transfer" ) , Utils . ToJsonStringArray ( to , tokenId , amount ) ) ;
82116 }
83117
118+ /// <summary>
119+ /// Burn NFTs
120+ /// </summary>
84121 public async Task < TransactionResult > Burn ( string tokenId , int amount )
85122 {
86123 return await Bridge . InvokeRoute < TransactionResult > ( getRoute ( "burn" ) , Utils . ToJsonStringArray ( tokenId , amount ) ) ;
87124 }
88125
126+ /// <summary>
127+ /// Claim NFTs from a Drop contract
128+ /// </summary>
89129 public async Task < TransactionResult [ ] > Claim ( string tokenId , int amount )
90130 {
91131 return await Bridge . InvokeRoute < TransactionResult [ ] > ( getRoute ( "claim" ) , Utils . ToJsonStringArray ( tokenId , amount ) ) ;
92132 }
93133
134+ /// <summary>
135+ /// Claim NFTs from a Drop contract and send them to the given address
136+ /// </summary>
94137 public async Task < TransactionResult [ ] > ClaimTo ( string address , string tokenId , int amount )
95138 {
96139 return await Bridge . InvokeRoute < TransactionResult [ ] > ( getRoute ( "claimTo" ) , Utils . ToJsonStringArray ( address , tokenId , amount ) ) ;
97140 }
98141
142+ /// <summary>
143+ /// Mint an NFT (requires minting permission)
144+ /// </summary>
99145 public async Task < TransactionResult > Mint ( NFTMetadataWithSupply nft )
100146 {
101147 return await Bridge . InvokeRoute < TransactionResult > ( getRoute ( "mint" ) , Utils . ToJsonStringArray ( nft ) ) ;
102148 }
103149
150+ /// <summary>
151+ /// Mint an NFT and send it to the given wallet (requires minting permission)
152+ /// </summary>
104153 public async Task < TransactionResult > MintTo ( string address , NFTMetadataWithSupply nft )
105154 {
106155 return await Bridge . InvokeRoute < TransactionResult > ( getRoute ( "mintTo" ) , Utils . ToJsonStringArray ( address , nft ) ) ;
107156 }
108157
158+ /// <summary>
159+ /// Mint additional supply of a given NFT (requires minting permission)
160+ /// </summary>
109161 public async Task < TransactionResult > MintAdditionalSupply ( string tokenId , int additionalSupply )
110162 {
111163 return await Bridge . InvokeRoute < TransactionResult > ( getRoute ( "mintAdditionalSupply" ) , Utils . ToJsonStringArray ( tokenId , additionalSupply , additionalSupply ) ) ;
112164 }
113165
166+ /// <summary>
167+ /// Mint additional supply of a given NFT and send it to the given wallet (requires minting permission)
168+ /// </summary>
114169 public async Task < TransactionResult > MintAdditionalSupplyTo ( string address , string tokenId , int additionalSupply )
115170 {
116171 return await Bridge . InvokeRoute < TransactionResult > ( getRoute ( "mintAdditionalSupplyTo" ) , Utils . ToJsonStringArray ( address , tokenId , additionalSupply ) ) ;
117172 }
118173
119- /// PRIVATE
174+ // PRIVATE
120175
121176 private string getRoute ( string functionPath ) {
122177 return this . address + ".erc1155." + functionPath ;
0 commit comments