Skip to content

Commit

Permalink
Merge pull request #320 from NextGenSoftwareUK/feature/rsk-polygon
Browse files Browse the repository at this point in the history
Rootstock and Polygon
  • Loading branch information
dellams authored Aug 10, 2024
2 parents fb2d8b5 + 5dc27b2 commit 8d294ec
Show file tree
Hide file tree
Showing 38 changed files with 25,826 additions and 5 deletions.
Binary file modified .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dotnet.defaultSolution": "The OASIS.sln"
}
3 changes: 2 additions & 1 deletion NextGenSoftware.OASIS.API.Core/Enums/ProviderType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public enum ProviderType
TRONOASIS,
Neo4jOASIS,
CosmosBlockChainOASIS,
LocalFileOASIS
LocalFileOASIS,
RootstockOASIS
}
}
16 changes: 16 additions & 0 deletions NextGenSoftware.OASIS.API.DNA/OASISDNA.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ public class StorageProviderSettings
public ThreeFoldOASISProviderSettings ThreeFoldOASIS { get; set; }
public EthereumOASISProviderSettings EthereumOASIS { get; set; }
public ArbitrumOASISProviderSettings ArbitrumOASIS { get; set; }
public RootstockOASISProviderSettings RootstockOASIS { get; set; }
public PolygonOASISProviderSettings PolygonOASIS { get; set; }
public SQLLiteDBOASISSettings SQLLiteDBOASIS { get; set; }
public IPFSOASISSettings IPFSOASIS { get; set; }
public Neo4jOASISSettings Neo4jOASIS { get; set; }
Expand Down Expand Up @@ -312,6 +314,20 @@ public class ArbitrumOASISProviderSettings : ProviderSettingsBase
public string Abi { get; set; }
}

public class PolygonOASISProviderSettings : ProviderSettingsBase
{
public string ChainPrivateKey { get; set; }
public string ContractAddress { get; set; }
public string Abi { get; set; }
}

public class RootstockOASISProviderSettings : ProviderSettingsBase
{
public string ChainPrivateKey { get; set; }
public string ContractAddress { get; set; }
public string Abi { get; set; }
}

public class SQLLiteDBOASISSettings : ProviderSettingsBase
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@
using NextGenSoftware.OASIS.API.Providers.SQLLiteDBOASIS;
using NextGenSoftware.OASIS.API.Providers.Neo4jOASIS.Aura;
using NextGenSoftware.OASIS.API.Providers.ArbitrumOASIS;
using NextGenSoftware.OASIS.API.Providers.RootstockOASIS;
using NextGenSoftware.OASIS.API.Providers.PolygonOASIS;

namespace NextGenSoftware.OASIS.API.Native.EndPoint
{
public class OASISProviders
{
EthereumOASIS _ethereum;
ArbitrumOASIS _arbitrum;
RootstockOASIS _rootstock;
PolygonOASIS _polygon;
SolanaOASIS _solana;
EOSIOOASIS _EOSIO;
TelosOASIS _telos;
Expand Down Expand Up @@ -169,6 +173,48 @@ public ArbitrumOASIS Arbitrum
}
}

public PolygonOASIS Polygon
{
get
{
if (_polygon == null)
{
Task.Run(async () =>
{
OASISResult<IOASISStorageProvider> result = await OASISBootLoader.OASISBootLoader.RegisterProviderAsync(ProviderType.PolygonOASIS);

if (result != null && !result.IsError)
_polygon = (PolygonOASIS)result.Result;
else
OASISErrorHandling.HandleError(ref result, $"Error Occured In OASISAPIProviders In Polygon Property Getter. Reason: {result.Message}");
});
}

return _polygon;
}
}

public RootstockOASIS Rootstock
{
get
{
if (_rootstock == null)
{
Task.Run(async () =>
{
OASISResult<IOASISStorageProvider> result = await OASISBootLoader.OASISBootLoader.RegisterProviderAsync(ProviderType.RootstockOASIS);

if (result != null && !result.IsError)
_rootstock = (RootstockOASIS)result.Result;
else
OASISErrorHandling.HandleError(ref result, $"Error Occured In OASISAPIProviders In Rootstock Property Getter. Reason: {result.Message}");
});
}

return _rootstock;
}
}

public TelosOASIS Telos
{
get
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\NextGenSoftware.OASIS.API.Core\NextGenSoftware.OASIS.API.Core.csproj" />
<ProjectReference Include="..\NextGenSoftware.OASIS.Common\NextGenSoftware.OASIS.Common.csproj" />
<ProjectReference Include="..\NextGenSoftware.OASIS.API.Providers.Web3CoreOASIS\NextGenSoftware.OASIS.API.Providers.Web3CoreOASIS.csproj" />
</ItemGroup>

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<PackageId>NextGenSoftware.OASIS.API.Providers.PolygonOASIS</PackageId>
<Company>NextGen Software Ltd</Company>
<Product>WEB4 OASIS API Polygon OASIS Provider</Product>
<Title>WEB4 OASIS API Polygon OASIS Provider</Title>
<Summary>WEB4 OASIS API Polygon OASIS Provider is one of the many WEB2/WEB3 providers that plug in and integtate into the OASIS.</Summary>
<Description>WEB4 OASIS API Polygon OASIS Provider is one of the many WEB2/WEB3 providers that plug in and integtate into the OASIS.</Description>
<PackageProjectUrl>https://github.com/NextGenSoftwareUK/Our-World-OASIS-API-HoloNET-HoloUnity-And-.NET-HDK</PackageProjectUrl>
<PackageIcon>OASISLogo128.jpg</PackageIcon>
<Authors>David Ellams (NextGen Software Ltd)</Authors>
<PackageTags>OASIS API; Native; Integrated; WEB4; Provider </PackageTags>
<PackageReleaseNotes>Initial Release.</PackageReleaseNotes>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/NextGenSoftwareUK/Our-World-OASIS-API-HoloNET-HoloUnity-And-.NET-HDK</RepositoryUrl>
<Copyright>Copyright © NextGen Software Ltd 2022</Copyright>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<Version>1.0.0</Version>

<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
</PropertyGroup>

</Project>
16 changes: 16 additions & 0 deletions NextGenSoftware.OASIS.API.Providers.PolygonOASIS/PolygonOASIS.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using NextGenSoftware.OASIS.API.Core.Interfaces;
using NextGenSoftware.OASIS.API.Providers.Web3CoreOASIS;

namespace NextGenSoftware.OASIS.API.Providers.PolygonOASIS;

public sealed class PolygonOASIS : Web3CoreOASISBaseProvider, IOASISDBStorageProvider, IOASISNETProvider, IOASISSuperStar, IOASISBlockchainStorageProvider
{
public PolygonOASIS(string hostUri, string chainPrivateKey, string contractAddress, string abi)
: base(hostUri, chainPrivateKey, contractAddress, abi)
{
this.ProviderName = "PolygonOASIS";
this.ProviderDescription = "Polygon Provider";
this.ProviderType = new(Core.Enums.ProviderType.PolygonOASIS);
this.ProviderCategory = new(Core.Enums.ProviderCategory.StorageAndNetwork);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\NextGenSoftware.OASIS.API.Core\NextGenSoftware.OASIS.API.Core.csproj" />
<ProjectReference Include="..\NextGenSoftware.OASIS.Common\NextGenSoftware.OASIS.Common.csproj" />
<ProjectReference Include="..\NextGenSoftware.OASIS.API.Providers.Web3CoreOASIS\NextGenSoftware.OASIS.API.Providers.Web3CoreOASIS.csproj" />
</ItemGroup>

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<PackageId>NextGenSoftware.OASIS.API.Providers.RootstockOASIS</PackageId>
<Company>NextGen Software Ltd</Company>
<Product>WEB4 OASIS API Rootstock OASIS Provider</Product>
<Title>WEB4 OASIS API Rootstock OASIS Provider</Title>
<Summary>WEB4 OASIS API Rootstock OASIS Provider is one of the many WEB2/WEB3 providers that plug in and integtate into the OASIS.</Summary>
<Description>WEB4 OASIS API Rootstock OASIS Provider is one of the many WEB2/WEB3 providers that plug in and integtate into the OASIS.</Description>
<PackageProjectUrl>https://github.com/NextGenSoftwareUK/Our-World-OASIS-API-HoloNET-HoloUnity-And-.NET-HDK</PackageProjectUrl>
<PackageIcon>OASISLogo128.jpg</PackageIcon>
<Authors>David Ellams (NextGen Software Ltd)</Authors>
<PackageTags>OASIS API; Native; Integrated; WEB4; Provider </PackageTags>
<PackageReleaseNotes>Initial Release.</PackageReleaseNotes>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/NextGenSoftwareUK/Our-World-OASIS-API-HoloNET-HoloUnity-And-.NET-HDK</RepositoryUrl>
<Copyright>Copyright © NextGen Software Ltd 2022</Copyright>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<Version>1.0.0</Version>

<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using NextGenSoftware.OASIS.API.Core.Interfaces;
using NextGenSoftware.OASIS.API.Providers.Web3CoreOASIS;

namespace NextGenSoftware.OASIS.API.Providers.RootstockOASIS;

public sealed class RootstockOASIS : Web3CoreOASISBaseProvider, IOASISDBStorageProvider, IOASISNETProvider, IOASISSuperStar, IOASISBlockchainStorageProvider
{
public RootstockOASIS(string hostUri, string chainPrivateKey, string contractAddress, string abi)
: base(hostUri, chainPrivateKey, contractAddress, abi)
{
this.ProviderName = "RootstockOASIS";
this.ProviderDescription = "Rootstock Provider";
this.ProviderType = new(Core.Enums.ProviderType.RootstockOASIS);
this.ProviderCategory = new(Core.Enums.ProviderCategory.StorageAndNetwork);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
</ItemGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\NextGenSoftware.OASIS.API.Providers.Web3CoreOASIS\NextGenSoftware.OASIS.API.Providers.Web3CoreOASIS.csproj" />
</ItemGroup>

</Project>
Loading

0 comments on commit 8d294ec

Please sign in to comment.