NAV Navigation
Shell HTTP JavaScript Node.js Ruby Python Java Go PHP

OnChain Crypto Currency API v1.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Swagger definition for this API is available at https://onchain.io/docs/onchain.swagger.json

Base URLs:

Email: onchain.io Web: onchain.io

Authentication

Address

GetBalance

Code samples

# You can also use wget
curl -X GET https://onchain.io/api/address/balance/{coin_type}/{address} \
  -H 'Accept: application/json' \
  -H 'X-API-KEY: API_KEY'

GET https://onchain.io/api/address/balance/{coin_type}/{address} HTTP/1.1
Host: onchain.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

$.ajax({
  url: 'https://onchain.io/api/address/balance/{coin_type}/{address}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

fetch('https://onchain.io/api/address/balance/{coin_type}/{address}',
{
  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-API-KEY' => 'API_KEY'
}

result = RestClient.get 'https://onchain.io/api/address/balance/{coin_type}/{address}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'X-API-KEY': 'API_KEY'
}

r = requests.get('https://onchain.io/api/address/balance/{coin_type}/{address}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://onchain.io/api/address/balance/{coin_type}/{address}");
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-API-KEY": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://onchain.io/api/address/balance/{coin_type}/{address}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
    'X-API-KEY' => 'API_KEY',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://onchain.io/api/address/balance/{coin_type}/{address}', 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());
 }

 // ...

GET /api/address/balance/{coin_type}/{address}

Get Balance

Returns the satoshi balance, usd balance and user viewable balance for an address. For ERC20 tokens you need to pass in the contract ID and the number of decimal places.

Parameters

Name In Type Required Description
coin_type path string true none
address path string true The public address to lookup

Enumerated Values

Parameter Value
coin_type BITCOIN
coin_type ETHEREUM
coin_type TESTNET3
coin_type BITCOIN_CASH
coin_type BITCOIN_GOLD
coin_type LITECOIN
coin_type DASH
coin_type DOGE
coin_type BITCOIN_PRIVATE
coin_type ZCASH
coin_type ZCASH_TESTNET
coin_type ZCLASSIC

Example responses

200 Response

{
  "usd_balance": 0,
  "balance": 0,
  "unconfirmed_balance": 0,
  "human_balance": 0,
  "human_unconfirmed_balance": 0
}

Responses

Status Meaning Description Schema
200 OK A successful response. onchain.BalanceReply
default Default An unexpected error response grpc.gateway.runtime.Error

GetBalances

Code samples

# You can also use wget
curl -X GET https://onchain.io/api/address/balances/{coin_type}/{addresses} \
  -H 'Accept: application/json' \
  -H 'X-API-KEY: API_KEY'

GET https://onchain.io/api/address/balances/{coin_type}/{addresses} HTTP/1.1
Host: onchain.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

$.ajax({
  url: 'https://onchain.io/api/address/balances/{coin_type}/{addresses}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

fetch('https://onchain.io/api/address/balances/{coin_type}/{addresses}',
{
  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-API-KEY' => 'API_KEY'
}

result = RestClient.get 'https://onchain.io/api/address/balances/{coin_type}/{addresses}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'X-API-KEY': 'API_KEY'
}

r = requests.get('https://onchain.io/api/address/balances/{coin_type}/{addresses}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://onchain.io/api/address/balances/{coin_type}/{addresses}");
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-API-KEY": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://onchain.io/api/address/balances/{coin_type}/{addresses}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
    'X-API-KEY' => 'API_KEY',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://onchain.io/api/address/balances/{coin_type}/{addresses}', 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());
 }

 // ...

GET /api/address/balances/{coin_type}/{addresses}

Get Balances

Returns the satoshi balance, usd balance and user viewable balance for a set of addresses.

Parameters

Name In Type Required Description
coin_type path string true none
addresses path array[string] true none

Enumerated Values

Parameter Value
coin_type BITCOIN
coin_type ETHEREUM
coin_type TESTNET3
coin_type BITCOIN_CASH
coin_type BITCOIN_GOLD
coin_type LITECOIN
coin_type DASH
coin_type DOGE
coin_type BITCOIN_PRIVATE
coin_type ZCASH
coin_type ZCASH_TESTNET
coin_type ZCLASSIC

Example responses

200 Response

{
  "addresses": [
    {
      "address": "string",
      "usd_balance": 0,
      "balance": 0,
      "unconfirmed_balance": 0,
      "human_balance": 0,
      "human_unconfirmed_balance": 0
    }
  ],
  "totals": {
    "usd_balance": 0,
    "balance": 0,
    "unconfirmed_balance": 0,
    "human_balance": 0,
    "human_unconfirmed_balance": 0
  }
}

Responses

Status Meaning Description Schema
200 OK A successful response. onchain.BalancesReply
default Default An unexpected error response grpc.gateway.runtime.Error

GetHistory

Code samples

# You can also use wget
curl -X GET https://onchain.io/api/address/history/{coin_type}/{addresses} \
  -H 'Accept: application/json' \
  -H 'X-API-KEY: API_KEY'

GET https://onchain.io/api/address/history/{coin_type}/{addresses} HTTP/1.1
Host: onchain.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

$.ajax({
  url: 'https://onchain.io/api/address/history/{coin_type}/{addresses}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

fetch('https://onchain.io/api/address/history/{coin_type}/{addresses}',
{
  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-API-KEY' => 'API_KEY'
}

result = RestClient.get 'https://onchain.io/api/address/history/{coin_type}/{addresses}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'X-API-KEY': 'API_KEY'
}

r = requests.get('https://onchain.io/api/address/history/{coin_type}/{addresses}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://onchain.io/api/address/history/{coin_type}/{addresses}");
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-API-KEY": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://onchain.io/api/address/history/{coin_type}/{addresses}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
    'X-API-KEY' => 'API_KEY',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://onchain.io/api/address/history/{coin_type}/{addresses}', 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());
 }

 // ...

GET /api/address/history/{coin_type}/{addresses}

Get History

Returns the transaction history for an address or addresses.

Parameters

Name In Type Required Description
coin_type path string true none
addresses path array[string] true none

Enumerated Values

Parameter Value
coin_type BITCOIN
coin_type ETHEREUM
coin_type TESTNET3
coin_type BITCOIN_CASH
coin_type BITCOIN_GOLD
coin_type LITECOIN
coin_type DASH
coin_type DOGE
coin_type BITCOIN_PRIVATE
coin_type ZCASH
coin_type ZCASH_TESTNET
coin_type ZCLASSIC

Example responses

200 Response

{
  "total_txs": 0,
  "txs": [
    {
      "confirmations": 0,
      "time": 0,
      "is_deposit": true,
      "address": "string",
      "amount": 0,
      "human_amount": 0
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK A successful response. onchain.HistoryReply
default Default An unexpected error response grpc.gateway.runtime.Error

VerifyAddress

Code samples

# You can also use wget
curl -X GET https://onchain.io/api/address/verify/{coin_type}/{address} \
  -H 'Accept: application/json' \
  -H 'X-API-KEY: API_KEY'

GET https://onchain.io/api/address/verify/{coin_type}/{address} HTTP/1.1
Host: onchain.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

$.ajax({
  url: 'https://onchain.io/api/address/verify/{coin_type}/{address}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

fetch('https://onchain.io/api/address/verify/{coin_type}/{address}',
{
  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-API-KEY' => 'API_KEY'
}

result = RestClient.get 'https://onchain.io/api/address/verify/{coin_type}/{address}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'X-API-KEY': 'API_KEY'
}

r = requests.get('https://onchain.io/api/address/verify/{coin_type}/{address}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://onchain.io/api/address/verify/{coin_type}/{address}");
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-API-KEY": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://onchain.io/api/address/verify/{coin_type}/{address}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
    'X-API-KEY' => 'API_KEY',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://onchain.io/api/address/verify/{coin_type}/{address}', 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());
 }

 // ...

GET /api/address/verify/{coin_type}/{address}

Verify Address

Verify a public address parses correctly

Parameters

Name In Type Required Description
coin_type path string true none
address path string true none

Enumerated Values

Parameter Value
coin_type BITCOIN
coin_type ETHEREUM
coin_type TESTNET3
coin_type BITCOIN_CASH
coin_type BITCOIN_GOLD
coin_type LITECOIN
coin_type DASH
coin_type DOGE
coin_type BITCOIN_PRIVATE
coin_type ZCASH
coin_type ZCASH_TESTNET
coin_type ZCLASSIC

Example responses

200 Response

{
  "valid": true
}

Responses

Status Meaning Description Schema
200 OK A successful response. onchain.VerificationReply
default Default An unexpected error response grpc.gateway.runtime.Error

GetNetworkAddress

Code samples

# You can also use wget
curl -X GET https://onchain.io/api/address/{coin_type}/{public_key} \
  -H 'Accept: application/json' \
  -H 'X-API-KEY: API_KEY'

GET https://onchain.io/api/address/{coin_type}/{public_key} HTTP/1.1
Host: onchain.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

$.ajax({
  url: 'https://onchain.io/api/address/{coin_type}/{public_key}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

fetch('https://onchain.io/api/address/{coin_type}/{public_key}',
{
  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-API-KEY' => 'API_KEY'
}

result = RestClient.get 'https://onchain.io/api/address/{coin_type}/{public_key}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'X-API-KEY': 'API_KEY'
}

r = requests.get('https://onchain.io/api/address/{coin_type}/{public_key}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://onchain.io/api/address/{coin_type}/{public_key}");
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-API-KEY": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://onchain.io/api/address/{coin_type}/{public_key}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
    'X-API-KEY' => 'API_KEY',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://onchain.io/api/address/{coin_type}/{public_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());
 }

 // ...

GET /api/address/{coin_type}/{public_key}

Parameters

Name In Type Required Description
coin_type path string true none
public_key path string(byte) true none

Enumerated Values

Parameter Value
coin_type BITCOIN
coin_type ETHEREUM
coin_type TESTNET3
coin_type BITCOIN_CASH
coin_type BITCOIN_GOLD
coin_type LITECOIN
coin_type DASH
coin_type DOGE
coin_type BITCOIN_PRIVATE
coin_type ZCASH
coin_type ZCASH_TESTNET
coin_type ZCLASSIC

Example responses

200 Response

{
  "network_address": "string"
}

Responses

Status Meaning Description Schema
200 OK A successful response. onchain.AddressReply
default Default An unexpected error response grpc.gateway.runtime.Error

ERC20Transaction

CreateTransaction

Code samples

# You can also use wget
curl -X POST https://onchain.io/api/erc20/create \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-KEY: API_KEY'

POST https://onchain.io/api/erc20/create HTTP/1.1
Host: onchain.io
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

$.ajax({
  url: 'https://onchain.io/api/erc20/create',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "to": "string",
  "amount": "string",
  "gas_price": 0,
  "gas_limit": 0,
  "contract_id": "string",
  "decimal_places": 0
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

fetch('https://onchain.io/api/erc20/create',
{
  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-API-KEY' => 'API_KEY'
}

result = RestClient.post 'https://onchain.io/api/erc20/create',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'X-API-KEY': 'API_KEY'
}

r = requests.post('https://onchain.io/api/erc20/create', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://onchain.io/api/erc20/create");
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-API-KEY": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://onchain.io/api/erc20/create", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
    'Accept' => 'application/json',
    'X-API-KEY' => 'API_KEY',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://onchain.io/api/erc20/create', 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());
 }

 // ...

POST /api/erc20/create

Body parameter

{
  "to": "string",
  "amount": "string",
  "gas_price": 0,
  "gas_limit": 0,
  "contract_id": "string",
  "decimal_places": 0
}

Parameters

Name In Type Required Description
body body onchain.ERC20TransactionRequest true none

Example responses

200 Response

{
  "tx": "string",
  "to_sign": "string"
}

Responses

Status Meaning Description Schema
200 OK A successful response. onchain.EthereumTransactionReply
default Default An unexpected error response grpc.gateway.runtime.Error

SignAndSend

Code samples

# You can also use wget
curl -X POST https://onchain.io/api/erc20/sign_and_send \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-KEY: API_KEY'

POST https://onchain.io/api/erc20/sign_and_send HTTP/1.1
Host: onchain.io
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

$.ajax({
  url: 'https://onchain.io/api/erc20/sign_and_send',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "tx": "string",
  "v": 0,
  "r": "string",
  "s": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

fetch('https://onchain.io/api/erc20/sign_and_send',
{
  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-API-KEY' => 'API_KEY'
}

result = RestClient.post 'https://onchain.io/api/erc20/sign_and_send',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'X-API-KEY': 'API_KEY'
}

r = requests.post('https://onchain.io/api/erc20/sign_and_send', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://onchain.io/api/erc20/sign_and_send");
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-API-KEY": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://onchain.io/api/erc20/sign_and_send", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
    'Accept' => 'application/json',
    'X-API-KEY' => 'API_KEY',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://onchain.io/api/erc20/sign_and_send', 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());
 }

 // ...

POST /api/erc20/sign_and_send

Body parameter

{
  "tx": "string",
  "v": 0,
  "r": "string",
  "s": "string"
}

Parameters

Name In Type Required Description
body body onchain.EthereumTransactionSendRequest true none

Example responses

200 Response

{
  "tx_hash": "string"
}

Responses

Status Meaning Description Schema
200 OK A successful response. onchain.TransactionSendReply
default Default An unexpected error response grpc.gateway.runtime.Error

EthereumTransaction

CreateTransaction

Code samples

# You can also use wget
curl -X POST https://onchain.io/api/ethereum/create \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-KEY: API_KEY'

POST https://onchain.io/api/ethereum/create HTTP/1.1
Host: onchain.io
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

$.ajax({
  url: 'https://onchain.io/api/ethereum/create',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "to": "string",
  "from": "string",
  "amount": "string",
  "gas_price": 0,
  "gas_limit": 0
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

fetch('https://onchain.io/api/ethereum/create',
{
  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-API-KEY' => 'API_KEY'
}

result = RestClient.post 'https://onchain.io/api/ethereum/create',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'X-API-KEY': 'API_KEY'
}

r = requests.post('https://onchain.io/api/ethereum/create', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://onchain.io/api/ethereum/create");
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-API-KEY": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://onchain.io/api/ethereum/create", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
    'Accept' => 'application/json',
    'X-API-KEY' => 'API_KEY',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://onchain.io/api/ethereum/create', 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());
 }

 // ...

POST /api/ethereum/create

Body parameter

{
  "to": "string",
  "from": "string",
  "amount": "string",
  "gas_price": 0,
  "gas_limit": 0
}

Parameters

Name In Type Required Description
body body onchain.EthereumTransactionRequest true none

Example responses

200 Response

{
  "tx": "string",
  "to_sign": "string"
}

Responses

Status Meaning Description Schema
200 OK A successful response. onchain.EthereumTransactionReply
default Default An unexpected error response grpc.gateway.runtime.Error

SignAndSend

Code samples

# You can also use wget
curl -X POST https://onchain.io/api/ethereum/sign_and_send \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-KEY: API_KEY'

POST https://onchain.io/api/ethereum/sign_and_send HTTP/1.1
Host: onchain.io
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

$.ajax({
  url: 'https://onchain.io/api/ethereum/sign_and_send',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "tx": "string",
  "v": 0,
  "r": "string",
  "s": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

fetch('https://onchain.io/api/ethereum/sign_and_send',
{
  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-API-KEY' => 'API_KEY'
}

result = RestClient.post 'https://onchain.io/api/ethereum/sign_and_send',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'X-API-KEY': 'API_KEY'
}

r = requests.post('https://onchain.io/api/ethereum/sign_and_send', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://onchain.io/api/ethereum/sign_and_send");
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-API-KEY": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://onchain.io/api/ethereum/sign_and_send", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
    'Accept' => 'application/json',
    'X-API-KEY' => 'API_KEY',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://onchain.io/api/ethereum/sign_and_send', 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());
 }

 // ...

POST /api/ethereum/sign_and_send

Body parameter

{
  "tx": "string",
  "v": 0,
  "r": "string",
  "s": "string"
}

Parameters

Name In Type Required Description
body body onchain.EthereumTransactionSendRequest true none

Example responses

200 Response

{
  "tx_hash": "string"
}

Responses

Status Meaning Description Schema
200 OK A successful response. onchain.TransactionSendReply
default Default An unexpected error response grpc.gateway.runtime.Error

MultiSigTransaction

CreateTransaction

Code samples

# You can also use wget
curl -X POST https://onchain.io/api/multi_sig/create/{coin_type} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-KEY: API_KEY'

POST https://onchain.io/api/multi_sig/create/{coin_type} HTTP/1.1
Host: onchain.io
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

$.ajax({
  url: 'https://onchain.io/api/multi_sig/create/{coin_type}',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "coin_type": "BITCOIN",
  "recipients": [
    {
      "to": "string",
      "amount": 0
    }
  ],
  "public_keys": [
    "string"
  ],
  "miners_fee": 0,
  "number_of_required_signatures": 0
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

fetch('https://onchain.io/api/multi_sig/create/{coin_type}',
{
  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-API-KEY' => 'API_KEY'
}

result = RestClient.post 'https://onchain.io/api/multi_sig/create/{coin_type}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'X-API-KEY': 'API_KEY'
}

r = requests.post('https://onchain.io/api/multi_sig/create/{coin_type}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://onchain.io/api/multi_sig/create/{coin_type}");
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-API-KEY": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://onchain.io/api/multi_sig/create/{coin_type}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
    'Accept' => 'application/json',
    'X-API-KEY' => 'API_KEY',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://onchain.io/api/multi_sig/create/{coin_type}', 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());
 }

 // ...

POST /api/multi_sig/create/{coin_type}

Body parameter

{
  "coin_type": "BITCOIN",
  "recipients": [
    {
      "to": "string",
      "amount": 0
    }
  ],
  "public_keys": [
    "string"
  ],
  "miners_fee": 0,
  "number_of_required_signatures": 0
}

Parameters

Name In Type Required Description
coin_type path string true none
body body onchain.MultiSigTransactionRequest true none

Enumerated Values

Parameter Value
coin_type BITCOIN
coin_type ETHEREUM
coin_type TESTNET3
coin_type BITCOIN_CASH
coin_type BITCOIN_GOLD
coin_type LITECOIN
coin_type DASH
coin_type DOGE
coin_type BITCOIN_PRIVATE
coin_type ZCASH
coin_type ZCASH_TESTNET
coin_type ZCLASSIC

Example responses

200 Response

{
  "tx": "string",
  "total_input_value": 0,
  "hashes_to_sign": [
    {
      "input_index": 0,
      "public_key": "string",
      "hash_to_sign": "string",
      "signature": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK A successful response. onchain.TransactionReply
default Default An unexpected error response grpc.gateway.runtime.Error

SignAndSend

Code samples

# You can also use wget
curl -X POST https://onchain.io/api/multi_sig/sign_and_send/{coin_type} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-KEY: API_KEY'

POST https://onchain.io/api/multi_sig/sign_and_send/{coin_type} HTTP/1.1
Host: onchain.io
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

$.ajax({
  url: 'https://onchain.io/api/multi_sig/sign_and_send/{coin_type}',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "coin_type": "BITCOIN",
  "tx": "string",
  "signatures": [
    {
      "input_index": 0,
      "public_key": "string",
      "hash_to_sign": "string",
      "signature": "string"
    }
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

fetch('https://onchain.io/api/multi_sig/sign_and_send/{coin_type}',
{
  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-API-KEY' => 'API_KEY'
}

result = RestClient.post 'https://onchain.io/api/multi_sig/sign_and_send/{coin_type}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'X-API-KEY': 'API_KEY'
}

r = requests.post('https://onchain.io/api/multi_sig/sign_and_send/{coin_type}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://onchain.io/api/multi_sig/sign_and_send/{coin_type}");
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-API-KEY": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://onchain.io/api/multi_sig/sign_and_send/{coin_type}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
    'Accept' => 'application/json',
    'X-API-KEY' => 'API_KEY',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://onchain.io/api/multi_sig/sign_and_send/{coin_type}', 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());
 }

 // ...

POST /api/multi_sig/sign_and_send/{coin_type}

Body parameter

{
  "coin_type": "BITCOIN",
  "tx": "string",
  "signatures": [
    {
      "input_index": 0,
      "public_key": "string",
      "hash_to_sign": "string",
      "signature": "string"
    }
  ]
}

Parameters

Name In Type Required Description
coin_type path string true none
body body onchain.TransactionSendRequest true none

Enumerated Values

Parameter Value
coin_type BITCOIN
coin_type ETHEREUM
coin_type TESTNET3
coin_type BITCOIN_CASH
coin_type BITCOIN_GOLD
coin_type LITECOIN
coin_type DASH
coin_type DOGE
coin_type BITCOIN_PRIVATE
coin_type ZCASH
coin_type ZCASH_TESTNET
coin_type ZCLASSIC

Example responses

200 Response

{
  "tx_hash": "string"
}

Responses

Status Meaning Description Schema
200 OK A successful response. onchain.TransactionSendReply
default Default An unexpected error response grpc.gateway.runtime.Error

Transaction

CreatePayment

Code samples

# You can also use wget
curl -X POST https://onchain.io/api/payment/create/{coin_type} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-KEY: API_KEY'

POST https://onchain.io/api/payment/create/{coin_type} HTTP/1.1
Host: onchain.io
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

$.ajax({
  url: 'https://onchain.io/api/payment/create/{coin_type}',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "coin_type": "BITCOIN",
  "recipients": [
    {
      "to": "string",
      "amount": 0
    }
  ],
  "from": [
    {
      "from": "string",
      "from_address": "string"
    }
  ],
  "miners_fee": 0
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

fetch('https://onchain.io/api/payment/create/{coin_type}',
{
  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-API-KEY' => 'API_KEY'
}

result = RestClient.post 'https://onchain.io/api/payment/create/{coin_type}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'X-API-KEY': 'API_KEY'
}

r = requests.post('https://onchain.io/api/payment/create/{coin_type}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://onchain.io/api/payment/create/{coin_type}");
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-API-KEY": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://onchain.io/api/payment/create/{coin_type}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
    'Accept' => 'application/json',
    'X-API-KEY' => 'API_KEY',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://onchain.io/api/payment/create/{coin_type}', 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());
 }

 // ...

POST /api/payment/create/{coin_type}

Carbon wallet requires multiple source addresses.

Body parameter

{
  "coin_type": "BITCOIN",
  "recipients": [
    {
      "to": "string",
      "amount": 0
    }
  ],
  "from": [
    {
      "from": "string",
      "from_address": "string"
    }
  ],
  "miners_fee": 0
}

Parameters

Name In Type Required Description
coin_type path string true none
body body onchain.PaymentRequest true none

Enumerated Values

Parameter Value
coin_type BITCOIN
coin_type ETHEREUM
coin_type TESTNET3
coin_type BITCOIN_CASH
coin_type BITCOIN_GOLD
coin_type LITECOIN
coin_type DASH
coin_type DOGE
coin_type BITCOIN_PRIVATE
coin_type ZCASH
coin_type ZCASH_TESTNET
coin_type ZCLASSIC

Example responses

200 Response

{
  "tx": "string",
  "total_input_value": 0,
  "hashes_to_sign": [
    {
      "input_index": 0,
      "public_key": "string",
      "hash_to_sign": "string",
      "signature": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK A successful response. onchain.TransactionReply
default Default An unexpected error response grpc.gateway.runtime.Error

CreateTransaction

Code samples

# You can also use wget
curl -X POST https://onchain.io/api/transaction/create/{coin_type} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-KEY: API_KEY'

POST https://onchain.io/api/transaction/create/{coin_type} HTTP/1.1
Host: onchain.io
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

$.ajax({
  url: 'https://onchain.io/api/transaction/create/{coin_type}',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "coin_type": "BITCOIN",
  "recipients": [
    {
      "to": "string",
      "amount": 0
    }
  ],
  "from": "string",
  "from_address": "string",
  "miners_fee": 0
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

fetch('https://onchain.io/api/transaction/create/{coin_type}',
{
  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-API-KEY' => 'API_KEY'
}

result = RestClient.post 'https://onchain.io/api/transaction/create/{coin_type}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'X-API-KEY': 'API_KEY'
}

r = requests.post('https://onchain.io/api/transaction/create/{coin_type}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://onchain.io/api/transaction/create/{coin_type}");
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-API-KEY": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://onchain.io/api/transaction/create/{coin_type}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
    'Accept' => 'application/json',
    'X-API-KEY' => 'API_KEY',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://onchain.io/api/transaction/create/{coin_type}', 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());
 }

 // ...

POST /api/transaction/create/{coin_type}

Similar to create payment but allows only one source address.

Body parameter

{
  "coin_type": "BITCOIN",
  "recipients": [
    {
      "to": "string",
      "amount": 0
    }
  ],
  "from": "string",
  "from_address": "string",
  "miners_fee": 0
}

Parameters

Name In Type Required Description
coin_type path string true none
body body onchain.TransactionRequest true none

Enumerated Values

Parameter Value
coin_type BITCOIN
coin_type ETHEREUM
coin_type TESTNET3
coin_type BITCOIN_CASH
coin_type BITCOIN_GOLD
coin_type LITECOIN
coin_type DASH
coin_type DOGE
coin_type BITCOIN_PRIVATE
coin_type ZCASH
coin_type ZCASH_TESTNET
coin_type ZCLASSIC

Example responses

200 Response

{
  "tx": "string",
  "total_input_value": 0,
  "hashes_to_sign": [
    {
      "input_index": 0,
      "public_key": "string",
      "hash_to_sign": "string",
      "signature": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK A successful response. onchain.TransactionReply
default Default An unexpected error response grpc.gateway.runtime.Error

SendRaw

Code samples

# You can also use wget
curl -X POST https://onchain.io/api/transaction/send_raw/{coin_type} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-KEY: API_KEY'

POST https://onchain.io/api/transaction/send_raw/{coin_type} HTTP/1.1
Host: onchain.io
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

$.ajax({
  url: 'https://onchain.io/api/transaction/send_raw/{coin_type}',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "coin_type": "BITCOIN",
  "tx": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

fetch('https://onchain.io/api/transaction/send_raw/{coin_type}',
{
  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-API-KEY' => 'API_KEY'
}

result = RestClient.post 'https://onchain.io/api/transaction/send_raw/{coin_type}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'X-API-KEY': 'API_KEY'
}

r = requests.post('https://onchain.io/api/transaction/send_raw/{coin_type}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://onchain.io/api/transaction/send_raw/{coin_type}");
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-API-KEY": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://onchain.io/api/transaction/send_raw/{coin_type}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
    'Accept' => 'application/json',
    'X-API-KEY' => 'API_KEY',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://onchain.io/api/transaction/send_raw/{coin_type}', 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());
 }

 // ...

POST /api/transaction/send_raw/{coin_type}

Body parameter

{
  "coin_type": "BITCOIN",
  "tx": "string"
}

Parameters

Name In Type Required Description
coin_type path string true none
body body onchain.RawTransactionSendRequest true none

Enumerated Values

Parameter Value
coin_type BITCOIN
coin_type ETHEREUM
coin_type TESTNET3
coin_type BITCOIN_CASH
coin_type BITCOIN_GOLD
coin_type LITECOIN
coin_type DASH
coin_type DOGE
coin_type BITCOIN_PRIVATE
coin_type ZCASH
coin_type ZCASH_TESTNET
coin_type ZCLASSIC

Example responses

200 Response

{
  "tx_hash": "string"
}

Responses

Status Meaning Description Schema
200 OK A successful response. onchain.TransactionSendReply
default Default An unexpected error response grpc.gateway.runtime.Error

SignAndSend

Code samples

# You can also use wget
curl -X POST https://onchain.io/api/transaction/sign_and_send/{coin_type} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'X-API-KEY: API_KEY'

POST https://onchain.io/api/transaction/sign_and_send/{coin_type} HTTP/1.1
Host: onchain.io
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

$.ajax({
  url: 'https://onchain.io/api/transaction/sign_and_send/{coin_type}',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "coin_type": "BITCOIN",
  "tx": "string",
  "signatures": [
    {
      "input_index": 0,
      "public_key": "string",
      "hash_to_sign": "string",
      "signature": "string"
    }
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'X-API-KEY':'API_KEY'

};

fetch('https://onchain.io/api/transaction/sign_and_send/{coin_type}',
{
  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-API-KEY' => 'API_KEY'
}

result = RestClient.post 'https://onchain.io/api/transaction/sign_and_send/{coin_type}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'X-API-KEY': 'API_KEY'
}

r = requests.post('https://onchain.io/api/transaction/sign_and_send/{coin_type}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://onchain.io/api/transaction/sign_and_send/{coin_type}");
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-API-KEY": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://onchain.io/api/transaction/sign_and_send/{coin_type}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

 'application/json',
    'Accept' => 'application/json',
    'X-API-KEY' => 'API_KEY',
    
    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://onchain.io/api/transaction/sign_and_send/{coin_type}', 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());
 }

 // ...

POST /api/transaction/sign_and_send/{coin_type}

Body parameter

{
  "coin_type": "BITCOIN",
  "tx": "string",
  "signatures": [
    {
      "input_index": 0,
      "public_key": "string",
      "hash_to_sign": "string",
      "signature": "string"
    }
  ]
}

Parameters

Name In Type Required Description
coin_type path string true none
body body onchain.TransactionSendRequest true none

Enumerated Values

Parameter Value
coin_type BITCOIN
coin_type ETHEREUM
coin_type TESTNET3
coin_type BITCOIN_CASH
coin_type BITCOIN_GOLD
coin_type LITECOIN
coin_type DASH
coin_type DOGE
coin_type BITCOIN_PRIVATE
coin_type ZCASH
coin_type ZCASH_TESTNET
coin_type ZCLASSIC

Example responses

200 Response

{
  "tx_hash": "string"
}

Responses

Status Meaning Description Schema
200 OK A successful response. onchain.TransactionSendReply
default Default An unexpected error response grpc.gateway.runtime.Error

Schemas

google.protobuf.Any

{
  "type_url": "string",
  "value": "string"
}

*Any contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message.

Protobuf library provides support to pack/unpack Any values in the form of utility functions or additional generated methods of the Any type.

Example 1: Pack and unpack a message in C++.

Foo foo = ...;
Any any;
any.PackFrom(foo);
...
if (any.UnpackTo(&foo)) {
  ...
}

Example 2: Pack and unpack a message in Java.

Foo foo = ...;
Any any = Any.pack(foo);
...
if (any.is(Foo.class)) {
  foo = any.unpack(Foo.class);
}

Example 3: Pack and unpack a message in Python.

foo = Foo(...)
any = Any()
any.Pack(foo)
...
if any.Is(Foo.DESCRIPTOR):
  any.Unpack(foo)
  ...

Example 4: Pack and unpack a message in Go

 foo := &pb.Foo{...}
 any, err := ptypes.MarshalAny(foo)
 ...
 foo := &pb.Foo{}
 if err := ptypes.UnmarshalAny(any, foo); err != nil {
   ...
 }

The pack methods provided by protobuf library will by default use 'type.googleapis.com/full.type.name' as the type URL and the unpack methods only use the fully qualified type name after the last '/' in the type URL, for example "foo.bar.com/x/y.z" will yield type name "y.z".

JSON

The JSON representation of an Any value uses the regular representation of the deserialized, embedded message, with an additional field @type which contains the type URL. Example:

package google.profile;
message Person {
  string first_name = 1;
  string last_name = 2;
}

{
  "@type": "type.googleapis.com/google.profile.Person",
  "firstName": ,
  "lastName": 
}

If the embedded message type is well-known and has a custom JSON representation, that representation will be embedded adding a field value which holds the custom JSON in addition to the @type field. Example (for message [google.protobuf.Duration][]):

{
  "@type": "type.googleapis.com/google.protobuf.Duration",
  "value": "1.212s"
}*

Properties

Name Type Required Restrictions Description
type_url string false none A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one "/" character. The last segment of the URL's path must represent the fully qualified name of the type (as in path/google.protobuf.Duration). The name should be in a canonical form (e.g., leading "." is not accepted). In practice, teams usually precompile into the binary all types that they expect it to use in the context of Any. However, for URLs which use the scheme http, https, or no scheme, one can optionally set up a type server that maps type URLs to message definitions as follows: * If no scheme is provided, https is assumed. * An HTTP GET on the URL must yield a [google.protobuf.Type][] value in binary format, or produce an error. * Applications are allowed to cache lookup results based on the URL, or have them precompiled into a binary to avoid any lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.) Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com. Schemes other than http, https (or the empty scheme) might be used with implementation specific semantics.
value string(byte) false none Must be a valid serialized protocol buffer of the above specified type.

grpc.gateway.runtime.Error

{
  "error": "string",
  "code": 0,
  "message": "string",
  "details": [
    {
      "type_url": "string",
      "value": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
error string false none none
code integer(int32) false none none
message string false none none
details [google.protobuf.Any] false none [Any contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. Protobuf library provides support to pack/unpack Any values in the form of utility functions or additional generated methods of the Any type. Example 1: Pack and unpack a message in C++. Foo foo = ...; Any any; any.PackFrom(foo); ... if (any.UnpackTo(&foo)) { ... } Example 2: Pack and unpack a message in Java. Foo foo = ...; Any any = Any.pack(foo); ... if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() any.Pack(foo) ... if any.Is(Foo.DESCRIPTOR): any.Unpack(foo) ... Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := ptypes.MarshalAny(foo) ... foo := &pb.Foo{} if err := ptypes.UnmarshalAny(any, foo); err != nil { ... } The pack methods provided by protobuf library will by default use 'type.googleapis.com/full.type.name' as the type URL and the unpack methods only use the fully qualified type name after the last '/' in the type URL, for example "foo.bar.com/x/y.z" will yield type name "y.z". JSON ==== The JSON representation of an Any value uses the regular representation of the deserialized, embedded message, with an additional field @type which contains the type URL. Example: package google.profile; message Person { string first_name = 1; string last_name = 2; } { "@type": "type.googleapis.com/google.profile.Person", "firstName": , "lastName": } If the embedded message type is well-known and has a custom JSON representation, that representation will be embedded adding a field value which holds the custom JSON in addition to the @type field. Example (for message [google.protobuf.Duration][]): { "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" }]

onchain.AddressReply

{
  "network_address": "string"
}

Properties

Name Type Required Restrictions Description
network_address string false none none

onchain.BalanceAddressReply

{
  "address": "string",
  "usd_balance": 0,
  "balance": 0,
  "unconfirmed_balance": 0,
  "human_balance": 0,
  "human_unconfirmed_balance": 0
}

Properties

Name Type Required Restrictions Description
address string false none none
usd_balance number(float) false none none
balance integer(uint64) false none none
unconfirmed_balance integer(uint64) false none none
human_balance number(double) false none none
human_unconfirmed_balance number(double) false none none

onchain.BalanceReply

{
  "usd_balance": 0,
  "balance": 0,
  "unconfirmed_balance": 0,
  "human_balance": 0,
  "human_unconfirmed_balance": 0
}

Properties

Name Type Required Restrictions Description
usd_balance number(float) false none none
balance integer(uint64) false none none
unconfirmed_balance integer(uint64) false none none
human_balance number(double) false none none
human_unconfirmed_balance number(double) false none none

onchain.BalancesReply

{
  "addresses": [
    {
      "address": "string",
      "usd_balance": 0,
      "balance": 0,
      "unconfirmed_balance": 0,
      "human_balance": 0,
      "human_unconfirmed_balance": 0
    }
  ],
  "totals": {
    "usd_balance": 0,
    "balance": 0,
    "unconfirmed_balance": 0,
    "human_balance": 0,
    "human_unconfirmed_balance": 0
  }
}

Properties

Name Type Required Restrictions Description
addresses [onchain.BalanceAddressReply] false none none
totals onchain.BalanceReply false none none

onchain.CoinType

"BITCOIN"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous BITCOIN
anonymous ETHEREUM
anonymous TESTNET3
anonymous BITCOIN_CASH
anonymous BITCOIN_GOLD
anonymous LITECOIN
anonymous DASH
anonymous DOGE
anonymous BITCOIN_PRIVATE
anonymous ZCASH
anonymous ZCASH_TESTNET
anonymous ZCLASSIC

onchain.ERC20TransactionRequest

{
  "to": "string",
  "amount": "string",
  "gas_price": 0,
  "gas_limit": 0,
  "contract_id": "string",
  "decimal_places": 0
}

Properties

Name Type Required Restrictions Description
to string false none none
amount string false none The amount we wish to send in GWEI. We have to use a string to store this as Ethereum stores amounts in potentially nunbers with 256 bits.
gas_price integer(uint64) false none none
gas_limit integer(uint64) false none none
contract_id string false none none
decimal_places integer(int64) false none none

onchain.EthereumTransactionReply

{
  "tx": "string",
  "to_sign": "string"
}

Properties

Name Type Required Restrictions Description
tx string(byte) false none none
to_sign string(byte) false none none

onchain.EthereumTransactionRequest

{
  "to": "string",
  "from": "string",
  "amount": "string",
  "gas_price": 0,
  "gas_limit": 0
}

Properties

Name Type Required Restrictions Description
to string false none none
from string(byte) false none none
amount string false none The amount we wish to send in GWEI. We have to use a string to store this as Ethereum stores amounts in potentially nunbers with 256 bits.
gas_price integer(uint64) false none none
gas_limit integer(uint64) false none none

onchain.EthereumTransactionSendRequest

{
  "tx": "string",
  "v": 0,
  "r": "string",
  "s": "string"
}

Properties

Name Type Required Restrictions Description
tx string(byte) false none none
v integer(uint64) false none none
r string(byte) false none none
s string(byte) false none none

onchain.HashToSign

{
  "input_index": 0,
  "public_key": "string",
  "hash_to_sign": "string",
  "signature": "string"
}

Properties

Name Type Required Restrictions Description
input_index integer(int64) false none none
public_key string(byte) false none none
hash_to_sign string(byte) false none none
signature string(byte) false none none

onchain.HistoryReply

{
  "total_txs": 0,
  "txs": [
    {
      "confirmations": 0,
      "time": 0,
      "is_deposit": true,
      "address": "string",
      "amount": 0,
      "human_amount": 0
    }
  ]
}

Properties

Name Type Required Restrictions Description
total_txs integer(uint64) false none none
txs [onchain.HistoryReply.TX] false none none

onchain.HistoryReply.TX

{
  "confirmations": 0,
  "time": 0,
  "is_deposit": true,
  "address": "string",
  "amount": 0,
  "human_amount": 0
}

Properties

Name Type Required Restrictions Description
confirmations integer(uint64) false none none
time integer(uint64) false none none
is_deposit boolean false none none
address string false none none
amount integer(uint64) false none none
human_amount number(float) false none none

onchain.MultiSigTransactionRequest

{
  "coin_type": "BITCOIN",
  "recipients": [
    {
      "to": "string",
      "amount": 0
    }
  ],
  "public_keys": [
    "string"
  ],
  "miners_fee": 0,
  "number_of_required_signatures": 0
}

Properties

Name Type Required Restrictions Description
coin_type onchain.CoinType false none none
recipients [onchain.TransactionRecipient] false none none
public_keys [string] false none none
miners_fee integer(uint64) false none none
number_of_required_signatures integer(uint64) false none none

onchain.PaymentRequest

{
  "coin_type": "BITCOIN",
  "recipients": [
    {
      "to": "string",
      "amount": 0
    }
  ],
  "from": [
    {
      "from": "string",
      "from_address": "string"
    }
  ],
  "miners_fee": 0
}

Properties

Name Type Required Restrictions Description
coin_type onchain.CoinType false none none
recipients [onchain.TransactionRecipient] false none none
from [onchain.TransactionSource] false none [Allo users to create payments from multiple source addresses.]
miners_fee integer(uint64) false none none

onchain.RawTransactionSendRequest

{
  "coin_type": "BITCOIN",
  "tx": "string"
}

Properties

Name Type Required Restrictions Description
coin_type onchain.CoinType false none none
tx string(byte) false none none

onchain.TransactionRecipient

{
  "to": "string",
  "amount": 0
}

Properties

Name Type Required Restrictions Description
to string false none none
amount integer(uint64) false none none

onchain.TransactionReply

{
  "tx": "string",
  "total_input_value": 0,
  "hashes_to_sign": [
    {
      "input_index": 0,
      "public_key": "string",
      "hash_to_sign": "string",
      "signature": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
tx string(byte) false none none
total_input_value integer(uint64) false none none
hashes_to_sign [onchain.HashToSign] false none none

onchain.TransactionRequest

{
  "coin_type": "BITCOIN",
  "recipients": [
    {
      "to": "string",
      "amount": 0
    }
  ],
  "from": "string",
  "from_address": "string",
  "miners_fee": 0
}

Properties

Name Type Required Restrictions Description
coin_type onchain.CoinType false none none
recipients [onchain.TransactionRecipient] false none none
from string(byte) false none none
from_address string false none none
miners_fee integer(uint64) false none none

onchain.TransactionSendReply

{
  "tx_hash": "string"
}

Properties

Name Type Required Restrictions Description
tx_hash string(byte) false none none

onchain.TransactionSendRequest

{
  "coin_type": "BITCOIN",
  "tx": "string",
  "signatures": [
    {
      "input_index": 0,
      "public_key": "string",
      "hash_to_sign": "string",
      "signature": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
coin_type onchain.CoinType false none none
tx string(byte) false none none
signatures [onchain.HashToSign] false none none

onchain.TransactionSource

{
  "from": "string",
  "from_address": "string"
}

Allo users to create payments from multiple source addresses.

Properties

Name Type Required Restrictions Description
from string(byte) false none none
from_address string false none none

onchain.VerificationReply

{
  "valid": true
}

Properties

Name Type Required Restrictions Description
valid boolean false none none