New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bc-runes-js

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bc-runes-js

A package to be able to mint, etch or transfer bitcoin runes very easily.

  • 0.2.0
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-79.49%
Maintainers
1
Weekly downloads
 
Created
Source

BC RUNES JS

A package that makes use of runelib library to allow minting, etching or transferring bitcoin runes very easily, by abstracting a bit more of what runelib does, creating the whole environment and scripts for transaction signing, submitting, and waiting.

USAGE

Preparing the addresses

If getting addresses for the first time, run npm run generate-addresses and a random wif with two addresses will be generated.

  $ npm run generate-addresses
    >> No WIF set, generating new random addresses
    >> {
    >>  paymentAddress: 'tb1q8zem3pf9mua90czwh90grfv3jsnpdt5s43ldth',
    >>  ordinalsAddress: 'tb1pk9tupncu3xx53qgrckmlh54ardlhw8zaylk44zx8wkmqxums5dqqx9mh47',
    >>  WIF: 'cVXykGkQ7xMuYw7oSS7SLQUt1UqwJETxiLLR2eepHesXLjcazGbV'
    >> }

If already have a WIF key, use it as an argument for the previous script npm run generate-addresses $wif

  $ npm run generate-addresses cQcystps9ZiT2PSFvmxH4wZ5kAgHiRBXL6e8KBmmsLEhVUzASyfc
      >> {
      >>  paymentAddress: 'tb1qhnhaw5qs75rttpg48vawcxy3nk2qqcf3h2utmf',
      >>  ordinalsAddress: 'tb1p52mys7sd95jsf0v0vc5p2j3ll03tztjthcmylwprgzm296sahdpswnralf',
      >>  WIF: 'cQcystps9ZiT2PSFvmxH4wZ5kAgHiRBXL6e8KBmmsLEhVUzASyfc'
      >> }

In both cases, save paymentAddress, ordinalsAddress and WIF in an .env file or anywhere for later use in the project. These addresses are, respectively, the one that should hold the satoshis to pay for transaction fees, and the address that will own the runes etched or minted.

Note: the addresses and keys shown in this example are randomly generated and purely for this example, don't try to use them.

Example for etching a rune

const {
  etch,
  init
} = require('bc-runes-js')

const {
  PAYMENT_ADDRESS,
  ORDINALS_ADDRESS,
  WIF
} = process.env

async function main() {
  init({
    paymentAddress: PAYMENT_ADDRESS,
    ordinalsAddress: ORDINALS_ADDRESS,
    wif: WIF,
    feePerByte: 300
  })

  const res = await etch({
    amount: 1,
    cap: 100,
    divisibility: 0,
    name: 'YOUR•RUNE•NAME',
    symbol: '❤︎'
  })

  console.log({ res })
}

main()

Example for minting a rune

const {
  mint,
  init
} = require('bc-runes-js')

const {
  PAYMENT_ADDRESS,
  ORDINALS_ADDRESS,
  WIF
} = process.env

async function main() {
  init({
    paymentAddress: PAYMENT_ADDRESS,
    ordinalsAddress: ORDINALS_ADDRESS,
    wif: WIF,
    feePerByte: 300
  })

  // only one of these two arguments is mandatory
  const res = await mint({
    name: '',
    runeId: [blockNumber, txIndex]
  })

  console.log({ res })
}

main()

Example for minting a rune

Not implemented yet. Will be available soon.

Keywords

FAQs

Package last updated on 01 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc