@dodoex/wallet-web3 0.0.64 → 0.0.66
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/LICENSE +674 -674
- package/dist/{alchemy-provider-5870b6fa-457cd6bb.js → alchemy-provider-5870b6fa-18c81351.js} +1 -1
- package/dist/{alchemy-websocket-provider-213da986-746c5eca.js → alchemy-websocket-provider-213da986-4e051507.js} +1 -1
- package/dist/{blocto-ee2a838e.js → blocto-b790d079.js} +1 -1
- package/dist/{ccip-c55250b6.js → ccip-1b50a4b6.js} +1 -1
- package/dist/cjs/{alchemy-provider-5870b6fa-1de644f2.cjs → alchemy-provider-5870b6fa-757dd405.cjs} +1 -1
- package/dist/cjs/{alchemy-websocket-provider-213da986-e220e8bd.cjs → alchemy-websocket-provider-213da986-63a14c19.cjs} +1 -1
- package/dist/cjs/{blocto-0a1f8c82.cjs → blocto-6ad74a7c.cjs} +1 -1
- package/dist/cjs/{ccip-6d742628.cjs → ccip-29a0c692.cjs} +1 -1
- package/dist/cjs/{draggabilly-8dcddcae.cjs → draggabilly-1db23d29.cjs} +1 -1
- package/dist/cjs/id-18175452.cjs +1 -0
- package/dist/cjs/{index-3d1bc02e.cjs → index-0da0f3e1.cjs} +1 -1
- package/dist/cjs/{index-fed98538.cjs → index-10420800.cjs} +1 -1
- package/dist/cjs/{index-dcff3fbf.cjs → index-32fdf8e5.cjs} +1 -1
- package/dist/cjs/{index-78ce40b2.cjs → index-42ebd156.cjs} +2 -2
- package/dist/cjs/{index-91f65724.cjs → index-43289a57.cjs} +4 -4
- package/dist/cjs/{index-b10f5546.cjs → index-5a6afdc1.cjs} +2 -2
- package/dist/cjs/{index-b0f51d7d.cjs → index-7ee26fab.cjs} +1 -1
- package/dist/cjs/{index-db3fa985.cjs → index-8b646c2c.cjs} +1 -1
- package/dist/cjs/{index-fe9fcb08.cjs → index-ec75bd64.cjs} +1 -1
- package/dist/cjs/{index-6cb4d019.cjs → index-eeda7d0a.cjs} +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/{index.es-75a30b77.cjs → index.es-38733083.cjs} +1 -1
- package/dist/cjs/{interface-1412cfee.cjs → interface-78ed6726.cjs} +1 -1
- package/dist/cjs/{lib-typedarrays-45edc54c.cjs → lib-typedarrays-765e8073.cjs} +1 -1
- package/dist/cjs/{portis-9ac42c6a.cjs → portis-bbdb30f7.cjs} +1 -1
- package/dist/cjs/{provider-25d93a69.cjs → provider-214a541f.cjs} +1 -1
- package/dist/cjs/providers/connector/alchemy/index.d.ts +12 -8
- package/dist/cjs/providers/connector/alchemy/provider.d.ts +12 -8
- package/dist/cjs/providers/connector/index.d.ts +12 -8
- package/dist/cjs/providers/wallets/index.d.ts +2 -0
- package/dist/cjs/{rainbow-a04db469.cjs → rainbow-bdbbdf92.cjs} +1 -1
- package/dist/cjs/{sha224-2fadd06e.cjs → sha224-e35247b0.cjs} +1 -1
- package/dist/cjs/{sha256-9f8015ea.cjs → sha256-1da100f2.cjs} +1 -1
- package/dist/cjs/{typed-data-dde4a66f.cjs → typed-data-ac450224.cjs} +1 -1
- package/dist/cjs/{uAuth-ea317035.cjs → uAuth-fb59a769.cjs} +1 -1
- package/dist/cjs/{walletConnect-15fc29df.cjs → walletConnect-e3be2b57.cjs} +1 -1
- package/dist/cjs/walletLink-0372cd75.cjs +3 -0
- package/dist/{draggabilly-e028ec41.js → draggabilly-e5894c14.js} +1 -1
- package/dist/id-68d53df0.js +1 -0
- package/dist/{index-af74b255.js → index-38803328.js} +2 -2
- package/dist/{index-5772df94.js → index-446c71f4.js} +4 -4
- package/dist/{index-239ddf05.js → index-730e4ec4.js} +1 -1
- package/dist/{index-7a5a2895.js → index-87c6229a.js} +1 -1
- package/dist/{index-fa8ae676.js → index-a42068f2.js} +1 -1
- package/dist/{index-1256acc9.js → index-afeddbec.js} +1 -1
- package/dist/{index-26ab1f42.js → index-b2d7f586.js} +2 -2
- package/dist/{index-b559a26e.js → index-bccf7498.js} +1 -1
- package/dist/{index-e9aacae8.js → index-c079cfa5.js} +1 -1
- package/dist/{index-de37a495.js → index-fd6b6765.js} +1 -1
- package/dist/{index.es-3b789bf9.js → index.es-77497000.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{interface-001cd30f.js → interface-789628fd.js} +1 -1
- package/dist/{lib-typedarrays-0f3d7cfd.js → lib-typedarrays-13c0d1d7.js} +1 -1
- package/dist/{portis-aa99a2cc.js → portis-85dc7ba5.js} +1 -1
- package/dist/{provider-ed732881.js → provider-b787ad38.js} +1 -1
- package/dist/providers/connector/alchemy/index.d.ts +12 -8
- package/dist/providers/connector/alchemy/provider.d.ts +12 -8
- package/dist/providers/connector/index.d.ts +12 -8
- package/dist/providers/wallets/index.d.ts +2 -0
- package/dist/{rainbow-1636f787.js → rainbow-e0ef719e.js} +1 -1
- package/dist/{sha224-3bdc932c.js → sha224-cac5c58b.js} +1 -1
- package/dist/{sha256-4da40dc5.js → sha256-8f491017.js} +1 -1
- package/dist/{typed-data-1847b6ed.js → typed-data-e7777a2c.js} +1 -1
- package/dist/{uAuth-d30d3c61.js → uAuth-2d4231df.js} +1 -1
- package/dist/{walletConnect-f307066d.js → walletConnect-e5320b71.js} +1 -1
- package/dist/walletLink-24205b0c.js +3 -0
- package/package.json +92 -92
- package/dist/cjs/id-a70f30cf.cjs +0 -1
- package/dist/cjs/walletLink-3ac9efad.cjs +0 -3
- package/dist/id-17eaf985.js +0 -1
- package/dist/walletLink-091917c3.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,D as e,Z as n,$ as r,a0 as o,C as i}from"./index-
|
|
1
|
+
import{_ as t,D as e,Z as n,$ as r,a0 as o,C as i}from"./index-446c71f4.js";import{getAddress as s}from"@ethersproject/address";import{Signer as a}from"@ethersproject/abstract-signer";import{UniPassPopupSDK as d}from"@unipasswallet/popup-sdk";import{defineReadOnly as c}from"@ethersproject/properties";import"@ethersproject/providers";import"zustand";import"@ethersproject/bytes";import"buffer";import"@ethersproject/abstract-provider";import"@ethersproject/contracts";import"events";import"@ethersproject/constants";import"@ethersproject/transactions";class l extends a{constructor(t,e,n,r){super(),this._address=n,this._index=null!=r?r:0,this.provider=t,this.upWallet=e}_legacySignMessage(t){throw new Error("Method not implemented.")}sendUncheckedTransaction(t){throw new Error("Method not implemented.")}unlock(t){throw new Error("Method not implemented.")}getAddress(){return t(this,void 0,void 0,(function*(){return Promise.resolve(s(this._address))}))}signMessage(e){return t(this,void 0,void 0,(function*(){if(!this.upWallet)throw new Error(`address unknown '${e}'`);return yield this.upWallet.signMessage(e,{isEIP191Prefix:!0,onAuthChain:!0})}))}_signTypedData(e,n,r){return t(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}signTransaction(e){return t(this,void 0,void 0,(function*(){if(!this.upWallet)throw new Error(`address unknown '${e.from}'`);return this.upWallet.sendTransaction({from:e.from,to:e.to,value:e.value,data:e.data})}))}sendTransaction(e){return t(this,void 0,void 0,(function*(){if(!this.upWallet)throw new Error(`address unknown '${e.from}'`);return{hash:yield this.upWallet.sendTransaction({from:e.from,to:e.to,value:e.value,data:e.data}),from:e.from}}))}connect(t){return new l(null!=t?t:this.provider,this.upWallet,this._address,this._index)}connectUnchecked(){return new l(this.provider,this.upWallet,this._address,this._index)}}function u(i){var a,u,p;return t(this,void 0,void 0,(function*(){const h=i.JsonRpcProvider||e,v=null!==(a=i.chainId)&&void 0!==a?a:1;let m=null!==(u=i.rpcUrl)&&void 0!==u?u:null===(p=i.rpc)||void 0===p?void 0:p[v];const f=new class extends h{constructor(t,e){super(t,e),this.updateUpWalletConfig=t=>{var e;const o=null===(e=i.rpc)||void 0===e?void 0:e[t];if(!n.includes(t))throw new Error(`chainId ${t} not supported`);if(this.upWallet.updateConfig({chainType:r(t),nodeRPC:o,appSettings:{chain:r(t)}}),"object"==typeof this.network)this.network.chainId=t;else{const e={chainId:t,name:"unknown"};c(this,"_network",e),this.emit("network",e,null)}return this.rpcUrl=o,this.emit("chainChanged",`0x${t.toString(16)}`),{result:!0}},this.rpcUrl=t,this.upWallet=new d({env:o(v),chainType:r(v),appSettings:{appIcon:i.appLogoUrl,appName:i.appName,chain:r(v)},rpcUrl:m,storageType:"sessionStorage"})}getSigner(){var t;const e=this.upWallet.getAccount();return new l(f,this.upWallet,null!==(t=null==e?void 0:e.address)&&void 0!==t?t:"",0)}connect(){return t(this,void 0,void 0,(function*(){const t=this.upWallet.getAccount();return t||(yield this.upWallet.login({email:false}))}))}disconnect(){return t(this,void 0,void 0,(function*(){yield this.upWallet.logout()}))}listAccounts(){return t(this,void 0,void 0,(function*(){const t=this.upWallet.getAccount();return(null==t?void 0:t.address)?[null==t?void 0:t.address]:[]}))}getAddress(){const t=this.upWallet.getAccount();return Promise.resolve((null==t?void 0:t.address)?s(null==t?void 0:t.address):null)}}(m,v);return f}))}function p(e,n){return t(this,void 0,void 0,(function*(){const t=yield u(e);return t.on("connect",n.connect),t.on("disconnect",(t=>{n.disconnect(t),n.accountsChanged([])})),t.on("accountsChanged",n.accountsChanged),t.on("chainChanged",n.chainChanged),t.on("message",(({type:t,data:e})=>n.message(t,e))),yield t.connect(),t}))}function h(){var t;null===(t=i.getState().provider)||void 0===t||t.disconnect()}function v(t){var e,n;return null===(n=null===(e=i.getState().provider)||void 0===e?void 0:e.upWallet)||void 0===n?void 0:n.signTypedData(t)}function m(t){var e;const r=t.addChainParameters.chainId,o="string"==typeof r&&(null==r?void 0:r.startsWith("0x"))?parseInt(r,16):Number(r);if(!n.includes(o))throw new Error(`chainId ${o} not supported`);return null===(e=i.getState().provider)||void 0===e?void 0:e.updateUpWalletConfig(o)}export{u as createProvider,p as default,h as disconnectWallet,v as signTypedData,m as switchChain};
|