https://github.com/coinbase-samples/intx-sdk-ts
https://github.com/coinbase-samples/intx-sdk-ts
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/coinbase-samples/intx-sdk-ts
- Owner: coinbase-samples
- License: other
- Created: 2025-02-03T19:27:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-09-30T17:14:14.000Z (8 months ago)
- Last Synced: 2025-10-30T04:59:03.370Z (8 months ago)
- Language: TypeScript
- Size: 141 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Coinbase International Exchange API TypeScript SDK
## Overview
Welcome to the Coinbase International Exchange (INTX) API TypeScript SDK. This TypeScript project was created to allow developers to easily plug into the [Coinbase INTX API](https://docs.cdp.coinbase.com/intx/docs/welcome).
---
## License
The _Intx Typescript SDK_ sample library is free and open source and released under the [Apache License, Version 2.0](LICENSE).
The application and code are only available for demonstration purposes.
## Usage
Here are a few examples requests:
**[List Portfolios](https://docs.cdp.coinbase.com/intx/reference/getportfolios)**
```
const portfoliosService = new PortfoliosService(client);
portfoliosService
.listPortfolios()
.then((portfolios) => {
console.log(portfolios);
})
.catch((err) => console.log(err));
```
**[Get Assets](https://docs.cdp.coinbase.com/intx/reference/getassets)**
```
const assetService = new AssetsService(client);
assetService
.listAssets()
.then((assets) => {
console.log(assets);
})
.catch((err) => console.log(err));
```
**[Create Order](https://docs.cdp.coinbase.com/intx/reference/createorder)**
_$10 Market Buy on BTC-USD_
```
client
.createOrder({
portfolio: "somePortfolioId",
clientOrderId: "someClientOrderId",
instrument: "BTC-USD",
side: OrderSide.BUY,
type: OrderType.Market,
size: "0.0001"
})
.then((result) => {
console.log(result);
})
.catch((error) => {
console.error(error.message);
});
```
## Development Installation
```bash
npm install
```
---
## Build and Use
To build the project, run the following command:
```bash
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:
```bash
node dist/main.js
```
---