Socket
Book a DemoInstallSign in
Socket

@coinbase-sample/prime-sdk-ts

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coinbase-sample/prime-sdk-ts

Welcome to the Coinbase Prime API TypeScript SDK. This TypeScript project was created to allow developers to easily plug into the [Coinbase Prime API](https://docs.cdp.coinbase.com/prime/docs/welcome).

Source
npmnpm
Version
0.3.0
Version published
Weekly downloads
734
392.62%
Maintainers
1
Weekly downloads
 
Created
Source

Coinbase Prime API TypeScript SDK

Overview

Welcome to the Coinbase Prime API TypeScript SDK. This TypeScript project was created to allow developers to easily plug into the Coinbase Prime API.

License

The Prime Typescript 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.

Usage

Here are a few examples requests:

List Portfolios

client
    .listPortfolios()
    .then((result) => {
        console.log(result);
    })
    .catch((error) => {
        console.error(error.message);
    });

Get Assets

client
    .listAssets({entityId: "somePortfolioId"})
    .then((result) => {
        console.log(result);
    })
    .catch((error) => {
        console.error(error.message);
    });

Create Order

$10 Market Buy on BTC-USD

client
    .createOrder({
        portfolioId: "somePortfolioId",
        productId: "BTC-USD",
        side: OrderSide.BUY,
        type: OrderType.Market,
        baseQuantity: "0.0001"
    })
    .then((result) => {
        console.log(result);
    })
    .catch((error) => {
        console.error(error.message);
    });

Development Installation

npm install

Build and Use

To build the project, run the following command:

npm run build

Note: To avoid potential issues, do not forget to build your project again after making any changes to it.

After building the project, each .ts file will have its .js counterpart generated.

To run a file, use the following command:

node dist/{INSERT-FILENAME}.js

For example, a main.ts file would be run like:

node dist/main.js

FAQs

Package last updated on 14 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts