# XCP Tools JS - Send Asset

**URL:** <https://forums.counterparty.io/t/xcp-tools-js-send-asset/1759>\
**Category:** Support\
**Created:** [January 20, 2016, 10:00am UTC](https://forums.counterparty.io/t/xcp-tools-js-send-asset/1759 "2016-01-20T10:00:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JPJA](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/jpja/32/1324_2.png) [@JPJA](https://forums.counterparty.io/u/JPJA)\
**Post date:** [January 20, 2016, 10:00am UTC](https://forums.counterparty.io/t/xcp-tools-js-send-asset/1759/1 "2016-01-20T10:00:00Z")

</div>

\*I used this library: \*  
_[https://github.com/loon3/xcp-tools-js](https://github.com/loon3/xcp-tools-js)_

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  
Asset: BBSXSIVNXQ  
Quantity: 0.10000000 BBSXSIVNXQ  
Sources: 1Ch9trfp2ULuPxnU81cA3TDvW17L8YRw6r,  
Destinations: 1AeEhRpChp1TteqBTkC4GPmyQJgH31MMmK,  
Everything is correct except the asset name, which should be GUERILLA.  
[https://www.blocktrail.com/BTC/tx/e9dfc6987568c9f7f386089f318e71bb2312bdaac687f61dcbd1d7c0affc4add](https://www.blocktrail.com/BTC/tx/e9dfc6987568c9f7f386089f318e71bb2312bdaac687f61dcbd1d7c0affc4add)

---

<div class="post-metadata">

**Author:** ![loon3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/loon3/32/1018_2.png) [@loon3](https://forums.counterparty.io/u/loon3)\
**Post date:** [January 20, 2016, 1:27pm UTC](https://forums.counterparty.io/t/xcp-tools-js-send-asset/1759/2 "2016-01-20T13:27:48Z")

</div>

Check out the xcp-js library in the XCP Wallet repo, [https://github.com/loon3/XCP-Wallet/tree/master/Chrome-Extension/js/xcp-js](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…

---

<div class="post-metadata">

**Author:** ![JPJA](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/jpja/32/1324_2.png) [@JPJA](https://forums.counterparty.io/u/JPJA)\
**Post date:** [January 21, 2016, 7:21am UTC](https://forums.counterparty.io/t/xcp-tools-js-send-asset/1759/3 "2016-01-21T07:21:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JPJA](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/jpja/32/1324_2.png) [@JPJA](https://forums.counterparty.io/u/JPJA)\
**Post date:** [January 21, 2016, 1:39pm UTC](https://forums.counterparty.io/t/xcp-tools-js-send-asset/1759/4 "2016-01-21T13:39:49Z")

</div>

Tested it. Works! 😃

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](https://insight.bitpay.com/api/addr/%22+add_from+%22/utxo)”;

---

<div class="post-metadata">

**Author:** ![loon3](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/loon3/32/1018_2.png) [@loon3](https://forums.counterparty.io/u/loon3)\
**Post date:** [January 21, 2016, 2:44pm UTC](https://forums.counterparty.io/t/xcp-tools-js-send-asset/1759/5 "2016-01-21T14:44:20Z")

</div>

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/](https://localbitcoinschain.com/) and [https://search.bitaccess.ca/](https://search.bitaccess.ca/)
