PageSourceSearch

https://www.tapbit.com/_next_app/price/0.1.227/_next/static/chunks/9429.c44c3c5b3bff1648.js

js tapbit.com collected 2026-10-03 21:42:56 UTC 10,797 bytes, 1 lines download raw bytes

1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},r=(new e.Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="07422e43-1bb0-4be6-bb65-083afb6f78cc",e._sentryDebugIdIdentifier="sentry-dbid-07422e43-1bb0-4be6-bb65-083afb6f78cc")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9429],{49429:(e,r,o)=>{o.d(r,{X:()=>M});var t=o(3529),i=o(88518),a=o(95696),n=o(41809),s=o(3030),l=o(70464),c=o(69770),g=o(10522);let d=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"crossed";return{symbol:e,direction:"openLong",marginMode:r,targetType:"roe",leverage:10,openPrice:"",closePrice:"",quantity:"",balance:"",profit:"",roe:""}},u=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"crossed";return{profit:d(e,r),targetPrice:d(e,r),liquidationPrice:d(e,r)}},m=e=>e.endsWith("-SWAP")?e:(0,t.Qx)(e,"-");function p(e){return"separated"===e||"merged"===e?e:"merged"}function v(e){if(e&&"object"==typeof e){var r,o,t;return{success:!1,errorCode:Number((null==(r=e.data)?void 0:r.code)||0)||void 0,errorMessage:(null==(o=e.getResponseMessage)?void 0:o.call(e))||(null==(t=e.data)?void 0:t.message)}}return{success:!1}}let y={differenceDirection:void 0,pendingSubmit:null,neverRemind:!1,estLiqPrice:""},M=(0,n.v)((e,r)=>({...y,settingsLoading:!1,settingsSaving:!1,settingsError:void 0,settingsCurrentMode:void 0,settingsCurrentPositionMode:void 0,settingsMarginDisabled:!1,calculatorLoading:!1,calculatorError:void 0,calculatorTab:"profit",calculatorForms:u("BTC-USDT"),calculatorForm:d("BTC-USDT"),calculatorResult:void 0,loadSettings:async(r,o)=>{e({settingsLoading:!0,settingsError:void 0});
1try{let t=m(o),i=(await (0,a.TP)({locale:r,params:{symbol:t}})).data||{};!function(e){let r={marginMode:e.marginMode||e.marginModeSetting||"crossed",positionMode:p(e.positionMode||e.positionModeSetting),longLeverage:Number(e.curLongLeverage||e.curLeverage||10),shortLeverage:Number(e.curShortLeverage||e.curLeverage||10)};(0,c.fD)({...r,symbol:e.symbol})}({...i,symbol:t}),e({settingsLoading:!1,settingsCurrentMode:i.marginMode,settingsCurrentPositionMode:p(i.positionMode||i.positionModeSetting),settingsMarginDisabled:!!i.marginMode})}catch(r){e({settingsLoading:!1,settingsError:r instanceof Error?r.message:"Failed to load settings"})}},saveSettings:async(o,t,i)=>{e({settingsSaving:!0,settingsError:void 0});let n=g.Mr.getState().form,s=p(n.positionMode),l=r().settingsCurrentMode,d=!1;try{let r=m(t);return await (0,a.YF)({locale:o,params:{symbol:r,marginMode:i.marginMode,positionMode:s}}),d=!0,g.Mr.setState(e=>({form:{...e.form,marginMode:i.marginMode,positionMode:s}})),e({settingsCurrentMode:i.marginMode}),await (0,a.YF)({locale:o,params:{symbol
1:r,leverageLong:i.longLeverage,leverageShort:i.shortLeverage}}),(0,c.fD)({...i,positionMode:s,symbol:r}),e({settingsSaving:!1}),{success:!0}}catch(o){g.Mr.setState(e=>({form:{...e.form,marginMode:d?i.marginMode:n.marginMode,positionMode:s,longLeverage:n.longLeverage,shortLeverage:n.shortLeverage}})),e({settingsCurrentMode:d?i.marginMode:l});let r=v(o);return e({settingsSaving:!1,settingsError:r.errorMessage||(o instanceof Error?o.message:"Failed to save settings")}),{success:!1,errorCode:r.errorCode,errorMessage:r.errorMessage}}},setCalculatorTab:r=>e(e=>{let o=e.calculatorForms[r];return e.calculatorTab===r&&e.calculatorForm===o&&void 0===e.calculatorResult&&void 0===e.calculatorError?e:{calculatorTab:r,calculatorForm:o,calculatorResult:void 0,calculatorError:void 0}}),updateCalculatorForm:r=>e(e=>{let o=e.calculatorTab,t={...e.calculatorForm,...r},i={...e.calculatorForms,[o]:t};return(void 0!==r.symbol&&Object.keys(i).forEach(e=>{i[e]={...i[e],symbol:r.symbol}}),Object.keys(r).some(r=>e.calculatorForm[r]!==t[r])||void 0!==e.calculatorResult||void 0!==e.calculatorError)?{calculatorForms:i,calculatorForm:t,calculatorResult:void 0,calculatorError:void 0}:e}),initializeCalculatorForm:function(r){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"crossed";return e(e=>{let t=u(r,o),i=t.profit;return e.calculatorForm.symbol===r&&e.calculatorForm.marginMode===o&&"profit"===e.calculatorTab&&JSON.stringify(e.calculatorForms)===JSON.stringify(t)&&void 0===e.calculatorResult&&void 0===e.calculatorError?e:{calculatorForms:t,calculatorForm:i,calculatorTab:"profit",calculatorResult:void 0,calculatorError:void 0}})},calculate:async(o,t)=>{e({calculatorLoading:!0,calculatorError:void 0});try{let a,{contract:n,tradeUnit:s}=t,c=r().calculatorForm,g=m(c.symbol),d=(0,l.DG)({quantity:Number(c.quantity||0),tradeUnit:s,multiplier:Number((null==n?void 0:n.multiplier)||0),price:Number(c.openPrice||0)});a="profit"===r().calculatorTab?await (0,i.LE)({locale:o,params:{symbol
1:g,direction:c.direction,leverage:c.leverage,openPrice:c.openPrice,closePrice:c.closePrice,quantity:d}}):"targetPrice"===r().calculatorTab?"roe"===c.targetType?await (0,i.Z2)({locale:o,params:{symbol:g,direction:c.direction,leverage:c.leverage,openPrice:c.openPrice,roe:c.roe}}):await (0,i.Tc)({locale:o,params:{symbol:g,direction:c.direction,leverage:c.leverage,openPrice:c.openPrice,quantity:d,profit:c.profit}}):await (0,i.Ds)({locale:o,params:{symbol:g,direction:c.direction,marginMode:c.marginMode,leverage:c.leverage,openPrice:c.openPrice,quantity:d,balance:c.balance}}),e({calculatorLoading:!1,calculatorResult:a.data||{}})}catch(r){e({calculatorLoading:!1,calculatorError:r instanceof Error?r.message:"Failed to calculate"})}},submitOpenOrder:async(e,r,o)=>{let t=g.Mr.getState().form,i="openLong"===o.direction?t.longLeverage:t.shortLeverage,n=m(r),l=p(o.positionMode||t.positionMode);try{var c,d;if("planLimit"===t.orderType||"planMarket"===t.orderType){let r=t.orderType,g=await (0,s.p)("order_open",()=>{var s,c,g,d;
1return(0,a.lb)({locale:e,params:{symbol:n,direction:o.direction,orderType:r,triggerPrice:null!=(s=o.triggerPrice)?s:t.triggerPrice,orderPrice:null!=(c=o.orderPrice)?c:t.orderPrice,quantity:o.quantity,percentage:t.percentage,isPercentage:t.isPercentage,leverage:i,marginMode:t.marginMode,positionMode:l,triggerWay:t.triggerWay,takeProfitPrice:null!=(g=o.takeProfitPrice)?g:t.takeProfitPrice,stopLosePrice:null!=(d=o.stopLosePrice)?d:t.stopLossPrice,tpOrderPrice:t.tpOrderPrice,slOrderPrice:t.slOrderPrice,tpTriggerWay:t.tpTriggerWay,slTriggerWay:t.slTriggerWay}})});return{success:!0,orderId:null==(c=g.data)?void 0:c.orderId}}{let r=t.orderType,c=await (0,s.p)("order_open",()=>{var s,c,g;return(0,a.gA)({locale:e,params:{symbol:n,direction:o.direction,orderType:"postOnly"===r?"postOnly":r,orderPrice:null!=(s=o.orderPrice)?s:t.orderPrice,quantity:o.quantity,percentage:t.percentage,isPercentage:t.isPercentage,leverage:i,marginMode:t.marginMode,positionMode:l,takeProfitPrice:null!=(c=o.takeProfitPrice)?c:t.takeProfitPrice,stopLosePrice:null!=(g=o.stopLosePrice)?g:t.stopLossPrice,tpOrderPrice:t.tpOrderPrice,slOrderPrice:t.slOrderPrice,tpTriggerWay:t.tpTriggerWay,slTriggerWay:t.slTriggerWay}})});return{success:!0,orderId:null==(d=c.data)?void 0:d.orderId}}}catch(e){return v(e)}},submitCloseOrder:async(e,r,o)=>{let t=g.Mr.getState().form,i=m(r);try{var n;let r=await (0,s.p)("order_close",()=>{var r;
1return(0,a.gq)({locale:e,params:{symbol:i,direction:o.direction,orderType:"postOnly"===t.orderType?"postOnly":"market"===t.orderType?"market":"limit",orderPrice:null!=(r=o.orderPrice)?r:t.orderPrice,quantity:o.quantity,marginMode:t.marginMode}})});return{success:!0,orderId:null==(n=r.data)?void 0:n.orderId}}catch(e){return v(e)}},estimateLiqPrice:async(e,r,o)=>{let t=g.Mr.getState().form,i="openLong"===o.direction?t.longLeverage:t.shortLeverage,n=p(o.positionMode||t.positionMode);try{var s,l,c;let g=await (0,a.rW)({locale:e,params:{symbol:m(r),orderType:t.orderType,triggerWay:t.triggerWay,tpTriggerWay:t.tpTriggerWay,slTriggerWay:t.slTriggerWay,direction:o.direction,triggerPrice:null!=(l=o.triggerPrice)?l:t.triggerPrice,orderPrice:"market"===t.orderType||"planMarket"===t.orderType?"":null!=(c=o.orderPrice)?c:t.orderPrice,quantity:o.quantity,percentage:t.percentage,isPercentage:t.isPercentage,leverage:i,longLeverage:t.longLeverage,shortLeverage:t.shortLeverage,marginMode:t.marginMode,positionMode:n,takeProfitPrice:t.takeProfitPrice,stopLosePrice:t.stopLossPrice,tpOrderPrice:t.tpOrderPrice,slOrderPrice:t.slOrderPrice}});return String((null==(s=g.data)?void 0:s.liqPrice)||"")}catch(e){return}},setDifferenceDirection:r=>e({differenceDirection:r}),setPendingSubmit:r=>e({pendingSubmit:r}),setNeverRemind:r=>e({neverRemind:r}),setEstLiqPrice:r=>e({estLiqPrice:r}),resetSubmitFlow:()=>e(y)}))},69770:(e,r,o)=>{o.d(r,{VY:()=>m,ZM:()=>s,dH:()=>g,fD:()=>u});var t=o(20449),i=o(41809),a=o(10522),n=o(77962);let s=(0,i.v)(e=>({currentLeverage:null,currentLeverageSymbol:void 0,setCurrentLeverage:(r,o)=>e({currentLeverage:r,currentLeverageSymbol:o}),resetCurrentLeverage:()=>e({currentLeverage:null,currentLeverageSymbol:void 0})}));function l(e){let r=Number(e);return Number.isFinite(r)&&r>0?r:void 0}function c(e,r,o){if(o){t.$3.setCurrent(e,o),t.$3.setLongLeverage(e,o),t.$3.setShortLeverage(r,o);return}t.$3.setCurrent(e),t.$3.setLongLeverage(e),t.$3.setShortLeverage(r)}function g(e){return{...e.current||{},...e.marginMode?{marginMode:e.marginMode,marginModeSetting:e.marginMode}:{},...e.positionMode?{positionMode:e.positionMode,positionModeSetting:e.positionMode}:{},curLeverage:Math.min(e.longLeverage,e.shortLeverage),curLongLeverage:e.longLeverage,curShortLeverage:e.shortLeverage}}function d(e){let{currentLeverage:r,setCurrentLeverage:o}=s.getState();o(g({...e,current:r||{}}),e.symbol)}function u(e){let r=l(e.longLeverage),o=l(e.shortLeverage),t=function(e){let r=[l(e.longLeverage),l(e.shortLeverage)].filter(e=>void 0!==e);if(r.length)return function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20;return Math.max(1,Math.min(e,r))}(Math.min(...r),e.maxGridLeverage)}(e);r&&o&&(a.Mr.setState(t=>({form:{...t.form,...e.marginMode?{marginMode:e.marginMode}:{},...e.positionMode?{positionMode:e.positionMode}:{},longLeverage:r,shortLeverage:o}})),!1!==e.persist&&c(r,o,e.symbol),d({longLeverage:r,shortLeverage:o,marginMode:e.marginMode,positionMode:e.positionMode,symbol:e.symbol})),t&&n.N.setState(e=>e.form.leverage===t?e:{form:{...e.form,leverage:t}})}function m(e){let r=l(e.leverage);r&&(n.N.setState(e=>e.form.leverage===r?e:{form:{...e.form,leverage:r}}),a.Mr.setState(o=>({form:{...o.form,...e.marginMode?{marginMode:e.marginMode}:{},...e.positionMode?{positionMode:e.positionMode}:{},longLeverage:r,shortLeverage:r}})),!1!==e.persist&&c(r,r,e.symbol),d({longLeverage:r,shortLeverage:r,marginMode:e.marginMode,positionMode:e.positionMode,symbol:e.symbol}))}}}]);

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.