CoinbaseSdk.Prime 0.8.0

dotnet add package CoinbaseSdk.Prime --version 0.8.0
                    
NuGet\Install-Package CoinbaseSdk.Prime -Version 0.8.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CoinbaseSdk.Prime" Version="0.8.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CoinbaseSdk.Prime" Version="0.8.0" />
                    
Directory.Packages.props
<PackageReference Include="CoinbaseSdk.Prime" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CoinbaseSdk.Prime --version 0.8.0
                    
#r "nuget: CoinbaseSdk.Prime, 0.8.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CoinbaseSdk.Prime@0.8.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CoinbaseSdk.Prime&version=0.8.0
                    
Install as a Cake Addin
#tool nuget:?package=CoinbaseSdk.Prime&version=0.8.0
                    
Install as a Cake Tool

Coinbase Prime .NET SDK

Overview

The Coinbase Prime .NET SDK is a sample library that demonstrates the structure of a Coinbase Prime driver for the REST APIs.

Repository: coinbase/prime-sdk-dotnet

Prerequisites

  • .NET 10 SDK or later
  • Coinbase Prime API credentials (access key, passphrase, and signing key), which can be created in the Prime web console under Settings > APIs

Installation

dotnet add package CoinbaseSdk.Prime --version x.y.z

Configuration

Coinbase Prime API credentials can be provided via environment variables. Copy the example file and populate your credentials:

cp .env.example .env

Required environment variables:

PRIME_ACCESS_KEY=your-access-key
PRIME_PASSPHRASE=your-passphrase
PRIME_SIGNING_KEY=your-signing-key

Optional environment variables used by examples:

PRIME_ENTITY_ID=your-entity-id
PRIME_PORTFOLIO_ID=your-portfolio-id

Entity ID can be retrieved by calling Get Portfolio.

Usage

Initialize the client using environment variables (automatically loads a .env file if present):

var client = CoinbasePrimeClient.FromEnv();

Or construct credentials manually:

var credentials = new CoinbaseCredentials(accessKey, passphrase, signingKey);
var client = new CoinbasePrimeClient(credentials);

Once the client is initialized, instantiate a service to make the desired call. For example, to list portfolios:

var portfoliosService = new PortfoliosService(client);
var response = portfoliosService.ListPortfolios(new ListPortfoliosRequest());

Or to list activities for a portfolio using the request builder:

var activitiesService = new ActivitiesService(client);

var request = new ListActivitiesRequest.ListActivitiesRequestBuilder()
    .WithPortfolioId(portfolioId)
    .Build();

var response = activitiesService.ListActivities(request);

OpenAPI spec

The Prime public OpenAPI specification is vendored at apiSpec/prime-public-api-spec.yaml. To refresh it:

make fetch-spec

Build

To build the sample library, ensure that .NET 10 SDK or later is installed and then run:

dotnet build prime-sdk-dotnet.sln

Examples

Each example under src/CoinbaseSdk/PrimeExample/examples/ is a standalone .cs file executable directly with .NET 10+:

dotnet run --file src/CoinbaseSdk/PrimeExample/examples/portfolios/ListPortfolios.cs
dotnet run --file src/CoinbaseSdk/PrimeExample/examples/portfolios/GetPortfolio.cs -- --portfolioId <portfolio-id>
dotnet run --file src/CoinbaseSdk/PrimeExample/examples/activities/ListActivities.cs -- --portfolioId <portfolio-id>
dotnet run --file src/CoinbaseSdk/PrimeExample/examples/balances/ListEntityBalances.cs -- --entityId <entity-id>

On Unix systems with executable permissions set, examples can also be invoked directly:

./src/CoinbaseSdk/PrimeExample/examples/portfolios/ListPortfolios.cs

Available example categories: activities, addressbook, advancedtransfer, allocations, assets, balances, commission, errors, financing, futures, invoice, onchainaddressbook, orders, paymentmethods, portfolios, positions, products, staking, transactions, users, wallets.

🚨 Security and Bug Reports

If you discover a security vulnerability within this SDK, please see our Security Policy for disclosure information.

📧 Contact

License

The Coinbase Prime .NET SDK sample library is free and open source and released under the Apache License, Version 2.0.

The application and code are only available for demonstration purposes.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.8.0 139 9/11/2026
0.7.0 729 6/24/2026
0.6.0 204 6/18/2026
0.4.0 1,961 1/5/2026
0.3.0 2,815 5/29/2025
0.2.0 311 2/21/2025