Skip to content

Commit 7aee4ea

Browse files
committed
update to version 0.8.7
1 parent ee4aa24 commit 7aee4ea

File tree

6 files changed

+142
-70
lines changed

6 files changed

+142
-70
lines changed

DigitexConnector/DigitexConnector.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
66
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
77
<PackageId>DigitexConnectorCSharp</PackageId>
8-
<Version>0.8.5</Version>
8+
<Version>0.8.7</Version>
99
<Authors>SmartDec https://smartdec.com/</Authors>
1010
<Company>SmartDec</Company>
1111
<PackageLicenseExpression>MIT</PackageLicenseExpression>

DigitexConnector/EngineAPI/Symbol.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,31 @@ public class Symbol : IEquatable<Symbol>
4747
public readonly decimal PriceStep;
4848

4949
/// <summary>
50-
/// Symbols quantity step.
50+
/// Symbol's quantity step.
5151
/// </summary>
5252
[DataMember]
5353
public readonly decimal QuantityStep;
5454

55+
/// <summary>
56+
/// Symbol's currency pair. Used for exchange rate receiving.
57+
/// </summary>
58+
[DataMember]
59+
public readonly int CurrencyPairId;
60+
5561
/// <summary>
5662
/// Constructor.
5763
/// </summary>
5864
/// <param name="marketId">Id of symbol at exchange.</param>
5965
/// <param name="name">Name of symbol at exchange.</param>
6066
/// <param name="priceStep">Symbol's price step</param>
6167
/// <param name="quantityStep">Symbol's quantity step</param>
62-
public Symbol(int marketId, string name, decimal priceStep, decimal quantityStep)
68+
public Symbol(int marketId, string name, decimal priceStep, decimal quantityStep, int currencyPairId)
6369
{
6470
MarketId = marketId;
6571
Name = name;
6672
PriceStep = priceStep;
6773
QuantityStep = quantityStep;
74+
CurrencyPairId = currencyPairId;
6875
}
6976

7077
public Symbol()
@@ -90,7 +97,8 @@ public bool Equals(Symbol other)
9097
if (string.Compare(Name, other.Name, StringComparison.CurrentCulture) == 0 &&
9198
MarketId == other.MarketId &&
9299
PriceStep == other.PriceStep &&
93-
QuantityStep == other.QuantityStep)
100+
QuantityStep == other.QuantityStep &&
101+
CurrencyPairId == other.CurrencyPairId)
94102
{ return true; }
95103
else
96104
{ return false; }

DigitexConnector/Symbols.mainnet.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,43 @@
44
"MarketId": 1,
55
"Name": "BTC/USD",
66
"PriceStep": 5,
7-
"QuantityStep": 1
7+
"QuantityStep": 1,
8+
"CurrencyPairId": 1
89
},
910
{
1011
"MarketId": 2,
1112
"Name": "ETH/USD",
1213
"PriceStep": 0.25,
13-
"QuantityStep": 1
14+
"QuantityStep": 1,
15+
"CurrencyPairId": 2
1416
},
1517
{
1618
"MarketId": 3,
1719
"Name": "XRP/USD",
1820
"PriceStep": 1,
19-
"QuantityStep": 1
21+
"QuantityStep": 1,
22+
"CurrencyPairId": 6
2023
},
2124
{
2225
"MarketId": 7,
2326
"Name": "EUR/USD",
2427
"PriceStep": 0.0001,
25-
"QuantityStep": 1
28+
"QuantityStep": 1,
29+
"CurrencyPairId": 26
2630
},
2731
{
2832
"MarketId": 9,
2933
"Name": "BTC/USD1",
3034
"PriceStep": 1,
31-
"QuantityStep": 1
35+
"QuantityStep": 1,
36+
"CurrencyPairId": 1
3237
},
3338
{
3439
"MarketId": 10,
3540
"Name": "USD/JPY",
3641
"PriceStep": 0.01,
37-
"QuantityStep": 1
42+
"QuantityStep": 1,
43+
"CurrencyPairId": 28
3844
}
3945
]
4046
}

DigitexConnector/Symbols.testnet.json

Lines changed: 58 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,175 +4,204 @@
44
"MarketId": 1,
55
"Name": "BTC/USD DGTX",
66
"PriceStep": 5,
7-
"QuantityStep": 1
7+
"QuantityStep": 1,
8+
"CurrencyPairId": 1
89
},
910
{
1011
"MarketId": 2,
1112
"Name": "ETH/USD DGTX",
1213
"PriceStep": 0.25,
13-
"QuantityStep": 1
14+
"QuantityStep": 1,
15+
"CurrencyPairId": 2
1416
},
1517
{
1618
"MarketId": 3,
1719
"Name": "XRP/USD DGTX",
1820
"PriceStep": 1,
19-
"QuantityStep": 1
21+
"QuantityStep": 1,
22+
"CurrencyPairId": 6
2023
},
2124
{
2225
"MarketId": 4,
2326
"Name": "DGTX/ETH SPOT",
2427
"PriceStep": 0.000001,
25-
"QuantityStep": 1
28+
"QuantityStep": 1,
29+
"CurrencyPairId": 3
2630
},
2731
{
2832
"MarketId": 5,
2933
"Name": "XAU/USD DGTX",
3034
"PriceStep": 0.5,
31-
"QuantityStep": 1
35+
"QuantityStep": 1,
36+
"CurrencyPairId": 7
3237
},
3338
{
3439
"MarketId": 7,
3540
"Name": "EUR/USD DGTX",
3641
"PriceStep": 0.0001,
37-
"QuantityStep": 1
42+
"QuantityStep": 1,
43+
"CurrencyPairId": 26
3844
},
3945
{
4046
"MarketId": 8,
4147
"Name": "AMZN DGTX",
4248
"PriceStep": 1,
43-
"QuantityStep": 1
49+
"QuantityStep": 1,
50+
"CurrencyPairId": 21
4451
},
4552
{
4653
"MarketId": 9,
4754
"Name": "BTC/USD1 DGTX",
4855
"PriceStep": 1,
49-
"QuantityStep": 1
56+
"QuantityStep": 1,
57+
"CurrencyPairId": 1
5058
},
5159
{
5260
"MarketId": 10,
5361
"Name": "USD/JPY DGTX",
5462
"PriceStep": 0.01,
55-
"QuantityStep": 1
63+
"QuantityStep": 1,
64+
"CurrencyPairId": 28
5665
},
5766
{
5867
"MarketId": 12,
5968
"Name": "FB DGTX",
6069
"PriceStep": 0.1,
61-
"QuantityStep": 1
70+
"QuantityStep": 1,
71+
"CurrencyPairId": 20
6272
},
6373
{
6474
"MarketId": 13,
6575
"Name": "AAPL DGTX",
6676
"PriceStep": 0.1,
67-
"QuantityStep": 1
77+
"QuantityStep": 1,
78+
"CurrencyPairId": 19
6879
},
6980
{
7081
"MarketId": 14,
7182
"Name": "BTC/USD DUSD",
7283
"PriceStep": 5,
73-
"QuantityStep": 1
84+
"QuantityStep": 1,
85+
"CurrencyPairId": 1
7486
},
7587
{
7688
"MarketId": 15,
7789
"Name": "BTC1/USD DUSD",
7890
"PriceStep": 1,
79-
"QuantityStep": 1
91+
"QuantityStep": 1,
92+
"CurrencyPairId": 1
8093
},
8194
{
8295
"MarketId": 16,
8396
"Name": "ETH/USD DUSD",
8497
"PriceStep": 0.25,
85-
"QuantityStep": 1
98+
"QuantityStep": 1,
99+
"CurrencyPairId": 2
86100
},
87101
{
88102
"MarketId": 17,
89103
"Name": "XRP/USD DUSD",
90104
"PriceStep": 0.001,
91-
"QuantityStep": 1
105+
"QuantityStep": 1,
106+
"CurrencyPairId": 8
92107
},
93108
{
94109
"MarketId": 31,
95110
"Name": "XAU/USD DUSD",
96111
"PriceStep": 1,
97-
"QuantityStep": 1
112+
"QuantityStep": 1,
113+
"CurrencyPairId": 7
98114
},
99115
{
100116
"MarketId": 18,
101117
"Name": "BTC/DUSD SPOT",
102118
"PriceStep": 1,
103-
"QuantityStep": 0.0001
119+
"QuantityStep": 0.0001,
120+
"CurrencyPairId": 36
104121
},
105122
{
106123
"MarketId": 19,
107124
"Name": "ETH/BTC SPOT",
108125
"PriceStep": 0.00001,
109-
"QuantityStep": 0.001
126+
"QuantityStep": 0.001,
127+
"CurrencyPairId": 37
110128
},
111129
{
112130
"MarketId": 20,
113131
"Name": "ETH/DUSD SPOT",
114132
"PriceStep": 0.1,
115-
"QuantityStep": 0.001
133+
"QuantityStep": 0.001,
134+
"CurrencyPairId": 38
116135
},
117136
{
118137
"MarketId": 21,
119138
"Name": "DUSD/USDC SPOT",
120139
"PriceStep": 0.001,
121-
"QuantityStep": 0.01
140+
"QuantityStep": 0.01,
141+
"CurrencyPairId": 39
122142
},
123143
{
124144
"MarketId": 22,
125145
"Name": "LINK/DUSD SPOT",
126146
"PriceStep": 0.01,
127-
"QuantityStep": 0.01
147+
"QuantityStep": 0.01,
148+
"CurrencyPairId": 40
128149
},
129150
{
130151
"MarketId": 23,
131152
"Name": "DGTX/BTC SPOT",
132153
"PriceStep": 0.0000001,
133-
"QuantityStep": 1
154+
"QuantityStep": 1,
155+
"CurrencyPairId": 4
134156
},
135157
{
136158
"MarketId": 24,
137159
"Name": "DGTX/DUSD SPOT",
138160
"PriceStep": 0.001,
139-
"QuantityStep": 1
161+
"QuantityStep": 1,
162+
"CurrencyPairId": 41
140163
},
141164
{
142165
"MarketId": 25,
143166
"Name": "DGTX/LINK SPOT",
144167
"PriceStep": 0.0001,
145-
"QuantityStep": 1
168+
"QuantityStep": 1,
169+
"CurrencyPairId": 42
146170
},
147171
{
148172
"MarketId": 26,
149173
"Name": "EUR/USD DUSD",
150174
"PriceStep": 0.0001,
151-
"QuantityStep": 1
175+
"QuantityStep": 1,
176+
"CurrencyPairId": 26
152177
},
153178
{
154179
"MarketId": 27,
155180
"Name": "GBP/USD DUSD",
156181
"PriceStep": 0.0001,
157-
"QuantityStep": 1
182+
"QuantityStep": 1,
183+
"CurrencyPairId": 34
158184
},
159185
{
160186
"MarketId": 28,
161187
"Name": "AUD/USD DUSD",
162188
"PriceStep": 0.0001,
163-
"QuantityStep": 1
189+
"QuantityStep": 1,
190+
"CurrencyPairId": 35
164191
},
165192
{
166193
"MarketId": 29,
167194
"Name": "USD/JPY DUSD",
168195
"PriceStep": 0.01,
169-
"QuantityStep": 1
196+
"QuantityStep": 1,
197+
"CurrencyPairId": 28
170198
},
171199
{
172200
"MarketId": 30,
173201
"Name": "USD/CAD DUSD",
174202
"PriceStep": 0.0001,
175-
"QuantityStep": 1
203+
"QuantityStep": 1,
204+
"CurrencyPairId": 33
176205
}
177206
]
178207
}

DigitexConnector/Trading/OrderBook.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private void Init()
6868

6969
private void ExchangeRateHandler(ExchangeRateData data)
7070
{
71-
if (data.CurrencyPairId != (uint)TrackedSymbol.MarketId)
71+
if (data.CurrencyPairId != (uint)TrackedSymbol.CurrencyPairId)
7272
{ return; }
7373
SpotPrice = data.MarkPrice;
7474
SpotPriceUpdated?.Invoke(this);

0 commit comments

Comments
 (0)