Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <h4>In this demo, it helps you to understand how to get the token list and transfer token</h4>

<label for="tokens">Recipient: </label>
<input id="to" placeholder="enter recipient address" value="0x70aE85A2fF6030366F512DbcD60Be3828139b498"></input>
<label for="amount">Amount: </label>
<input id="amount" placeholder="enter transfer amount" value=1></input>
<select name="tokensList" id="tokensList">

<button onclick="transferToken()">Transfer</button>

<pre id="result"></pre>




                const connex = new Connex({
  node: "",
  network: "test"
const resultDetails = document.getElementById("result");
var json = [];
var tokenSelect = document.getElementById("tokensList");
const url = "";
//token  list:

const transferABI = {
  constant: false,
  inputs: [
    { name: "_to", type: "address" },
    { name: "_amount", type: "uint256" }
  name: "transfer",
  outputs: [{ name: "success", type: "bool" }],
  payable: false,
  stateMutability: "nonpayable",
  type: "function"

const request = new XMLHttpRequest();"get", url);
request.onload = function () {
  if (request.status == 200) {
    json = JSON.parse(request.responseText);
    for (var i = 0; i < json.length; i++) {
      var option = document.createElement("option");
      option.text = json[i].symbol;
      option.value = json[i].address;
      var select = document.getElementById("tokensList");

function transferToken() {
  const to = document.getElementById("to").value;
  const amount = BigInt(document.getElementById("amount").value);

  //the value unit is wei , thus, value need to multiply by 1e18
  const e18 = BigInt(1e18);
  const transferMethod = connex.thor

  const clause = transferMethod.asClause(to, (amount * e18).toString(10));

    .sign("tx", [clause])
    .comment("transaction signing - transfer token")
    // .accepted(() => alert("accepted"))
    .then((r) => (resultDetails.innerText = JSON.stringify(r, null, 4)))
    .catch((e) => console.log("error:" + e.message));