KMD API
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
API for KMD (Key Management Daemon)
Base URLs:
Email: Support
Authentication
- API Key (api_key)
- Parameter Name: X-KMD-API-Token, in: header. Generated header parameter. This value can be found in
/kmd/data/dir/kmd.token
. Example value: ‘330b2e4fc9b20f4f89812cf87f1dabeb716d23e3f11aec97a61ff5f750563b78’
- Parameter Name: X-KMD-API-Token, in: header. Generated header parameter. This value can be found in
Default
CreateWallet
Code samples
curl -X POST http://localhost/v1/wallet \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
POST http://localhost/v1/wallet HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "master_derivation_key": [ 0 ], "wallet_driver_name": "string", "wallet_name": "string", "wallet_password": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/wallet',{ method: 'POST', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.post 'http://localhost/v1/wallet', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.post('http://localhost/v1/wallet', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('POST','http://localhost/v1/wallet', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/wallet");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("POST");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "http://localhost/v1/wallet", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
POST /v1/wallet
Create a wallet
Create a new wallet (collection of keys) with the given parameters.
Body parameter
{ "master_derivation_key": [ 0 ], "wallet_driver_name": "string", "wallet_name": "string", "wallet_password": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | CreateWalletRequest | true | none |
Example responses
200 Response
{ "error": true, "message": "string", "wallet": { "driver_name": "string", "driver_version": 0, "id": "string", "mnemonic_ux": true, "name": "string", "supported_txs": [ "string" ] }}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to POST /v1/wallet | APIV1POSTWalletResponse |
DeleteKey
Code samples
curl -X DELETE http://localhost/v1/key \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
DELETE http://localhost/v1/key HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "address": "string", "wallet_handle_token": "string", "wallet_password": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/key',{ method: 'DELETE', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.delete 'http://localhost/v1/key', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.delete('http://localhost/v1/key', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('DELETE','http://localhost/v1/key', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/key");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("DELETE");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("DELETE", "http://localhost/v1/key", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
DELETE /v1/key
Delete a key
Deletes the key with the passed public key from the wallet.
Body parameter
{ "address": "string", "wallet_handle_token": "string", "wallet_password": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | DeleteKeyRequest | true | none |
Example responses
200 Response
{ "error": true, "message": "string"}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to DELETE /v1/key | APIV1DELETEKeyResponse |
DeleteMultisig
Code samples
curl -X DELETE http://localhost/v1/multisig \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
DELETE http://localhost/v1/multisig HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "address": "string", "wallet_handle_token": "string", "wallet_password": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/multisig',{ method: 'DELETE', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.delete 'http://localhost/v1/multisig', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.delete('http://localhost/v1/multisig', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('DELETE','http://localhost/v1/multisig', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/multisig");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("DELETE");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("DELETE", "http://localhost/v1/multisig", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
DELETE /v1/multisig
Delete a multisig
Deletes multisig preimage information for the passed address from the wallet.
Body parameter
{ "address": "string", "wallet_handle_token": "string", "wallet_password": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | DeleteMultisigRequest | true | none |
Example responses
200 Response
{ "error": true, "message": "string"}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to POST /v1/multisig/delete | APIV1DELETEMultisigResponse |
ExportKey
Code samples
curl -X POST http://localhost/v1/key/export \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
POST http://localhost/v1/key/export HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "address": "string", "wallet_handle_token": "string", "wallet_password": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/key/export',{ method: 'POST', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.post 'http://localhost/v1/key/export', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.post('http://localhost/v1/key/export', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('POST','http://localhost/v1/key/export', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/key/export");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("POST");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "http://localhost/v1/key/export", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
POST /v1/key/export
Export a key
Export the secret key associated with the passed public key.
Body parameter
{ "address": "string", "wallet_handle_token": "string", "wallet_password": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | ExportKeyRequest | true | none |
Example responses
200 Response
{ "error": true, "message": "string", "private_key": [ 0 ]}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to POST /v1/key/export | APIV1POSTKeyExportResponse |
ExportMasterKey
Code samples
curl -X POST http://localhost/v1/master-key/export \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
POST http://localhost/v1/master-key/export HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "wallet_handle_token": "string", "wallet_password": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/master-key/export',{ method: 'POST', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.post 'http://localhost/v1/master-key/export', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.post('http://localhost/v1/master-key/export', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('POST','http://localhost/v1/master-key/export', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/master-key/export");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("POST");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "http://localhost/v1/master-key/export", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
POST /v1/master-key/export
Export the master derivation key from a wallet
Export the master derivation key from the wallet. This key is a master “backup” key for the underlying wallet. With it, you can regenerate all of the wallets that have been generated with this wallet’s POST /v1/key
endpoint. This key will not allow you to recover keys imported from other wallets, however.
Body parameter
{ "wallet_handle_token": "string", "wallet_password": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | ExportMasterKeyRequest | true | none |
Example responses
200 Response
{ "error": true, "master_derivation_key": [ 0 ], "message": "string"}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to POST /v1/master-key/export | APIV1POSTMasterKeyExportResponse |
ExportMultisig
Code samples
curl -X POST http://localhost/v1/multisig/export \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
POST http://localhost/v1/multisig/export HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "address": "string", "wallet_handle_token": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/multisig/export',{ method: 'POST', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.post 'http://localhost/v1/multisig/export', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.post('http://localhost/v1/multisig/export', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('POST','http://localhost/v1/multisig/export', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/multisig/export");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("POST");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "http://localhost/v1/multisig/export", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
POST /v1/multisig/export
Export multisig address metadata
Given a multisig address whose preimage this wallet stores, returns the information used to generate the address, including public keys, threshold, and multisig version.
Body parameter
{ "address": "string", "wallet_handle_token": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | ExportMultisigRequest | true | none |
Example responses
200 Response
{ "error": true, "message": "string", "multisig_version": 0, "pks": [ [ 0 ] ], "threshold": 0}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to POST /v1/multisig/export | APIV1POSTMultisigExportResponse |
GenerateKey
Code samples
curl -X POST http://localhost/v1/key \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
POST http://localhost/v1/key HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "display_mnemonic": true, "wallet_handle_token": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/key',{ method: 'POST', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.post 'http://localhost/v1/key', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.post('http://localhost/v1/key', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('POST','http://localhost/v1/key', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/key");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("POST");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "http://localhost/v1/key", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
POST /v1/key
Generate a key
Generates the next key in the deterministic key sequence (as determined by the master derivation key) and adds it to the wallet, returning the public key.
Body parameter
{ "display_mnemonic": true, "wallet_handle_token": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | GenerateKeyRequest | true | none |
Example responses
200 Response
{ "address": "string", "error": true, "message": "string"}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to POST /v1/key | APIV1POSTKeyResponse |
GetVersion
Code samples
curl -X GET http://localhost/versions \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
GET http://localhost/versions HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/versions',{ method: 'GET', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.get 'http://localhost/versions', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.get('http://localhost/versions', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('GET','http://localhost/versions', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/versions");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("GET");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("GET", "http://localhost/versions", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
GET /versions
Retrieves the current version
Body parameter
{}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | VersionsRequest | false | none |
Example responses
200 Response
{ "versions": [ "string" ]}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to GET /versions | VersionsResponse |
GetWalletInfo
Code samples
curl -X POST http://localhost/v1/wallet/info \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
POST http://localhost/v1/wallet/info HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "wallet_handle_token": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/wallet/info',{ method: 'POST', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.post 'http://localhost/v1/wallet/info', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.post('http://localhost/v1/wallet/info', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('POST','http://localhost/v1/wallet/info', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/wallet/info");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("POST");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "http://localhost/v1/wallet/info", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
POST /v1/wallet/info
Get wallet info
Returns information about the wallet associated with the passed wallet handle token. Additionally returns expiration information about the token itself.
Body parameter
{ "wallet_handle_token": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | WalletInfoRequest | true | none |
Example responses
200 Response
{ "error": true, "message": "string", "wallet_handle": { "expires_seconds": 0, "wallet": { "driver_name": "string", "driver_version": 0, "id": "string", "mnemonic_ux": true, "name": "string", "supported_txs": [ "string" ] } }}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to POST /v1/wallet/info | APIV1POSTWalletInfoResponse |
ImportKey
Code samples
curl -X POST http://localhost/v1/key/import \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
POST http://localhost/v1/key/import HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "private_key": [ 0 ], "wallet_handle_token": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/key/import',{ method: 'POST', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.post 'http://localhost/v1/key/import', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.post('http://localhost/v1/key/import', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('POST','http://localhost/v1/key/import', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/key/import");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("POST");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "http://localhost/v1/key/import", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
POST /v1/key/import
Import a key
Import an externally generated key into the wallet. Note that if you wish to back up the imported key, you must do so by backing up the entire wallet database, because imported keys were not derived from the wallet’s master derivation key.
Body parameter
{ "private_key": [ 0 ], "wallet_handle_token": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | ImportKeyRequest | true | none |
Example responses
200 Response
{ "address": "string", "error": true, "message": "string"}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to POST /v1/key/import | APIV1POSTKeyImportResponse |
ImportMultisig
Code samples
curl -X POST http://localhost/v1/multisig/import \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
POST http://localhost/v1/multisig/import HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "multisig_version": 0, "pks": [ [ 0 ] ], "threshold": 0, "wallet_handle_token": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/multisig/import',{ method: 'POST', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.post 'http://localhost/v1/multisig/import', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.post('http://localhost/v1/multisig/import', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('POST','http://localhost/v1/multisig/import', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/multisig/import");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("POST");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "http://localhost/v1/multisig/import", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
POST /v1/multisig/import
Import a multisig account
Generates a multisig account from the passed public keys array and multisig metadata, and stores all of this in the wallet.
Body parameter
{ "multisig_version": 0, "pks": [ [ 0 ] ], "threshold": 0, "wallet_handle_token": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | ImportMultisigRequest | true | none |
Example responses
200 Response
{ "address": "string", "error": true, "message": "string"}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to POST /v1/multisig/import | APIV1POSTMultisigImportResponse |
InitWalletHandleToken
Code samples
curl -X POST http://localhost/v1/wallet/init \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
POST http://localhost/v1/wallet/init HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "wallet_id": "string", "wallet_password": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/wallet/init',{ method: 'POST', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.post 'http://localhost/v1/wallet/init', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.post('http://localhost/v1/wallet/init', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('POST','http://localhost/v1/wallet/init', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/wallet/init");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("POST");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "http://localhost/v1/wallet/init", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
POST /v1/wallet/init
Initialize a wallet handle token
Unlock the wallet and return a wallet handle token that can be used for subsequent operations. These tokens expire periodically and must be renewed. You can POST
the token to /v1/wallet/info
to see how much time remains until expiration, and renew it with /v1/wallet/renew
. When you’re done, you can invalidate the token with /v1/wallet/release
.
Body parameter
{ "wallet_id": "string", "wallet_password": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | InitWalletHandleTokenRequest | true | none |
Example responses
200 Response
{ "error": true, "message": "string", "wallet_handle_token": "string"}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to POST /v1/wallet/init | APIV1POSTWalletInitResponse |
ListKeysInWallet
Code samples
curl -X POST http://localhost/v1/key/list \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
POST http://localhost/v1/key/list HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "wallet_handle_token": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/key/list',{ method: 'POST', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.post 'http://localhost/v1/key/list', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.post('http://localhost/v1/key/list', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('POST','http://localhost/v1/key/list', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/key/list");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("POST");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "http://localhost/v1/key/list", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
POST /v1/key/list
List keys in wallet
Lists all of the public keys in this wallet. All of them have a stored private key.
Body parameter
{ "wallet_handle_token": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | ListKeysRequest | true | none |
Example responses
200 Response
{ "addresses": [ "string" ], "error": true, "message": "string"}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to POST /v1/key/list | APIV1POSTKeyListResponse |
ListMultisg
Code samples
curl -X POST http://localhost/v1/multisig/list \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
POST http://localhost/v1/multisig/list HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "wallet_handle_token": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/multisig/list',{ method: 'POST', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.post 'http://localhost/v1/multisig/list', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.post('http://localhost/v1/multisig/list', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('POST','http://localhost/v1/multisig/list', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/multisig/list");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("POST");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "http://localhost/v1/multisig/list", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
POST /v1/multisig/list
List multisig accounts
Lists all of the multisig accounts whose preimages this wallet stores
Body parameter
{ "wallet_handle_token": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | ListMultisigRequest | true | none |
Example responses
200 Response
{ "addresses": [ "string" ], "error": true, "message": "string"}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to POST /v1/multisig/list | APIV1POSTMultisigListResponse |
ListWallets
Code samples
curl -X GET http://localhost/v1/wallets \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
GET http://localhost/v1/wallets HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/wallets',{ method: 'GET', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.get 'http://localhost/v1/wallets', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.get('http://localhost/v1/wallets', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('GET','http://localhost/v1/wallets', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/wallets");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("GET");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("GET", "http://localhost/v1/wallets", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
GET /v1/wallets
List wallets
Lists all of the wallets that kmd is aware of.
Body parameter
{}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | ListWalletsRequest | false | none |
Example responses
200 Response
{ "error": true, "message": "string", "wallets": [ { "driver_name": "string", "driver_version": 0, "id": "string", "mnemonic_ux": true, "name": "string", "supported_txs": [ "string" ] } ]}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to GET /v1/wallets | APIV1GETWalletsResponse |
ReleaseWalletHandleToken
Code samples
curl -X POST http://localhost/v1/wallet/release \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
POST http://localhost/v1/wallet/release HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "wallet_handle_token": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/wallet/release',{ method: 'POST', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.post 'http://localhost/v1/wallet/release', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.post('http://localhost/v1/wallet/release', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('POST','http://localhost/v1/wallet/release', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/wallet/release");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("POST");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "http://localhost/v1/wallet/release", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
POST /v1/wallet/release
Release a wallet handle token
Invalidate the passed wallet handle token, making it invalid for use in subsequent requests.
Body parameter
{ "wallet_handle_token": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | ReleaseWalletHandleTokenRequest | true | none |
Example responses
200 Response
{ "error": true, "message": "string"}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to POST /v1/wallet/release | APIV1POSTWalletReleaseResponse |
RenameWallet
Code samples
curl -X POST http://localhost/v1/wallet/rename \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
POST http://localhost/v1/wallet/rename HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "wallet_id": "string", "wallet_name": "string", "wallet_password": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/wallet/rename',{ method: 'POST', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.post 'http://localhost/v1/wallet/rename', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.post('http://localhost/v1/wallet/rename', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('POST','http://localhost/v1/wallet/rename', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/wallet/rename");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("POST");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "http://localhost/v1/wallet/rename", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
POST /v1/wallet/rename
Rename a wallet
Rename the underlying wallet to something else
Body parameter
{ "wallet_id": "string", "wallet_name": "string", "wallet_password": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | RenameWalletRequest | true | none |
Example responses
200 Response
{ "error": true, "message": "string", "wallet": { "driver_name": "string", "driver_version": 0, "id": "string", "mnemonic_ux": true, "name": "string", "supported_txs": [ "string" ] }}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to POST /v1/wallet/rename | APIV1POSTWalletRenameResponse |
RenewWalletHandleToken
Code samples
curl -X POST http://localhost/v1/wallet/renew \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
POST http://localhost/v1/wallet/renew HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "wallet_handle_token": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/wallet/renew',{ method: 'POST', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.post 'http://localhost/v1/wallet/renew', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.post('http://localhost/v1/wallet/renew', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('POST','http://localhost/v1/wallet/renew', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/wallet/renew");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("POST");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "http://localhost/v1/wallet/renew", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
POST /v1/wallet/renew
Renew a wallet handle token
Renew a wallet handle token, increasing its expiration duration to its initial value
Body parameter
{ "wallet_handle_token": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | RenewWalletHandleTokenRequest | true | none |
Example responses
200 Response
{ "error": true, "message": "string", "wallet_handle": { "expires_seconds": 0, "wallet": { "driver_name": "string", "driver_version": 0, "id": "string", "mnemonic_ux": true, "name": "string", "supported_txs": [ "string" ] } }}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response POST /v1/wallet/renew | APIV1POSTWalletRenewResponse |
SignMultisigProgram
Code samples
curl -X POST http://localhost/v1/multisig/signprogram \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
POST http://localhost/v1/multisig/signprogram HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "address": "string", "data": "string", "partial_multisig": { "Subsigs": [ { "Key": [ 0 ], "Sig": [ 0 ] } ], "Threshold": 0, "Version": 0 }, "public_key": [ 0 ], "wallet_handle_token": "string", "wallet_password": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/multisig/signprogram',{ method: 'POST', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.post 'http://localhost/v1/multisig/signprogram', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.post('http://localhost/v1/multisig/signprogram', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('POST','http://localhost/v1/multisig/signprogram', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/multisig/signprogram");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("POST");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "http://localhost/v1/multisig/signprogram", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
POST /v1/multisig/signprogram
Sign a program for a multisig account
Start a multisig signature, or add a signature to a partially completed multisig signature object.
Body parameter
{ "address": "string", "data": "string", "partial_multisig": { "Subsigs": [ { "Key": [ 0 ], "Sig": [ 0 ] } ], "Threshold": 0, "Version": 0 }, "public_key": [ 0 ], "wallet_handle_token": "string", "wallet_password": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | SignProgramMultisigRequest | true | none |
Example responses
200 Response
{ "error": true, "message": "string", "multisig": "string"}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to POST /v1/multisig/signdata | APIV1POSTMultisigProgramSignResponse |
SignMultisigTransaction
Code samples
curl -X POST http://localhost/v1/multisig/sign \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
POST http://localhost/v1/multisig/sign HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "partial_multisig": { "Subsigs": [ { "Key": [ 0 ], "Sig": [ 0 ] } ], "Threshold": 0, "Version": 0 }, "public_key": [ 0 ], "signer": [ 0 ], "transaction": "string", "wallet_handle_token": "string", "wallet_password": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/multisig/sign',{ method: 'POST', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.post 'http://localhost/v1/multisig/sign', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.post('http://localhost/v1/multisig/sign', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('POST','http://localhost/v1/multisig/sign', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/multisig/sign");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("POST");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "http://localhost/v1/multisig/sign", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
POST /v1/multisig/sign
Sign a multisig transaction
Start a multisig signature, or add a signature to a partially completed multisig signature object.
Body parameter
{ "partial_multisig": { "Subsigs": [ { "Key": [ 0 ], "Sig": [ 0 ] } ], "Threshold": 0, "Version": 0 }, "public_key": [ 0 ], "signer": [ 0 ], "transaction": "string", "wallet_handle_token": "string", "wallet_password": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | SignMultisigRequest | true | none |
Example responses
200 Response
{ "error": true, "message": "string", "multisig": "string"}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to POST /v1/multisig/sign | APIV1POSTMultisigTransactionSignResponse |
SignProgram
Code samples
curl -X POST http://localhost/v1/program/sign \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
POST http://localhost/v1/program/sign HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "address": "string", "data": "string", "wallet_handle_token": "string", "wallet_password": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/program/sign',{ method: 'POST', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.post 'http://localhost/v1/program/sign', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.post('http://localhost/v1/program/sign', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('POST','http://localhost/v1/program/sign', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/program/sign");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("POST");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "http://localhost/v1/program/sign", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
POST /v1/program/sign
Sign program
Signs the passed program with a key from the wallet, determined by the account named in the request.
Body parameter
{ "address": "string", "data": "string", "wallet_handle_token": "string", "wallet_password": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | SignProgramRequest | true | none |
Example responses
200 Response
{ "error": true, "message": "string", "sig": "string"}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to POST /v1/data/sign | APIV1POSTProgramSignResponse |
SignTransaction
Code samples
curl -X POST http://localhost/v1/transaction/sign \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
POST http://localhost/v1/transaction/sign HTTP/1.1Host: localhostContent-Type: application/jsonAccept: application/json
const inputBody = '{ "public_key": [ 0 ], "transaction": "string", "wallet_handle_token": "string", "wallet_password": "string"}';const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/v1/transaction/sign',{ method: 'POST', body: inputBody, headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.post 'http://localhost/v1/transaction/sign', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.post('http://localhost/v1/transaction/sign', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('POST','http://localhost/v1/transaction/sign', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/v1/transaction/sign");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("POST");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Content-Type": []string{"application/json"}, "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("POST", "http://localhost/v1/transaction/sign", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
POST /v1/transaction/sign
Sign a transaction
Signs the passed transaction with a key from the wallet, determined by the sender encoded in the transaction.
Body parameter
{ "public_key": [ 0 ], "transaction": "string", "wallet_handle_token": "string", "wallet_password": "string"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | SignTransactionRequest | true | none |
Example responses
200 Response
{ "error": true, "message": "string", "signed_transaction": "string"}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response to POST /v1/transaction/sign | APIV1POSTTransactionSignResponse |
SwaggerHandler
Code samples
curl -X GET http://localhost/swagger.json \ -H 'Accept: application/json' \ -H 'X-KMD-API-Token: API_KEY'
GET http://localhost/swagger.json HTTP/1.1Host: localhostAccept: application/json
const headers = { 'Accept':'application/json', 'X-KMD-API-Token':'API_KEY'};
fetch('http://localhost/swagger.json',{ method: 'GET',
headers: headers}).then(function(res) { return res.json();}).then(function(body) { console.log(body);});
require 'rest-client'require 'json'
headers = { 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY'}
result = RestClient.get 'http://localhost/swagger.json', params: { }, headers: headers
p JSON.parse(result)
import requestsheaders = { 'Accept': 'application/json', 'X-KMD-API-Token': 'API_KEY'}
r = requests.get('http://localhost/swagger.json', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array( 'Accept' => 'application/json', 'X-KMD-API-Token' => 'API_KEY',);
$client = new \GuzzleHttp\Client();
// Define array of request body.$request_body = array();
try { $response = $client->request('GET','http://localhost/swagger.json', array( 'headers' => $headers, 'json' => $request_body, ) ); print_r($response->getBody()->getContents()); } catch (\GuzzleHttp\Exception\BadResponseException $e) { // handle exception or api errors. print_r($e->getMessage()); }
// ...
URL obj = new URL("http://localhost/swagger.json");HttpURLConnection con = (HttpURLConnection) obj.openConnection();con.setRequestMethod("GET");int responseCode = con.getResponseCode();BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream()));String inputLine;StringBuffer response = new StringBuffer();while ((inputLine = in.readLine()) != null) { response.append(inputLine);}in.close();System.out.println(response.toString());
package main
import ( "bytes" "net/http")
func main() {
headers := map[string][]string{ "Accept": []string{"application/json"}, "X-KMD-API-Token": []string{"API_KEY"}, }
data := bytes.NewBuffer([]byte{jsonReq}) req, err := http.NewRequest("GET", "http://localhost/swagger.json", data) req.Header = headers
client := &http.Client{} resp, err := client.Do(req) // ...}
GET /swagger.json
Gets the current swagger spec.
Returns the entire swagger spec in json.
Example responses
200 Response
"string"
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The current swagger spec | string |
default | Default | Unknown Error | None |
Schemas
APIV1DELETEKeyResponse
{ "error": true, "message": "string"}
APIV1DELETEKeyResponse is the response to DELETE /v1/key
friendly:DeleteKeyResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
message | string | false | none | none |
APIV1DELETEMultisigResponse
{ "error": true, "message": "string"}
APIV1DELETEMultisigResponse is the response to POST /v1/multisig/delete` friendly:DeleteMultisigResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
message | string | false | none | none |
APIV1GETWalletsResponse
{ "error": true, "message": "string", "wallets": [ { "driver_name": "string", "driver_version": 0, "id": "string", "mnemonic_ux": true, "name": "string", "supported_txs": [ "string" ] } ]}
APIV1GETWalletsResponse is the response to GET /v1/wallets
friendly:ListWalletsResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
message | string | false | none | none |
wallets | [APIV1Wallet] | false | none | [APIV1Wallet is the API’s representation of a wallet] |
APIV1POSTKeyExportResponse
{ "error": true, "message": "string", "private_key": [ 0 ]}
APIV1POSTKeyExportResponse is the response to POST /v1/key/export
friendly:ExportKeyResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
message | string | false | none | none |
private_key | PrivateKey | false | none | none |
APIV1POSTKeyImportResponse
{ "address": "string", "error": true, "message": "string"}
APIV1POSTKeyImportResponse is the response to POST /v1/key/import
friendly:ImportKeyResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
address | string | false | none | none |
error | boolean | false | none | none |
message | string | false | none | none |
APIV1POSTKeyListResponse
{ "addresses": [ "string" ], "error": true, "message": "string"}
APIV1POSTKeyListResponse is the response to POST /v1/key/list
friendly:ListKeysResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
addresses | [string] | false | none | none |
error | boolean | false | none | none |
message | string | false | none | none |
APIV1POSTKeyResponse
{ "address": "string", "error": true, "message": "string"}
APIV1POSTKeyResponse is the response to POST /v1/key
friendly:GenerateKeyResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
address | string | false | none | none |
error | boolean | false | none | none |
message | string | false | none | none |
APIV1POSTMasterKeyExportResponse
{ "error": true, "master_derivation_key": [ 0 ], "message": "string"}
APIV1POSTMasterKeyExportResponse is the response to POST /v1/master-key/export
friendly:ExportMasterKeyResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
master_derivation_key | MasterDerivationKey | false | none | MasterDerivationKey is used to derive ed25519 keys for use in wallets |
message | string | false | none | none |
APIV1POSTMultisigExportResponse
{ "error": true, "message": "string", "multisig_version": 0, "pks": [ [ 0 ] ], "threshold": 0}
APIV1POSTMultisigExportResponse is the response to POST /v1/multisig/export
friendly:ExportMultisigResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
message | string | false | none | none |
multisig_version | integer(uint8) | false | none | none |
pks | [PublicKey] | false | none | none |
threshold | integer(uint8) | false | none | none |
APIV1POSTMultisigImportResponse
{ "address": "string", "error": true, "message": "string"}
APIV1POSTMultisigImportResponse is the response to POST /v1/multisig/import
friendly:ImportMultisigResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
address | string | false | none | none |
error | boolean | false | none | none |
message | string | false | none | none |
APIV1POSTMultisigListResponse
{ "addresses": [ "string" ], "error": true, "message": "string"}
APIV1POSTMultisigListResponse is the response to POST /v1/multisig/list
friendly:ListMultisigResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
addresses | [string] | false | none | none |
error | boolean | false | none | none |
message | string | false | none | none |
APIV1POSTMultisigProgramSignResponse
{ "error": true, "message": "string", "multisig": "string"}
APIV1POSTMultisigProgramSignResponse is the response to POST /v1/multisig/signdata
friendly:SignProgramMultisigResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
message | string | false | none | none |
multisig | string(byte) | false | none | none |
APIV1POSTMultisigTransactionSignResponse
{ "error": true, "message": "string", "multisig": "string"}
APIV1POSTMultisigTransactionSignResponse is the response to POST /v1/multisig/sign
friendly:SignMultisigResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
message | string | false | none | none |
multisig | string(byte) | false | none | none |
APIV1POSTProgramSignResponse
{ "error": true, "message": "string", "sig": "string"}
APIV1POSTProgramSignResponse is the response to POST /v1/data/sign
friendly:SignProgramResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
message | string | false | none | none |
sig | string(byte) | false | none | none |
APIV1POSTTransactionSignResponse
{ "error": true, "message": "string", "signed_transaction": "string"}
APIV1POSTTransactionSignResponse is the response to POST /v1/transaction/sign
friendly:SignTransactionResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
message | string | false | none | none |
signed_transaction | string(byte) | false | none | none |
APIV1POSTWalletInfoResponse
{ "error": true, "message": "string", "wallet_handle": { "expires_seconds": 0, "wallet": { "driver_name": "string", "driver_version": 0, "id": "string", "mnemonic_ux": true, "name": "string", "supported_txs": [ "string" ] } }}
APIV1POSTWalletInfoResponse is the response to POST /v1/wallet/info
friendly:WalletInfoResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
message | string | false | none | none |
wallet_handle | APIV1WalletHandle | false | none | APIV1WalletHandle includes the wallet the handle corresponds to and the number of number of seconds to expiration |
APIV1POSTWalletInitResponse
{ "error": true, "message": "string", "wallet_handle_token": "string"}
APIV1POSTWalletInitResponse is the response to POST /v1/wallet/init
friendly:InitWalletHandleTokenResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
message | string | false | none | none |
wallet_handle_token | string | false | none | none |
APIV1POSTWalletReleaseResponse
{ "error": true, "message": "string"}
APIV1POSTWalletReleaseResponse is the response to POST /v1/wallet/release
friendly:ReleaseWalletHandleTokenResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
message | string | false | none | none |
APIV1POSTWalletRenameResponse
{ "error": true, "message": "string", "wallet": { "driver_name": "string", "driver_version": 0, "id": "string", "mnemonic_ux": true, "name": "string", "supported_txs": [ "string" ] }}
APIV1POSTWalletRenameResponse is the response to POST /v1/wallet/rename
friendly:RenameWalletResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
message | string | false | none | none |
wallet | APIV1Wallet | false | none | APIV1Wallet is the API’s representation of a wallet |
APIV1POSTWalletRenewResponse
{ "error": true, "message": "string", "wallet_handle": { "expires_seconds": 0, "wallet": { "driver_name": "string", "driver_version": 0, "id": "string", "mnemonic_ux": true, "name": "string", "supported_txs": [ "string" ] } }}
APIV1POSTWalletRenewResponse is the response to POST /v1/wallet/renew
friendly:RenewWalletHandleTokenResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
message | string | false | none | none |
wallet_handle | APIV1WalletHandle | false | none | APIV1WalletHandle includes the wallet the handle corresponds to and the number of number of seconds to expiration |
APIV1POSTWalletResponse
{ "error": true, "message": "string", "wallet": { "driver_name": "string", "driver_version": 0, "id": "string", "mnemonic_ux": true, "name": "string", "supported_txs": [ "string" ] }}
APIV1POSTWalletResponse is the response to POST /v1/wallet
friendly:CreateWalletResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
message | string | false | none | none |
wallet | APIV1Wallet | false | none | APIV1Wallet is the API’s representation of a wallet |
APIV1Wallet
{ "driver_name": "string", "driver_version": 0, "id": "string", "mnemonic_ux": true, "name": "string", "supported_txs": [ "string" ]}
APIV1Wallet is the API’s representation of a wallet
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
driver_name | string | false | none | none |
driver_version | integer(uint32) | false | none | none |
id | string | false | none | none |
mnemonic_ux | boolean | false | none | none |
name | string | false | none | none |
supported_txs | [TxType] | false | none | [TxType is the type of the transaction written to the ledger] |
APIV1WalletHandle
{ "expires_seconds": 0, "wallet": { "driver_name": "string", "driver_version": 0, "id": "string", "mnemonic_ux": true, "name": "string", "supported_txs": [ "string" ] }}
APIV1WalletHandle includes the wallet the handle corresponds to and the number of number of seconds to expiration
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
expires_seconds | integer(int64) | false | none | none |
wallet | APIV1Wallet | false | none | APIV1Wallet is the API’s representation of a wallet |
CreateWalletRequest
{ "master_derivation_key": [ 0 ], "wallet_driver_name": "string", "wallet_name": "string", "wallet_password": "string"}
APIV1POSTWalletRequest is the request for POST /v1/wallet
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
master_derivation_key | MasterDerivationKey | false | none | MasterDerivationKey is used to derive ed25519 keys for use in wallets |
wallet_driver_name | string | false | none | none |
wallet_name | string | false | none | none |
wallet_password | string | false | none | none |
DeleteKeyRequest
{ "address": "string", "wallet_handle_token": "string", "wallet_password": "string"}
APIV1DELETEKeyRequest is the request for DELETE /v1/key
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
address | string | false | none | none |
wallet_handle_token | string | false | none | none |
wallet_password | string | false | none | none |
DeleteMultisigRequest
{ "address": "string", "wallet_handle_token": "string", "wallet_password": "string"}
APIV1DELETEMultisigRequest is the request for DELETE /v1/multisig
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
address | string | false | none | none |
wallet_handle_token | string | false | none | none |
wallet_password | string | false | none | none |
Digest
[ 0]
Digest represents a 32-byte value holding the 256-bit Hash digest.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Digest represents a 32-byte value holding the 256-bit Hash digest. | [integer] | false | none | none |
ed25519PrivateKey
[ 0]
Properties
None
ed25519PublicKey
[ 0]
Properties
None
ed25519Signature
[ 0]
Classical signatures */
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Classical signatures */ | [integer] | false | none | none |
ExportKeyRequest
{ "address": "string", "wallet_handle_token": "string", "wallet_password": "string"}
APIV1POSTKeyExportRequest is the request for POST /v1/key/export
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
address | string | false | none | none |
wallet_handle_token | string | false | none | none |
wallet_password | string | false | none | none |
ExportMasterKeyRequest
{ "wallet_handle_token": "string", "wallet_password": "string"}
APIV1POSTMasterKeyExportRequest is the request for POST /v1/master-key/export
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
wallet_handle_token | string | false | none | none |
wallet_password | string | false | none | none |
ExportMultisigRequest
{ "address": "string", "wallet_handle_token": "string"}
APIV1POSTMultisigExportRequest is the request for POST /v1/multisig/export
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
address | string | false | none | none |
wallet_handle_token | string | false | none | none |
GenerateKeyRequest
{ "display_mnemonic": true, "wallet_handle_token": "string"}
APIV1POSTKeyRequest is the request for POST /v1/key
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
display_mnemonic | boolean | false | none | none |
wallet_handle_token | string | false | none | none |
ImportKeyRequest
{ "private_key": [ 0 ], "wallet_handle_token": "string"}
APIV1POSTKeyImportRequest is the request for POST /v1/key/import
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
private_key | PrivateKey | false | none | none |
wallet_handle_token | string | false | none | none |
ImportMultisigRequest
{ "multisig_version": 0, "pks": [ [ 0 ] ], "threshold": 0, "wallet_handle_token": "string"}
APIV1POSTMultisigImportRequest is the request for POST /v1/multisig/import
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
multisig_version | integer(uint8) | false | none | none |
pks | [PublicKey] | false | none | none |
threshold | integer(uint8) | false | none | none |
wallet_handle_token | string | false | none | none |
InitWalletHandleTokenRequest
{ "wallet_id": "string", "wallet_password": "string"}
APIV1POSTWalletInitRequest is the request for POST /v1/wallet/init
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
wallet_id | string | false | none | none |
wallet_password | string | false | none | none |
ListKeysRequest
{ "wallet_handle_token": "string"}
APIV1POSTKeyListRequest is the request for POST /v1/key/list
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
wallet_handle_token | string | false | none | none |
ListMultisigRequest
{ "wallet_handle_token": "string"}
APIV1POSTMultisigListRequest is the request for POST /v1/multisig/list
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
wallet_handle_token | string | false | none | none |
ListWalletsRequest
{}
APIV1GETWalletsRequest is the request for GET /v1/wallets
Properties
None
MasterDerivationKey
[ 0]
MasterDerivationKey is used to derive ed25519 keys for use in wallets
Properties
None
MultisigSig
{ "Subsigs": [ { "Key": [ 0 ], "Sig": [ 0 ] } ], "Threshold": 0, "Version": 0}
MultisigSig is the structure that holds multiple Subsigs
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Subsigs | [MultisigSubsig] | false | none | [MultisigSubsig is a struct that holds a pair of public key and signatures signatures may be empty] |
Threshold | integer(uint8) | false | none | none |
Version | integer(uint8) | false | none | none |
MultisigSubsig
{ "Key": [ 0 ], "Sig": [ 0 ]}
MultisigSubsig is a struct that holds a pair of public key and signatures signatures may be empty
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Key | PublicKey | false | none | none |
Sig | Signature | false | none | none |
PrivateKey
[ 0]
Properties
None
PublicKey
[ 0]
Properties
None
ReleaseWalletHandleTokenRequest
{ "wallet_handle_token": "string"}
APIV1POSTWalletReleaseRequest is the request for POST /v1/wallet/release
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
wallet_handle_token | string | false | none | none |
RenameWalletRequest
{ "wallet_id": "string", "wallet_name": "string", "wallet_password": "string"}
APIV1POSTWalletRenameRequest is the request for POST /v1/wallet/rename
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
wallet_id | string | false | none | none |
wallet_name | string | false | none | none |
wallet_password | string | false | none | none |
RenewWalletHandleTokenRequest
{ "wallet_handle_token": "string"}
APIV1POSTWalletRenewRequest is the request for POST /v1/wallet/renew
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
wallet_handle_token | string | false | none | none |
Signature
[ 0]
Properties
None
SignMultisigRequest
{ "partial_multisig": { "Subsigs": [ { "Key": [ 0 ], "Sig": [ 0 ] } ], "Threshold": 0, "Version": 0 }, "public_key": [ 0 ], "signer": [ 0 ], "transaction": "string", "wallet_handle_token": "string", "wallet_password": "string"}
APIV1POSTMultisigTransactionSignRequest is the request for POST /v1/multisig/sign
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
partial_multisig | MultisigSig | false | none | MultisigSig is the structure that holds multiple Subsigs |
public_key | PublicKey | false | none | none |
signer | Digest | false | none | none |
transaction | string(byte) | false | none | none |
wallet_handle_token | string | false | none | none |
wallet_password | string | false | none | none |
SignProgramMultisigRequest
{ "address": "string", "data": "string", "partial_multisig": { "Subsigs": [ { "Key": [ 0 ], "Sig": [ 0 ] } ], "Threshold": 0, "Version": 0 }, "public_key": [ 0 ], "wallet_handle_token": "string", "wallet_password": "string"}
APIV1POSTMultisigProgramSignRequest is the request for POST /v1/multisig/signprogram
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
address | string | false | none | none |
data | string(byte) | false | none | none |
partial_multisig | MultisigSig | false | none | MultisigSig is the structure that holds multiple Subsigs |
public_key | PublicKey | false | none | none |
wallet_handle_token | string | false | none | none |
wallet_password | string | false | none | none |
SignProgramRequest
{ "address": "string", "data": "string", "wallet_handle_token": "string", "wallet_password": "string"}
APIV1POSTProgramSignRequest is the request for POST /v1/program/sign
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
address | string | false | none | none |
data | string(byte) | false | none | none |
wallet_handle_token | string | false | none | none |
wallet_password | string | false | none | none |
SignTransactionRequest
{ "public_key": [ 0 ], "transaction": "string", "wallet_handle_token": "string", "wallet_password": "string"}
APIV1POSTTransactionSignRequest is the request for POST /v1/transaction/sign
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
public_key | PublicKey | false | none | none |
transaction | string(byte) | false | none | Base64 encoding of msgpack encoding of a Transaction objectNote: SDK and goal usually generate SignedTxn objectsin that case, the field txn / Transaction of thegenerated SignedTxn object needs to be used |
wallet_handle_token | string | false | none | none |
wallet_password | string | false | none | none |
TxType
"string"
TxType is the type of the transaction written to the ledger
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | string | false | none | TxType is the type of the transaction written to the ledger |
VersionsRequest
{}
VersionsRequest is the request for GET /versions
Properties
None
VersionsResponse
{ "versions": [ "string" ]}
VersionsResponse is the response to GET /versions
friendly:VersionsResponse
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
versions | [string] | false | none | none |
WalletInfoRequest
{ "wallet_handle_token": "string"}
APIV1POSTWalletInfoRequest is the request for POST /v1/wallet/info
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
wallet_handle_token | string | false | none | none |