XCP Tools JS - Send Asset

*I used this library: *

I tried to send GUERILLA from asset_send.html.
Two issues:

  1. Needed to include libraries:

  2. The send is invalid. Blocktrail shows:
    Type: send
    Quantity: 0.10000000 BBSXSIVNXQ
    Sources: 1Ch9trfp2ULuPxnU81cA3TDvW17L8YRw6r,
    Destinations: 1AeEhRpChp1TteqBTkC4GPmyQJgH31MMmK,
    Everything is correct except the asset name, which should be GUERILLA.

Check out the xcp-js library in the XCP Wallet repo, https://github.com/loon3/XCP-Wallet/tree/master/Chrome-Extension/js/xcp-js

I haven’t done a good job at keeping the xcp-tools-js library up to date…

1 Like

Thanks! XCP Wallet repo updated two days ago. Yeah, I will definitely try it out.

Tested it. Works! :smiley:

Just some notes:

  1. Had to add
    < script src="…/js/biginteger.js">
    < script src="…/js/hex2dec-cs.js">
    to asset_send.html

  2. var source_html = “https://”+INSIGHT_SERVER+"/api/addr/"+add_from+"/utxo";
    in transactions.js did not work (I unzipped the project and opened it in locally in FIrefox). Works after I changed it to
    var source_html = “https://insight.bitpay.com/api/addr/"+add_from+"/utxo”;

Feel free to submit a pull request to make those changes to the asset_send.html test page

In regard to your second point, the INSIGHT_SERVER variable is declared via

var INSIGHT_SERVER = getInsightServer();

as long as you include

<script src="../js/apiserver.js">

The reason for this is that bitpay’s insight server isn’t the most reliable so I needed a quick way to change servers. Other insight server options besides bitpay are https://localbitcoinschain.com/ and https://search.bitaccess.ca/