Skip to content

Commit

Permalink
Add package metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
GhostWalker562 committed Sep 26, 2024
1 parent c528326 commit f8b1e62
Show file tree
Hide file tree
Showing 16 changed files with 61 additions and 35 deletions.
6 changes: 4 additions & 2 deletions Aptos.Examples/Aptos.Examples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
<PropertyGroup>
<TargetFrameworks>$(DefaultTargetFrameworks)</TargetFrameworks>
<OutputType>Exe</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup Label="C#">
<WarningLevel>0</WarningLevel>
</PropertyGroup>

Expand Down
8 changes: 3 additions & 5 deletions Aptos.Indexer/Aptos.Indexer.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\Package.props"></Import>

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>$(DefaultTargetFrameworks)</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 2 additions & 4 deletions Aptos.Poseidon/Aptos.Poseidon.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\Package.props"></Import>

<PropertyGroup>
<TargetFrameworks>$(DefaultTargetFrameworks)</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>

</Project>
3 changes: 1 addition & 2 deletions Aptos.Tests/Aptos.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

<PropertyGroup>
<TargetFrameworks>$(DefaultTestingFrameworks)</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
Expand All @@ -24,6 +22,7 @@

<ItemGroup>
<ProjectReference Include="..\Aptos\Aptos.csproj" />
<ProjectReference Include="..\Aptos.Indexer\Aptos.Indexer.csproj" />
<ProjectReference Include="..\Aptos.Poseidon\Aptos.Poseidon.csproj" />
</ItemGroup>

Expand Down
6 changes: 6 additions & 0 deletions Aptos.Tests/xunit.runner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
"longRunningTestSeconds": 60,
"showLiveOutput": true,
"stopOnFail": true
}
8 changes: 0 additions & 8 deletions Aptos/Aptos.Api/TransactionResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@ JsonSerializer serializer
var jsonObject = JObject.Load(reader);
var type = jsonObject["type"]?.ToString();

// If the type is `null`, it is a transaction simulation.
// In this case, we override to "user_transaction".
if (type == null)
{
type = "user_transaction";
jsonObject["type"] = "user_transaction";
}

return type switch
{
"user_transaction" => JsonConvert.DeserializeObject<UserTransactionResponse>(
Expand Down
4 changes: 2 additions & 2 deletions Aptos/Aptos.Clients/TransactionClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ await GenerateTransaction(
/// </summary>
/// <param name="data">The transaction data to simulate.</param>
/// <returns>The simulated transaction responses.</returns>
public async Task<List<UserTransactionResponse>> Simulate(SimulateTransactionData data)
public async Task<List<PendingTransactionResponse>> Simulate(SimulateTransactionData data)
{
var signedTransaction = GenerateSignedTransactionForSimulation(data);

Expand All @@ -405,7 +405,7 @@ public async Task<List<UserTransactionResponse>> Simulate(SimulateTransactionDat
);
}

var response = await _client.PostFullNode<List<UserTransactionResponse>>(
var response = await _client.PostFullNode<List<PendingTransactionResponse>>(
new(
path: "transactions/simulate",
originMethod: "simulateTransaction",
Expand Down
21 changes: 12 additions & 9 deletions Aptos/Aptos.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\Package.props"></Import>

<PropertyGroup>
<TargetFrameworks>$(DefaultTargetFrameworks)</TargetFrameworks>
<PackageVersion>$(DefaultVersion)</PackageVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>Aptos</AssemblyName>
<AssemblyTitle>Aptos</AssemblyTitle>
<PackageId>Aptos</PackageId>
<Description>Aptos Web3 .NET SDK built by Aptos Labs.</Description>
<PackageTags>aptos web3 blockchain unity godot</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<Content Include="..\README.md" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />
<PackageReference Include="StrawberryShake.Transport.Http" Version="13.9.11" />
Expand All @@ -17,12 +26,6 @@
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.0.2" />
</ItemGroup>

<PropertyGroup Label="C#">
<LangVersion>latest</LangVersion>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Aptos.Indexer\Aptos.Indexer.csproj" />
<ProjectReference Include="..\Aptos.Poseidon\Aptos.Poseidon.csproj" />
Expand Down
3 changes: 3 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@
<LangVersion>latest</LangVersion>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
</Project>
25 changes: 25 additions & 0 deletions Package.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- https://learn.microsoft.com/en-us/nuget/create-packages/package-authoring-best-practices#package-metadata-properties -->
<Project>

<PropertyGroup>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/aptos-labs/aptos-dotnet-sdk</RepositoryUrl>
</PropertyGroup>

<PropertyGroup>
<Authors>Aptos Labs</Authors>
<FileVersion>$(DefaultVersion)</FileVersion>
<AssemblyVersion>$(DefaultVersion)</AssemblyVersion>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>http://aptoslabs.dev/</PackageProjectUrl>
<PackageIcon>icon.jpg</PackageIcon>
<PackageVersion>$(DefaultVersion)-beta.1</PackageVersion>
<Copyright>Copyright (c) Aptos Labs 2024</Copyright>
</PropertyGroup>

<ItemGroup>
<Content Include="..\assets\icon.jpg" PackagePath="\" />
<Content Include="..\LICENSE" Pack="True" PackagePath="\" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ var committedTransaction = await client.Transaction.WaitForTransaction(pendingTr

## Examples

Examples can be found in the [`Aptos.Examples`](./Aptos.Examples) project. Run the examples by using the following command:
Examples can be found in the [`Aptos.Examples`](https://github.com/aptos-labs/aptos-dotnet-sdk/tree/main/Aptos.Examples) project. Run the examples by using the following command:

```bash
dotnet run --project ./Aptos.Examples --framework net8.0
```

This will prompt the follow console. You can select an example to run by entering the corresponding number or using the arrow keys to navigate the menu.

![examples-demonstration](./assets/examples_demo.png)
![examples-demonstration](https://i.imgur.com/YS140Zb.png)

[github-license]: https://img.shields.io/github/license/aptos-labs/aptos-ts-sdk
[github-license]: https://img.shields.io/github/license/aptos-labs/aptos-ts-sdk
Binary file added artifacts/Aptos.0.0.1-beta.1.nupkg
Binary file not shown.
Binary file added artifacts/Aptos.Indexer.0.0.1-beta.1.nupkg
Binary file not shown.
Binary file added artifacts/Aptos.Poseidon.0.0.1-beta.1.nupkg
Binary file not shown.
Binary file removed assets/examples_demo.png
Binary file not shown.
Binary file added assets/icon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f8b1e62

Please sign in to comment.