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
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.
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.