diff --git a/binding.gyp b/binding.gyp index 9b416ecf..22b905fb 100644 --- a/binding.gyp +++ b/binding.gyp @@ -56,6 +56,10 @@ # bitcoind: '<(BITCOIN_DIR)/src/libbitcoind.so', + + # '<(BITCOIN_DIR)/src/libbitcoin_server.a', + # '<(BITCOIN_DIR)/src/libbitcoin_common.a', + # '<(BITCOIN_DIR)/src/libbitcoin_wallet.a', ] }] } diff --git a/lib/bitcoind.js b/lib/bitcoind.js index f869c032..3f1fc431 100644 --- a/lib/bitcoind.js +++ b/lib/bitcoind.js @@ -9,6 +9,7 @@ var EventEmitter = require('events').EventEmitter; var bitcoindjs = require('../build/Release/bitcoindjs.node'); var util = require('util'); var net = require('net'); +var bn = require('bn.js'); /** * Bitcoin @@ -279,6 +280,86 @@ Bitcoin.prototype.close = function(callback) { }); }; +/** + * Block + */ + +function Block(data) { + if (!(this instanceof Block)) { + return new Block(data); + } +} + +/** + * Transaction + */ + +function Transaction(data) { + if (!(this instanceof Transaction)) { + return new Transaction(data); + } + + this.nMinTxFee = data.nMinTxFee || new bn(0); + this.nMinRelayTxFee = data.nMinRelayTxFee || new bn(0); + this.CURRENT_VERSION = 1; + this.nVersion = data.nVersion || -1; + this.vin = data.vin || []; + this.vout = data.vout || []; + this.nLockTime = data.nLockTime || null; +} + +Transaction.prototype.getSerializeSize = function() { + ; +}; + +Transaction.prototype.serialize = function() { + ; +}; + +Transaction.prototype.unserialize = function() { + ; +}; + +Transaction.prototype.setNull = function() { + ; +}; + +Transaction.prototype.isNull = function() { + ; +}; + +Transaction.prototype.getHash = function() { + ; +}; + +Transaction.prototype.getValueOut = function() { + ; +}; + +Transaction.prototype.computePriority = function() { + ; +}; + +Transaction.prototype.isCoinbase = function() { + ; +}; + +Transaction.prototype.equal = function() { + ; +}; + +Transaction.prototype.notEqual = function() { + ; +}; + +Transaction.prototype.toString = function() { + ; +}; + +Transaction.prototype.print = function() { + ; +}; + /** * Utils */ diff --git a/package.json b/package.json index 54b127d9..ef6ef535 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,8 @@ "bitcoind" ], "dependencies": { - "nan": "1.3.0" + "nan": "1.3.0", + "bn.js": "^0.10.0" }, "devDependencies": { "mocha": "~1.16.2"