Skip to content

Commit b15a960

Browse files
committed
Fix GetCurrencies for KuCoin
1 parent a6da81b commit b15a960

File tree

1 file changed

+68
-10
lines changed

1 file changed

+68
-10
lines changed

src/ExchangeSharp/API/Exchanges/KuCoin/ExchangeKuCoinAPI.cs

Lines changed: 68 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,24 +126,82 @@ protected override async Task<
126126
IReadOnlyDictionary<string, ExchangeCurrency>
127127
> OnGetCurrenciesAsync()
128128
{
129+
/**
130+
{
131+
"code": "200000",
132+
"data": [
133+
{
134+
"currency": "BTC",
135+
"name": "BTC",
136+
"fullName": "Bitcoin",
137+
"precision": 8,
138+
"confirms": null,
139+
"contractAddress": null,
140+
"isMarginEnabled": true,
141+
"isDebitEnabled": true,
142+
"chains": [
143+
{
144+
"chainName" : "BTC",
145+
"withdrawalMinFee" : "0.001",
146+
"withdrawalMinSize" : "0.0012",
147+
"withdrawFeeRate" : "0",
148+
"depositMinSize" : "0.0002",
149+
"isWithdrawEnabled" : true,
150+
"isDepositEnabled" : true,
151+
"preConfirms" : 1,
152+
"contractAddress" : "",
153+
"chainId" : "btc",
154+
"confirms" : 3
155+
},
156+
{
157+
"chainName" : "KCC",
158+
"withdrawalMinFee" : "0.00002",
159+
"withdrawalMinSize" : "0.0008",
160+
"withdrawFeeRate" : "0",
161+
"depositMinSize" : null,
162+
"isWithdrawEnabled" : true,
163+
"isDepositEnabled" : true,
164+
"preConfirms" : 20,
165+
"contractAddress" : "0xfa93c12cd345c658bc4644d1d4e1b9615952258c",
166+
"chainId" : "kcc",
167+
"confirms" : 20
168+
},
169+
{
170+
"chainName" : "BTC-Segwit",
171+
"withdrawalMinFee" : "0.0005",
172+
"withdrawalMinSize" : "0.0008",
173+
"withdrawFeeRate" : "0",
174+
"depositMinSize" : "0.0002",
175+
"isWithdrawEnabled" : false,
176+
"isDepositEnabled" : true,
177+
"preConfirms" : 2,
178+
"contractAddress" : "",
179+
"chainId" : "bech32",
180+
"confirms" : 2
181+
}
182+
]
183+
}
184+
]
185+
}
186+
*/
187+
129188
Dictionary<string, ExchangeCurrency> currencies =
130189
new Dictionary<string, ExchangeCurrency>();
131190
List<string> symbols = new List<string>();
132-
// [ { "withdrawMinFee": 100000, "withdrawMinAmount": 200000, "withdrawFeeRate": 0.001, "confirmationCount": 12, "name": "Bitcoin", "tradePrecision": 7, "coin": "BTC","infoUrl": null, "enableWithdraw": true, "enableDeposit": true, "depositRemark": "", "withdrawRemark": "" } ... ]
133-
JToken token = await MakeJsonRequestAsync<JToken>("/market/open/coins");
191+
JToken token = await MakeJsonRequestAsync<JToken>("/currencies");
134192
foreach (JToken currency in token)
135193
currencies.Add(
136-
currency["coin"].ToStringInvariant(),
194+
currency["currency"].ToStringInvariant(),
137195
new ExchangeCurrency()
138196
{
139-
Name = currency["coin"].ToStringInvariant(),
140-
FullName = currency["name"].ToStringInvariant(),
141-
WithdrawalEnabled = currency["enableWithdraw"].ConvertInvariant<bool>(),
142-
DepositEnabled = currency["enableDepost"].ConvertInvariant<bool>(),
143-
TxFee = currency["withdrawFeeRate"].ConvertInvariant<decimal>(),
144-
MinConfirmations = currency["confirmationCount"].ConvertInvariant<int>(),
197+
Name = currency["currency"].ToStringInvariant(),
198+
FullName = currency["fullName"].ToStringInvariant(),
199+
WithdrawalEnabled = currency["isDepositEnabled"].ConvertInvariant<bool>(),
200+
DepositEnabled = currency["isWithdrawEnabled"].ConvertInvariant<bool>(),
201+
TxFee = currency["withdrawalMinFee"].ConvertInvariant<decimal>(),
202+
MinConfirmations = currency["confirms"].ConvertInvariant<int>(),
145203
MinWithdrawalSize = currency[
146-
"withdrawMinAmount"
204+
"withdrawalMinSize"
147205
].ConvertInvariant<decimal>(),
148206
}
149207
);

0 commit comments

Comments
 (0)