-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuickTrade.eef46c332ad10fadb218.js
2 lines (2 loc) · 39.7 KB
/
QuickTrade.eef46c332ad10fadb218.js
1
2
(this.webpackJsonp=this.webpackJsonp||[]).push([[24],{1993:function(e,t,n){"use strict";var r=n(86),s=n(71),a=function(){return s.a.Date.now()},i=n(604),o="Expected a function",l=Math.max,c=Math.min;t.a=function(e,t,n){var s,u,p,h,f,v,m=0,d=!1,g=!1,A=!0;if("function"!=typeof e)throw new TypeError(o);function y(t){var n=s,r=u;return s=u=void 0,m=t,h=e.apply(r,n)}function b(e){var n=e-v;return void 0===v||n>=t||n<0||g&&e-m>=p}function _(){var e=a();if(b(e))return k(e);f=setTimeout(_,function(e){var n=t-(e-v);return g?c(n,p-(e-m)):n}(e))}function k(e){return f=void 0,A&&s?y(e):(s=u=void 0,h)}function w(){var e=a(),n=b(e);if(s=arguments,u=this,v=e,n){if(void 0===f)return function(e){return m=e,f=setTimeout(_,t),d?y(e):h}(v);if(g)return f=setTimeout(_,t),y(v)}return void 0===f&&(f=setTimeout(_,t)),h}return t=Object(i.a)(t)||0,Object(r.a)(n)&&(d=!!n.leading,p=(g="maxWait"in n)?l(Object(i.a)(n.maxWait)||0,t):p,A="trailing"in n?!!n.trailing:A),w.cancel=function(){void 0!==f&&clearTimeout(f),m=0,s=v=u=f=void 0},w.flush=function(){return void 0===f?h:k(a())},w}},1997:function(e,t,n){"use strict";n.d(t,"b",function(){return f}),n.d(t,"a",function(){return v});var r=n(0),s=n.n(r),a=n(44),i=n(592),o=n.n(i),l=n(47),c=n(30),u=n(23),p=n(41),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var f=function(e){return!!e&&!!e.get("id")},v=function(e){var t,n,r=(n=t=function(t){function n(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,s.a.Component),h(n,[{key:"render",value:function(){return f(this.props.currentAccount)?s.a.createElement(e,this.props):s.a.createElement(p.a,null)}}]),n}(),t.propTypes={currentAccount:a.a.ChainAccount},t.defaultProps={autosubscribe:!0},n);return r=Object(l.a)(r),r=o()(r,100,{leading:!1}),Object(c.a)(r,{listenTo:function(){return[u.a]},getProps:function(){var e=u.a.getState().currentAccount||u.a.getState().passwordAccount||"please-login";return{currentAccount:new Map([["name",e]])}}})}},2033:function(e,t,n){"use strict";n.d(t,"c",function(){return i}),n.d(t,"a",function(){return o}),n.d(t,"b",function(){return c});var r=n(106),s=n(6),a=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,s=!1,a=void 0;try{for(var i,o=e[Symbol.iterator]();!(r=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){s=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(s)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();function i(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments[2],r=arguments[3];if(e||""===e){var s=e.toUpperCase();s.startsWith("BIT")&&s.length>=6&&(s=e.substr(3,s.length-1)),n(s,10,t),r({lookupQuote:s})}}function o(e,t,n,s){var i=e.searchAssets,o=e.marketPickerAsset,u=e.baseAsset,p=e.quoteAsset,h=t.inputValue,f=t.lookupQuote;n({activeSearch:!0});var v=0,m=[],d=u.get("symbol"),g=p.get("symbol");i.size&&h&&h.length>2&&i.filter(function(e){try{if(e.options.description){var t=JSON.parse(e.options.description);if("visible"in t&&!t.visible)return!1}}catch(e){}return-1!==e.symbol.indexOf(f)}).forEach(function(e){if(!(v>100)){v++;var t=c(e.issuer),n=u.get("symbol"),r=e.symbol+"_"+n,s=g==o;(s&&e.symbol!=d||!s&&e.symbol!=g)&&m.push([r,{quote:e.symbol,base:n,issuerId:e.issuer,issuer:t}])}}),s(function(e,t){t.startsWith("BIT")&&t.length>=6&&(t=t.substr(3,t.length-1));return e.sort(function(e,n){var s=a(e,2),i=s[1],o=a(n,2),c=o[1],u=l(i),p=l(c);if(u.asset!==p.asset){if(u.asset===t)return-1;if(p.asset===t)return 1;if(u.asset>p.asset)return-1;if(u.asset<p.asset)return 1}if(u.isCommittee^p.isCommittee){if(u.isCommittee)return-1;if(p.isCommittee)return 1}var h=Object(r.f)(i.quote),f=Object(r.f)(c.quote);return h&&!f?-1:f&&!h?1:u.gateway>p.gateway?1:u.gateway<p.gateway?-1:0})}(m,h))}function l(e){var t={},n=e.quote;if(-1!==n.indexOf(".")){var r=n.split("."),s=a(r,2),i=s[0],o=s[1];t.gateway=i,t.asset=o}else t.asset=n;return"1.2.0"===e.issuerId&&(t.isCommittee=!0),t}function c(e){var t=s.ChainStore.getObject(e,!1,!1);return t?t.get("name"):void 0}},2256:function(e,t,n){"use strict";n.r(t);var r=n(0),s=n.n(r),a=n(600),i=n(1993),o=n(1997),l=n(30),c=n(595),u=n(196),p=n(4),h=n(2),f=n.n(h),v=n(1),m=n.n(v),d=n(593),g=n(5),A=n.n(g),y=n(9),b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var k=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,s.a.Component),_(t,[{key:"render",value:function(){var e=this.props,t=e.chains,n=e.selectStyle,r=e.style,a=e.placeholder,i=e.value,o=e.onDropdownVisibleChange,l=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["chains","selectStyle","style","placeholder","value","onDropdownVisibleChange"]),c=t.filter(y.Map.isMap).length<=1&&!o;i||(i=t[0]);var u=s.a.createElement(p.Select,b({onDropdownVisibleChange:o,showArrow:!c&&void 0,style:n,placeholder:s.a.createElement(f.a,{content:a||"utility.asset_select_placeholder"}),value:i},l,{optionFilterProp:"children",filterOption:function(e,t){return t.key.toLowerCase().indexOf(e.toLowerCase())>=0},disabled:c,notFoundContent:A.a.translate("global.not_found")}),t.filter(y.Map.isMap).map(function(e){return s.a.createElement(p.Select.Option,{key:e,value:e},e)}));return s.a.createElement("div",{className:"chain-select",style:r},u)}}]),t}();k.propTypes={chains:m.a.array,placeholder:m.a.string,style:m.a.object,selectStyle:m.a.object},k.defaultProps={chains:["BitShares Blockchain"],placeholder:null,style:{},selectStyle:{}};var w=k,S=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var I=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={imageError:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,s.a.Component),S(t,[{key:"componentDidUpdate",value:function(e,t){this.props.imgName&&this.props.imgName!==e.imgName&&"unknown"!==this.props.imgName&&this.setState({imageError:!1})}},{key:"onImageError",value:function(){this.setState({imageError:!0})}},{key:"render",value:function(){var e=this.props,t=e.label,n=(e.assetInput,e.asset),r=e.assets,a=e.amount,i=(e.onAssetInputChange,e.onSearch),o=e.onAmountChange,l=e.imgName,c=(e.placeholder,e.placeholderAmount),u=e.tooltipText;this.state.imageError&&(l="unknown");var h=s.a.createElement(f.a,{className:"left-label",component:"label",content:t,style:{fontSize:"1.2rem",margin:"0",padding:"0"}}),v=s.a.createElement(w,null),m=s.a.createElement("img",{style:{width:"3.5rem",height:"3.5rem",marginTop:"0.5rem"},onError:this.onImageError.bind(this),src:"/asset-symbols/"+l.toLowerCase()+".png"}),g=s.a.createElement(d.a,{onChange:o,amount:a,asset:n,assets:r,placeholder:c,onSearch:i});return s.a.createElement("div",{className:"amount-selector-2",style:{minWidth:"3.5rem",width:"100%"}},h,s.a.createElement(p.Row,{style:{minWidth:"18rem"}},s.a.createElement(p.Col,{style:{minWidth:"3.5rem"},span:5},m),s.a.createElement(p.Col,{span:19},s.a.createElement(p.Tooltip,{placement:"top",title:u},v),g)))}}]),t}();I.propTypes={label:m.a.string,assetInput:m.a.string,asset:m.a.string,assets:m.a.array,amount:m.a.string,disabled:m.a.bool,onAssetInputChange:m.a.func,onAmountChange:m.a.func,onImageError:m.a.func,onSearch:m.a.func,imgName:m.a.string,placeholderAmount:m.a.string,placeholder:m.a.string},I.defaultProps={disabled:!1,imgName:"unknown",placeholderAmount:"0.0",placeholder:""};var E=I,O=n(34),C=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var P=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["Component"]),C(t,[{key:"render",value:function(){var e=window.innerWidth<850,t=this.props,n=t.sellAssetInput,r=t.sellAsset,a=t.sellAssets,i=t.sellAmount,o=t.sellImgName,l=t.receiveAssetInput,c=t.receiveAsset,u=t.receiveAssets,h=t.receiveAmount,f=t.receiveImgName,v=t.onSellAssetInputChange,m=t.onSellAmountChange,d=t.onReceiveAssetInputChange,g=t.onReceiveAmountChange,A=t.onReceiveAssetSearch,y=t.onSwap,b=t.isSwappable,_=s.a.createElement(E,{label:"exchange.sell",assetInput:n,asset:r,assets:a,amount:i,onAssetInputChange:v,onAmountChange:m,imgName:o,placeholder:"exchange.quick_trade_details.placeholder_sell"}),k=s.a.createElement(E,{label:"exchange.receive",assetInput:l,asset:c,assets:u,amount:h,onAssetInputChange:d,onSearch:A,onAmountChange:g,imgName:f,placeholder:"exchange.quick_trade_details.placeholder_receive"}),w={align:"center",display:"flex",justifyContent:"center"};b||(w.opacity=.1);var S=s.a.createElement("div",{style:w},s.a.createElement(O.a,{name:"swap",size:"2x",style:e?null:{marginTop:"3rem"},onClick:y}));return s.a.createElement("div",null,e?s.a.createElement("div",null,s.a.createElement(p.Row,null,_),s.a.createElement(p.Row,null,S),s.a.createElement(p.Row,null,k)):s.a.createElement(p.Row,null,s.a.createElement(p.Col,{span:10},_),s.a.createElement(p.Col,{span:4},S),s.a.createElement(p.Col,{span:10},k)))}}]),t}();P.propTypes={sellAssetInput:m.a.string,sellAsset:m.a.string,sellAssets:m.a.array,sellAmount:m.a.string,sellImgName:m.a.string,receiveAssetInput:m.a.string,receiveAsset:m.a.string,receiveAssets:m.a.array,receiveAmount:m.a.string,receiveImgName:m.a.string,onSellAssetInputChange:m.a.func.isRequired,onSellAmountChange:m.a.func.isRequired,onReceiveAssetInputChange:m.a.func.isRequired,onReceiveAmountChange:m.a.func.isRequired,onSwap:m.a.func.isRequired,isSwappable:m.a.bool};var T=P,x=n(82),R=n(16),M=n(6),j=n(210),F=function(){var e=q(regeneratorRuntime.mark(function e(t,n,r){var s,a,i,o,l;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=t.getIn(["options","market_fee_percent"])/100+"%",a=n.getIn(["options","market_fee_percent"])/100+"%",i=t.getIn(["options","market_fee_percent"]),o=n.getIn(["options","market_fee_percent"]),e.next=6,D([t,n],r);case 6:return l=e.sent,e.abrupt("return",{marketFee:{baseMarketFeePercent:s,quoteMarketFeePercent:a,baseMarketFee:i,quoteMarketFee:o},transactionFee:l});case 8:case"end":return e.stop()}},e,this)}));return function(t,n,r){return e.apply(this,arguments)}}(),D=function(){var e=q(regeneratorRuntime.mark(function e(){var t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],s=arguments[1];return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t={},n=[],r.forEach(function(e){n.push(Object(j.b)({accountID:s.get("id"),feeID:e.get("id"),type:"limit_order_create"}))}),e.abrupt("return",Promise.all(n).then(function(e){return r.forEach(function(n,r){t[n.get("id")]=e[r]}),t}).catch(function(e){return console.error("checkFeeStatusAsync error",e),t}));case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}();function q(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function r(s,a){try{var i=t[s](a),o=i.value}catch(e){return void n(e)}if(!i.done)return Promise.resolve(o).then(function(e){r("next",e)},function(e){r("throw",e)});e(o)}("next")})}}function N(e,t,n){var r=[],s=void 0;t.sort(function(e,t){return t.getPrice()-e.getPrice()});for(var a=0;a<t.length;a++)if(r.length){if(r.forEach(function(e){var t=e.order;s="receive"===n?t.total_for_sale.getAmount():t.total_to_receive.getAmount()}),s>=e)break;r.push({order:t[a],amount:t[a].amountToReceive().amount,total_amount:t[a].total_to_receive.amount,price:t[a].getPrice()})}else r.push({order:t[a],amount:t[a].amountToReceive().amount,total_amount:t[a].total_to_receive.amount,price:t[a].getPrice()});return r}function L(e){var t=[];if(!e||!e.get("balances"))return t;var n=e.get("balances").toJS();for(var r in t=Object.keys(n).sort(R.a.sortID),n){var s=M.ChainStore.getObject(n[r]);s&&0===s.get("balance")&&t.splice(t.indexOf(r),1)}return t}var U=n(474),V=n(2033),B=n(126),W=n(40),z=n(134),J=n(97),G=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,s=!1,a=void 0;try{for(var i,o=e[Symbol.iterator]();!(r=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){s=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(s)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Q=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function Y(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){return function r(s,a){try{var i=t[s](a),o=i.value}catch(e){return void n(e)}if(!i.done)return Promise.resolve(o).then(function(e){r("next",e)},function(e){r("throw",e)});e(o)}("next")})}}var K=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),r=L(e.currentAccount);return n.state={mounted:!1,sub:"",sellAssetInput:"",sellAsset:null,sellAssets:r,sellAmount:"",sellImgName:"unknown",receiveAssetInput:"",receiveAsset:null,receiveAssets:r,receiveAmount:"",receiveImgName:"unknown",activeInput:"",activeAmountInput:"",lookupQuote:"",orders:[],orderView:"amount",fees:null,prices:null,isSubscribedToMarket:!0},n.onSellAssetInputChange=n.onSellAssetInputChange.bind(n),n.onReceiveAssetInputChange=n.onReceiveAssetInputChange.bind(n),n.onSellAmountChange=n.onSellAmountChange.bind(n),n.onReceiveAmountChange=n.onReceiveAmountChange.bind(n),n.onSellImageError=n.onSellImageError.bind(n),n.onReceiveImageError=n.onReceiveImageError.bind(n),n.onReceiveAssetSearch=n.onReceiveAssetSearch.bind(n),n.onSwap=n.onSwap.bind(n),n.handleSubscriptionToggleChange=n.handleSubscriptionToggleChange.bind(n),n.hendleOrderView=n.hendleOrderView.bind(n),n.handleSell=n.handleSell.bind(n),n._subToMarket=n._subToMarket.bind(n),n._checkAndUpdateMarketList=n._checkAndUpdateMarketList.bind(n),n.getAssetList=Object(i.a)(U.a.getAssetList.defer,150),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["Component"]),Q(t,[{key:"_routeTo",value:function(e,t){var n=e,r=t;e||(n=""),t||(r="");var s="/instant-trade/"+n+"_"+r;this.props.location.pathname!==s&&this.props.history.push(s)}},{key:"_areEqualAssets",value:function(e,t){return this._isLoadedAsset(e)&&this._isLoadedAsset(t)&&e.get("id")===t.get("id")}},{key:"_isLoadedAsset",value:function(e){return!!e&&!!e.toJS}},{key:"_areAssetsGiven",value:function(){return this._isLoadedAsset(this.props.assetToSell)&&this._isLoadedAsset(this.props.assetToReceive)}},{key:"_haveAssetsChanged",value:function(e){return this._isLoadedAsset(this.props.assetToSell)!==this._isLoadedAsset(e.assetToSell)||(this._isLoadedAsset(this.props.assetToReceive)!==this._isLoadedAsset(e.assetToReceive)||(!this._areEqualAssets(this.props.assetToSell,e.assetToSell)||!this._areEqualAssets(this.props.assetToReceive,e.assetToReceive)))}},{key:"_hasMarketChanged",value:function(e){return JSON.stringify(e.marketData)!==JSON.stringify(this.props.marketData)}},{key:"componentDidUpdate",value:function(e){var t=this;if(this._haveAssetsChanged(e)?this._assetsHaveChanged():this._hasMarketChanged(e)&&this._getOrders(),this.props.searchAssets!==e.searchAssets){this.setState({activeSearch:!0});var n=this.props.searchAssets.toArray().filter(function(e){return-1!==e.symbol.indexOf(t.state.lookupQuote)});this._checkAndUpdateMarketList(n)}if(this.props.currentAccount!==e.currentAccount){var r=L(this.props.currentAccount);this.setState({sellAssets:r,receiveAssets:r})}}},{key:"componentDidMount",value:function(){this.setState({mounted:!0}),this._areAssetsGiven()&&this._assetsHaveChanged()}},{key:"componentWillUnmount",value:function(){var e=this.state.sub,t=this.getAssetsDetails(),n=t.sellAssetId,r=t.receiveAssetId;e&&x.a.unSubscribeMarket(n,r)}},{key:"_subToMarket",value:function(){var e=Y(regeneratorRuntime.mark(function e(){var t,n,r,s,a,i,o,l,c,u,p,h,f=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.state,n=t.receiveAsset,r=t.sellAsset,s=t.sub,!n||!r){e.next=13;break}if(a=this.getAssetsDetails(),i=a.receiveAssetId,o=a.sellAssetId,l=this.props,l.bucketSize,l.currentGroupOrderLimit,!s){e.next=10;break}if(c=s.split("_"),u=H(c,2),p=u[0],h=u[1],p!==o||h!==i){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,x.a.unSubscribeMarket(p,h);case 10:return e.next=12,x.a.subscribeMarket(n,r,3600,0);case 12:this.setState({sub:o+"_"+i},function(){f.getAllPrices(),f.getAllFees()});case 13:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"getAllFees",value:function(){var e=Y(regeneratorRuntime.mark(function e(){var t,n,r,s,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.props.currentAccount,n=this.state,r=n.sellAsset,s=n.receiveAsset,!r||!s){e.next=7;break}return e.next=5,F(s,r,t);case 5:a=e.sent,this.setState({fees:a});case 7:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"getAssetsDetails",value:function(){var e=this.state,t=e.sellAsset,n=e.receiveAsset;return{sellAssetId:t?t.get("id"):null,receiveAssetId:n?n.get("id"):null,sellAssetPrecision:t?t.get("precision"):null,receiveAssetPrecision:n?n.get("precision"):null,sellAssetSymbol:t?t.get("symbol"):null,receiveAssetSymbol:n?n.get("symbol"):null}}},{key:"getAllPrices",value:function(){var e=this.props,t=function(e,t){var n=void 0;return e.size&&(n=e.take(2).first().getPrice()),{latestPrice:n||null,feedPrice:t?t.toReal():t}}(e.activeMarketHistory,e.feedPrice);this.setState({prices:t})}},{key:"_getOrders",value:function(){var e=this;if(this.state.isSubscribedToMarket){var t=this.props.marketData.combinedBids,n=this.state,r=n.sellAsset,s=n.receiveAsset,a=n.sellAmount,i=n.receiveAmount,o=n.activeInput,l=this.getAssetsDetails(),c=l.sellAssetPrecision,u=l.receiveAssetPrecision;if(t&&t.length&&r&&s)switch(o){case"receiveAsset":if(a){var p=N(a*Math.pow(10,c),t,"sell");this.setState({orders:p,ordersUpdated:new Date},function(){return e.updateReceiveAmount()})}break;case"sellAsset":if(i){var h=N(i*Math.pow(10,u),t,"receive");this.setState({orders:h,ordersUpdated:new Date},function(){return e.updateSellAmount()})}break;case"sell":if(a){var f=N(a*Math.pow(10,c),t,"sell");this.setState({orders:f,ordersUpdated:new Date},function(){return e.updateReceiveAmount()})}else this.setState({orders:[],receiveAmount:""});break;case"receive":if(i){var v=N(i*Math.pow(10,u),t,"receive");this.setState({orders:v,ordersUpdated:new Date},function(){return e.updateSellAmount()})}else this.setState({orders:[],sellAmount:""})}}else console.log(this.props.marketData)}},{key:"_assetsHaveChanged",value:function(){this._subToMarket()}},{key:"_setSellAsset",value:function(){var e=Y(regeneratorRuntime.mark(function e(t){var n,r=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"sellAsset";!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=null,"string"!=typeof t){e.next=7;break}return e.next=4,Object(M.FetchChain)("getAsset",t);case 4:n=e.sent,e.next=8;break;case 7:n=t;case 8:0,this.setState({activeInput:s},function(){r._routeTo(n.get("symbol"),r.props.assetToReceive?r.props.assetToReceive.get("symbol"):"")});case 10:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"_setReceiveAsset",value:function(){var e=Y(regeneratorRuntime.mark(function e(t){var n,r=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"receiveAsset";!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=null,"string"!=typeof t){e.next=7;break}return e.next=4,Object(M.FetchChain)("getAsset",t);case 4:n=e.sent,e.next=8;break;case 7:n=t;case 8:0,this.setState({activeInput:s},function(){r._routeTo(r.props.assetToSell?r.props.assetToSell.get("symbol"):"",n.get("symbol"))});case 10:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"_swapAssets",value:function(){var e=Y(regeneratorRuntime.mark(function e(t){var n=this;!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({sellAmount:"sellAsset"===t?"":this.state.receiveAmount,receiveAmount:"receiveAsset"===t?"":this.state.sellAmount,activeInput:t},function(){n._routeTo(n.state.receiveAsset.get("symbol"),n.state.sellAsset.get("symbol"))});case 1:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"onSellAssetInputChange",value:function(){var e=Y(regeneratorRuntime.mark(function e(t){var n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=this.getAssetsDetails(),r=n.receiveAssetId,t===r?this._swapAssets("sellAsset"):this._setSellAsset(t);case 2:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"onReceiveAssetInputChange",value:function(){var e=Y(regeneratorRuntime.mark(function e(t){var n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=this.getAssetsDetails(),r=n.sellAssetId,t===r?this._swapAssets("receiveAsset"):this._setReceiveAsset(t);case 2:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"onReceiveAssetSearch",value:function(e){var t=this;this.state.mounted&&(!M.ChainValidation.is_valid_symbol_error(e,!0)?(this.state.receiveAssetInput!==e&&this.timer&&clearTimeout(this.timer),this.timer=setTimeout(function(){Object(V.c)(e,!0,t.getAssetList,t.setState)},100)):this.setState({receiveAsset:null,receiveAssetInput:e,activeSearch:!1}))}},{key:"_checkAndUpdateMarketList",value:function(e){var t=this,n=e.map(function(e){return e.id});clearInterval(this.intervalId);var r=this.state.receiveAssetInput,s="";if(M.ChainStore.getAsset(r)){var a=M.ChainStore.getAsset(r).get("id");n.includes(a)&&(s=M.ChainStore.getAsset(r).get("id"))}if(1===n.length){s=n[0];var i=this.props.currentAccount;(n=L(i)).push(s)}if(0===n.length){var o=this.props.currentAccount;n=L(o)}this.intervalId=setInterval(function(){clearInterval(t.intervalId),t.setState({receiveAssets:n,activeSearch:!1},function(){t._subToMarket()})},100)}},{key:"onSellAmountChange",value:function(e){var t=this;this.state.mounted&&(e.asset!==this.state.sellAssetInput&&this.onSellAssetInputChange(e.asset),this.setState({sellAmount:e.amount,activeInput:"sell",activeAmountInput:"sell"},function(){t._getOrders()}))}},{key:"onReceiveAmountChange",value:function(e){var t=this;this.state.mounted&&(e.asset!==this.state.receiveAssetInput&&this.onReceiveAssetInputChange(e.asset),this.setState({receiveAmount:e.amount,activeInput:"receive",activeAmountInput:"receive"},function(){t._getOrders()}))}},{key:"onSellImageError",value:function(){this.setState({sellImgName:"unknown"})}},{key:"onReceiveImageError",value:function(){this.setState({receiveImgName:"unknown"})}},{key:"onSwap",value:function(){this.isSwappable()&&this._swapAssets("neither")}},{key:"handleSubscriptionToggleChange",value:function(){this.setState(function(e){return{isSubscribedToMarket:!e.isSubscribedToMarket}})}},{key:"hendleOrderView",value:function(){this.setState(function(e){return{orderView:"amount"===e.orderView?"total":"amount"}})}},{key:"handleSell",value:function(){var e=this.props.currentAccount,t=this.state,n=t.sellAmount,r=t.receiveAmount,s=this.getAssetsDetails(),a=s.sellAssetId,i=s.receiveAssetId,o=s.sellAssetPrecision,l=s.receiveAssetPrecision,c=new W.a({asset_id:a,precision:o,amount:n*Math.pow(10,o)}),u=new W.a({asset_id:i,precision:l,amount:r*Math.pow(10,l)}),h=new Date(Date.now()+31536e6),f=new W.h({for_sale:c,expiration:h,to_receive:u,seller:e.get("id"),fee:{asset_id:"1.3.0",amount:0},fill_or_kill:!0});return x.a.createLimitOrder2(f).then(function(e){e.error&&"wallet locked"!==e.error.message&&p.Notification.error({message:A.a.translate("notifications.exchange_unknown_error_place_order",{amount:r,symbol:i})})}).catch(function(e){console.error("order failed:",e)})}},{key:"updateSellAmount",value:function(){var e=this.state,t=e.orders,n=e.receiveAmount,r=this.getAssetsDetails(),s=r.sellAssetPrecision,a=r.receiveAssetPrecision;if(1!==t.length)if(t.length>1){var i=t.slice(-1)[0],o=t.slice(t.length-2,t.length-1)[0],l=(n*Math.pow(10,a)-o.order.total_for_sale.getAmount())/i.order.getPrice()*Math.pow(10,s)/Math.pow(10,a),c=((o.order.total_to_receive.getAmount()+l)/Math.pow(10,s)).toFixed(s);this.setState({sellAmount:c})}else;else{var u=(n/t[0].order.getPrice()).toFixed(s);this.setState({sellAmount:u})}}},{key:"updateReceiveAmount",value:function(){var e=this.state,t=e.orders,n=e.sellAmount,r=this.getAssetsDetails(),s=r.sellAssetPrecision,a=r.receiveAssetPrecision;if(1!==t.length)if(t.length>1){var i=t.slice(-1)[0],o=t.slice(t.length-2,t.length-1)[0],l=(n*Math.pow(10,s)-o.order.total_to_receive.getAmount())*i.order.getPrice()*Math.pow(10,a)/Math.pow(10,s),c=((o.order.total_for_sale.getAmount()+l)/Math.pow(10,a)).toFixed(a);this.setState({receiveAmount:c})}else;else{var u=(t[0].order.getPrice()*n).toFixed(a);this.setState({receiveAmount:u})}}},{key:"isSwappable",value:function(){return this._areAssetsGiven()}},{key:"_getTransactionFee",value:function(e){var t=this.state,n=t.fees,r=t.prices,s=this.getAssetsDetails().sellAssetId;return n&&n.transactionFee[s]?e&&e!==s?n.transactionFee[s].fee.amount/Math.pow(10,n.transactionFee[s].fee.precision)*r.latestPrice:n.transactionFee[s].fee.amount/Math.pow(10,n.transactionFee[s].fee.precision):0}},{key:"_getMarketFee",value:function(e){var t=this.state,n=t.fees,r=t.prices,s=t.receiveAmount,a=this.getAssetsDetails().receiveAssetId;return n?e&&e!==a?n.marketFee.baseMarketFee*s/r.latestPrice/1e4:n.marketFee.baseMarketFee*s/1e4:0}},{key:"_getFeePercent",value:function(e,t){return+t?(+t+ +e)/t-1:0}},{key:"getDetails",value:function(){if(this.state.sub){var e=this.state,t=e.sellAmount,n=e.receiveAmount,r=this.getAssetsDetails(),a=r.sellAssetId,i=r.receiveAssetId,o=r.sellAssetPrecision,l=r.receiveAssetPrecision,c=r.receiveAssetSymbol,u=this.getPriceSection(),h=s.a.createElement(s.a.Fragment,null,A.a.translate("exchange.quick_trade_details.effective")," ",s.a.createElement(z.a,{base_asset:a,quote_asset:i,base_amount:t*Math.pow(10,o),quote_amount:n*Math.pow(10,l),noPopOver:!0,force_direction:c,noInvertTip:!0})),f=this.getFeeSection(),v=this.getOrdersSection(),m=A.a.translate("exchange.quick_trade_details.effective")+" "+(100*this.getTotalPercentFee()).toFixed(2),d=this.state.orders.length,g=d<2?A.a.translate("exchange.quick_trade_details.order"):A.a.translate("exchange.quick_trade_details.orders");return s.a.createElement(p.Collapse,{className:"asset-collapse",style:{marginTop:"1rem"}},s.a.createElement(p.Collapse.Panel,{header:A.a.translate("exchange.price"),extra:h},u),s.a.createElement(p.Collapse.Panel,{header:A.a.translate("exchange.fee"),extra:m+"%"},f),s.a.createElement(p.Collapse.Panel,{header:A.a.translate("exchange.orders"),extra:d?d+" "+g:"no orders"},v))}}},{key:"showDetails",value:function(){var e=this.state,t=e.sellAsset,n=e.receiveAsset,r=e.sellAmount,s=e.receiveAmount;return t&&n&&+r&&+s}},{key:"showFeedPrice",value:function(){var e=this.state,t=e.sellAsset,n=e.receiveAsset,r=this.getAssetsDetails(),s=r.sellAssetId,a=r.receiveAssetId,i=n.getIn(["bitasset","options","short_backing_asset"]),o=t.getIn(["bitasset","options","short_backing_asset"]);return i===s||o===a}},{key:"getPriceSection",value:function(){var e=this.state,t=e.prices,n=e.sellAmount,r=e.receiveAmount,a=this.getAssetsDetails(),i=a.sellAssetId,o=a.receiveAssetId,l=a.sellAssetPrecision,c=a.receiveAssetPrecision,u=a.receiveAssetSymbol;return s.a.createElement(p.Row,null,s.a.createElement(p.Col,{span:12},s.a.createElement("div",null,A.a.translate("exchange.quick_trade_details.your_price")),this.showFeedPrice()&&s.a.createElement("div",null,A.a.translate("exchange.quick_trade_details.feed_price")),s.a.createElement("div",null,A.a.translate("exchange.quick_trade_details.last_price"))),s.a.createElement(p.Col,{span:12,style:{textAlign:"right"}},s.a.createElement("div",null,s.a.createElement(z.a,{base_asset:i,quote_asset:o,base_amount:n*Math.pow(10,l),quote_amount:r*Math.pow(10,c),noPopOver:!0,force_direction:u,noInvertTip:!0})),this.showFeedPrice()&&s.a.createElement("div",null,s.a.createElement(z.a,{base_asset:i,quote_asset:o,base_amount:1*Math.pow(10,l),quote_amount:t.feedPrice*Math.pow(10,c),noPopOver:!0,force_direction:u,noInvertTip:!0})),s.a.createElement("div",null,s.a.createElement(z.a,{base_asset:i,quote_asset:o,base_amount:1*Math.pow(10,l),quote_amount:t.latestPrice*Math.pow(10,c),noPopOver:!0,force_direction:u,noInvertTip:!0}))))}},{key:"getFeeSection",value:function(){var e=this.state,t=e.sellAmount,n=e.receiveAmount,r=this.getAssetsDetails(),a=r.sellAssetPrecision,i=r.receiveAssetPrecision,o=r.sellAssetSymbol,l=r.receiveAssetSymbol,c=this._getTransactionFee().toFixed(a),u=(100*this._getFeePercent(this._getTransactionFee(),t)).toFixed(2),h=this._getMarketFee().toFixed(i),f=(100*this._getFeePercent(this._getMarketFee(),n)).toFixed(2),v=this.getLiquidityPenalty(),m=H(v,2),d=m[0],g=m[1];d=d||0===d?(100*d).toFixed(2)+"%":"-",g=g||0===g?(100*g).toFixed(2)+"%":"-";var y=this.showFeedPrice()?d+" / "+g:d;return s.a.createElement(p.Row,null,s.a.createElement(p.Col,{span:12},s.a.createElement("div",null,A.a.translate("exchange.quick_trade_details.liquidity_penalty")),s.a.createElement("div",null,A.a.translate("exchange.quick_trade_details.market_fee")," "+f+"%"),s.a.createElement("div",null,A.a.translate("exchange.quick_trade_details.transaction_fee")," "+u+"%")),s.a.createElement(p.Col,{span:12,style:{textAlign:"right"}},s.a.createElement("div",null,y),s.a.createElement("div",null,h," ",s.a.createElement(J.a,{name:l,noTip:!0})),s.a.createElement("div",null,c," ",s.a.createElement(J.a,{name:o,noTip:!0}))))}},{key:"getOrdersSection",value:function(){var e=this,t=this.state,n=t.orders,r=t.orderView,a=this.getAssetsDetails(),i=a.sellAssetId,o=a.receiveAssetId,l=a.sellAssetPrecision,c=a.sellAssetSymbol,u=a.receiveAssetSymbol,h=n.map(function(t){return{key:t.order.id,id:t.order.id,seller:s.a.createElement(B.a,{account:t.order.seller}),amount:s.a.createElement("div",{onClick:e.hendleOrderView},"amount"===r?t.amount/Math.pow(10,l):t.total_amount/Math.pow(10,l)),price:t.price}}),v=s.a.createElement("span",null,"amount"===r?A.a.translate("exchange.quick_trade_details.amount"):A.a.translate("exchange.quick_trade_details.total")," (",s.a.createElement(J.a,{name:c,noTip:!0}),")"),m=s.a.createElement("span",null,A.a.translate("exchange.quick_trade_details.price")," (",s.a.createElement(z.a,{base_asset:i,quote_asset:o,noPopOver:!0,force_direction:u,noInvertTip:!0,hide_value:!0}),")"),d=[{title:A.a.translate("exchange.quick_trade_details.id"),dataIndex:"id",key:"id",width:"20%"},{title:A.a.translate("exchange.quick_trade_details.seller"),dataIndex:"seller",key:"seller",width:"20%"},{title:v,dataIndex:"amount",key:"amount",width:"30%"},{title:m,dataIndex:"price",key:"price"}];return s.a.createElement("div",null,s.a.createElement(p.Switch,{style:{marginLeft:"0px"},onChange:this.handleSubscriptionToggleChange,checked:this.state.isSubscribedToMarket}),this.state.ordersUpdated&&s.a.createElement("div",{style:{float:"right"}},A.a.localize(this.state.ordersUpdated)),s.a.createElement(f.a,{onClick:this.handleSubscriptionToggleChange,content:"exchange.quick_trade_details.subscribe_to_market",style:{marginLeft:"10px",cursor:"pointer"}}),s.a.createElement(p.Table,{columns:d,dataSource:h,style:{width:"100%",marginTop:"10px"},pagination:h.length>5&&{pageSize:5}}))}},{key:"getLiquidityPenalty",value:function(){var e=this.state,t=e.prices,n=e.sellAmount,r=e.receiveAmount/n,s=t.latestPrice,a=t.feedPrice,i=void 0,o=void 0;return r&&s&&(i=Math.max(1-r/s,1-s/r)),r&&a&&(o=Math.max(1-r/a,1-a/r)),[i,o]}},{key:"getTotalPercentFee",value:function(){var e=this.state,t=e.sellAmount,n=e.receiveAmount;return this._getFeePercent(this._getTransactionFee(),t)+this._getFeePercent(this._getMarketFee(),n)+this.getLiquidityPenalty()[0]}},{key:"hasBalance",value:function(){var e=this.state.sellAmount,t=this.props.currentAccount.get("balances").toJS(),n=this.getAssetsDetails(),r=n.sellAssetId,s=n.sellAssetPrecision;if(!t[r])return!1;var a=M.ChainStore.getObject(t[r]).get("balance"),i=this._getTransactionFee();return e*Math.pow(10,s)+i*Math.pow(10,s)<+a}},{key:"render",value:function(){var e=this.state,t=e.sellAssetInput,n=e.sellAssets,r=e.sellAmount,a=e.sellImgName,i=e.receiveAssetInput,o=e.receiveAssets,l=e.receiveAmount,c=e.receiveImgName,u=e.sub,h=this.getAssetsDetails(),f=h.sellAssetId,v=h.receiveAssetId,m=this.showDetails()?this.getDetails():null;return s.a.createElement(p.Card,{className:"quick-trade",style:{align:"center",display:"flex",justifyContent:"center",minWidth:"300px",marginTop:"1rem"}},s.a.createElement(T,{sellAssetInput:t,sellAsset:f,sellAssets:n,sellAmount:r,sellImgName:a,onSellAssetInputChange:this.onSellAssetInputChange,onSellAmountChange:this.onSellAmountChange,receiveAssetInput:i,receiveAsset:v,receiveAssets:o,receiveAmount:l,receiveImgName:c,onReceiveAssetInputChange:this.onReceiveAssetInputChange,onReceiveAmountChange:this.onReceiveAmountChange,onReceiveAssetSearch:this.onReceiveAssetSearch,onSwap:this.onSwap,isSwappable:this.isSwappable()}),m,s.a.createElement("div",{style:{marginTop:"1rem",textAlign:"center"}},s.a.createElement(p.Tooltip,{title:this.hasBalance()?null:A.a.translate("exchange.no_balance")},s.a.createElement(p.Button,{key:"sell",type:"primary",disabled:!this.showDetails()||!u||!this.hasBalance(),onClick:this.handleSell},A.a.translate("exchange.sell")))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n={};return e.assetToSell&&(n={sellAssetInput:e.assetToSell.get("id"),sellAsset:e.assetToSell,sellImgName:e.assetToSell.get("symbol")}),e.assetToReceive&&(n=G({},n,{receiveAssetInput:e.assetToReceive.get("id"),receiveAsset:e.assetToReceive,receiveImgName:e.assetToReceive.get("symbol")})),n}}]),t}();K=Object(l.a)(K,{listenTo:function(){return[c.a,u.a]},getProps:function(){return{searchAssets:c.a.getState().assets,assetsLoading:c.a.getState().assetsLoading,marketData:u.a.getState().marketData,activeMarketHistory:u.a.getState().activeMarketHistory,bucketSize:u.a.getState().bucketSize,currentGroupOrderLimit:u.a.getState().currentGroupOrderLimit,feedPrice:u.a.getState().feedPrice,marketLimitOrders:u.a.getState().marketLimitOrders}}});var X=K=Object(o.a)(K),Z=n(44),$=n(47),ee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},te=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function ne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function re(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function se(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var ae=function(e){function t(){return ne(this,t),re(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return se(t,r["Component"]),te(t,[{key:"render",value:function(){return this.props.assetToReceive.get&&this.props.assetToSell.get?s.a.createElement(X,this.props):null}}]),t}();ae.propTypes={assetToSell:Z.a.ChainAsset,assetToReceive:Z.a.ChainAsset},ae.defaultProps={assetToSell:"CNY",assetToReceive:"BTS"};var ie=Object($.a)(ae,{show_loader:!0}),oe=function(e){function t(){return ne(this,t),re(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return se(t,r["Component"]),te(t,[{key:"render",value:function(){var e=this.props.match.params.marketID?this.props.match.params.marketID.toUpperCase().split("_"):["",""];return 2==e.length&&e[0]&&e[0]===e[1]?s.a.createElement(a.a,{subtitle:"market_not_found_subtitle"}):s.a.createElement(ie,ee({},this.props,{assetToSell:e[0]||"",assetToReceive:2==e.length?e[1]:""}))}}]),t}();t.default=oe}}]);
//# sourceMappingURL=QuickTrade.js.map