Skip to content
JavaScript SDK for cnd's HTTP API written in TypeScript
TypeScript Other
Branch: master
Clone or download
thomaseizinger Add README with link to create-comit-app and basic overview (#24)
Add README with link to create-comit-app and basic overview
Latest commit 548e5b8 Oct 23, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.githooks Initial version of SDK extracted from hello-swap Sep 20, 2019
.github/workflows Only test against Node 10 Sep 20, 2019
dist Return transaction IDs from ledger actions Oct 17, 2019
gen
src Return transaction IDs from ledger actions Oct 17, 2019
types Initial version of SDK extracted from hello-swap Sep 20, 2019
.gitignore Initial version of SDK extracted from hello-swap Sep 20, 2019
.prettierignore Initial version of SDK extracted from hello-swap Sep 20, 2019
LICENSE
README.md
jest.config.js Initial version of SDK extracted from hello-swap Sep 20, 2019
package.json
siren.schema.json Initial version of SDK extracted from hello-swap Sep 20, 2019
tsconfig.json Initial version of SDK extracted from hello-swap Sep 20, 2019
tslint.json Initial version of SDK extracted from hello-swap Sep 20, 2019

README.md

Comit Javascript SDK

A software development kit for developing Javascript applications on top of the COMIT protocol reference implementation comit-rs.

Currently comit-rs is shipped as a binary called cnd (COMIT Network Daemon).

Getting started

The fastest way to get started with the SDK is to take a look at examples using the SDK.

Create a project using create-comit-app and take a look at the generated examples folder!

SDK Overview

Communication with cnd

The SDK exports the ComitClient class which is a first starting point for the communication with cnd. The ComitClient allows you to:

  • sendSwaps: when the taker initiates a swap with the maker (after successful negotiation)
  • getNewSwaps: when the maker has received a swap from the taker
  • getOngoingSwaps: for both maker and taker during the execution of the swap (fund, redeem)
  • getDoneSwaps: for both maker and taker to retrieve swaps that are finished

Additionally the SDK exports more fine-grained functionality to communicate with cnd, take a look at the classes in cnd.ts for details.

Wallets

The SDK includes two Javascript wallets:

When starting an environment using the start-env command of create-comit-app an .env file is created that is read by an application using the SDK. The wallets are used to request balances and sending transactions.

You can’t perform that action at this time.