});o.setRequestManager(this._web3._requestManager);vars=o.buildCall();returno=null,s(r.params,r.callback)},l.prototype._createTxObject=function(){vart={};returnt.call=this.parent._executeMethod.bind(t,"call"),t.call.request=this.parent._executeMethod.bind(t,"call",!0),t.send=this.parent._executeMethod.bind(t,"send"),t.send.request=this.parent._executeMethod.bind(t,"send",!0),t.estimateGas=this.parent._executeMethod.bind(t,"estimate"),t.encodeABI=this.parent._encodeMethodABI.bind(t),t.arguments=arguments,t._method=this.method,t._parent=this.parent,t},l.prototype._executeMethod=function(t){vare=this,n=Array.prototype.slice.call(arguments),i=o(),s=s||{},c=null,u=null;if(t=n.shift(),r.isFunction(n[n.length-1])&&(u=n.pop()),"call"===t&&n[n.length-1]!==!0&&(r.isString(n[n.length-1])||isFinite(n[n.length-1]))&&(c=n.pop()),s=r.isObject(n[n.length-1])?n.pop():{},makeRequest=n[n.length-1]===!0?n.pop():!1,s.from=s.from||this._parent.options.from,s.data=this.encodeABI(),s.gas=s.gas||s.gasLimit,deletes.gasLimit,!r.isAddress(this._parent.address))thrownewError("This contract object doesn't have address set yet, please set an address first.");if(r.isAddress(s.from)&&(s.from=s.from.toLowerCase()),s.to=this._parent.address.toLowerCase(),!s.data)returnr._fireError(newError("Couldn't find a matching contract method, or the number of parameters is wrong."),i.promise,i.reject,u);if(makeRequest){varl={params:[a.inputCallFormatter(s),a.inputDefaultBlockNumberFormatter(c)],callback:u};return"call"===t?(l.method="eth_call",l.format=e._parent._decodeMethodReturn.bind(null,e._method.outputTypes)):l.method="eth_sendTransaction",l}varp=function(n,o){return"call"===t&&(o=e._parent._decodeMethodReturn(e._method.outputTypes,o)),n?r._fireError(n,i.promise,i.reject,u):(u&&u(null,o),i.promise.emit("data",o),"send"===t?e._parent._web3.eth.subscribe("newBlocks",{},function(t,n,s){returnt?(s.unsubscribe(),r._fireError(t,i.promise,i.reject)):voide._parent._web3.eth.getTransactionReceipt(o,function(t,e){if(t)returns.unsubscribe(),r._fireError(t,i.promise,i.reject);if(e){if(s.unsubscribe(),e.outOfGas)returnr._fireError(newError("Transaction ran out of gas."),i.promise,i.reject);i.promise.emit("mined",e),i.resolve(e),i.promise.removeAllListeners()}})}):(i.resolve(o),i.promise.removeAllListeners()),void0)};switch(t){case"estimate":this._parent._web3.eth.estimateGas(s,p);break;case"call":this._parent._web3.eth.call(s,c,p);break;case"send":this._parent._web3.eth.sendTransaction(s,p)}returni.promise},e.exports=l},{"../solidity/coder":7,"../utils/sha3":19,"../utils/utils":20,"./eventifiedPromise.js":26,"./formatters":28,"./method.js":33,"./subscription.js":43}],25:[function(t,e,n){e.exports={InvalidNumberOfParams:function(){returnnewError("Invalid number of input parameters")},InvalidConnection:function(t){returnnewError("CONNECTION ERROR: Couldn't connect to node "+t+".")},InvalidProvider:function(){returnnewError("Provider not set or invalid")},InvalidResponse:function(t){vare=t&&t.error&&t.error.message?t.error.message:"Invalid JSON RPC response: "+JSON.stringify(t);returnnewError(e)}}},{}],26:[function(t,e,n){varr=t("eventemitter3"),o=t("bluebird"),i=function(){vart,e,n=newr,i=newo(function(){t=arguments[0],e=arguments[1]});returni.emit=n.emit,i.on=n.on,i.once=n.once,i.off=n.off,i.listeners=n.listeners,i.addListener=n.addListener,i.removeListener=n.removeListener,i.removeAllListeners=n.removeAllListeners,{resolve:t,reject:e,promise:i}};e.exports=i},{bluebird:47,eventemitter3:83}],27:[function(t,e,n){varr=t("./formatters"),o=t("./../utils/utils"),i=t("./method"),s=t("./property"),a=function(t){vare=function(e){varn;e.property?(t[e.property]||(t[e.property]={}),n=t[e.property]):n=t,e.methods&&e.methods.forEach(function(e){e.attachToObject(n),e.setRequestManager(t._requestManager)}),e.properties&&e.properties.forEach(function(e){e.attachToObject(n),e.setRequestManager(t._requestManager)})};returne.formatters=r,e.utils=o,e.Method=i,e.Property=s,e};e.exports=a},{"./../utils/utils":20,"./formatters":28,"./method":33,"./property":40
this.name=t.name,this.subscribe=t.subscribe,this.unsubscribe=t.unsubscribe,this.subscriptions=t.subscriptions||{},this.requestManager=null};o.prototype.setRequestManager=function(t){this.requestManager=t},o.prototype.attachToObject=function(t){vare=this.buildCall();e.call=this.call;varn=this.name.split(".");n.length>1?(t[n[0]]=t[n[0]]||{},t[n[0]][n[1]]=e):t[n[0]]=e},o.prototype.buildCall=function(){vart=this;returnfunction(){vare=newr({subscription:t.subscriptions[arguments[0]],subscribeMethod:t.subscribe,unsubscribeMethod:t.unsubscribe,requestManager:t.requestManager});returne.subscribe.apply(e,arguments)}},e.exports=o},{"./subscription.js":43}],45:[function(t,e,n){varr=t("./iban"),o=t("../contracts/SmartExchange.json"),i=function(t,e,n,o,i){varc=newr(n);if(!c.isValid())thrownewError("invalid iban address");if(c.isDirect())returns(t,e,c.address(),o,i);if(!i){varu=t.icapNamereg().addr(c.institution());returna(t,e,u,o,c.client())}t.icapNamereg().addr(c.institution(),function(n,r){returna(t,e,r,o,c.client(),i)})},s=function(t,e,n,r,o){returnt.sendTransaction({address:n,from:e,value:r},o)},a=function(t,e,n,r,i,s){vara=o;returnt.contract(a).at(n).deposit(i,{from:e,value:r},s)};e.exports=i},{"../contracts/SmartExchange.json":3,"./iban":30}],46:[function(t,e,n){"use strict";varr=t("../utils/utils"),o=t("./errors"),i=function(t){vare=this;this.responseCallbacks={},this.notificationCallbacks=[],this.path=t,this.connection=newWebSocket(t),this.addDefaultEvents(),this.connection.onmessage=function(t){varn="string"==typeoft.data?t.data:"";e._parseResponse(n).forEach(function(t){varn=null;r.isArray(t)?t.forEach(function(t){e.responseCallbacks[t.id]&&(n=t.id)}):n=t.id,n||"eth_subscription"!==t.method?e.responseCallbacks[n]&&(e.responseCallbacks[n](null,t),deletee.responseCallbacks[n]):e.notificationCallbacks.forEach(function(e){r.isFunction(e)&&e(null,t)})})}};i.prototype.addDefaultEvents=function(){vart=this;this.connection.onerror=function(e){t._timeout()},this.connection.onclose=function(e){t._timeout();varn=t.notificationCallbacks;t.reset(),n.forEach(function(t){r.isFunction(t)&&t(e)})}},i.prototype._parseResponse=function(t){vare=this,n=[],r=t.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|");returnr.forEach(function(t){e.lastChunk&&(t=e.lastChunk+t);varr=null;try{r=JSON.parse(t)}catch(i){returne.lastChunk=t,clearTimeout(e.lastChunkTimeout),void(e.lastChunkTimeout=setTimeout(function(){throwe._timeout(),o.InvalidResponse(t)},15e3))}clearTimeout(e.lastChunkTimeout),e.lastChunk=null,r&&n.push(r)}),n},i.prototype._addResponseCallback=function(t,e){varn=t.id||t[0].id,r=t.method||t[0].method;this.responseCallbacks[n]=e,this.responseCallbacks[n].method=r},i.prototype._timeout=function(){for(vartinthis.responseCallbacks)this.responseCallbacks.hasOwnProperty(t)&&(this.responseCallbacks[t](o.InvalidConnection("on IPC")),deletethis.responseCallbacks[t])},i.prototype.isConnected=function(){console.log(this.connection)},i.prototype.send=function(t){thrownewError('You tried to send "'+t.method+'" synchronously. Synchronous requests are not supported by the Websocket provider.')},i.prototype.sendAsync=function(t,e){this.connection.send(JSON.stringify(t)),this._addResponseCallback(t,e)},i.prototype.on=function(t,e){if("function"!=typeofe)thrownewError("The second parameter callback must be a function.");switch(t){case"notification":this.notificationCallbacks.push(e);break;case"connect":this.connection.onopen=e}},i.prototype.removeListener=function(t,e){varn=this;switch(t){case"notification":this.notificationCallbacks.forEach(function(t,r){t===e&&n.notificationCallbacks.splice(r,1)})}},i.prototype.removeAllListeners=function(t){switch(t){case"notification":this.notificationCallbacks=[];break;case"connect":this.connection.onopen=null}},i.prototype.reset=function(){this._timeout(),this.notificationCallbacks=[],this.addDefaultEvents()},e.exports=i},{"../utils/utils":20,"./errors":25}],47:[function
},c.prototype._cleanup=function(){this._promise=this._generator=null},c.prototype._promiseCancelled=function(){if(!this._isResolved()){vart,n="undefined"!=typeofthis._generator["return"];if(n)this._promise._pushContext(),t=h(this._generator["return"]).call(this._generator,void0),this._promise._popContext();else{varr=newe.CancellationError("generator .return() sentinel");e.coroutine.returnSentinel=r,this._promise._attachExtraTrace(r),this._promise._pushContext(),t=h(this._generator["throw"]).call(this._generator,r),this._promise._popContext(),t===f&&t.e===r&&(t=null)}varo=this._promise;this._cleanup(),t===f?o._rejectCallback(t.e,!1):o.cancel()}},c.prototype._promiseFulfilled=function(t){this._yieldedPromise=null,this._promise._pushContext();vare=h(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)},c.prototype._promiseRejected=function(t){this._yieldedPromise=null,this._promise._attachExtraTrace(t),this._promise._pushContext();vare=h(this._generator["throw"]).call(this._generator,t);this._promise._popContext(),this._continue(e)},c.prototype._resultCancelled=function(){if(this._yieldedPromiseinstanceofe){vart=this._yieldedPromise;this._yieldedPromise=null,t.cancel()}},c.prototype.promise=function(){returnthis._promise},c.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void0,this._promiseFulfilled(void0)},c.prototype._continue=function(t){varn=this._promise;if(t===f)returnthis._cleanup(),n._rejectCallback(t.e,!1);varr=t.value;if(t.done===!0)returnthis._cleanup(),n._resolveCallback(r);vari=o(r,this._promise);if(!(iinstanceofe)&&(i=a(i,this._yieldHandlers,this._promise),null===i))returnvoidthis._promiseRejected(newl("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s",r)+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")));i=i._target();vars=i._bitField;0===(50397184&s)?(this._yieldedPromise=i,i._proxy(this,null)):0!==(33554432&s)?this._promiseFulfilled(i._value()):0!==(16777216&s)?this._promiseRejected(i._reason()):this._promiseCancelled()},e.coroutine=function(t,e){if("function"!=typeoft)thrownewl("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");varn=Object(e).yieldHandler,r=c,o=(newError).stack;returnfunction(){vare=t.apply(this,arguments),i=newr(void0,void0,n,o),s=i.promise();returni._generator=e,i._promiseFulfilled(void0),s}},e.coroutine.addYieldHandler=function(t){if("function"!=typeoft)thrownewl("expecting a function but got "+p.classString(t));d.push(t)},e.spawn=function(t){if(s.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeoft)returnn("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");varr=newc(t,this),o=r.promise();returnr._run(e.spawn),o}}},{"./errors":12,"./util":36}],17:[function(t,e,n){"use strict";e.exports=function(e,n,r,o){vari=t("./util");i.canEvaluate,i.tryCatch,i.errorObj;e.join=function(){vart,e=arguments.length-1;if(e>0&&"function"==typeofarguments[e]){t=arguments[e];varr}varo=[].slice.call(arguments);t&&o.pop();varr=newn(o).promise();returnvoid0!==t?r.spread(t):r}}},{"./util":36}],18:[function(t,e,n){"use strict";e.exports=function(e,n,r,o,i,s){functiona(t,e,n,r){this.constructor$(t),this._promise._captureStackTrace();varo=u();this._callback=null===o?e:o.bind(e),this._preservedValues=r===i?newArray(this.length()):null,this._limit=n,this._inFlight=0,this._queue=n>=1?[]:h,this._init$(void0,-2)}functionc(t,e,n,o){if("function"!=typeofe)returnr("expecting a function but got "+l.classString(e));vari="object"==typeofn&&null!==n?n.concurrency:0;returni="number"==typeofi&&isFinite(i)&&i>=1?i:0,newa(t,e,i,o).promise()}varu=e._getDomain,l=t("./util"),p=l.tryCatch,f=l.errorObj,h=[];l.inherits(a,n),a.prototype._init=function(){},a.prototype._promiseFulfilled=function(t,n){varr=this._values,i=this.length(),a=this._preservedValues,c=this._limit;if(0>n){if(n=-1*n-1,r[n]=t,c>=1&&(this._inFli
};if(o.isNode&&"undefined"==typeofMutationObserver){vars=global.setImmediate,a=process.nextTick;r=o.isRecentNode?function(t){s.call(global,t)}:function(t){a.call(process,t)}}elser="undefined"==typeofMutationObserver||"undefined"!=typeofwindow&&window.navigator&&window.navigator.standalone?"undefined"!=typeofsetImmediate?function(t){setImmediate(t)}:"undefined"!=typeofsetTimeout?function(t){setTimeout(t,0)}:i:function(){vart=document.createElement("div"),e={attributes:!0},n=!1,r=document.createElement("div"),o=newMutationObserver(function(){t.classList.toggle("foo"),n=!1});o.observe(r,e);vari=function(){n||(n=!0,r.classList.toggle("foo"))};returnfunction(n){varr=newMutationObserver(function(){r.disconnect(),n()});r.observe(t,e),i()}}();e.exports=r},{"./util":36}],30:[function(t,e,n){"use strict";e.exports=function(e,n,r){functiono(t){this.constructor$(t)}vari=e.PromiseInspection,s=t("./util");s.inherits(o,n),o.prototype._promiseResolved=function(t,e){this._values[t]=e;varn=++this._totalResolved;returnn>=this._length?(this._resolve(this._values),!0):!1},o.prototype._promiseFulfilled=function(t,e){varn=newi;returnn._bitField=33554432,n._settledValueField=t,this._promiseResolved(e,n)},o.prototype._promiseRejected=function(t,e){varn=newi;returnn._bitField=16777216,n._settledValueField=t,this._promiseResolved(e,n)},e.settle=function(t){returnr.deprecated(".settle()",".reflect()"),newo(t).promise()},e.prototype.settle=function(){returne.settle(this)}}},{"./util":36}],31:[function(t,e,n){"use strict";e.exports=function(e,n,r){functiono(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}functioni(t,e){if((0|e)!==e||0>e)returnr("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");varn=newo(t),i=n.promise();returnn.setHowMany(e),n.init(),i}vars=t("./util"),a=t("./errors").RangeError,c=t("./errors").AggregateError,u=s.isArray,l={};s.inherits(o,n),o.prototype._init=function(){if(this._initialized){if(0===this._howMany)returnvoidthis._resolve([]);this._init$(void0,-5);vart=u(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},o.prototype.init=function(){this._initialized=!0,this._init()},o.prototype.setUnwrap=function(){this._unwrap=!0},o.prototype.howMany=function(){returnthis._howMany},o.prototype.setHowMany=function(t){this._howMany=t},o.prototype._promiseFulfilled=function(t){returnthis._addFulfilled(t),this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0):!1},o.prototype._promiseRejected=function(t){returnthis._addRejected(t),this._checkOutcome()},o.prototype._promiseCancelled=function(){returnthis._valuesinstanceofe||null==this._values?this._cancel():(this._addRejected(l),this._checkOutcome())},o.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(vart=newc,e=this.length();e<this._values.length;++e)this._values[e]!==l&&t.push(this._values[e]);returnt.length>0?this._reject(t):this._cancel(),!0}return!1},o.prototype._fulfilled=function(){returnthis._totalResolved},o.prototype._rejected=function(){returnthis._values.length-this.length()},o.prototype._addRejected=function(t){this._values.push(t)},o.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},o.prototype._canPossiblyFulfill=function(){returnthis.length()-this._rejected()},o.prototype._getRangeError=function(t){vare="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";returnnewa(e)},o.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){returni(t,e)},e.prototype.some=function(t){returni(this,t)},e._SomePromiseArray=o}},{"./errors":12,"./util":36}],32:[function(t,e,n){"use strict";e.exports=function(t){functione(t){void0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void0):(this._bitField=0,this._se