bitcoinjs-phore
Client-side Phore JavaScript library
Last updated 2 years ago by marleymarl .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install bitcoinjs-phore 
SYNC missed versions from official npm registry.

Bitcoinjs-Phore

This is essentially a fork of bitcoinjs-lib with a change to the network.js file to add Phore network parameters.

It provides base functionality in javascript for operations such as creating and receiving Phore transactions, and generating secure Phore keys.

Installation

npm install bitcoinjs-phore

Setup

Node.js

var phore = require('bitcoinjs-phore')

Creating a transaction


var phore = require('bitcoinjs-phore')

let phorenet = phore.networks.phore;

let txb = new phore.TransactionBuilder(phorenet);

let txId = ""; //insert the txId to use as Input to the Transaction

let outn = 1; //or whatever outn to be used as Input to the Transaciton

let rcv = ""; //insert the receiving address the output is being "sent" to

let amt = 100000000; //or whatever amount in phore-satoshis is being output in this transaction

//Input

txb.addInput(txId, outn);

//Output

txb.addOutput(rcv, amt);

//Sign the transaction

let WIF = ""; //insert the WIF of the private key being used to sign the transaction

let keypairSpend = phore.ECPair.fromWIF(WIF, phorenet);

txb.sign(0, keypairSpend);

let tx = txb.build();

let txHex = tx.toHex();

console.log(txHex) // logs out the hex of the transaction --> the hex (txHex) is what you need to broadcast the transaction to the Phore newtork using the Phore-RPC package


LICENSE MIT

Current Tags

  • 1.1.0                                ...           latest (2 years ago)

2 Versions

  • 1.1.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (15)
Dev Dependencies (12)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |