2.2.1 • Published 4 years ago

bch-token-sweep v2.2.1

Weekly downloads
53
License
MIT
Repository
github
Last release
4 years ago

bch-token-sweep

This is a library that allows sweeping of Bitcoin Cash (BCH) and Simple Ledger Protocol (SLP) tokens from a paper wallet. Paper wallets are just a WIF private key embedded inside a QR code. You can generate a paper wallet for BCH at paperwallet.bitcoin.com and SLP tokens at slp-paper-wallet.fullstack.cash.

This library is intended to be used by the gatsby-plugin-bch-sweep Gatsby Plugin. This is a plugin that is incorporated into the wallet.fullstack.cash web wallet.

Check out the end-to-end tests for examples of different use-cases for this library.

Example:

// These are the WIF (private keys) used to operate the test.
const paperWif = 'KxtteuKQ2enad5jH2o5eGkSaTgas49kWmvADW6qqhLAURrxuUo7m'
const receiverWif = 'L3nSksvTtHHBRP3HNMDhy6hDKpu88PQvrLGzLJn3FYX2diKqC1GD'
const receiverAddr = 'simpleledger:qp7xf0f5x7hgj6ak2xzcdnt6e0wggdty8vqe0asv5y'

async function sweep(wif) {
  // Instancing the library
  const sweeperLib = new SweeperLib(paperWif, receiverWif)
  await sweeperLib.populateObjectFromNetwork()

  // Generate a transaction.
  const hex = await sweeperLib.sweepTo(receiverAddr)

  // Send a transaction.
  const txid = await sweeperLib.blockchain.broadcast(hex)

  console.log('Transaction ID', txid)
  console.log(`https://explorer.bitcoin.com/bch/tx/${txid}`)
}
sweep(paperWif)

Licence

MIT

t

2.2.1

4 years ago

2.2.0

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

1.5.14

4 years ago

1.5.16

4 years ago

1.5.15

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.5.13

5 years ago

1.5.12

5 years ago

1.5.11

5 years ago

1.5.10

5 years ago

1.5.9

6 years ago

1.5.8

6 years ago

1.5.7

6 years ago

1.5.6

6 years ago

1.5.5

6 years ago

1.5.4

6 years ago

1.5.3

6 years ago

1.5.2

6 years ago

1.5.1

6 years ago

1.5.0

6 years ago

1.4.6

6 years ago

1.4.5

6 years ago

1.4.4

6 years ago

1.4.3

6 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago