Closed notdanilo closed 2 years ago
From this commit, we are able to generate this file from candle.rs
:
namespace OpenlimitsExchange
{
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct Candle
{
public readonly u64 time;
public readonly Decimal low;
public readonly Decimal high;
public readonly Decimal open;
public readonly Decimal close;
public readonly Decimal volume;
public Candle(u64 time, Decimal low, Decimal high, Decimal open, Decimal close, Decimal volume)
{
this.time = time;
this.low = low;
this.high = high;
this.open = open;
this.close = close;
this.volume = volume;
}
}
}
which is partially similar to this file https://github.com/nash-io/openlimits-csharp/blob/master/OpenLimits/Candle.cs
We still need to adapt the namespace
and provide a way to marshal arbitraty types -- in this case Decimal
to double
.
Including enumerations and more structures.
WIP
Build depends on https://github.com/sensorial-systems/ligen (branch: ligen-csharp) in the parent folder.
Output can be found in
crates/openlimits-exchange/target/ligen/openlimits-exchange/