edge-currency-accountbased 4.27.1 → 4.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/android/src/main/assets/edge-currency-accountbased/597.chunk.js +1 -1
- package/android/src/main/assets/edge-currency-accountbased/9649.chunk.js +3 -3
- package/android/src/main/assets/edge-currency-accountbased/algorand.chunk.js +1 -1
- package/android/src/main/assets/edge-currency-accountbased/axelar.chunk.js +1 -1
- package/android/src/main/assets/edge-currency-accountbased/bnb.chunk.js +1 -1
- package/android/src/main/assets/edge-currency-accountbased/cardano.chunk.js +2 -2
- package/android/src/main/assets/edge-currency-accountbased/edge-currency-accountbased.js +8 -8
- package/android/src/main/assets/edge-currency-accountbased/eos.chunk.js +2 -2
- package/android/src/main/assets/edge-currency-accountbased/ethereum.chunk.js +5 -5
- package/android/src/main/assets/edge-currency-accountbased/filecoin.chunk.js +1 -1
- package/android/src/main/assets/edge-currency-accountbased/fio.chunk.js +2 -2
- package/android/src/main/assets/edge-currency-accountbased/hedera.chunk.js +1 -1
- package/android/src/main/assets/edge-currency-accountbased/polkadot.chunk.js +82 -2
- package/android/src/main/assets/edge-currency-accountbased/ripple.chunk.js +2 -2
- package/android/src/main/assets/edge-currency-accountbased/solana.chunk.js +1 -1
- package/android/src/main/assets/edge-currency-accountbased/stellar.chunk.js +2 -2
- package/android/src/main/assets/edge-currency-accountbased/tezos.chunk.js +1 -1
- package/android/src/main/assets/edge-currency-accountbased/ton.chunk.js +1 -1
- package/android/src/main/assets/edge-currency-accountbased/tron.chunk.js +1 -1
- package/android/src/main/assets/edge-currency-accountbased/zcash.chunk.js +2 -2
- package/lib/algorand/AlgorandEngine.js +2 -0
- package/lib/binance/BinanceEngine.js +2 -0
- package/lib/cardano/CardanoEngine.js +3 -0
- package/lib/cosmos/engine/CosmosEngine.js +3 -0
- package/lib/eos/EosEngine.js +4 -0
- package/lib/ethereum/EthereumEngine.js +1 -0
- package/lib/ethereum/EthereumNetwork.js +219 -145
- package/lib/ethereum/info/ethereumInfo.js +11 -11
- package/lib/ethereum/networkAdapters/BlockbookWsAdapter.js +15 -7
- package/lib/ethereum/networkAdapters/EvmScanAdapter.js +1 -0
- package/lib/ethereum/networkAdapters/FilfoxAdapter.js +1 -0
- package/lib/ethereum/networkAdapters/PulsechainScanAdapter.js +1 -0
- package/lib/ethereum/networkAdapters/types.js +2 -0
- package/lib/filecoin/FilecoinEngine.js +3 -0
- package/lib/fio/FioEngine.js +3 -1
- package/lib/hedera/HederaEngine.js +2 -0
- package/lib/piratechain/PiratechainEngine.js +2 -0
- package/lib/polkadot/PolkadotEngine.js +357 -3
- package/lib/polkadot/info/liberlandInfo.js +4 -4
- package/lib/polkadot/info/liberlandTestnetInfo.js +3 -3
- package/lib/polkadot/info/polkadotInfo.js +2 -1
- package/lib/polkadot/polkadotTypes.js +58 -1
- package/lib/ripple/RippleEngine.js +5 -0
- package/lib/solana/SolanaEngine.js +2 -0
- package/lib/stellar/StellarEngine.js +2 -0
- package/lib/tezos/TezosEngine.js +2 -0
- package/lib/ton/TonEngine.js +2 -0
- package/lib/tron/TronEngine.js +13 -0
- package/lib/zcash/ZcashEngine.js +24 -10
- package/lib/zcash/zcashTypes.js +21 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 4.29.0 (2024-12-02)
|
|
6
|
+
|
|
7
|
+
- added: Added `getAddresses` to ZCash engine.
|
|
8
|
+
- fixed: (ETH) Improved and re-enabled BlockbookWsAdapter integration
|
|
9
|
+
|
|
10
|
+
## 4.28.0 (2024-11-21)
|
|
11
|
+
|
|
12
|
+
- added: (LLD/LLM) Tx history support
|
|
13
|
+
- fixed: (FIO) Fix unstakefio amount saved to `stakedAmounts`
|
|
14
|
+
|
|
5
15
|
## 4.27.1 (2024-11-11)
|
|
6
16
|
|
|
7
17
|
- fixed: (EVM) Fix performance regression caused by thrashing on network queries.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkedge_currency_accountbased=self.webpackChunkedge_currency_accountbased||[]).push([[597],{93689:function(fe,o,v){var a;a={value:!0};var e=v(53662),q=v(99211);const N=e.asCodec(w=>q.base16.parse(e.asString(w)),w=>q.base16.stringify(w).toLowerCase()),W=e.asCodec(w=>q.base32.parse(e.asString(w),{loose:!0}),w=>q.base32.stringify(w,{pad:!1})),y=e.asCodec(w=>q.base64.parse(e.asString(w)),w=>q.base64.stringify(w)),L=e.asObject({voucherId:e.asString,activates:e.asDate,created:e.asDate,ip:e.asString,ipDescription:e.asString,deviceDescription:e.asOptional(e.asString)}),p=e.asObject({encryptionType:e.asNumber,data_base64:y,iv_hex:N}),I=e.asObject({salt_hex:N,n:e.asNumber,r:e.asNumber,p:e.asNumber}),D=e.asObject({loginRequest:e.asOptional(e.asObject({appId:e.asString}).withRest),publicKey:y,timeout:e.asOptional(e.asNumber)}).withRest,V=e.asObject({publicKey:y,box:p}),j=e.asArray(y),A=e.asObject({data:e.asUnknown,challengeId:e.asOptional(e.asString),deviceDescription:e.asOptional(e.asString),otp:e.asOptional(e.asString),syncToken:e.asOptional(e.asString),voucherId:e.asOptional(e.asString),voucherAuth:e.asOptional(y),loginId:e.asOptional(y),loginAuth:e.asOptional(y),userId:e.asOptional(y),passwordAuth:e.asOptional(y),pin2Id:e.asOptional(y),pin2Auth:e.asOptional(y),recovery2Id:e.asOptional(y),recovery2Auth:e.asOptional(j),loginIds:e.asOptional(e.asArray(y)),otpResetAuth:e.asOptional(e.asString),did:e.asOptional(e.asString),l1:e.asOptional(y),lp1:e.asOptional(y),lpin1:e.asOptional(y),lra1:e.asOptional(y),recoveryAuth:e.asOptional(y)}),C=e.asObject({results:e.asOptional(e.asUnknown),status_code:e.asNumber,message:e.asString}),P=e.asObject({otpTimeout:e.asOptional(e.asNumber,7*24*60*60),otpKey:W}),F=e.asObject({passwordAuth:y,passwordAuthBox:p,passwordAuthSnrp:I,passwordBox:p,passwordKeySnrp:I}),K=e.asObject({pin2Id:y}),z=e.asObject({pin2Id:e.asOptional(y),pin2Auth:e.asOptional(y),pin2Box:e.asOptional(p),pin2KeyBox:e.asOptional(p),pin2TextBox:p}),f=e.asObject({recovery2Id:y}),u=e.asObject({recovery2Id:y,recovery2Auth:j,recovery2Box:p,recovery2KeyBox:p,question2Box:p}),l=e.asObject({loginAuthBox:p,loginAuth:y}),c=e.asObject({userId:y,userTextBox:p}),O=e.asObject({approvedVouchers:e.asOptional(e.asArray(e.asString)),rejectedVouchers:e.asOptional(e.asArray(e.asString))}),S=e.asObject({keyBoxes:e.asArray(p),newSyncKeys:e.asOptional(e.asArray(e.asString),()=>[])}),m=e.asObject({appId:e.asString,loginId:y,parentBox:e.asOptional(p)}),R=e.asObject({challengeId:e.asString,challengeUri:e.asString}),H=e.asObject({request:D,replies:e.asArray(V)}),re=e.asValue(!0),ie=e.asObject({appId:e.asString,created:e.asDate,loginId:y,syncToken:e.asOptional(e.asString),children:e.asOptional(e.asArray(w=>ie(w))),parentBox:e.asOptional(p),otpKey:e.asOptional(e.asEither(re,W)),otpResetDate:e.asOptional(e.asDate),otpTimeout:e.asOptional(e.asNumber),passwordAuthBox:e.asOptional(p),passwordAuthSnrp:e.asOptional(I),passwordBox:e.asOptional(e.asEither(re,p)),passwordKeySnrp:e.asOptional(I),pin2Box:e.asOptional(e.asEither(re,p)),pin2KeyBox:e.asOptional(p),pin2TextBox:e.asOptional(p),question2Box:e.asOptional(p),recovery2Box:e.asOptional(e.asEither(re,p)),recovery2KeyBox:e.asOptional(p),loginAuthBox:e.asOptional(p),userId:e.asOptional(y),userTextBox:e.asOptional(p),pendingVouchers:e.asOptional(e.asArray(L),()=>[]),keyBoxes:e.asOptional(e.asArray(p)),mnemonicBox:e.asOptional(p),rootKeyBox:e.asOptional(p),syncKeyBox:e.asOptional(p)}),g=e.asArray(e.asObject({loginId:y,otpResetPending:e.asOptional(e.asBoolean,!1),pendingVouchers:e.asOptional(e.asArray(L),()=>[]),recovery2Corrupt:e.asOptional(e.asBoolean,!1)})),ne=e.asObject({login_id:e.asOptional(y),otp_reset_auth:e.asOptional(e.asString),otp_timeout_date:e.asOptional(e.asDate),reason:e.asOptional(e.asValue("ip","otp"),"otp"),voucher_activates:e.asOptional(e.asDate),voucher_auth:e.asOptional(y),voucher_id:e.asOptional(e.asString)}),Re=e.asObject({otpResetDate:e.asDate}),ye=e.asObject({wait_seconds:e.asOptional(e.asNumber)}),_e=e.asObject({question2Box:p}),tr=e.asObject({loginId:y,passwordAuthSnrp:e.asOptional(I),questionBox:e.asOptional(p),questionKeySnrp:e.asOptional(I),recoveryAuthSnrp:e.asOptional(I)}),Or=e.uncleaner(p),br=e.uncleaner(V),de=e.uncleaner(D),Y=e.uncleaner(A),Q=e.uncleaner(C),he=e.uncleaner(P),De=e.uncleaner(F),ar=e.uncleaner(K),or=e.uncleaner(z),te=e.uncleaner(f),sr=e.uncleaner(u),je=e.uncleaner(l),He=e.uncleaner(c),qe=e.uncleaner(O),Cr=e.uncleaner(S),ir=e.uncleaner(m),pe=e.uncleaner(R),J=e.uncleaner(H),cr=e.uncleaner(ie),Sr=e.uncleaner(g),Pr=e.uncleaner(ne),Ir=e.uncleaner(Re),Ar=e.uncleaner(ye),ae=e.uncleaner(_e),ge=e.uncleaner(tr);function Te(w,d="Login requires a CAPTCHA"){if(!(this instanceof Te))throw new TypeError("Class constructor ChallengeError cannot be invoked without 'new'");var h;function b($){return h=new Error($),Object.defineProperty(h,"constructor",{value:Te,configurable:!0,writable:!0}),h}return b(d),h.name="ChallengeError",h.challengeId=w.challengeId,h.challengeUri=w.challengeUri,h}function ve(w="Please send a larger amount"){if(!(this instanceof ve))throw new TypeError("Class constructor DustSpendError cannot be invoked without 'new'");var d;function h(b){return d=new Error(b),Object.defineProperty(d,"constructor",{value:ve,configurable:!0,writable:!0}),d}return h(w),d.name="DustSpendError",d}function Ve(w){if(!(this instanceof Ve))throw new TypeError("Class constructor InsufficientFundsError cannot be invoked without 'new'");var d;function h(ee){return d=new Error(ee),Object.defineProperty(d,"constructor",{value:Ve,configurable:!0,writable:!0}),d}const{tokenId:b=null,networkFee:$}=w!=null?w:{};return h(`Insufficient ${b!=null?b:"funds"}`),d.tokenId=b,d.networkFee=$,d.name="InsufficientFundsError",d}function Ee(w="Cannot reach the network"){if(!(this instanceof Ee))throw new TypeError("Class constructor NetworkError cannot be invoked without 'new'");var d;function h(b){return d=new Error(b),Object.defineProperty(d,"constructor",{value:Ee,configurable:!0,writable:!0}),d}return h(w),d.name="NetworkError",d}function G(w="Unable to create zero-amount transaction."){if(!(this instanceof G))throw new TypeError("Class constructor NoAmountSpecifiedError cannot be invoked without 'new'");var d;function h(b){return d=new Error(b),Object.defineProperty(d,"constructor",{value:G,configurable:!0,writable:!0}),d}return h(w),d.name="NoAmountSpecifiedError",d}function we(w="The application is too old. Please upgrade."){if(!(this instanceof we))throw new TypeError("Class constructor ObsoleteApiError cannot be invoked without 'new'");var d;function h(b){return d=new Error(b),Object.defineProperty(d,"constructor",{value:we,configurable:!0,writable:!0}),d}return h(w),d.name="ObsoleteApiError",d}function ce(w,d="Invalid OTP token"){if(!(this instanceof ce))throw new TypeError("Class constructor OtpError cannot be invoked without 'new'");var h;function b(ee){return h=new Error(ee),Object.defineProperty(h,"constructor",{value:ce,configurable:!0,writable:!0}),h}b(d),h.name="OtpError",h.reason="otp";const $=e.asMaybe(ne)(w);if($!=null)return $.login_id!=null&&(h.loginId=q.base64.stringify($.login_id)),h.resetToken=$.otp_reset_auth,h.reason=$.reason,h.resetDate=$.otp_timeout_date,h.voucherActivates=$.voucher_activates,$.voucher_auth!=null&&(h.voucherAuth=q.base64.stringify($.voucher_auth)),h.voucherId=$.voucher_id,h}function Oe(w,d="Invalid password"){if(!(this instanceof Oe))throw new TypeError("Class constructor PasswordError cannot be invoked without 'new'");var h;function b(ee){return h=new Error(ee),Object.defineProperty(h,"constructor",{value:Oe,configurable:!0,writable:!0}),h}b(d),h.name="PasswordError";const $=e.asMaybe(ye)(w);if($!=null)return h.wait=$.wait_seconds,h}function be(w="Not enough confirmed funds"){if(!(this instanceof be))throw new TypeError("Class constructor PendingFundsError cannot be invoked without 'new'");var d;function h(b){return d=new Error(b),Object.defineProperty(d,"constructor",{value:be,configurable:!0,writable:!0}),d}return h(w),d.name="PendingFundsError",d}function Ce(w="Wallets can not be the same currency"){if(!(this instanceof Ce))throw new TypeError("Class constructor SameCurrencyError cannot be invoked without 'new'");var d;function h(b){return d=new Error(b),Object.defineProperty(d,"constructor",{value:Ce,configurable:!0,writable:!0}),d}return h(w),d.name="SameCurrencyError",d}function $e(w="Spending to self"){if(!(this instanceof $e))throw new TypeError("Class constructor SpendToSelfError cannot be invoked without 'new'");var d;function h(b){return d=new Error(b),Object.defineProperty(d,"constructor",{value:$e,configurable:!0,writable:!0}),d}return h(w),d.name="SpendToSelfError",d}function Ue(w,d,h="from"){if(!(this instanceof Ue))throw new TypeError("Class constructor SwapAboveLimitError cannot be invoked without 'new'");var b;function $(ee){return b=new Error(ee),Object.defineProperty(b,"constructor",{value:Ue,configurable:!0,writable:!0}),b}return $("Amount is too high"),b.name="SwapAboveLimitError",b.pluginId=w.pluginId,b.nativeMax=d,b.direction=h,b}function Ne(w,d,h="from"){if(!(this instanceof Ne))throw new TypeError("Class constructor SwapBelowLimitError cannot be invoked without 'new'");var b;function $(ee){return b=new Error(ee),Object.defineProperty(b,"constructor",{value:Ne,configurable:!0,writable:!0}),b}return $("Amount is too low"),b.name="SwapBelowLimitError",b.pluginId=w.pluginId,b.nativeMin=d,b.direction=h,b}function Se(w,d){if(!(this instanceof Se))throw new TypeError("Class constructor SwapCurrencyError cannot be invoked without 'new'");var h;function b(s){return h=new Error(s),Object.defineProperty(h,"constructor",{value:Se,configurable:!0,writable:!0}),h}const{fromWallet:$,toWallet:ee,fromTokenId:Me,toTokenId:Ie}=d,Tr=$.currencyConfig.currencyInfo.pluginId,r=ee.currencyConfig.currencyInfo.pluginId,n=`${Tr}:${String(Me)}`,t=`${r}:${String(Ie)}`;return b(`${w.displayName} does not support ${n} to ${t}`),h.name="SwapCurrencyError",h.pluginId=w.pluginId,h.fromTokenId=Me!=null?Me:null,h.toTokenId=Ie!=null?Ie:null,h}function Pe(w,d){if(!(this instanceof Pe))throw new TypeError("Class constructor SwapPermissionError cannot be invoked without 'new'");var h;function b($){return h=new Error($),Object.defineProperty(h,"constructor",{value:Pe,configurable:!0,writable:!0}),h}return d!=null?b(d):b("You are not allowed to make this trade"),h.name="SwapPermissionError",h.pluginId=w.pluginId,h.reason=d,h}function Le(w="Invalid username"){if(!(this instanceof Le))throw new TypeError("Class constructor UsernameError cannot be invoked without 'new'");var d;function h(b){return d=new Error(b),Object.defineProperty(d,"constructor",{value:Le,configurable:!0,writable:!0}),d}return h(w),d.name="UsernameError",d}function k(w){return function(h){if(h instanceof Error&&h.name===w)return h}}const ur=k("ChallengeError"),Ke=k("DustSpendError"),ze=k("InsufficientFundsError"),Ge=k("NetworkError"),lr=k("NoAmountSpecifiedError"),Ze=k("ObsoleteApiError"),Xe=k("OtpError"),fr=k("PasswordError"),mr=k("PendingFundsError"),dr=k("SameCurrencyError"),ue=k("SpendToSelfError"),hr=k("SwapAboveLimitError"),Rr=k("SwapBelowLimitError"),We=k("SwapCurrencyError"),pr=k("SwapPermissionError"),_r=k("UsernameError"),Er=e.asObject(p),Fe=e.asObject({loginId:y,voucherAuth:y,voucherId:e.asString,created:e.asDate,activates:e.asDate,status:e.asValue("pending","approved","rejected"),ip:e.asString,ipDescription:e.asString,deviceDescription:e.asOptional(e.asString)}),Ye=e.asObject({appId:e.asString,created:e.asOptional(e.asDate,()=>new Date),loginId:y,children:e.asOptional(e.asArray(w=>Ye(w)),()=>[]),parentBox:e.asOptional(p),parentId:()=>{},otpKey:e.asOptional(W),otpResetAuth:e.asOptional(e.asString),otpResetDate:e.asOptional(e.asDate),otpTimeout:e.asOptional(e.asNumber),passwordAuth:e.asOptional(y),passwordAuthBox:e.asOptional(p),passwordAuthSnrp:e.asOptional(I),passwordBox:e.asOptional(p),passwordKeySnrp:e.asOptional(I),pin2Id:e.asOptional(y),pin2Auth:e.asOptional(y),pin2Box:e.asOptional(p),pin2KeyBox:e.asOptional(p),pin2TextBox:e.asOptional(p),recovery2Id:e.asOptional(y),recovery2Auth:e.asOptional(j),question2Box:e.asOptional(p),recovery2Box:e.asOptional(p),recovery2KeyBox:e.asOptional(p),loginAuth:e.asOptional(y),loginAuthBox:e.asOptional(p),userId:e.asOptional(y),userTextBox:e.asOptional(p),keyBoxes:e.asOptional(e.asArray(p),()=>[]),mnemonicBox:e.asOptional(p),rootKeyBox:e.asOptional(p),syncKeyBox:e.asOptional(p),vouchers:e.asOptional(e.asArray(Fe),()=>[]),pinBox:e.asOptional(p),pinId:e.asOptional(e.asString),pinKeyBox:e.asOptional(p)}),yr=e.uncleaner(Ye),Dr=e.uncleaner(Er);o.WK=Te,o.DE=ve,o.k5=Ve,o.Dr=Ee,o.ef=G,o.GY=we,o.WM=ce,o.Kz=Oe,o.uX=be,o.IK=Ce,o.gw=$e,o.WU=Ue,o.G8=Ne,o.xQ=Se,o.D7=Pe,o.hi=Le,o.zU=N,o.dq=W,o.m$=y,o.MU=R,o.ID=P,o.k0=F,o.D4=K,o.kL=z,o.jx=f,o.A_=u,o.v1=l,o.TL=c,o.Og=O,o.ft=S,o.KU=m,o.ZU=p,o.ye=V,o.Xj=D,o.Rn=Ye,o.bo=L,o.KL=Er,o.rW=I,o.U3=Fe,o.$Y=H,o.EJ=ie,o.XY=A,o.v7=C,o.up=ur,o.h=Ke,o.Cx=ze,o.Zz=Ge,o.CU=lr,o.ib=Ze,o.eT=Xe,o._0=fr,o.UR=mr,o.Up=dr,o.y0=ue,o.A2=hr,o.ql=Rr,o.FX=We,o.Jr=pr,o.zS=_r,o.pK=g,o.ud=ne,o.Zk=Re,o.Mf=ye,o.U0=j,o.CX=_e,o.l4=tr,o.Jv=pe,o.T0=he,o.z8=De,o.Gt=ar,o.Fm=or,o.b4=te,o.N2=sr,o.K8=je,o.gB=He,o.bd=qe,o.GG=Cr,o.V$=ir,o.CC=Or,o.dT=br,o.uT=de,o._j=yr,o.p4=Dr,o.W0=J,o.zk=cr,o.AB=Y,o.sn=Q,o._u=Sr,o.Py=Pr,o.iu=Ir,o.l7=Ar,o.JU=ae,o.O6=ge},73992:function(fe,o){var v=Object.prototype.hasOwnProperty,a;function e(y){try{return decodeURIComponent(y.replace(/\+/g," "))}catch{return null}}function q(y){try{return encodeURIComponent(y)}catch{return null}}function N(y){for(var L=/([^=?&]+)=?([^&]*)/g,p={},I;I=L.exec(y);){var D=e(I[1]),V=e(I[2]);D===null||V===null||D in p||(p[D]=V)}return p}function W(y,L){L=L||"";var p=[],I,D;typeof L!="string"&&(L="?");for(D in y)if(v.call(y,D)){if(I=y[D],!I&&(I===null||I===a||isNaN(I))&&(I=""),D=encodeURIComponent(D),I=encodeURIComponent(I),D===null||I===null)continue;p.push(D+"="+I)}return p.length?L+p.join("&"):""}o.stringify=W,o.parse=N},92063:function(fe){fe.exports=function(v,a){if(a=a.split(":")[0],v=+v,!v)return!1;switch(a){case"http":case"ws":return v!==80;case"https":case"wss":return v!==443;case"ftp":return v!==21;case"gopher":return v!==70;case"file":return!1}return v!==0}},63054:function(fe,o,v){v.d(o,{lK:function(){return J}});function a(...r){if(r.length>1){r[0]=r[0].slice(0,-1);const n=r.length-1;for(let t=1;t<n;++t)r[t]=r[t].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}else return r[0]}function e(r){return"(?:"+r+")"}function q(r){return r===void 0?"undefined":r===null?"null":Object.prototype.toString.call(r).split(" ").pop().split("]").shift().toLowerCase()}function N(r){return r.toUpperCase()}function W(r){return r!=null?r instanceof Array?r:typeof r.length!="number"||r.split||r.setInterval||r.call?[r]:Array.prototype.slice.call(r):[]}function y(r){const n="[A-Za-z]",t="[\\x0D]",s="[0-9]",i="[\\x22]",E=a(s,"[A-Fa-f]"),T="[\\x0A]",x="[\\x20]",U=e(e("%[EFef]"+E+"%"+E+E+"%"+E+E)+"|"+e("%[89A-Fa-f]"+E+"%"+E+E)+"|"+e("%"+E+E)),Z="[\\:\\/\\?\\#\\[\\]\\@]",_="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",X=a(Z,_),oe=r?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",se=r?"[\\uE000-\\uF8FF]":"[]",B=a(n,s,"[\\-\\.\\_\\~]",oe),Ae=e(n+a(n,s,"[\\+\\-\\.]")+"*"),Qe=e(e(U+"|"+a(B,_,"[\\:]"))+"*"),gr=e(e("25[0-5]")+"|"+e("2[0-4]"+s)+"|"+e("1"+s+s)+"|"+e("[1-9]"+s)+"|"+s),$r=e(gr+"\\."+gr+"\\."+gr+"\\."+gr),M=e(E+"{1,4}"),me=e(e(M+"\\:"+M)+"|"+$r),xr=e(e(M+"\\:")+"{6}"+me),Br=e("\\:\\:"+e(M+"\\:")+"{5}"+me),kr=e(e(M)+"?\\:\\:"+e(M+"\\:")+"{4}"+me),jr=e(e(e(M+"\\:")+"{0,1}"+M)+"?\\:\\:"+e(M+"\\:")+"{3}"+me),Hr=e(e(e(M+"\\:")+"{0,2}"+M)+"?\\:\\:"+e(M+"\\:")+"{2}"+me),qr=e(e(e(M+"\\:")+"{0,3}"+M)+"?\\:\\:"+M+"\\:"+me),Vr=e(e(e(M+"\\:")+"{0,4}"+M)+"?\\:\\:"+me),Kr=e(e(e(M+"\\:")+"{0,5}"+M)+"?\\:\\:"+M),zr=e(e(e(M+"\\:")+"{0,6}"+M)+"?\\:\\:"),Ur=e([xr,Br,kr,jr,Hr,qr,Vr,Kr,zr].join("|")),Gr=e("[vV]"+E+"+\\."+a(B,_,"[\\:]")+"+"),Zr=e("\\["+e(Ur+"|"+Gr)+"\\]"),Nr=e(e(U+"|"+a(B,_))+"*"),Je=e(Zr+"|"+$r+"(?!"+Nr+")|"+Nr),er=e(s+"*"),Lr=e(e(Qe+"@")+"?"+Je+e("\\:"+er)+"?"),rr=e(U+"|"+a(B,_,"[\\:\\@]")),Xr=e(rr+"*"),Fr=e(rr+"+"),Wr=e(e(U+"|"+a(B,_,"[\\@]"))+"+"),le=e(e("\\/"+Xr)+"*"),xe=e("\\/"+e(Fr+le)+"?"),vr=e(Wr+le),wr=e(Fr+le),Be="(?!"+rr+")",en=e(le+"|"+xe+"|"+vr+"|"+wr+"|"+Be),ke=e(e(rr+"|"+a("[\\/\\?]",se))+"*"),nr=e(e(rr+"|[\\/\\?]")+"*"),Mr=e(e("\\/\\/"+Lr+le)+"|"+xe+"|"+wr+"|"+Be),Yr=e(Ae+"\\:"+Mr+e("\\?"+ke)+"?"+e("\\#"+nr)+"?"),Qr=e(e("\\/\\/"+Lr+le)+"|"+xe+"|"+vr+"|"+Be),Jr=e(Qr+e("\\?"+ke)+"?"+e("\\#"+nr)+"?"),rn=e(Yr+"|"+Jr),nn=e(Ae+"\\:"+Mr+e("\\?"+ke)+"?"),tn="^("+Ae+")\\:"+e(e("\\/\\/("+e("("+Qe+")@")+"?("+Je+")"+e("\\:("+er+")")+"?)")+"?("+le+"|"+xe+"|"+wr+"|"+Be+")")+e("\\?("+ke+")")+"?"+e("\\#("+nr+")")+"?$",an="^(){0}"+e(e("\\/\\/("+e("("+Qe+")@")+"?("+Je+")"+e("\\:("+er+")")+"?)")+"?("+le+"|"+xe+"|"+vr+"|"+Be+")")+e("\\?("+ke+")")+"?"+e("\\#("+nr+")")+"?$",on="^("+Ae+")\\:"+e(e("\\/\\/("+e("("+Qe+")@")+"?("+Je+")"+e("\\:("+er+")")+"?)")+"?("+le+"|"+xe+"|"+wr+"|"+Be+")")+e("\\?("+ke+")")+"?$",sn="^"+e("\\#("+nr+")")+"?$",cn="^"+e("("+Qe+")@")+"?("+Je+")"+e("\\:("+er+")")+"?$";return{NOT_SCHEME:new RegExp(a("[^]",n,s,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(a("[^\\%\\:]",B,_),"g"),NOT_HOST:new RegExp(a("[^\\%\\[\\]\\:]",B,_),"g"),NOT_PATH:new RegExp(a("[^\\%\\/\\:\\@]",B,_),"g"),NOT_PATH_NOSCHEME:new RegExp(a("[^\\%\\/\\@]",B,_),"g"),NOT_QUERY:new RegExp(a("[^\\%]",B,_,"[\\:\\@\\/\\?]",se),"g"),NOT_FRAGMENT:new RegExp(a("[^\\%]",B,_,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(a("[^]",B,_),"g"),UNRESERVED:new RegExp(B,"g"),OTHER_CHARS:new RegExp(a("[^\\%]",B,X),"g"),PCT_ENCODED:new RegExp(U,"g"),IPV6ADDRESS:new RegExp("\\[?("+Ur+")\\]?","g")}}var L=y(!1),p=y(!0);const I=2147483647,D=36,V=1,j=26,A=38,C=700,P=72,F=128,K="-",z=/^xn--/,f=/[^\0-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},c=D-V,O=Math.floor,S=String.fromCharCode;function m(r){throw new RangeError(l[r])}function R(r,n){const t=[];let s=r.length;for(;s--;)t[s]=n(r[s]);return t}function H(r,n){const t=r.split("@");let s="";t.length>1&&(s=t[0]+"@",r=t[1]),r=r.replace(u,".");const i=r.split("."),E=R(i,n).join(".");return s+E}function re(r){const n=[];let t=0;const s=r.length;for(;t<s;){const i=r.charCodeAt(t++);if(i>=55296&&i<=56319&&t<s){const E=r.charCodeAt(t++);(E&64512)==56320?n.push(((i&1023)<<10)+(E&1023)+65536):(n.push(i),t--)}else n.push(i)}return n}const ie=r=>String.fromCodePoint(...r),g=function(r){return r-48<10?r-22:r-65<26?r-65:r-97<26?r-97:D},ne=function(r,n){return r+22+75*(r<26)-((n!=0)<<5)},Re=function(r,n,t){let s=0;for(r=t?O(r/C):r>>1,r+=O(r/n);r>c*j>>1;s+=D)r=O(r/c);return O(s+(c+1)*r/(r+A))},ye=function(r){const n=[],t=r.length;let s=0,i=F,E=P,T=r.lastIndexOf(K);T<0&&(T=0);for(let x=0;x<T;++x)r.charCodeAt(x)>=128&&m("not-basic"),n.push(r.charCodeAt(x));for(let x=T>0?T+1:0;x<t;){let U=s;for(let _=1,X=D;;X+=D){x>=t&&m("invalid-input");const oe=g(r.charCodeAt(x++));(oe>=D||oe>O((I-s)/_))&&m("overflow"),s+=oe*_;const se=X<=E?V:X>=E+j?j:X-E;if(oe<se)break;const B=D-se;_>O(I/B)&&m("overflow"),_*=B}const Z=n.length+1;E=Re(s-U,Z,U==0),O(s/Z)>I-i&&m("overflow"),i+=O(s/Z),s%=Z,n.splice(s++,0,i)}return String.fromCodePoint(...n)},_e=function(r){const n=[];r=re(r);let t=r.length,s=F,i=0,E=P;for(const U of r)U<128&&n.push(S(U));let T=n.length,x=T;for(T&&n.push(K);x<t;){let U=I;for(const _ of r)_>=s&&_<U&&(U=_);const Z=x+1;U-s>O((I-i)/Z)&&m("overflow"),i+=(U-s)*Z,s=U;for(const _ of r)if(_<s&&++i>I&&m("overflow"),_==s){let X=i;for(let oe=D;;oe+=D){const se=oe<=E?V:oe>=E+j?j:oe-E;if(X<se)break;const B=X-se,Ae=D-se;n.push(S(ne(se+B%Ae,0))),X=O(B/Ae)}n.push(S(ne(X,0))),E=Re(i,Z,x==T),i=0,++x}++i,++s}return n.join("")};var de={version:"2.1.0",ucs2:{decode:re,encode:ie},decode:ye,encode:_e,toASCII:function(r){return H(r,function(n){return f.test(n)?"xn--"+_e(n):n})},toUnicode:function(r){return H(r,function(n){return z.test(n)?ye(n.slice(4).toLowerCase()):n})}};const Y={};function Q(r){const n=r.charCodeAt(0);let t;return n<16?t="%0"+n.toString(16).toUpperCase():n<128?t="%"+n.toString(16).toUpperCase():n<2048?t="%"+(n>>6|192).toString(16).toUpperCase()+"%"+(n&63|128).toString(16).toUpperCase():t="%"+(n>>12|224).toString(16).toUpperCase()+"%"+(n>>6&63|128).toString(16).toUpperCase()+"%"+(n&63|128).toString(16).toUpperCase(),t}function he(r){let n="",t=0;const s=r.length;for(;t<s;){const i=parseInt(r.substr(t+1,2),16);if(i<128)n+=String.fromCharCode(i),t+=3;else if(i>=194&&i<224){if(s-t>=6){const E=parseInt(r.substr(t+4,2),16);n+=String.fromCharCode((i&31)<<6|E&63)}else n+=r.substr(t,6);t+=6}else if(i>=224){if(s-t>=9){const E=parseInt(r.substr(t+4,2),16),T=parseInt(r.substr(t+7,2),16);n+=String.fromCharCode((i&15)<<12|(E&63)<<6|T&63)}else n+=r.substr(t,9);t+=9}else n+=r.substr(t,3),t+=3}return n}function De(r,n){function t(s){const i=he(s);return i.match(n.UNRESERVED)?i:s}return r.scheme&&(r.scheme=String(r.scheme).replace(n.PCT_ENCODED,t).toLowerCase().replace(n.NOT_SCHEME,"")),r.userinfo!==void 0&&(r.userinfo=String(r.userinfo).replace(n.PCT_ENCODED,t).replace(n.NOT_USERINFO,Q).replace(n.PCT_ENCODED,N)),r.host!==void 0&&(r.host=String(r.host).replace(n.PCT_ENCODED,t).toLowerCase().replace(n.NOT_HOST,Q).replace(n.PCT_ENCODED,N)),r.path!==void 0&&(r.path=String(r.path).replace(n.PCT_ENCODED,t).replace(r.scheme?n.NOT_PATH:n.NOT_PATH_NOSCHEME,Q).replace(n.PCT_ENCODED,N)),r.query!==void 0&&(r.query=String(r.query).replace(n.PCT_ENCODED,t).replace(n.NOT_QUERY,Q).replace(n.PCT_ENCODED,N)),r.fragment!==void 0&&(r.fragment=String(r.fragment).replace(n.PCT_ENCODED,t).replace(n.NOT_FRAGMENT,Q).replace(n.PCT_ENCODED,N)),r}const ar=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[\dA-F:.]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,or="".match(/(){0}/)[1]===void 0;function te(r,n={}){const t={},s=n.iri!==!1?IRI_PROTOCOL:URI_PROTOCOL;n.reference==="suffix"&&(r=(n.scheme?n.scheme+":":"")+"//"+r);const i=r.match(ar);if(i){or?(t.scheme=i[1],t.userinfo=i[3],t.host=i[4],t.port=parseInt(i[5],10),t.path=i[6]||"",t.query=i[7],t.fragment=i[8],isNaN(t.port)&&(t.port=i[5])):(t.scheme=i[1]||void 0,t.userinfo=r.indexOf("@")!==-1?i[3]:void 0,t.host=r.indexOf("//")!==-1?i[4]:void 0,t.port=parseInt(i[5],10),t.path=i[6]||"",t.query=r.indexOf("?")!==-1?i[7]:void 0,t.fragment=r.indexOf("#")!==-1?i[8]:void 0,isNaN(t.port)&&(t.port=r.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),t.host&&(t.host=t.host.replace(s.IPV6ADDRESS,"$1")),t.scheme===void 0&&t.userinfo===void 0&&t.host===void 0&&t.port===void 0&&!t.path&&t.query===void 0?t.reference="same-document":t.scheme===void 0?t.reference="relative":t.fragment===void 0?t.reference="absolute":t.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==t.reference&&(t.error=t.error||"URI is not a "+n.reference+" reference.");const E=Y[(n.scheme||t.scheme||"").toLowerCase()];if(!n.unicodeSupport&&(!E||!E.unicodeSupport)){if(t.host&&(n.domainHost||E&&E.domainHost))try{t.host=punycode.toASCII(t.host.replace(s.PCT_ENCODED,he).toLowerCase())}catch(T){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+T}De(t,URI_PROTOCOL)}else De(t,s);E&&E.parse&&E.parse(t,n)}else t.error=t.error||"URI can not be parsed.";return t}function sr(r,n){const t=n.iri!==!1?p:L,s=[];return r.userinfo!==void 0&&(s.push(r.userinfo),s.push("@")),r.host!==void 0&&s.push(String(r.host).replace(t.IPV6ADDRESS,"[$1]")),typeof r.port=="number"&&(s.push(":"),s.push(r.port.toString(10))),s.length?s.join(""):void 0}const je=/^\.\.?\//,He=/^\/\.(\/|$)/,qe=/^\/\.\.(\/|$)/,Cr=/^\.\.?$/,ir=/^\/?(?:.|\n)*?(?=\/|$)/;function pe(r){const n=[];for(;r.length;)if(r.match(je))r=r.replace(je,"");else if(r.match(He))r=r.replace(He,"/");else if(r.match(qe))r=r.replace(qe,"/"),n.pop();else if(r==="."||r==="..")r="";else{const t=r.match(ir);if(t){const s=t[0];r=r.slice(s.length),n.push(s)}else throw new Error("Unexpected dot segment condition")}return n.join("")}function J(r,n={}){const t=n.iri?p:L,s=[],i=Y[(n.scheme||r.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(r,n),r.host&&!t.IPV6ADDRESS.test(r.host)){if(n.domainHost||i&&i.domainHost)try{r.host=n.iri?de.toUnicode(r.host):de.toASCII(r.host.replace(t.PCT_ENCODED,he).toLowerCase())}catch(T){r.error=r.error||"Host's domain name can not be converted to "+(n.iri?"Unicode":"ASCII")+" via punycode: "+T}}De(r,t),n.reference!=="suffix"&&r.scheme&&(s.push(r.scheme),s.push(":"));const E=sr(r,n);if(E!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(E),r.path&&r.path.charAt(0)!=="/"&&s.push("/")),r.path!==void 0){let T=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(T=pe(T)),E===void 0&&(T=T.replace(/^\/\//,"/%2F")),s.push(T)}return r.query!==void 0&&(s.push("?"),s.push(r.query)),r.fragment!==void 0&&(s.push("#"),s.push(r.fragment)),s.join("")}function cr(r,n,t={},s){const i={};return s||(r=te(J(r,t),t),n=te(J(n,t),t)),t=t||{},!t.tolerant&&n.scheme?(i.scheme=n.scheme,i.userinfo=n.userinfo,i.host=n.host,i.port=n.port,i.path=pe(n.path||""),i.query=n.query):(n.userinfo!==void 0||n.host!==void 0||n.port!==void 0?(i.userinfo=n.userinfo,i.host=n.host,i.port=n.port,i.path=pe(n.path||""),i.query=n.query):(n.path?(n.path.charAt(0)==="/"?i.path=pe(n.path):((r.userinfo!==void 0||r.host!==void 0||r.port!==void 0)&&!r.path?i.path="/"+n.path:r.path?i.path=r.path.slice(0,r.path.lastIndexOf("/")+1)+n.path:i.path=n.path,i.path=pe(i.path)),i.query=n.query):(i.path=r.path,n.query!==void 0?i.query=n.query:i.query=r.query),i.userinfo=r.userinfo,i.host=r.host,i.port=r.port),i.scheme=r.scheme),i.fragment=n.fragment,i}function Sr(r,n,t){return J(cr(te(r,t),te(n,t),t,!0),t)}function Pr(r,n){return typeof r=="string"?r=J(te(r,n),n):typeOf(r)==="object"&&(r=te(J(r,n),n)),r}function Ir(r,n,t){return typeof r=="string"?r=J(te(r,t),t):typeOf(r)==="object"&&(r=J(r,t)),typeof n=="string"?n=J(te(n,t),t):typeOf(n)==="object"&&(n=J(n,t)),r===n}function Ar(r,n){return r&&r.toString().replace(!n||!n.iri?URI_PROTOCOL.ESCAPE:IRI_PROTOCOL.ESCAPE,Q)}function ae(r,n){return r&&r.toString().replace(!n||!n.iri?L.PCT_ENCODED:p.PCT_ENCODED,he)}var ge={scheme:"http",domainHost:!0,parse:function(r,n){return r.host||(r.error=r.error||"HTTP URIs must have a host."),r},serialize:function(r,n){return(r.port===(String(r.scheme).toLowerCase()!=="https"?80:443)||r.port==="")&&(r.port=void 0),r.path||(r.path="/"),r}},Te={scheme:"https",domainHost:ge.domainHost,parse:ge.parse,serialize:ge.serialize};const ve={},Ee="[A-Za-z0-9\\-\\.\\_\\~"+(!0?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",G="[0-9A-Fa-f]",we=e(e("%[EFef]"+G+"%"+G+G+"%"+G+G)+"|"+e("%[89A-Fa-f]"+G+"%"+G+G)+"|"+e("%"+G+G)),ce="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Oe="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",be=a(Oe,'[\\"\\\\]'),Ce=e(ce+"+"+e("\\."+ce+"+")+"*"),$e=e("\\\\"+be),Ue=e(Oe+"|"+$e),Ne=e('\\"'+Ue+'*\\"'),Se="[\\x21-\\x5A\\x5E-\\x7E]",Pe="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Le=e(Ee+"|"+we+"|"+Pe),k=e(Ce+"|\\["+Se+"*\\]"),ur=e(Ce+"|"+Ne),Ke=e(ur+"\\@"+k),ze=e(Ke+e("\\,"+Ke)+"*"),Ge=e(Le+"*"),lr=Ge,Ze=e(Ge+"\\="+lr),Xe=e(Ze+e("\\&"+Ze)+"*"),fr=e("\\?"+Xe),mr=new RegExp("^mailto\\:"+ze+"?"+fr+"?$"),dr=new RegExp(Ee,"g"),ue=new RegExp(we,"g"),hr=new RegExp(a("[^]",ce,"[\\.]",'[\\"]',be),"g"),Rr=new RegExp(a("[^]",ce,"[\\.]","[\\[]",Se,"[\\]]"),"g"),We=new RegExp(a("[^]",Ee,Pe),"g"),pr=We,_r=new RegExp("^"+ze+"$"),Er=new RegExp("^"+Xe+"$");function Fe(r){const n=he(r);return n.match(dr)?n:r}var Ye={scheme:"mailto",parse:function(r,n){const t=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){let s=!1;const i={},E=r.query.split("&");for(let T=0,x=E.length;T<x;++T){const U=E[T].split("=");switch(U[0]){case"to":const Z=U[1].split(",");for(let _=0,X=Z.length;_<X;++_)t.push(Z[_]);break;case"subject":r.subject=ae(U[1],n);break;case"body":r.body=ae(U[1],n);break;default:s=!0,i[ae(U[0],n)]=ae(U[1],n);break}}s&&(r.headers=i)}r.query=void 0;for(let s=0,i=t.length;s<i;++s){const E=t[s].split("@");if(E[0]=ae(E[0]),n.unicodeSupport)E[1]=ae(E[1],n).toLowerCase();else try{E[1]=de.toASCII(ae(E[1],n).toLowerCase())}catch(T){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+T}t[s]=E.join("@")}return r},serialize:function(r,n){const t=W(r.to);if(t){for(let E=0,T=t.length;E<T;++E){const x=String(t[E]),U=x.lastIndexOf("@"),Z=x.slice(0,U).replace(ue,Fe).replace(ue,N).replace(hr,Q);let _=x.slice(U+1);try{_=n.iri?de.toUnicode(_):de.toASCII(ae(_,n).toLowerCase())}catch(X){r.error=r.error||"Email address's domain name can not be converted to "+(n.iri?"Unicode":"ASCII")+" via punycode: "+X}t[E]=Z+"@"+_}r.path=t.join(",")}const s=r.headers=r.headers||{};r.subject&&(s.subject=r.subject),r.body&&(s.body=r.body);const i=[];for(const E in s)s[E]!==ve[E]&&i.push(E.replace(ue,Fe).replace(ue,N).replace(We,Q)+"="+s[E].replace(ue,Fe).replace(ue,N).replace(pr,Q));return i.length&&(r.query=i.join("&")),r}};const yr="(?:[0-9A-Za-z][0-9A-Za-z\\-]{1,31})",Dr="(?:\\%[0-9A-Fa-f]{2})",w="[0-9A-Za-z\\(\\)\\+\\,\\-\\.\\:\\=\\@\\;\\$\\_\\!\\*\\'\\/\\?\\#]",d="(?:(?:"+Dr+"|"+w+")+)",h=new RegExp("^urn\\:("+yr+")$"),b=new RegExp("^("+yr+")\\:("+d+")$"),$=/^([^\:]+)\:(.*)/,ee=/[\x00-\x20\\\"\&\<\>\[\]\^\`\{\|\}\~\x7F-\xFF]/g;var Me={scheme:"urn",parse:function(r,n){const t=r.path&&r.path.match($);if(t){const s="urn:"+t[1].toLowerCase();let i=Y[s];i||(i=Y[s]={scheme:s,parse:function(E,T){return E},serialize:Y.urn.serialize}),r.scheme=s,r.path=t[2],r=i.parse(r,n)}else r.error=r.error||"URN can not be parsed.";return r},serialize:function(r,n){const t=r.scheme||n.scheme;if(t&&t!=="urn"){const s=t.match(h)||["urn:"+t,t];r.scheme="urn",r.path=s[1]+":"+(r.path?r.path.replace(ee,Q):"")}return r}};const Ie=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;var Tr={scheme:"urn:uuid",parse:function(r,n){return!n.tolerant&&(!r.path||!r.path.match(Ie))&&(r.error=r.error||"UUID is not valid."),r},serialize:function(r,n){return!n.tolerant&&(!r.path||!r.path.match(Ie))?r.scheme=void 0:r.path=(r.path||"").toLowerCase(),Y.urn.serialize(r,n)}};Y.http=ge,Y.https=Te,Y.mailto=Ye,Y.urn=Me,Y["urn:uuid"]=Tr},61160:function(fe,o,v){var a=v(92063),e=v(73992),q=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,N=/[\n\r\t]/g,W=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,y=/:\d+$/,L=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,p=/^[a-zA-Z]:/;function I(f){return(f||"").toString().replace(q,"")}var D=[["#","hash"],["?","query"],function(u,l){return A(l.protocol)?u.replace(/\\/g,"/"):u},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],V={hash:1,query:1};function j(f){var u;typeof window<"u"?u=window:typeof v.g<"u"?u=v.g:typeof self<"u"?u=self:u={};var l=u.location||{};f=f||l;var c={},O=typeof f,S;if(f.protocol==="blob:")c=new F(unescape(f.pathname),{});else if(O==="string"){c=new F(f,{});for(S in V)delete c[S]}else if(O==="object"){for(S in f)S in V||(c[S]=f[S]);c.slashes===void 0&&(c.slashes=W.test(f.href))}return c}function A(f){return f==="file:"||f==="ftp:"||f==="http:"||f==="https:"||f==="ws:"||f==="wss:"}function C(f,u){f=I(f),f=f.replace(N,""),u=u||{};var l=L.exec(f),c=l[1]?l[1].toLowerCase():"",O=!!l[2],S=!!l[3],m=0,R;return O?S?(R=l[2]+l[3]+l[4],m=l[2].length+l[3].length):(R=l[2]+l[4],m=l[2].length):S?(R=l[3]+l[4],m=l[3].length):R=l[4],c==="file:"?m>=2&&(R=R.slice(2)):A(c)?R=l[4]:c?O&&(R=R.slice(2)):m>=2&&A(u.protocol)&&(R=l[4]),{protocol:c,slashes:O||A(c),slashesCount:m,rest:R}}function P(f,u){if(f==="")return u;for(var l=(u||"/").split("/").slice(0,-1).concat(f.split("/")),c=l.length,O=l[c-1],S=!1,m=0;c--;)l[c]==="."?l.splice(c,1):l[c]===".."?(l.splice(c,1),m++):m&&(c===0&&(S=!0),l.splice(c,1),m--);return S&&l.unshift(""),(O==="."||O==="..")&&l.push(""),l.join("/")}function F(f,u,l){if(f=I(f),f=f.replace(N,""),!(this instanceof F))return new F(f,u,l);var c,O,S,m,R,H,re=D.slice(),ie=typeof u,g=this,ne=0;for(ie!=="object"&&ie!=="string"&&(l=u,u=null),l&&typeof l!="function"&&(l=e.parse),u=j(u),O=C(f||"",u),c=!O.protocol&&!O.slashes,g.slashes=O.slashes||c&&u.slashes,g.protocol=O.protocol||u.protocol||"",f=O.rest,(O.protocol==="file:"&&(O.slashesCount!==2||p.test(f))||!O.slashes&&(O.protocol||O.slashesCount<2||!A(g.protocol)))&&(re[3]=[/(.*)/,"pathname"]);ne<re.length;ne++){if(m=re[ne],typeof m=="function"){f=m(f,g);continue}S=m[0],H=m[1],S!==S?g[H]=f:typeof S=="string"?(R=S==="@"?f.lastIndexOf(S):f.indexOf(S),~R&&(typeof m[2]=="number"?(g[H]=f.slice(0,R),f=f.slice(R+m[2])):(g[H]=f.slice(R),f=f.slice(0,R)))):(R=S.exec(f))&&(g[H]=R[1],f=f.slice(0,R.index)),g[H]=g[H]||c&&m[3]&&u[H]||"",m[4]&&(g[H]=g[H].toLowerCase())}l&&(g.query=l(g.query)),c&&u.slashes&&g.pathname.charAt(0)!=="/"&&(g.pathname!==""||u.pathname!=="")&&(g.pathname=P(g.pathname,u.pathname)),g.pathname.charAt(0)!=="/"&&A(g.protocol)&&(g.pathname="/"+g.pathname),a(g.port,g.protocol)||(g.host=g.hostname,g.port=""),g.username=g.password="",g.auth&&(R=g.auth.indexOf(":"),~R?(g.username=g.auth.slice(0,R),g.username=encodeURIComponent(decodeURIComponent(g.username)),g.password=g.auth.slice(R+1),g.password=encodeURIComponent(decodeURIComponent(g.password))):g.username=encodeURIComponent(decodeURIComponent(g.auth)),g.auth=g.password?g.username+":"+g.password:g.username),g.origin=g.protocol!=="file:"&&A(g.protocol)&&g.host?g.protocol+"//"+g.host:"null",g.href=g.toString()}function K(f,u,l){var c=this;switch(f){case"query":typeof u=="string"&&u.length&&(u=(l||e.parse)(u)),c[f]=u;break;case"port":c[f]=u,a(u,c.protocol)?u&&(c.host=c.hostname+":"+u):(c.host=c.hostname,c[f]="");break;case"hostname":c[f]=u,c.port&&(u+=":"+c.port),c.host=u;break;case"host":c[f]=u,y.test(u)?(u=u.split(":"),c.port=u.pop(),c.hostname=u.join(":")):(c.hostname=u,c.port="");break;case"protocol":c.protocol=u.toLowerCase(),c.slashes=!l;break;case"pathname":case"hash":if(u){var O=f==="pathname"?"/":"#";c[f]=u.charAt(0)!==O?O+u:u}else c[f]=u;break;case"username":case"password":c[f]=encodeURIComponent(u);break;case"auth":var S=u.indexOf(":");~S?(c.username=u.slice(0,S),c.username=encodeURIComponent(decodeURIComponent(c.username)),c.password=u.slice(S+1),c.password=encodeURIComponent(decodeURIComponent(c.password))):c.username=encodeURIComponent(decodeURIComponent(u))}for(var m=0;m<D.length;m++){var R=D[m];R[4]&&(c[R[1]]=c[R[1]].toLowerCase())}return c.auth=c.password?c.username+":"+c.password:c.username,c.origin=c.protocol!=="file:"&&A(c.protocol)&&c.host?c.protocol+"//"+c.host:"null",c.href=c.toString(),c}function z(f){(!f||typeof f!="function")&&(f=e.stringify);var u,l=this,c=l.host,O=l.protocol;O&&O.charAt(O.length-1)!==":"&&(O+=":");var S=O+(l.protocol&&l.slashes||A(l.protocol)?"//":"");return l.username?(S+=l.username,l.password&&(S+=":"+l.password),S+="@"):l.password?(S+=":"+l.password,S+="@"):l.protocol!=="file:"&&A(l.protocol)&&!c&&l.pathname!=="/"&&(S+="@"),(c[c.length-1]===":"||y.test(l.hostname)&&!l.port)&&(c+=":"),S+=c+l.pathname,u=typeof l.query=="object"?f(l.query):l.query,u&&(S+=u.charAt(0)!=="?"?"?"+u:u),l.hash&&(S+=l.hash),S}F.prototype={set:K,toString:z},F.extractProtocol=C,F.location=j,F.trimLeft=I,F.qs=e,fe.exports=F},99211:function(fe,o){Object.defineProperty(o,"__esModule",{value:!0});function v(A,C,P){var F;if(P===void 0&&(P={}),!C.codes){C.codes={};for(var K=0;K<C.chars.length;++K)C.codes[C.chars[K]]=K}if(!P.loose&&A.length*C.bits&7)throw new SyntaxError("Invalid padding");for(var z=A.length;A[z-1]==="=";)if(--z,!P.loose&&!((A.length-z)*C.bits&7))throw new SyntaxError("Invalid padding");for(var f=new((F=P.out)!=null?F:Uint8Array)(z*C.bits/8|0),u=0,l=0,c=0,O=0;O<z;++O){var S=C.codes[A[O]];if(S===void 0)throw new SyntaxError("Invalid character "+A[O]);l=l<<C.bits|S,u+=C.bits,u>=8&&(u-=8,f[c++]=255&l>>u)}if(u>=C.bits||255&l<<8-u)throw new SyntaxError("Unexpected end of data");return f}function a(A,C,P){P===void 0&&(P={});for(var F=P,K=F.pad,z=K===void 0?!0:K,f=(1<<C.bits)-1,u="",l=0,c=0,O=0;O<A.length;++O)for(c=c<<8|255&A[O],l+=8;l>C.bits;)l-=C.bits,u+=C.chars[f&c>>l];if(l&&(u+=C.chars[f&c<<C.bits-l]),z)for(;u.length*C.bits&7;)u+="=";return u}var e={chars:"0123456789ABCDEF",bits:4},q={chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bits:5},N={chars:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bits:5},W={chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bits:6},y={chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bits:6},L={parse:function(C,P){return v(C.toUpperCase(),e,P)},stringify:function(C,P){return a(C,e,P)}},p={parse:function(C,P){return P===void 0&&(P={}),v(P.loose?C.toUpperCase().replace(/0/g,"O").replace(/1/g,"L").replace(/8/g,"B"):C,q,P)},stringify:function(C,P){return a(C,q,P)}},I={parse:function(C,P){return v(C,N,P)},stringify:function(C,P){return a(C,N,P)}},D={parse:function(C,P){return v(C,W,P)},stringify:function(C,P){return a(C,W,P)}},V={parse:function(C,P){return v(C,y,P)},stringify:function(C,P){return a(C,y,P)}},j={parse:v,stringify:a};o.base16=L,o.base32=p,o.base32hex=I,o.base64=D,o.base64url=V,o.codec=j},82671:function(fe,o,v){v.d(o,{ef:function(){return y},gw:function(){return j},k5:function(){return N}});var a=v(93689);const e=a.WK,q=a.DE,N=a.k5,W=a.Dr,y=a.ef,L=a.GY,p=a.WM,I=a.Kz,D=a.uX,V=a.IK,j=a.gw,A=a.WU,C=a.G8,P=a.xQ,F=a.D7,K=a.hi,z=a.zU,f=a.dq,u=a.m$,l=a.MU,c=a.ID,O=a.k0,S=a.D4,m=a.kL,R=a.jx,H=a.A_,re=a.v1,ie=a.TL,g=a.Og,ne=a.ft,Re=a.KU,ye=a.ZU,_e=a.ye,tr=a.Xj,Or=a.Rn,br=a.bo,de=a.KL,Y=a.rW,Q=a.U3,he=a.$Y,De=a.EJ,ar=a.XY,or=a.v7,te=a.up,sr=a.h,je=a.Cx,He=a.Zz,qe=a.CU,Cr=a.ib,ir=a.eT,pe=a._0,J=a.UR,cr=a.Up,Sr=a.y0,Pr=a.A2,Ir=a.ql,Ar=a.FX,ae=a.Jr,ge=a.zS,Te=a.pK,ve=a.ud,Ve=a.Zk,Ee=a.Mf,G=a.U0,we=a.CX,ce=a.l4,Oe=a.Jv,be=a.T0,Ce=a.z8,$e=a.Gt,Ue=a.Fm,Ne=a.b4,Se=a.N2,Pe=a.K8,Le=a.gB,k=a.bd,ur=a.GG,Ke=a.V$,ze=a.CC,Ge=a.dT,lr=a.uT,Ze=a._j,Xe=a.p4,fr=a.W0,mr=a.zk,dr=a.AB,ue=a.sn,hr=a._u,Rr=a.Py,We=a.iu,pr=a.l7,_r=a.JU,Er=a.O6}}]);
|
|
1
|
+
"use strict";(self.webpackChunkedge_currency_accountbased=self.webpackChunkedge_currency_accountbased||[]).push([[597],{66863:function(fe,o){Object.defineProperty(o,"__esModule",{value:!0});function R(s){switch(typeof s){case"function":case"object":return s==null?"null":Array.isArray(s)?"array":typeof s;case"string":return JSON.stringify(s);default:return String(s)}}function a(s,f){return function(C){return C!=null?s(C):typeof f=="function"?f():f}}function e(){for(var s=arguments.length,f=new Array(s),y=0;y<s;y++)f[y]=arguments[y];return function(T){for(var U=0;U<f.length;++U)if(T===f[U])return T;var $="Expected ";f.length!==1&&($+="one of: ");for(var p=0;p<f.length;++p)p>0&&($+=" | "),$+=JSON.stringify(f[p]);throw $+=", got "+R(T),new TypeError($)}}function G(s){if(typeof s!="boolean")throw new TypeError("Expected a boolean, got "+R(s));return s}function M(s){if(typeof s!="number")throw new TypeError("Expected a number, got "+R(s));return s}function Z(s){if(typeof s!="string")throw new TypeError("Expected a string, got "+R(s));return s}var w=e(null),j=e(void 0);function b(s){return s}var _=a(w);function m(s,f,y){return s instanceof Error&&(s.insertStepAt==null&&(s.message+=" at ",s.insertStepAt=s.message.length),s.message=s.message.slice(0,s.insertStepAt)+f+s.message.slice(s.insertStepAt),s.insertStepAt+=y),s}function J(s){return function(y){if(!Array.isArray(y))throw new TypeError("Expected an array, got "+R(y));for(var C=[],T=0;T<y.length;++T)try{C[T]=s(y[T])}catch(U){throw m(U,"["+T+"]",0)}return C}}function K(s){if(typeof s=="function")return function(U){if(typeof U!="object"||U==null)throw new TypeError("Expected an object, got "+R(U));for(var $={},p=Object.keys(U),z=0;z<p.length;++z){var ee=p[z];if(ee!=="__proto__")try{$[ee]=s(U[ee])}catch(ne){throw m(ne,"["+JSON.stringify(ee)+"]",0)}}return $};var f=Object.keys(s);function y(T){return function($){if(typeof $!="object"||$==null)throw new TypeError("Expected an object, got "+R($));var p,z={};if(T){var ee=Object.keys($);for(p=0;p<ee.length;++p){var ne=ee[p];ne!=="__proto__"&&(z[ne]=$[ne])}}for(p=0;p<f.length;++p){var se=f[p];try{z[se]=s[se]($[se])}catch(Oe){throw m(Oe,"."+se,0)}}return z}}var C=y(!1);return C.shape=s,C.withRest=y(!0),C}var v=K;function P(){for(var s=arguments.length,f=new Array(s),y=0;y<s;y++)f[y]=arguments[y];function C(T){if(!Array.isArray(T))throw new TypeError("Expected an array, got "+R(T));for(var U=[],$=0;$<f.length;++$)try{U[$]=f[$](T[$])}catch(p){throw m(p,"["+$+"]")}return U}return C}function I(){for(var s=arguments.length,f=new Array(s),y=0;y<s;y++)f[y]=arguments[y];return function(T){for(var U=0;U<f.length;U++)try{return f[U](T)}catch($){if(U+1>=f.length)throw $}}}function B(s,f){return function(C){try{return s(C)}catch{return typeof f=="function"?f():f}}}function k(s,f){return function(C){return h[l]>0?f(C):s(C)}}function X(s){return function(y){h[l]==null&&Object.defineProperty(h,l,{value:0,writable:!0});try{return++h[l],s(y)}finally{--h[l]}}}var h=typeof globalThis=="object"&&globalThis!=null?globalThis:JSON,l=typeof Symbol=="function"?Symbol.for("uncleaning"):"uncleaning",d=k(function(f){if(typeof f!="string"&&!(f instanceof Date))throw new TypeError("Expected a date string, got "+R(f));var y=new Date(f);if(y.toJSON()==null)throw new TypeError("Invalid date format, got "+R(f));return y},function(f){return f.toISOString()});function u(s){return k(function(y){var C=JSON.parse(Z(y));try{return s(C)}catch(T){throw m(T,"JSON.parse()",11)}},function(y){return JSON.stringify(s(y))})}o.asArray=J,o.asBoolean=G,o.asCodec=k,o.asDate=d,o.asEither=I,o.asJSON=u,o.asMap=v,o.asMaybe=B,o.asNone=_,o.asNull=w,o.asNumber=M,o.asObject=K,o.asOptional=a,o.asString=Z,o.asTuple=P,o.asUndefined=j,o.asUnknown=b,o.asValue=e,o.uncleaner=X},93689:function(fe,o,R){var a;a={value:!0};var e=R(66863),G=R(99211);const M=e.asCodec(S=>G.base16.parse(e.asString(S)),S=>G.base16.stringify(S).toLowerCase()),Z=e.asCodec(S=>G.base32.parse(e.asString(S),{loose:!0}),S=>G.base32.stringify(S,{pad:!1})),w=e.asCodec(S=>G.base64.parse(e.asString(S)),S=>G.base64.stringify(S)),j=e.asObject({voucherId:e.asString,activates:e.asDate,created:e.asDate,ip:e.asString,ipDescription:e.asString,deviceDescription:e.asOptional(e.asString)}),b=e.asObject({encryptionType:e.asNumber,data_base64:w,iv_hex:M}),_=e.asObject({created:e.asOptional(e.asDate),data_base64:w,encryptionType:e.asNumber,iv_hex:M}),m=e.asObject({salt_hex:M,n:e.asNumber,r:e.asNumber,p:e.asNumber}),J=e.asObject({loginRequest:e.asOptional(e.asObject({appId:e.asString}).withRest),publicKey:w,timeout:e.asOptional(e.asNumber)}).withRest,K=e.asObject({publicKey:w,box:b}),v=e.asArray(w),P=e.asObject({data:e.asUnknown,challengeId:e.asOptional(e.asString),deviceDescription:e.asOptional(e.asString),otp:e.asOptional(e.asString),syncToken:e.asOptional(e.asString),voucherId:e.asOptional(e.asString),voucherAuth:e.asOptional(w),loginId:e.asOptional(w),loginAuth:e.asOptional(w),userId:e.asOptional(w),passwordAuth:e.asOptional(w),pin2Id:e.asOptional(w),pin2Auth:e.asOptional(w),recovery2Id:e.asOptional(w),recovery2Auth:e.asOptional(v),loginIds:e.asOptional(e.asArray(w)),otpResetAuth:e.asOptional(e.asString),did:e.asOptional(e.asString),l1:e.asOptional(w),lp1:e.asOptional(w),lpin1:e.asOptional(w),lra1:e.asOptional(w),recoveryAuth:e.asOptional(w)}),I=e.asObject({results:e.asOptional(e.asUnknown),status_code:e.asNumber,message:e.asString}),B=e.asObject({otpTimeout:e.asOptional(e.asNumber,7*24*60*60),otpKey:Z}),k=e.asObject({passwordAuth:w,passwordAuthBox:b,passwordAuthSnrp:m,passwordBox:b,passwordKeySnrp:m}),X=e.asObject({pin2Id:w}),h=e.asObject({pin2Id:e.asOptional(w),pin2Auth:e.asOptional(w),pin2Box:e.asOptional(b),pin2KeyBox:e.asOptional(b),pin2TextBox:b}),l=e.asObject({recovery2Id:w}),d=e.asObject({recovery2Id:w,recovery2Auth:v,recovery2Box:b,recovery2KeyBox:b,question2Box:b}),u=e.asObject({loginAuthBox:b,loginAuth:w}),s=e.asObject({userId:w,userTextBox:b}),f=e.asObject({approvedVouchers:e.asOptional(e.asArray(e.asString)),rejectedVouchers:e.asOptional(e.asArray(e.asString))}),y=e.asObject({keyBoxes:e.asArray(b),newSyncKeys:e.asOptional(e.asArray(e.asString),()=>[])}),C=e.asObject({appId:e.asString,loginId:w,parentBox:e.asOptional(b)}),T=e.asObject({challengeId:e.asString,challengeUri:e.asString}),U=e.asObject({challengeId:e.asString,challengeUri:e.asOptional(e.asString)}),$=e.asObject({request:J,replies:e.asArray(K)}),p=e.asValue(!0),z=e.asObject({appId:e.asString,created:e.asDate,loginId:w,syncToken:e.asOptional(e.asString),children:e.asOptional(e.asArray(S=>z(S))),parentBox:e.asOptional(b),otpKey:e.asOptional(e.asEither(p,Z)),otpResetDate:e.asOptional(e.asDate),otpTimeout:e.asOptional(e.asNumber),passwordAuthBox:e.asOptional(b),passwordAuthSnrp:e.asOptional(m),passwordBox:e.asOptional(e.asEither(p,b)),passwordKeySnrp:e.asOptional(m),pin2Box:e.asOptional(e.asEither(p,b)),pin2KeyBox:e.asOptional(b),pin2TextBox:e.asOptional(b),question2Box:e.asOptional(b),recovery2Box:e.asOptional(e.asEither(p,b)),recovery2KeyBox:e.asOptional(b),loginAuthBox:e.asOptional(b),userId:e.asOptional(w),userTextBox:e.asOptional(b),pendingVouchers:e.asOptional(e.asArray(j),()=>[]),keyBoxes:e.asOptional(e.asArray(_)),mnemonicBox:e.asOptional(b),rootKeyBox:e.asOptional(b),syncKeyBox:e.asOptional(b)}),ee=e.asArray(e.asObject({loginId:w,otpResetPending:e.asOptional(e.asBoolean,!1),pendingVouchers:e.asOptional(e.asArray(j),()=>[]),recovery2Corrupt:e.asOptional(e.asBoolean,!1)})),ne=e.asObject({login_id:e.asOptional(w),otp_reset_auth:e.asOptional(e.asString),otp_timeout_date:e.asOptional(e.asDate),reason:e.asOptional(e.asValue("ip","otp"),"otp"),voucher_activates:e.asOptional(e.asDate),voucher_auth:e.asOptional(w),voucher_id:e.asOptional(e.asString)}),se=e.asObject({otpResetDate:e.asDate}),Oe=e.asObject({wait_seconds:e.asOptional(e.asNumber)}),rr=e.asObject({question2Box:b}),nr=e.asObject({loginId:w,passwordAuthSnrp:e.asOptional(m),questionBox:e.asOptional(b),questionKeySnrp:e.asOptional(m),recoveryAuthSnrp:e.asOptional(m)}),Ee=e.uncleaner(b),re=e.uncleaner(K),te=e.uncleaner(J),ye=e.uncleaner(P),_e=e.uncleaner(I),tr=e.uncleaner(B),ar=e.uncleaner(k),ie=e.uncleaner(X),or=e.uncleaner(h),He=e.uncleaner(l),qe=e.uncleaner(d),Ve=e.uncleaner(u),Or=e.uncleaner(s),sr=e.uncleaner(f),ge=e.uncleaner(y),ae=e.uncleaner(C),ir=e.uncleaner(T),br=e.uncleaner(U),Cr=e.uncleaner($),Sr=e.uncleaner(z),Pr=e.uncleaner(ee),ce=e.uncleaner(ne),be=e.uncleaner(se),cr=e.uncleaner(Oe),ur=e.uncleaner(rr),Ar=e.uncleaner(nr);function we(S,E="Login requires a CAPTCHA"){if(!(this instanceof we))throw new TypeError("Class constructor ChallengeError cannot be invoked without 'new'");var g;function A(L){return g=new Error(L),Object.defineProperty(g,"constructor",{value:we,configurable:!0,writable:!0}),g}return A(E),g.name="ChallengeError",g.challengeId=S.challengeId,g.challengeUri=S.challengeUri,g}function W(S="Please send a larger amount"){if(!(this instanceof W))throw new TypeError("Class constructor DustSpendError cannot be invoked without 'new'");var E;function g(A){return E=new Error(A),Object.defineProperty(E,"constructor",{value:W,configurable:!0,writable:!0}),E}return g(S),E.name="DustSpendError",E}function Ce(S){if(!(this instanceof Ce))throw new TypeError("Class constructor InsufficientFundsError cannot be invoked without 'new'");var E;function g(oe){return E=new Error(oe),Object.defineProperty(E,"constructor",{value:Ce,configurable:!0,writable:!0}),E}const{tokenId:A=null,networkFee:L}=S!=null?S:{};return g(`Insufficient ${A!=null?A:"funds"}`),E.tokenId=A,E.networkFee=L,E.name="InsufficientFundsError",E}function de(S="Cannot reach the network"){if(!(this instanceof de))throw new TypeError("Class constructor NetworkError cannot be invoked without 'new'");var E;function g(A){return E=new Error(A),Object.defineProperty(E,"constructor",{value:de,configurable:!0,writable:!0}),E}return g(S),E.name="NetworkError",E}function Se(S="Unable to create zero-amount transaction."){if(!(this instanceof Se))throw new TypeError("Class constructor NoAmountSpecifiedError cannot be invoked without 'new'");var E;function g(A){return E=new Error(A),Object.defineProperty(E,"constructor",{value:Se,configurable:!0,writable:!0}),E}return g(S),E.name="NoAmountSpecifiedError",E}function Pe(S="The application is too old. Please upgrade."){if(!(this instanceof Pe))throw new TypeError("Class constructor ObsoleteApiError cannot be invoked without 'new'");var E;function g(A){return E=new Error(A),Object.defineProperty(E,"constructor",{value:Pe,configurable:!0,writable:!0}),E}return g(S),E.name="ObsoleteApiError",E}function Ae(S,E="Invalid OTP token"){if(!(this instanceof Ae))throw new TypeError("Class constructor OtpError cannot be invoked without 'new'");var g;function A(oe){return g=new Error(oe),Object.defineProperty(g,"constructor",{value:Ae,configurable:!0,writable:!0}),g}A(E),g.name="OtpError",g.reason="otp";const L=e.asMaybe(ne)(S);if(L!=null)return L.login_id!=null&&(g.loginId=G.base64.stringify(L.login_id)),g.resetToken=L.otp_reset_auth,g.reason=L.reason,g.resetDate=L.otp_timeout_date,g.voucherActivates=L.voucher_activates,L.voucher_auth!=null&&(g.voucherAuth=G.base64.stringify(L.voucher_auth)),g.voucherId=L.voucher_id,g}function De(S,E="Invalid password"){if(!(this instanceof De))throw new TypeError("Class constructor PasswordError cannot be invoked without 'new'");var g;function A(oe){return g=new Error(oe),Object.defineProperty(g,"constructor",{value:De,configurable:!0,writable:!0}),g}A(E),g.name="PasswordError";const L=e.asMaybe(Oe)(S);if(L!=null)return g.wait=L.wait_seconds,g}function $e(S="Not enough confirmed funds"){if(!(this instanceof $e))throw new TypeError("Class constructor PendingFundsError cannot be invoked without 'new'");var E;function g(A){return E=new Error(A),Object.defineProperty(E,"constructor",{value:$e,configurable:!0,writable:!0}),E}return g(S),E.name="PendingFundsError",E}function Ne(S="Wallets can not be the same currency"){if(!(this instanceof Ne))throw new TypeError("Class constructor SameCurrencyError cannot be invoked without 'new'");var E;function g(A){return E=new Error(A),Object.defineProperty(E,"constructor",{value:Ne,configurable:!0,writable:!0}),E}return g(S),E.name="SameCurrencyError",E}function me(S="Spending to self"){if(!(this instanceof me))throw new TypeError("Class constructor SpendToSelfError cannot be invoked without 'new'");var E;function g(A){return E=new Error(A),Object.defineProperty(E,"constructor",{value:me,configurable:!0,writable:!0}),E}return g(S),E.name="SpendToSelfError",E}function Ie(S,E,g="from"){if(!(this instanceof Ie))throw new TypeError("Class constructor SwapAboveLimitError cannot be invoked without 'new'");var A;function L(oe){return A=new Error(oe),Object.defineProperty(A,"constructor",{value:Ie,configurable:!0,writable:!0}),A}return L("Amount is too high"),A.name="SwapAboveLimitError",A.pluginId=S.pluginId,A.nativeMax=E,A.direction=g,A}function Ue(S,E,g="from"){if(!(this instanceof Ue))throw new TypeError("Class constructor SwapBelowLimitError cannot be invoked without 'new'");var A;function L(oe){return A=new Error(oe),Object.defineProperty(A,"constructor",{value:Ue,configurable:!0,writable:!0}),A}return L("Amount is too low"),A.name="SwapBelowLimitError",A.pluginId=S.pluginId,A.nativeMin=E,A.direction=g,A}function Le(S,E){if(!(this instanceof Le))throw new TypeError("Class constructor SwapCurrencyError cannot be invoked without 'new'");var g;function A(N){return g=new Error(N),Object.defineProperty(g,"constructor",{value:Le,configurable:!0,writable:!0}),g}const{fromWallet:L,toWallet:oe,fromTokenId:r,toTokenId:n}=E,t=L.currencyConfig.currencyInfo.pluginId,c=oe.currencyConfig.currencyInfo.pluginId,i=`${t}:${String(r)}`,O=`${c}:${String(n)}`;return A(`${S.displayName} does not support ${i} to ${O}`),g.name="SwapCurrencyError",g.pluginId=S.pluginId,g.fromTokenId=r!=null?r:null,g.toTokenId=n!=null?n:null,g}function Fe(S,E){if(!(this instanceof Fe))throw new TypeError("Class constructor SwapPermissionError cannot be invoked without 'new'");var g;function A(L){return g=new Error(L),Object.defineProperty(g,"constructor",{value:Fe,configurable:!0,writable:!0}),g}return E!=null?A(E):A("You are not allowed to make this trade"),g.name="SwapPermissionError",g.pluginId=S.pluginId,g.reason=E,g}function Re(S="Invalid username"){if(!(this instanceof Re))throw new TypeError("Class constructor UsernameError cannot be invoked without 'new'");var E;function g(A){return E=new Error(A),Object.defineProperty(E,"constructor",{value:Re,configurable:!0,writable:!0}),E}return g(S),E.name="UsernameError",E}function H(S){return function(g){if(g instanceof Error&&g.name===S)return g}}const Ke=H("ChallengeError"),lr=H("DustSpendError"),ze=H("InsufficientFundsError"),Ge=H("NetworkError"),fr=H("NoAmountSpecifiedError"),mr=H("ObsoleteApiError"),dr=H("OtpError"),he=H("PasswordError"),hr=H("PendingFundsError"),Ir=H("SameCurrencyError"),Je=H("SpendToSelfError"),pr=H("SwapAboveLimitError"),Rr=H("SwapBelowLimitError"),vr=H("SwapCurrencyError"),Me=H("SwapPermissionError"),Er=H("UsernameError"),je=e.asObject(b),yr=e.asObject({loginId:w,voucherAuth:w,voucherId:e.asString,created:e.asDate,activates:e.asDate,status:e.asValue("pending","approved","rejected"),ip:e.asString,ipDescription:e.asString,deviceDescription:e.asOptional(e.asString)}),Ze=e.asObject({appId:e.asString,created:e.asOptional(e.asDate,()=>new Date),loginId:w,children:e.asOptional(e.asArray(S=>Ze(S)),()=>[]),parentBox:e.asOptional(b),parentId:()=>{},otpKey:e.asOptional(Z),otpResetAuth:e.asOptional(e.asString),otpResetDate:e.asOptional(e.asDate),otpTimeout:e.asOptional(e.asNumber),passwordAuth:e.asOptional(w),passwordAuthBox:e.asOptional(b),passwordAuthSnrp:e.asOptional(m),passwordBox:e.asOptional(b),passwordKeySnrp:e.asOptional(m),pin2Id:e.asOptional(w),pin2Auth:e.asOptional(w),pin2Box:e.asOptional(b),pin2KeyBox:e.asOptional(b),pin2TextBox:e.asOptional(b),recovery2Id:e.asOptional(w),recovery2Auth:e.asOptional(v),question2Box:e.asOptional(b),recovery2Box:e.asOptional(b),recovery2KeyBox:e.asOptional(b),loginAuth:e.asOptional(w),loginAuthBox:e.asOptional(b),userId:e.asOptional(w),userTextBox:e.asOptional(b),keyBoxes:e.asOptional(e.asArray(_),()=>[]),mnemonicBox:e.asOptional(b),rootKeyBox:e.asOptional(b),syncKeyBox:e.asOptional(b),vouchers:e.asOptional(e.asArray(yr),()=>[]),pinBox:e.asOptional(b),pinId:e.asOptional(e.asString),pinKeyBox:e.asOptional(b)}),Tr=e.uncleaner(Ze),_r=e.uncleaner(je);o.WK=we,o.DE=W,o.k5=Ce,o.Dr=de,o.ef=Se,o.GY=Pe,o.WM=Ae,o.Kz=De,o.uX=$e,o.IK=Ne,o.gw=me,o.WU=Ie,o.G8=Ue,o.xQ=Le,o.D7=Fe,o.hi=Re,o.zU=M,o.dq=Z,o.m$=w,o.MU=T,o.ID=B,o.k0=k,o.D4=X,o.kL=h,o.jx=l,o.A_=d,o.v1=u,o.TL=s,o.Og=f,o.mq=U,o.ft=y,o.KU=C,o.ZU=b,o.sF=_,o.ye=K,o.Xj=J,o.Rn=Ze,o.bo=j,o.KL=je,o.rW=m,o.U3=yr,o.$Y=$,o.EJ=z,o.XY=P,o.v7=I,o.up=Ke,o.h=lr,o.Cx=ze,o.Zz=Ge,o.CU=fr,o.ib=mr,o.eT=dr,o._0=he,o.UR=hr,o.Up=Ir,o.y0=Je,o.A2=pr,o.ql=Rr,o.FX=vr,o.Jr=Me,o.zS=Er,o.pK=ee,o.ud=ne,o.Zk=se,o.Mf=Oe,o.U0=v,o.CX=rr,o.l4=nr,o.Jv=ir,o.T0=tr,o.z8=ar,o.Gt=ie,o.Fm=or,o.b4=He,o.N2=qe,o.K8=Ve,o.gB=Or,o.bd=sr,o.z2=br,o.GG=ge,o.V$=ae,o.CC=Ee,o.dT=re,o.uT=te,o._j=Tr,o.p4=_r,o.W0=Cr,o.zk=Sr,o.AB=ye,o.sn=_e,o._u=Pr,o.Py=ce,o.iu=be,o.l7=cr,o.JU=ur,o.O6=Ar},73992:function(fe,o){var R=Object.prototype.hasOwnProperty,a;function e(w){try{return decodeURIComponent(w.replace(/\+/g," "))}catch{return null}}function G(w){try{return encodeURIComponent(w)}catch{return null}}function M(w){for(var j=/([^=?&]+)=?([^&]*)/g,b={},_;_=j.exec(w);){var m=e(_[1]),J=e(_[2]);m===null||J===null||m in b||(b[m]=J)}return b}function Z(w,j){j=j||"";var b=[],_,m;typeof j!="string"&&(j="?");for(m in w)if(R.call(w,m)){if(_=w[m],!_&&(_===null||_===a||isNaN(_))&&(_=""),m=encodeURIComponent(m),_=encodeURIComponent(_),m===null||_===null)continue;b.push(m+"="+_)}return b.length?j+b.join("&"):""}o.stringify=Z,o.parse=M},92063:function(fe){fe.exports=function(R,a){if(a=a.split(":")[0],R=+R,!R)return!1;switch(a){case"http":case"ws":return R!==80;case"https":case"wss":return R!==443;case"ftp":return R!==21;case"gopher":return R!==70;case"file":return!1}return R!==0}},63054:function(fe,o,R){R.d(o,{lK:function(){return ae}});function a(...r){if(r.length>1){r[0]=r[0].slice(0,-1);const n=r.length-1;for(let t=1;t<n;++t)r[t]=r[t].slice(1,-1);return r[n]=r[n].slice(1),r.join("")}else return r[0]}function e(r){return"(?:"+r+")"}function G(r){return r===void 0?"undefined":r===null?"null":Object.prototype.toString.call(r).split(" ").pop().split("]").shift().toLowerCase()}function M(r){return r.toUpperCase()}function Z(r){return r!=null?r instanceof Array?r:typeof r.length!="number"||r.split||r.setInterval||r.call?[r]:Array.prototype.slice.call(r):[]}function w(r){const n="[A-Za-z]",t="[\\x0D]",c="[0-9]",i="[\\x22]",O=a(c,"[A-Fa-f]"),N="[\\x0A]",q="[\\x20]",F=e(e("%[EFef]"+O+"%"+O+O+"%"+O+O)+"|"+e("%[89A-Fa-f]"+O+"%"+O+O)+"|"+e("%"+O+O)),Y="[\\:\\/\\?\\#\\[\\]\\@]",D="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",Q=a(Y,D),ue=r?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",le=r?"[\\uE000-\\uF8FF]":"[]",V=a(n,c,"[\\-\\.\\_\\~]",ue),ve=e(n+a(n,c,"[\\+\\-\\.]")+"*"),Xe=e(e(F+"|"+a(V,D,"[\\:]"))+"*"),gr=e(e("25[0-5]")+"|"+e("2[0-4]"+c)+"|"+e("1"+c+c)+"|"+e("[1-9]"+c)+"|"+c),$r=e(gr+"\\."+gr+"\\."+gr+"\\."+gr),x=e(O+"{1,4}"),Te=e(e(x+"\\:"+x)+"|"+$r),jr=e(e(x+"\\:")+"{6}"+Te),Br=e("\\:\\:"+e(x+"\\:")+"{5}"+Te),xr=e(e(x)+"?\\:\\:"+e(x+"\\:")+"{4}"+Te),kr=e(e(e(x+"\\:")+"{0,1}"+x)+"?\\:\\:"+e(x+"\\:")+"{3}"+Te),Hr=e(e(e(x+"\\:")+"{0,2}"+x)+"?\\:\\:"+e(x+"\\:")+"{2}"+Te),qr=e(e(e(x+"\\:")+"{0,3}"+x)+"?\\:\\:"+x+"\\:"+Te),Vr=e(e(e(x+"\\:")+"{0,4}"+x)+"?\\:\\:"+Te),Kr=e(e(e(x+"\\:")+"{0,5}"+x)+"?\\:\\:"+x),zr=e(e(e(x+"\\:")+"{0,6}"+x)+"?\\:\\:"),Nr=e([jr,Br,xr,kr,Hr,qr,Vr,Kr,zr].join("|")),Gr=e("[vV]"+O+"+\\."+a(V,D,"[\\:]")+"+"),Jr=e("\\["+e(Nr+"|"+Gr)+"\\]"),Ur=e(e(F+"|"+a(V,D))+"*"),We=e(Jr+"|"+$r+"(?!"+Ur+")|"+Ur),Ye=e(c+"*"),Lr=e(e(Xe+"@")+"?"+We+e("\\:"+Ye)+"?"),Qe=e(F+"|"+a(V,D,"[\\:\\@]")),Zr=e(Qe+"*"),Fr=e(Qe+"+"),Xr=e(e(F+"|"+a(V,D,"[\\@]"))+"+"),pe=e(e("\\/"+Zr)+"*"),Be=e("\\/"+e(Fr+pe)+"?"),Dr=e(Xr+pe),wr=e(Fr+pe),xe="(?!"+Qe+")",en=e(pe+"|"+Be+"|"+Dr+"|"+wr+"|"+xe),ke=e(e(Qe+"|"+a("[\\/\\?]",le))+"*"),er=e(e(Qe+"|[\\/\\?]")+"*"),Mr=e(e("\\/\\/"+Lr+pe)+"|"+Be+"|"+wr+"|"+xe),Wr=e(ve+"\\:"+Mr+e("\\?"+ke)+"?"+e("\\#"+er)+"?"),Yr=e(e("\\/\\/"+Lr+pe)+"|"+Be+"|"+Dr+"|"+xe),Qr=e(Yr+e("\\?"+ke)+"?"+e("\\#"+er)+"?"),rn=e(Wr+"|"+Qr),nn=e(ve+"\\:"+Mr+e("\\?"+ke)+"?"),tn="^("+ve+")\\:"+e(e("\\/\\/("+e("("+Xe+")@")+"?("+We+")"+e("\\:("+Ye+")")+"?)")+"?("+pe+"|"+Be+"|"+wr+"|"+xe+")")+e("\\?("+ke+")")+"?"+e("\\#("+er+")")+"?$",an="^(){0}"+e(e("\\/\\/("+e("("+Xe+")@")+"?("+We+")"+e("\\:("+Ye+")")+"?)")+"?("+pe+"|"+Be+"|"+Dr+"|"+xe+")")+e("\\?("+ke+")")+"?"+e("\\#("+er+")")+"?$",on="^("+ve+")\\:"+e(e("\\/\\/("+e("("+Xe+")@")+"?("+We+")"+e("\\:("+Ye+")")+"?)")+"?("+pe+"|"+Be+"|"+wr+"|"+xe+")")+e("\\?("+ke+")")+"?$",sn="^"+e("\\#("+er+")")+"?$",cn="^"+e("("+Xe+")@")+"?("+We+")"+e("\\:("+Ye+")")+"?$";return{NOT_SCHEME:new RegExp(a("[^]",n,c,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(a("[^\\%\\:]",V,D),"g"),NOT_HOST:new RegExp(a("[^\\%\\[\\]\\:]",V,D),"g"),NOT_PATH:new RegExp(a("[^\\%\\/\\:\\@]",V,D),"g"),NOT_PATH_NOSCHEME:new RegExp(a("[^\\%\\/\\@]",V,D),"g"),NOT_QUERY:new RegExp(a("[^\\%]",V,D,"[\\:\\@\\/\\?]",le),"g"),NOT_FRAGMENT:new RegExp(a("[^\\%]",V,D,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(a("[^]",V,D),"g"),UNRESERVED:new RegExp(V,"g"),OTHER_CHARS:new RegExp(a("[^\\%]",V,Q),"g"),PCT_ENCODED:new RegExp(F,"g"),IPV6ADDRESS:new RegExp("\\[?("+Nr+")\\]?","g")}}var j=w(!1),b=w(!0);const _=2147483647,m=36,J=1,K=26,v=38,P=700,I=72,B=128,k="-",X=/^xn--/,h=/[^\0-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},u=m-J,s=Math.floor,f=String.fromCharCode;function y(r){throw new RangeError(d[r])}function C(r,n){const t=[];let c=r.length;for(;c--;)t[c]=n(r[c]);return t}function T(r,n){const t=r.split("@");let c="";t.length>1&&(c=t[0]+"@",r=t[1]),r=r.replace(l,".");const i=r.split("."),O=C(i,n).join(".");return c+O}function U(r){const n=[];let t=0;const c=r.length;for(;t<c;){const i=r.charCodeAt(t++);if(i>=55296&&i<=56319&&t<c){const O=r.charCodeAt(t++);(O&64512)==56320?n.push(((i&1023)<<10)+(O&1023)+65536):(n.push(i),t--)}else n.push(i)}return n}const $=r=>String.fromCodePoint(...r),p=function(r){return r-48<10?r-22:r-65<26?r-65:r-97<26?r-97:m},z=function(r,n){return r+22+75*(r<26)-((n!=0)<<5)},ee=function(r,n,t){let c=0;for(r=t?s(r/P):r>>1,r+=s(r/n);r>u*K>>1;c+=m)r=s(r/u);return s(c+(u+1)*r/(r+v))},ne=function(r){const n=[],t=r.length;let c=0,i=B,O=I,N=r.lastIndexOf(k);N<0&&(N=0);for(let q=0;q<N;++q)r.charCodeAt(q)>=128&&y("not-basic"),n.push(r.charCodeAt(q));for(let q=N>0?N+1:0;q<t;){let F=c;for(let D=1,Q=m;;Q+=m){q>=t&&y("invalid-input");const ue=p(r.charCodeAt(q++));(ue>=m||ue>s((_-c)/D))&&y("overflow"),c+=ue*D;const le=Q<=O?J:Q>=O+K?K:Q-O;if(ue<le)break;const V=m-le;D>s(_/V)&&y("overflow"),D*=V}const Y=n.length+1;O=ee(c-F,Y,F==0),s(c/Y)>_-i&&y("overflow"),i+=s(c/Y),c%=Y,n.splice(c++,0,i)}return String.fromCodePoint(...n)},se=function(r){const n=[];r=U(r);let t=r.length,c=B,i=0,O=I;for(const F of r)F<128&&n.push(f(F));let N=n.length,q=N;for(N&&n.push(k);q<t;){let F=_;for(const D of r)D>=c&&D<F&&(F=D);const Y=q+1;F-c>s((_-i)/Y)&&y("overflow"),i+=(F-c)*Y,c=F;for(const D of r)if(D<c&&++i>_&&y("overflow"),D==c){let Q=i;for(let ue=m;;ue+=m){const le=ue<=O?J:ue>=O+K?K:ue-O;if(Q<le)break;const V=Q-le,ve=m-le;n.push(f(z(le+V%ve,0))),Q=s(V/ve)}n.push(f(z(Q,0))),O=ee(i,Y,q==N),i=0,++q}++i,++c}return n.join("")};var Ee={version:"2.1.0",ucs2:{decode:U,encode:$},decode:ne,encode:se,toASCII:function(r){return T(r,function(n){return h.test(n)?"xn--"+se(n):n})},toUnicode:function(r){return T(r,function(n){return X.test(n)?ne(n.slice(4).toLowerCase()):n})}};const re={};function te(r){const n=r.charCodeAt(0);let t;return n<16?t="%0"+n.toString(16).toUpperCase():n<128?t="%"+n.toString(16).toUpperCase():n<2048?t="%"+(n>>6|192).toString(16).toUpperCase()+"%"+(n&63|128).toString(16).toUpperCase():t="%"+(n>>12|224).toString(16).toUpperCase()+"%"+(n>>6&63|128).toString(16).toUpperCase()+"%"+(n&63|128).toString(16).toUpperCase(),t}function ye(r){let n="",t=0;const c=r.length;for(;t<c;){const i=parseInt(r.substr(t+1,2),16);if(i<128)n+=String.fromCharCode(i),t+=3;else if(i>=194&&i<224){if(c-t>=6){const O=parseInt(r.substr(t+4,2),16);n+=String.fromCharCode((i&31)<<6|O&63)}else n+=r.substr(t,6);t+=6}else if(i>=224){if(c-t>=9){const O=parseInt(r.substr(t+4,2),16),N=parseInt(r.substr(t+7,2),16);n+=String.fromCharCode((i&15)<<12|(O&63)<<6|N&63)}else n+=r.substr(t,9);t+=9}else n+=r.substr(t,3),t+=3}return n}function _e(r,n){function t(c){const i=ye(c);return i.match(n.UNRESERVED)?i:c}return r.scheme&&(r.scheme=String(r.scheme).replace(n.PCT_ENCODED,t).toLowerCase().replace(n.NOT_SCHEME,"")),r.userinfo!==void 0&&(r.userinfo=String(r.userinfo).replace(n.PCT_ENCODED,t).replace(n.NOT_USERINFO,te).replace(n.PCT_ENCODED,M)),r.host!==void 0&&(r.host=String(r.host).replace(n.PCT_ENCODED,t).toLowerCase().replace(n.NOT_HOST,te).replace(n.PCT_ENCODED,M)),r.path!==void 0&&(r.path=String(r.path).replace(n.PCT_ENCODED,t).replace(r.scheme?n.NOT_PATH:n.NOT_PATH_NOSCHEME,te).replace(n.PCT_ENCODED,M)),r.query!==void 0&&(r.query=String(r.query).replace(n.PCT_ENCODED,t).replace(n.NOT_QUERY,te).replace(n.PCT_ENCODED,M)),r.fragment!==void 0&&(r.fragment=String(r.fragment).replace(n.PCT_ENCODED,t).replace(n.NOT_FRAGMENT,te).replace(n.PCT_ENCODED,M)),r}const tr=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[\dA-F:.]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,ar="".match(/(){0}/)[1]===void 0;function ie(r,n={}){const t={},c=n.iri!==!1?IRI_PROTOCOL:URI_PROTOCOL;n.reference==="suffix"&&(r=(n.scheme?n.scheme+":":"")+"//"+r);const i=r.match(tr);if(i){ar?(t.scheme=i[1],t.userinfo=i[3],t.host=i[4],t.port=parseInt(i[5],10),t.path=i[6]||"",t.query=i[7],t.fragment=i[8],isNaN(t.port)&&(t.port=i[5])):(t.scheme=i[1]||void 0,t.userinfo=r.indexOf("@")!==-1?i[3]:void 0,t.host=r.indexOf("//")!==-1?i[4]:void 0,t.port=parseInt(i[5],10),t.path=i[6]||"",t.query=r.indexOf("?")!==-1?i[7]:void 0,t.fragment=r.indexOf("#")!==-1?i[8]:void 0,isNaN(t.port)&&(t.port=r.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),t.host&&(t.host=t.host.replace(c.IPV6ADDRESS,"$1")),t.scheme===void 0&&t.userinfo===void 0&&t.host===void 0&&t.port===void 0&&!t.path&&t.query===void 0?t.reference="same-document":t.scheme===void 0?t.reference="relative":t.fragment===void 0?t.reference="absolute":t.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==t.reference&&(t.error=t.error||"URI is not a "+n.reference+" reference.");const O=re[(n.scheme||t.scheme||"").toLowerCase()];if(!n.unicodeSupport&&(!O||!O.unicodeSupport)){if(t.host&&(n.domainHost||O&&O.domainHost))try{t.host=punycode.toASCII(t.host.replace(c.PCT_ENCODED,ye).toLowerCase())}catch(N){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+N}_e(t,URI_PROTOCOL)}else _e(t,c);O&&O.parse&&O.parse(t,n)}else t.error=t.error||"URI can not be parsed.";return t}function or(r,n){const t=n.iri!==!1?b:j,c=[];return r.userinfo!==void 0&&(c.push(r.userinfo),c.push("@")),r.host!==void 0&&c.push(String(r.host).replace(t.IPV6ADDRESS,"[$1]")),typeof r.port=="number"&&(c.push(":"),c.push(r.port.toString(10))),c.length?c.join(""):void 0}const He=/^\.\.?\//,qe=/^\/\.(\/|$)/,Ve=/^\/\.\.(\/|$)/,Or=/^\.\.?$/,sr=/^\/?(?:.|\n)*?(?=\/|$)/;function ge(r){const n=[];for(;r.length;)if(r.match(He))r=r.replace(He,"");else if(r.match(qe))r=r.replace(qe,"/");else if(r.match(Ve))r=r.replace(Ve,"/"),n.pop();else if(r==="."||r==="..")r="";else{const t=r.match(sr);if(t){const c=t[0];r=r.slice(c.length),n.push(c)}else throw new Error("Unexpected dot segment condition")}return n.join("")}function ae(r,n={}){const t=n.iri?b:j,c=[],i=re[(n.scheme||r.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(r,n),r.host&&!t.IPV6ADDRESS.test(r.host)){if(n.domainHost||i&&i.domainHost)try{r.host=n.iri?Ee.toUnicode(r.host):Ee.toASCII(r.host.replace(t.PCT_ENCODED,ye).toLowerCase())}catch(N){r.error=r.error||"Host's domain name can not be converted to "+(n.iri?"Unicode":"ASCII")+" via punycode: "+N}}_e(r,t),n.reference!=="suffix"&&r.scheme&&(c.push(r.scheme),c.push(":"));const O=or(r,n);if(O!==void 0&&(n.reference!=="suffix"&&c.push("//"),c.push(O),r.path&&r.path.charAt(0)!=="/"&&c.push("/")),r.path!==void 0){let N=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(N=ge(N)),O===void 0&&(N=N.replace(/^\/\//,"/%2F")),c.push(N)}return r.query!==void 0&&(c.push("?"),c.push(r.query)),r.fragment!==void 0&&(c.push("#"),c.push(r.fragment)),c.join("")}function ir(r,n,t={},c){const i={};return c||(r=ie(ae(r,t),t),n=ie(ae(n,t),t)),t=t||{},!t.tolerant&&n.scheme?(i.scheme=n.scheme,i.userinfo=n.userinfo,i.host=n.host,i.port=n.port,i.path=ge(n.path||""),i.query=n.query):(n.userinfo!==void 0||n.host!==void 0||n.port!==void 0?(i.userinfo=n.userinfo,i.host=n.host,i.port=n.port,i.path=ge(n.path||""),i.query=n.query):(n.path?(n.path.charAt(0)==="/"?i.path=ge(n.path):((r.userinfo!==void 0||r.host!==void 0||r.port!==void 0)&&!r.path?i.path="/"+n.path:r.path?i.path=r.path.slice(0,r.path.lastIndexOf("/")+1)+n.path:i.path=n.path,i.path=ge(i.path)),i.query=n.query):(i.path=r.path,n.query!==void 0?i.query=n.query:i.query=r.query),i.userinfo=r.userinfo,i.host=r.host,i.port=r.port),i.scheme=r.scheme),i.fragment=n.fragment,i}function br(r,n,t){return ae(ir(ie(r,t),ie(n,t),t,!0),t)}function Cr(r,n){return typeof r=="string"?r=ae(ie(r,n),n):typeOf(r)==="object"&&(r=ie(ae(r,n),n)),r}function Sr(r,n,t){return typeof r=="string"?r=ae(ie(r,t),t):typeOf(r)==="object"&&(r=ae(r,t)),typeof n=="string"?n=ae(ie(n,t),t):typeOf(n)==="object"&&(n=ae(n,t)),r===n}function Pr(r,n){return r&&r.toString().replace(!n||!n.iri?URI_PROTOCOL.ESCAPE:IRI_PROTOCOL.ESCAPE,te)}function ce(r,n){return r&&r.toString().replace(!n||!n.iri?j.PCT_ENCODED:b.PCT_ENCODED,ye)}var be={scheme:"http",domainHost:!0,parse:function(r,n){return r.host||(r.error=r.error||"HTTP URIs must have a host."),r},serialize:function(r,n){return(r.port===(String(r.scheme).toLowerCase()!=="https"?80:443)||r.port==="")&&(r.port=void 0),r.path||(r.path="/"),r}},cr={scheme:"https",domainHost:be.domainHost,parse:be.parse,serialize:be.serialize};const ur={},we="[A-Za-z0-9\\-\\.\\_\\~"+(!0?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",W="[0-9A-Fa-f]",Ce=e(e("%[EFef]"+W+"%"+W+W+"%"+W+W)+"|"+e("%[89A-Fa-f]"+W+"%"+W+W)+"|"+e("%"+W+W)),de="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Se="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",Pe=a(Se,'[\\"\\\\]'),Ae=e(de+"+"+e("\\."+de+"+")+"*"),De=e("\\\\"+Pe),$e=e(Se+"|"+De),Ne=e('\\"'+$e+'*\\"'),me="[\\x21-\\x5A\\x5E-\\x7E]",Ie="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ue=e(we+"|"+Ce+"|"+Ie),Le=e(Ae+"|\\["+me+"*\\]"),Fe=e(Ae+"|"+Ne),Re=e(Fe+"\\@"+Le),H=e(Re+e("\\,"+Re)+"*"),Ke=e(Ue+"*"),lr=Ke,ze=e(Ke+"\\="+lr),Ge=e(ze+e("\\&"+ze)+"*"),fr=e("\\?"+Ge),mr=new RegExp("^mailto\\:"+H+"?"+fr+"?$"),dr=new RegExp(we,"g"),he=new RegExp(Ce,"g"),hr=new RegExp(a("[^]",de,"[\\.]",'[\\"]',Pe),"g"),Ir=new RegExp(a("[^]",de,"[\\.]","[\\[]",me,"[\\]]"),"g"),Je=new RegExp(a("[^]",we,Ie),"g"),pr=Je,Rr=new RegExp("^"+H+"$"),vr=new RegExp("^"+Ge+"$");function Me(r){const n=ye(r);return n.match(dr)?n:r}var Er={scheme:"mailto",parse:function(r,n){const t=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){let c=!1;const i={},O=r.query.split("&");for(let N=0,q=O.length;N<q;++N){const F=O[N].split("=");switch(F[0]){case"to":const Y=F[1].split(",");for(let D=0,Q=Y.length;D<Q;++D)t.push(Y[D]);break;case"subject":r.subject=ce(F[1],n);break;case"body":r.body=ce(F[1],n);break;default:c=!0,i[ce(F[0],n)]=ce(F[1],n);break}}c&&(r.headers=i)}r.query=void 0;for(let c=0,i=t.length;c<i;++c){const O=t[c].split("@");if(O[0]=ce(O[0]),n.unicodeSupport)O[1]=ce(O[1],n).toLowerCase();else try{O[1]=Ee.toASCII(ce(O[1],n).toLowerCase())}catch(N){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+N}t[c]=O.join("@")}return r},serialize:function(r,n){const t=Z(r.to);if(t){for(let O=0,N=t.length;O<N;++O){const q=String(t[O]),F=q.lastIndexOf("@"),Y=q.slice(0,F).replace(he,Me).replace(he,M).replace(hr,te);let D=q.slice(F+1);try{D=n.iri?Ee.toUnicode(D):Ee.toASCII(ce(D,n).toLowerCase())}catch(Q){r.error=r.error||"Email address's domain name can not be converted to "+(n.iri?"Unicode":"ASCII")+" via punycode: "+Q}t[O]=Y+"@"+D}r.path=t.join(",")}const c=r.headers=r.headers||{};r.subject&&(c.subject=r.subject),r.body&&(c.body=r.body);const i=[];for(const O in c)c[O]!==ur[O]&&i.push(O.replace(he,Me).replace(he,M).replace(Je,te)+"="+c[O].replace(he,Me).replace(he,M).replace(pr,te));return i.length&&(r.query=i.join("&")),r}};const je="(?:[0-9A-Za-z][0-9A-Za-z\\-]{1,31})",yr="(?:\\%[0-9A-Fa-f]{2})",Ze="[0-9A-Za-z\\(\\)\\+\\,\\-\\.\\:\\=\\@\\;\\$\\_\\!\\*\\'\\/\\?\\#]",Tr="(?:(?:"+yr+"|"+Ze+")+)",_r=new RegExp("^urn\\:("+je+")$"),S=new RegExp("^("+je+")\\:("+Tr+")$"),E=/^([^\:]+)\:(.*)/,g=/[\x00-\x20\\\"\&\<\>\[\]\^\`\{\|\}\~\x7F-\xFF]/g;var A={scheme:"urn",parse:function(r,n){const t=r.path&&r.path.match(E);if(t){const c="urn:"+t[1].toLowerCase();let i=re[c];i||(i=re[c]={scheme:c,parse:function(O,N){return O},serialize:re.urn.serialize}),r.scheme=c,r.path=t[2],r=i.parse(r,n)}else r.error=r.error||"URN can not be parsed.";return r},serialize:function(r,n){const t=r.scheme||n.scheme;if(t&&t!=="urn"){const c=t.match(_r)||["urn:"+t,t];r.scheme="urn",r.path=c[1]+":"+(r.path?r.path.replace(g,te):"")}return r}};const L=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;var oe={scheme:"urn:uuid",parse:function(r,n){return!n.tolerant&&(!r.path||!r.path.match(L))&&(r.error=r.error||"UUID is not valid."),r},serialize:function(r,n){return!n.tolerant&&(!r.path||!r.path.match(L))?r.scheme=void 0:r.path=(r.path||"").toLowerCase(),re.urn.serialize(r,n)}};re.http=be,re.https=cr,re.mailto=Er,re.urn=A,re["urn:uuid"]=oe},61160:function(fe,o,R){var a=R(92063),e=R(73992),G=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,M=/[\n\r\t]/g,Z=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,w=/:\d+$/,j=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,b=/^[a-zA-Z]:/;function _(h){return(h||"").toString().replace(G,"")}var m=[["#","hash"],["?","query"],function(l,d){return v(d.protocol)?l.replace(/\\/g,"/"):l},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],J={hash:1,query:1};function K(h){var l;typeof window<"u"?l=window:typeof R.g<"u"?l=R.g:typeof self<"u"?l=self:l={};var d=l.location||{};h=h||d;var u={},s=typeof h,f;if(h.protocol==="blob:")u=new B(unescape(h.pathname),{});else if(s==="string"){u=new B(h,{});for(f in J)delete u[f]}else if(s==="object"){for(f in h)f in J||(u[f]=h[f]);u.slashes===void 0&&(u.slashes=Z.test(h.href))}return u}function v(h){return h==="file:"||h==="ftp:"||h==="http:"||h==="https:"||h==="ws:"||h==="wss:"}function P(h,l){h=_(h),h=h.replace(M,""),l=l||{};var d=j.exec(h),u=d[1]?d[1].toLowerCase():"",s=!!d[2],f=!!d[3],y=0,C;return s?f?(C=d[2]+d[3]+d[4],y=d[2].length+d[3].length):(C=d[2]+d[4],y=d[2].length):f?(C=d[3]+d[4],y=d[3].length):C=d[4],u==="file:"?y>=2&&(C=C.slice(2)):v(u)?C=d[4]:u?s&&(C=C.slice(2)):y>=2&&v(l.protocol)&&(C=d[4]),{protocol:u,slashes:s||v(u),slashesCount:y,rest:C}}function I(h,l){if(h==="")return l;for(var d=(l||"/").split("/").slice(0,-1).concat(h.split("/")),u=d.length,s=d[u-1],f=!1,y=0;u--;)d[u]==="."?d.splice(u,1):d[u]===".."?(d.splice(u,1),y++):y&&(u===0&&(f=!0),d.splice(u,1),y--);return f&&d.unshift(""),(s==="."||s==="..")&&d.push(""),d.join("/")}function B(h,l,d){if(h=_(h),h=h.replace(M,""),!(this instanceof B))return new B(h,l,d);var u,s,f,y,C,T,U=m.slice(),$=typeof l,p=this,z=0;for($!=="object"&&$!=="string"&&(d=l,l=null),d&&typeof d!="function"&&(d=e.parse),l=K(l),s=P(h||"",l),u=!s.protocol&&!s.slashes,p.slashes=s.slashes||u&&l.slashes,p.protocol=s.protocol||l.protocol||"",h=s.rest,(s.protocol==="file:"&&(s.slashesCount!==2||b.test(h))||!s.slashes&&(s.protocol||s.slashesCount<2||!v(p.protocol)))&&(U[3]=[/(.*)/,"pathname"]);z<U.length;z++){if(y=U[z],typeof y=="function"){h=y(h,p);continue}f=y[0],T=y[1],f!==f?p[T]=h:typeof f=="string"?(C=f==="@"?h.lastIndexOf(f):h.indexOf(f),~C&&(typeof y[2]=="number"?(p[T]=h.slice(0,C),h=h.slice(C+y[2])):(p[T]=h.slice(C),h=h.slice(0,C)))):(C=f.exec(h))&&(p[T]=C[1],h=h.slice(0,C.index)),p[T]=p[T]||u&&y[3]&&l[T]||"",y[4]&&(p[T]=p[T].toLowerCase())}d&&(p.query=d(p.query)),u&&l.slashes&&p.pathname.charAt(0)!=="/"&&(p.pathname!==""||l.pathname!=="")&&(p.pathname=I(p.pathname,l.pathname)),p.pathname.charAt(0)!=="/"&&v(p.protocol)&&(p.pathname="/"+p.pathname),a(p.port,p.protocol)||(p.host=p.hostname,p.port=""),p.username=p.password="",p.auth&&(C=p.auth.indexOf(":"),~C?(p.username=p.auth.slice(0,C),p.username=encodeURIComponent(decodeURIComponent(p.username)),p.password=p.auth.slice(C+1),p.password=encodeURIComponent(decodeURIComponent(p.password))):p.username=encodeURIComponent(decodeURIComponent(p.auth)),p.auth=p.password?p.username+":"+p.password:p.username),p.origin=p.protocol!=="file:"&&v(p.protocol)&&p.host?p.protocol+"//"+p.host:"null",p.href=p.toString()}function k(h,l,d){var u=this;switch(h){case"query":typeof l=="string"&&l.length&&(l=(d||e.parse)(l)),u[h]=l;break;case"port":u[h]=l,a(l,u.protocol)?l&&(u.host=u.hostname+":"+l):(u.host=u.hostname,u[h]="");break;case"hostname":u[h]=l,u.port&&(l+=":"+u.port),u.host=l;break;case"host":u[h]=l,w.test(l)?(l=l.split(":"),u.port=l.pop(),u.hostname=l.join(":")):(u.hostname=l,u.port="");break;case"protocol":u.protocol=l.toLowerCase(),u.slashes=!d;break;case"pathname":case"hash":if(l){var s=h==="pathname"?"/":"#";u[h]=l.charAt(0)!==s?s+l:l}else u[h]=l;break;case"username":case"password":u[h]=encodeURIComponent(l);break;case"auth":var f=l.indexOf(":");~f?(u.username=l.slice(0,f),u.username=encodeURIComponent(decodeURIComponent(u.username)),u.password=l.slice(f+1),u.password=encodeURIComponent(decodeURIComponent(u.password))):u.username=encodeURIComponent(decodeURIComponent(l))}for(var y=0;y<m.length;y++){var C=m[y];C[4]&&(u[C[1]]=u[C[1]].toLowerCase())}return u.auth=u.password?u.username+":"+u.password:u.username,u.origin=u.protocol!=="file:"&&v(u.protocol)&&u.host?u.protocol+"//"+u.host:"null",u.href=u.toString(),u}function X(h){(!h||typeof h!="function")&&(h=e.stringify);var l,d=this,u=d.host,s=d.protocol;s&&s.charAt(s.length-1)!==":"&&(s+=":");var f=s+(d.protocol&&d.slashes||v(d.protocol)?"//":"");return d.username?(f+=d.username,d.password&&(f+=":"+d.password),f+="@"):d.password?(f+=":"+d.password,f+="@"):d.protocol!=="file:"&&v(d.protocol)&&!u&&d.pathname!=="/"&&(f+="@"),(u[u.length-1]===":"||w.test(d.hostname)&&!d.port)&&(u+=":"),f+=u+d.pathname,l=typeof d.query=="object"?h(d.query):d.query,l&&(f+=l.charAt(0)!=="?"?"?"+l:l),d.hash&&(f+=d.hash),f}B.prototype={set:k,toString:X},B.extractProtocol=P,B.location=K,B.trimLeft=_,B.qs=e,fe.exports=B},99211:function(fe,o){Object.defineProperty(o,"__esModule",{value:!0});function R(v,P,I){var B;if(I===void 0&&(I={}),!P.codes){P.codes={};for(var k=0;k<P.chars.length;++k)P.codes[P.chars[k]]=k}if(!I.loose&&v.length*P.bits&7)throw new SyntaxError("Invalid padding");for(var X=v.length;v[X-1]==="=";)if(--X,!I.loose&&!((v.length-X)*P.bits&7))throw new SyntaxError("Invalid padding");for(var h=new((B=I.out)!=null?B:Uint8Array)(X*P.bits/8|0),l=0,d=0,u=0,s=0;s<X;++s){var f=P.codes[v[s]];if(f===void 0)throw new SyntaxError("Invalid character "+v[s]);d=d<<P.bits|f,l+=P.bits,l>=8&&(l-=8,h[u++]=255&d>>l)}if(l>=P.bits||255&d<<8-l)throw new SyntaxError("Unexpected end of data");return h}function a(v,P,I){I===void 0&&(I={});for(var B=I,k=B.pad,X=k===void 0?!0:k,h=(1<<P.bits)-1,l="",d=0,u=0,s=0;s<v.length;++s)for(u=u<<8|255&v[s],d+=8;d>P.bits;)d-=P.bits,l+=P.chars[h&u>>d];if(d&&(l+=P.chars[h&u<<P.bits-d]),X)for(;l.length*P.bits&7;)l+="=";return l}var e={chars:"0123456789ABCDEF",bits:4},G={chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bits:5},M={chars:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bits:5},Z={chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bits:6},w={chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bits:6},j={parse:function(P,I){return R(P.toUpperCase(),e,I)},stringify:function(P,I){return a(P,e,I)}},b={parse:function(P,I){return I===void 0&&(I={}),R(I.loose?P.toUpperCase().replace(/0/g,"O").replace(/1/g,"L").replace(/8/g,"B"):P,G,I)},stringify:function(P,I){return a(P,G,I)}},_={parse:function(P,I){return R(P,M,I)},stringify:function(P,I){return a(P,M,I)}},m={parse:function(P,I){return R(P,Z,I)},stringify:function(P,I){return a(P,Z,I)}},J={parse:function(P,I){return R(P,w,I)},stringify:function(P,I){return a(P,w,I)}},K={parse:R,stringify:a};o.base16=j,o.base32=b,o.base32hex=_,o.base64=m,o.base64url=J,o.codec=K},82671:function(fe,o,R){R.d(o,{ef:function(){return w},gw:function(){return K},k5:function(){return M}});var a=R(93689);const e=a.WK,G=a.DE,M=a.k5,Z=a.Dr,w=a.ef,j=a.GY,b=a.WM,_=a.Kz,m=a.uX,J=a.IK,K=a.gw,v=a.WU,P=a.G8,I=a.xQ,B=a.D7,k=a.hi,X=a.zU,h=a.dq,l=a.m$,d=a.MU,u=a.ID,s=a.k0,f=a.D4,y=a.kL,C=a.jx,T=a.A_,U=a.v1,$=a.TL,p=a.Og,z=a.mq,ee=a.ft,ne=a.KU,se=a.ZU,Oe=a.sF,rr=a.ye,nr=a.Xj,Ee=a.Rn,re=a.bo,te=a.KL,ye=a.rW,_e=a.U3,tr=a.$Y,ar=a.EJ,ie=a.XY,or=a.v7,He=a.up,qe=a.h,Ve=a.Cx,Or=a.Zz,sr=a.CU,ge=a.ib,ae=a.eT,ir=a._0,br=a.UR,Cr=a.Up,Sr=a.y0,Pr=a.A2,ce=a.ql,be=a.FX,cr=a.Jr,ur=a.zS,Ar=a.pK,we=a.ud,W=a.Zk,Ce=a.Mf,de=a.U0,Se=a.CX,Pe=a.l4,Ae=a.Jv,De=a.T0,$e=a.z8,Ne=a.Gt,me=a.Fm,Ie=a.b4,Ue=a.N2,Le=a.K8,Fe=a.gB,Re=a.bd,H=a.z2,Ke=a.GG,lr=a.V$,ze=a.CC,Ge=a.dT,fr=a.uT,mr=a._j,dr=a.p4,he=a.W0,hr=a.zk,Ir=a.AB,Je=a.sn,pr=a._u,Rr=a.Py,vr=a.iu,Me=a.l7,Er=a.JU,je=a.O6}}]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkedge_currency_accountbased=self.webpackChunkedge_currency_accountbased||[]).push([[9649],{99649:function(j,k,u){u.r(k),u.d(k,{PiratechainTools:function(){return A},makeCurrencyEngine:function(){return R},makeCurrencyTools:function(){return M},updateInfoPayload:function(){return $}});var y=u(66001),I=u(90749),D=u(48287),E=u(36856),b=u(96542),v=u(44276),g=u(62071),w=u(82671),P=u(65828),H=u(26277),z=Object.defineProperty,C=Object.getOwnPropertySymbols,B=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,x=Reflect.get,S=(s,t,e)=>t in s?z(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,K=(s,t)=>{for(var e in t||(t={}))N.call(t,e)&&S(s,e,t[e]);if(C)for(var e of C(t))O.call(t,e)&&S(s,e,t[e]);return s},m=(s,t,e)=>x(B(s),e,t),h=(s,t,e)=>new Promise((n,r)=>{var o=a=>{try{l(e.next(a))}catch(c){r(c)}},i=a=>{try{l(e.throw(a))}catch(c){r(c)}},l=a=>a.done?n(a.value):Promise.resolve(a.value).then(o,i);l((e=e.apply(s,t)).next())});class p extends H.k{constructor(t,e,n,r,o){super(t,e,n,r);const{networkInfo:i}=t;this.pluginId=this.currencyInfo.pluginId,this.networkInfo=i,this.birthdayHeight=0,this.makeSynchronizer=o,this.synchronizerPromise=new Promise(l=>{this.synchronizerResolver=l}),this.queryMutex=!1,this.started=!1,this.progressRatio=0}setOtherData(t){this.otherData=(0,g.Gb)(t)}initData(){this.otherData.blockRange.first===0&&(this.otherData.blockRange={first:this.birthdayHeight,last:this.birthdayHeight}),this.initialNumBlocksToDownload=-1,this.synchronizerStatus="DISCONNECTED",this.availableZatoshi="0"}initSubscriptions(){this.synchronizer!=null&&(this.synchronizer.on("update",t=>h(this,null,function*(){const{lastDownloadedHeight:e,scanProgress:n,networkBlockHeight:r}=t;this.onUpdateBlockHeight(r),this.onUpdateProgress(e,n,r),yield this.queryAll()})),this.synchronizer.on("statusChanged",t=>h(this,null,function*(){this.synchronizerStatus=t.name,yield this.queryAll()})),this.synchronizer.on("error",t=>h(this,null,function*(){this.log.warn(`Synchronizer error: ${t.message}`),t.level==="critical"&&(yield this.killEngine(),this.lastUpdateFromSynchronizer=void 0,yield this.startEngine())})))}queryAll(){return h(this,null,function*(){if(this.lastUpdateFromSynchronizer=Date.now(),!this.queryMutex){this.queryMutex=!0;try{yield this.queryBalance(),yield this.queryTransactions(),this.onUpdateTransactions()}catch{}this.queryMutex=!1}})}onUpdateBlockHeight(t){this.walletLocalData.blockHeight!==t&&(this.walletLocalData.blockHeight=t,this.walletLocalDataDirty=!0,this.currencyEngineCallbacks.onBlockHeightChanged(this.walletLocalData.blockHeight))}onUpdateTransactions(){this.transactionsChangedArray.length>0&&(this.currencyEngineCallbacks.onTransactionsChanged(this.transactionsChangedArray),this.transactionsChangedArray=[])}onUpdateProgress(t,e,n){if(!this.addressesChecked&&!this.isSynced()){const r=e*.99,o=e*.8;this.tokenCheckBalanceStatus[this.currencyInfo.currencyCode]=r/100,this.tokenCheckTransactionsStatus[this.currencyInfo.currencyCode]=o/100;const i=(r+o)/2;i>this.progressRatio&&(this.progressRatio=i,this.log.warn(`Scan and download progress: ${Math.floor(i)}%`),this.updateOnAddressesChecked())}}startEngine(){return h(this,null,function*(){this.engineOn=!0,this.started=!0,yield m(p.prototype,this,"startEngine").call(this)})}isSynced(){return this.synchronizerStatus==="SYNCED"}queryBalance(){return h(this,null,function*(){if(!(!this.isSynced()||this.synchronizer==null))try{const t=yield this.synchronizer.getBalance();if(t.totalZatoshi==="-1")return;this.availableZatoshi=t.availableZatoshi,this.updateBalance(this.currencyInfo.currencyCode,t.totalZatoshi)}catch(t){this.warn("Failed to update balances",t),this.updateBalance(this.currencyInfo.currencyCode,"0")}})}queryTransactions(){return h(this,null,function*(){if(this.synchronizer!=null)try{let t=this.otherData.blockRange.first,e=this.otherData.blockRange.last;for(;this.isSynced()&&e<=this.walletLocalData.blockHeight;){if((yield this.synchronizer.getTransactions({first:t,last:e})).forEach(r=>this.processTransaction(r)),e===this.walletLocalData.blockHeight){t=this.walletLocalData.blockHeight,this.walletLocalDataDirty=!0,this.tokenCheckTransactionsStatus[this.currencyInfo.currencyCode]=1,this.updateOnAddressesChecked();break}t=e+1,e=e+this.networkInfo.transactionQueryLimit<this.walletLocalData.blockHeight?e+this.networkInfo.transactionQueryLimit:this.walletLocalData.blockHeight,this.otherData.blockRange={first:t,last:e},this.walletLocalDataDirty=!0}}catch(t){this.error(`Error querying ${this.currencyInfo.currencyCode} transactions `,t)}})}processTransaction(t){let e=t.value;const n=[];t.toAddress!=null?e=`-${(0,y.add)(e,this.networkInfo.defaultNetworkFee)}`:n.push(this.walletInfo.keys.publicKey);const r=t.memos.filter(i=>i!=="").map(i=>({memoName:"memo",type:"text",value:i})),o={blockHeight:t.minedHeight,currencyCode:this.currencyInfo.currencyCode,date:t.blockTimeInSeconds,isSend:e.startsWith("-"),memos:r,nativeAmount:e,networkFee:this.networkInfo.defaultNetworkFee,otherParams:{},ourReceiveAddresses:n,signedTx:"",tokenId:null,txid:t.rawTransactionId,walletId:this.walletId};this.addTransaction(this.currencyInfo.currencyCode,o)}syncNetwork(t){return h(this,null,function*(){if(!this.started)return 1e3;const e=(0,g.cl)(this.currencyInfo.pluginId)(t==null?void 0:t.privateKeys),{rpcNode:n}=this.networkInfo;this.birthdayHeight=e.birthdayHeight;try{this.synchronizerPromise=this.makeSynchronizer(K({mnemonicSeed:e.mnemonic,birthdayHeight:e.birthdayHeight,alias:P.xn.stringify(P.K3.parse(this.walletId))},n)),this.synchronizer=yield this.synchronizerPromise,this.synchronizerResolver(this.synchronizer)}catch(r){if(String(r)==="Invariant Violation: `new NativeEventEmitter()` requires a non-null argument.")this.log.warn("SDK not present");else throw r}return this.initData(),this.initSubscriptions(),yield new Promise(r=>{this.stopSyncing=r})})}killEngine(){return h(this,null,function*(){var t;this.synchronizerPromise=new Promise(e=>{this.synchronizerResolver=e}),this.started=!1,this.stopSyncing!=null&&(yield this.stopSyncing(1e3),this.stopSyncing=void 0),yield(t=this.synchronizer)==null?void 0:t.stop(),yield m(p.prototype,this,"killEngine").call(this)})}clearBlockchainCache(){return h(this,null,function*(){yield m(p.prototype,this,"clearBlockchainCache").call(this)})}resyncBlockchain(){return h(this,null,function*(){var t;yield m(p.prototype,this,"killEngine").call(this),yield this.clearBlockchainCache(),yield this.startEngine(),(t=this.synchronizer)==null||t.rescan().catch(e=>this.warn("resyncBlockchain failed: ",e)),this.initData(),this.progressRatio=0,this.synchronizerStatus="SYNCING"})}getMaxSpendable(){return h(this,null,function*(){const t=(0,y.sub)(this.availableZatoshi,this.networkInfo.defaultNetworkFee);if((0,y.lte)(t,"0"))throw new w.k5({tokenId:null});return t})}makeSpend(t){return h(this,null,function*(){var e;if(!this.isSynced())throw new Error("Cannot spend until wallet is synced");const{edgeSpendInfo:n,currencyCode:r}=this.makeSpendCheck(t),{memos:o=[],tokenId:i}=n,l=n.spendTargets[0],{publicAddress:a,nativeAmount:c}=l;if(a==null)throw new Error("makeSpend Missing publicAddress");if(c==null)throw new w.ef;if((0,y.eq)(c,"0"))throw new w.ef;const f=(0,y.add)(c,this.networkInfo.defaultNetworkFee);if((0,y.gt)(f,(e=this.walletLocalData.totalBalances[this.currencyInfo.currencyCode])!=null?e:"0"))throw new w.k5({tokenId:i});if((0,y.gt)(f,this.availableZatoshi))throw new w.k5({tokenId:i});const V=(0,y.mul)(f,"-1");return{blockHeight:0,currencyCode:r,date:0,isSend:!0,memos:o,nativeAmount:V,networkFee:this.networkInfo.defaultNetworkFee,ourReceiveAddresses:[],signedTx:"",tokenId:i,txid:"",walletId:this.walletId}})}signTx(t){return h(this,null,function*(){return t})}broadcastTx(t,e){return h(this,null,function*(){var n;const{memos:r}=t,o=(0,g.cl)(this.pluginId)(e==null?void 0:e.privateKeys);if(t.spendTargets==null||t.spendTargets.length!==1)throw new Error("Invalid spend targets");const i=((n=r[0])==null?void 0:n.type)==="text"?r[0].value:"",l=t.spendTargets[0],a={zatoshi:(0,y.sub)((0,y.abs)(t.nativeAmount),t.networkFee),toAddress:l.publicAddress,memo:i,mnemonicSeed:o.mnemonic};try{const f=yield(yield this.synchronizerPromise).sendToAddress(a);t.txid=f.txId,t.signedTx=f.raw,t.date=Date.now()/1e3,this.warn(`SUCCESS broadcastTx
|
|
2
|
-
${(0,v.T5)(t)}`)}catch(c){throw this.warn("FAILURE broadcastTx failed: ",c),c}return t})}getFreshAddress(){return h(this,null,function*(){const t=()=>h(this,null,function*(){const e=yield this.synchronizerPromise,{saplingAddress:n}=yield e.deriveUnifiedAddress();return this.otherData.cachedAddress=n,this.walletLocalDataDirty=!0,{publicAddress:n}});return this.otherData.cachedAddress==null?yield t():(t().catch(e=>{throw e}),{publicAddress:this.otherData.cachedAddress})})}}function R(s,t,e,n){return h(this,null,function*(){const r=(0,g.xH)(e),{makeSynchronizer:o}=s.nativeIo["edge-currency-accountbased"].piratechain,i=new p(s,t,r,n,o);return yield i.loadEngine(),i})}var T=Object.getOwnPropertySymbols,U=Object.prototype.hasOwnProperty,
|
|
1
|
+
"use strict";(self.webpackChunkedge_currency_accountbased=self.webpackChunkedge_currency_accountbased||[]).push([[9649],{99649:function(j,k,u){u.r(k),u.d(k,{PiratechainTools:function(){return A},makeCurrencyEngine:function(){return R},makeCurrencyTools:function(){return M},updateInfoPayload:function(){return $}});var y=u(66001),I=u(90749),D=u(48287),E=u(36856),b=u(96542),v=u(44276),g=u(62071),w=u(82671),P=u(65828),H=u(26277),z=Object.defineProperty,C=Object.getOwnPropertySymbols,B=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,x=Reflect.get,S=(s,t,e)=>t in s?z(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,K=(s,t)=>{for(var e in t||(t={}))N.call(t,e)&&S(s,e,t[e]);if(C)for(var e of C(t))O.call(t,e)&&S(s,e,t[e]);return s},m=(s,t,e)=>x(B(s),e,t),h=(s,t,e)=>new Promise((n,r)=>{var o=a=>{try{l(e.next(a))}catch(c){r(c)}},i=a=>{try{l(e.throw(a))}catch(c){r(c)}},l=a=>a.done?n(a.value):Promise.resolve(a.value).then(o,i);l((e=e.apply(s,t)).next())});class p extends H.k{constructor(t,e,n,r,o){super(t,e,n,r);const{networkInfo:i}=t;this.pluginId=this.currencyInfo.pluginId,this.networkInfo=i,this.birthdayHeight=0,this.makeSynchronizer=o,this.synchronizerPromise=new Promise(l=>{this.synchronizerResolver=l}),this.queryMutex=!1,this.started=!1,this.progressRatio=0}setOtherData(t){this.otherData=(0,g.Gb)(t)}initData(){this.otherData.blockRange.first===0&&(this.otherData.blockRange={first:this.birthdayHeight,last:this.birthdayHeight}),this.initialNumBlocksToDownload=-1,this.synchronizerStatus="DISCONNECTED",this.availableZatoshi="0"}initSubscriptions(){this.synchronizer!=null&&(this.synchronizer.on("update",t=>h(this,null,function*(){const{lastDownloadedHeight:e,scanProgress:n,networkBlockHeight:r}=t;this.onUpdateBlockHeight(r),this.onUpdateProgress(e,n,r),yield this.queryAll()})),this.synchronizer.on("statusChanged",t=>h(this,null,function*(){this.synchronizerStatus=t.name,yield this.queryAll()})),this.synchronizer.on("error",t=>h(this,null,function*(){this.log.warn(`Synchronizer error: ${t.message}`),t.level==="critical"&&(yield this.killEngine(),this.lastUpdateFromSynchronizer=void 0,yield this.startEngine())})))}queryAll(){return h(this,null,function*(){if(this.lastUpdateFromSynchronizer=Date.now(),!this.queryMutex){this.queryMutex=!0;try{yield this.queryBalance(),yield this.queryTransactions(),this.onUpdateTransactions()}catch{}this.queryMutex=!1}})}onUpdateBlockHeight(t){this.walletLocalData.blockHeight!==t&&(this.walletLocalData.blockHeight=t,this.walletLocalDataDirty=!0,this.currencyEngineCallbacks.onBlockHeightChanged(this.walletLocalData.blockHeight))}onUpdateTransactions(){this.transactionsChangedArray.length>0&&(this.currencyEngineCallbacks.onTransactionsChanged(this.transactionsChangedArray),this.transactionsChangedArray=[])}onUpdateProgress(t,e,n){if(!this.addressesChecked&&!this.isSynced()){const r=e*.99,o=e*.8;this.tokenCheckBalanceStatus[this.currencyInfo.currencyCode]=r/100,this.tokenCheckTransactionsStatus[this.currencyInfo.currencyCode]=o/100;const i=(r+o)/2;i>this.progressRatio&&(this.progressRatio=i,this.log.warn(`Scan and download progress: ${Math.floor(i)}%`),this.updateOnAddressesChecked())}}startEngine(){return h(this,null,function*(){this.engineOn=!0,this.started=!0,yield m(p.prototype,this,"startEngine").call(this)})}isSynced(){return this.synchronizerStatus==="SYNCED"}queryBalance(){return h(this,null,function*(){if(!(!this.isSynced()||this.synchronizer==null))try{const t=yield this.synchronizer.getBalance();if(t.totalZatoshi==="-1")return;this.availableZatoshi=t.availableZatoshi,this.updateBalance(this.currencyInfo.currencyCode,t.totalZatoshi)}catch(t){this.warn("Failed to update balances",t),this.updateBalance(this.currencyInfo.currencyCode,"0")}})}queryTransactions(){return h(this,null,function*(){if(this.synchronizer!=null)try{let t=this.otherData.blockRange.first,e=this.otherData.blockRange.last;for(;this.isSynced()&&e<=this.walletLocalData.blockHeight;){if((yield this.synchronizer.getTransactions({first:t,last:e})).forEach(r=>this.processTransaction(r)),e===this.walletLocalData.blockHeight){t=this.walletLocalData.blockHeight,this.walletLocalDataDirty=!0,this.tokenCheckTransactionsStatus[this.currencyInfo.currencyCode]=1,this.updateOnAddressesChecked();break}t=e+1,e=e+this.networkInfo.transactionQueryLimit<this.walletLocalData.blockHeight?e+this.networkInfo.transactionQueryLimit:this.walletLocalData.blockHeight,this.otherData.blockRange={first:t,last:e},this.walletLocalDataDirty=!0}}catch(t){this.error(`Error querying ${this.currencyInfo.currencyCode} transactions `,t)}})}processTransaction(t){let e=t.value;const n=[];t.toAddress!=null?e=`-${(0,y.add)(e,this.networkInfo.defaultNetworkFee)}`:n.push(this.walletInfo.keys.publicKey);const r=t.memos.filter(i=>i!=="").map(i=>({memoName:"memo",type:"text",value:i})),o={blockHeight:t.minedHeight,currencyCode:this.currencyInfo.currencyCode,date:t.blockTimeInSeconds,isSend:e.startsWith("-"),memos:r,nativeAmount:e,networkFee:this.networkInfo.defaultNetworkFee,networkFees:[],otherParams:{},ourReceiveAddresses:n,signedTx:"",tokenId:null,txid:t.rawTransactionId,walletId:this.walletId};this.addTransaction(this.currencyInfo.currencyCode,o)}syncNetwork(t){return h(this,null,function*(){if(!this.started)return 1e3;const e=(0,g.cl)(this.currencyInfo.pluginId)(t==null?void 0:t.privateKeys),{rpcNode:n}=this.networkInfo;this.birthdayHeight=e.birthdayHeight;try{this.synchronizerPromise=this.makeSynchronizer(K({mnemonicSeed:e.mnemonic,birthdayHeight:e.birthdayHeight,alias:P.xn.stringify(P.K3.parse(this.walletId))},n)),this.synchronizer=yield this.synchronizerPromise,this.synchronizerResolver(this.synchronizer)}catch(r){if(String(r)==="Invariant Violation: `new NativeEventEmitter()` requires a non-null argument.")this.log.warn("SDK not present");else throw r}return this.initData(),this.initSubscriptions(),yield new Promise(r=>{this.stopSyncing=r})})}killEngine(){return h(this,null,function*(){var t;this.synchronizerPromise=new Promise(e=>{this.synchronizerResolver=e}),this.started=!1,this.stopSyncing!=null&&(yield this.stopSyncing(1e3),this.stopSyncing=void 0),yield(t=this.synchronizer)==null?void 0:t.stop(),yield m(p.prototype,this,"killEngine").call(this)})}clearBlockchainCache(){return h(this,null,function*(){yield m(p.prototype,this,"clearBlockchainCache").call(this)})}resyncBlockchain(){return h(this,null,function*(){var t;yield m(p.prototype,this,"killEngine").call(this),yield this.clearBlockchainCache(),yield this.startEngine(),(t=this.synchronizer)==null||t.rescan().catch(e=>this.warn("resyncBlockchain failed: ",e)),this.initData(),this.progressRatio=0,this.synchronizerStatus="SYNCING"})}getMaxSpendable(){return h(this,null,function*(){const t=(0,y.sub)(this.availableZatoshi,this.networkInfo.defaultNetworkFee);if((0,y.lte)(t,"0"))throw new w.k5({tokenId:null});return t})}makeSpend(t){return h(this,null,function*(){var e;if(!this.isSynced())throw new Error("Cannot spend until wallet is synced");const{edgeSpendInfo:n,currencyCode:r}=this.makeSpendCheck(t),{memos:o=[],tokenId:i}=n,l=n.spendTargets[0],{publicAddress:a,nativeAmount:c}=l;if(a==null)throw new Error("makeSpend Missing publicAddress");if(c==null)throw new w.ef;if((0,y.eq)(c,"0"))throw new w.ef;const f=(0,y.add)(c,this.networkInfo.defaultNetworkFee);if((0,y.gt)(f,(e=this.walletLocalData.totalBalances[this.currencyInfo.currencyCode])!=null?e:"0"))throw new w.k5({tokenId:i});if((0,y.gt)(f,this.availableZatoshi))throw new w.k5({tokenId:i});const V=(0,y.mul)(f,"-1");return{blockHeight:0,currencyCode:r,date:0,isSend:!0,memos:o,nativeAmount:V,networkFee:this.networkInfo.defaultNetworkFee,networkFees:[],ourReceiveAddresses:[],signedTx:"",tokenId:i,txid:"",walletId:this.walletId}})}signTx(t){return h(this,null,function*(){return t})}broadcastTx(t,e){return h(this,null,function*(){var n;const{memos:r}=t,o=(0,g.cl)(this.pluginId)(e==null?void 0:e.privateKeys);if(t.spendTargets==null||t.spendTargets.length!==1)throw new Error("Invalid spend targets");const i=((n=r[0])==null?void 0:n.type)==="text"?r[0].value:"",l=t.spendTargets[0],a={zatoshi:(0,y.sub)((0,y.abs)(t.nativeAmount),t.networkFee),toAddress:l.publicAddress,memo:i,mnemonicSeed:o.mnemonic};try{const f=yield(yield this.synchronizerPromise).sendToAddress(a);t.txid=f.txId,t.signedTx=f.raw,t.date=Date.now()/1e3,this.warn(`SUCCESS broadcastTx
|
|
2
|
+
${(0,v.T5)(t)}`)}catch(c){throw this.warn("FAILURE broadcastTx failed: ",c),c}return t})}getFreshAddress(){return h(this,null,function*(){const t=()=>h(this,null,function*(){const e=yield this.synchronizerPromise,{saplingAddress:n}=yield e.deriveUnifiedAddress();return this.otherData.cachedAddress=n,this.walletLocalDataDirty=!0,{publicAddress:n}});return this.otherData.cachedAddress==null?yield t():(t().catch(e=>{throw e}),{publicAddress:this.otherData.cachedAddress})})}}function R(s,t,e,n){return h(this,null,function*(){const r=(0,g.xH)(e),{makeSynchronizer:o}=s.nativeIo["edge-currency-accountbased"].piratechain,i=new p(s,t,r,n,o);return yield i.loadEngine(),i})}var T=Object.getOwnPropertySymbols,U=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable,L=(s,t)=>{var e={};for(var n in s)U.call(s,n)&&t.indexOf(n)<0&&(e[n]=s[n]);if(s!=null&&T)for(var n of T(s))t.indexOf(n)<0&&F.call(s,n)&&(e[n]=s[n]);return e},d=(s,t,e)=>new Promise((n,r)=>{var o=a=>{try{l(e.next(a))}catch(c){r(c)}},i=a=>{try{l(e.throw(a))}catch(c){r(c)}},l=a=>a.done?n(a.value):Promise.resolve(a.value).then(o,i);l((e=e.apply(s,t)).next())});class A{constructor(t){const{builtinTokens:e,currencyInfo:n,io:r,networkInfo:o}=t;this.builtinTokens=e,this.currencyInfo=n,this.io=r,this.networkInfo=o;const i=t.nativeIo["edge-currency-accountbased"];if(i==null)throw new Error("Need opts");const{Tools:l}=i.piratechain;this.nativeTools=l}getDisplayPrivateKey(t){return d(this,null,function*(){const{pluginId:e}=this.currencyInfo,n=(0,g.cl)(e)(t.keys);return`Seed Phrase:
|
|
3
3
|
${n.mnemonic}
|
|
4
4
|
|
|
5
5
|
Birthday Height:
|
|
6
|
-
${n.birthdayHeight}`})}getDisplayPublicKey(t){return d(this,null,function*(){const{keys:e}=(0,g.xH)(t);return e.publicKey})}getNewWalletBirthdayBlockheight(){return d(this,null,function*(){return yield this.nativeTools.getBirthdayHeight(this.networkInfo.rpcNode.defaultHost,this.networkInfo.rpcNode.defaultPort)})}isValidAddress(t){return d(this,null,function*(){return yield this.nativeTools.isValidAddress(t)})}importPrivateKey(t){return d(this,arguments,function*(e,n={}){const{pluginId:r}=this.currencyInfo,o=(0,I.validateMnemonic)(e);if(e.split(" ").length!==24)throw new Error("Mnemonic must be 24 words");if(!o)throw new Error(`Invalid ${this.currencyInfo.currencyCode} mnemonic`);const i=yield this.getNewWalletBirthdayBlockheight();let l=i;const{birthdayHeight:a}=n;if(a!=null){(0,E.ym)(a);const c=parseInt(a);if(c>i)throw new Error("InvalidBirthdayHeight");l=c}return{[`${r}Mnemonic`]:e,[`${r}BirthdayHeight`]:l}})}createPrivateKey(t){return d(this,null,function*(){if(t!==this.currencyInfo.walletType)throw new Error("InvalidWalletType");const e=D.Buffer.from(this.io.random(32)).toString("hex"),n=(0,I.entropyToMnemonic)(e);return yield this.importPrivateKey(n)})}checkPublicKey(t){return d(this,null,function*(){try{return(0,g.QC)(t).publicKey.length>0}catch{return!1}})}derivePublicKey(t){return d(this,null,function*(){const{pluginId:e}=this.currencyInfo,n=(0,g.cl)(e)(t.keys);if(t.type!==this.currencyInfo.walletType)throw new Error("InvalidWalletType");const r=n.mnemonic;if(typeof r!="string")throw new Error("InvalidMnemonic");const o=yield this.nativeTools.deriveViewingKey(r,this.networkInfo.rpcNode.networkName);return{birthdayHeight:n.birthdayHeight,publicKey:o}})}parseUri(t,e,n){return d(this,null,function*(){const{pluginId:r}=this.currencyInfo,o={[r]:!0},{edgeParsedUri:i,edgeParsedUri:{publicAddress:l}}=yield(0,b.x)({currencyInfo:this.currencyInfo,uri:t,networks:o,builtinTokens:this.builtinTokens,currencyCode:e!=null?e:this.currencyInfo.currencyCode,customTokens:n});if(l==null||!(yield this.isValidAddress(l)))throw new Error("InvalidPublicAddressError");return i})}encodeUri(t){return d(this,arguments,function*(e,n=[]){const{pluginId:r}=this.currencyInfo,{nativeAmount:o,currencyCode:i,publicAddress:l}=e;if(!(yield this.isValidAddress(l)))throw new Error("InvalidPublicAddressError");let a;if(o!=null){const f=(0,v.FQ)(i!=null?i:this.currencyInfo.currencyCode,this.currencyInfo,n,this.builtinTokens);if(f==null)throw new Error("InternalErrorInvalidCurrencyCode");a=(0,y.div)(o,f.multiplier,18)}return(0,b.m)(e,`${r}`,a)})}}function M(s){return d(this,null,function*(){return new A(s)})}function $(s,t){return d(this,null,function*(){const e=
|
|
6
|
+
${n.birthdayHeight}`})}getDisplayPublicKey(t){return d(this,null,function*(){const{keys:e}=(0,g.xH)(t);return e.publicKey})}getNewWalletBirthdayBlockheight(){return d(this,null,function*(){return yield this.nativeTools.getBirthdayHeight(this.networkInfo.rpcNode.defaultHost,this.networkInfo.rpcNode.defaultPort)})}isValidAddress(t){return d(this,null,function*(){return yield this.nativeTools.isValidAddress(t)})}importPrivateKey(t){return d(this,arguments,function*(e,n={}){const{pluginId:r}=this.currencyInfo,o=(0,I.validateMnemonic)(e);if(e.split(" ").length!==24)throw new Error("Mnemonic must be 24 words");if(!o)throw new Error(`Invalid ${this.currencyInfo.currencyCode} mnemonic`);const i=yield this.getNewWalletBirthdayBlockheight();let l=i;const{birthdayHeight:a}=n;if(a!=null){(0,E.ym)(a);const c=parseInt(a);if(c>i)throw new Error("InvalidBirthdayHeight");l=c}return{[`${r}Mnemonic`]:e,[`${r}BirthdayHeight`]:l}})}createPrivateKey(t){return d(this,null,function*(){if(t!==this.currencyInfo.walletType)throw new Error("InvalidWalletType");const e=D.Buffer.from(this.io.random(32)).toString("hex"),n=(0,I.entropyToMnemonic)(e);return yield this.importPrivateKey(n)})}checkPublicKey(t){return d(this,null,function*(){try{return(0,g.QC)(t).publicKey.length>0}catch{return!1}})}derivePublicKey(t){return d(this,null,function*(){const{pluginId:e}=this.currencyInfo,n=(0,g.cl)(e)(t.keys);if(t.type!==this.currencyInfo.walletType)throw new Error("InvalidWalletType");const r=n.mnemonic;if(typeof r!="string")throw new Error("InvalidMnemonic");const o=yield this.nativeTools.deriveViewingKey(r,this.networkInfo.rpcNode.networkName);return{birthdayHeight:n.birthdayHeight,publicKey:o}})}parseUri(t,e,n){return d(this,null,function*(){const{pluginId:r}=this.currencyInfo,o={[r]:!0},{edgeParsedUri:i,edgeParsedUri:{publicAddress:l}}=yield(0,b.x)({currencyInfo:this.currencyInfo,uri:t,networks:o,builtinTokens:this.builtinTokens,currencyCode:e!=null?e:this.currencyInfo.currencyCode,customTokens:n});if(l==null||!(yield this.isValidAddress(l)))throw new Error("InvalidPublicAddressError");return i})}encodeUri(t){return d(this,arguments,function*(e,n=[]){const{pluginId:r}=this.currencyInfo,{nativeAmount:o,currencyCode:i,publicAddress:l}=e;if(!(yield this.isValidAddress(l)))throw new Error("InvalidPublicAddressError");let a;if(o!=null){const f=(0,v.FQ)(i!=null?i:this.currencyInfo.currencyCode,this.currencyInfo,n,this.builtinTokens);if(f==null)throw new Error("InternalErrorInvalidCurrencyCode");a=(0,y.div)(o,f.multiplier,18)}return(0,b.m)(e,`${r}`,a)})}}function M(s){return d(this,null,function*(){return new A(s)})}function $(s,t){return d(this,null,function*(){const e=L(t,[]);s.networkInfo=(0,v.wy)(s.networkInfo,e)})}}}]);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(self.webpackChunkedge_currency_accountbased=self.webpackChunkedge_currency_accountbased||[]).push([[9647],{47813:function(q,H,m){"use strict";m.r(H),m.d(H,{AlgorandTools:function(){return re},makeCurrencyEngine:function(){return ue},makeCurrencyTools:function(){return me},updateInfoPayload:function(){return ge}});var T=m(68140),d=m(66001),A=m(14483),P=m(96542),v=m(44276),h=m(37085),W=m(99818),z=m(82671),E=m(65828),Y=m(26277),x=m(62351),g=m(14171),I=m(27662),O=Object.defineProperty,D=Object.defineProperties,j=Object.getOwnPropertyDescriptors,N=Object.getOwnPropertySymbols,U=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable,G=Reflect.get,V=(u,e,t)=>e in u?O(u,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[e]=t,X=(u,e)=>{for(var t in e||(e={}))S.call(e,t)&&V(u,t,e[t]);if(N)for(var t of N(e))F.call(e,t)&&V(u,t,e[t]);return u},ae=(u,e)=>D(u,j(e)),_=(u,e,t)=>G(U(u),t,e),p=(u,e,t)=>new Promise((n,i)=>{var o=r=>{try{s(t.next(r))}catch(l){i(l)}},a=r=>{try{s(t.throw(r))}catch(l){i(l)}},s=r=>r.done?n(r.value):Promise.resolve(r.value).then(o,a);s((t=t.apply(u,e)).next())});const{Algodv2:Z,Indexer:ce}=T.Ay,ee=(0,x.fi)(2e4),le=(0,x.fi)(2e4);class J extends Y.k{constructor(e,t,n,i){super(e,t,n,i),this.getRecipientBalance=o=>p(this,null,function*(){try{return(yield this.fetchAccountInfo(o)).amount.toString()}catch{return this.minimumAddressBalance}}),this.engineGetActivationAssets=o=>p(this,null,function*(){return{assetOptions:[{tokenId:null,paymentWalletId:this.walletId,currencyPluginId:this.currencyInfo.pluginId}]}}),this.engineActivateWallet=o=>p(this,[o],function*({activateTokenIds:a,paymentInfo:s}){var r;if(a==null)throw new Error(`Must specify activateTokenIds for ${this.currencyInfo.currencyCode}`);const{tokenId:l,wallet:f}=s!=null?s:{tokenId:null};if(l!=null)throw new Error(`Must activate with ${this.currencyInfo.currencyCode}`);if((f==null?void 0:f.id)!==this.walletId)throw new Error("Must pay with same wallet you are activating token with");const c=this.networkInfo.minimumTxFee.toFixed();let y="0";const b=[];for(const C of a){if(C!==null&&this.allTokensMap[C]==null)throw new Error(`Invalid tokenId to activate ${C}`);const K={tokenId:C,skipChecks:!0,spendTargets:[{publicAddress:this.walletInfo.keys.publicKey,nativeAmount:"0"}]};try{const B=yield this.makeSpend(K);y=(0,d.add)(y,(r=B.parentNetworkFee)!=null?r:c)}catch{y=(0,d.add)(y,c)}b.push(K)}return{paymentTokenId:l,paymentWalletId:this.walletId,fromNativeAmount:"0",networkFee:{tokenId:null,nativeAmount:y,currencyPluginId:this.currencyInfo.pluginId},approve:(...C)=>p(this,[...C],function*(K={}){const{metadata:B}=K,w=[];for(const k of b){const $=yield this.makeSpend(k);$.metadata=X({},B);let L=yield f.signTx($);L=yield f.broadcastTx(L),w.push(L),yield f.saveTx(L)}return{transactions:w}}),close:()=>p(this,null,function*(){})}}),this.networkInfo=e.networkInfo,this.queryTxMutex=(0,v.M0)(),this.suggestedTransactionParams={flatFee:!1,fee:0,firstRound:0,lastRound:0,genesisID:this.networkInfo.genesisID,genesisHash:this.networkInfo.genesisHash},this.minimumAddressBalance=this.networkInfo.minimumAddressBalance,this.totalReserve=this.minimumAddressBalance,this.otherMethods={parseWalletConnectV2Payload:o=>p(this,null,function*(){try{const s=(0,h.Ut)(o).params[0][0],r=(0,T.kX)(E.K3.parse(s.txn)),l=r.amount!=null?r.amount.toString():"0",f=r.fee.toFixed();let c=null;if(r.type==="axfer"){const y=r.assetIndex.toString();if(this.allTokensMap[y]==null)throw new Error("Unrecognized token");c=y}return{nativeAmount:l,networkFee:f,tokenId:c}}catch(a){throw this.warn("Wallet connect call_request ",a),a}})}}changeEnabledTokenIds(e){return p(this,null,function*(){yield _(J.prototype,this,"changeEnabledTokenIds").call(this,e),yield this.queryBalance()})}setOtherData(e){this.otherData=(0,h.gQ)(e)}fetchAccountInfo(e){return p(this,null,function*(){return yield(0,g.NN)(this.networkInfo.algodServers.map(t=>()=>p(this,null,function*(){const i=yield new Z("",t,"").accountInformation(e).do();return(0,h.Um)(i)})))})}queryBalance(){return p(this,null,function*(){try{const e=yield this.fetchAccountInfo(this.walletLocalData.publicKey),{assets:t,amount:n,"min-balance":i,round:o}=e;this.updateBalance(this.currencyInfo.currencyCode,n.toString()),this.totalReserve=i.toString();const a=[],s=[];for(const[r,l]of Object.entries(this.allTokensMap)){const f=t.find(c=>c["asset-id"].toFixed()===r);if(f!=null){const c=f.amount.toString();this.updateBalance(l.currencyCode,c),(0,d.gt)(c,"0")&&!this.enabledTokenIds.includes(r)&&a.push(r)}else this.updateBalance(l.currencyCode,"0"),this.enabledTokenIds.includes(r)&&s.push(r)}a.length>0&&this.currencyEngineCallbacks.onNewTokens(a),o>this.walletLocalData.blockHeight&&(this.walletLocalData.blockHeight=o,this.walletLocalDataDirty=!0,this.currencyEngineCallbacks.onBlockHeightChanged(this.walletLocalData.blockHeight)),(0,v.AP)(s,this.walletLocalData.unactivatedTokenIds)||(this.walletLocalData.unactivatedTokenIds=s,this.walletLocalDataDirty=!0,this.currencyEngineCallbacks.onUnactivatedTokenIdsChanged(this.walletLocalData.unactivatedTokenIds))}catch(e){this.log.warn("queryBalance Error ",e)}})}queryTransactionParams(){return p(this,null,function*(){try{const e=yield(0,g.NN)(this.networkInfo.algodServers.map(t=>()=>p(this,null,function*(){const i=yield new Z("",t,"").getTransactionParams().do(),o=(0,h.wC)(i);if(o.genesisHash!==this.networkInfo.genesisHash)throw new Error("Server genesisHash mismatch");return o})));this.suggestedTransactionParams=e}catch(e){this.log.warn("queryTransactionParams error:",e)}})}processAlgorandTransaction(e){const{"confirmed-round":t,"round-time":n,"tx-type":i,fee:o,id:a,note:s,sender:r}=e;let l,f,c,y,b,R=!1;const C=[];switch(i){case"pay":{const{amount:w,receiver:k}=(0,h.pT)(e)["payment-transaction"];if(c=w.toString(),y=o.toString(),r===this.walletInfo.keys.publicKey)c=`-${(0,d.add)(c,y)}`,R=!0;else if(k===this.walletInfo.keys.publicKey)y="0",C.push(this.walletInfo.keys.publicKey);else return;l=this.currencyInfo.currencyCode,f=null;break}case"axfer":{const{amount:w,"asset-id":k,receiver:$}=(0,h.NH)(e)["asset-transfer-transaction"];if(c=w.toString(),y="0",r===this.walletInfo.keys.publicKey)c=`-${c}`,b=o.toString(),R=!0;else if($===this.walletInfo.keys.publicKey)C.push(this.walletInfo.keys.publicKey);else return;const L=this.allTokensMap[k];if(L==null)return;l=L.currencyCode,f=k.toString();break}case"appl":{const{"inner-txns":w=[]}=(0,h.gF)(e);if(w.forEach(k=>this.processAlgorandTransaction(ae(X({},k),{id:a}))),c="0",y=o.toString(),r===this.walletInfo.keys.publicKey)c=`-${(0,d.add)(c,y)}`,R=!0;else return;l=this.currencyInfo.currencyCode,f=null;break}default:return}const K=[];if(s!=null){const w=E.K3.parse(s);try{K.push({memoName:"note",type:"text",value:I.A.stringify(w)})}catch{K.push({memoName:"note",type:"hex",value:E.xn.stringify(w).toLowerCase()})}}const B={blockHeight:t,currencyCode:l,date:n,isSend:R,memos:K,nativeAmount:c,networkFee:y,ourReceiveAddresses:C,parentNetworkFee:b,signedTx:"",tokenId:f,txid:a,walletId:this.walletId};this.addTransaction(this.currencyInfo.currencyCode,B)}queryTransactions(){return p(this,null,function*(){return yield this.queryTxMutex(()=>p(this,null,function*(){return yield this.queryTransactionsInner()}))})}queryTransactionsInner(){return p(this,null,function*(){const e=this.otherData.latestRound;let t,n=this.otherData.latestRound,i=0,o,a=!0;do{const s=yield(0,g.NN)(this.networkInfo.indexerServers.map(c=>()=>p(this,null,function*(){const b=yield new ce({},c,"").lookupAccountTransactions(this.walletLocalData.publicKey).minRound(e).nextToken(o!=null?o:"").do();return(0,h.n$)(b)}))),{"next-token":r,transactions:l}=s;if(l.length===0)break;for(const c of l){if(t==null&&(t=c.id,n=c["confirmed-round"]),i=c["confirmed-round"],c.id===this.otherData.latestTxid){a=!1;break}try{this.processAlgorandTransaction(c)}catch(y){this.log.warn("processAlgorandTransaction error:",y)}}n=n!=null?n:this.walletLocalData.blockHeight;const f=(n-i)/(n-e);this.tokenCheckTransactionsStatus[this.currencyInfo.currencyCode]=f,this.updateOnAddressesChecked(),o=r}while(o!=null&&a);t!=null&&this.otherData.latestTxid!==t&&(this.otherData.latestTxid=t,this.otherData.latestRound=n,this.walletLocalDataDirty=!0);for(const s of this.enabledTokens)this.tokenCheckTransactionsStatus[s]=1;this.updateOnAddressesChecked(),this.transactionsChangedArray.length>0&&(this.walletLocalDataDirty=!0,this.currencyEngineCallbacks.onTransactionsChanged(this.transactionsChangedArray),this.transactionsChangedArray=[])})}startEngine(){return p(this,null,function*(){this.engineOn=!0,this.addToLoop("queryBalance",ee).catch(()=>{}),this.addToLoop("queryTransactionParams",ee).catch(()=>{}),this.addToLoop("queryTransactions",le).catch(()=>{}),yield _(J.prototype,this,"startEngine").call(this)})}resyncBlockchain(){return p(this,null,function*(){yield this.killEngine(),yield this.clearBlockchainCache(),yield this.startEngine()})}calcFee(e){const t=e.estimateSize();return Math.max(this.suggestedTransactionParams.fee*t,this.networkInfo.minimumTxFee).toString()}getMaxSpendable(e){return p(this,null,function*(){const{tokenId:t}=e;let n=this.getBalance({tokenId:t});if(t==null&&(n=(0,d.sub)(n,this.totalReserve)),e.spendTargets[0].publicAddress==null)throw new Error("makeSpend Missing publicAddress");const{customNetworkFee:o}=e;let s=(0,h.wN)(o).fee;s==null&&(e.spendTargets[0].nativeAmount="1",s=(yield this.makeSpend(e)).networkFee);const r=(l,f)=>p(this,null,function*(){const c=(0,d.sub)(f,l);if((0,d.lte)(c,"1"))return l;const y=(0,d.add)(l,(0,d.div)(c,"2"));e.spendTargets[0].nativeAmount=y;const b=(0,d.add)(y,s!=null?s:this.networkInfo.minimumTxFee.toString());return(0,d.gt)(b,n)?yield r(l,y):yield r(y,f)});return yield r("0",(0,d.add)(n,"1"))})}makeSpend(e){return p(this,null,function*(){var t,n,i,o;const{edgeSpendInfo:a,currencyCode:s,nativeBalance:r}=this.makeSpendCheck(e),{customNetworkFee:l,memos:f=[],tokenId:c}=a,y=(0,d.sub)(this.getBalance({tokenId:null}),this.totalReserve);if(a.spendTargets.length!==1)throw new Error("Error: only one output allowed");const{nativeAmount:b,publicAddress:R}=a.spendTargets[0];if(R==null)throw new Error("makeSpend Missing publicAddress");if(b==null)throw new z.ef;const{type:C}=(t=(0,W.HS)(h.cA)(a.otherParams))!=null?t:{type:s===this.currencyInfo.currencyCode?"pay":"axfer"},K=((n=f[0])==null?void 0:n.type)==="text"?I.A.parse(f[0].value):void 0,B=(0,h.wN)(l).fee;let w,k=b,$="0",L,Q,oe;switch(C){case"pay":{if(w=T.Ay.makePaymentTxnWithSuggestedParamsFromObject({to:R,from:this.walletInfo.keys.publicKey,amount:BigInt(b),note:K,suggestedParams:X({},this.suggestedTransactionParams)}),Q=B!=null?B:this.calcFee(w),$=Q,k=`-${(0,d.add)(k,$)}`,oe=R,(0,d.gt)((0,d.abs)(k),y))throw new z.k5({tokenId:c});break}case"axfer":{const se=Object.keys(this.allTokensMap).find(Ie=>this.allTokensMap[Ie].currencyCode===s);if(se==null)throw new Error("Unrecognized asset");const ie=(0,h.Ax)((o=(i=this.allTokensMap)==null?void 0:i[se])==null?void 0:o.networkLocation);if(ie==null)throw new Error("Unrecognized asset");if(w=T.Ay.makeAssetTransferTxnWithSuggestedParamsFromObject({assetIndex:parseInt(ie.contractAddress),to:R,from:this.walletInfo.keys.publicKey,amount:BigInt(b),note:K,suggestedParams:X({},this.suggestedTransactionParams)}),Q=B!=null?B:this.calcFee(w),k=`-${k}`,L=Q,(0,d.gt)(L,y))throw new z.k5({networkFee:Q,tokenId:null});if((0,d.gt)((0,d.abs)(k),r))throw new z.k5({tokenId:c});break}default:throw new Error("Unrecognized transaction type")}w.flatFee=!0,w.fee=parseInt(Q);const we={encodedTx:E.xn.stringify((0,T.w7)(w)),recipient:oe};return{blockHeight:0,currencyCode:s,date:0,isSend:!0,memos:f,nativeAmount:k,networkFee:$,otherParams:we,ourReceiveAddresses:[],parentNetworkFee:L,signedTx:"",tokenId:c,txid:"",walletId:this.walletId}})}signMessage(e,t){return p(this,null,function*(){const n=(0,h.sf)(this.currencyInfo.pluginId)(t),i=(0,T.kX)(E.K3.parse(e)),o=T.Ay.mnemonicToSecretKey(n.mnemonic),a=i.signTxn(o.sk);return E.K3.stringify(a)})}signTx(e,t){return p(this,null,function*(){const{encodedTx:n,recipient:i}=(0,h._t)((0,v.Je)(e)),o=(0,T.kX)(Uint8Array.from(E.xn.parse(n)));i!=null&&(yield this.checkRecipientMinimumBalance(this.getRecipientBalance,o.amount.toString(),i));const a=(0,h.sf)(this.currencyInfo.pluginId)(t),s=T.Ay.mnemonicToSecretKey(a.mnemonic),r=o.signTxn(s.sk),l=E.xn.stringify(r);return e.signedTx=l,e})}broadcastTx(e){return p(this,null,function*(){const t=Uint8Array.from(E.xn.parse(e.signedTx));try{const{txId:n}=yield(0,g.NN)(this.networkInfo.algodServers.map(i=>()=>p(this,null,function*(){return yield new Z("",i,"").sendRawTransaction(t).do()})));e.txid=n,e.date=Date.now()/1e3}catch(n){throw this.warn("FAILURE broadcastTx failed: ",n),n}return this.warn(`SUCCESS broadcastTx
|
|
1
|
+
(self.webpackChunkedge_currency_accountbased=self.webpackChunkedge_currency_accountbased||[]).push([[9647],{47813:function(q,H,m){"use strict";m.r(H),m.d(H,{AlgorandTools:function(){return re},makeCurrencyEngine:function(){return ue},makeCurrencyTools:function(){return me},updateInfoPayload:function(){return ge}});var T=m(68140),d=m(66001),A=m(14483),P=m(96542),v=m(44276),h=m(37085),W=m(99818),z=m(82671),E=m(65828),Y=m(26277),x=m(62351),g=m(14171),I=m(27662),O=Object.defineProperty,D=Object.defineProperties,j=Object.getOwnPropertyDescriptors,N=Object.getOwnPropertySymbols,U=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable,G=Reflect.get,V=(u,e,t)=>e in u?O(u,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[e]=t,X=(u,e)=>{for(var t in e||(e={}))S.call(e,t)&&V(u,t,e[t]);if(N)for(var t of N(e))F.call(e,t)&&V(u,t,e[t]);return u},ae=(u,e)=>D(u,j(e)),_=(u,e,t)=>G(U(u),t,e),p=(u,e,t)=>new Promise((n,i)=>{var o=r=>{try{s(t.next(r))}catch(l){i(l)}},a=r=>{try{s(t.throw(r))}catch(l){i(l)}},s=r=>r.done?n(r.value):Promise.resolve(r.value).then(o,a);s((t=t.apply(u,e)).next())});const{Algodv2:Z,Indexer:ce}=T.Ay,ee=(0,x.fi)(2e4),le=(0,x.fi)(2e4);class J extends Y.k{constructor(e,t,n,i){super(e,t,n,i),this.getRecipientBalance=o=>p(this,null,function*(){try{return(yield this.fetchAccountInfo(o)).amount.toString()}catch{return this.minimumAddressBalance}}),this.engineGetActivationAssets=o=>p(this,null,function*(){return{assetOptions:[{tokenId:null,paymentWalletId:this.walletId,currencyPluginId:this.currencyInfo.pluginId}]}}),this.engineActivateWallet=o=>p(this,[o],function*({activateTokenIds:a,paymentInfo:s}){var r;if(a==null)throw new Error(`Must specify activateTokenIds for ${this.currencyInfo.currencyCode}`);const{tokenId:l,wallet:f}=s!=null?s:{tokenId:null};if(l!=null)throw new Error(`Must activate with ${this.currencyInfo.currencyCode}`);if((f==null?void 0:f.id)!==this.walletId)throw new Error("Must pay with same wallet you are activating token with");const c=this.networkInfo.minimumTxFee.toFixed();let y="0";const b=[];for(const C of a){if(C!==null&&this.allTokensMap[C]==null)throw new Error(`Invalid tokenId to activate ${C}`);const K={tokenId:C,skipChecks:!0,spendTargets:[{publicAddress:this.walletInfo.keys.publicKey,nativeAmount:"0"}]};try{const B=yield this.makeSpend(K);y=(0,d.add)(y,(r=B.parentNetworkFee)!=null?r:c)}catch{y=(0,d.add)(y,c)}b.push(K)}return{paymentTokenId:l,paymentWalletId:this.walletId,fromNativeAmount:"0",networkFee:{tokenId:null,nativeAmount:y,currencyPluginId:this.currencyInfo.pluginId},approve:(...C)=>p(this,[...C],function*(K={}){const{metadata:B}=K,w=[];for(const k of b){const $=yield this.makeSpend(k);$.metadata=X({},B);let L=yield f.signTx($);L=yield f.broadcastTx(L),w.push(L),yield f.saveTx(L)}return{transactions:w}}),close:()=>p(this,null,function*(){})}}),this.networkInfo=e.networkInfo,this.queryTxMutex=(0,v.M0)(),this.suggestedTransactionParams={flatFee:!1,fee:0,firstRound:0,lastRound:0,genesisID:this.networkInfo.genesisID,genesisHash:this.networkInfo.genesisHash},this.minimumAddressBalance=this.networkInfo.minimumAddressBalance,this.totalReserve=this.minimumAddressBalance,this.otherMethods={parseWalletConnectV2Payload:o=>p(this,null,function*(){try{const s=(0,h.Ut)(o).params[0][0],r=(0,T.kX)(E.K3.parse(s.txn)),l=r.amount!=null?r.amount.toString():"0",f=r.fee.toFixed();let c=null;if(r.type==="axfer"){const y=r.assetIndex.toString();if(this.allTokensMap[y]==null)throw new Error("Unrecognized token");c=y}return{nativeAmount:l,networkFee:f,tokenId:c}}catch(a){throw this.warn("Wallet connect call_request ",a),a}})}}changeEnabledTokenIds(e){return p(this,null,function*(){yield _(J.prototype,this,"changeEnabledTokenIds").call(this,e),yield this.queryBalance()})}setOtherData(e){this.otherData=(0,h.gQ)(e)}fetchAccountInfo(e){return p(this,null,function*(){return yield(0,g.NN)(this.networkInfo.algodServers.map(t=>()=>p(this,null,function*(){const i=yield new Z("",t,"").accountInformation(e).do();return(0,h.Um)(i)})))})}queryBalance(){return p(this,null,function*(){try{const e=yield this.fetchAccountInfo(this.walletLocalData.publicKey),{assets:t,amount:n,"min-balance":i,round:o}=e;this.updateBalance(this.currencyInfo.currencyCode,n.toString()),this.totalReserve=i.toString();const a=[],s=[];for(const[r,l]of Object.entries(this.allTokensMap)){const f=t.find(c=>c["asset-id"].toFixed()===r);if(f!=null){const c=f.amount.toString();this.updateBalance(l.currencyCode,c),(0,d.gt)(c,"0")&&!this.enabledTokenIds.includes(r)&&a.push(r)}else this.updateBalance(l.currencyCode,"0"),this.enabledTokenIds.includes(r)&&s.push(r)}a.length>0&&this.currencyEngineCallbacks.onNewTokens(a),o>this.walletLocalData.blockHeight&&(this.walletLocalData.blockHeight=o,this.walletLocalDataDirty=!0,this.currencyEngineCallbacks.onBlockHeightChanged(this.walletLocalData.blockHeight)),(0,v.AP)(s,this.walletLocalData.unactivatedTokenIds)||(this.walletLocalData.unactivatedTokenIds=s,this.walletLocalDataDirty=!0,this.currencyEngineCallbacks.onUnactivatedTokenIdsChanged(this.walletLocalData.unactivatedTokenIds))}catch(e){this.log.warn("queryBalance Error ",e)}})}queryTransactionParams(){return p(this,null,function*(){try{const e=yield(0,g.NN)(this.networkInfo.algodServers.map(t=>()=>p(this,null,function*(){const i=yield new Z("",t,"").getTransactionParams().do(),o=(0,h.wC)(i);if(o.genesisHash!==this.networkInfo.genesisHash)throw new Error("Server genesisHash mismatch");return o})));this.suggestedTransactionParams=e}catch(e){this.log.warn("queryTransactionParams error:",e)}})}processAlgorandTransaction(e){const{"confirmed-round":t,"round-time":n,"tx-type":i,fee:o,id:a,note:s,sender:r}=e;let l,f,c,y,b,R=!1;const C=[];switch(i){case"pay":{const{amount:w,receiver:k}=(0,h.pT)(e)["payment-transaction"];if(c=w.toString(),y=o.toString(),r===this.walletInfo.keys.publicKey)c=`-${(0,d.add)(c,y)}`,R=!0;else if(k===this.walletInfo.keys.publicKey)y="0",C.push(this.walletInfo.keys.publicKey);else return;l=this.currencyInfo.currencyCode,f=null;break}case"axfer":{const{amount:w,"asset-id":k,receiver:$}=(0,h.NH)(e)["asset-transfer-transaction"];if(c=w.toString(),y="0",r===this.walletInfo.keys.publicKey)c=`-${c}`,b=o.toString(),R=!0;else if($===this.walletInfo.keys.publicKey)C.push(this.walletInfo.keys.publicKey);else return;const L=this.allTokensMap[k];if(L==null)return;l=L.currencyCode,f=k.toString();break}case"appl":{const{"inner-txns":w=[]}=(0,h.gF)(e);if(w.forEach(k=>this.processAlgorandTransaction(ae(X({},k),{id:a}))),c="0",y=o.toString(),r===this.walletInfo.keys.publicKey)c=`-${(0,d.add)(c,y)}`,R=!0;else return;l=this.currencyInfo.currencyCode,f=null;break}default:return}const K=[];if(s!=null){const w=E.K3.parse(s);try{K.push({memoName:"note",type:"text",value:I.A.stringify(w)})}catch{K.push({memoName:"note",type:"hex",value:E.xn.stringify(w).toLowerCase()})}}const B={blockHeight:t,currencyCode:l,date:n,isSend:R,memos:K,nativeAmount:c,networkFee:y,networkFees:[],ourReceiveAddresses:C,parentNetworkFee:b,signedTx:"",tokenId:f,txid:a,walletId:this.walletId};this.addTransaction(this.currencyInfo.currencyCode,B)}queryTransactions(){return p(this,null,function*(){return yield this.queryTxMutex(()=>p(this,null,function*(){return yield this.queryTransactionsInner()}))})}queryTransactionsInner(){return p(this,null,function*(){const e=this.otherData.latestRound;let t,n=this.otherData.latestRound,i=0,o,a=!0;do{const s=yield(0,g.NN)(this.networkInfo.indexerServers.map(c=>()=>p(this,null,function*(){const b=yield new ce({},c,"").lookupAccountTransactions(this.walletLocalData.publicKey).minRound(e).nextToken(o!=null?o:"").do();return(0,h.n$)(b)}))),{"next-token":r,transactions:l}=s;if(l.length===0)break;for(const c of l){if(t==null&&(t=c.id,n=c["confirmed-round"]),i=c["confirmed-round"],c.id===this.otherData.latestTxid){a=!1;break}try{this.processAlgorandTransaction(c)}catch(y){this.log.warn("processAlgorandTransaction error:",y)}}n=n!=null?n:this.walletLocalData.blockHeight;const f=(n-i)/(n-e);this.tokenCheckTransactionsStatus[this.currencyInfo.currencyCode]=f,this.updateOnAddressesChecked(),o=r}while(o!=null&&a);t!=null&&this.otherData.latestTxid!==t&&(this.otherData.latestTxid=t,this.otherData.latestRound=n,this.walletLocalDataDirty=!0);for(const s of this.enabledTokens)this.tokenCheckTransactionsStatus[s]=1;this.updateOnAddressesChecked(),this.transactionsChangedArray.length>0&&(this.walletLocalDataDirty=!0,this.currencyEngineCallbacks.onTransactionsChanged(this.transactionsChangedArray),this.transactionsChangedArray=[])})}startEngine(){return p(this,null,function*(){this.engineOn=!0,this.addToLoop("queryBalance",ee).catch(()=>{}),this.addToLoop("queryTransactionParams",ee).catch(()=>{}),this.addToLoop("queryTransactions",le).catch(()=>{}),yield _(J.prototype,this,"startEngine").call(this)})}resyncBlockchain(){return p(this,null,function*(){yield this.killEngine(),yield this.clearBlockchainCache(),yield this.startEngine()})}calcFee(e){const t=e.estimateSize();return Math.max(this.suggestedTransactionParams.fee*t,this.networkInfo.minimumTxFee).toString()}getMaxSpendable(e){return p(this,null,function*(){const{tokenId:t}=e;let n=this.getBalance({tokenId:t});if(t==null&&(n=(0,d.sub)(n,this.totalReserve)),e.spendTargets[0].publicAddress==null)throw new Error("makeSpend Missing publicAddress");const{customNetworkFee:o}=e;let s=(0,h.wN)(o).fee;s==null&&(e.spendTargets[0].nativeAmount="1",s=(yield this.makeSpend(e)).networkFee);const r=(l,f)=>p(this,null,function*(){const c=(0,d.sub)(f,l);if((0,d.lte)(c,"1"))return l;const y=(0,d.add)(l,(0,d.div)(c,"2"));e.spendTargets[0].nativeAmount=y;const b=(0,d.add)(y,s!=null?s:this.networkInfo.minimumTxFee.toString());return(0,d.gt)(b,n)?yield r(l,y):yield r(y,f)});return yield r("0",(0,d.add)(n,"1"))})}makeSpend(e){return p(this,null,function*(){var t,n,i,o;const{edgeSpendInfo:a,currencyCode:s,nativeBalance:r}=this.makeSpendCheck(e),{customNetworkFee:l,memos:f=[],tokenId:c}=a,y=(0,d.sub)(this.getBalance({tokenId:null}),this.totalReserve);if(a.spendTargets.length!==1)throw new Error("Error: only one output allowed");const{nativeAmount:b,publicAddress:R}=a.spendTargets[0];if(R==null)throw new Error("makeSpend Missing publicAddress");if(b==null)throw new z.ef;const{type:C}=(t=(0,W.HS)(h.cA)(a.otherParams))!=null?t:{type:s===this.currencyInfo.currencyCode?"pay":"axfer"},K=((n=f[0])==null?void 0:n.type)==="text"?I.A.parse(f[0].value):void 0,B=(0,h.wN)(l).fee;let w,k=b,$="0",L,Q,oe;switch(C){case"pay":{if(w=T.Ay.makePaymentTxnWithSuggestedParamsFromObject({to:R,from:this.walletInfo.keys.publicKey,amount:BigInt(b),note:K,suggestedParams:X({},this.suggestedTransactionParams)}),Q=B!=null?B:this.calcFee(w),$=Q,k=`-${(0,d.add)(k,$)}`,oe=R,(0,d.gt)((0,d.abs)(k),y))throw new z.k5({tokenId:c});break}case"axfer":{const se=Object.keys(this.allTokensMap).find(Ie=>this.allTokensMap[Ie].currencyCode===s);if(se==null)throw new Error("Unrecognized asset");const ie=(0,h.Ax)((o=(i=this.allTokensMap)==null?void 0:i[se])==null?void 0:o.networkLocation);if(ie==null)throw new Error("Unrecognized asset");if(w=T.Ay.makeAssetTransferTxnWithSuggestedParamsFromObject({assetIndex:parseInt(ie.contractAddress),to:R,from:this.walletInfo.keys.publicKey,amount:BigInt(b),note:K,suggestedParams:X({},this.suggestedTransactionParams)}),Q=B!=null?B:this.calcFee(w),k=`-${k}`,L=Q,(0,d.gt)(L,y))throw new z.k5({networkFee:Q,tokenId:null});if((0,d.gt)((0,d.abs)(k),r))throw new z.k5({tokenId:c});break}default:throw new Error("Unrecognized transaction type")}w.flatFee=!0,w.fee=parseInt(Q);const we={encodedTx:E.xn.stringify((0,T.w7)(w)),recipient:oe};return{blockHeight:0,currencyCode:s,date:0,isSend:!0,memos:f,nativeAmount:k,networkFee:$,networkFees:[],otherParams:we,ourReceiveAddresses:[],parentNetworkFee:L,signedTx:"",tokenId:c,txid:"",walletId:this.walletId}})}signMessage(e,t){return p(this,null,function*(){const n=(0,h.sf)(this.currencyInfo.pluginId)(t),i=(0,T.kX)(E.K3.parse(e)),o=T.Ay.mnemonicToSecretKey(n.mnemonic),a=i.signTxn(o.sk);return E.K3.stringify(a)})}signTx(e,t){return p(this,null,function*(){const{encodedTx:n,recipient:i}=(0,h._t)((0,v.Je)(e)),o=(0,T.kX)(Uint8Array.from(E.xn.parse(n)));i!=null&&(yield this.checkRecipientMinimumBalance(this.getRecipientBalance,o.amount.toString(),i));const a=(0,h.sf)(this.currencyInfo.pluginId)(t),s=T.Ay.mnemonicToSecretKey(a.mnemonic),r=o.signTxn(s.sk),l=E.xn.stringify(r);return e.signedTx=l,e})}broadcastTx(e){return p(this,null,function*(){const t=Uint8Array.from(E.xn.parse(e.signedTx));try{const{txId:n}=yield(0,g.NN)(this.networkInfo.algodServers.map(i=>()=>p(this,null,function*(){return yield new Z("",i,"").sendRawTransaction(t).do()})));e.txid=n,e.date=Date.now()/1e3}catch(n){throw this.warn("FAILURE broadcastTx failed: ",n),n}return this.warn(`SUCCESS broadcastTx
|
|
2
2
|
${(0,v.T5)(e)}`),e})}}function ue(u,e,t,n){return p(this,null,function*(){const i=(0,h.fr)(t),o=new J(u,e,i,n);return yield o.loadEngine(),o})}var de=m(48287).Buffer,te=Object.getOwnPropertySymbols,he=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable,ye=(u,e)=>{var t={};for(var n in u)he.call(u,n)&&e.indexOf(n)<0&&(t[n]=u[n]);if(u!=null&&te)for(var n of te(u))e.indexOf(n)<0&&fe.call(u,n)&&(t[n]=u[n]);return t},M=(u,e,t)=>new Promise((n,i)=>{var o=r=>{try{s(t.next(r))}catch(l){i(l)}},a=r=>{try{s(t.throw(r))}catch(l){i(l)}},s=r=>r.done?n(r.value):Promise.resolve(r.value).then(o,a);s((t=t.apply(u,e)).next())});const{isValidAddress:ne,mnemonicFromSeed:pe}=T.Ay;class re{constructor(e){const{builtinTokens:t,currencyInfo:n,io:i}=e;this.io=i,this.currencyInfo=n,this.builtinTokens=t}getDisplayPrivateKey(e){return M(this,null,function*(){const{pluginId:t}=this.currencyInfo;return(0,h.sf)(t)(e.keys).mnemonic})}getDisplayPublicKey(e){return M(this,null,function*(){const{keys:t}=(0,h.fr)(e);return t.publicKey})}importPrivateKey(e){return M(this,null,function*(){const{pluginId:t}=this.currencyInfo;return T.Ay.mnemonicToSecretKey(e),{[`${t}Mnemonic`]:e}})}createPrivateKey(e){return M(this,null,function*(){if(e!==this.currencyInfo.walletType)throw new Error("InvalidWalletType");const t=de.from(this.io.random(32)),n=pe(t);return yield this.importPrivateKey(n)})}derivePublicKey(e){return M(this,null,function*(){const{pluginId:t}=this.currencyInfo;if(e.type!==this.currencyInfo.walletType)throw new Error("InvalidWalletType");const n=(0,h.sf)(t)(e.keys);return{publicKey:T.Ay.mnemonicToSecretKey(n.mnemonic).addr}})}parseUri(e,t,n){return M(this,null,function*(){const{pluginId:i}=this.currencyInfo,o={[i]:!0},{parsedUri:a,edgeParsedUri:s}=yield(0,P.x)({currencyInfo:this.currencyInfo,uri:e,networks:o,builtinTokens:this.builtinTokens,currencyCode:t!=null?t:this.currencyInfo.currencyCode,customTokens:n});let r="";if(s.publicAddress!=null&&(r=s.publicAddress),!ne(r))throw new Error("InvalidPublicAddressError");return s.uniqueIdentifier=a.query.memo,s})}encodeUri(e){return M(this,arguments,function*(t,n=[]){const{pluginId:i}=this.currencyInfo,{nativeAmount:o,currencyCode:a,publicAddress:s}=t;if(!ne(s))throw new Error("InvalidPublicAddressError");let r;if(typeof o=="string"){const f=(0,v.FQ)(a!=null?a:this.currencyInfo.currencyCode,this.currencyInfo,n,this.builtinTokens);if(f==null)throw new Error("InternalErrorInvalidCurrencyCode");r=(0,d.div)(o,f.multiplier,18)}return(0,P.m)(t,i,r)})}getTokenId(e){return M(this,null,function*(){(0,A.k9)(e);const t=(0,h.Ax)(e.networkLocation);if(t==null)throw new Error("ErrorInvalidContractAddress");return t.contractAddress})}}function me(u){return M(this,null,function*(){return new re(u)})}function ge(u,e){return M(this,null,function*(){const t=ye(e,[]);u.networkInfo=(0,v.wy)(u.networkInfo,t)})}},62351:function(q,H,m){"use strict";m.d(H,{Nn:function(){return z},Nt:function(){return E},fi:function(){return Y},zp:function(){return h}});var T=m(14171),d=m(44276),A=(x,g,I)=>new Promise((O,D)=>{var j=S=>{try{U(I.next(S))}catch(F){D(F)}},N=S=>{try{U(I.throw(S))}catch(F){D(F)}},U=S=>S.done?O(S.value):Promise.resolve(S.value).then(j,N);U((I=I.apply(x,g)).next())});const P=["https://info1.edge.app","https://info2.edge.app"];function v(x,g,I){return A(this,arguments,function*(O,D,j,N=5e3,U=fetch){const S=O.map(F=>()=>A(this,null,function*(){const G=yield U(F+"/"+D,j);if(typeof G!="object"){const V=`Invalid return value ${D} in ${F}`;throw console.log(V),new Error(V)}return G}));return yield(0,T.NN)(S,N)})}function h(x,g,I,O,D=5e3,j){return A(this,null,function*(){const N=yield v((0,d.R3)(g),I,O,D,j);if(!N.ok){const F=yield N.text();throw console.error(F),new Error(`Error fetching ${I}: ${F}`)}const U=yield N.json();return x(U)})}function W(x,g,I,O=5e3,D){return A(this,null,function*(){return yield v((0,d.R3)(x),g,I,O,D)})}const z=(x,g,I,O)=>A(void 0,null,function*(){return yield W(P,x,g,I,O)}),E=x=>Object.keys(x).map(g=>{const I=x[g];return I==null?g:`${g}=${encodeURIComponent(I)}`}).join("&"),Y=(x,g=5e3)=>x+Math.random()*g*2-g},27662:function(q,H,m){"use strict";m.d(H,{A:function(){return T}});const T={parse(d){const A=encodeURI(d),P=new Uint8Array(A.length);let v=0;for(let h=0;h<A.length;++h){const W=A.charCodeAt(h);W===37?(P[v++]=parseInt(A.slice(h+1,h+3),16),h+=2):P[v++]=W}return P.subarray(0,v)},stringify(d){let A="";for(let P=0;P<d.length;++P){const v=d[P];A+="%"+(v>>4).toString(16)+(v&15).toString(16)}return decodeURIComponent(A)}}},71281:function(){}}]);
|