Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Config/EosConfig.ini
*.lai
*.la
*.a
*.lib

# Executables
*.exe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void USequencePay::GetSwapPrice(const int64 ChainID, const FString& WalletAddres
{
this->GetSwapPrices(ChainID, WalletAddress, BuyCurrency, BuyAmount, [SellCurrency, OnSuccess, OnFailure](TArray<FSeqSwapPrice> Prices)
{
for (const FSeqSwapPrice Price : Prices)
for (const FSeqSwapPrice& Price : Prices)
{
if (Price.CurrencyAddress == SellCurrency)
{
Expand Down Expand Up @@ -139,7 +139,10 @@ void USequencePay::GetSwapPrices(const int64 ChainID, const FString& WalletAddre

for (const FSeqSwapToken& FromToken : Route.FromTokens)
{
SwapPrices.Add(FSeqSwapPrice(FromToken.Address, FromToken.Price));
SwapPrices.Add(FSeqSwapPrice {
FromToken.Address,
FromToken.Price
});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Run the installation steps from the official website:

https://doc.rust-lang.org/cargo/getting-started/installation.html

## Updating Library
## Compiling Library

Navigate to the `SequencePlugin/Source/SequencePlugin/Public/EthAbi/` directory in your terminal and run the following code to compile:

Expand All @@ -22,6 +22,52 @@ cargo build --release

Now, take the `libethabi_bridge.a` file from the `./target/release/` directory and move it to `EthAbi/`

## Platforms Builds

MacOS, iOS and Android files can be build on MacOS and Windows. Windows' .lib file can only be installed on a Windows machine.

### MacOS

```shell
cargo build --release --target x86_64-apple-darwin
cargo build --release --target aarch64-apple-darwin
```

```shell
lipo -create \
./target/x86_64-apple-darwin/release/libethabi_bridge.a \
./target/aarch64-apple-darwin/release/libethabi_bridge.a \
-output ./macos/libethabi_bridge.a
```

### Android

```shell
cargo ndk -t arm64-v8a -t armeabi-v7a -t x86_64 build --release
```

### iOS

```shell
cargo lipo --release
```

### Windows

Building .lib files only works on Windows machines.
Run the following install commands on Windows.

```shell
winget install --id Rustlang.Rustup -e --source winget
rustup default stable-x86_64-pc-windows-msvc
```

Build command:

```shell
cargo build --release --target x86_64-pc-windows-msvc
```

## Decoding:

Returns JSON array as a string of unnamed values. This array mirrors the ABI's output array. E.g. [5000] or [[0,10000,1747809900,1905662700,"0x0000000000000000000000000000000000000000000000000000000000000000"]]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@ public SequencePlugin(ReadOnlyTargetRules Target) : base(Target)
{
bUseUnity = false;
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

string lib = Path.Combine(PluginDirectory, "Source/SequencePlugin/Public/EthAbi/libethabi_bridge.a");
string includes = Path.Combine(ModuleDirectory, "Public/EthAbi/");

PublicSystemLibraryPaths.Add(includes);
PublicAdditionalLibraries.Add(lib);

AddEthAbiLibraries();

PublicIncludePaths.AddRange(
new string[] {
// ... add public include paths required here ...
Expand Down Expand Up @@ -141,4 +137,35 @@ public SequencePlugin(ReadOnlyTargetRules Target) : base(Target)
);//Public Frameworks
}//IOS Frameworks
}//SequencePlugin

public void AddEthAbiLibraries()
{
string EthAbiDirectory = Path.Combine(PluginDirectory, "Source/SequencePlugin/Public/EthAbi/");

PublicSystemLibraryPaths.Add(EthAbiDirectory);

if (Target.Platform == UnrealTargetPlatform.Win64)
{
string libDir = Path.Combine(EthAbiDirectory, "windows");
PublicAdditionalLibraries.Add(Path.Combine(libDir, "libethabi_bridge.lib"));

// Add extra MSVC libs here
// PublicSystemLibraries.AddRange(new string[] { "advapi32", "bcrypt" });
}
else if (Target.Platform == UnrealTargetPlatform.Mac)
{
string libDir = Path.Combine(EthAbiDirectory, "macos");
PublicAdditionalLibraries.Add(Path.Combine(libDir, "libethabi_bridge.a"));
}
else if (Target.Platform == UnrealTargetPlatform.IOS)
{
PublicAdditionalLibraries.Add(Path.Combine(EthAbiDirectory, "ios", "libethabi_bridge.a"));
}
else if (Target.Platform == UnrealTargetPlatform.Android)
{
string libDir = Path.Combine(EthAbiDirectory, "android");
PublicAdditionalLibraries.Add(Path.Combine(libDir, "arm64", "libethabi_bridge.a"));
PublicAdditionalLibraries.Add(Path.Combine(libDir, "x86", "libethabi_bridge.a"));
}
}
}//namespace