npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

comit-sdk

v0.17.1

Published

An SDK for developing COMIT applications.

Downloads

96

Readme


COMIT is an open protocol facilitating cross-blockchain applications. For example, with COMIT you can exchange Bitcoin for Ether or any ERC20 token directly with another person.

This repository contains the Javascript software development kit (SDK) that wraps the communication with the comit-network daemon.

If you wish to do an atomic swap on your machine or to integrate COMIT into an application (e.g. a DEX) please take a look at the Getting Started section of the COMIT documentation. If you have any questions, feel free to reach out to the team in our Gitter chat!

License Gitter chat

COMIT Javascript SDK

The COMIT Javascript SDK enables the integration of the comit-network daemon into Javascript applications. You'll find the latest comit-sdk version on npmjs.

Below you find a short introduction into the SDK. For more detailed information please refer to the API-documentation in our documentation.

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

The SDK enables you to create Javascript applications on top of COMIT. This can for example be a trustless decentralized exchange (DEX) or a multi-currency wallet.

The SDK offers functionality to negotiate a trade and to execute the trade after the negotiation is finished.

Trade Negotiation vs. Execution

The SDK integrates a simple negotiation protocol that serves as a starting point for makers and takers to create and take orders.

It is recommended to take a look at the TakerNegotiator and MakerNegotiator classes to get started.

The negotiation is currently only integrated into the SDK and does not concern the comit-network daemon (cnd). cnd is only used for executing the trade, i.e. preparing transactions necessary for executing the atomic swap and monitoring the respective ledgers of the swap.

For the execution you can use the SDK for communicating with cnd. Take a look at the ComitClient class to get started. The ComitClient enables you to:

  1. Initiate a swap with another party.
  2. Receive the fund action from cnd when available.
  3. Send the fund transaction to a wallet.
  4. Receive the redeem transaction from cnd when available.
  5. Send the redeem transaction to a wallet.

(For a refund scenario you would of course be able to receive and send the refund transaction as well.)

Wallets

The SDK includes two Javascript wallets:

These wallets are used to actually send the transactions necessary for the atomic swap to the respective ledger. COMIT is designed in a non-custodial way, thus cnd never holds your private key at any time. The wallets integrated in the SDK show how the transaction information received from cnd can be sent to the respective ledger. Note that you can, of course, use different wallets than the above default wallets in your application.