@@ -10,6 +10,9 @@ public class ERC20
1010 {
1111 public string chain ;
1212 public string address ;
13+ /// <summary>
14+ /// Handle signature minting functionality
15+ /// </summary>
1316 public ERC20Signature signature ;
1417
1518 public ERC20 ( string chain , string address )
@@ -19,76 +22,115 @@ public ERC20(string chain, string address)
1922 this . signature = new ERC20Signature ( chain , address ) ;
2023 }
2124
22- /// READ FUNCTIONS
25+ // READ FUNCTIONS
2326
27+ /// <summary>
28+ /// Get the currency information
29+ /// </summary>
2430 public async Task < Currency > Get ( )
2531 {
2632 return await Bridge . InvokeRoute < Currency > ( getRoute ( "get" ) , new string [ ] { } ) ;
2733 }
2834
35+ /// <summary>
36+ /// Get the balance of the connected wallet
37+ /// </summary>
2938 public async Task < CurrencyValue > Balance ( )
3039 {
3140 return await Bridge . InvokeRoute < CurrencyValue > ( getRoute ( "balance" ) , new string [ ] { } ) ;
3241 }
3342
43+ /// <summary>
44+ /// Get the balance of the specified wallet
45+ /// </summary>
3446 public async Task < CurrencyValue > BalanceOf ( string address )
3547 {
3648 return await Bridge . InvokeRoute < CurrencyValue > ( getRoute ( "balanceOf" ) , Utils . ToJsonStringArray ( address ) ) ;
3749 }
3850
51+ /// <summary>
52+ /// Get how much allowance the given address is allowed to spend on behalf of the connected wallet
53+ /// </summary>
3954 public async Task < string > Allowance ( string spender )
4055 {
4156 return await Bridge . InvokeRoute < string > ( getRoute ( "allowance" ) , Utils . ToJsonStringArray ( spender ) ) ;
4257 }
4358
59+ /// <summary>
60+ /// Get how much allowance the given address is allowed to spend on behalf of the specified wallet
61+ /// </summary>
4462 public async Task < string > AllowanceOf ( string owner , string spender )
4563 {
4664 return await Bridge . InvokeRoute < string > ( getRoute ( "allowanceOf" ) , Utils . ToJsonStringArray ( owner , spender ) ) ;
4765 }
4866
67+ /// <summary>
68+ /// Get the total supply in circulation
69+ /// </summary>
4970 public async Task < CurrencyValue > TotalSupply ( )
5071 {
5172 return await Bridge . InvokeRoute < CurrencyValue > ( getRoute ( "totalSupply" ) , new string [ ] { } ) ;
5273 }
5374
54- /// WRITE FUNCTIONS
75+ // WRITE FUNCTIONS
5576
77+ /// <summary>
78+ /// Set how much allowance the given address is allowed to spend on behalf of the connected wallet
79+ /// </summary>
5680 public async Task < TransactionResult > SetAllowance ( string spender , bool amount )
5781 {
5882 return await Bridge . InvokeRoute < TransactionResult > ( getRoute ( "setAllowance" ) , Utils . ToJsonStringArray ( spender , amount ) ) ;
5983 }
6084
85+ /// <summary>
86+ /// Transfer a given amount of currency to another wallet
87+ /// </summary>
6188 public async Task < TransactionResult > Transfer ( string to , string amount )
6289 {
6390 return await Bridge . InvokeRoute < TransactionResult > ( getRoute ( "transfer" ) , Utils . ToJsonStringArray ( to , amount ) ) ;
6491 }
6592
93+ /// <summary>
94+ /// Burn a given amount of currency
95+ /// </summary>
6696 public async Task < TransactionResult > Burn ( string amount )
6797 {
6898 return await Bridge . InvokeRoute < TransactionResult > ( getRoute ( "burn" ) , Utils . ToJsonStringArray ( amount ) ) ;
6999 }
70100
101+ /// <summary>
102+ /// Claim a given amount of currency for compatible drop contracts
103+ /// </summary>
71104 public async Task < TransactionResult [ ] > Claim ( string amount )
72105 {
73106 return await Bridge . InvokeRoute < TransactionResult [ ] > ( getRoute ( "claim" ) , Utils . ToJsonStringArray ( amount ) ) ;
74107 }
75108
109+ /// <summary>
110+ /// Claim a given amount of currency to a given destination wallet for compatible drop contracts
111+ /// </summary>
76112 public async Task < TransactionResult [ ] > ClaimTo ( string address , int amount )
77113 {
78114 return await Bridge . InvokeRoute < TransactionResult [ ] > ( getRoute ( "claimTo" ) , Utils . ToJsonStringArray ( address , amount ) ) ;
79115 }
80116
117+ /// <summary>
118+ /// Mint a given amount of currency
119+ /// </summary>
81120 public async Task < TransactionResult > Mint ( string amount )
82121 {
83122 return await Bridge . InvokeRoute < TransactionResult > ( getRoute ( "mint" ) , Utils . ToJsonStringArray ( amount ) ) ;
84123 }
85124
125+ /// <summary>
126+ /// Mint a given amount of currency to a given destination wallet
127+ /// </summary>
86128 public async Task < TransactionResult > MintTo ( string address , string amount )
87129 {
88130 return await Bridge . InvokeRoute < TransactionResult > ( getRoute ( "mintTo" ) , Utils . ToJsonStringArray ( address , amount ) ) ;
89131 }
90132
91- /// PRIVATE
133+ // PRIVATE
92134
93135 private string getRoute ( string functionPath ) {
94136 return this . address + ".erc20." + functionPath ;
@@ -153,16 +195,25 @@ public ERC20Signature(string chain, string address)
153195 this . address = address ;
154196 }
155197
198+ /// <summary>
199+ /// Generate a signed mintable payload. Requires minting permission.
200+ /// </summary>
156201 public async Task < ERC20SignedPayload > Generate ( ERC20MintPayload payloadToSign )
157202 {
158203 return await Bridge . InvokeRoute < ERC20SignedPayload > ( getRoute ( "generate" ) , Utils . ToJsonStringArray ( payloadToSign ) ) ;
159204 }
160205
206+ /// <summary>
207+ /// Verify that a signed mintable payload is valid
208+ /// </summary>
161209 public async Task < bool > Verify ( ERC20SignedPayload signedPayload )
162210 {
163211 return await Bridge . InvokeRoute < bool > ( getRoute ( "verify" ) , Utils . ToJsonStringArray ( signedPayload ) ) ;
164212 }
165213
214+ /// <summary>
215+ /// Mint a signed mintable payload
216+ /// </summary>
166217 public async Task < TransactionResult > Mint ( ERC20SignedPayload signedPayload )
167218 {
168219 return await Bridge . InvokeRoute < TransactionResult > ( getRoute ( "mint" ) , Utils . ToJsonStringArray ( signedPayload ) ) ;
0 commit comments