Browse Source

Added compilation target for exit node client.

hk-custom-address
Stefan Thomas 13 years ago
parent
commit
8719d925d6
  1. 12
      Jakefile.js
  2. 8
      build/bitcoinjs-exit-min.js
  3. 40
      build/bitcoinjs-min.js

12
Jakefile.js

@ -10,7 +10,10 @@ var headerJS = "\
* it under the terms of the MIT license.\n\
*/";
task('default', ['build/bitcoinjs-min.js']);
task({'default': [
'build/bitcoinjs-min.js',
'build/bitcoinjs-exit-min.js'
]});
desc('General-purpose build containing most features');
minify({'build/bitcoinjs-min.js': [
@ -41,3 +44,10 @@ minify({'build/bitcoinjs-min.js': [
]}, {
header: headerJS
});
desc('Exit node client implementation');
minify({'build/bitcoinjs-exit-min.js': [
'src/exit/client.js'
]}, {
header: headerJS
});

8
build/bitcoinjs-exit-min.js

@ -0,0 +1,8 @@
/**
* BitcoinJS-lib v0.1.0-default
* Copyright (c) 2011 BitcoinJS Project
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the MIT license.
*/
(function(a,b,c,d,e){function f(a,b,c){this.setUri(a,b,c),this.unique=1,this.connected=!1,this.callbacks=[]}a.ExitNode=f,b.EventEmitter.augment(f),f.prototype.setUri=function(a,b,c){this.uri=(c?"https://":"http://")+a+":"+b},f.prototype.connect=function(a){this.wallet=a,delete c.sockets[this.uri],c.j=[],this.socket=c.connect(this.uri),this.socket.on("connect",d.proxy(this.handleConnect,this)),this.socket.on("error",function(){console.log("error, test")}),this.socket.on("message",d.proxy(this.handleMessage,this)),this.socket.on("disconnect",d.proxy(this.handleDisconnect,this))},f.prototype.disconnect=function(){this.socket&&(this.socket.disconnect(),this.socket=null,this.connected=!1),this.trigger("connectStatus",{status:"unknown"})},f.prototype.call=function(a,b,c){this.socket.send(d.toJSON({method:a,params:[b],id:this.unique})),c&&(this.callbacks[this.unique]=c),this.unique++},f.prototype.handleConnect=function(){var a=this;this.connected=!0},f.prototype.listen=function(a){self.call("pubkeysRegister",{keys:a.join(",")},function(a,b){if(a){console.error("Could not register public keys");return}self.call("pubkeysListen",{handle:b.handle},function(a,b){self.trigger("blockInit",{height:b.height}),self.trigger("txData",{confirmed:!0,txs:b.txs}),self.trigger("connectStatus",{status:"ok"})}),self.call("pubkeysUnconfirmed",{handle:b.handle},function(a,b){self.trigger("txData",{confirmed:!1,txs:b.txs})})})},f.prototype.handleMessage=function(a){"undefined"!=typeof a.result&&"function"==typeof this.callbacks[a.id]?this.callbacks[a.id](a.error,a.result):"undefined"!=typeof a.method&&this.trigger(a.method,a.params[0])},f.prototype.handleDisconnect=function(){},f.prototype.query=function(a,b,c,e){"function"==typeof c&&(e=c,c=!1),b=b||{},e="function"==typeof e?e:function(){};var f=this.uri+"/"+a;c&&(f+="?callback=?"),d.getJSON(f,b,e)}})("undefined"!=typeof Bitcoin?Bitcoin:module.exports,"undefined"!=typeof Bitcoin?Bitcoin:require("bitcoinjs-lib"),"undefined"!=typeof io?io:require("io"),jQuery,this)

40
build/bitcoinjs-min.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save