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.


Auto Save

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>connex.thor.filter - event(VTHO transfer)</h4>
<pre id="status">connecting to node.....</pre>
<label>criteria: </label>
<select id="criteria">
  <!-- Base on transferEventABI indexed == true   -->
  <option value="_from">_from</option>
  <option value="_to">_to</option>
<input id="address" placeholder="input address" value="0xd3ae78222beadb038203be21ed5ce7c9b1bff602"></input>
<label>order: </label>
<select id="order">
  <option value="desc">desc</option>
  <option value="asc">asc</option>
<label>fitlerRange: </label>
<select id="rangeUnit">
  <option value="block">block</option>
  <option value="time">time</option>
<input id="from"></input>
<input id="to"></input>
<h5>Note: Enter block number or timestamp in second</h5>
<button onclick="filter()">filter</button>
<pre id="filterResult"></pre>




                const connex = new Connex({
  node: "",
  network: "test"
//VTHO transfer
const transferEventABI = {
  anonymous: false,
  inputs: [
    { indexed: true, name: "_from", type: "address" },
    { indexed: true, name: "_to", type: "address" },
    { indexed: false, name: "_value", type: "uint256" }
  name: "Transfer",
  type: "event"
const transferEvent = connex.thor
const filterResult = document.getElementById("filterResult");
const filterOffset = 0; // Start cursor in the result
const filterLimit = 1; // Constrain the number of result returned
const ticker = connex.thor.ticker();

void (async () => {
  for (;;) {
    document.getElementById("status").innerText =
      "Current block# " + connex.thor.status.head.number;

function filter() {
  const criteriaType = document.getElementById("criteria").value;
  const orderType = document.getElementById("order").value;
  const rangeUnit = document.getElementById("rangeUnit").value;
  const address = document.getElementById("address").value;
  const filterFrom = document.getElementById("from").value;
  const filterTo = document.getElementById("to").value;
  filterResult.innerText = "";

  // Create a filter from eventABI
  const criteria = { [criteriaType]: address };
  const filter = transferEvent.filter([criteria]);
  // Set filter order
  // Set filter range
  if (filterFrom && filterTo != "") {
      unit: rangeUnit,
      from: parseInt(filterFrom, 10),
      to: parseInt(filterTo, 10)
  // Set the range
  // Apply the filter, get the first one
  filter.apply(filterOffset, filterLimit).then((logs) => {
    filterResult.innerText = JSON.stringify(logs, null, 4);