react-web3-storage 2.0.2 → 2.0.3
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/dist/{ReownAuthentication-7iIT4jS4.mjs → ReownAuthentication-ZWJVb5u8.mjs} +5 -5
- package/dist/{ReownAuthentication-BEGlJitZ.js → ReownAuthentication-_EMKUe4O.js} +1 -1
- package/dist/{SwapController-DNucRoq5.js → SwapController-75y039lY.js} +1 -1
- package/dist/{SwapController-CmWZu4cY.mjs → SwapController-CNHVjC6V.mjs} +16 -16
- package/dist/{ccip-Cy73HTCR.js → ccip-BgoVuN3u.js} +1 -1
- package/dist/{ccip-BCIUIeQM.mjs → ccip-CQrFYKlN.mjs} +6 -6
- package/dist/{data-capture-CaxHvefN.mjs → data-capture-CgKKCS0j.mjs} +5 -5
- package/dist/{data-capture-DbbP8JDT.js → data-capture-hbDyOOyJ.js} +1 -1
- package/dist/{email-B3WQnC0b.mjs → email-C2N4HkZQ.mjs} +9 -9
- package/dist/{email-CYJMBkHW.js → email-DYvAHYik.js} +1 -1
- package/dist/{embedded-wallet-t_Jd_LFV.js → embedded-wallet-CYNDQvBG.js} +1 -1
- package/dist/{embedded-wallet-Dlo0wBgH.mjs → embedded-wallet-_7JcZAOC.mjs} +22 -22
- package/dist/{features-B1ezv71b.js → features-BA8f0aFu.js} +1 -1
- package/dist/{features-5qKGISK9.mjs → features-JvQHn7sG.mjs} +1 -1
- package/dist/{index-2WfSPp5U.mjs → index-B--AiWBy.mjs} +5 -5
- package/dist/index-B7Og0OLg.js +1 -0
- package/dist/{index-CFLg0HEy.mjs → index-BHukHFIh.mjs} +4250 -4171
- package/dist/{index-BhaYgUya.js → index-BNobBA-8.js} +281 -281
- package/dist/{index-SXXuh_Wo.mjs → index-Bxg-paEQ.mjs} +346 -394
- package/dist/{index-BCZXGGtc.js → index-CASDFBE7.js} +1 -1
- package/dist/{index-DAGaFidW.js → index-CLUlCRLy.js} +1 -1
- package/dist/{index-VrnBQez9.js → index-C_fopi0u.js} +1 -1
- package/dist/{index-D3R3_EiN.mjs → index-Ccy2zz9q.mjs} +1 -1
- package/dist/index-CgI_Ukj5.mjs +267 -0
- package/dist/{index-D1agTf42.js → index-CjS2YG3n.js} +1 -1
- package/dist/{index-CAtS1mbf.mjs → index-Clu0wU1d.mjs} +15 -15
- package/dist/{index-BR1aMNYm.mjs → index-DIxai2A2.mjs} +1 -1
- package/dist/{index-BBH4oh8q.mjs → index-DVNi_N99.mjs} +2 -2
- package/dist/{index-D8W2bJl5.mjs → index-DnKQlXMR.mjs} +1 -1
- package/dist/{index-MeOSUHRy.js → index-DzjJtqrG.js} +1 -1
- package/dist/{index-Dk48RrmB.js → index-mvH0tD6I.js} +8 -8
- package/dist/{index-CZuajWCC.js → index-xYJPqvul.js} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{onramp-BMMneL8g.js → onramp-DlA5BSaX.js} +1 -1
- package/dist/{onramp-qJaw31Jf.mjs → onramp-zhj-U9X5.mjs} +31 -31
- package/dist/{parseSignature-jZAFls5F.js → parseSignature-CWAxHYP1.js} +6 -6
- package/dist/{parseSignature-zKnspnY-.mjs → parseSignature-ZB66mPGB.mjs} +56 -74
- package/dist/{pay-with-exchange-CgjKtyDu.js → pay-with-exchange-BQaMDGKp.js} +1 -1
- package/dist/{pay-with-exchange-CTRrPVEx.mjs → pay-with-exchange-Czbx9cbv.mjs} +2 -2
- package/dist/{receive-eP1MrUw6.js → receive-BA736NNd.js} +1 -1
- package/dist/{receive-D9mYL7F2.mjs → receive-VPGRuO6J.mjs} +1 -1
- package/dist/{send-tFHrHPh4.js → send-BhagKj7q.js} +1 -1
- package/dist/{send-DmCwhyow.mjs → send-xiZMc6dE.mjs} +21 -21
- package/dist/{socials-BXz_VcPl.js → socials-B-mhVCLM.js} +1 -1
- package/dist/{socials-BbYHDCTQ.mjs → socials-BX3hluqS.mjs} +13 -13
- package/dist/{swaps-D06KGkWD.mjs → swaps-BFl7r_MZ.mjs} +3 -3
- package/dist/{swaps-C9W-NxLv.js → swaps-DQYnz8sb.js} +1 -1
- package/dist/{transactions-B-bDj0J7.mjs → transactions-BooVIWm5.mjs} +1 -1
- package/dist/{transactions-CHNmwPaw.js → transactions-DWsNckfd.js} +1 -1
- package/dist/{w3m-modal-B82zwpqg.mjs → w3m-modal-BLoHPTsO.mjs} +18 -18
- package/dist/{w3m-modal-CaxvJDN5.js → w3m-modal-D6NKq8XS.js} +1 -1
- package/package.json +4 -3
- package/dist/index-DWRWjePT.mjs +0 -267
- package/dist/index-R_8iHUbU.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
class
|
|
1
|
+
import { cc as g, cn as w, co as y, cp as A, c8 as k, cq as u, cd as N, cr as p } from "./index-BHukHFIh.mjs";
|
|
2
|
+
class m {
|
|
3
3
|
constructor(e) {
|
|
4
4
|
this.getNonce = e.getNonce;
|
|
5
5
|
}
|
|
@@ -55,7 +55,7 @@ class E {
|
|
|
55
55
|
constructor(e = {}) {
|
|
56
56
|
this.otpUuid = null, this.listeners = {
|
|
57
57
|
sessionChanged: []
|
|
58
|
-
}, this.localAuthStorageKey = e.localAuthStorageKey || y.SIWX_AUTH_TOKEN, this.localNonceStorageKey = e.localNonceStorageKey || y.SIWX_NONCE_TOKEN, this.required = e.required ?? !0, this.messenger = new
|
|
58
|
+
}, this.localAuthStorageKey = e.localAuthStorageKey || y.SIWX_AUTH_TOKEN, this.localNonceStorageKey = e.localNonceStorageKey || y.SIWX_NONCE_TOKEN, this.required = e.required ?? !0, this.messenger = new m({
|
|
59
59
|
getNonce: this.getNonce.bind(this)
|
|
60
60
|
});
|
|
61
61
|
}
|
|
@@ -246,7 +246,7 @@ class E {
|
|
|
246
246
|
};
|
|
247
247
|
}
|
|
248
248
|
getSDKProperties() {
|
|
249
|
-
return
|
|
249
|
+
return p._getSdkProperties();
|
|
250
250
|
}
|
|
251
251
|
emit(e, t) {
|
|
252
252
|
this.listeners[e].forEach((s) => s(t));
|
|
@@ -270,5 +270,5 @@ function I(d) {
|
|
|
270
270
|
}
|
|
271
271
|
export {
|
|
272
272
|
E as R,
|
|
273
|
-
|
|
273
|
+
m as a
|
|
274
274
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const s=require("./index-
|
|
1
|
+
"use strict";const s=require("./index-BNobBA-8.js");class f{constructor(e){this.getNonce=e.getNonce}async createMessage(e){const t={accountAddress:e.accountAddress,chainId:e.chainId,version:"1",domain:typeof document>"u"?"Unknown Domain":document.location.host,uri:typeof document>"u"?"Unknown URI":document.location.href,resources:this.resources,nonce:await this.getNonce(e),issuedAt:this.stringifyDate(new Date),statement:void 0,expirationTime:void 0,notBefore:void 0};return Object.assign(t,{toString:()=>this.stringify(t)})}stringify(e){var n;const t=this.getNetworkName(e.chainId);return[`${e.domain} wants you to sign in with your ${t} account:`,e.accountAddress,e.statement?`
|
|
2
2
|
${e.statement}
|
|
3
3
|
`:"",`URI: ${e.uri}`,`Version: ${e.version}`,`Chain ID: ${e.chainId}`,`Nonce: ${e.nonce}`,e.issuedAt&&`Issued At: ${e.issuedAt}`,e.expirationTime&&`Expiration Time: ${e.expirationTime}`,e.notBefore&&`Not Before: ${e.notBefore}`,e.requestId&&`Request ID: ${e.requestId}`,((n=e.resources)==null?void 0:n.length)&&e.resources.reduce((o,r)=>`${o}
|
|
4
4
|
- ${r}`,"Resources:")].filter(o=>typeof o=="string").join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("./index-BhaYgUya.js"),A={getGasPriceInEther(n,r){const t=r*n;return Number(t)/1e18},getGasPriceInUSD(n,r,t){const s=A.getGasPriceInEther(r,t);return o.NumberUtil.bigNumber(n).times(s).toNumber()},getPriceImpact({sourceTokenAmount:n,sourceTokenPriceInUSD:r,toTokenPriceInUSD:t,toTokenAmount:s}){const l=o.NumberUtil.bigNumber(n).times(r),i=o.NumberUtil.bigNumber(s).times(t);return l.minus(i).div(l).times(100).toNumber()},getMaxSlippage(n,r){const t=o.NumberUtil.bigNumber(n).div(100);return o.NumberUtil.multiply(r,t).toNumber()},getProviderFee(n,r=.0085){return o.NumberUtil.bigNumber(n).times(r).toString()},isInsufficientNetworkTokenForGas(n,r){const t=r||"0";return o.NumberUtil.bigNumber(n).eq(0)?!0:o.NumberUtil.bigNumber(o.NumberUtil.bigNumber(t)).gt(n)},isInsufficientSourceTokenForSwap(n,r,t){var i,d;const s=(d=(i=t==null?void 0:t.find(k=>k.address===r))==null?void 0:i.quantity)==null?void 0:d.numeric;return o.NumberUtil.bigNumber(s||"0").lt(n)}},N=15e4,y=6,T={initializing:!1,initialized:!1,loadingPrices:!1,loadingQuote:!1,loadingApprovalTransaction:!1,loadingBuildTransaction:!1,loadingTransaction:!1,switchingTokens:!1,fetchError:!1,approvalTransaction:void 0,swapTransaction:void 0,transactionError:void 0,sourceToken:void 0,sourceTokenAmount:"",sourceTokenPriceInUSD:0,toToken:void 0,toTokenAmount:"",toTokenPriceInUSD:0,networkPrice:"0",networkBalanceInUSD:"0",networkTokenSymbol:"",inputError:void 0,slippage:o.ConstantsUtil$1.CONVERT_SLIPPAGE_TOLERANCE,tokens:void 0,popularTokens:void 0,suggestedTokens:void 0,foundTokens:void 0,myTokensWithBalance:void 0,tokensPriceMap:{},gasFee:"0",gasPriceInUSD:0,priceImpact:void 0,maxSlippage:void 0,providerFee:void 0},e=o.proxy({...T}),h={state:e,subscribe(n){return o.subscribe(e,()=>n(e))},subscribeKey(n,r){return o.subscribeKey(e,n,r)},getParams(){var c,u,p,g,w,f,S,C,P;const n=o.ChainController.state.activeChain,r=((c=o.ChainController.getAccountData(n))==null?void 0:c.caipAddress)??o.ChainController.state.activeCaipAddress,t=o.CoreHelperUtil.getPlainAddress(r),s=o.getActiveNetworkTokenAddress(),l=o.ConnectorController.getConnectorId(o.ChainController.state.activeChain);if(!t)throw new Error("No address found to swap the tokens from.");const i=!((u=e.toToken)!=null&&u.address)||!((p=e.toToken)!=null&&p.decimals),d=!((g=e.sourceToken)!=null&&g.address)||!((w=e.sourceToken)!=null&&w.decimals)||!o.NumberUtil.bigNumber(e.sourceTokenAmount).gt(0),k=!e.sourceTokenAmount;return{networkAddress:s,fromAddress:t,fromCaipAddress:r,sourceTokenAddress:(f=e.sourceToken)==null?void 0:f.address,toTokenAddress:(S=e.toToken)==null?void 0:S.address,toTokenAmount:e.toTokenAmount,toTokenDecimals:(C=e.toToken)==null?void 0:C.decimals,sourceTokenAmount:e.sourceTokenAmount,sourceTokenDecimals:(P=e.sourceToken)==null?void 0:P.decimals,invalidToToken:i,invalidSourceToken:d,invalidSourceTokenAmount:k,availableToSwap:r&&!i&&!d&&!k,isAuthConnector:l===o.ConstantsUtil.CONNECTOR_ID.AUTH}},async setSourceToken(n){if(!n){e.sourceToken=n,e.sourceTokenAmount="",e.sourceTokenPriceInUSD=0;return}e.sourceToken=n,await a.setTokenPrice(n.address,"sourceToken")},setSourceTokenAmount(n){e.sourceTokenAmount=n},async setToToken(n){if(!n){e.toToken=n,e.toTokenAmount="",e.toTokenPriceInUSD=0;return}e.toToken=n,await a.setTokenPrice(n.address,"toToken")},setToTokenAmount(n){e.toTokenAmount=n?o.NumberUtil.toFixed(n,y):""},async setTokenPrice(n,r){let t=e.tokensPriceMap[n]||0;t||(e.loadingPrices=!0,t=await a.getAddressPrice(n)),r==="sourceToken"?e.sourceTokenPriceInUSD=t:r==="toToken"&&(e.toTokenPriceInUSD=t),e.loadingPrices&&(e.loadingPrices=!1),a.getParams().availableToSwap&&!e.switchingTokens&&a.swapTokens()},async switchTokens(){if(!(e.initializing||!e.initialized||e.switchingTokens)){e.switchingTokens=!0;try{const n=e.toToken?{...e.toToken}:void 0,r=e.sourceToken?{...e.sourceToken}:void 0,t=n&&e.toTokenAmount===""?"1":e.toTokenAmount;a.setSourceTokenAmount(t),a.setToTokenAmount(""),await a.setSourceToken(n),await a.setToToken(r),e.switchingTokens=!1,a.swapTokens()}catch(n){throw e.switchingTokens=!1,n}}},resetState(){e.myTokensWithBalance=T.myTokensWithBalance,e.tokensPriceMap=T.tokensPriceMap,e.initialized=T.initialized,e.initializing=T.initializing,e.switchingTokens=T.switchingTokens,e.sourceToken=T.sourceToken,e.sourceTokenAmount=T.sourceTokenAmount,e.sourceTokenPriceInUSD=T.sourceTokenPriceInUSD,e.toToken=T.toToken,e.toTokenAmount=T.toTokenAmount,e.toTokenPriceInUSD=T.toTokenPriceInUSD,e.networkPrice=T.networkPrice,e.networkTokenSymbol=T.networkTokenSymbol,e.networkBalanceInUSD=T.networkBalanceInUSD,e.inputError=T.inputError},resetValues(){var t;const{networkAddress:n}=a.getParams(),r=(t=e.tokens)==null?void 0:t.find(s=>s.address===n);a.setSourceToken(r),a.setToToken(void 0)},getApprovalLoadingState(){return e.loadingApprovalTransaction},clearError(){e.transactionError=void 0},async initializeState(){if(!e.initializing){if(e.initializing=!0,!e.initialized)try{await a.fetchTokens(),e.initialized=!0}catch{e.initialized=!1,o.SnackController.showError("Failed to initialize swap"),o.RouterController.goBack()}e.initializing=!1}},async fetchTokens(){var t;const{networkAddress:n}=a.getParams();await a.getNetworkTokenPrice(),await a.getMyTokensWithBalance();const r=(t=e.myTokensWithBalance)==null?void 0:t.find(s=>s.address===n);r&&(e.networkTokenSymbol=r.symbol,a.setSourceToken(r),a.setSourceTokenAmount("0"))},async getTokenList(){var r,t;const n=(r=o.ChainController.state.activeCaipNetwork)==null?void 0:r.caipNetworkId;if(!(e.caipNetworkId===n&&e.tokens))try{e.tokensLoading=!0;const s=await o.SwapApiUtil.getTokenList(n);e.tokens=s,e.caipNetworkId=n,e.popularTokens=s.sort((c,u)=>c.symbol<u.symbol?-1:c.symbol>u.symbol?1:0);const i=(n&&((t=o.ConstantsUtil$1.SUGGESTED_TOKENS_BY_CHAIN)==null?void 0:t[n])||[]).map(c=>s.find(u=>u.symbol===c)).filter(c=>!!c),k=(o.ConstantsUtil$1.SWAP_SUGGESTED_TOKENS||[]).map(c=>s.find(u=>u.symbol===c)).filter(c=>!!c).filter(c=>!i.some(u=>u.address===c.address));e.suggestedTokens=[...i,...k]}catch{e.tokens=[],e.popularTokens=[],e.suggestedTokens=[]}finally{e.tokensLoading=!1}},async getAddressPrice(n){var c,u;const r=e.tokensPriceMap[n];if(r)return r;const t=await o.BlockchainApiController.fetchTokenPrice({addresses:[n]}),s=(t==null?void 0:t.fungibles)||[],l=[...e.tokens||[],...e.myTokensWithBalance||[]],i=(c=l==null?void 0:l.find(p=>p.address===n))==null?void 0:c.symbol,d=((u=s.find(p=>p.symbol.toLowerCase()===(i==null?void 0:i.toLowerCase())))==null?void 0:u.price)||0,k=parseFloat(d.toString());return e.tokensPriceMap[n]=k,k},async getNetworkTokenPrice(){var l;const{networkAddress:n}=a.getParams(),t=(l=(await o.BlockchainApiController.fetchTokenPrice({addresses:[n]}).catch(()=>(o.SnackController.showError("Failed to fetch network token price"),{fungibles:[]}))).fungibles)==null?void 0:l[0],s=(t==null?void 0:t.price.toString())||"0";e.tokensPriceMap[n]=parseFloat(s),e.networkTokenSymbol=(t==null?void 0:t.symbol)||"",e.networkPrice=s},async getMyTokensWithBalance(n){var s;const r=await o.BalanceUtil.getMyTokensWithBalance({forceUpdate:n,caipNetwork:o.ChainController.state.activeCaipNetwork,address:(s=o.ChainController.getAccountData())==null?void 0:s.address}),t=o.SwapApiUtil.mapBalancesToSwapTokens(r);t&&(await a.getInitialGasPrice(),a.setBalances(t))},setBalances(n){const{networkAddress:r}=a.getParams(),t=o.ChainController.state.activeCaipNetwork;if(!t)return;const s=n.find(l=>l.address===r);n.forEach(l=>{e.tokensPriceMap[l.address]=l.price||0}),e.myTokensWithBalance=n.filter(l=>l.address.startsWith(t.caipNetworkId)),e.networkBalanceInUSD=s?o.NumberUtil.multiply(s.quantity.numeric,s.price).toString():"0"},async getInitialGasPrice(){var r,t;const n=await o.SwapApiUtil.fetchGasPrice();if(!n)return{gasPrice:null,gasPriceInUSD:null};switch((t=(r=o.ChainController.state)==null?void 0:r.activeCaipNetwork)==null?void 0:t.chainNamespace){case o.ConstantsUtil.CHAIN.SOLANA:return e.gasFee=n.standard??"0",e.gasPriceInUSD=o.NumberUtil.multiply(n.standard,e.networkPrice).div(1e9).toNumber(),{gasPrice:BigInt(e.gasFee),gasPriceInUSD:Number(e.gasPriceInUSD)};case o.ConstantsUtil.CHAIN.EVM:default:const s=n.standard??"0",l=BigInt(s),i=BigInt(N),d=A.getGasPriceInUSD(e.networkPrice,i,l);return e.gasFee=s,e.gasPriceInUSD=d,{gasPrice:l,gasPriceInUSD:d}}},async swapTokens(){var i,d,k;const n=(i=o.ChainController.getAccountData())==null?void 0:i.address,r=e.sourceToken,t=e.toToken,s=o.NumberUtil.bigNumber(e.sourceTokenAmount).gt(0);if(s||a.setToTokenAmount(""),!t||!r||e.loadingPrices||!s||!n)return;e.loadingQuote=!0;const l=o.NumberUtil.bigNumber(e.sourceTokenAmount).times(10**r.decimals).round(0);try{const c=await o.BlockchainApiController.fetchSwapQuote({userAddress:n,from:r.address,to:t.address,gasPrice:e.gasFee,amount:l.toString()});e.loadingQuote=!1;const u=(k=(d=c==null?void 0:c.quotes)==null?void 0:d[0])==null?void 0:k.toAmount;if(!u){o.AlertController.open({displayMessage:"Incorrect amount",debugMessage:"Please enter a valid amount"},"error");return}const p=o.NumberUtil.bigNumber(u).div(10**t.decimals).toString();a.setToTokenAmount(p),a.hasInsufficientToken(e.sourceTokenAmount,r.address)?e.inputError="Insufficient balance":(e.inputError=void 0,a.setTransactionDetails())}catch(c){const u=await o.SwapApiUtil.handleSwapError(c);e.loadingQuote=!1,e.inputError=u||"Insufficient balance"}},async getTransaction(){const{fromCaipAddress:n,availableToSwap:r}=a.getParams(),t=e.sourceToken,s=e.toToken;if(!(!n||!r||!t||!s||e.loadingQuote))try{e.loadingBuildTransaction=!0;const l=await o.SwapApiUtil.fetchSwapAllowance({userAddress:n,tokenAddress:t.address,sourceTokenAmount:e.sourceTokenAmount,sourceTokenDecimals:t.decimals});let i;return l?i=await a.createSwapTransaction():i=await a.createAllowanceTransaction(),e.loadingBuildTransaction=!1,e.fetchError=!1,i}catch{o.RouterController.goBack(),o.SnackController.showError("Failed to check allowance"),e.loadingBuildTransaction=!1,e.approvalTransaction=void 0,e.swapTransaction=void 0,e.fetchError=!0;return}},async createAllowanceTransaction(){const{fromCaipAddress:n,sourceTokenAddress:r,toTokenAddress:t}=a.getParams();if(!(!n||!t)){if(!r)throw new Error("createAllowanceTransaction - No source token address found.");try{const s=await o.BlockchainApiController.generateApproveCalldata({from:r,to:t,userAddress:n}),l=o.CoreHelperUtil.getPlainAddress(s.tx.from);if(!l)throw new Error("SwapController:createAllowanceTransaction - address is required");const i={data:s.tx.data,to:l,gasPrice:BigInt(s.tx.eip155.gasPrice),value:BigInt(s.tx.value),toAmount:e.toTokenAmount};return e.swapTransaction=void 0,e.approvalTransaction={data:i.data,to:i.to,gasPrice:i.gasPrice,value:i.value,toAmount:i.toAmount},{data:i.data,to:i.to,gasPrice:i.gasPrice,value:i.value,toAmount:i.toAmount}}catch{o.RouterController.goBack(),o.SnackController.showError("Failed to create approval transaction"),e.approvalTransaction=void 0,e.swapTransaction=void 0,e.fetchError=!0;return}}},async createSwapTransaction(){var d;const{networkAddress:n,fromCaipAddress:r,sourceTokenAmount:t}=a.getParams(),s=e.sourceToken,l=e.toToken;if(!r||!t||!s||!l)return;const i=(d=o.ConnectionController.parseUnits(t,s.decimals))==null?void 0:d.toString();try{const k=await o.BlockchainApiController.generateSwapCalldata({userAddress:r,from:s.address,to:l.address,amount:i,disableEstimate:!0}),c=s.address===n,u=BigInt(k.tx.eip155.gas),p=BigInt(k.tx.eip155.gasPrice),g=o.CoreHelperUtil.getPlainAddress(k.tx.to);if(!g)throw new Error("SwapController:createSwapTransaction - address is required");const w={data:k.tx.data,to:g,gas:u,gasPrice:p,value:BigInt(c?i??"0":"0"),toAmount:e.toTokenAmount};return e.gasPriceInUSD=A.getGasPriceInUSD(e.networkPrice,u,p),e.approvalTransaction=void 0,e.swapTransaction=w,w}catch{o.RouterController.goBack(),o.SnackController.showError("Failed to create transaction"),e.approvalTransaction=void 0,e.swapTransaction=void 0,e.fetchError=!0;return}},onEmbeddedWalletApprovalSuccess(){o.SnackController.showLoading("Approve limit increase in your wallet"),o.RouterController.replace("SwapPreview")},async sendTransactionForApproval(n){var l,i,d;const{fromAddress:r,isAuthConnector:t}=a.getParams();e.loadingApprovalTransaction=!0,t?o.RouterController.pushTransactionStack({onSuccess:a.onEmbeddedWalletApprovalSuccess}):o.SnackController.showLoading("Approve limit increase in your wallet");try{await o.ConnectionController.sendTransaction({address:r,to:n.to,data:n.data,value:n.value,chainNamespace:o.ConstantsUtil.CHAIN.EVM}),await a.swapTokens(),await a.getTransaction(),e.approvalTransaction=void 0,e.loadingApprovalTransaction=!1}catch(k){const c=k;e.transactionError=c==null?void 0:c.displayMessage,e.loadingApprovalTransaction=!1,o.SnackController.showError((c==null?void 0:c.displayMessage)||"Transaction error"),o.EventsController.sendEvent({type:"track",event:"SWAP_APPROVAL_ERROR",properties:{message:(c==null?void 0:c.displayMessage)||(c==null?void 0:c.message)||"Unknown",network:((l=o.ChainController.state.activeCaipNetwork)==null?void 0:l.caipNetworkId)||"",swapFromToken:((i=a.state.sourceToken)==null?void 0:i.symbol)||"",swapToToken:((d=a.state.toToken)==null?void 0:d.symbol)||"",swapFromAmount:a.state.sourceTokenAmount||"",swapToAmount:a.state.toTokenAmount||"",isSmartAccount:o.getPreferredAccountType(o.ConstantsUtil.CHAIN.EVM)===o.W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}})}},async sendTransactionForSwap(n){var d,k,c,u,p,g,w,f,S,C,P,b;if(!n)return;const{fromAddress:r,toTokenAmount:t,isAuthConnector:s}=a.getParams();e.loadingTransaction=!0;const l=`Swapping ${(d=e.sourceToken)==null?void 0:d.symbol} to ${o.NumberUtil.formatNumberToLocalString(t,3)} ${(k=e.toToken)==null?void 0:k.symbol}`,i=`Swapped ${(c=e.sourceToken)==null?void 0:c.symbol} to ${o.NumberUtil.formatNumberToLocalString(t,3)} ${(u=e.toToken)==null?void 0:u.symbol}`;s?o.RouterController.pushTransactionStack({onSuccess(){o.RouterController.replace("Account"),o.SnackController.showLoading(l),h.resetState()}}):o.SnackController.showLoading("Confirm transaction in your wallet");try{const I=[(p=e.sourceToken)==null?void 0:p.address,(g=e.toToken)==null?void 0:g.address].join(","),m=await o.ConnectionController.sendTransaction({address:r,to:n.to,data:n.data,value:n.value,chainNamespace:o.ConstantsUtil.CHAIN.EVM});return e.loadingTransaction=!1,o.SnackController.showSuccess(i),o.EventsController.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:((w=o.ChainController.state.activeCaipNetwork)==null?void 0:w.caipNetworkId)||"",swapFromToken:((f=a.state.sourceToken)==null?void 0:f.symbol)||"",swapToToken:((S=a.state.toToken)==null?void 0:S.symbol)||"",swapFromAmount:a.state.sourceTokenAmount||"",swapToAmount:a.state.toTokenAmount||"",isSmartAccount:o.getPreferredAccountType(o.ConstantsUtil.CHAIN.EVM)===o.W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}}),h.resetState(),s||o.RouterController.replace("Account"),h.getMyTokensWithBalance(I),m}catch(I){const m=I;e.transactionError=m==null?void 0:m.displayMessage,e.loadingTransaction=!1,o.SnackController.showError((m==null?void 0:m.displayMessage)||"Transaction error"),o.EventsController.sendEvent({type:"track",event:"SWAP_ERROR",properties:{message:(m==null?void 0:m.displayMessage)||(m==null?void 0:m.message)||"Unknown",network:((C=o.ChainController.state.activeCaipNetwork)==null?void 0:C.caipNetworkId)||"",swapFromToken:((P=a.state.sourceToken)==null?void 0:P.symbol)||"",swapToToken:((b=a.state.toToken)==null?void 0:b.symbol)||"",swapFromAmount:a.state.sourceTokenAmount||"",swapToAmount:a.state.toTokenAmount||"",isSmartAccount:o.getPreferredAccountType(o.ConstantsUtil.CHAIN.EVM)===o.W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken(n,r){return A.isInsufficientSourceTokenForSwap(n,r,e.myTokensWithBalance)},setTransactionDetails(){const{toTokenAddress:n,toTokenDecimals:r}=a.getParams();!n||!r||(e.gasPriceInUSD=A.getGasPriceInUSD(e.networkPrice,BigInt(e.gasFee),BigInt(N)),e.priceImpact=A.getPriceImpact({sourceTokenAmount:e.sourceTokenAmount,sourceTokenPriceInUSD:e.sourceTokenPriceInUSD,toTokenPriceInUSD:e.toTokenPriceInUSD,toTokenAmount:e.toTokenAmount}),e.maxSlippage=A.getMaxSlippage(e.slippage,e.toTokenAmount),e.providerFee=A.getProviderFee(e.sourceTokenAmount))}},a=o.withErrorBoundary(h);exports.SwapController=a;
|
|
1
|
+
"use strict";const o=require("./index-BNobBA-8.js"),A={getGasPriceInEther(n,r){const t=r*n;return Number(t)/1e18},getGasPriceInUSD(n,r,t){const s=A.getGasPriceInEther(r,t);return o.NumberUtil.bigNumber(n).times(s).toNumber()},getPriceImpact({sourceTokenAmount:n,sourceTokenPriceInUSD:r,toTokenPriceInUSD:t,toTokenAmount:s}){const l=o.NumberUtil.bigNumber(n).times(r),i=o.NumberUtil.bigNumber(s).times(t);return l.minus(i).div(l).times(100).toNumber()},getMaxSlippage(n,r){const t=o.NumberUtil.bigNumber(n).div(100);return o.NumberUtil.multiply(r,t).toNumber()},getProviderFee(n,r=.0085){return o.NumberUtil.bigNumber(n).times(r).toString()},isInsufficientNetworkTokenForGas(n,r){const t=r||"0";return o.NumberUtil.bigNumber(n).eq(0)?!0:o.NumberUtil.bigNumber(o.NumberUtil.bigNumber(t)).gt(n)},isInsufficientSourceTokenForSwap(n,r,t){var i,d;const s=(d=(i=t==null?void 0:t.find(k=>k.address===r))==null?void 0:i.quantity)==null?void 0:d.numeric;return o.NumberUtil.bigNumber(s||"0").lt(n)}},N=15e4,y=6,T={initializing:!1,initialized:!1,loadingPrices:!1,loadingQuote:!1,loadingApprovalTransaction:!1,loadingBuildTransaction:!1,loadingTransaction:!1,switchingTokens:!1,fetchError:!1,approvalTransaction:void 0,swapTransaction:void 0,transactionError:void 0,sourceToken:void 0,sourceTokenAmount:"",sourceTokenPriceInUSD:0,toToken:void 0,toTokenAmount:"",toTokenPriceInUSD:0,networkPrice:"0",networkBalanceInUSD:"0",networkTokenSymbol:"",inputError:void 0,slippage:o.ConstantsUtil$1.CONVERT_SLIPPAGE_TOLERANCE,tokens:void 0,popularTokens:void 0,suggestedTokens:void 0,foundTokens:void 0,myTokensWithBalance:void 0,tokensPriceMap:{},gasFee:"0",gasPriceInUSD:0,priceImpact:void 0,maxSlippage:void 0,providerFee:void 0},e=o.proxy({...T}),h={state:e,subscribe(n){return o.subscribe(e,()=>n(e))},subscribeKey(n,r){return o.subscribeKey(e,n,r)},getParams(){var c,u,p,g,w,f,S,C,P;const n=o.ChainController.state.activeChain,r=((c=o.ChainController.getAccountData(n))==null?void 0:c.caipAddress)??o.ChainController.state.activeCaipAddress,t=o.CoreHelperUtil.getPlainAddress(r),s=o.getActiveNetworkTokenAddress(),l=o.ConnectorController.getConnectorId(o.ChainController.state.activeChain);if(!t)throw new Error("No address found to swap the tokens from.");const i=!((u=e.toToken)!=null&&u.address)||!((p=e.toToken)!=null&&p.decimals),d=!((g=e.sourceToken)!=null&&g.address)||!((w=e.sourceToken)!=null&&w.decimals)||!o.NumberUtil.bigNumber(e.sourceTokenAmount).gt(0),k=!e.sourceTokenAmount;return{networkAddress:s,fromAddress:t,fromCaipAddress:r,sourceTokenAddress:(f=e.sourceToken)==null?void 0:f.address,toTokenAddress:(S=e.toToken)==null?void 0:S.address,toTokenAmount:e.toTokenAmount,toTokenDecimals:(C=e.toToken)==null?void 0:C.decimals,sourceTokenAmount:e.sourceTokenAmount,sourceTokenDecimals:(P=e.sourceToken)==null?void 0:P.decimals,invalidToToken:i,invalidSourceToken:d,invalidSourceTokenAmount:k,availableToSwap:r&&!i&&!d&&!k,isAuthConnector:l===o.ConstantsUtil.CONNECTOR_ID.AUTH}},async setSourceToken(n){if(!n){e.sourceToken=n,e.sourceTokenAmount="",e.sourceTokenPriceInUSD=0;return}e.sourceToken=n,await a.setTokenPrice(n.address,"sourceToken")},setSourceTokenAmount(n){e.sourceTokenAmount=n},async setToToken(n){if(!n){e.toToken=n,e.toTokenAmount="",e.toTokenPriceInUSD=0;return}e.toToken=n,await a.setTokenPrice(n.address,"toToken")},setToTokenAmount(n){e.toTokenAmount=n?o.NumberUtil.toFixed(n,y):""},async setTokenPrice(n,r){let t=e.tokensPriceMap[n]||0;t||(e.loadingPrices=!0,t=await a.getAddressPrice(n)),r==="sourceToken"?e.sourceTokenPriceInUSD=t:r==="toToken"&&(e.toTokenPriceInUSD=t),e.loadingPrices&&(e.loadingPrices=!1),a.getParams().availableToSwap&&!e.switchingTokens&&a.swapTokens()},async switchTokens(){if(!(e.initializing||!e.initialized||e.switchingTokens)){e.switchingTokens=!0;try{const n=e.toToken?{...e.toToken}:void 0,r=e.sourceToken?{...e.sourceToken}:void 0,t=n&&e.toTokenAmount===""?"1":e.toTokenAmount;a.setSourceTokenAmount(t),a.setToTokenAmount(""),await a.setSourceToken(n),await a.setToToken(r),e.switchingTokens=!1,a.swapTokens()}catch(n){throw e.switchingTokens=!1,n}}},resetState(){e.myTokensWithBalance=T.myTokensWithBalance,e.tokensPriceMap=T.tokensPriceMap,e.initialized=T.initialized,e.initializing=T.initializing,e.switchingTokens=T.switchingTokens,e.sourceToken=T.sourceToken,e.sourceTokenAmount=T.sourceTokenAmount,e.sourceTokenPriceInUSD=T.sourceTokenPriceInUSD,e.toToken=T.toToken,e.toTokenAmount=T.toTokenAmount,e.toTokenPriceInUSD=T.toTokenPriceInUSD,e.networkPrice=T.networkPrice,e.networkTokenSymbol=T.networkTokenSymbol,e.networkBalanceInUSD=T.networkBalanceInUSD,e.inputError=T.inputError},resetValues(){var t;const{networkAddress:n}=a.getParams(),r=(t=e.tokens)==null?void 0:t.find(s=>s.address===n);a.setSourceToken(r),a.setToToken(void 0)},getApprovalLoadingState(){return e.loadingApprovalTransaction},clearError(){e.transactionError=void 0},async initializeState(){if(!e.initializing){if(e.initializing=!0,!e.initialized)try{await a.fetchTokens(),e.initialized=!0}catch{e.initialized=!1,o.SnackController.showError("Failed to initialize swap"),o.RouterController.goBack()}e.initializing=!1}},async fetchTokens(){var t;const{networkAddress:n}=a.getParams();await a.getNetworkTokenPrice(),await a.getMyTokensWithBalance();const r=(t=e.myTokensWithBalance)==null?void 0:t.find(s=>s.address===n);r&&(e.networkTokenSymbol=r.symbol,a.setSourceToken(r),a.setSourceTokenAmount("0"))},async getTokenList(){var r,t;const n=(r=o.ChainController.state.activeCaipNetwork)==null?void 0:r.caipNetworkId;if(!(e.caipNetworkId===n&&e.tokens))try{e.tokensLoading=!0;const s=await o.SwapApiUtil.getTokenList(n);e.tokens=s,e.caipNetworkId=n,e.popularTokens=s.sort((c,u)=>c.symbol<u.symbol?-1:c.symbol>u.symbol?1:0);const i=(n&&((t=o.ConstantsUtil$1.SUGGESTED_TOKENS_BY_CHAIN)==null?void 0:t[n])||[]).map(c=>s.find(u=>u.symbol===c)).filter(c=>!!c),k=(o.ConstantsUtil$1.SWAP_SUGGESTED_TOKENS||[]).map(c=>s.find(u=>u.symbol===c)).filter(c=>!!c).filter(c=>!i.some(u=>u.address===c.address));e.suggestedTokens=[...i,...k]}catch{e.tokens=[],e.popularTokens=[],e.suggestedTokens=[]}finally{e.tokensLoading=!1}},async getAddressPrice(n){var c,u;const r=e.tokensPriceMap[n];if(r)return r;const t=await o.BlockchainApiController.fetchTokenPrice({addresses:[n]}),s=(t==null?void 0:t.fungibles)||[],l=[...e.tokens||[],...e.myTokensWithBalance||[]],i=(c=l==null?void 0:l.find(p=>p.address===n))==null?void 0:c.symbol,d=((u=s.find(p=>p.symbol.toLowerCase()===(i==null?void 0:i.toLowerCase())))==null?void 0:u.price)||0,k=parseFloat(d.toString());return e.tokensPriceMap[n]=k,k},async getNetworkTokenPrice(){var l;const{networkAddress:n}=a.getParams(),t=(l=(await o.BlockchainApiController.fetchTokenPrice({addresses:[n]}).catch(()=>(o.SnackController.showError("Failed to fetch network token price"),{fungibles:[]}))).fungibles)==null?void 0:l[0],s=(t==null?void 0:t.price.toString())||"0";e.tokensPriceMap[n]=parseFloat(s),e.networkTokenSymbol=(t==null?void 0:t.symbol)||"",e.networkPrice=s},async getMyTokensWithBalance(n){var s;const r=await o.BalanceUtil.getMyTokensWithBalance({forceUpdate:n,caipNetwork:o.ChainController.state.activeCaipNetwork,address:(s=o.ChainController.getAccountData())==null?void 0:s.address}),t=o.SwapApiUtil.mapBalancesToSwapTokens(r);t&&(await a.getInitialGasPrice(),a.setBalances(t))},setBalances(n){const{networkAddress:r}=a.getParams(),t=o.ChainController.state.activeCaipNetwork;if(!t)return;const s=n.find(l=>l.address===r);n.forEach(l=>{e.tokensPriceMap[l.address]=l.price||0}),e.myTokensWithBalance=n.filter(l=>l.address.startsWith(t.caipNetworkId)),e.networkBalanceInUSD=s?o.NumberUtil.multiply(s.quantity.numeric,s.price).toString():"0"},async getInitialGasPrice(){var r,t;const n=await o.SwapApiUtil.fetchGasPrice();if(!n)return{gasPrice:null,gasPriceInUSD:null};switch((t=(r=o.ChainController.state)==null?void 0:r.activeCaipNetwork)==null?void 0:t.chainNamespace){case o.ConstantsUtil.CHAIN.SOLANA:return e.gasFee=n.standard??"0",e.gasPriceInUSD=o.NumberUtil.multiply(n.standard,e.networkPrice).div(1e9).toNumber(),{gasPrice:BigInt(e.gasFee),gasPriceInUSD:Number(e.gasPriceInUSD)};case o.ConstantsUtil.CHAIN.EVM:default:const s=n.standard??"0",l=BigInt(s),i=BigInt(N),d=A.getGasPriceInUSD(e.networkPrice,i,l);return e.gasFee=s,e.gasPriceInUSD=d,{gasPrice:l,gasPriceInUSD:d}}},async swapTokens(){var i,d,k;const n=(i=o.ChainController.getAccountData())==null?void 0:i.address,r=e.sourceToken,t=e.toToken,s=o.NumberUtil.bigNumber(e.sourceTokenAmount).gt(0);if(s||a.setToTokenAmount(""),!t||!r||e.loadingPrices||!s||!n)return;e.loadingQuote=!0;const l=o.NumberUtil.bigNumber(e.sourceTokenAmount).times(10**r.decimals).round(0);try{const c=await o.BlockchainApiController.fetchSwapQuote({userAddress:n,from:r.address,to:t.address,gasPrice:e.gasFee,amount:l.toString()});e.loadingQuote=!1;const u=(k=(d=c==null?void 0:c.quotes)==null?void 0:d[0])==null?void 0:k.toAmount;if(!u){o.AlertController.open({displayMessage:"Incorrect amount",debugMessage:"Please enter a valid amount"},"error");return}const p=o.NumberUtil.bigNumber(u).div(10**t.decimals).toString();a.setToTokenAmount(p),a.hasInsufficientToken(e.sourceTokenAmount,r.address)?e.inputError="Insufficient balance":(e.inputError=void 0,a.setTransactionDetails())}catch(c){const u=await o.SwapApiUtil.handleSwapError(c);e.loadingQuote=!1,e.inputError=u||"Insufficient balance"}},async getTransaction(){const{fromCaipAddress:n,availableToSwap:r}=a.getParams(),t=e.sourceToken,s=e.toToken;if(!(!n||!r||!t||!s||e.loadingQuote))try{e.loadingBuildTransaction=!0;const l=await o.SwapApiUtil.fetchSwapAllowance({userAddress:n,tokenAddress:t.address,sourceTokenAmount:e.sourceTokenAmount,sourceTokenDecimals:t.decimals});let i;return l?i=await a.createSwapTransaction():i=await a.createAllowanceTransaction(),e.loadingBuildTransaction=!1,e.fetchError=!1,i}catch{o.RouterController.goBack(),o.SnackController.showError("Failed to check allowance"),e.loadingBuildTransaction=!1,e.approvalTransaction=void 0,e.swapTransaction=void 0,e.fetchError=!0;return}},async createAllowanceTransaction(){const{fromCaipAddress:n,sourceTokenAddress:r,toTokenAddress:t}=a.getParams();if(!(!n||!t)){if(!r)throw new Error("createAllowanceTransaction - No source token address found.");try{const s=await o.BlockchainApiController.generateApproveCalldata({from:r,to:t,userAddress:n}),l=o.CoreHelperUtil.getPlainAddress(s.tx.from);if(!l)throw new Error("SwapController:createAllowanceTransaction - address is required");const i={data:s.tx.data,to:l,gasPrice:BigInt(s.tx.eip155.gasPrice),value:BigInt(s.tx.value),toAmount:e.toTokenAmount};return e.swapTransaction=void 0,e.approvalTransaction={data:i.data,to:i.to,gasPrice:i.gasPrice,value:i.value,toAmount:i.toAmount},{data:i.data,to:i.to,gasPrice:i.gasPrice,value:i.value,toAmount:i.toAmount}}catch{o.RouterController.goBack(),o.SnackController.showError("Failed to create approval transaction"),e.approvalTransaction=void 0,e.swapTransaction=void 0,e.fetchError=!0;return}}},async createSwapTransaction(){var d;const{networkAddress:n,fromCaipAddress:r,sourceTokenAmount:t}=a.getParams(),s=e.sourceToken,l=e.toToken;if(!r||!t||!s||!l)return;const i=(d=o.ConnectionController.parseUnits(t,s.decimals))==null?void 0:d.toString();try{const k=await o.BlockchainApiController.generateSwapCalldata({userAddress:r,from:s.address,to:l.address,amount:i,disableEstimate:!0}),c=s.address===n,u=BigInt(k.tx.eip155.gas),p=BigInt(k.tx.eip155.gasPrice),g=o.CoreHelperUtil.getPlainAddress(k.tx.to);if(!g)throw new Error("SwapController:createSwapTransaction - address is required");const w={data:k.tx.data,to:g,gas:u,gasPrice:p,value:BigInt(c?i??"0":"0"),toAmount:e.toTokenAmount};return e.gasPriceInUSD=A.getGasPriceInUSD(e.networkPrice,u,p),e.approvalTransaction=void 0,e.swapTransaction=w,w}catch{o.RouterController.goBack(),o.SnackController.showError("Failed to create transaction"),e.approvalTransaction=void 0,e.swapTransaction=void 0,e.fetchError=!0;return}},onEmbeddedWalletApprovalSuccess(){o.SnackController.showLoading("Approve limit increase in your wallet"),o.RouterController.replace("SwapPreview")},async sendTransactionForApproval(n){var l,i,d;const{fromAddress:r,isAuthConnector:t}=a.getParams();e.loadingApprovalTransaction=!0,t?o.RouterController.pushTransactionStack({onSuccess:a.onEmbeddedWalletApprovalSuccess}):o.SnackController.showLoading("Approve limit increase in your wallet");try{await o.ConnectionController.sendTransaction({address:r,to:n.to,data:n.data,value:n.value,chainNamespace:o.ConstantsUtil.CHAIN.EVM}),await a.swapTokens(),await a.getTransaction(),e.approvalTransaction=void 0,e.loadingApprovalTransaction=!1}catch(k){const c=k;e.transactionError=c==null?void 0:c.displayMessage,e.loadingApprovalTransaction=!1,o.SnackController.showError((c==null?void 0:c.displayMessage)||"Transaction error"),o.EventsController.sendEvent({type:"track",event:"SWAP_APPROVAL_ERROR",properties:{message:(c==null?void 0:c.displayMessage)||(c==null?void 0:c.message)||"Unknown",network:((l=o.ChainController.state.activeCaipNetwork)==null?void 0:l.caipNetworkId)||"",swapFromToken:((i=a.state.sourceToken)==null?void 0:i.symbol)||"",swapToToken:((d=a.state.toToken)==null?void 0:d.symbol)||"",swapFromAmount:a.state.sourceTokenAmount||"",swapToAmount:a.state.toTokenAmount||"",isSmartAccount:o.getPreferredAccountType(o.ConstantsUtil.CHAIN.EVM)===o.W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}})}},async sendTransactionForSwap(n){var d,k,c,u,p,g,w,f,S,C,P,b;if(!n)return;const{fromAddress:r,toTokenAmount:t,isAuthConnector:s}=a.getParams();e.loadingTransaction=!0;const l=`Swapping ${(d=e.sourceToken)==null?void 0:d.symbol} to ${o.NumberUtil.formatNumberToLocalString(t,3)} ${(k=e.toToken)==null?void 0:k.symbol}`,i=`Swapped ${(c=e.sourceToken)==null?void 0:c.symbol} to ${o.NumberUtil.formatNumberToLocalString(t,3)} ${(u=e.toToken)==null?void 0:u.symbol}`;s?o.RouterController.pushTransactionStack({onSuccess(){o.RouterController.replace("Account"),o.SnackController.showLoading(l),h.resetState()}}):o.SnackController.showLoading("Confirm transaction in your wallet");try{const I=[(p=e.sourceToken)==null?void 0:p.address,(g=e.toToken)==null?void 0:g.address].join(","),m=await o.ConnectionController.sendTransaction({address:r,to:n.to,data:n.data,value:n.value,chainNamespace:o.ConstantsUtil.CHAIN.EVM});return e.loadingTransaction=!1,o.SnackController.showSuccess(i),o.EventsController.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:((w=o.ChainController.state.activeCaipNetwork)==null?void 0:w.caipNetworkId)||"",swapFromToken:((f=a.state.sourceToken)==null?void 0:f.symbol)||"",swapToToken:((S=a.state.toToken)==null?void 0:S.symbol)||"",swapFromAmount:a.state.sourceTokenAmount||"",swapToAmount:a.state.toTokenAmount||"",isSmartAccount:o.getPreferredAccountType(o.ConstantsUtil.CHAIN.EVM)===o.W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}}),h.resetState(),s||o.RouterController.replace("Account"),h.getMyTokensWithBalance(I),m}catch(I){const m=I;e.transactionError=m==null?void 0:m.displayMessage,e.loadingTransaction=!1,o.SnackController.showError((m==null?void 0:m.displayMessage)||"Transaction error"),o.EventsController.sendEvent({type:"track",event:"SWAP_ERROR",properties:{message:(m==null?void 0:m.displayMessage)||(m==null?void 0:m.message)||"Unknown",network:((C=o.ChainController.state.activeCaipNetwork)==null?void 0:C.caipNetworkId)||"",swapFromToken:((P=a.state.sourceToken)==null?void 0:P.symbol)||"",swapToToken:((b=a.state.toToken)==null?void 0:b.symbol)||"",swapFromAmount:a.state.sourceTokenAmount||"",swapToAmount:a.state.toTokenAmount||"",isSmartAccount:o.getPreferredAccountType(o.ConstantsUtil.CHAIN.EVM)===o.W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken(n,r){return A.isInsufficientSourceTokenForSwap(n,r,e.myTokensWithBalance)},setTransactionDetails(){const{toTokenAddress:n,toTokenDecimals:r}=a.getParams();!n||!r||(e.gasPriceInUSD=A.getGasPriceInUSD(e.networkPrice,BigInt(e.gasFee),BigInt(N)),e.priceImpact=A.getPriceImpact({sourceTokenAmount:e.sourceTokenAmount,sourceTokenPriceInUSD:e.sourceTokenPriceInUSD,toTokenPriceInUSD:e.toTokenPriceInUSD,toTokenAmount:e.toTokenAmount}),e.maxSlippage=A.getMaxSlippage(e.slippage,e.toTokenAmount),e.providerFee=A.getProviderFee(e.sourceTokenAmount))}},a=o.withErrorBoundary(h);exports.SwapController=a;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c2 as T, c3 as W, c4 as x, c5 as A, c6 as w, c7 as D, c8 as P, c9 as B, ca as M, cb as F, cc as g, cd as v, ce as L, cf as N, cg as z, ch as R, ci as _, cj as H, ck as V, cl as $, cm as q } from "./index-BHukHFIh.mjs";
|
|
2
2
|
const I = {
|
|
3
3
|
getGasPriceInEther(n, t) {
|
|
4
4
|
const o = t * n;
|
|
@@ -81,7 +81,7 @@ const I = {
|
|
|
81
81
|
},
|
|
82
82
|
getParams() {
|
|
83
83
|
var i, u, p, f, S, h, y, b, C;
|
|
84
|
-
const n =
|
|
84
|
+
const n = g.state.activeChain, t = ((i = g.getAccountData(n)) == null ? void 0 : i.caipAddress) ?? g.state.activeCaipAddress, o = L.getPlainAddress(t), s = H(), c = V.getConnectorId(g.state.activeChain);
|
|
85
85
|
if (!o)
|
|
86
86
|
throw new Error("No address found to swap the tokens from.");
|
|
87
87
|
const r = !((u = e.toToken) != null && u.address) || !((p = e.toToken) != null && p.decimals), d = !((f = e.sourceToken) != null && f.address) || !((S = e.sourceToken) != null && S.decimals) || !T.bigNumber(e.sourceTokenAmount).gt(0), l = !e.sourceTokenAmount;
|
|
@@ -171,7 +171,7 @@ const I = {
|
|
|
171
171
|
},
|
|
172
172
|
async getTokenList() {
|
|
173
173
|
var t, o;
|
|
174
|
-
const n = (t =
|
|
174
|
+
const n = (t = g.state.activeCaipNetwork) == null ? void 0 : t.caipNetworkId;
|
|
175
175
|
if (!(e.caipNetworkId === n && e.tokens))
|
|
176
176
|
try {
|
|
177
177
|
e.tokensLoading = !0;
|
|
@@ -206,13 +206,13 @@ const I = {
|
|
|
206
206
|
var s;
|
|
207
207
|
const t = await R.getMyTokensWithBalance({
|
|
208
208
|
forceUpdate: n,
|
|
209
|
-
caipNetwork:
|
|
210
|
-
address: (s =
|
|
209
|
+
caipNetwork: g.state.activeCaipNetwork,
|
|
210
|
+
address: (s = g.getAccountData()) == null ? void 0 : s.address
|
|
211
211
|
}), o = N.mapBalancesToSwapTokens(t);
|
|
212
212
|
o && (await a.getInitialGasPrice(), a.setBalances(o));
|
|
213
213
|
},
|
|
214
214
|
setBalances(n) {
|
|
215
|
-
const { networkAddress: t } = a.getParams(), o =
|
|
215
|
+
const { networkAddress: t } = a.getParams(), o = g.state.activeCaipNetwork;
|
|
216
216
|
if (!o)
|
|
217
217
|
return;
|
|
218
218
|
const s = n.find((c) => c.address === t);
|
|
@@ -225,7 +225,7 @@ const I = {
|
|
|
225
225
|
const n = await N.fetchGasPrice();
|
|
226
226
|
if (!n)
|
|
227
227
|
return { gasPrice: null, gasPriceInUSD: null };
|
|
228
|
-
switch ((o = (t =
|
|
228
|
+
switch ((o = (t = g.state) == null ? void 0 : t.activeCaipNetwork) == null ? void 0 : o.chainNamespace) {
|
|
229
229
|
case P.CHAIN.SOLANA:
|
|
230
230
|
return e.gasFee = n.standard ?? "0", e.gasPriceInUSD = T.multiply(n.standard, e.networkPrice).div(1e9).toNumber(), {
|
|
231
231
|
gasPrice: BigInt(e.gasFee),
|
|
@@ -240,7 +240,7 @@ const I = {
|
|
|
240
240
|
// -- Swap -------------------------------------- //
|
|
241
241
|
async swapTokens() {
|
|
242
242
|
var r, d, l;
|
|
243
|
-
const n = (r =
|
|
243
|
+
const n = (r = g.getAccountData()) == null ? void 0 : r.address, t = e.sourceToken, o = e.toToken, s = T.bigNumber(e.sourceTokenAmount).gt(0);
|
|
244
244
|
if (s || a.setToTokenAmount(""), !o || !t || e.loadingPrices || !s || !n)
|
|
245
245
|
return;
|
|
246
246
|
e.loadingQuote = !0;
|
|
@@ -382,7 +382,7 @@ const I = {
|
|
|
382
382
|
event: "SWAP_APPROVAL_ERROR",
|
|
383
383
|
properties: {
|
|
384
384
|
message: (i == null ? void 0 : i.displayMessage) || (i == null ? void 0 : i.message) || "Unknown",
|
|
385
|
-
network: ((c =
|
|
385
|
+
network: ((c = g.state.activeCaipNetwork) == null ? void 0 : c.caipNetworkId) || "",
|
|
386
386
|
swapFromToken: ((r = a.state.sourceToken) == null ? void 0 : r.symbol) || "",
|
|
387
387
|
swapToToken: ((d = a.state.toToken) == null ? void 0 : d.symbol) || "",
|
|
388
388
|
swapFromAmount: a.state.sourceTokenAmount || "",
|
|
@@ -405,7 +405,7 @@ const I = {
|
|
|
405
405
|
}
|
|
406
406
|
}) : w.showLoading("Confirm transaction in your wallet");
|
|
407
407
|
try {
|
|
408
|
-
const U = [(p = e.sourceToken) == null ? void 0 : p.address, (f = e.toToken) == null ? void 0 : f.address].join(","),
|
|
408
|
+
const U = [(p = e.sourceToken) == null ? void 0 : p.address, (f = e.toToken) == null ? void 0 : f.address].join(","), m = await D.sendTransaction({
|
|
409
409
|
address: t,
|
|
410
410
|
to: n.to,
|
|
411
411
|
data: n.data,
|
|
@@ -416,22 +416,22 @@ const I = {
|
|
|
416
416
|
type: "track",
|
|
417
417
|
event: "SWAP_SUCCESS",
|
|
418
418
|
properties: {
|
|
419
|
-
network: ((S =
|
|
419
|
+
network: ((S = g.state.activeCaipNetwork) == null ? void 0 : S.caipNetworkId) || "",
|
|
420
420
|
swapFromToken: ((h = a.state.sourceToken) == null ? void 0 : h.symbol) || "",
|
|
421
421
|
swapToToken: ((y = a.state.toToken) == null ? void 0 : y.symbol) || "",
|
|
422
422
|
swapFromAmount: a.state.sourceTokenAmount || "",
|
|
423
423
|
swapToAmount: a.state.toTokenAmount || "",
|
|
424
424
|
isSmartAccount: M(P.CHAIN.EVM) === F.ACCOUNT_TYPES.SMART_ACCOUNT
|
|
425
425
|
}
|
|
426
|
-
}), E.resetState(), s || A.replace("Account"), E.getMyTokensWithBalance(U),
|
|
426
|
+
}), E.resetState(), s || A.replace("Account"), E.getMyTokensWithBalance(U), m;
|
|
427
427
|
} catch (U) {
|
|
428
|
-
const
|
|
429
|
-
e.transactionError =
|
|
428
|
+
const m = U;
|
|
429
|
+
e.transactionError = m == null ? void 0 : m.displayMessage, e.loadingTransaction = !1, w.showError((m == null ? void 0 : m.displayMessage) || "Transaction error"), B.sendEvent({
|
|
430
430
|
type: "track",
|
|
431
431
|
event: "SWAP_ERROR",
|
|
432
432
|
properties: {
|
|
433
|
-
message: (
|
|
434
|
-
network: ((b =
|
|
433
|
+
message: (m == null ? void 0 : m.displayMessage) || (m == null ? void 0 : m.message) || "Unknown",
|
|
434
|
+
network: ((b = g.state.activeCaipNetwork) == null ? void 0 : b.caipNetworkId) || "",
|
|
435
435
|
swapFromToken: ((C = a.state.sourceToken) == null ? void 0 : C.symbol) || "",
|
|
436
436
|
swapToToken: ((G = a.state.toToken) == null ? void 0 : G.symbol) || "",
|
|
437
437
|
swapFromAmount: a.state.sourceTokenAmount || "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./parseSignature-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./parseSignature-CWAxHYP1.js"),s=require("./index-BNobBA-8.js");class k extends s.BaseError{constructor({callbackSelector:o,cause:t,data:c,extraData:u,sender:d,urls:a}){var n;super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],(n=t.metaMessages)!=null&&n.length?"":[],"Offchain Gateway Call:",a&&[" Gateway URL(s):",...a.map(f=>` ${s.getUrl(f)}`)],` Sender: ${d}`,` Data: ${c}`,` Callback selector: ${o}`,` Extra data: ${u}`].flat(),name:"OffchainLookupError"})}}class b extends s.BaseError{constructor({result:o,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${s.getUrl(t)}`,`Response: ${s.stringify(o)}`],name:"OffchainLookupResponseMalformedError"})}}class L extends s.BaseError{constructor({sender:o,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${o}`],name:"OffchainLookupSenderMismatchError"})}}const E="0x556f1830",m={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function O(i,{blockNumber:o,blockTag:t,data:c,to:u}){const{args:d}=l.decodeErrorResult({data:c,abi:[m]}),[a,n,f,p,r]=d,{ccipRead:e}=i,y=e&&typeof(e==null?void 0:e.request)=="function"?e.request:g;try{if(!l.isAddressEqual(u,a))throw new L({sender:a,to:u});const h=n.includes(l.localBatchGatewayUrl)?await l.localBatchGatewayRequest({data:f,ccipRequest:y}):await y({data:f,sender:a,urls:n}),{data:w}=await l.call(i,{blockNumber:o,blockTag:t,data:s.concat([p,s.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[h,r])]),to:u});return w}catch(h){throw new k({callbackSelector:p,cause:h,data:c,extraData:r,sender:a,urls:n})}}async function g({data:i,sender:o,urls:t}){var u;let c=new Error("An unknown error occurred.");for(let d=0;d<t.length;d++){const a=t[d],n=a.includes("{data}")?"GET":"POST",f=n==="POST"?{data:i,sender:o}:void 0,p=n==="POST"?{"Content-Type":"application/json"}:{};try{const r=await fetch(a.replace("{sender}",o.toLowerCase()).replace("{data}",i),{body:JSON.stringify(f),headers:p,method:n});let e;if((u=r.headers.get("Content-Type"))!=null&&u.startsWith("application/json")?e=(await r.json()).data:e=await r.text(),!r.ok){c=new s.HttpRequestError({body:f,details:e!=null&&e.error?s.stringify(e.error):r.statusText,headers:r.headers,status:r.status,url:a});continue}if(!s.isHex(e)){c=new b({result:e,url:a});continue}return e}catch(r){c=new s.HttpRequestError({body:f,details:r.message,url:a})}}throw c}exports.ccipRequest=g;exports.offchainLookup=O;exports.offchainLookupAbiItem=m;exports.offchainLookupSignature=E;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a1 as g, ab as k,
|
|
2
|
-
import { ad as p,
|
|
1
|
+
import { a1 as g, ab as k, aR as L, aS as O, aT as E } from "./parseSignature-ZB66mPGB.mjs";
|
|
2
|
+
import { ad as p, cs as y, bN as w, bb as R, b3 as x, aw as m, be as M } from "./index-BHukHFIh.mjs";
|
|
3
3
|
class S extends p {
|
|
4
4
|
constructor({ callbackSelector: r, cause: a, data: n, extraData: i, sender: f, urls: t }) {
|
|
5
5
|
var o;
|
|
@@ -70,7 +70,7 @@ const D = "0x556f1830", T = {
|
|
|
70
70
|
}
|
|
71
71
|
]
|
|
72
72
|
};
|
|
73
|
-
async function
|
|
73
|
+
async function P(c, { blockNumber: r, blockTag: a, data: n, to: i }) {
|
|
74
74
|
const { args: f } = g({
|
|
75
75
|
data: n,
|
|
76
76
|
abi: [T]
|
|
@@ -84,9 +84,9 @@ async function U(c, { blockNumber: r, blockTag: a, data: n, to: i }) {
|
|
|
84
84
|
}) : await h({ data: d, sender: t, urls: o }), { data: b } = await E(c, {
|
|
85
85
|
blockNumber: r,
|
|
86
86
|
blockTag: a,
|
|
87
|
-
data:
|
|
87
|
+
data: R([
|
|
88
88
|
l,
|
|
89
|
-
|
|
89
|
+
x([{ type: "bytes" }, { type: "bytes" }], [u, s])
|
|
90
90
|
]),
|
|
91
91
|
to: i
|
|
92
92
|
});
|
|
@@ -144,7 +144,7 @@ async function C({ data: c, sender: r, urls: a }) {
|
|
|
144
144
|
}
|
|
145
145
|
export {
|
|
146
146
|
C as ccipRequest,
|
|
147
|
-
|
|
147
|
+
P as offchainLookup,
|
|
148
148
|
T as offchainLookupAbiItem,
|
|
149
149
|
D as offchainLookupSignature
|
|
150
150
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { W as C } from "./index-
|
|
3
|
-
import { R as v } from "./ReownAuthentication-
|
|
1
|
+
import { c1 as y, bX as $, bY as l, bV as S, bW as x, cz as m, c5 as p, cc as f, c6 as h, cw as u, c0 as _, cq as E, co as R } from "./index-BHukHFIh.mjs";
|
|
2
|
+
import { W as C } from "./index-B--AiWBy.mjs";
|
|
3
|
+
import { R as v } from "./ReownAuthentication-ZWJVb5u8.mjs";
|
|
4
4
|
const D = y`
|
|
5
5
|
.email-sufixes {
|
|
6
6
|
display: flex;
|
|
@@ -168,7 +168,7 @@ A([
|
|
|
168
168
|
b = A([
|
|
169
169
|
x("w3m-data-capture-otp-confirm-view")
|
|
170
170
|
], b);
|
|
171
|
-
const
|
|
171
|
+
const q = y`
|
|
172
172
|
.hero {
|
|
173
173
|
display: flex;
|
|
174
174
|
flex-direction: column;
|
|
@@ -456,7 +456,7 @@ let c = class extends $ {
|
|
|
456
456
|
return /^\S+@\S+\.\S+$/u.test(t);
|
|
457
457
|
}
|
|
458
458
|
};
|
|
459
|
-
c.styles = [
|
|
459
|
+
c.styles = [q];
|
|
460
460
|
d([
|
|
461
461
|
u()
|
|
462
462
|
], c.prototype, "email", void 0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BNobBA-8.js"),d=require("./index-xYJPqvul.js"),u=require("./ReownAuthentication-_EMKUe4O.js"),g=e.i$1`
|
|
2
2
|
.email-sufixes {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: row;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { W as y } from "./index-
|
|
3
|
-
var
|
|
1
|
+
import { cc as S, c7 as g, cz as p, c9 as c, cA as _, c5 as s, c6 as f, ce as b, bW as u, bS as D, bX as C, ck as d, bY as m, cw as E, c1 as $, bZ as W, b$ as P, cB as N, c8 as T } from "./index-BHukHFIh.mjs";
|
|
2
|
+
import { W as y } from "./index-B--AiWBy.mjs";
|
|
3
|
+
var F = function(a, e, t, r) {
|
|
4
4
|
var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, o;
|
|
5
5
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, r);
|
|
6
6
|
else for (var l = a.length - 1; l >= 0; l--) (o = a[l]) && (i = (n < 3 ? o(i) : n > 3 ? o(e, t, i) : o(e, t)) || i);
|
|
@@ -41,10 +41,10 @@ let I = class extends y {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
I =
|
|
44
|
+
I = F([
|
|
45
45
|
u("w3m-email-verify-otp-view")
|
|
46
46
|
], I);
|
|
47
|
-
const
|
|
47
|
+
const U = D`
|
|
48
48
|
wui-icon-box {
|
|
49
49
|
height: ${({ spacing: a }) => a[16]};
|
|
50
50
|
width: ${({ spacing: a }) => a[16]};
|
|
@@ -121,14 +121,14 @@ let w = class extends C {
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
|
-
w.styles =
|
|
124
|
+
w.styles = U;
|
|
125
125
|
x([
|
|
126
126
|
E()
|
|
127
127
|
], w.prototype, "loading", void 0);
|
|
128
128
|
w = x([
|
|
129
129
|
u("w3m-email-verify-device-view")
|
|
130
130
|
], w);
|
|
131
|
-
const
|
|
131
|
+
const j = $`
|
|
132
132
|
wui-email-input {
|
|
133
133
|
width: 100%;
|
|
134
134
|
}
|
|
@@ -148,7 +148,7 @@ var O = function(a, e, t, r) {
|
|
|
148
148
|
let h = class extends C {
|
|
149
149
|
constructor() {
|
|
150
150
|
var e, t;
|
|
151
|
-
super(...arguments), this.formRef =
|
|
151
|
+
super(...arguments), this.formRef = W(), this.initialEmail = ((e = s.state.data) == null ? void 0 : e.email) ?? "", this.redirectView = (t = s.state.data) == null ? void 0 : t.redirectView, this.email = "", this.loading = !1;
|
|
152
152
|
}
|
|
153
153
|
firstUpdated() {
|
|
154
154
|
var e;
|
|
@@ -230,7 +230,7 @@ let h = class extends C {
|
|
|
230
230
|
`;
|
|
231
231
|
}
|
|
232
232
|
};
|
|
233
|
-
h.styles =
|
|
233
|
+
h.styles = j;
|
|
234
234
|
O([
|
|
235
235
|
E()
|
|
236
236
|
], h.prototype, "email", void 0);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-BNobBA-8.js"),c=require("./index-xYJPqvul.js");var p=function(l,e,i,o){var n=arguments.length,r=n<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(l,e,i,o);else for(var s=l.length-1;s>=0;s--)(a=l[s])&&(r=(n<3?a(r):n>3?a(e,i,r):a(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};exports.W3mEmailVerifyOtpView=class extends c.W3mEmailOtpWidget{constructor(){super(...arguments),this.onOtpSubmit=async e=>{var i,o;try{if(this.authConnector){const n=t.ChainController.state.activeChain,r=t.ConnectionController.getConnections(n),a=(i=t.OptionsController.state.remoteFeatures)==null?void 0:i.multiWallet,s=r.length>0;if(await this.authConnector.provider.connectOtp({otp:e}),t.EventsController.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),n)await t.ConnectionController.connectExternal(this.authConnector,n);else throw new Error("Active chain is not set on ChainController");if((o=t.OptionsController.state.remoteFeatures)!=null&&o.emailCapture)return;if(t.OptionsController.state.siwx){t.ModalController.close();return}if(s&&a){t.RouterController.replace("ProfileWallets"),t.SnackController.showSuccess("New Wallet Added");return}t.ModalController.close()}}catch(n){throw t.EventsController.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL",properties:{message:t.CoreHelperUtil.parseError(n)}}),n}},this.onOtpResend=async e=>{this.authConnector&&(await this.authConnector.provider.connectEmail({email:e}),t.EventsController.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}))}}};exports.W3mEmailVerifyOtpView=p([t.customElement("w3m-email-verify-otp-view")],exports.W3mEmailVerifyOtpView);const h=t.css`
|
|
2
2
|
wui-icon-box {
|
|
3
3
|
height: ${({spacing:l})=>l[16]};
|
|
4
4
|
width: ${({spacing:l})=>l[16]};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BNobBA-8.js"),x=e.i$1`
|
|
2
2
|
div {
|
|
3
3
|
width: 100%;
|
|
4
4
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const ie =
|
|
1
|
+
import { c1 as B, bX as g, cA as W, cz as K, bY as c, ck as _, cu as V, cI as G, cw as d, bW as w, bS as E, bT as z, bU as H, bV as l, ci as N, cc as h, cJ as j, c8 as k, ca as A, cb as m, c7 as L, cK as X, cv as q, bZ as Z, cL as v, ce as U, cM as O, b$ as J, c9 as I, c6 as Q, cN as ee, c5 as te } from "./index-BHukHFIh.mjs";
|
|
2
|
+
const ie = B`
|
|
3
3
|
div {
|
|
4
4
|
width: 100%;
|
|
5
5
|
}
|
|
@@ -56,7 +56,7 @@ let R = class extends g {
|
|
|
56
56
|
async syncTheme() {
|
|
57
57
|
const t = _.getAuthConnector();
|
|
58
58
|
if (t) {
|
|
59
|
-
const i =
|
|
59
|
+
const i = V.getSnapshot().themeMode, n = V.getSnapshot().themeVariables;
|
|
60
60
|
await t.provider.syncTheme({
|
|
61
61
|
themeVariables: n,
|
|
62
62
|
w3mThemeVariables: G(n, i)
|
|
@@ -244,7 +244,7 @@ let u = class extends g {
|
|
|
244
244
|
></wui-icon>`;
|
|
245
245
|
}
|
|
246
246
|
};
|
|
247
|
-
u.styles = [z,
|
|
247
|
+
u.styles = [z, H, ne];
|
|
248
248
|
y([
|
|
249
249
|
l()
|
|
250
250
|
], u.prototype, "type", void 0);
|
|
@@ -296,7 +296,7 @@ let Y = class extends g {
|
|
|
296
296
|
Y = ae([
|
|
297
297
|
w("w3m-upgrade-wallet-view")
|
|
298
298
|
], Y);
|
|
299
|
-
var
|
|
299
|
+
var C = function(e, t, i, n) {
|
|
300
300
|
var r = arguments.length, o = r < 3 ? t : n === null ? n = Object.getOwnPropertyDescriptor(t, i) : n, s;
|
|
301
301
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, i, n);
|
|
302
302
|
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (o = (r < 3 ? s(o) : r > 3 ? s(t, i, o) : s(t, i)) || o);
|
|
@@ -331,16 +331,16 @@ let $ = class extends g {
|
|
|
331
331
|
`;
|
|
332
332
|
}
|
|
333
333
|
isV6() {
|
|
334
|
-
return (
|
|
334
|
+
return (j.get("dapp_smart_account_version") || "v6") === "v6";
|
|
335
335
|
}
|
|
336
336
|
toggleSmartAccountVersion() {
|
|
337
337
|
var t;
|
|
338
|
-
|
|
338
|
+
j.set("dapp_smart_account_version", this.isV6() ? "v7" : "v6"), typeof window < "u" && ((t = window == null ? void 0 : window.location) == null || t.reload());
|
|
339
339
|
}
|
|
340
340
|
togglePreferredAccountTypeTemplate() {
|
|
341
341
|
var o;
|
|
342
342
|
const t = (o = this.network) == null ? void 0 : o.chainNamespace, i = h.checkIfSmartAccountEnabled(), n = _.getConnectorId(t);
|
|
343
|
-
return !_.getAuthConnector() || n !== k.CONNECTOR_ID.AUTH || !i ? null : (this.switched || (this.text =
|
|
343
|
+
return !_.getAuthConnector() || n !== k.CONNECTOR_ID.AUTH || !i ? null : (this.switched || (this.text = A(t) === m.ACCOUNT_TYPES.SMART_ACCOUNT ? "Switch to your EOA" : "Switch to your Smart Account"), c`
|
|
344
344
|
<wui-list-item
|
|
345
345
|
icon="swapHorizontal"
|
|
346
346
|
?rounded=${!0}
|
|
@@ -355,23 +355,23 @@ let $ = class extends g {
|
|
|
355
355
|
}
|
|
356
356
|
async changePreferredAccountType() {
|
|
357
357
|
var o;
|
|
358
|
-
const t = (o = this.network) == null ? void 0 : o.chainNamespace, i = h.checkIfSmartAccountEnabled(), n =
|
|
358
|
+
const t = (o = this.network) == null ? void 0 : o.chainNamespace, i = h.checkIfSmartAccountEnabled(), n = A(t) === m.ACCOUNT_TYPES.SMART_ACCOUNT || !i ? m.ACCOUNT_TYPES.EOA : m.ACCOUNT_TYPES.SMART_ACCOUNT;
|
|
359
359
|
_.getAuthConnector() && (this.loading = !0, await L.setPreferredAccountType(n, t), this.text = n === m.ACCOUNT_TYPES.SMART_ACCOUNT ? "Switch to your EOA" : "Switch to your Smart Account", this.switched = !0, X.resetSend(), this.loading = !1, this.requestUpdate());
|
|
360
360
|
}
|
|
361
361
|
};
|
|
362
|
-
|
|
362
|
+
C([
|
|
363
363
|
d()
|
|
364
364
|
], $.prototype, "loading", void 0);
|
|
365
|
-
|
|
365
|
+
C([
|
|
366
366
|
d()
|
|
367
367
|
], $.prototype, "switched", void 0);
|
|
368
|
-
|
|
368
|
+
C([
|
|
369
369
|
d()
|
|
370
370
|
], $.prototype, "text", void 0);
|
|
371
|
-
|
|
371
|
+
C([
|
|
372
372
|
d()
|
|
373
373
|
], $.prototype, "network", void 0);
|
|
374
|
-
$ =
|
|
374
|
+
$ = C([
|
|
375
375
|
w("w3m-smart-account-settings-view")
|
|
376
376
|
], $);
|
|
377
377
|
const ce = E`
|
|
@@ -436,7 +436,7 @@ let b = class extends g {
|
|
|
436
436
|
return this.loading ? c`<wui-loading-spinner size="lg" color="primary"></wui-loading-spinner>` : this.registered ? c`<wui-tag variant="info" size="sm">Registered</wui-tag>` : c`<wui-tag variant="success" size="sm">Available</wui-tag>`;
|
|
437
437
|
}
|
|
438
438
|
};
|
|
439
|
-
b.styles = [z,
|
|
439
|
+
b.styles = [z, H, ce];
|
|
440
440
|
T([
|
|
441
441
|
l()
|
|
442
442
|
], b.prototype, "name", void 0);
|
|
@@ -579,7 +579,7 @@ var x = function(e, t, i, n) {
|
|
|
579
579
|
let p = class extends g {
|
|
580
580
|
constructor() {
|
|
581
581
|
var t;
|
|
582
|
-
super(), this.formRef =
|
|
582
|
+
super(), this.formRef = Z(), this.usubscribe = [], this.name = "", this.error = "", this.loading = v.state.loading, this.suggestions = v.state.suggestions, this.profileName = (t = h.getAccountData()) == null ? void 0 : t.profileName, this.onDebouncedNameInputChange = U.debounce((i) => {
|
|
583
583
|
i.length < 4 ? this.error = "Name must be at least 4 characters long" : O.isValidReownName(i) ? (this.error = "", v.getSuggestions(i)) : this.error = "The value is not a valid username";
|
|
584
584
|
}), this.usubscribe.push(v.subscribe((i) => {
|
|
585
585
|
this.suggestions = i.suggestions, this.loading = i.loading;
|
|
@@ -603,7 +603,7 @@ let p = class extends g {
|
|
|
603
603
|
gap="4"
|
|
604
604
|
.padding=${["1", "3", "4", "3"]}
|
|
605
605
|
>
|
|
606
|
-
<form ${
|
|
606
|
+
<form ${J(this.formRef)} @submit=${this.onSubmitName.bind(this)}>
|
|
607
607
|
<wui-ens-input
|
|
608
608
|
@inputChange=${this.onNameInputChange.bind(this)}
|
|
609
609
|
.errorMessage=${this.error}
|
|
@@ -676,23 +676,23 @@ let p = class extends g {
|
|
|
676
676
|
type: "track",
|
|
677
677
|
event: "REGISTER_NAME_INITIATED",
|
|
678
678
|
properties: {
|
|
679
|
-
isSmartAccount:
|
|
679
|
+
isSmartAccount: A(h.state.activeChain) === m.ACCOUNT_TYPES.SMART_ACCOUNT,
|
|
680
680
|
ensName: t
|
|
681
681
|
}
|
|
682
682
|
}), await v.registerName(t), I.sendEvent({
|
|
683
683
|
type: "track",
|
|
684
684
|
event: "REGISTER_NAME_SUCCESS",
|
|
685
685
|
properties: {
|
|
686
|
-
isSmartAccount:
|
|
686
|
+
isSmartAccount: A(h.state.activeChain) === m.ACCOUNT_TYPES.SMART_ACCOUNT,
|
|
687
687
|
ensName: t
|
|
688
688
|
}
|
|
689
689
|
});
|
|
690
690
|
} catch (i) {
|
|
691
|
-
|
|
691
|
+
Q.showError(i.message), I.sendEvent({
|
|
692
692
|
type: "track",
|
|
693
693
|
event: "REGISTER_NAME_ERROR",
|
|
694
694
|
properties: {
|
|
695
|
-
isSmartAccount:
|
|
695
|
+
isSmartAccount: A(h.state.activeChain) === m.ACCOUNT_TYPES.SMART_ACCOUNT,
|
|
696
696
|
ensName: t,
|
|
697
697
|
error: U.parseError(i)
|
|
698
698
|
}
|
|
@@ -728,7 +728,7 @@ x([
|
|
|
728
728
|
p = x([
|
|
729
729
|
w("w3m-register-account-name-view")
|
|
730
730
|
], p);
|
|
731
|
-
const ue =
|
|
731
|
+
const ue = B`
|
|
732
732
|
.continue-button-container {
|
|
733
733
|
width: 100%;
|
|
734
734
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ReownAuthentication-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ReownAuthentication-_EMKUe4O.js");exports.ReownAuthentication=e.ReownAuthentication;exports.ReownAuthenticationMessenger=e.ReownAuthenticationMessenger;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bS as C, bT as O, bU as P, bV as h, bW as w, bX as v, bY as l, c1 as E, cw as d, c0 as I, cx as g, c5 as S, ck as $, ce as R, c6 as T } from "./index-BHukHFIh.mjs";
|
|
2
2
|
const L = C`
|
|
3
3
|
:host {
|
|
4
4
|
position: relative;
|
|
@@ -172,18 +172,18 @@ let c = class extends v {
|
|
|
172
172
|
const i = t.target, s = this.getInputElement(i);
|
|
173
173
|
if (s) {
|
|
174
174
|
const o = s.value;
|
|
175
|
-
t.inputType === "insertFromPaste" ? this.handlePaste(s, o, e) :
|
|
175
|
+
t.inputType === "insertFromPaste" ? this.handlePaste(s, o, e) : I.isNumber(o) && t.data ? (this.updateInput(s, e, t.data), this.focusInputField("next", e)) : this.updateInput(s, e, "");
|
|
176
176
|
}
|
|
177
177
|
this.dispatchInputChangeEvent();
|
|
178
178
|
}
|
|
179
179
|
handlePaste(t, e, i) {
|
|
180
180
|
const s = e[0];
|
|
181
|
-
if (s &&
|
|
181
|
+
if (s && I.isNumber(s)) {
|
|
182
182
|
this.updateInput(t, i, s);
|
|
183
183
|
const r = e.substring(1);
|
|
184
184
|
if (i + 1 < this.length && r.length) {
|
|
185
|
-
const a = this.numerics[i + 1],
|
|
186
|
-
|
|
185
|
+
const a = this.numerics[i + 1], x = a ? this.getInputElement(a) : void 0;
|
|
186
|
+
x && this.handlePaste(x, r, i + 1);
|
|
187
187
|
} else
|
|
188
188
|
this.focusInputField("next", i);
|
|
189
189
|
} else
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./parseSignature-CWAxHYP1.js"),r=require("./index-BNobBA-8.js"),o=require("./ccip-BgoVuN3u.js");exports.AccountStateConflictError=e.AccountStateConflictError;exports.BaseFeeScalarError=e.BaseFeeScalarError;exports.BlockNotFoundError=e.BlockNotFoundError;exports.BundleFailedError=e.BundleFailedError;exports.CallExecutionError=e.CallExecutionError;exports.ChainDoesNotSupportContract=e.ChainDoesNotSupportContract;exports.CircularReferenceError=e.CircularReferenceError;exports.ClientChainNotConfiguredError=e.ClientChainNotConfiguredError;exports.ContractFunctionExecutionError=e.ContractFunctionExecutionError;exports.ContractFunctionRevertedError=e.ContractFunctionRevertedError;exports.ContractFunctionZeroDataError=e.ContractFunctionZeroDataError;exports.CounterfactualDeploymentFailedError=e.CounterfactualDeploymentFailedError;exports.Eip1559FeesNotSupportedError=e.Eip1559FeesNotSupportedError;exports.EnsAvatarInvalidNftUriError=e.EnsAvatarInvalidNftUriError;exports.EnsAvatarUnsupportedNamespaceError=e.EnsAvatarUnsupportedNamespaceError;exports.EnsAvatarUriResolutionError=e.EnsAvatarUriResolutionError;exports.EstimateGasExecutionError=e.EstimateGasExecutionError;exports.FilterTypeNotSupportedError=e.FilterTypeNotSupportedError;exports.InvalidAbiItemError=e.InvalidAbiItemError;exports.InvalidAbiParametersError=e.InvalidAbiParametersError;exports.InvalidAbiTypeParameterError=e.InvalidAbiTypeParameterError;exports.InvalidChainIdError=e.InvalidChainIdError;exports.InvalidFunctionModifierError=e.InvalidFunctionModifierError;exports.InvalidLegacyVError=e.InvalidLegacyVError;exports.InvalidModifierError=e.InvalidModifierError;exports.InvalidParameterError=e.InvalidParameterError;exports.InvalidParenthesisError=e.InvalidParenthesisError;exports.InvalidSerializableTransactionError=e.InvalidSerializableTransactionError;exports.InvalidSignatureError=e.InvalidSignatureError;exports.InvalidStorageKeySizeError=e.InvalidStorageKeySizeError;exports.InvalidStructSignatureError=e.InvalidStructSignatureError;exports.MaxFeePerGasTooLowError=e.MaxFeePerGasTooLowError;exports.RawContractError=e.RawContractError;exports.SolidityProtectedKeywordError=e.SolidityProtectedKeywordError;exports.StateAssignmentConflictError=e.StateAssignmentConflictError;exports.TransactionExecutionError=e.TransactionExecutionError;exports.TransactionNotFoundError=e.TransactionNotFoundError;exports.TransactionReceiptNotFoundError=e.TransactionReceiptNotFoundError;exports.UnknownSignatureError=e.UnknownSignatureError;exports.UnknownTypeError=e.UnknownTypeError;exports.WaitForCallsStatusTimeoutError=e.WaitForCallsStatusTimeoutError;exports.WaitForTransactionReceiptTimeoutError=e.WaitForTransactionReceiptTimeoutError;exports.assertRequest=e.assertRequest;exports.assertTransactionEIP1559=e.assertTransactionEIP1559;exports.assertTransactionEIP2930=e.assertTransactionEIP2930;exports.assertTransactionLegacy=e.assertTransactionLegacy;exports.blobsToCommitments=e.blobsToCommitments;exports.blobsToProofs=e.blobsToProofs;exports.bytesToBigInt=e.bytesToBigInt;exports.bytesToBool=e.bytesToBool;exports.bytesToNumber=e.bytesToNumber;exports.bytesToString=e.bytesToString;exports.commitmentToVersionedHash=e.commitmentToVersionedHash;exports.commitmentsToVersionedHashes=e.commitmentsToVersionedHashes;exports.createClient=e.createClient;exports.createNonceManager=e.createNonceManager;exports.createPublicClient=e.createPublicClient;exports.decodeAbiParameters=e.decodeAbiParameters;exports.decodeErrorResult=e.decodeErrorResult;exports.decodeEventLog=e.decodeEventLog;exports.decodeFunctionData=e.decodeFunctionData;exports.decodeFunctionResult=e.decodeFunctionResult;exports.defineBlock=e.defineBlock;exports.defineTransaction=e.defineTransaction;exports.defineTransactionReceipt=e.defineTransactionReceipt;exports.deploylessCallViaBytecodeBytecode=e.deploylessCallViaBytecodeBytecode;exports.deploylessCallViaFactoryBytecode=e.deploylessCallViaFactoryBytecode;exports.encodeDeployData=e.encodeDeployData;exports.encodeErrorResult=e.encodeErrorResult;exports.encodeEventTopics=e.encodeEventTopics;exports.encodeFunctionResult=e.encodeFunctionResult;exports.encodePacked=e.encodePacked;exports.erc6492SignatureValidatorByteCode=e.erc6492SignatureValidatorByteCode;exports.ethAddress=e.ethAddress;exports.formatBlock=e.formatBlock;exports.formatEther=e.formatEther;exports.formatLog=e.formatLog;exports.formatTransaction=e.formatTransaction;exports.formatTransactionReceipt=e.formatTransactionReceipt;exports.formatTransactionRequest=e.formatTransactionRequest;exports.getChainContractAddress=e.getChainContractAddress;exports.getContractError=e.getContractError;exports.getTransactionType=e.getTransactionType;exports.hexToSignature=e.parseSignature;exports.isAddressEqual=e.isAddressEqual;exports.labelhash=e.labelhash;exports.maxUint256=e.maxUint256;exports.namehash=e.namehash;exports.parseAbi=e.parseAbi;exports.parseAbiItem=e.parseAbiItem;exports.parseAbiParameters=e.parseAbiParameters;exports.parseEventLogs=e.parseEventLogs;exports.parseSignature=e.parseSignature;exports.publicActions=e.publicActions;exports.recoverAddress=e.recoverAddress;exports.recoverPublicKey=e.recoverPublicKey;exports.rpcTransactionType=e.rpcTransactionType;exports.serializeAccessList=e.serializeAccessList;exports.serializeErc6492Signature=e.serializeErc6492Signature;exports.serializeSignature=e.serializeSignature;exports.serializeTransaction=e.serializeTransaction;exports.sha256=e.sha256;exports.signatureToHex=e.serializeSignature;exports.toBlobSidecars=e.toBlobSidecars;exports.toBlobs=e.toBlobs;exports.toRlp=e.toRlp;exports.transactionType=e.transactionType;exports.universalSignatureValidatorByteCode=e.erc6492SignatureValidatorByteCode;exports.withCache=e.withCache;exports.zeroAddress=e.zeroAddress;exports.AbiConstructorNotFoundError=r.AbiConstructorNotFoundError;exports.AbiConstructorParamsNotFoundError=r.AbiConstructorParamsNotFoundError;exports.AbiDecodingDataSizeTooSmallError=r.AbiDecodingDataSizeTooSmallError;exports.AbiDecodingZeroDataError=r.AbiDecodingZeroDataError;exports.AbiEncodingArrayLengthMismatchError=r.AbiEncodingArrayLengthMismatchError;exports.AbiEncodingBytesSizeMismatchError=r.AbiEncodingBytesSizeMismatchError;exports.AbiEncodingLengthMismatchError=r.AbiEncodingLengthMismatchError;exports.AbiErrorInputsNotFoundError=r.AbiErrorInputsNotFoundError;exports.AbiErrorNotFoundError=r.AbiErrorNotFoundError;exports.AbiErrorSignatureNotFoundError=r.AbiErrorSignatureNotFoundError;exports.AbiEventNotFoundError=r.AbiEventNotFoundError;exports.AbiEventSignatureEmptyTopicsError=r.AbiEventSignatureEmptyTopicsError;exports.AbiEventSignatureNotFoundError=r.AbiEventSignatureNotFoundError;exports.AbiFunctionNotFoundError=r.AbiFunctionNotFoundError;exports.AbiFunctionOutputsNotFoundError=r.AbiFunctionOutputsNotFoundError;exports.AbiFunctionSignatureNotFoundError=r.AbiFunctionSignatureNotFoundError;exports.AtomicReadyWalletRejectedUpgradeError=r.AtomicReadyWalletRejectedUpgradeError;exports.AtomicityNotSupportedError=r.AtomicityNotSupportedError;exports.BaseError=r.BaseError;exports.BundleTooLargeError=r.BundleTooLargeError;exports.BytesSizeMismatchError=r.BytesSizeMismatchError;exports.ChainDisconnectedError=r.ChainDisconnectedError;exports.DecodeLogDataMismatch=r.DecodeLogDataMismatch;exports.DecodeLogTopicsMismatch=r.DecodeLogTopicsMismatch;exports.DuplicateIdError=r.DuplicateIdError;exports.ExecutionRevertedError=r.ExecutionRevertedError;exports.FeeCapTooHighError=r.FeeCapTooHighError;exports.FeeCapTooLowError=r.FeeCapTooLowError;exports.HttpRequestError=r.HttpRequestError;exports.InsufficientFundsError=r.InsufficientFundsError;exports.IntegerOutOfRangeError=r.IntegerOutOfRangeError;exports.InternalRpcError=r.InternalRpcError;exports.IntrinsicGasTooHighError=r.IntrinsicGasTooHighError;exports.IntrinsicGasTooLowError=r.IntrinsicGasTooLowError;exports.InvalidAbiDecodingTypeError=r.InvalidAbiDecodingTypeError;exports.InvalidAbiEncodingTypeError=r.InvalidAbiEncodingTypeError;exports.InvalidAddressError=r.InvalidAddressError;exports.InvalidArrayError=r.InvalidArrayError;exports.InvalidBytesBooleanError=r.InvalidBytesBooleanError;exports.InvalidDefinitionTypeError=r.InvalidDefinitionTypeError;exports.InvalidDomainError=r.InvalidDomainError;exports.InvalidHexBooleanError=r.InvalidHexBooleanError;exports.InvalidInputRpcError=r.InvalidInputRpcError;exports.InvalidParamsRpcError=r.InvalidParamsRpcError;exports.InvalidPrimaryTypeError=r.InvalidPrimaryTypeError;exports.InvalidRequestRpcError=r.InvalidRequestRpcError;exports.InvalidStructTypeError=r.InvalidStructTypeError;exports.JsonRpcVersionUnsupportedError=r.JsonRpcVersionUnsupportedError;exports.LimitExceededRpcError=r.LimitExceededRpcError;exports.MethodNotFoundRpcError=r.MethodNotFoundRpcError;exports.MethodNotSupportedRpcError=r.MethodNotSupportedRpcError;exports.NonceMaxValueError=r.NonceMaxValueError;exports.NonceTooHighError=r.NonceTooHighError;exports.NonceTooLowError=r.NonceTooLowError;exports.ParseRpcError=r.ParseRpcError;exports.ProviderDisconnectedError=r.ProviderDisconnectedError;exports.ProviderRpcError=r.ProviderRpcError;exports.ResourceNotFoundRpcError=r.ResourceNotFoundRpcError;exports.ResourceUnavailableRpcError=r.ResourceUnavailableRpcError;exports.RpcError=r.RpcError;exports.RpcRequestError=r.RpcRequestError;exports.SizeExceedsPaddingSizeError=r.SizeExceedsPaddingSizeError;exports.SizeOverflowError=r.SizeOverflowError;exports.SliceOffsetOutOfBoundsError=r.SliceOffsetOutOfBoundsError;exports.SwitchChainError=r.SwitchChainError;exports.TimeoutError=r.TimeoutError;exports.TipAboveFeeCapError=r.TipAboveFeeCapError;exports.TransactionRejectedRpcError=r.TransactionRejectedRpcError;exports.TransactionTypeNotSupportedError=r.TransactionTypeNotSupportedError;exports.UnauthorizedProviderError=r.UnauthorizedProviderError;exports.UnknownBundleIdError=r.UnknownBundleIdError;exports.UnknownNodeError=r.UnknownNodeError;exports.UnknownRpcError=r.UnknownRpcError;exports.UnsupportedChainIdError=r.UnsupportedChainIdError;exports.UnsupportedNonOptionalCapabilityError=r.UnsupportedNonOptionalCapabilityError;exports.UnsupportedPackedAbiType=r.UnsupportedPackedAbiType;exports.UnsupportedProviderMethodError=r.UnsupportedProviderMethodError;exports.UrlRequiredError=r.UrlRequiredError;exports.UserRejectedRequestError=r.UserRejectedRequestError;exports.boolToBytes=r.boolToBytes;exports.boolToHex=r.boolToHex;exports.bytesToHex=r.bytesToHex;exports.checksumAddress=r.checksumAddress;exports.concat=r.concat;exports.concatBytes=r.concatBytes;exports.concatHex=r.concatHex;exports.createTransport=r.createTransport;exports.defineChain=r.defineChain;exports.encodeAbiParameters=r.encodeAbiParameters;exports.encodeFunctionData=r.encodeFunctionData;exports.erc20Abi=r.erc20Abi;exports.erc6492SignatureValidatorAbi=r.erc6492SignatureValidatorAbi;exports.etherUnits=r.etherUnits;exports.fallback=r.fallback;exports.formatGwei=r.formatGwei;exports.formatUnits=r.formatUnits;exports.getAbiItem=r.getAbiItem;exports.getAddress=r.getAddress;exports.getEventSelector=r.toEventSelector;exports.getEventSignature=r.toSignature;exports.getFunctionSelector=r.toFunctionSelector;exports.getFunctionSignature=r.toSignature;exports.getTypesForEIP712Domain=r.getTypesForEIP712Domain;exports.gweiUnits=r.gweiUnits;exports.hashDomain=r.hashDomain;exports.hashMessage=r.hashMessage;exports.hashStruct=r.hashStruct;exports.hashTypedData=r.hashTypedData;exports.hexToBigInt=r.hexToBigInt;exports.hexToBool=r.hexToBool;exports.hexToBytes=r.hexToBytes;exports.hexToNumber=r.hexToNumber;exports.hexToString=r.hexToString;exports.http=r.http;exports.isAddress=r.isAddress;exports.isHex=r.isHex;exports.keccak256=r.keccak256;exports.multicall3Abi=r.multicall3Abi;exports.numberToBytes=r.numberToBytes;exports.numberToHex=r.numberToHex;exports.pad=r.pad;exports.padBytes=r.padBytes;exports.padHex=r.padHex;exports.prepareEncodeFunctionData=r.prepareEncodeFunctionData;exports.presignMessagePrefix=r.presignMessagePrefix;exports.shouldThrow=r.shouldThrow;exports.size=r.size;exports.slice=r.slice;exports.sliceBytes=r.sliceBytes;exports.sliceHex=r.sliceHex;exports.stringToBytes=r.stringToBytes;exports.stringToHex=r.stringToHex;exports.stringify=r.stringify;exports.toBytes=r.toBytes;exports.toEventHash=r.toSignatureHash;exports.toEventSelector=r.toEventSelector;exports.toEventSignature=r.toSignature;exports.toFunctionHash=r.toSignatureHash;exports.toFunctionSelector=r.toFunctionSelector;exports.toFunctionSignature=r.toSignature;exports.toHex=r.toHex;exports.toPrefixedMessage=r.toPrefixedMessage;exports.trim=r.trim;exports.universalSignatureValidatorAbi=r.erc6492SignatureValidatorAbi;exports.validateTypedData=r.validateTypedData;exports.withRetry=r.withRetry;exports.withTimeout=r.withTimeout;exports.ccipFetch=o.ccipRequest;exports.ccipRequest=o.ccipRequest;exports.offchainLookup=o.offchainLookup;exports.offchainLookupAbiItem=o.offchainLookupAbiItem;exports.offchainLookupSignature=o.offchainLookupSignature;
|