Skip to content

Commit

Permalink
feat: uncomment rsk in docs, smaller fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kilrau committed Oct 24, 2023
1 parent 9e5eade commit 0f588e0
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 39 deletions.
74 changes: 37 additions & 37 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,21 +293,21 @@ Response:
}
```

### EVM Chains (Coming Soon!)
### EVM Chains (Currently RSK Testnet Only!)

~~Swaps from account-based EVM chains like RSK do not require a new address for every swap. `/createswap` takes the details of the swap (like lightning invoice and pair) and Boltz waits until the user locked e.g. rBTC in the contract. The addresses of those contracts can be queried with~~ [~~`/getcontracts`~~](api.md#swap-contracts-coming-soon) ~~and the address of the contract that needs to be used for the swap is also returned in the response of this request.~~
Swaps from account-based EVM chains like RSK do not require a new address for every swap. `/createswap` takes the details of the swap (like lightning invoice and pair) and Boltz waits until the user locked e.g. rBTC in the contract. The addresses of those contracts can be queried with [`/getcontracts`](api.md#swap-contracts-coming-soon) and the address of the contract that needs to be used for the swap is also returned in the response of this request.

~~The request does not require any additional values.~~
The request does not require any additional values.

~~But the response has one additional value:~~
But the response has one additional value:

* ~~`claimAddress`: which is e.g. the RSK address of Boltz. It is specified in the`lock` function of the swap contract~~
* `claimAddress`: which is e.g. the RSK address of Boltz. It is specified in the`lock` function of the swap contract

~~**Examples:**~~
**Examples:**

~~`POST /createswap`~~
`POST /createswap`

~~Request body:~~
Request body:

```json
{
Expand All @@ -318,7 +318,7 @@ Response:
}
```

~~Response:~~
Response:

```json
{
Expand Down Expand Up @@ -584,30 +584,30 @@ Response body:
}
```

### EVM Chains (Coming Soon!)
### EVM Chains (Currently RSK Testnet Only!)

~~Requests to create swaps for Reverse Submarine Swaps from account-based EVM chains like RSK have to contain one additional value:~~
Requests to create swaps for Reverse Submarine Swaps from account-based EVM chains like RSK have to contain one additional value:

* ~~`claimAddress`: address from which the bitcoin will be claimed~~
* `claimAddress`: address from which the bitcoin will be claimed

~~The response also has one more property:~~
The response also has one more property:

* ~~`refundAddress`: the address of Boltz which is specified as refund address when it is locking up funds~~
* `refundAddress`: the address of Boltz which is specified as refund address when it is locking up funds

~~Also, Boltz offers an optional protocol called EVM prepay miner fee that allows the user to pay an additional lightning invoice to pay for gas on the EVM chain to claim funds. In this process, Boltz sends some e.g. rBTC to the `claimAddress` in the lockup process in case the user's `claimAddress` does not have enough rBTC to pay gas to claim the funds. To use that protocol set the following property in the request body to `true`.~~
Also, Boltz offers an optional protocol called EVM prepay miner fee that allows the user to pay an additional lightning invoice to pay for gas on the EVM chain to claim funds. In this process, Boltz sends some e.g. rBTC to the `claimAddress` in the lockup process in case the user's `claimAddress` does not have enough rBTC to pay gas to claim the funds. To use that protocol set the following property in the request body to `true`.

* ~~`prepayMinerFee`: if the prepay miner fee protocol should be used for the Reverse Swap~~
* `prepayMinerFee`: if the prepay miner fee protocol should be used for the Reverse Swap

~~When the EVM prepay miner fee protocol is used the response will contain two more values. One is the amount of rBTC that will be sent to `claimAddress` in the lockup process. The other is an invoice for the rBTC sent. Only when both invoices are paid the chain bitcoin will get locked.~~
When the EVM prepay miner fee protocol is used the response will contain two more values. One is the amount of rBTC that will be sent to `claimAddress` in the lockup process. The other is an invoice for the rBTC sent. Only when both invoices are paid the chain bitcoin will get locked.

* ~~`prepayMinerFeeAmount`: amount of e.g. rBTC that will be sent to the `claimAddress` with the lockup transaction from Boltz~~
* ~~`minerFeeInvoice`: invoice that pays for the rBTC sent in the lockup process~~
* `prepayMinerFeeAmount`: amount of e.g. rBTC that will be sent to the `claimAddress` with the lockup transaction from Boltz
* `minerFeeInvoice`: invoice that pays for the rBTC sent in the lockup process

~~**Examples:**~~
**Examples:**

~~`POST /createswap`~~
`POST /createswap`

~~Request body:~~
Request body:

```json
{
Expand All @@ -620,7 +620,7 @@ Response body:
}
```

~~Response body:~~
Response body:

```json
{
Expand Down Expand Up @@ -814,32 +814,32 @@ Response:
}
```

## Swap Contracts (Coming Soon!)
## Swap Contracts (Currently RSK Testnet Only!)

~~To query the addresses of contracts used by Boltz for swaps on EVM chains like~~ [~~RSK~~](https://rootstock.io/)~~, the following endpoint can be queried:~~
To query the addresses of contracts used by Boltz for swaps on EVM chains like [RSK](https://rootstock.io/), the following endpoint can be queried:

| URL | Response |
| ------------------- | ------------- |
| `GET /getcontracts` | `JSON` object |

~~Status Codes:~~
Status Codes:

* ~~`200 OK`~~
* `200 OK`

~~Response object:~~
Response object:

* ~~`rsk`: a `JSON` object that contains all relevant RSK addresses~~
* ~~`network`: `JSON` object that contains information about the network~~
* ~~`chainId`: id of the RSK chain~~
* ~~`name`: if the RSK network of the backend is public, this property will be set to its name. Else this value stays `undefined`.~~
* ~~`swapContracts`: `JSON` object containing swap contract addresses as values~~
* ~~`tokens`: `JSON` object with the ticker symbol of the supported token as key and its address as value~~
* `rsk`: a `JSON` object that contains all relevant RSK addresses
* `network`: `JSON` object that contains information about the network
* `chainId`: id of the RSK chain
* `name`: if the RSK network of the backend is public, this property will be set to its name. Else this value stays `undefined`.
* `swapContracts`: `JSON` object containing swap contract addresses as values
* `tokens`: `JSON` object with the ticker symbol of the supported token as key and its address as value

~~**Examples:**~~
**Examples:**

~~`GET /getcontracts`~~
`GET /getcontracts`

~~Response:~~
Response:

```json
{
Expand Down
4 changes: 2 additions & 2 deletions docs/scripting.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,6 @@ There is one more difference when compared to claim transactions: the `nLockTime

An example for this can be found in the [`boltz-core`](https://github.com/BoltzExchange/boltz-core/blob/master/lib/swap/Refund.ts#L20) reference library. The linked function uses the claim function from above but requires the timeout block height as argument and sets an empty preimage.

## EVM chains
## EVM Chains

The HTLCs that Boltz uses on EVM chains are not single use scripts, but contracts. The source for the those contracts and integration tests can be found in the [`boltz-core`](https://github.com/BoltzExchange/boltz-core/tree/master/contracts) [r](https://github.com/BoltzExchange/boltz-core/blob/master/lib/swap/Scripts.ts)eference library.
The HTLCs that Boltz uses on EVM chains are not single use scripts, but contracts. The source for the those contracts and integration tests can be found in the [`boltz-core`](https://github.com/BoltzExchange/boltz-core/tree/master/contracts) reference library.

0 comments on commit 0f588e0

Please sign in to comment.