NAV

Fastspot Client Developer Documentation

Fastspot is a software provided to liquidity providers, so they can offer non-custodial, atomic swaps to their customers.

This documentation is for client developers that want to connect their client to a liquidity provider that runs Fastspot.

Fastspot and this documentation are copyrighted by Inuit International Operations Ltd. All rights reserved.
The initial version of the FAST API was designed by Nimiq Foundation, Inc.

Overview

The Fiat Atomic Swap Trading (FAST) API is a public protocol that is used for the communication between a liquidity provider and a trader.

The trader announces what assets they want to sell and buy and how much and the liquidity provider gives a price quote for such swap. If the trader accepts the quote, the liquidity provider will lock its funds in an automated escrow and wait for the trader to do the same. Once that happened, the liquidity provider will reveal the secret and thereby process the swap.

Fastspot is the first public implementation of the FAST protocol.

Hashed Time-Locked Contracts

Fastspot and the FAST protocol are based on Hashed Time-Locked Contracts (HTLC), a well-known and simple technique for building protocols for atomic swaps.

Bitcoin

Bitcoin HTLC script

OP_IF
    OP_SIZE <secret length> OP_EQUALVERIFY OP_SHA256 <hash> OP_EQUALVERIFY
    <recipient signature verification>
OP_ELSE
    <timeout> OP_CHECKLOCKTIMEVERIFY OP_DROP
    <refund signature verification>
OP_ENDIF

Bitcoin uses scripts to facilitate simple smart contracts.

BIP199 attempts to standardize the HTLC script for use in Bitcoin, using pubkey hashes during signature verification and further optimize the script by extracting common parts of the signature verification. However, BIP199 does not include a secret length check, making it unsuitable for interoperability with blockchains that have or require length restrictions.

For FAST, we thus use an adjusted version of the hash verification. Furthermore, we do not optimize the signature verification to remain flexible regarding the verification method. As FAST API works with a timestamp exclusively, it restricts the TIMEOUTOP to OP_CHECKLOCKTIMEVERIFY.

Bitcoin contract intermediary object example

{
  "scriptBytes": "6382012088a820545b88db88f9feb2f0686d861cd1ad70c18cfd20e27e4ab4ed6ea96a68b397398876a914ef8790a39445aabb04d25d4fc11344b6f75bdcfd88ac6704cc5eea5fb17576a9143baa8d3e8f6499591ba6c76471fdc4191389a89e88ac68",
  "p2sh": "2NBh57tvemUe3mHY8SpZKRs3Cr3WVhN4HxH",
  "p2wsh": "tb1q2mhvmajek99pa5n3zmpvte0klycvx6lshmkwfawlfnqexw5fkatqnkkfu7"
}

When a Bitcoin HTLC is involved the FAST API will always provide you with the full script being used in the intermediary object of the contract. The object will also provide the P2SH and P2WSH addresses for the script. Payments can be made directly to the script or any of the two provided addresses, however when a payment is made by a Fastspot service, it will reside to always pay to the P2WSH address to save on fees.

Ethereum

Public documentation will be provided as soon as Ethereum support is no longer in restricted test phase.

Nimiq

Nimiq has built-in, native support for HTLCs. Each HTLC is created using a transaction that has the specific contract terms in the data field and the recipient type set to 2 (HTLC).

The timeout of Nimiq HTLCs has to be provided as a block number, timestamps thus cannot be used directly. Fortunately, Nimiq uses an adaptive difficulty algorithm that keeps block times sufficiently constant around 1 minute to estimate the timeout of the HTLC.

Nimiq contract intermediary object example

{
  "timeoutBlock": 1289962,
  "data": "689dae2f77b048dcc08e14d73104ea14222b5be17a2a90f6499a10bdf9bf537637810dc523fe7293038b45fcbc038ac859c27f8dbb3cbeac9ad96dedbbfd5d3f5020be67f49a3c80bf010013aeea",
  "address": "NQ55 S2SH V83M XVTY NNMA 1785 063J FN8U 1AE1"
}

The FAST API will provide the contents of that data field, and the required timeout block number in the contract intermediary object. After the contract is funded, or the funding transaction sent, the API will also provide the contract address.

OASIS

Fiat transactions in FAST instances are typically facilitated using the Nimiq OASIS protocol.

OASIS intermediary object example

{
  "name": "OASIS Bank",
  "iban": "DE42500105178493278699",
  "bic": "INGDDEFFXXX",
  "purpose": "a80067d2-0731"
}

The intermediary object includes all the relevant fiat transaction details to finalize the swap. Clients are encouraged to verify them independently using the OASIS protocol.

Fiat Atomic Swap Trading API

At the time of this documentation, these were the API endpoint used for contacting the respective service.

Instance API base URL Notes
test.fastspot.io https://api.test.fastspot.io/fast/v1 Operating on testnet.
go.fastspot.io https://api.go.fastspot.io/fast/v1

In this documentation, all URLs will be based on the test.fastspot.io instance. That instance also provides a Swagger UI for easy testing of the API endpoints.

Authentication

All operations that create, confirm, cancel or fetch a swap or related details need to be authenticated using an API key.

The API key is provided to you by the provider of the FAST instance. Use of the API may be subject to additional terms and conditions. Please contact:

Instance e-Mail
test.fastspot.io test@fastspot.io
go.fastspot.io go@fastspot.io

List supported assets

Code samples

GET https://api.test.fastspot.io/fast/v1/assets HTTP/1.1
Host: api.test.fastspot.io
Accept: application/json

GET /assets

Returns a list of all assets supported by the FAST instance running on this server.

Example responses

200 Response

[
  {
    "symbol": "BTC",
    "name": "Bitcoin",
    "feePerUnit": "0.00000030",
    "software": {
      "name": "Bitcoin Core",
      "version": "0.20.1"
    },
    "limits": {
      "minimum": "0.00001"
    }
  },
  {
    "symbol": "NIM",
    "name": "Nimiq",
    "feePerUnit": "0",
    "software": {
      "name": "Nimiq Core",
      "version": "1.5.0"
    }
  },
  {
    "symbol": "EUR",
    "name": "Euro",
    "provider": {
      "company": "OASIS Bank AG",
      "url": "https://oasis-bank.ag"
    },
    "limits": {
      "minimum": "1",
      "maximum": "1000"
    }
  }
]

Responses

Status Meaning Description Schema
200 OK Operation successful Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [AssetInfo] false none none
» symbol AssetSymbol true none none
» limits AssetLimits false none none
»» maximum AssetQuantity(decimal) false none none
»» minimum AssetQuantity(decimal) false none none
» name string true none none
» software object false none none
»» name string false none none
»» version string false none none
» provider object false none none
»» name string false none none
»» url string false none none
»» company string false none none

Estimate swap price

Code samples

POST https://api.test.fastspot.io/fast/v1/estimates HTTP/1.1
Host: api.test.fastspot.io
Content-Type: application/json
Accept: application/json

POST /estimates

Estimates the amount of any asset that can be received for selling the specified assets or that will will be required to receive the specified assets.

An estimate is not a quote and should only be used as an indication. When the result of this call is presented to the user, they should be informed that the price might change for the final quote.

If one side of the swap is not specified at all, estimates will be provided for all supported assets with sufficient liquidity.

Body parameter

{
  "from": {
    "EUR": "46.11"
  },
  "includedFees": "required"
}

Parameters

Name In Type Required Description
body body EstimateRequest true none

Example responses

200 Response

[
  {
    "from": [
      {
        "symbol": "EUR",
        "name": "Euro",
        "amount": "46.11"
      }
    ],
    "to": [
      {
        "symbol": "BTC",
        "name": "Bitcoin",
        "amount": "0.0001",
        "fundingNetworkFee": {
          "total": "0.000001",
          "perUnit": "0.00000001",
          "totalIsIncluded": true
        },
        "finalizeNetworkFee": {
          "total": "0.000001",
          "perUnit": "0.00000001",
          "totalIsIncluded": false
        }
      }
    ],
    "serviceFeePercentage": "0.01"
  }
]

404 Response

{
  "status": 404,
  "type": "urn:x-fast:problem:asset-not-found",
  "title": "Asset not found",
  "detail": "The asset identified by symbol LXP was not found. Check /assets to retrieve a list of all known assets and their symbols."
}

Responses

Status Meaning Description Schema
200 OK Operation successful Inline
404 Not Found Asset not found Problem

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [SwapInfo] false none none
» from [SwapInfoSide] true none none
»» symbol AssetSymbol true none none
»» name string true none none
»» amount AssetQuantity(decimal) true none none
»» fundingNetworkFee NetworkFee false none none
»»» total AssetQuantity(decimal) false none none
»»» perUnit AssetQuantity(decimal) false none none
»»» totalIsIncluded boolean false none none
»» operatingNetworkFee NetworkFee false none none
»» finalizeNetworkFee NetworkFee false none none
» to [SwapInfoSide] true none none
» serviceFeePercentage string(decimal) true none none
» direction SwapDirection true none none

Enumerated Values

Property Value
direction forward
direction reverse

Create swap quote

Code samples

POST https://api.test.fastspot.io/fast/v1/swaps HTTP/1.1
Host: api.test.fastspot.io
Content-Type: application/json
Accept: application/json

POST /swaps

Creates a quote to swap a single source asset for a set of target assets.

A quote has a limited lifespan, during this lifespan it has to be confirmed first and all relevant transactions have to be send. As such it is important to only request a quote when the payment is due.

Note that the server may limit the number of quotes pending a confirmation or waiting for incoming transaction. In such case this method will error.

This method also returns the required network transaction fee of the source asset. Note that any higher transaction fee is acceptable as well, but lower transaction fees may be refused. Any transaction fee on the target asset is already included within the quote amount.

Body parameter

{
  "from": {
    "EUR": "46.11"
  },
  "to": "BTC",
  "includedFees": "required"
}

Parameters

Name In Type Required Description
body body SwapRequest true none

Example responses

200 Response

{
  "id": "26885cac-7c10-45ab-af0b-b52f7a5a230e",
  "status": "waiting-for-confirmation",
  "expires": 1609178276,
  "info": {
    "from": [
      {
        "symbol": "EUR",
        "name": "Euro",
        "amount": "46.11"
      }
    ],
    "to": [
      {
        "symbol": "BTC",
        "name": "Bitcoin",
        "amount": "0.0001",
        "fundingNetworkFee": {
          "total": "0.000001",
          "perUnit": "0.00000001",
          "totalIsIncluded": true
        },
        "finalizeNetworkFee": {
          "total": "0.000001",
          "perUnit": "0.00000001",
          "totalIsIncluded": false
        }
      }
    ],
    "serviceFeePercentage": "0.01"
  }
}

Forbidden

{
  "status": 403,
  "type": "urn:x-fast:problem:invalid-api-key",
  "title": "Invalid API key"
}
{
  "status": 403,
  "type": "urn:x-fast:problem:quota-exceeded",
  "title": "Quota exceeded"
}

404 Response

{
  "status": 404,
  "type": "urn:x-fast:problem:asset-not-found",
  "title": "Asset not found",
  "detail": "The asset identified by symbol LXP was not found. Check /assets to retrieve a list of all known assets and their symbols."
}

Responses

Status Meaning Description Schema
200 OK Operation successful Swap
403 Forbidden Forbidden Problem
404 Not Found Asset not found Problem

Confirm quote and start swap

Code samples

POST https://api.test.fastspot.io/fast/v1/swaps/{id} HTTP/1.1
Host: api.test.fastspot.io
Content-Type: application/json
Accept: application/json

POST /swaps/{id}

This method updates the swap status. It is mostly used to * Confirm the swap and register the benificiaries * To lodge settlement instructions

If confirm is set to true, confirms a quote creted before. After confirming method, the asset swap can no longer be cancelled. Confirming also initiates the swap process by creating the required contracts. A caller is expected to complete the swap after they confirmed it. If a caller lets confirmed swaps expire repeatedly, their api key may be retracted. If the API is used from the context of an online shop to instantly swap crypto currency payments, the confirmation should only be persued after the buyer's final confirmation. When setting confirm is set, it is also required to include the benificiary details for each of the assets.

The beneficiary must be provided for all assets received. Depending on the asset implementation, the beneficiary must either be presented as an address or a JSON Web Key.

Refund information is optional for some asset implementations, for example when the funds are always returned to the sender in case of a failure.

Must be called with the same API key that created the quote.

Body parameter

{
  "confirm": true,
  "beneficiary": {
    "BTC": {
      "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
    }
  },
  "uid": "93631735-2a1a-4808-8509-3c3fde99c7a2"
}

Parameters

Name In Type Required Description
id path SwapId true The ID of an existing quote
body body SwapConfirmation true none

Example responses

200 Response

{
  "id": "26885cac-7c10-45ab-af0b-b52f7a5a230e",
  "status": "waiting-for-transactions",
  "expires": 1609178276,
  "info": {
    "from": [
      {
        "symbol": "EUR",
        "name": "Euro",
        "amount": "46.11"
      }
    ],
    "to": [
      {
        "symbol": "BTC",
        "name": "Bitcoin",
        "amount": "0.0001",
        "fundingNetworkFee": {
          "total": "0.000001",
          "perUnit": "0.00000001",
          "totalIsIncluded": true
        },
        "finalizeNetworkFee": {
          "total": "0.000001",
          "perUnit": "0.00000001",
          "totalIsIncluded": false
        }
      }
    ],
    "serviceFeePercentage": "0.01"
  },
  "hash": "32369514f78c59a538599ec756f4b0ab9ef7e1f11a835529696759f67a1a5446",
  "contracts": [
    {
      "id": "a80067d2-0731-408a-9c3e-644a0ef3d26a",
      "asset": "EUR",
      "recipient": {
        "kty": "EC",
        "crv": "P-256",
        "x": "MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4",
        "y": "4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM"
      },
      "amount": "46.11",
      "timeout": 1609178276,
      "direction": "send",
      "status": "pending",
      "intermediary": {
        "contractId": "a80067d2-0731-408a-9c3e-644a0ef3d26a",
        "name": "OASIS Bank",
        "iban": "DE42500105178493278699",
        "bic": "INGDDEFFXXX",
        "amount": "46.11",
        "purpose": "a80067d2-0731"
      }
    },
    {
      "id": "50ac6b29-b748-47e9-b412-2c817fa487b7",
      "asset": "BTC",
      "refund": {
        "address": "1MiCi78Edy8MiWsAxok7275N3ygQLsuHWm"
      },
      "recipient": {
        "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
      },
      "amount": "0.0001",
      "timeout": 1609178276,
      "direction": "receive",
      "status": "funded",
      "intermediary": {
        "address": "3B1zP1eP5QGefi44MPTgTL5SLmv7DivfHb"
      }
    }
  ]
}

Forbidden

{
  "status": 403,
  "type": "urn:x-fast:problem:invalid-api-key",
  "title": "Invalid API key"
}
{
  "status": 403,
  "type": "urn:x-fast:problem:access-denied",
  "title": "Access denied"
}

404 Response

{
  "status": 404,
  "type": "urn:x-fast:problem:swap-not-found",
  "title": "Swap not found",
  "detail": "No swap found under the given id aa51cb11-e806-4aa0-82b4-d04c67f331c6."
}

Conflict

{
  "status": 409,
  "type": "urn:x-fast:problem:already-confirmed",
  "title": "The swap was already confirmed"
}

Responses

Status Meaning Description Schema
200 OK Operation successful Swap
403 Forbidden Forbidden Problem
404 Not Found Swap not found Problem
409 Conflict Conflict Problem

Fetch swap information

Code samples

GET https://api.test.fastspot.io/fast/v1/swaps/{id} HTTP/1.1
Host: api.test.fastspot.io
Accept: application/json

GET /swaps/{id}

Fetches the current status of an asset swap as well as information on it.

Must be called with the same API key that created the quote.

Parameters

Name In Type Required Description
id path SwapId true The ID of an existing quote

Example responses

200 Response

{
  "id": "aa044189-1fc5-4ac3-b597-af2b37d91136",
  "status": "waiting-for-confirmation",
  "expires": 0,
  "info": {
    "from": [
      {
        "symbol": "NIM",
        "name": "string",
        "amount": "47.11",
        "fundingNetworkFee": {
          "total": "47.11",
          "perUnit": "47.11",
          "totalIsIncluded": false
        },
        "operatingNetworkFee": {
          "total": "47.11",
          "perUnit": "47.11",
          "totalIsIncluded": false
        },
        "finalizeNetworkFee": {
          "total": "47.11",
          "perUnit": "47.11",
          "totalIsIncluded": false
        }
      }
    ],
    "to": [
      {
        "symbol": "NIM",
        "name": "string",
        "amount": "47.11",
        "fundingNetworkFee": {
          "total": "47.11",
          "perUnit": "47.11",
          "totalIsIncluded": false
        },
        "operatingNetworkFee": {
          "total": "47.11",
          "perUnit": "47.11",
          "totalIsIncluded": false
        },
        "finalizeNetworkFee": {
          "total": "47.11",
          "perUnit": "47.11",
          "totalIsIncluded": false
        }
      }
    ],
    "serviceFeePercentage": "0.01",
    "direction": "forward"
  },
  "hash": "32369514f78c59a538599ec756f4b0ab9ef7e1f11a835529696759f67a1a5446",
  "secret": "270ea8715bdcba74a718e7fa6a452aee3035c17497bc08a8f388086f988f1ed2",
  "contracts": [
    {
      "id": "string",
      "asset": "NIM",
      "refund": {
        "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
      },
      "recipient": {
        "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
      },
      "amount": "47.11",
      "timeout": 0,
      "direction": "send",
      "status": "pending",
      "intermediary": null
    }
  ]
}

Forbidden

{
  "status": 403,
  "type": "urn:x-fast:problem:invalid-api-key",
  "title": "Invalid API key"
}
{
  "status": 403,
  "type": "urn:x-fast:problem:access-denied",
  "title": "Access denied"
}

404 Response

{
  "status": 404,
  "type": "urn:x-fast:problem:swap-not-found",
  "title": "Swap not found",
  "detail": "No swap found under the given id aa51cb11-e806-4aa0-82b4-d04c67f331c6."
}

Responses

Status Meaning Description Schema
200 OK Operation successful Swap
403 Forbidden Forbidden Problem
404 Not Found Swap not found Problem

Cancel swap

Code samples

DELETE https://api.test.fastspot.io/fast/v1/swaps/{id} HTTP/1.1
Host: api.test.fastspot.io
Accept: application/json

DELETE /swaps/{id}

Cancels a quote creted before. After using this method, the asset swap can no longer be confirmed.

Must be called with the same API key that created the quote.

Parameters

Name In Type Required Description
id path SwapId true The ID of an existing quote

Example responses

200 Response

{
  "id": "26885cac-7c10-45ab-af0b-b52f7a5a230e",
  "status": "cancelled",
  "expires": 1609178276,
  "info": {
    "from": [
      {
        "symbol": "EUR",
        "name": "Euro",
        "amount": "46.11"
      }
    ],
    "to": [
      {
        "symbol": "BTC",
        "name": "Bitcoin",
        "amount": "0.0001",
        "fundingNetworkFee": {
          "total": "0.000001",
          "perUnit": "0.00000001",
          "totalIsIncluded": true
        },
        "finalizeNetworkFee": {
          "total": "0.000001",
          "perUnit": "0.00000001",
          "totalIsIncluded": false
        }
      }
    ],
    "serviceFeePercentage": "0.01"
  }
}

Forbidden

{
  "status": 403,
  "type": "urn:x-fast:problem:invalid-api-key",
  "title": "Invalid API key"
}
{
  "status": 403,
  "type": "urn:x-fast:problem:access-denied",
  "title": "Access denied"
}

404 Response

{
  "status": 404,
  "type": "urn:x-fast:problem:swap-not-found",
  "title": "Swap not found",
  "detail": "No swap found under the given id aa51cb11-e806-4aa0-82b4-d04c67f331c6."
}

Conflict

{
  "status": 409,
  "type": "urn:x-fast:problem:already-confirmed",
  "title": "The swap was already confirmed"
}

Responses

Status Meaning Description Schema
200 OK Operation successful Swap
403 Forbidden Forbidden Problem
404 Not Found Swap not found Problem
409 Conflict Conflict Problem

Schemas

Problem

{
  "status": 400,
  "type": "urn:x-fast:problem:bad-request",
  "title": "Bad Request",
  "detail": "Invalid Content-Type for request"
}

Properties

Name Type Required Restrictions Description
status integer(int32) true none none
type string(uri) true none none
title string false none none
detail string false none none

AssetQuantity

"47.11"

Properties

Name Type Required Restrictions Description
anonymous string(decimal) false none none

AssetSymbol

"NIM"

Properties

Name Type Required Restrictions Description
anonymous string false none none

SwapId

"aa044189-1fc5-4ac3-b597-af2b37d91136"

Properties

Name Type Required Restrictions Description
anonymous string false none none

AssetLimits

{
  "maximum": "47.11",
  "minimum": "47.11"
}

Properties

Name Type Required Restrictions Description
maximum AssetQuantity false none none
minimum AssetQuantity false none none

AssetInfo

{
  "symbol": "NIM",
  "name": "Nimiq",
  "software": {
    "name": "Nimiq Core",
    "version": "1.5.0"
  }
}

Properties

Name Type Required Restrictions Description
symbol AssetSymbol true none none
limits AssetLimits false none none
name string true none none
software object false none none
» name string false none none
» version string false none none
provider object false none none
» name string false none none
» url string false none none
» company string false none none

EstimateRequest

{
  "from": {
    "BTC": 0.01
  },
  "to": {
    "BTC": 0.01
  },
  "includedFees": "all"
}

Properties

Name Type Required Restrictions Description
from RequestSide false none none
to RequestSide false none none
includedFees IncludedFees false none none

RequestSide

{
  "BTC": 0.01
}

Properties

anyOf

Name Type Required Restrictions Description
anonymous SpecificRequestSide false none Object mapping asset to amount

or

Name Type Required Restrictions Description
anonymous SingleAssetUnspecifiedRequestSide false none none

or

Name Type Required Restrictions Description
anonymous MultiAssetUnspecificRequestSide false none none

IncludedFees

"all"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous all
anonymous required
anonymous none

SwapRequestSide

{
  "BTC": 0.01
}

Properties

anyOf

Name Type Required Restrictions Description
anonymous SpecificRequestSide false none Object mapping asset to amount

or

Name Type Required Restrictions Description
anonymous SingleAssetUnspecifiedRequestSide false none none

SpecificRequestSide

{
  "BTC": 0.01
}

Object mapping asset to amount

Properties

Name Type Required Restrictions Description
additionalProperties AssetQuantity false none none

SingleAssetUnspecifiedRequestSide

"NIM"

Properties

None

MultiAssetUnspecificRequestSide

[
  "NIM"
]

Properties

Name Type Required Restrictions Description
anonymous [AssetSymbol] false none none

SwapInfo

{
  "from": [
    {
      "symbol": "NIM",
      "name": "string",
      "amount": "47.11",
      "fundingNetworkFee": {
        "total": "47.11",
        "perUnit": "47.11",
        "totalIsIncluded": false
      },
      "operatingNetworkFee": {
        "total": "47.11",
        "perUnit": "47.11",
        "totalIsIncluded": false
      },
      "finalizeNetworkFee": {
        "total": "47.11",
        "perUnit": "47.11",
        "totalIsIncluded": false
      }
    }
  ],
  "to": [
    {
      "symbol": "NIM",
      "name": "string",
      "amount": "47.11",
      "fundingNetworkFee": {
        "total": "47.11",
        "perUnit": "47.11",
        "totalIsIncluded": false
      },
      "operatingNetworkFee": {
        "total": "47.11",
        "perUnit": "47.11",
        "totalIsIncluded": false
      },
      "finalizeNetworkFee": {
        "total": "47.11",
        "perUnit": "47.11",
        "totalIsIncluded": false
      }
    }
  ],
  "serviceFeePercentage": "0.01",
  "direction": "forward"
}

Properties

Name Type Required Restrictions Description
from [SwapInfoSide] true none none
to [SwapInfoSide] true none none
serviceFeePercentage string(decimal) true none none
direction SwapDirection true none none

SwapInfoSide

{
  "symbol": "NIM",
  "name": "string",
  "amount": "47.11",
  "fundingNetworkFee": {
    "total": "47.11",
    "perUnit": "47.11",
    "totalIsIncluded": false
  },
  "operatingNetworkFee": {
    "total": "47.11",
    "perUnit": "47.11",
    "totalIsIncluded": false
  },
  "finalizeNetworkFee": {
    "total": "47.11",
    "perUnit": "47.11",
    "totalIsIncluded": false
  }
}

Properties

Name Type Required Restrictions Description
symbol AssetSymbol true none none
name string true none none
amount AssetQuantity true none none
fundingNetworkFee NetworkFee false none none
operatingNetworkFee NetworkFee false none none
finalizeNetworkFee NetworkFee false none none

NetworkFee

{
  "total": "47.11",
  "perUnit": "47.11",
  "totalIsIncluded": false
}

Properties

Name Type Required Restrictions Description
total AssetQuantity false none none
perUnit AssetQuantity false none none
totalIsIncluded boolean false none none

SwapDirection

"forward"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous forward
anonymous reverse

SwapRequest

{
  "from": {
    "BTC": 0.01
  },
  "to": {
    "BTC": 0.01
  },
  "includedFees": "all"
}

Properties

Name Type Required Restrictions Description
from SwapRequestSide true none none
to SwapRequestSide true none none
includedFees IncludedFees false none none

Swap

{
  "id": "aa044189-1fc5-4ac3-b597-af2b37d91136",
  "status": "waiting-for-confirmation",
  "expires": 0,
  "info": {
    "from": [
      {
        "symbol": "NIM",
        "name": "string",
        "amount": "47.11",
        "fundingNetworkFee": {
          "total": "47.11",
          "perUnit": "47.11",
          "totalIsIncluded": false
        },
        "operatingNetworkFee": {
          "total": "47.11",
          "perUnit": "47.11",
          "totalIsIncluded": false
        },
        "finalizeNetworkFee": {
          "total": "47.11",
          "perUnit": "47.11",
          "totalIsIncluded": false
        }
      }
    ],
    "to": [
      {
        "symbol": "NIM",
        "name": "string",
        "amount": "47.11",
        "fundingNetworkFee": {
          "total": "47.11",
          "perUnit": "47.11",
          "totalIsIncluded": false
        },
        "operatingNetworkFee": {
          "total": "47.11",
          "perUnit": "47.11",
          "totalIsIncluded": false
        },
        "finalizeNetworkFee": {
          "total": "47.11",
          "perUnit": "47.11",
          "totalIsIncluded": false
        }
      }
    ],
    "serviceFeePercentage": "0.01",
    "direction": "forward"
  },
  "hash": "32369514f78c59a538599ec756f4b0ab9ef7e1f11a835529696759f67a1a5446",
  "secret": "270ea8715bdcba74a718e7fa6a452aee3035c17497bc08a8f388086f988f1ed2",
  "contracts": [
    {
      "id": "string",
      "asset": "NIM",
      "refund": {
        "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
      },
      "recipient": {
        "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
      },
      "amount": "47.11",
      "timeout": 0,
      "direction": "send",
      "status": "pending",
      "intermediary": null
    }
  ]
}

Properties

Name Type Required Restrictions Description
id SwapId true none none
status SwapStatus true none none
expires integer true none none
info SwapInfo true none none
hash string false none none
secret string false none none
contracts [Contract] false none none

SwapStatus

"waiting-for-confirmation"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous waiting-for-confirmation
anonymous waiting-for-transactions
anonymous waiting-for-redemption
anonymous expired-pending-confirmation
anonymous expired-pending-transactions
anonymous cancelled
anonymous finished
anonymous invalid

Contract

{
  "id": "string",
  "asset": "NIM",
  "refund": {
    "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
  },
  "recipient": {
    "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
  },
  "amount": "47.11",
  "timeout": 0,
  "direction": "send",
  "status": "pending",
  "intermediary": null
}

Properties

Name Type Required Restrictions Description
id string true none none
asset AssetSymbol true none none
refund Target false none none
recipient Target true none none
amount AssetQuantity true none none
timeout integer true none none
direction ContractDirection true none none
status ContractStatus true none none
intermediary IntermediaryTarget false none none

ContractDirection

"send"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous send
anonymous receive

ContractStatus

"pending"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous pending
anonymous funded
anonymous timeout-reached
anonymous refunded
anonymous redeemed

SwapConfirmation

{
  "confirm": true,
  "beneficiary": {
    "EUR": {
      "kty": "EC",
      "crv": "P-256",
      "x": "MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4",
      "y": "4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM"
    }
  },
  "refund": {
    "BTC": {
      "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
    }
  },
  "uid": "93631735-2a1a-4808-8509-3c3fde99c7a2"
}

Properties

Name Type Required Restrictions Description
confirm boolean false none none
beneficiary object false none Object mapping asset to beneficiary for that asset
» additionalProperties Target false none none
refund object false none Object mapping asset to refundee for that asset
» additionalProperties Target false none none
uid string false none Identifier of the end user

Target

{
  "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
}

Properties

anyOf

Name Type Required Restrictions Description
anonymous Address false none none

or - discriminator: JsonWebKey.kty

Name Type Required Restrictions Description
anonymous JsonWebKey false none A JSON Web Key, one of EllipticCurveKey, OctetKeyPair.

Address

{
  "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
}

Properties

Name Type Required Restrictions Description
address string false none none

JsonWebKey

{
  "kty": "EC",
  "crv": "P-256",
  "x": "MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4",
  "y": "4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM"
}

A JSON Web Key, one of EllipticCurveKey, OctetKeyPair.

Properties

Name Type Required Restrictions Description
kty JsonWebKeyType true none none

oneOf

Name Type Required Restrictions Description
anonymous EllipticCurveKey false none none

xor

Name Type Required Restrictions Description
anonymous OctetKeyPair false none none

JsonWebKeyType

"EC"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous EC
anonymous OKP

EllipticCurveKey

{
  "kty": "EC",
  "crv": "P-256",
  "x": "MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4",
  "y": "4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM"
}

Properties

Name Type Required Restrictions Description
kty JsonWebKeyType false none none
crv string true none none
x string(base64url) true none none
y string(base64url) true none none

Enumerated Values

Property Value
crv P-256

OctetKeyPair

{
  "kty": "OKP",
  "crv": "Ed25519",
  "x": "UDbXAUgNRWwMzjWBW70RpEMrrhVF_CsdNb8e35Fv5No"
}

Properties

Name Type Required Restrictions Description
kty JsonWebKeyType false none none
crv string true none none
x string(base64url) true none none

Enumerated Values

Property Value
crv Ed25519