PageSourceSearch

https://www.icrypex.com/6142.031a2aa79277089b.js

js icrypex.com collected 2026-10-01 15:07:32 UTC 12,959 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkicrypex=self.webpackChunkicrypex||[]).push([[6142],{22574:(D,C,o)=>{o.d(C,{R:()=>g});var f=o(15861),b=o(61356),u=o(3697),h=o(65412),m=o(54355),t=o(41571),y=o(33786),l=o(26642),r=o(81953),v=o(17630),d=o(54680),M=o(86872),E=o(50299),O=o(46632),c=o(37943),p=o(7357),_=o(36895),T=o(90433),A=o(30893),P=o(34288),S=o(18077);const U=["multiSelect"],L=["quantityInput"];function Z(a,e){if(1&a){const s=t.EpF();t.TgZ(0,"li",37),t.NdJ("click",function(){const I=t.CHM(s).$implicit,R=t.oxw(3);return t.KtG(R.selectOption(I))}),t._uU(1),t.qZA()}if(2&a){const s=e.$implicit;t.xp6(1),t.hij(" ",s.text," ")}}function x(a,e){if(1&a&&(t.TgZ(0,"div",34)(1,"ul",35),t.YNc(2,Z,2,1,"li",36),t.qZA()()),2&a){const s=t.oxw(2);t.xp6(2),t.Q6J("ngForOf",s.filteredOptions)}}function W(a,e){if(1&a){const s=t.EpF();t.TgZ(0,"div",31)(1,"button",32),t.NdJ("click",function(){t.CHM(s);const n=t.oxw();return t.KtG(n.toggleDropdown())}),t._uU(2),t.qZA(),t.YNc(3,x,3,1,"div",33),t.qZA()}if(2&a){const s=t.oxw();t.ekj("open",s.dropdownOpen),t.xp6(2),t.hij(" ",s.selectedOption.text," "),t.xp6(1),t.Q6J("ngIf",s.dropdownOpen)}}function F(a,e){if(1&a&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&a){const s=t.oxw();t.xp6(1),t.hij(" ",s.selectedOption.text," ")}}class g extends b.z{constructor(e,s,i,n,I,R,N,B,K,w,z){super(),this.data=e,this.futureService=s,this.futureStore=i,this.openPositionStore=n,this.walletStore=I,this.walletService=R,this.tickerStore=N,this.localization=B,this.toastrService=K,this.assetStore=w,this.pairStore=z,this.openPositionModel=[],this.options=[],this.filteredOptions=[],this.transferToFuture=!0,this.dropdownOpen=!1,this.selectedOption={text:"",value:null},this.available=u.D.zero(8),this.futureAvailable=u.D.zero(8),this.spotAvailable=u.D.zero(8),this.quantity=u.D.zero(8),this.precision=2}ngOnInit(){var e=this;return(0,f.Z)(function*(){e.futureWalletData=yield e.walletService.getFuture(),e.spotWallets=yield e.walletService.getSpot(),e.on(e.tickerStore.onset).subscribe(()=>e.updateSpotWallet(e.spotWallets)),e.on(e.walletStore.onset).subscribe(s=>{e.updateSpotWallet(s)}),e.on(e.tickerStore.onset).subscribe(()=>e.updateFutureWallet()),e.on(e.futureStore.onaction).subscribe(s=>{e.updateFutureWallet()}),yield e.getOpenPositions(),e.updateOptions(),e.wallet&&e.setAsset(e.wallet.assetSymbol)})()}getOpenPositions(){var e=this;return(0,f.Z)(function*(){e.openPositionModel=(yield e.futureService.getOpenPositions())||[],e.openPositionStore.setState(e.openPositionModel)})()}updateOptions(){if(this.options=[],this.filteredOptions=[],this.transferToFuture){this.options=this.generateOptionsWithFutureWallet();const e=m.U.prototype.transform("FUTURE_WALLET"),s=null===this.selectedOption.value&&this.selectedOption.text!==e,i=this.options.some(n=>n.text===this.selectedOption.text);(s||!i)&&(this.selectedOption=this.options.find(n=>null===n.value)||this.options[0]),this.filteredOptions=this.options.filter(n=>n.text!==this.selectedOption.text)}else this.selectedOption={text:m.U.prototype.transform("SPOT_WALLET"),value:null},this.filteredOptions=this.options.filter(e=>e.text!==this.selectedOption.text);this.assetDropdownOptions()}generateOptionsWithFutureWallet(){const e={text:m.U.prototype.transform("FUTURE_WALLET"),value:null};return this.openPositionModel.length>0?[...this.openPositionModel.map(s=>({text:`${s.pairSymbol} - ${s.side}`,value:s.id})),e]:[e]}selectOption(e){this.selectedOption=e,this.dropdownOpen=!1,this.updateOptions()}assetDropdownOptions(){if(this.transferToFuture){const e=new Set;let s=this.pairStore.state.filter(i=>1==i.isPerpetual);this.assetSelectItems=s.flatMap(i=>{const n=[{selected:this.wallet?.assetSymbol===i.baseAsset.symbol,text:`${i.baseAsset.symbol}<small>`,value:i.baseAsset.symbol,icon:`currency-${i.baseAsset.symbol.toLowerCase()}`}];return e.has(i.quoteAsset.symbol)||(e.add(i.quoteAsset.symbol),n.push({selected:this.wallet?.assetSymbol===i.quoteAsset.symbol,text:`${i.quoteAsset.symbol}<small>`,value:i.quoteAsset.symbol,icon:`currency-${i.quoteAsset.symbol.toLowerCase()}`})),console.log("items",n),n})}
1if(this.transferToFuture&&null!=this.selectedOption.value){let e=this.openPositionModel.filter(s=>this.selectedOption.text.includes(s.pairSymbol));console.log("selectedPair",e),this.assetSelectItems=e.flatMap(s=>[{selected:this.wallet?.assetSymbol===s.baseSymbol,text:`${s.baseSymbol}<small>`,value:s.baseSymbol,icon:`currency-${s.baseSymbol.toLowerCase()}`},{selected:this.wallet?.assetSymbol===s.quoteSymbol,text:`${s.quoteSymbol}<small>`,value:s.quoteSymbol,icon:`currency-${s.quoteSymbol.toLowerCase()}`}]),setTimeout(()=>this.setAsset(this.wallet?.assetSymbol||this.assetSelectItems[0].value),50)}}changeTransferDirection(){this.transferToFuture=!this.transferToFuture,this.updateOptions(),this.quantityInput.setValue(u.D.zero(0),!0)}toggleDropdown(){this.transferToFuture&&(this.dropdownOpen=!this.dropdownOpen)}setAsset(e){if(this.assetSelectItems&&(this.asset=this.assetSelectItems.find(s=>s.value==e),this.asset)){let s=this.assetSelectItems.find(i=>i.value==e);setTimeout(()=>this.multiSelect.toggleItem(null,s),50),this.multiSelect.updateSelectios(),this.assetChanged()}}assetChanged(){let e=this.assetSelectItems.find(s=>s.selected);e&&(this.asset=this.assetSelectItems.find(s=>s.value==e.value)),this.quantityInput.setValue(u.D.zero(0),!0)}quantityChanged(){this.quantity.dgreater(this.available)&&(this.quantity=this.available),this.quantityInput.setValue(this.quantity,!0)}useAllBalance(){this.precision=this.assetStore.state.find(e=>e.symbol==this.asset.value).displayPrecision,this.quantityInput.model=this.available.set(this.precision),this.quantityChanged()}setAvailable(){this.precision=this.assetStore.state.find(e=>e.symbol==this.asset.value).displayPrecision,this.available=1==this.transferToFuture?this.spotAvailable:this.futureAvailable}updateSpotWallet(e){if(this.asset){let s=e.find(i=>i.asset==this.asset.value);
1s&&(this.spotAvailable=s.davailable,this.setAvailable())}}updateFutureWallet(){if(this.asset){let e=this.futureWalletData.userFutureWallet.find(s=>s.assetSymbol==this.asset.value);e&&(this.futureAvailable=e.dinAvailable,this.setAvailable())}}submitTransfer(){var e=this;return(0,f.Z)(function*(){const s=e.quantity.single();0!=s?(e.process(!0),e.transferToFuture&&null!=e.selectedOption.value&&e.futureService.transferToPosition(e.selectedOption.value,e.asset.value,s).then(i=>{i.hasError?e.toastrService.error(e.localization.get("ERROR"),e.resolveApiErrorMessage(i)):e.toastrService.success(e.localization.get("SUCCESS"),e.localization.get("TRANSACTION_SUCCESS"))}),e.transferToFuture&&null==e.selectedOption.value&&e.futureService.transferToFuture(e.asset.value,s).then(i=>{i.hasError?e.toastrService.error(e.localization.get("ERROR"),e.resolveApiErrorMessage(i)):e.toastrService.success(e.localization.get("SUCCESS"),e.localization.get("TRANSACTION_SUCCESS"))}),e.transferToFuture||e.futureService.transferToSpot(e.asset.value,s).then(i=>{i.hasError?e.toastrService.error(e.localization.get("ERROR"),e.resolveApiErrorMessage(i)):e.toastrService.success(e.localization.get("SUCCESS"),e.localization.get("TRANSACTION_SUCCESS"))}),e.process(!1),e.close()):e.toastrService.warning(e.localization.get("WARNING"),e.localization.get("TRANSFER_QUANTITY_REQUIRED"))})()}resolveApiErrorMessage(e){const s=e?.content,i=e?.error;return Array.isArray(s?.errors)&&s.errors.length>0?s.errors[0]?.message||this.localization.get("TRANSACTION_FAILED"):Array.isArray(i?.errors)&&i.errors.length>0?i.errors[0]?.message||this.localization.get("TRANSACTION_FAILED"):s?.message?s.message:i?.message?i.message:this.localization.get("TRANSACTION_FAILED")}}g.\u0275fac=function(e){return new(e||g)(t.Y36(h.WI),t.Y36(y.f),t.Y36(l.H),t.Y36(r.I),t.Y36(v.a),t.Y36(d.X),t.Y36(M.E),t.Y36(E.o),t.Y36(O._),t.Y36(c.M),t.Y36(p.S))},g.\u0275cmp=t.Xpm({type:g,selectors:[["transfer-modal"]],viewQuery:function(e,s){if(1&e&&(t.Gf(U,5),t.Gf(L,5)),2&e){let i;t.iGM(i=t.CRH())&&(s.multiSelect=i.first),t.iGM(i=t.CRH())&&(s.quantityInput=i.first)}},features:[t.qOj],decls:65,vars:44,consts:[["mat-dialog-title",""],["mat-button","","mat-dialog-close","",1,"mat-dialog-close",3,"title"],[1,"icon","icon-close"],[1,"mat-dialog-overflow"],[1,"mat-dialog-form"],[1,"form","form-lg"],[1,"form-group"],[1,"tab-option"],[1,"tab-item"],[1,"tab-caption"],[1,"caption"],[1,"btn","btn-lg","btn-primary","btn-change",3,"click"],[1,"icon","icon-change"],["class","select",3,"open",4,"ngIf"],[4,"ngIf"],[1,"form-group","crypto-group"],["disallow-all","","single-select","",3,"items","selectionChanged"],["multiSelect",""],[1,"form-group","m-0"],[1,"balance"],[1,"toggle",3,"click"],[1,"icon","icon-plus"],["length","14","placeholder","0.00",3,"precision","model","modelChange","updated"],["quantityInput",""],["data-append","",1,"input-group-append"],["type","button",1,"btn","btn-icon","btn-add",3,"click"],[1,"icon","icon-add"],[1,"btn-group"],[1,"btn-item"],["mat-button","","mat-dialog-close","",1,"btn","btn-lg","btn-secondary"],["mat-button","",1,"btn","btn-lg","btn-primary",3,"click"],[1,"select"],["type","button",1,"btn","select-btn",3,"click"],["class","select-list",4,"ngIf"],[1,"select-list"],[1,"list"],[3,"click",4,"ngFor","ngForOf"],[3,"click"]],template:function(e,s){1&e&&(t.TgZ(0,"h2",0),t._uU(1),t.ALo(2,"locale"),t.TgZ(3,"button",1),t.ALo(4,"locale"),t._UZ(5,"i",2),t.qZA()(),t.TgZ(6,"mat-dialog-content",3)(7,"div",4)(8,"form",5)(9,"div",6)(10,"label"),t._uU(11),t.ALo(12,"locale"),t.qZA(),t.TgZ(13,"ul",7)(14,"li",8)(15,"div",9)(16,"label",10),t._uU(17),t.ALo(18,"locale"),t.qZA(),t._uU(19),t.ALo(20,"locale"),t.ALo(21,"locale"),t.qZA()(),t.TgZ(22,"li",8)(23,"a",11),t.NdJ("click",function(){return s.changeTransferDirection()}),t._UZ(24,"i",12),t.qZA()(),t.TgZ(25,"li",8)(26,"div",9)(27,"label",10),t._uU(28),t.ALo(29,"locale"),t.qZA(),t.YNc(30,W,4,4,"div",13),t.YNc(31,F,2,1,"span",14),t.qZA()()()(),t.TgZ(32,"div",15)(33,"label"),t._uU(34),t.ALo(35,"locale"),t.qZA(),t.TgZ(36,"multi-select",16,17),t.NdJ("selectionChanged",function(){return s.assetChanged()}),t.qZA()(),t.TgZ(38,"div",18)(39,"label"),t._uU(40),t.ALo(41,"locale"),t.TgZ(42,"span",19),t._uU(43),t.ALo(44,"locale"),t.TgZ(45,"a",20),t.NdJ("click",function(){return s.useAllBalance()}),t._UZ(46,"i",21),t.TgZ(47,"b"),t._uU(48),t.ALo(49,"currency"),t.qZA()()()(),t.TgZ(50,"numeric-input",22,23),t.
1NdJ("modelChange",function(n){return s.quantity=n})("updated",function(){return s.quantityChanged()}),t.TgZ(52,"div",24)(53,"button",25),t.NdJ("click",function(){return s.useAllBalance()}),t._UZ(54,"i",26),t.qZA()()()()()()(),t.TgZ(55,"mat-dialog-actions")(56,"ul",27)(57,"li",28)(58,"button",29),t._uU(59),t.ALo(60,"locale"),t.qZA()(),t.TgZ(61,"li",28)(62,"button",30),t.NdJ("click",function(){return s.submitTransfer()}),t._uU(63),t.ALo(64,"locale"),t.qZA()()()()),2&e&&(t.xp6(1),t.hij(" ",t.lcZ(2,17,"TRANSFER")," "),t.xp6(2),t.s9C("title",t.lcZ(4,19,"CLOSE")),t.xp6(8),t.Oqu(t.lcZ(12,21,"TRANSFER_DIRECTION")),t.xp6(6),t.hij(" ",t.lcZ(18,23,"SOURCE_WALLET"),": "),t.xp6(2),t.hij(" ",s.transferToFuture?t.lcZ(20,25,"SPOT_WALLET"):t.lcZ(21,27,"FUTURE_WALLET")," "),t.xp6(9),t.hij(" ",t.lcZ(29,29,"TARGET_WALLET"),": "),t.xp6(2),t.Q6J("ngIf",s.transferToFuture),t.xp6(1),t.Q6J("ngIf",!s.transferToFuture),t.xp6(3),t.Oqu(t.lcZ(35,31,"CRYPTOCURRENCY")),t.xp6(2),t.Q6J("items",s.assetSelectItems),t.xp6(4),t.hij(" ",t.lcZ(41,33,"QUANTITY")," "),t.xp6(3),t.hij("",t.lcZ(44,35,"USABLE"),": "),t.xp6(5),t.Oqu(t.xi3(49,37,s.available,s.precision)),t.xp6(2),t.s9C("precision",s.precision),t.Q6J("model",s.quantity),t.xp6(9),t.Oqu(t.lcZ(60,40,"CLOSE")),t.xp6(4),t.Oqu(t.lcZ(64,42,"CONFIRM")))},dependencies:[_.sg,_.O5,T._Y,T.JL,T.F,h.ZT,h.uh,h.xY,h.H8,A.O,P.A,S.H,m.U],encapsulation:2})},97644:(D,C,o)=>{o.d(C,{G:()=>t});var f=o(3697),b=o(4901),u=o(41571),h=o(86872),m=o(7357);class t{constructor(l,r){this.tickerStore=l,this.pairStore=r}isPairRunning(l){return(l||"").toUpperCase()===b.dw.RUNNING}findRunningTicker(l){let r=this.pairStore.state.find(d=>d.symbol==l);return null!=r&&this.isPairRunning(r.status)?this.tickerStore.state.find(d=>d.pairSymbol==l):null}getAssetPrice(l,r){if(l==r)return f.D.from(1);let d=this.findRunningTicker(l+r);if(d)return d.price;let E=this.findRunningTicker(r+l);if(E)return f.D.from(1,10).div(E.price,10);let O=this.pairStore.state.filter(c=>c.base==l&&this.isPairRunning(c.status));for(let c=0;c<O.length;c++){let p=O[c],_=this.findRunningTicker(p.symbol);if(!_)continue;if(p.quote==r&&!_.price.isZero())return _.price;let A=this.findRunningTicker(p.quote+r);if(_&&A)return _.price.mul(A.bid,10);{let S=this.findRunningTicker(r+p.quote);if(_&&S)return _.price.div(S.price,8)}}if("ICPX"!=l&&"ICPX"!=r){let c=this.findRunningTicker(l+"ICPX");if(c){let p=this.getAssetPrice("ICPX",r);if(!p.isZero())return c.price.mul(p,10)}}return f.D.from(0)}}t.\u0275fac=function(l){return new(l||t)(u.LFG(h.E),u.LFG(m.S))},t.\u0275prov=u.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.