@web3jskit/walletkit 0.6.0 → 0.6.1
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/{btcConnector-DMgc1GYB.mjs → btcConnector-B7ttVDQk.mjs} +2 -2
- package/dist/{btcConnector-CcZ3Vta3.mjs → btcConnector-Cj8EN5ES.mjs} +2 -2
- package/dist/{btcConnector-BDtO-SY1.js → btcConnector-Dm9kVuSb.js} +1 -1
- package/dist/{btcConnector-DfFAwTZX.js → btcConnector-DofJ97Y5.js} +1 -1
- package/dist/core/connectors/_tron/tronConnector.d.ts +1 -1
- package/dist/core/connectors/_tron/tronConnector.d.ts.map +1 -1
- package/dist/{createConnectors-motkSfb8.mjs → createConnectors-B-vlchFu.mjs} +337 -311
- package/dist/{createConnectors-Cv_QLnqK.js → createConnectors-BpxUcDLh.js} +2 -2
- package/dist/{createConnectors-CJ8mKxGL.js → createConnectors-CFrXz3Tc.js} +3 -3
- package/dist/{createConnectors-C9LH3IR3.mjs → createConnectors-CxmtbsYq.mjs} +2 -1
- package/dist/{deepLinkConnector-DkxVqLoI.mjs → deepLinkConnector-8odSmMjV.mjs} +2 -2
- package/dist/{deepLinkConnector-DZhNx2B3.mjs → deepLinkConnector-B6CyAaUr.mjs} +1 -1
- package/dist/{deepLinkConnector-BXnwTb3R.mjs → deepLinkConnector-B8pApc03.mjs} +1 -1
- package/dist/{deepLinkConnector-BdJyNgRZ.js → deepLinkConnector-BMZDoIAp.js} +1 -1
- package/dist/{deepLinkConnector-DNwi0QPz.js → deepLinkConnector-BPGRAVl-.js} +1 -1
- package/dist/{deepLinkConnector-DIFgHqiu.js → deepLinkConnector-C2aCjSbe.js} +1 -1
- package/dist/{deepLinkConnector-BYTD1fC1.mjs → deepLinkConnector-Cdjr25xm.mjs} +1 -1
- package/dist/{deepLinkConnector-Cvnq6T2g.js → deepLinkConnector-Cyu_Edwl.js} +1 -1
- package/dist/{deepLinkConnector-C2hzBr3K.mjs → deepLinkConnector-D87huDAb.mjs} +1 -1
- package/dist/{deepLinkConnector-Bu6KKcGy.mjs → deepLinkConnector-DLIigRSC.mjs} +1 -1
- package/dist/{deepLinkConnector-CuHi9EXY.js → deepLinkConnector-pwT-5sN9.js} +1 -1
- package/dist/{deepLinkConnector-Bw-eQd5I.js → deepLinkConnector-tiMGIje-.js} +1 -1
- package/dist/{deepLinkConnector-DjjZRYdu.mjs → deepLinkConnector-u50UYivS.mjs} +1 -1
- package/dist/{deepLinkConnector-CAwqVe4F.js → deepLinkConnector-yVckiqOS.js} +1 -1
- package/dist/{index-Dh0IhC3B.mjs → index-BDdQWaKC.mjs} +1 -1
- package/dist/{index-AJZEVNvC.js → index-BjW6H6Wf.js} +2 -2
- package/dist/{index-CwrzsL2T.mjs → index-C7kS8da-.mjs} +6 -6
- package/dist/{index-Ds_3MsPA.js → index-Czazgjox.js} +1 -1
- package/dist/{index-B2ReClHJ.js → index-SWj1NcId.js} +1 -1
- package/dist/{index-bCuJkrSE.mjs → index-yDk8A0La.mjs} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.js +55 -1
- package/dist/{silentConnect-CZY4_0a5.js → silentConnect-BADzd6pW.js} +1 -1
- package/dist/{silentConnect-ScWCxMaM.mjs → silentConnect-C3uKdKfg.mjs} +2 -2
- package/dist/{tronConnector-CXH3d_my.js → tronConnector-CEvkSzzX.js} +1 -1
- package/dist/{tronConnector-DGnNuwqC.js → tronConnector-CMOd_Cqc.js} +1 -1
- package/dist/{tronConnector-Bx-nhNWr.mjs → tronConnector-C_mkvgQ7.mjs} +2 -2
- package/dist/{tronConnector-P87k0GEa.mjs → tronConnector-Dwgaegsx.mjs} +2 -2
- package/package.json +1 -1
|
@@ -2171,13 +2171,13 @@ function Pr() {
|
|
|
2171
2171
|
} : null;
|
|
2172
2172
|
}
|
|
2173
2173
|
async function Bh(e, t) {
|
|
2174
|
-
return (await import("./createConnectors-
|
|
2174
|
+
return (await import("./createConnectors-B-vlchFu.mjs").then((i) => i.a)).createConnector(e, t);
|
|
2175
2175
|
}
|
|
2176
2176
|
async function Wh() {
|
|
2177
|
-
return (await import("./createConnectors-
|
|
2177
|
+
return (await import("./createConnectors-CxmtbsYq.mjs").then((t) => t.a)).createConnectors();
|
|
2178
2178
|
}
|
|
2179
2179
|
async function _h(e, t) {
|
|
2180
|
-
return (await import("./silentConnect-
|
|
2180
|
+
return (await import("./silentConnect-C3uKdKfg.mjs")).default(e, t);
|
|
2181
2181
|
}
|
|
2182
2182
|
function vs(e, t) {
|
|
2183
2183
|
const n = e.exec(t);
|
|
@@ -3601,11 +3601,11 @@ async function Yh(e, t) {
|
|
|
3601
3601
|
});
|
|
3602
3602
|
}
|
|
3603
3603
|
async function Va() {
|
|
3604
|
-
const { createConnector: e } = await import("./createConnectors-
|
|
3604
|
+
const { createConnector: e } = await import("./createConnectors-B-vlchFu.mjs").then((t) => t.a);
|
|
3605
3605
|
return e;
|
|
3606
3606
|
}
|
|
3607
3607
|
async function Ka() {
|
|
3608
|
-
const { createConnectors: e } = await import("./createConnectors-
|
|
3608
|
+
const { createConnectors: e } = await import("./createConnectors-CxmtbsYq.mjs").then((t) => t.a);
|
|
3609
3609
|
return e;
|
|
3610
3610
|
}
|
|
3611
3611
|
function Ja({
|
|
@@ -6020,7 +6020,7 @@ const Nh = () => {
|
|
|
6020
6020
|
if (e === void 0)
|
|
6021
6021
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
6022
6022
|
return e;
|
|
6023
|
-
}, Ah = li(() => import("./index-
|
|
6023
|
+
}, Ah = li(() => import("./index-yDk8A0La.mjs")), Sh = li(() => import("./index-BDdQWaKC.mjs")), Gh = ({
|
|
6024
6024
|
children: e,
|
|
6025
6025
|
theme: t = "light",
|
|
6026
6026
|
language: n,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),_=require("react"),T=require("./index-Dqp1KqTh.js"),l=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),_=require("react"),T=require("./index-Dqp1KqTh.js"),l=require("./index-BjW6H6Wf.js"),b=require("./walletName-mwS8Jhxj.js"),B="_modalContent_1q71y_1",$="_body_1q71y_5",R="_section_1q71y_11",M="_title_1q71y_17",L="_walletGrid_1q71y_25",O="_footer_1q71y_51",E="_poweredBy_1q71y_55",U="_connecting_1q71y_62",K="_content_1q71y_70",A="_walletIcon_1q71y_77",D="_iconContainer_1q71y_80",G="_status_1q71y_98",P="_subtitle_1q71y_111",z="_spinner_1q71y_119",H="_inner_1q71y_127",a={modalContent:B,body:$,section:R,title:M,walletGrid:L,footer:O,poweredBy:E,connecting:U,content:K,walletIcon:A,iconContainer:D,status:G,subtitle:P,spinner:z,inner:H},F=1e3*60*60*24,W=e=>e.connectorType===l.ConnectorType.Installed||e.connectorType===l.ConnectorType.Run,J=e=>b.normalizeWalletKey(e)==="browserwallet",Q=(e,t,c=Date.now())=>!(t!=null&&t.name)||!t.timestamp||t.timestamp<=c-F||b.normalizeWalletKey(e.name)!==b.normalizeWalletKey(t.name)?!1:W(e),q=e=>J(e.name)?2:e.isRecent?0:W(e)?1:3,V=(e,t)=>{const c=e.filter(Boolean);for(const i of c)i.isRecent=Q(i,t);return c.sort((i,n)=>q(i)-q(n))},X="_walletItem_6bfi0_1",Y="_content_6bfi0_16",Z="_icon_6bfi0_22",ee="_name_6bfi0_38",se="_badge_6bfi0_45",te="_installed_6bfi0_58",ne="_recent_6bfi0_63",le="_disabled_6bfi0_68",ae="_skeleton_6bfi0_72",o={walletItem:X,content:Y,icon:Z,name:ee,badge:se,installed:te,recent:ne,disabled:le,skeleton:ae},oe=({connector:e,onConnect:t,onError:c})=>{const{connectStatus:i,currentChainType:n,currentConnector:u,isConnecting:C,setRecentConnector:d}=l.useWalletKit(),{allowSwitchWallet:y}=_.useContext(l.ChainContext),{t:m}=l.useTranslation(),f=_.useMemo(()=>y?!1:(u==null?void 0:u.chainType)===n&&i==="connected",[y,i,u,n]),p=async()=>{try{if((e==null?void 0:e.connectorType)===l.ConnectorType.More){const x=l.checkIsMobile();e!=null&&e.deepLink&&x&&!l.detectWalletBrowser()?console.log("deepLink"):(console.log("not deepLink",e),x?e!=null&&e.downloadUrl?window.open(e.downloadUrl,"_blank"):console.log("no downloadUrl",e):e!=null&&e.extension?window.open(e.extension,"_blank"):console.log("no extension",e))}if(f||C)return;const w=await e.connect();d({name:e.name,timestamp:Date.now()}),typeof t=="function"&&t(w)}catch(w){c==null||c(w)}},h=["run","installed"].includes(e.connectorType),j=l.formatWalletDisplayName(e.name);return s.jsxs("div",{className:`${o.walletItem} ${f?o.disabled:""}`,onClick:p,children:[s.jsxs("div",{className:o.content,children:[s.jsx("div",{className:o.icon,children:s.jsx("img",{src:e.icon,alt:j})}),s.jsx("span",{className:o.name,children:j})]}),e.isRecent&&s.jsx("div",{className:`${o.badge} ${o.recent}`,children:m("recent")}),h&&!e.isRecent&&s.jsx("div",{className:`${o.badge} ${o.installed}`,children:m("installed")})]})},ie=({showBadge:e=!0})=>s.jsxs("div",{className:`${o.walletItem} ${o.skeleton}`,"aria-hidden":!0,children:[s.jsxs("div",{className:o.content,children:[s.jsx("div",{className:o.icon}),s.jsx("span",{className:o.name})]}),e?s.jsx("div",{className:`${o.badge} ${o.installed}`}):null]}),ce=e=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",viewBox:"0 0 46 46",fill:"none",children:s.jsx("path",{d:"M23 43C34.0457 43 43 34.0457 43 23C43 11.9543 34.0457 3 23 3C11.9543 3 3 11.9543 3 23",stroke:"currentColor",strokeWidth:"6"})}),re=6,de=4,me=(e,t=e)=>Array.from({length:e},(c,i)=>s.jsx(ie,{showBadge:i<t},i)),_e=({productName:e})=>{const{t}=l.useTranslation(),{currentChainType:c,supportWallets:i,isConnecting:n,setIsConnecting:u,recentConnector:C}=l.useWalletKit(),{connectModalData:d}=l.useModalStore(),[y,m]=_.useState([]),[f,p]=_.useState(!0),h=_.useMemo(()=>!!d,[d]);_.useEffect(()=>{if(!h){m([]),p(!1);return}let r=!1;return(async()=>{p(!0),m([]);try{const v=await(await l.loadCreateConnector())(c,i||[]);r||m((Array.isArray(v)?v:[]).filter(Boolean))}catch(g){console.error("Failed to load wallet connectors",g),r||m([])}finally{r||p(!1)}})(),()=>{r=!0}},[h,c,i]);const j=r=>{d==null||d.onConnect(r)},w=()=>{var r;(r=l.useModalStore.getState().connectModalData)==null||r.onError(l.UserRejectError),n&&u(!1)},x=_.useMemo(()=>V(y,C),[y,C]),N=l.isHiBroBrowser(),I=N||!f&&x.length<=1,S=N?1:re,k=N?1:de;return s.jsx(T.Modal,{isOpen:h,onClose:w,title:String(t(n?"connecting":"connect")),compact:I,children:s.jsxs("div",{className:a.modalContent,children:[n&&typeof n=="object"?s.jsx("div",{className:a.connecting,children:s.jsxs("div",{className:a.content,children:[s.jsx("div",{className:a.walletIcon,children:s.jsx("div",{className:a.iconContainer,children:s.jsx("img",{src:n==null?void 0:n.icon,alt:l.formatWalletDisplayName(n==null?void 0:n.name)})})}),s.jsxs("div",{className:a.status,children:[s.jsx("h3",{className:a.title,children:t("openingWallet",{name:l.formatWalletDisplayName(n==null?void 0:n.name)})}),s.jsx("div",{className:a.subtitle,children:t("confirmConnection")})]}),s.jsx("div",{className:a.spinner,children:s.jsx("div",{className:a.inner,children:s.jsx(ce,{})})})]})}):s.jsx("div",{className:a.body,"aria-busy":f,children:s.jsxs("div",{className:a.section,children:[s.jsx("h3",{className:a.title,children:t("popularWallets")}),s.jsx("div",{className:a.walletGrid,children:f?me(S,k):x.map(r=>s.jsx(oe,{connector:r,onConnect:j,onError:d==null?void 0:d.onError},r.name))})]})}),e&&s.jsx("div",{className:a.footer,children:s.jsx("p",{className:a.poweredBy,children:t("poweredBy",{productName:e})})})]})})};exports.default=_e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("./index-Dqp1KqTh.js"),C=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("./index-Dqp1KqTh.js"),C=require("./index-BjW6H6Wf.js"),m=require("react"),v=()=>e.jsxs("svg",{fill:"none",height:"16",viewBox:"0 0 17 16",width:"17",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("title",{children:"Copy"}),e.jsx("path",{d:"M3.04236 12.3027H4.18396V13.3008C4.18396 14.8525 5.03845 15.7002 6.59705 15.7002H13.6244C15.183 15.7002 16.0375 14.8525 16.0375 13.3008V6.24609C16.0375 4.69434 15.183 3.84668 13.6244 3.84668H12.4828V2.8418C12.4828 1.29688 11.6283 0.442383 10.0697 0.442383H3.04236C1.48376 0.442383 0.629272 1.29004 0.629272 2.8418V9.90332C0.629272 11.4551 1.48376 12.3027 3.04236 12.3027ZM3.23376 10.5391C2.68689 10.5391 2.39294 10.2656 2.39294 9.68457V3.06055C2.39294 2.47949 2.68689 2.21289 3.23376 2.21289H9.8783C10.4252 2.21289 10.7191 2.47949 10.7191 3.06055V3.84668H6.59705C5.03845 3.84668 4.18396 4.69434 4.18396 6.24609V10.5391H3.23376ZM6.78845 13.9365C6.24158 13.9365 5.94763 13.6699 5.94763 13.0889V6.45801C5.94763 5.87695 6.24158 5.61035 6.78845 5.61035H13.433C13.9799 5.61035 14.2738 5.87695 14.2738 6.45801V13.0889C14.2738 13.6699 13.9799 13.9365 13.433 13.9365H6.78845Z",fill:"currentColor"})]}),b=()=>e.jsxs("svg",{fill:"none",height:"13",viewBox:"0 0 13 13",width:"13",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("title",{children:"Copied"}),e.jsx("path",{d:"M4.94568 12.2646C5.41052 12.2646 5.77283 12.0869 6.01892 11.7109L12.39 1.96973C12.5677 1.69629 12.6429 1.44336 12.6429 1.2041C12.6429 0.561523 12.1644 0.0966797 11.5082 0.0966797C11.057 0.0966797 10.7767 0.260742 10.5033 0.691406L4.9115 9.50977L2.07458 5.98926C1.82166 5.68848 1.54822 5.55176 1.16541 5.55176C0.502319 5.55176 0.0238037 6.02344 0.0238037 6.66602C0.0238037 6.95312 0.112671 7.20605 0.358765 7.48633L3.88611 11.7588C4.18005 12.1074 4.50818 12.2646 4.94568 12.2646Z",fill:"currentColor"})]}),h=()=>e.jsxs("svg",{fill:"none",height:"16",viewBox:"0 0 18 16",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("title",{children:"Disconnect"}),e.jsx("path",{d:"M2.67834 15.5908H9.99963C11.5514 15.5908 12.399 14.7432 12.399 13.1777V10.2656H10.6354V12.9863C10.6354 13.5332 10.3688 13.8271 9.78772 13.8271H2.89026C2.3092 13.8271 2.0426 13.5332 2.0426 12.9863V3.15625C2.0426 2.60254 2.3092 2.30859 2.89026 2.30859H9.78772C10.3688 2.30859 10.6354 2.60254 10.6354 3.15625V5.89746H12.399V2.95801C12.399 1.39941 11.5514 0.544922 9.99963 0.544922H2.67834C1.12659 0.544922 0.278931 1.39941 0.278931 2.95801V13.1777C0.278931 14.7432 1.12659 15.5908 2.67834 15.5908ZM7.43616 8.85059H14.0875L15.0924 8.78906L14.566 9.14453L13.6842 9.96484C13.5406 10.1016 13.4586 10.2861 13.4586 10.4844C13.4586 10.8398 13.7321 11.168 14.1217 11.168C14.3199 11.168 14.4635 11.0928 14.6002 10.9561L16.7809 8.68652C16.986 8.48145 17.0543 8.27637 17.0543 8.06445C17.0543 7.85254 16.986 7.64746 16.7809 7.43555L14.6002 5.17285C14.4635 5.03613 14.3199 4.9541 14.1217 4.9541C13.7321 4.9541 13.4586 5.27539 13.4586 5.6377C13.4586 5.83594 13.5406 6.02734 13.6842 6.15723L14.566 6.98438L15.0924 7.33984L14.0875 7.27148H7.43616C7.01917 7.27148 6.65686 7.62012 6.65686 8.06445C6.65686 8.50195 7.01917 8.85059 7.43616 8.85059Z",fill:"currentColor"})]});var y=function(){var a=document.getSelection();if(!a.rangeCount)return function(){};for(var t=document.activeElement,o=[],c=0;c<a.rangeCount;c++)o.push(a.getRangeAt(c));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return a.removeAllRanges(),function(){a.type==="Caret"&&a.removeAllRanges(),a.rangeCount||o.forEach(function(s){a.addRange(s)}),t&&t.focus()}},w=y,x={"text/plain":"Text","text/html":"Url",default:"Text"},j="Copy to clipboard: #{key}, Enter";function _(a){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return a.replace(/#{\s*key\s*}/g,t)}function D(a,t){var o,c,s,d,l,n,u=!1;t||(t={}),o=t.debug||!1;try{s=w(),d=document.createRange(),l=document.getSelection(),n=document.createElement("span"),n.textContent=a,n.ariaHidden="true",n.style.all="unset",n.style.position="fixed",n.style.top=0,n.style.clip="rect(0, 0, 0, 0)",n.style.whiteSpace="pre",n.style.webkitUserSelect="text",n.style.MozUserSelect="text",n.style.msUserSelect="text",n.style.userSelect="text",n.addEventListener("copy",function(i){if(i.stopPropagation(),t.format)if(i.preventDefault(),typeof i.clipboardData>"u"){o&&console.warn("unable to use e.clipboardData"),o&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var p=x[t.format]||x.default;window.clipboardData.setData(p,a)}else i.clipboardData.clearData(),i.clipboardData.setData(t.format,a);t.onCopy&&(i.preventDefault(),t.onCopy(i.clipboardData))}),document.body.appendChild(n),d.selectNodeContents(n),l.addRange(d);var f=document.execCommand("copy");if(!f)throw new Error("copy command was unsuccessful");u=!0}catch(i){o&&console.error("unable to copy using execCommand: ",i),o&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",a),t.onCopy&&t.onCopy(window.clipboardData),u=!0}catch(p){o&&console.error("unable to copy using clipboardData: ",p),o&&console.error("falling back to prompt"),c=_("message"in t?t.message:j),window.prompt(c,a)}}finally{l&&(typeof l.removeRange=="function"?l.removeRange(d):l.removeAllRanges()),n&&document.body.removeChild(n),s()}return u}var H=D;const I=C.getDefaultExportFromCjs(H),S="_container_119qo_1",T="_avatarBox_119qo_7",M="_avatar_119qo_7",N="_accountInfo_119qo_19",V="_address_119qo_23",q="_btnGroup_119qo_34",E="_button_119qo_43",k="_btnIcon_119qo_57",L="_btnText_119qo_60",r={container:S,avatarBox:T,avatar:M,accountInfo:N,address:V,btnGroup:q,button:E,btnIcon:k,btnText:L},A=()=>{const{t:a}=C.useTranslation(),{walletAddress:t,avatar:o,setAvatar:c,currentConnector:s}=C.useWalletKit(),[d,l]=m.useState(!1),{closeWalletInfoModal:n,isShowWalletInfoModal:u}=C.useModalStore();m.useEffect(()=>{s!=null&&s.icon&&c({icon:s.icon})},[s==null?void 0:s.icon,c]);const f=()=>{n()};return e.jsxs(g.Modal,{isOpen:u,onClose:f,children:[e.jsx(g.ModalHeader,{onClose:f}),e.jsxs("div",{className:r.container,children:[e.jsx("div",{className:r.avatarBox,children:e.jsx("div",{className:r.avatar,style:{backgroundColor:(o==null?void 0:o.bg)||"transparent",backgroundImage:o!=null&&o.icon?`url(${o.icon})`:void 0,backgroundSize:"cover",backgroundPosition:"center"},children:o!=null&&o.icon?null:o==null?void 0:o.text})}),e.jsx("div",{className:r.accountInfo,children:e.jsx("div",{className:r.address,children:C.formatAddress(t)})}),e.jsxs("div",{className:r.btnGroup,children:[e.jsxs("div",{className:r.button,onClick:()=>{I(t),!d&&(l(!0),setTimeout(()=>{l(!1)},1e3))},children:[e.jsx("div",{className:r.btnIcon,children:d?e.jsx(b,{}):e.jsx(v,{})}),e.jsx("div",{className:r.btnText,children:a(d?"copied":"copyAddress")})]}),e.jsxs("div",{className:r.button,onClick:()=>{s==null||s.disconnect(),n()},children:[e.jsx("div",{className:r.btnIcon,children:e.jsx(h,{})}),e.jsx("div",{className:r.btnText,children:a("disConnect")})]})]})]})]})};exports.default=A;
|
|
@@ -2,7 +2,7 @@ import "./index.css";
|
|
|
2
2
|
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import { useContext as E, useMemo as g, useState as B, useEffect as O } from "react";
|
|
4
4
|
import { M as A } from "./index-D5CDP-Ja.mjs";
|
|
5
|
-
import { a as v, u as R, k as G, l as $, o as k, c as j, b as K, p as S, q as P, t as D, U as H } from "./index-
|
|
5
|
+
import { a as v, u as R, k as G, l as $, o as k, c as j, b as K, p as S, q as P, t as D, U as H } from "./index-C7kS8da-.mjs";
|
|
6
6
|
import { n as I } from "./walletName-BwayBopz.mjs";
|
|
7
7
|
const z = "_modalContent_1q71y_1", F = "_body_1q71y_5", J = "_section_1q71y_11", Q = "_title_1q71y_17", V = "_walletGrid_1q71y_25", X = "_footer_1q71y_51", Y = "_poweredBy_1q71y_55", Z = "_connecting_1q71y_62", ee = "_content_1q71y_70", te = "_walletIcon_1q71y_77", ne = "_iconContainer_1q71y_80", se = "_status_1q71y_98", le = "_subtitle_1q71y_111", ae = "_spinner_1q71y_119", oe = "_inner_1q71y_127", l = {
|
|
8
8
|
modalContent: z,
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as t, H as s, f as o, a as r, E as l, z as n, S as c, T as p, A as u, W as i, c as m, D as C, F as T, B as W, b as d, G as S, I as g, m as h, r as w, K as k, J as v, u as K, w as B } from "./index-
|
|
1
|
+
import { C as t, H as s, f as o, a as r, E as l, z as n, S as c, T as p, A as u, W as i, c as m, D as C, F as T, B as W, b as d, G as S, I as g, m as h, r as w, K as k, J as v, u as K, w as B } from "./index-C7kS8da-.mjs";
|
|
2
2
|
export {
|
|
3
3
|
t as ChainType,
|
|
4
4
|
s as ConnectButton,
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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-BjW6H6Wf.js");exports.ChainType=e.ChainType;exports.ConnectButton=e.ConnectButton;exports.ConnectStatus=e.ConnectStatus;exports.ConnectorType=e.ConnectorType;exports.EvmNetworks=e.EvmNetworks;exports.SupportWallet=e.SupportWallet;exports.SupportWallets=e.SupportWallets;exports.ThemeToggle=e.ThemeToggle;exports.TronNetworks=e.TronNetworks;exports.WalletKitProvider=e.WalletKitProvider;exports.checkIsMobile=e.checkIsMobile;exports.createConnector=e.createConnector;exports.createEvmConnectors=e.createEvmConnectors;exports.decodePhantomDeepLink=e.decodePhantomDeepLink;exports.detectWalletBrowser=e.detectWalletBrowser;exports.evmSilentConnect=e.evmSilentConnect;exports.getWalletKit=e.getWalletKit;exports.multicallRpc=e.multicallRpc;exports.readContractRpc=e.readContractRpc;exports.supportedLanguages=e.supportedLanguages;exports.useTheme=e.useTheme;exports.useWalletKit=e.useWalletKit;exports.walletHelperStore=e.walletHelperStore;
|
package/dist/index.umd.js
CHANGED
|
@@ -12526,6 +12526,35 @@
|
|
|
12526
12526
|
return [];
|
|
12527
12527
|
}
|
|
12528
12528
|
}
|
|
12529
|
+
var ChainIds$1 = /* @__PURE__ */ ((ChainIds2) => {
|
|
12530
|
+
ChainIds2["mainnet"] = "0x2b6653dc";
|
|
12531
|
+
ChainIds2["nile"] = "0xcd8690dc";
|
|
12532
|
+
ChainIds2["shasta"] = "0x94a9059e";
|
|
12533
|
+
return ChainIds2;
|
|
12534
|
+
})(ChainIds$1 || {});
|
|
12535
|
+
const toTronSwitchChainId = (chainId) => {
|
|
12536
|
+
const hex = typeof chainId === "string" && chainId.startsWith("0x") ? chainId : `0x${Number(chainId).toString(16)}`;
|
|
12537
|
+
return Object.values(ChainIds$1).find((id) => id.toLowerCase() === hex.toLowerCase()) ?? hex;
|
|
12538
|
+
};
|
|
12539
|
+
const toTronNumericChainId = (chainId) => {
|
|
12540
|
+
if (typeof chainId === "string" && chainId.startsWith("0x")) {
|
|
12541
|
+
return Number.parseInt(chainId, 16);
|
|
12542
|
+
}
|
|
12543
|
+
return Number(chainId);
|
|
12544
|
+
};
|
|
12545
|
+
const resolveTronSwitchRequest = (provider) => {
|
|
12546
|
+
var _a, _b;
|
|
12547
|
+
if (typeof (provider == null ? void 0 : provider.request) === "function") {
|
|
12548
|
+
return provider.request.bind(provider);
|
|
12549
|
+
}
|
|
12550
|
+
if (typeof window !== "undefined" && typeof ((_a = window.tron) == null ? void 0 : _a.request) === "function") {
|
|
12551
|
+
return window.tron.request.bind(window.tron);
|
|
12552
|
+
}
|
|
12553
|
+
if (typeof window !== "undefined" && typeof ((_b = window.tronLink) == null ? void 0 : _b.request) === "function") {
|
|
12554
|
+
return window.tronLink.request.bind(window.tronLink);
|
|
12555
|
+
}
|
|
12556
|
+
return null;
|
|
12557
|
+
};
|
|
12529
12558
|
class TronConnector extends BaseConnector {
|
|
12530
12559
|
constructor(info, provider) {
|
|
12531
12560
|
super(info, provider);
|
|
@@ -12728,7 +12757,32 @@
|
|
|
12728
12757
|
}
|
|
12729
12758
|
};
|
|
12730
12759
|
this.switchNetwork = async (chainId) => {
|
|
12731
|
-
this.
|
|
12760
|
+
const provider2 = await this.getProvider();
|
|
12761
|
+
const hexChainId = toTronSwitchChainId(chainId);
|
|
12762
|
+
const numericChainId = toTronNumericChainId(chainId);
|
|
12763
|
+
const request = resolveTronSwitchRequest(provider2);
|
|
12764
|
+
if (!request) {
|
|
12765
|
+
this.store.getState().setCurrentNetwork(numericChainId);
|
|
12766
|
+
return;
|
|
12767
|
+
}
|
|
12768
|
+
try {
|
|
12769
|
+
await request({
|
|
12770
|
+
method: "wallet_switchEthereumChain",
|
|
12771
|
+
params: [{ chainId: hexChainId }]
|
|
12772
|
+
});
|
|
12773
|
+
this.store.getState().setCurrentNetwork(numericChainId);
|
|
12774
|
+
} catch (err) {
|
|
12775
|
+
if ((err == null ? void 0 : err.code) === 4200) {
|
|
12776
|
+
this.store.getState().setCurrentNetwork(numericChainId);
|
|
12777
|
+
return;
|
|
12778
|
+
}
|
|
12779
|
+
if ((err == null ? void 0 : err.code) === UserRejectedRequestError.code) {
|
|
12780
|
+
throw new UserRejectedRequestError(
|
|
12781
|
+
err instanceof Error ? err : new Error((err == null ? void 0 : err.message) || "User rejected the request.")
|
|
12782
|
+
);
|
|
12783
|
+
}
|
|
12784
|
+
throw err;
|
|
12785
|
+
}
|
|
12732
12786
|
};
|
|
12733
12787
|
}
|
|
12734
12788
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-BjW6H6Wf.js"),c=require("./createConnectors-BpxUcDLh.js"),a=async(e,o)=>{const t=(await c.createConnector(n.ChainType.EVM)).find(r=>r.name.replace(" ","_")===e);if(!t)throw new Error(`Connector not found for wallet: ${e}`);n.walletHelperStore.getState().setCurrentNetwork(o),t.connect()};exports.default=a;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as r, w as c } from "./index-
|
|
2
|
-
import { c as a } from "./createConnectors-
|
|
1
|
+
import { C as r, w as c } from "./index-C7kS8da-.mjs";
|
|
2
|
+
import { c as a } from "./createConnectors-B-vlchFu.mjs";
|
|
3
3
|
const C = async (e, n) => {
|
|
4
4
|
const t = (await a(r.EVM)).find((o) => o.name.replace(" ", "_") === e);
|
|
5
5
|
if (!t)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-BjW6H6Wf.js"),i=require("./createConnectors-BpxUcDLh.js"),c=()=>{if(typeof window>"u")return null;const e=window.bitkeep,r=(e==null?void 0:e.tronLink)??(e==null?void 0:e.tron)??null;return r?r.tronWeb||!(e!=null&&e.tronWeb)?r:new Proxy(r,{get(n,t,u){return t==="tronWeb"?e.tronWeb:Reflect.get(n,t,u)}}):null};class s extends i.TronConnector{constructor(r){const n=c();super(r,n),this.connectorType=n?o.ConnectorType.Installed:o.ConnectorType.More}}exports.default=s;exports.getBitgetTronProvider=c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-BjW6H6Wf.js"),s=require("./createConnectors-BpxUcDLh.js");var t=(e=>(e.mainnet="0x2b6653dc",e.nile="0xcd8690dc",e.shasta="0x94a9059e",e))(t||{});class a extends s.TronConnector{constructor(c){var n,o;const i=(n=window.okxwallet)==null?void 0:n.tronLink;super(c,(o=window.okxwallet)==null?void 0:o.tronLink),this.connectorType=i?r.ConnectorType.Installed:r.ConnectorType.More}}exports.ChainIds=t;exports.default=a;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as t } from "./index-
|
|
2
|
-
import { T as c } from "./createConnectors-
|
|
1
|
+
import { a as t } from "./index-C7kS8da-.mjs";
|
|
2
|
+
import { T as c } from "./createConnectors-B-vlchFu.mjs";
|
|
3
3
|
var s = /* @__PURE__ */ ((o) => (o.mainnet = "0x2b6653dc", o.nile = "0xcd8690dc", o.shasta = "0x94a9059e", o))(s || {});
|
|
4
4
|
class d extends c {
|
|
5
5
|
constructor(e) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as e } from "./index-
|
|
2
|
-
import { T as u } from "./createConnectors-
|
|
1
|
+
import { a as e } from "./index-C7kS8da-.mjs";
|
|
2
|
+
import { T as u } from "./createConnectors-B-vlchFu.mjs";
|
|
3
3
|
const c = () => {
|
|
4
4
|
if (typeof window > "u") return null;
|
|
5
5
|
const r = window.bitkeep, n = (r == null ? void 0 : r.tronLink) ?? (r == null ? void 0 : r.tron) ?? null;
|