Skip to content

Commit

Permalink
Missing functionality (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
Platonenkov authored May 10, 2024
1 parent 27659c0 commit d94225e
Show file tree
Hide file tree
Showing 104 changed files with 6,464 additions and 1,211 deletions.
6 changes: 3 additions & 3 deletions Base/Xrpl.AddressCodec/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@

namespace Xrpl.AddressCodec
{
public class Utils
public static class Utils
{
/// <summary>
/// from bytes array to hex row
/// </summary>
/// <param name="bytes">bytes array</param>
/// <returns></returns>
public static string FromBytesToHex(byte[] bytes) => Hex.ToHexString(bytes).ToUpper();
public static string FromBytesToHex(this byte[] bytes) => Hex.ToHexString(bytes).ToUpper();

/// <summary>
/// hex row to bytes array
/// </summary>
/// <param name="hex">hex row</param>
/// <returns></returns>
public static byte[] FromHexToBytes(string hex) => Hex.Decode(hex);
public static byte[] FromHexToBytes(this string hex) => Hex.Decode(hex);

/// <summary>
/// combine bytes arrays to single array
Expand Down
4 changes: 2 additions & 2 deletions Base/Xrpl.AddressCodec/Xrpl.AddressCodec.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
<PackageLicenseUrl>https://github.com/Transia-RnD/XrplCSharp/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/Transia-RnD/XrplCSharp</PackageProjectUrl>
<Title>XrplCSharp</Title>
<PackageVersion>1.0.0</PackageVersion>
<PackageVersion>2.0.0</PackageVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\net6.0\XrplCSharp.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
<PackageReference Include="Chaos.NaCl.Standard" Version="1.0.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
Expand Down
9 changes: 0 additions & 9 deletions Base/Xrpl.BinaryCodec/Binary/BytesList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ public void Put(byte[] bytes)
}
/// <summary> Get all bytes </summary>
/// <returns>Bytes</returns>
public byte[] Bytes()
{
var n = BytesLength();
var bytes = new byte[n];
AddBytes(bytes, 0);
return bytes;
}
/// <summary> Get all bytes </summary>
/// <returns>Bytes</returns>
public byte[] ToBytes()
{
var n = BytesLength();
Expand Down
6 changes: 3 additions & 3 deletions Base/Xrpl.BinaryCodec/Enums/Field.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,14 @@ private bool IsVlEncodedType()
public static readonly TransactionTypeField TransactionType = new TransactionTypeField(nameof(TransactionType), 2);
public static readonly Uint16Field SignerWeight = new Uint16Field(nameof(SignerWeight), 3);
public static readonly Uint16Field TransferFee = new Uint16Field(nameof(TransferFee), 4);
public static readonly Uint16Field TradingFee = new Uint16Field(nameof(TradingFee), 4);
public static readonly Uint16Field TradingFee = new Uint16Field(nameof(TradingFee), 4);
public static readonly Uint16Field Version = new Uint16Field(nameof(Version), 16);
public static readonly Uint16Field HookStateChangeCount = new Uint16Field(nameof(HookStateChangeCount), 17);
public static readonly Uint16Field HookStateEmitCount = new Uint16Field(nameof(HookStateEmitCount), 18);
public static readonly Uint16Field HookStateExecutionIndex = new Uint16Field(nameof(HookStateExecutionIndex), 19);
public static readonly Uint16Field HookApiVersion = new Uint16Field(nameof(HookApiVersion), 20);

public static readonly Uint32Field NetworkID = new Uint32Field(nameof(NetworkID), 1);
public static readonly Uint32Field Flags = new Uint32Field(nameof(Flags), 2);
public static readonly Uint32Field SourceTag = new Uint32Field(nameof(SourceTag), 3);
public static readonly Uint32Field Sequence = new Uint32Field(nameof(Sequence), 4);
Expand Down Expand Up @@ -214,7 +215,7 @@ private bool IsVlEncodedType()
public static readonly AmountField DeliverMin = new AmountField(nameof(DeliverMin), 10);
public static readonly AmountField Amount2 = new AmountField(nameof(Amount2), 11);
public static readonly AmountField BidMin = new AmountField(nameof(BidMin), 12);
public static readonly AmountField BidMax = new AmountField(nameof(BidMax), 13);
public static readonly AmountField BidMax = new AmountField(nameof(BidMax), 13);
public static readonly AmountField MinimumOffer = new AmountField(nameof(MinimumOffer), 16);
public static readonly AmountField RippleEscrow = new AmountField(nameof(RippleEscrow), 17);
public static readonly AmountField DeliveredAmount = new AmountField(nameof(DeliveredAmount), 18);
Expand Down Expand Up @@ -314,7 +315,6 @@ private bool IsVlEncodedType()
public static readonly StArrayField HookParameters = new StArrayField(nameof(HookParameters), 19);
public static readonly StArrayField HookGrants = new StArrayField(nameof(HookGrants), 19);
public static readonly StArrayField AuthAccounts = new StArrayField(nameof(AuthAccounts), 26);

public static readonly Field Generic = new Field(nameof(Generic), 0, FieldType.Unknown, isSigningField: false);
public static readonly Field Invalid = new Field(nameof(Invalid), -1, FieldType.Unknown, isSigningField: false);

Expand Down
1 change: 0 additions & 1 deletion Base/Xrpl.BinaryCodec/Enums/LedgerEntryType.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Newtonsoft.Json.Linq;
using Xrpl.BinaryCodec.Enums;

//todo not found doc

Expand Down
3 changes: 2 additions & 1 deletion Base/Xrpl.BinaryCodec/Enums/TransactionType.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Xrpl.BinaryCodec.Enums;

namespace Xrpl.BinaryCodec.Enums
namespace Xrpl.BinaryCodec.Types
{
public class TransactionType : SerializedEnumItem<ushort>
{
Expand Down Expand Up @@ -86,6 +86,7 @@ private static TransactionType Add(string name, int ordinal)
public static readonly TransactionType AMMWithdraw = Add(nameof(AMMWithdraw), 37);
public static readonly TransactionType AMMVote = Add(nameof(AMMVote), 38);
public static readonly TransactionType AMMBid = Add(nameof(AMMBid), 39);
public static readonly TransactionType AMMDelete = Add(nameof(AMMDelete), 40);

// ...
/// <summary>
Expand Down
Loading

0 comments on commit d94225e

Please sign in to comment.