2.2.1 • Published 2 years ago

bch-token-sweep v2.2.1

Weekly downloads
53
License
MIT
Repository
github
Last release
2 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

2 years ago

2.2.0

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

1.5.14

2 years ago

1.5.16

2 years ago

1.5.15

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.5.13

3 years ago

1.5.12

3 years ago

1.5.11

3 years ago

1.5.10

3 years ago

1.5.9

3 years ago

1.5.8

3 years ago

1.5.7

3 years ago

1.5.6

3 years ago

1.5.5

3 years ago

1.5.4

3 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.6

4 years ago

1.4.5

4 years ago

1.4.4

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago