ComitClient
The ComitClient class is a one-stop shop interface for interacting with Swaps of Cnd.
It bundles all the necessary dependencies (BitcoinWallet, EthereumWallet, Cnd) to provide you with instances of Swaps.
Hierarchy
- ComitClient
Index
Constructors
Methods
- getDoneSwaps
- getNewSwaps
- getOngoingSwaps
- getPeerId
- getPeerListenAddresses
- retrieveSwapById
- sendSwap
- withBitcoinWallet
- withEthereumWallet
Constructors
constructor
+ new ComitClient(cnd
: Cnd): ComitClient
Defined in src/comit_client.ts:15
Parameters:
Name | Type |
---|---|
cnd | Cnd |
Returns: ComitClient
Methods
getDoneSwaps
▸ getDoneSwaps(): Promise‹Swap[]›
Defined in src/comit_client.ts:105
Returns: Promise‹Swap[]›
getNewSwaps
▸ getNewSwaps(): Promise‹Swap[]›
Defined in src/comit_client.ts:82
Returns: Promise‹Swap[]›
getOngoingSwaps
▸ getOngoingSwaps(): Promise‹Swap[]›
Defined in src/comit_client.ts:96
Returns: Promise‹Swap[]›
getPeerId
▸ getPeerId(): Promise‹string›
Defined in src/comit_client.ts:119
Returns: Promise‹string›
getPeerListenAddresses
▸ getPeerListenAddresses(): Promise‹string[]›
Defined in src/comit_client.ts:123
Returns: Promise‹string[]›
retrieveSwapById
▸ retrieveSwapById(swapId
: string): Promise‹Swap | undefined›
Defined in src/comit_client.ts:127
Parameters:
Name | Type |
---|---|
swapId | string |
Returns: Promise‹Swap | undefined›
sendSwap
▸ sendSwap(swapRequest
: SwapRequest): Promise‹Swap›
Defined in src/comit_client.ts:47
Send a SwapRequest to Cnd to create a Swap.
Parameters:
Name | Type | Description |
---|---|---|
swapRequest | SwapRequest |
Returns: Promise‹Swap›
withBitcoinWallet
▸ withBitcoinWallet(bitcoinWallet
: BitcoinWallet): ComitClient
Defined in src/comit_client.ts:26
Sets a BitcoinWallet in the ComitClient.
If you are planning to use this instance to handle swaps involving Bitcoin, you should set this.
Parameters:
Name | Type | Description |
---|---|---|
bitcoinWallet | BitcoinWallet | The wallet that should be used to handle Bitcoin related actions of swaps. |
Returns: ComitClient
withEthereumWallet
▸ withEthereumWallet(ethereumWallet
: EthereumWallet): ComitClient
Defined in src/comit_client.ts:38
Sets a EthereumWallet in the ComitClient.
If you are planning to use this instance to handle swaps involving Ethereum, you should set this.
Parameters:
Name | Type | Description |
---|---|---|
ethereumWallet | EthereumWallet | The wallet that should be used to handle Ethereum related actions of swaps. |
Returns: ComitClient