Admin

Admin endpints to handle the supported Wrapper APIs

Register a new Wrapper API

This method allows you to enable an API for a currency in the specified network. A currency can be supported in multiple networks

post

This method allows you to enable an API for a currency in the specified network. A currency can be supported in multiple networks. Configuration properties required (config parameter) to enable the currency API in a specific network are different for each API. Default values are used if custom config is not used.

Body
coinstringRequired

Currency for which you want to enable an API in the connector.

Example: btc
networkstringRequired

Network on which you want to enable the specified currency.

Example: testnet
configone ofRequired
or
or
or
Responses
200
Successful response
application/json
post
POST /addcoin HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 344

{
  "coin": "btc",
  "network": "testnet",
  "config": {
    "bitcoincoreRpcEndpoint": "http://swapper:swapper@bitcoincore-regtest:8332",
    "electrumRpcEndpoint": "http://swapper:swapper@electrum-regtest:30000",
    "bitcoincoreZmqEndpoint": "tcp://bitcoincore-regtest:28332",
    "bitcoinAddressCallbackHost": "http://connector:80",
    "electrsEndpoint": "electrs-regtest:60001:t"
  }
}
200

Successful response

{
  "success": true,
  "message": "testnet network added for currency btc"
}

Updating a Wrapper API

This method allows you to update the configuration properties that a currency API is using for a specific network.

post

This method allows you to update the configuration properties that a currency API is using for a specific network. Configuration properties required (config parameter) to update the currency API in a specific network are different for each API.

Body
coinstringRequired

Currency for which you want to update the configuration parameters

Example: btc
networkstringRequired

Network on which you want to enable the specified currency

Example: testnet
configone ofRequired
or
or
or
Responses
200
Successful response
application/json
post
POST /updatecoin HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 344

{
  "coin": "btc",
  "network": "testnet",
  "config": {
    "bitcoincoreRpcEndpoint": "http://swapper:swapper@bitcoincore-regtest:8332",
    "electrumRpcEndpoint": "http://swapper:swapper@electrum-regtest:30000",
    "bitcoincoreZmqEndpoint": "tcp://bitcoincore-regtest:28332",
    "bitcoinAddressCallbackHost": "http://connector:80",
    "electrsEndpoint": "electrs-regtest:60001:t"
  }
}
200

Successful response

{
  "success": true,
  "message": "Configuration for testnet network for currency btc updated successfully"
}

Get information of some Wrapper API

This method allows you to get the configuration properties that a currency API is using for a specific network.

post

This method allows you to get the configuration properties that a currency API is using for a specific network. Configuration properties (config parameter) returned are different for each API.

Body
coinstringRequired

Currency from which the configuration parameters are to be returned.

Example: btc
networkstringRequired

Network of the currency from which the configuration parameters are to be returned.

Example: testnet
Responses
200
Successful response
application/json
post
POST /getcoin HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 34

{
  "coin": "btc",
  "network": "testnet"
}
200

Successful response

{
  "success": true,
  "message": "Configuration for testnet network for currency btc retrieved successfully",
  "config": {
    "bitcoincoreRpcEndpoint": "http://swapper:swapper@bitcoincore-regtest:8332",
    "electrumRpcEndpoint": "http://swapper:swapper@electrum-regtest:30000",
    "bitcoincoreZmqEndpoint": "tcp://bitcoincore-regtest:28332",
    "bitcoinAddressCallbackHost": "http://connector:80",
    "electrsEndpoint": "electrs-regtest:60001:t"
  }
}

Unregister a Wrapper API

This method allows you to disable an API for a currency in the specified network.

post

This method allows you to disable an API for a currency in the specified network.

Body
coinstringRequired

Currency for which you want to disable an API in the connector

Example: btc
networkstringRequired

Network on which you want to disable the specified currency

Example: testnet
Responses
200
Successful response
application/json
post
POST /removecoin HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 34

{
  "coin": "btc",
  "network": "testnet"
}
200

Successful response

{
  "success": true,
  "message": "testnet network removed for currency btc"
}

Last updated