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

function handleButtonClick() {
  const params = {
    to: 'bitcoincash:qrd9khmeg4nqag3h5gzu8vjt537pm7le85lcauzezc',
    protocol: 'BCH',
    value: '0.000123'
  };

  sendAssets(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