{"id":18084150,"url":"https://github.com/aptos-labs/aptos-dotnet-sdk","last_synced_at":"2025-08-20T04:31:29.866Z","repository":{"id":258458112,"uuid":"856570580","full_name":"aptos-labs/aptos-dotnet-sdk","owner":"aptos-labs","description":"Aptos C#/.NET SDK for building Web3 applications","archived":false,"fork":false,"pushed_at":"2024-12-11T22:31:53.000Z","size":786,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-12-15T07:30:45.079Z","etag":null,"topics":["aptos","csharp","dotnet","godot","unity","web3"],"latest_commit_sha":null,"homepage":"https://aptos.dev/en/build/sdks/dotnet-sdk","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aptos-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-12T19:59:31.000Z","updated_at":"2024-12-11T22:29:19.000Z","dependencies_parsed_at":"2024-10-19T05:14:54.825Z","dependency_job_id":null,"html_url":"https://github.com/aptos-labs/aptos-dotnet-sdk","commit_stats":null,"previous_names":["aptos-labs/aptos-dotnet-sdk"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aptos-labs%2Faptos-dotnet-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aptos-labs%2Faptos-dotnet-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aptos-labs%2Faptos-dotnet-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aptos-labs%2Faptos-dotnet-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aptos-labs","download_url":"https://codeload.github.com/aptos-labs/aptos-dotnet-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230394214,"owners_count":18218705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aptos","csharp","dotnet","godot","unity","web3"],"created_at":"2024-10-31T15:05:52.433Z","updated_at":"2024-12-19T06:43:40.182Z","avatar_url":"https://github.com/aptos-labs.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C#/.NET SDK for Aptos (Beta)\n\n![License][github-license]\n\n## Overview\n\nThe Aptos .NET SDK is a library that provides a convenient way to interact with the Aptos blockchain using C# under the .NET framework. The SDK is designed to offer all the necessary tools to build applications that interact with the Aptos blockchain.\n\n### Features\n\n- Binary Canonical Serialization (BCS) encoding and decoding\n- Ed25519, SingleKey, MultiKey, and Keyless signer support\n- Utilities for transaction building, signing, and submission\n- Abstractions over the Aptos Fullnode and Indexer APIs\n\n## Usage\n\nInitialize an instance of the `AptosClient` class to interact with the Aptos blockchain. You can use a pre-defined network configuration from the `Networks` class.\n\n```csharp\n// 1. Import the Aptos namespace\nusing Aptos;\n\n// 2. Initialize the Aptos client\nvar config = new AptosConfig(Networks.Mainnet);\nvar client = new AptosClient(config);\n\n// 3. Use the client to interact with the blockchain!\nvar ledgerInfo = await client.Block.GetLedgerInfo();\n```\n\n### Sign and Submit Transactions\n\nTo sign and submit a transaction, you can build a payload using the `AptosClient` and sign it with an `Account` signer.\n\n```csharp\nusing Aptos;\n\n// 1. Initialize the Aptos client\nvar config = new AptosConfig(Networks.Mainnet);\nvar client = new AptosClient(config);\n\n// 2. Create a new account\nvar account = Account.Generate();\n\n// 2. Create a transaction payload\nvar transaction = await client.Transaction.Build(\n    sender: account,\n    data: new GenerateEntryFunctionPayloadData(\n        function: \"0x1::aptos_account::transfer_coins\",\n        typeArguments: [\"0x1::aptos_coin::AptosCoin\"],\n        functionArguments: [account.Address, \"100000\"]\n    )\n);\n\n// 3. Sign and submit the transaction\nvar pendingTransaction = client.Transaction.SignAndSubmitTransaction(account, transaction);\n\n// 4. (Optional) Wait for the transaction to be committed\nvar committedTransaction = await client.Transaction.WaitForTransaction(pendingTransaction);\n```\n\n### Smart Contract View Functions\n\nCall view functions to query smart contracts.\n\n```csharp\nusing Aptos;\n\n// 1. Initialize the Aptos client\nvar config = new AptosConfig(Networks.Mainnet);\nvar client = new AptosClient(config);\n\n// 2. Call a view function\nvar result = await client.Contract.View(\n    new GenerateViewFunctionPayloadData(\n        function: \"0x1::coin::name\",\n        functionArguments: [],\n        typeArguments: [\"0x1::aptos_coin::AptosCoin\"]\n    )\n);\n\n// 3. Parse the return values\nConsole.WriteLine(result[0]);\n```\n\n## Installation\n\nThe SDK is published onto [NuGet](https://www.nuget.org/packages/Aptos/) where you can install it using the following command:\n\n```bash\ndotnet add package Aptos\n```\n\n### Unity\n\nFind the Aptos Unity SDK repository at [aptos-labs/unity-sdk](https://github.com/aptos-labs/unity-sdk).\n\n### Unity Package Manager (UPM)\n\n1. Open the Unity Package Manager (`Window` \u003e `Package Manager`).\n2. Click on the `+` button and select `Add package from git URL...`.\n3. Enter the URL of the Aptos Unity SDK path in this repository: \n```bash\nhttps://github.com/aptos-labs/unity-sdk.git?path=/Packages/com.aptoslabs.aptos-unity-sdk\n```\n\n### Import Asset Package\n1. Go to the [`aptos-labs/unity-sdk Releases`](https://github.com/aptos-labs/unity-sdk/releases) and download the latest release. \n2. Drag and drop the `.unitypackage` file into your Unity project.\n\n### Godot\n\nTo install the Aptos SDK into your Godot project, you will need to add the Aptos SDK into your Godot project's `.csproj` file.\n\n1. Find the `.csproj` file in the root of your Godot project.\n2. Add the following line to the `\u003cItemGroup\u003e` section of the `.csproj` file. If it doesn't exist, create it the `\u003cItemGroup\u003e` section.\n\n```xml\n\u003cProject Sdk=\"Godot.NET.Sdk/4.3.0\"\u003e\n  \u003cPropertyGroup\u003e\n    \u003cTargetFramework\u003enet6.0\u003c/TargetFramework\u003e\n    \u003cTargetFramework Condition=\" '$(GodotTargetPlatform)' == 'android' \"\u003enet7.0\u003c/TargetFramework\u003e\n    \u003cTargetFramework Condition=\" '$(GodotTargetPlatform)' == 'ios' \"\u003enet8.0\u003c/TargetFramework\u003e\n    \u003cEnableDynamicLoading\u003etrue\u003c/EnableDynamicLoading\u003e\n    \u003cRootNamespace\u003eAptosSDKExample\u003c/RootNamespace\u003e\n  \u003c/PropertyGroup\u003e\n\n  \u003c!-- START: Add these lines --\u003e\n  \u003cItemGroup\u003e\n    \u003cPackageReference Include=\"Aptos\" Version=\"0.0.1-beta\" /\u003e\n  \u003c/ItemGroup\u003e\n  \u003c!-- END --\u003e\n\n\u003c/Project\u003e\n```\n\n3. You can now use the Aptos SDK in your Godot project.\n\n```csharp\nusing Aptos;\n\npublic partial class MyClass : Node\n{\n    public override void _Ready()\n    {\n        var client = new AptosClient(Networks.Mainnet);\n        var ledgerInfo = await client.Block.GetLedgerInfo();\n        Console.WriteLine($\"Ledger Block Height: {ledgerInfo.BlockHeight}\");\n    }\n}\n```\n\n## API Reference\n\nThe entire API reference can be found here: [API Reference](https://aptos-labs.github.io/aptos-dotnet-sdk/)\n\n## Examples \n\nExamples 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:\n\n```bash\ndotnet run --project ./Aptos.Examples --framework net8.0\n```\n\nThis 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.\n\n![examples-demonstration](https://i.imgur.com/YS140Zb.png)\n\n[github-license]: https://img.shields.io/github/license/aptos-labs/aptos-ts-sdk\n\n## Release Process\n\nTo release a new version of the SDK, you can bump the version in the `Directory.Build.props` file and push the changes to the `main` branch. The GitHub Actions workflow will automatically publish the new version to NuGet.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faptos-labs%2Faptos-dotnet-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faptos-labs%2Faptos-dotnet-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faptos-labs%2Faptos-dotnet-sdk/lists"}