@dodoex/wallet-web3 0.0.46 → 0.0.48-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{alchemy-provider-5870b6fa-05a9cdd2.js → alchemy-provider-5870b6fa-209ffeff.js} +1 -1
- package/dist/{alchemy-websocket-provider-213da986-8723808d.js → alchemy-websocket-provider-213da986-5e96f26c.js} +1 -1
- package/dist/{blocto-fc8c4e15.js → blocto-c808a5bd.js} +1 -1
- package/dist/{ccip-db316124.js → ccip-cd940fd7.js} +1 -1
- package/dist/cjs/{alchemy-provider-5870b6fa-353f58d4.cjs → alchemy-provider-5870b6fa-2c292be1.cjs} +1 -1
- package/dist/cjs/{alchemy-websocket-provider-213da986-6be63beb.cjs → alchemy-websocket-provider-213da986-7450178b.cjs} +1 -1
- package/dist/cjs/{blocto-1487010d.cjs → blocto-84722daf.cjs} +1 -1
- package/dist/cjs/{ccip-86fad01a.cjs → ccip-e30aa969.cjs} +1 -1
- package/dist/cjs/{draggabilly-dbda92fc.cjs → draggabilly-ee2bcde6.cjs} +1 -1
- package/dist/cjs/id-57d29fcf.cjs +1 -0
- package/dist/cjs/{index-7b4b01e7.cjs → index-0f10c270.cjs} +1 -1
- package/dist/cjs/{index-0ff5caa4.cjs → index-18ee01ee.cjs} +5 -5
- package/dist/cjs/{index-ec1311cb.cjs → index-47e304f2.cjs} +1 -1
- package/dist/cjs/{index-a08c7a09.cjs → index-5237d39f.cjs} +1 -1
- package/dist/cjs/{index-1955682d.cjs → index-5316cc22.cjs} +1 -1
- package/dist/cjs/{index-238460b8.cjs → index-63d597da.cjs} +1 -1
- package/dist/cjs/{index-2658257b.cjs → index-7149ce6d.cjs} +1 -1
- package/dist/cjs/{index-0428a136.cjs → index-8993648b.cjs} +2 -2
- package/dist/cjs/{index-fa794601.cjs → index-e3f50dec.cjs} +1 -1
- package/dist/cjs/{index-7e53e3db.cjs → index-ebf77d91.cjs} +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/{index.es-c45228af.cjs → index.es-fb7f947d.cjs} +1 -1
- package/dist/cjs/{interface-ef646a1d.cjs → interface-d026e725.cjs} +1 -1
- package/dist/cjs/{lib-typedarrays-5bb7adf8.cjs → lib-typedarrays-a8d915af.cjs} +1 -1
- package/dist/cjs/{portis-06903de8.cjs → portis-28eaaecf.cjs} +1 -1
- package/dist/cjs/{provider-0c6e6854.cjs → provider-a496b70d.cjs} +1 -1
- package/dist/cjs/providers/wallets/types.d.ts +2 -1
- package/dist/cjs/{rainbow-87f22860.cjs → rainbow-4ef7d8bf.cjs} +1 -1
- package/dist/cjs/sha224-3b7493f1.cjs +1 -0
- package/dist/cjs/{sha256-e3a9dcdd.cjs → sha256-03a63d94.cjs} +1 -1
- package/dist/cjs/{typed-data-4152d905.cjs → typed-data-157ba7a1.cjs} +1 -1
- package/dist/cjs/{uAuth-3cb99d69.cjs → uAuth-f33646d1.cjs} +1 -1
- package/dist/cjs/{walletConnect-ac861534.cjs → walletConnect-2b6076fe.cjs} +1 -1
- package/dist/cjs/{walletLink-70b86c1c.cjs → walletLink-a8555d28.cjs} +1 -1
- package/dist/{draggabilly-fb848e72.js → draggabilly-c64f5909.js} +1 -1
- package/dist/id-ede4f910.js +1 -0
- package/dist/{index-e0a0ecc8.js → index-0d6d555e.js} +1 -1
- package/dist/{index-190b2494.js → index-2356f7c1.js} +1 -1
- package/dist/{index-793d1043.js → index-36dcaa63.js} +1 -1
- package/dist/{index-2d8065f9.js → index-5cf3a9f6.js} +1 -1
- package/dist/{index-b3a7c5c1.js → index-7a322277.js} +1 -1
- package/dist/{index-7d062529.js → index-7cfc7caf.js} +1 -1
- package/dist/{index-99b239d4.js → index-84619d88.js} +1 -1
- package/dist/{index-c7b1a2e2.js → index-a0fc2c21.js} +2 -2
- package/dist/{index-fceb4f0a.js → index-a6332ebf.js} +1 -1
- package/dist/{index-d8f06534.js → index-daf53842.js} +6 -6
- package/dist/{index.es-d6b8fc7b.js → index.es-a24617b0.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{interface-04817156.js → interface-d3755be8.js} +1 -1
- package/dist/{lib-typedarrays-e44dffcb.js → lib-typedarrays-6dc3eede.js} +1 -1
- package/dist/{portis-d88b128e.js → portis-ce66f41f.js} +1 -1
- package/dist/{provider-caa6414a.js → provider-8d0344f2.js} +1 -1
- package/dist/providers/wallets/types.d.ts +2 -1
- package/dist/{rainbow-910fd19a.js → rainbow-c9c4cae8.js} +1 -1
- package/dist/sha224-80433535.js +1 -0
- package/dist/{sha256-6ef338e4.js → sha256-b07752d0.js} +1 -1
- package/dist/{typed-data-8a8f361d.js → typed-data-9838246a.js} +1 -1
- package/dist/{uAuth-2500b8f4.js → uAuth-08c3a849.js} +1 -1
- package/dist/{walletConnect-348e7564.js → walletConnect-79aa9c2a.js} +1 -1
- package/dist/{walletLink-693b072e.js → walletLink-cece85da.js} +1 -1
- package/package.json +7 -7
- package/dist/cjs/id-c60155a0.cjs +0 -1
- package/dist/cjs/sha224-4dc93ade.cjs +0 -1
- package/dist/id-276355c6.js +0 -1
- package/dist/sha224-0c8ae4ed.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,D as e,W as n,X as r,Y as o,A as i}from"./index-
|
|
1
|
+
import{_ as t,D as e,W as n,X as r,Y as o,A as i}from"./index-daf53842.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 l}from"@ethersproject/properties";import"@ethersproject/providers";import"zustand";import"events";import"@ethersproject/bytes";import"buffer";import"@ethersproject/abstract-provider";import"@ethersproject/contracts";import"@ethersproject/constants";import"@ethersproject/transactions";class c 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 c(null!=t?t:this.provider,this.upWallet,this._address,this._index)}connectUnchecked(){return new c(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"};l(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 c(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};
|