1"use strict";(self.webpackChunkremit2any=self.webpackChunkremit2any||[]).push([[8717],{48717:(Y,E,c)=>{c.d(E,{u:()=>et});var A=c(10467),v=c(21626),d=c(45312),G=c(86739),D=c(75463);class N{}var X=c(34282),U=c(57900),y=c(10267),K=c(47532),g=c(23432);const u=new y.Vy(K.r),b={},I=g.gH.from(0),O=g.gH.from(-1);function P(s,r,t,e){const n={fault:r,operation:t};return void 0!==e&&(n.value=e),u.throwError(s,y.Vy.errors.NUMERIC_FAULT,n)}let T="0";for(;T.length<256;)T+=T;function F(s){if("number"!=typeof s)try{s=g.gH.from(s).toNumber()}catch{}return"number"==typeof s&&s>=0&&s<=256&&!(s%1)?"1"+T.substring(0,s):u.throwArgumentError("invalid decimal size","decimals",s)}function V(s,r){null==r&&(r=0);const t=F(r),e=(s=g.gH.from(s)).lt(I);e&&(s=s.mul(O));let n=s.mod(t).toString();for(;n.length<t.length-1;)n="0"+n;n=n.match(/^([0-9]*[1-9]|0)(0*)/)[1];const i=s.div(t).toString();return s=1===t.length?i:i+"."+n,e&&(s="-"+s),s}function p(s,r){null==r&&(r=0);const t=F(r);("string"!=typeof s||!s.match(/^-?[0-9.]+$/))&&u.throwArgumentError("invalid decimal value","value",s);const e="-"===s.substring(0,1);e&&(s=s.substring(1)),"."===s&&u.throwArgumentError("missing value","value",s);const n=s.split(".");n.length>2&&u.throwArgumentError("too many decimal points","value",s);let i=n[0],o=n[1];for(i||(i="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>t.length-1&&P("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.length<t.length-1;)o+="0";const w=g.gH.from(i),m=g.gH.from(o);let h=w.mul(t).add(m);return e&&(h=h.mul(O)),h}class x{constructor(r,t,e,n){r!==b&&u.throwError("cannot use FixedFormat constructor; use FixedFormat.from",y.Vy.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=e,this.decimals=n,this.name=(t?"":"u")+"fixed"+String(e)+"x"+String(n),this._multiplier=F(n),Object.freeze(this)}static from(r){if(r instanceof x)return r;"number"==typeof r&&(r=`fixed128x${r}`);let t=!0,e=128,n=18;if("string"==typeof r){if("fixed"!==r)if("ufixed"===r)t=!1;else{const i=r.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||u.throwArgumentError("invalid fixed format","format",r),t="u"!==i[1],e=parseInt(i[2]),n=parseInt(i[3])}}else if(r){const i=(o,w,m)=>null==r[o]?m:(typeof r[o]!==w&&u.throwArgumentError("invalid fixed format ("+o+" not "+w+")","format."+o,r[o]),r[o]);t=i("signed","boolean",t),e=i("width","number",e),n=i("decimals","number",n)}return e%8&&u.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",e),n>80&&u.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new x(b,t,e,n)}}class l{constructor(r,t,e,n){r!==b&&u.throwError("cannot use FixedNumber constructor; use FixedNumber.from",y.Vy.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=e,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(r){this.format.name!==r.format.name&&u.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",r)}addUnsafe(r){this._checkFormat(r);const t=p(this._value,this.format.decimals),e=p(r._value,r.format.decimals);return l.fromValue(t.add(e),this.format.decimals,this.format)}subUnsafe(r){this._checkFormat(r);const t=p(this._value,this.format.decimals),e=p(r._value,r.format.decimals);return l.fromValue(t.sub(e),this.format.decimals,this.format)}mulUnsafe(r){this._checkFormat(r);const t=p(this._value,this.format.decimals),e=p(r._value,r.format.decimals);return l.fromValue(t.mul(e).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(r){this._checkFormat(r);const t=p(this._value,this.format.decimals),e=p(r._value,r.format.decimals);return l.fromValue(t.mul(this.format._multiplier).div(e),this.format.decimals,this.format)}floor(){const r=this.toString().split(".");1===r.length&&r.push("0");let t=l.from(r[0],this.format);const e=!r[1].match(/^(0*)$/);return this.isNegative()&&e&&(t=t.subUnsafe(k.toFormat(t.format))),t}ceiling(){const r=this.toString().split(".");1===r.length&&r.push("0");let t=l.from(r[0],this.format);const e=!r[1].match(/^(0*)$/);return!this.isNegative()&&e&&(t=t.addUnsafe(k.toFormat(t.format))),t}round(r){null==r&&(r=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(r<0||r>80||r%1)&&u.throwArgumentError("invalid decimal count","decimals",r),t[1].length<=r)return this;const e=l.from("1"+T.substring(0,r),this.format),n=Z.toFormat(this.format);return this.mulUnsafe(e).addUnsafe(n).floor().divUnsafe(e)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(r){if(null==r)return this._hex;r%8&&u.throwArgumentError("invalid byte width","width",r);const t=g.gH.from(this._hex).fromTwos(this.format.width).toTwos(r).toHexString();return(0,U.bj)(t,r/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(r){return l.fromString(this._value,r)}static fromValue(r,t,e){return null==e&&null!=t&&!(0,g.YR)(t)&&(e=t,t=null),null==t&&(t=0),null==e&&(e="fixed"),l.fromString(V(r,t),x.from(e))}static fromString(r,t){null==t&&(t="fixed");const e=x.from(t),n=p(r,e.decimals);!e.signed&&n.lt(I)&&P("unsigned value cannot be negative","overflow","value",r);let i=null;e.signed?i=n.toTwos(e.width).toHexString():(i=n.toHexString(),i=(0,U.bj)(i,e.width/8));const o=V(n,e.decimals);return new l(b,i,o,e)}static fromBytes(r,t){null==t&&(t="fixed");const e=x.from(t);if((0,U.k9)(r).length>e.width/8)throw new Error("overflow");let n=g.gH.from(r);e.signed&&(n=n.fromTwos(e.width));const i=n.toTwos((e.signed?0:1)+e.width).toHexString(),o=V(n,e.decimals);return new l(b,i,o,e)}static from(r,t){if("string"==typeof r)return l.fromString(r,t);if((0,U.aY)(r))return l.fromBytes(r,t);try{return l.fromValue(r,0,t)}catch(e){if(e.code!==y.Vy.errors.INVALID_ARGUMENT)throw e}return u.throwArgumentError("invalid FixedNumber value","value",r)}static isFixedNumber(r){return!(!r||!r._isFixedNumber)}}const k=l.from(1),Z=l.from("0.5"),B=new y.Vy("units/5.8.0"),M=["wei","kwei","mwei","gwei","szabo","finney","ether"];var q=c(40765),j=c(21413),_=c(84412),tt=c(93207),H=c(17705),rt=c(64691);let et=(()=>{class s extends G.d{constructor(t,e){super(t),this.clientContextService=e,this.withdrawMoneySource=new X.b,this.withdrawalRequestIdSource="",this.companyWallet=new N,this.baseUsersUrl=d.c.userDataServiceURL,this.continueClicked=new j.B,this.confirmWithdrawal=new j.B,this.withRequestSet=new _.t(!1),this.selectedBank=null,this.withdrawConfirmed=!1}getSupportedCryptoTokens(){return this.get(`${this.baseUsersUrl}crypto/supportedTokens`)}performAirdropOfNativeTokens(t,e){return this.post(`${d.c.userDataServiceURL}wallet-users/airdrop/${t}`,e)}getCouponCodes(t,e,n){let i=`${d.c.usersUrl}/${t}/couponCodes`;
1const o=[];return e&&o.push(`subTenant=${e}`),n?.skipCache&&o.push(`_=${Date.now()}`),o.length&&(i+=`?${o.join("&")}`),this.get(i)}getBestCouponCode(t){return this.get(`${d.c.usersUrl}/${t}/banner/coupon-codes`)}getPromotionalCreditCoupons(t,e){let n=t?`${d.c.usersUrl}/${t}/promotional-credit-coupons`:`${d.c.usersUrl}/promotional-credit-coupons`;return e&&(n+=`?subTenant=${e}`),n+=`${n.includes("?")?"&":"?"}_=${Date.now()}`,this.get(n,{headers:new v.Lr({"Cache-Control":"no-cache",Pragma:"no-cache"})})}createWithdrawlRequest(t,e){return this.post(`${d.c.usersUrl}/${t}/withdrawal/`,e)}confirmTransfer(t,e,n){const i=`${d.c.usersUrl}/${t}/confirmTransfer/${e}`,o=this.clientContextService.getTimezone(),w=this.clientContextService.getDeviceType(),m=this.clientContextService.getPlatform();let h=new v.Lr;return o&&(h=h.set("X-Device-Timezone",o)),w&&(h=h.set("X-Device-Type",w)),m&&(h=h.set("X-Device-Platform",m)),this.post(i,{transferType:n},{headers:h})}performPayout(t,e){return this.post(`${d.c.usersUrl}/${t}/payouts/`,e)}getBlockchainTransactionStatus(t,e){return this.get(`${d.c.usersUrl}/${t}/blockchainTransactionStatus/${e}`)}updatedWithdrawMoneyObj(t,e,n){this.withdrawMoneySource=t,this.withdrawalRequestIdSource=e,this.companyWallet=n,this.withRequestSet.next(!0)}displayCrypto(t){return this.floor2DigitsStr(t)}displayRupee(t){return this.floor2DigitsStr(t/100)}floor2DigitsStr(t){return(Math.floor(100*t)/100).toFixed(2)}displayCryptoStr(t){return this.floor2DigitsStr(+t)}transfer(t,e,n,i,o,w,m,h,f,R,$){var C=this;return(0,A.A)(function*(){try{const a={account:f.connectedAccount,asset:e,amount:n,toAddress:t,transactionId:i,decimals:w,symbol:o,chainId:m,timestamp:h};if(a.account===a.toAddress)return{hash:"",success:!1,error:{message:"Transfer funds between same account is not required",transactionHash:""}};$.onWarningToaster("Your request is processing","Withdraw Request");const S=D.A.getContractAddress(a.chainId),nt=(yield f.getContractDetail(S),yield f.getTokenContract(a.asset)),z=function W(s,r){if("string"!=typeof s&&B.throwArgumentError("value must be a string","value",s),"string"==typeof r){const t=M.indexOf(r);-1!==t&&(r=3*t)}return p(s,r??18)}(a.amount,a.decimals),st=[a.account,S],ot=yield nt.read.allowance(st);if(Number(ot)<Number(z)){const L=q.Is,ct=yield f.prepareMaxAllowanceContract(a.asset,S,L),lt=yield f.transactionStatus(ct.hash);console.log(lt)}const it=g.gH.from(z.toString()),at=(yield f.getFee(),yield f.prepareAndExecuteContractFunction(S,a.toAddress,a.asset,it,a.transactionId));return{hash:(yield C.getTransactionStatus(f.transactionStatus(at.hash),a.transactionId,R)).transactionHash,success:!0}}catch(a){return console.log(a),{hash:a.transactionHash,success:!1,error:a}}})()}getTransactionStatus(t,e,n){var i=this;return(0,A.A)(function*(){let m=0;const h=new Promise(f=>{setTimeout(()=>f("Timeout"),6e4)});try{for(;m<3e5;){const f=yield Promise.race([t,h]);if("Timeout"!==f)return f;{console.log("Transaction has local timeout, checking status from backend");const C=i.getBlockchainTransactionStatus(n,e),a=yield(0,tt.s)(C);if(a&&"success"===a.success)return a}const $=Math.min(6e4,3e5-m);yield D.A.sleep($,t),m+=$}}catch(f){throw console.error("Transaction failed:",f),f}})()}static{this.\u0275fac=function(e){return new(e||s)(H.KVO(v.Qq),H.KVO(rt.Y))}}static{this.\u0275prov=H.jDH({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})()},34282:(Y,E,c)=>{c.d(E,{b:()=>A});class A{constructor(){this.displayableAccountInfos=[],this.isBankAccountsLoaded=!1,this.selectedAccountReferenceId="",this.selectedDisplayableAccountInfo="",this.totalWithdrawAmount=1,this.tdsValue=0,this.customerWithdrawValue=0,this.taxValue=0,this.currencySymbol="\u20b9",this.currencyCode="INR",this.ipfsURL=""}}}}]);
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.