@dodoex/wallet-web3 0.5.2 → 0.5.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/{alchemy-provider-5870b6fa-1d4efe84.js → alchemy-provider-5870b6fa-1cd0b182.js} +1 -1
- package/dist/{alchemy-websocket-provider-213da986-d5cf3f6a.js → alchemy-websocket-provider-213da986-a1e43b83.js} +1 -1
- package/dist/{blocto-25c5c258.js → blocto-203f9ec1.js} +1 -1
- package/dist/{ccip-3ac23092.js → ccip-f118a914.js} +1 -1
- package/dist/cjs/{alchemy-provider-5870b6fa-5cbe3e31.cjs → alchemy-provider-5870b6fa-8031f5e9.cjs} +1 -1
- package/dist/cjs/{alchemy-websocket-provider-213da986-7065cb3f.cjs → alchemy-websocket-provider-213da986-ffd85fbf.cjs} +1 -1
- package/dist/cjs/{blocto-0c1d92db.cjs → blocto-fd5fce1b.cjs} +1 -1
- package/dist/cjs/{ccip-fb501af5.cjs → ccip-5821aa76.cjs} +1 -1
- package/dist/cjs/{draggabilly-1a578eed.cjs → draggabilly-534a06c4.cjs} +1 -1
- package/dist/cjs/id-20f6ce8c.cjs +1 -0
- package/dist/cjs/{index-b13bd062.cjs → index-11beefa2.cjs} +1 -1
- package/dist/cjs/{index-75b128c0.cjs → index-1cafa7ef.cjs} +1 -1
- package/dist/cjs/{index-803e4f67.cjs → index-2914fc1b.cjs} +1 -1
- package/dist/cjs/{index-a4906ebd.cjs → index-3c2f7ecb.cjs} +2 -2
- package/dist/cjs/{index-e103a51b.cjs → index-3e679370.cjs} +4 -4
- package/dist/cjs/{index-9e59c9f8.cjs → index-7d28ccd9.cjs} +1 -1
- package/dist/cjs/{index-49dfe63f.cjs → index-83d6612a.cjs} +1 -1
- package/dist/cjs/{index-64ab7e4d.cjs → index-8810c52e.cjs} +1 -1
- package/dist/cjs/{index-d78c1ab4.cjs → index-da0f0dc4.cjs} +1 -1
- package/dist/cjs/{index-1a823dfc.cjs → index-fe6d443a.cjs} +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/{index.es-cfbd4f15.cjs → index.es-1000eb22.cjs} +1 -1
- package/dist/cjs/{interface-ef9016d3.cjs → interface-d2286c23.cjs} +1 -1
- package/dist/cjs/{lib-typedarrays-22e0cfee.cjs → lib-typedarrays-f0840aa6.cjs} +1 -1
- package/dist/cjs/{portis-265f03df.cjs → portis-166a6955.cjs} +1 -1
- package/dist/cjs/{rainbow-48ed900d.cjs → rainbow-9e206ee7.cjs} +1 -1
- package/dist/cjs/{sha224-ba7123a0.cjs → sha224-bc65dfff.cjs} +1 -1
- package/dist/cjs/{sha256-00be81ad.cjs → sha256-0636f669.cjs} +1 -1
- package/dist/cjs/{typed-data-f167a2be.cjs → typed-data-8eaefdb5.cjs} +1 -1
- package/dist/cjs/{uAuth-c82eed54.cjs → uAuth-081ad6fc.cjs} +1 -1
- package/dist/cjs/{walletConnect-68f635da.cjs → walletConnect-073ff8dd.cjs} +1 -1
- package/dist/cjs/{walletLink-77a9287f.cjs → walletLink-101917c2.cjs} +1 -1
- package/dist/{draggabilly-ed1ea22f.js → draggabilly-5d335a04.js} +1 -1
- package/dist/id-b1749683.js +1 -0
- package/dist/{index-61916df2.js → index-0bf8d237.js} +1 -1
- package/dist/{index-fe388941.js → index-1ecaf2fe.js} +1 -1
- package/dist/{index-7152dee7.js → index-327eea25.js} +1 -1
- package/dist/{index-ff33ebed.js → index-540337a5.js} +1 -1
- package/dist/{index-76297fe2.js → index-5732342d.js} +2 -2
- package/dist/{index-bf37e2d0.js → index-8ed7d553.js} +1 -1
- package/dist/{index-fc1b4c33.js → index-b5f5db3c.js} +6 -6
- package/dist/{index-113ad8f8.js → index-b8d0e86d.js} +1 -1
- package/dist/{index-91b1499d.js → index-bfa2119a.js} +1 -1
- package/dist/{index-9a6126a2.js → index-d59ad34c.js} +1 -1
- package/dist/{index.es-166481e0.js → index.es-5e0a68ed.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{interface-8965a045.js → interface-3f9d4a5c.js} +1 -1
- package/dist/{lib-typedarrays-c5e5759f.js → lib-typedarrays-53c6b915.js} +1 -1
- package/dist/{portis-174647af.js → portis-9bab3be5.js} +1 -1
- package/dist/{rainbow-04d94d50.js → rainbow-5e0452af.js} +1 -1
- package/dist/sha224-204aec1e.js +1 -0
- package/dist/{sha256-b7dd8a5a.js → sha256-940f00e6.js} +1 -1
- package/dist/{typed-data-d3d4124b.js → typed-data-af5b29c1.js} +1 -1
- package/dist/{uAuth-ed5c6c9d.js → uAuth-4d80b0ec.js} +1 -1
- package/dist/{walletConnect-cd58a591.js → walletConnect-ae596280.js} +1 -1
- package/dist/{walletLink-874673f7.js → walletLink-0dd5c1e9.js} +1 -1
- package/package.json +2 -2
- package/dist/cjs/id-833d54a1.cjs +0 -1
- package/dist/id-3ec4567b.js +0 -1
- package/dist/sha224-76431e37.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as t,X as e,Y as n,Z as r,A as s}from"./index-
|
|
1
|
+
import{D as t,X as e,Y as n,Z as r,A as s}from"./index-b5f5db3c.js";import{getAddress as o}from"@ethersproject/address";import{Signer as a}from"@ethersproject/abstract-signer";import{UniPassPopupSDK as i}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 p extends a{constructor(t,e,n,r){super(),this._address=n,this._index=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.")}async getAddress(){return Promise.resolve(o(this._address))}async signMessage(t){if(!this.upWallet)throw new Error(`address unknown '${t}'`);return await this.upWallet.signMessage(t,{isEIP191Prefix:!0,onAuthChain:!0})}async _signTypedData(t,e,n){throw new Error("Method not implemented.")}async signTransaction(t){if(!this.upWallet)throw new Error(`address unknown '${t.from}'`);return this.upWallet.sendTransaction({from:t.from,to:t.to,value:t.value,data:t.data})}async sendTransaction(t){if(!this.upWallet)throw new Error(`address unknown '${t.from}'`);return{hash:await this.upWallet.sendTransaction({from:t.from,to:t.to,value:t.value,data:t.data}),from:t.from}}connect(t){return new p(t??this.provider,this.upWallet,this._address,this._index)}connectUnchecked(){return new p(this.provider,this.upWallet,this._address,this._index)}}async function d(s){const a=s.JsonRpcProvider||t,d=s.chainId??1;let h=s.rpcUrl??s.rpc?.[d];const l=new class extends a{constructor(t,o){super(t,o),this.updateUpWalletConfig=t=>{const r=s.rpc?.[t];if(!e.includes(t))throw new Error(`chainId ${t} not supported`);if(this.upWallet.updateConfig({chainType:n(t),nodeRPC:r,appSettings:{chain:n(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=r,this.emit("chainChanged",`0x${t.toString(16)}`),{result:!0}},this.rpcUrl=t,this.upWallet=new i({env:r(d),chainType:n(d),appSettings:{appIcon:s.appLogoUrl,appName:s.appName,chain:n(d)},rpcUrl:h,storageType:"sessionStorage"})}getSigner(){const t=this.upWallet.getAccount();return new p(l,this.upWallet,t?.address??"",0)}async connect(){const t=this.upWallet.getAccount();return t||await this.upWallet.login({email:false})}async disconnect(){await this.upWallet.logout()}async listAccounts(){const t=this.upWallet.getAccount();return t?.address?[t?.address]:[]}getAddress(){const t=this.upWallet.getAccount();return Promise.resolve(t?.address?o(t?.address):null)}}(h,d);return l}async function h(t,e){const n=await d(t);return n.on("connect",e.connect),n.on("disconnect",(t=>{e.disconnect(t),e.accountsChanged([])})),n.on("accountsChanged",e.accountsChanged),n.on("chainChanged",e.chainChanged),n.on("message",(({type:t,data:n})=>e.message(t,n))),await n.connect(),n}function l(){s.getState().provider?.disconnect()}function u(t){return s.getState().provider?.upWallet?.signTypedData(t)}function m(t){const n=t.addChainParameters.chainId,r="string"==typeof n&&n?.startsWith("0x")?parseInt(n,16):Number(n);if(!e.includes(r))throw new Error(`chainId ${r} not supported`);return s.getState().provider?.updateUpWalletConfig(r)}export{d as createProvider,h as default,l as disconnectWallet,u as signTypedData,m as switchChain};
|