@satchmo is on PowPing!

PowPing is a place where you can earn Bitcoin simply by socializing, for FREE.
Never tried Bitcoin? It's OK! Just come, socialize, and earn Bitcoin.
Check out satchmo's activities
Total Economy: 0.79 USD

Bitcoin extension for vs-code

Generating an private key, and getting a Bitcoin address associated with it.

Often times when writing code I need the same things over and over. Sometimes its a txid, or an address, or a private key. In the above screencast you can see me generating a private key, and then getting an address for that private key.

Typically I find myself opening Chrome just to open dev tools and use the console on a page I know has the bsv library exposed on the window object. I would manually generate some key or address, or maybe just wanting to validate some data I already have. 

Fetching pre-formatted transaction data by txid

Other times its sample data in a specific format like bmap, bob, or a raw transaction in hex or json.  I'll typically visit whatsonchain.com or a planaria like b.map.sv to browse the blockchain and find a data sample for whatever I'm working on at the moment.  In this example, you can see me simply pasting in a txid and getting the bmap formatted transaction data, and pasting it into my VSCode. The options are:

  1. raw - raw hex string
  2. bob - bob formatting
  3. json - json-rpc representation
  4. bmap - parses a number of known OP_RETURN protocols using bmap.js

This feature uses a secret parser endpoint I've had sitting at bmapjs.com that I use for development and testing sometimes. It's nice to make better use of it :)

Usage

To use the plugin, bring up the command palette (ctrl/cmd + shift + p) and type the name of any of the commands below.

Commands

Address

  • Address from Private Key
  • Address from Public Key
  • Address from WIF

Public Key

  • Public Key from Private Key
  • Generate Public Key

Private

  • Generate Private Key

WIF

  • Generate WIF

Tx

  • Fetch Transaction by ID (bob, raw, json and bmap formats available)

Download & Source

It turns out, writing vscode extensions is pretty easy compared to other plugin systems, and I managed to get something scrappy out in one day (so far!). 

You can install the plugin on the VS Code Marketplace and if you want to contribute to or check out the source code, its available on github as well.

Feature Ideas

There are many things that could be added to make this even more useful but would really love to hear requests (or better yet pull requests!). A few things I want to implement when I have time:

  1. Verify a tx is in a block by id (via miner thanks to merchant API)
  2. Validate Scripts
  3. Expose hash functions like sha256
  4. Encode / decode hex strings
powered by powpress
link Tip
Share
tx
translate
unwriter tipped:
connor tipped:
venezia tipped:
vegardwikeby tipped:
libs tipped:
mpapec tipped:
orimar tipped:
nitroxei tipped:
monbon tipped:
This is so useful - thanks for making this :)
This is great!
I really like the transaction fetch feature. Would it be possible to create a new tab with the result instead of copying to the clipboard? In most cases you want to see the result immediately. And if you want to copy, you can copy from the new tab.
satchmo replied:
good idea. Update to v0.0.10 tx payloads will open in a new tab now
unwriter tipped:
unwriter replied:
Nice, it works!
vegardwikeby replied:
Where do I bring the 🍺?