<button id="actionButton" onclick="handleButtonClick()">getAddress</button>
<br/>
<h3>Success</h3>
<div id="result"></div>
</br>
<h3>Error</h3>
<div id="error"></div>
const { getAddress, constants } = bitcoincomLink;

function handleButtonClick() {
  const params = { protocol: "BCH" };

  getAddress(params)
  .then(result => {
    resultEle.innerHTML = JSON.stringify(result);
  })
  .catch(errorResult => {
    errorResultEle.innerHTML = JSON.stringify(errorResult);
  });
}

const resultEle = document.getElementById('result');
const errorResultEle = document.getElementById('error');

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdn.jsdelivr.net/npm/bitcoincom-link@0.1.10/lib/bitcoincom-link.min.js