Skip to content

Commit 33a6279

Browse files
committed
v
1 parent 0426f3d commit 33a6279

File tree

7 files changed

+40
-9
lines changed

7 files changed

+40
-9
lines changed

CryptoClients.Net/Clients/Rest/ExchangeRestClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ public IEnumerable<ISharedClient> GetExchangeSharedClients(string name, TradingM
500500
public void SetApiCredentials(string exchange, DynamicCredentials credentials)
501501
{
502502
SetApiCredentials(
503-
ExchangeCredentials.From(exchange,
503+
ExchangeCredentials.CreateFrom(exchange,
504504
ExchangeCredentials.CreateCredentialsForExchange(exchange, credentials)));
505505
}
506506

CryptoClients.Net/Clients/Socket/ExchangeSocketClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ public IEnumerable<ISharedClient> GetExchangeSharedClients(string name, TradingM
496496
public void SetApiCredentials(string exchange, DynamicCredentials credentials)
497497
{
498498
SetApiCredentials(
499-
ExchangeCredentials.From(exchange,
499+
ExchangeCredentials.CreateFrom(exchange,
500500
ExchangeCredentials.CreateCredentialsForExchange(exchange, credentials)));
501501
}
502502

CryptoClients.Net/Exchanges.cs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ public static class Exchanges
5050
ApiDocsUrl = AsterExchange.ApiDocsUrl,
5151
Type = AsterExchange.Type,
5252
ApiEnvironments = AsterEnvironment.All,
53-
#warning V3 or V1?
5453
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
5554
{
5655
Exchange = AsterExchange.ExchangeName,
56+
KeyDescription = "The user private key",
5757
Param1Required = true,
58-
Param1Description = "API secret"
58+
Param1Description = "The private signing key"
5959
}
6060
};
6161

@@ -74,6 +74,7 @@ public static class Exchanges
7474
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
7575
{
7676
Exchange = BinanceExchange.ExchangeName,
77+
KeyDescription = "The API key",
7778
Param1Required = true,
7879
Param1Description = "API secret"
7980
}
@@ -94,6 +95,7 @@ public static class Exchanges
9495
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
9596
{
9697
Exchange = BingXExchange.ExchangeName,
98+
KeyDescription = "The API key",
9799
Param1Required = true,
98100
Param1Description = "API secret"
99101
}
@@ -114,6 +116,7 @@ public static class Exchanges
114116
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
115117
{
116118
Exchange = BitfinexExchange.ExchangeName,
119+
KeyDescription = "The API key",
117120
Param1Required = true,
118121
Param1Description = "API secret"
119122
}
@@ -134,6 +137,7 @@ public static class Exchanges
134137
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
135138
{
136139
Exchange = BitgetExchange.ExchangeName,
140+
KeyDescription = "The API key",
137141
Param1Required = true,
138142
Param1Description = "API secret",
139143
Param2Required = true,
@@ -156,6 +160,7 @@ public static class Exchanges
156160
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
157161
{
158162
Exchange = BitMartExchange.ExchangeName,
163+
KeyDescription = "The API key",
159164
Param1Required = true,
160165
Param1Description = "API secret",
161166
Param2Required = true,
@@ -178,6 +183,7 @@ public static class Exchanges
178183
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
179184
{
180185
Exchange = BitMEXExchange.ExchangeName,
186+
KeyDescription = "The API key",
181187
Param1Required = true,
182188
Param1Description = "API secret"
183189
}
@@ -198,6 +204,7 @@ public static class Exchanges
198204
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
199205
{
200206
Exchange = BitstampExchange.ExchangeName,
207+
KeyDescription = "The API key",
201208
Param1Required = true,
202209
Param1Description = "API secret"
203210
}
@@ -218,6 +225,7 @@ public static class Exchanges
218225
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
219226
{
220227
Exchange = BloFinExchange.ExchangeName,
228+
KeyDescription = "The API key",
221229
Param1Required = true,
222230
Param1Description = "API secret",
223231
Param2Required = true,
@@ -240,6 +248,7 @@ public static class Exchanges
240248
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
241249
{
242250
Exchange = BybitExchange.ExchangeName,
251+
KeyDescription = "The API key",
243252
Param1Required = true,
244253
Param1Description = "API secret"
245254
}
@@ -260,6 +269,7 @@ public static class Exchanges
260269
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
261270
{
262271
Exchange = CoinbaseExchange.ExchangeName,
272+
KeyDescription = "The API key",
263273
Param1Required = true,
264274
Param1Description = "API secret"
265275
}
@@ -280,6 +290,7 @@ public static class Exchanges
280290
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
281291
{
282292
Exchange = CoinExExchange.ExchangeName,
293+
KeyDescription = "The API key",
283294
Param1Required = true,
284295
Param1Description = "API secret"
285296
}
@@ -300,6 +311,7 @@ public static class Exchanges
300311
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
301312
{
302313
Exchange = CoinWExchange.ExchangeName,
314+
KeyDescription = "The API key",
303315
Param1Required = true,
304316
Param1Description = "API secret"
305317
}
@@ -320,6 +332,7 @@ public static class Exchanges
320332
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
321333
{
322334
Exchange = CryptoComExchange.ExchangeName,
335+
KeyDescription = "The API key",
323336
Param1Required = true,
324337
Param1Description = "API secret"
325338
}
@@ -340,6 +353,7 @@ public static class Exchanges
340353
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
341354
{
342355
Exchange = DeepCoinExchange.ExchangeName,
356+
KeyDescription = "The API key",
343357
Param1Required = true,
344358
Param1Description = "API secret",
345359
Param2Required = true,
@@ -362,6 +376,7 @@ public static class Exchanges
362376
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
363377
{
364378
Exchange = GateIoExchange.ExchangeName,
379+
KeyDescription = "The API key",
365380
Param1Required = true,
366381
Param1Description = "API secret"
367382
}
@@ -382,6 +397,7 @@ public static class Exchanges
382397
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
383398
{
384399
Exchange = HTXExchange.ExchangeName,
400+
KeyDescription = "The API key",
385401
Param1Required = true,
386402
Param1Description = "API secret"
387403
}
@@ -402,6 +418,7 @@ public static class Exchanges
402418
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
403419
{
404420
Exchange = HyperLiquidExchange.ExchangeName,
421+
KeyDescription = "The public key",
405422
Param1Required = true,
406423
Param1Description = "Private key"
407424
}
@@ -422,6 +439,7 @@ public static class Exchanges
422439
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
423440
{
424441
Exchange = KrakenExchange.ExchangeName,
442+
KeyDescription = "The API key",
425443
Param1Required = true,
426444
Param1Description = "API secret"
427445
}
@@ -442,6 +460,7 @@ public static class Exchanges
442460
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
443461
{
444462
Exchange = KucoinExchange.ExchangeName,
463+
KeyDescription = "The API key",
445464
Param1Required = true,
446465
Param1Description = "API secret",
447466
Param2Required = true,
@@ -464,6 +483,7 @@ public static class Exchanges
464483
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
465484
{
466485
Exchange = MexcExchange.ExchangeName,
486+
KeyDescription = "The API key",
467487
Param1Required = true,
468488
Param1Description = "API secret"
469489
}
@@ -484,6 +504,7 @@ public static class Exchanges
484504
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
485505
{
486506
Exchange = OKXExchange.ExchangeName,
507+
KeyDescription = "The API key",
487508
Param1Required = true,
488509
Param1Description = "API secret",
489510
Param2Required = true,
@@ -506,6 +527,7 @@ public static class Exchanges
506527
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
507528
{
508529
Exchange = ToobitExchange.ExchangeName,
530+
KeyDescription = "The API key",
509531
Param1Required = true,
510532
Param1Description = "API secret"
511533
}
@@ -541,6 +563,7 @@ public static class Exchanges
541563
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
542564
{
543565
Exchange = WhiteBitExchange.ExchangeName,
566+
KeyDescription = "The API key",
544567
Param1Required = true,
545568
Param1Description = "API secret"
546569
}
@@ -561,6 +584,7 @@ public static class Exchanges
561584
DynamicCredentialInfo = (mode) => new DynamicCredentialInfo
562585
{
563586
Exchange = XTExchange.ExchangeName,
587+
KeyDescription = "The API key",
564588
Param1Required = true,
565589
Param1Description = "API secret"
566590
}

CryptoClients.Net/Interfaces/IExchangeRestClient.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,9 @@ public interface IExchangeRestClient
169169
/// <summary>
170170
/// Set API credentials for exchanges using dynamic credentials.
171171
/// </summary>
172+
/// <param name="exchange">Exchange name</param>
172173
/// <param name="credentials">Credentials</param>
173-
void SetApiCredentials(DynamicCredentials credentials);
174+
void SetApiCredentials(string exchange, DynamicCredentials credentials);
174175

175176
/// <summary>
176177
/// Set API credentials for an exchange

CryptoClients.Net/Interfaces/IExchangeSocketClient.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,9 @@ public interface IExchangeSocketClient
171171
/// <summary>
172172
/// Set API credentials for exchanges using dynamic credentials.
173173
/// </summary>
174+
/// <param name="exchange">Exchange name</param>
174175
/// <param name="credentials">Credentials</param>
175-
void SetApiCredentials(DynamicCredentials credentials);
176+
void SetApiCredentials(string exchange, DynamicCredentials credentials);
176177

177178
/// <summary>
178179
/// Set API credentials for an exchange

CryptoClients.Net/Models/DynamicCredentialInfo.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ public class DynamicCredentialInfo
1010
/// </summary>
1111
public string Exchange { get; set; } = string.Empty;
1212

13+
/// <summary>
14+
/// The description of what the API key should be
15+
/// </summary>
16+
public string KeyDescription { get; set; } = string.Empty;
17+
1318
/// <summary>
1419
/// Whether Param1 is required
1520
/// </summary>

CryptoClients.Net/Models/ExchangeCredentials.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,17 +205,17 @@ public static ApiCredentials CreateCredentialsForExchange(string exchange, Dynam
205205
/// </summary>
206206
/// <param name="exchange">Exchange name</param>
207207
/// <param name="credentials">Credentials, should be credentials of the correct type for the exchange. For example, for Binance, the value should be of type BinanceCredentials.</param>
208-
public static ExchangeCredentials From(string exchange, ApiCredentials credentials)
208+
public static ExchangeCredentials CreateFrom(string exchange, ApiCredentials credentials)
209209
{
210-
return From(new Dictionary<string, ApiCredentials> { { exchange, credentials } });
210+
return CreateFrom(new Dictionary<string, ApiCredentials> { { exchange, credentials } });
211211
}
212212

213213
/// <summary>
214214
/// Create credentials from a dictionary of exchange name to credentials. Dictionary key should be the exchange name, value should be credentials of the correct type for that exchange. For example, for Binance, the value should be of type BinanceCredentials.<br />
215215
/// ExchangeCredentials.CreateCredentialsForExchange can be used to dynamically create credentials for an exchange.
216216
/// </summary>
217217
/// <param name="exchangeCredentials">Credentials, dictionary key should be the exchange name, value should be credentials of the correct type for that exchange. For example, for Binance, the value should be of type BinanceCredentials.</param>
218-
public static ExchangeCredentials From(Dictionary<string, ApiCredentials> exchangeCredentials)
218+
public static ExchangeCredentials CreateFrom(Dictionary<string, ApiCredentials> exchangeCredentials)
219219
{
220220
var creds = new ExchangeCredentials();
221221
foreach (var item in exchangeCredentials)

0 commit comments

Comments
 (0)