@dodoex/wallet-web3 0.4.1-rise.1 → 0.4.1-rise.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-bb85ec6a.js → alchemy-provider-5870b6fa-570fb900.js} +1 -1
- package/dist/{alchemy-websocket-provider-213da986-d5400b6b.js → alchemy-websocket-provider-213da986-1ad39828.js} +1 -1
- package/dist/{blocto-eff0b92d.js → blocto-ea84b07b.js} +1 -1
- package/dist/{ccip-8aed4fac.js → ccip-048fb373.js} +1 -1
- package/dist/{ccip-f0761404.js → ccip-f947bfbd.js} +1 -1
- package/dist/cjs/{alchemy-provider-5870b6fa-382979ef.cjs → alchemy-provider-5870b6fa-01111266.cjs} +1 -1
- package/dist/cjs/{alchemy-websocket-provider-213da986-4ce7835d.cjs → alchemy-websocket-provider-213da986-0c46c782.cjs} +1 -1
- package/dist/cjs/{blocto-14fc9f60.cjs → blocto-31cc0795.cjs} +1 -1
- package/dist/cjs/{ccip-2b0ca597.cjs → ccip-8a67092e.cjs} +1 -1
- package/dist/cjs/{ccip-a1973409.cjs → ccip-c0f384e5.cjs} +1 -1
- package/dist/cjs/{draggabilly-5c6a8eb9.cjs → draggabilly-70d11c4b.cjs} +1 -1
- package/dist/cjs/id-e2d47157.cjs +1 -0
- package/dist/cjs/{index-6507817d.cjs → index-2c45a702.cjs} +2 -2
- package/dist/cjs/{index-34ad5f20.cjs → index-311ffb6a.cjs} +1 -1
- package/dist/cjs/{index-5d7df663.cjs → index-51e3d015.cjs} +1 -1
- package/dist/cjs/{index-ceef92b9.cjs → index-51f18aa8.cjs} +1 -1
- package/dist/cjs/{index-5ce728f7.cjs → index-55514ebb.cjs} +4 -4
- package/dist/cjs/{index-67de37f3.cjs → index-62bbcbb0.cjs} +1 -1
- package/dist/cjs/{index-ddd9f3b1.cjs → index-81b8833b.cjs} +1 -1
- package/dist/cjs/{index-d2b3e830.cjs → index-95925230.cjs} +2 -2
- package/dist/cjs/{index-418ee7e2.cjs → index-97939f39.cjs} +1 -1
- package/dist/cjs/{index-0eb47a78.cjs → index-d8ff3f61.cjs} +1 -1
- package/dist/cjs/{index-21073eb0.cjs → index-dc65b593.cjs} +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/{index.es-26c6ee46.cjs → index.es-e21474ac.cjs} +1 -1
- package/dist/cjs/{interface-301bc9d4.cjs → interface-5e811a80.cjs} +1 -1
- package/dist/cjs/{lib-typedarrays-e51b5d1f.cjs → lib-typedarrays-e49da842.cjs} +1 -1
- package/dist/cjs/{portis-6ae03796.cjs → portis-6a45b74b.cjs} +1 -1
- package/dist/cjs/{provider-aec1ee59.cjs → provider-12f16b79.cjs} +1 -1
- package/dist/cjs/{rainbow-920371d7.cjs → rainbow-aaa50248.cjs} +1 -1
- package/dist/cjs/{secp256k1-88c91671.cjs → secp256k1-709fdc9d.cjs} +1 -1
- package/dist/cjs/{sha224-44664857.cjs → sha224-050851ec.cjs} +1 -1
- package/dist/cjs/{sha256-559d937c.cjs → sha256-4d90777b.cjs} +1 -1
- package/dist/cjs/{typed-data-2ac6e5bb.cjs → typed-data-16674444.cjs} +1 -1
- package/dist/cjs/{uAuth-63dec270.cjs → uAuth-f12cfe8f.cjs} +1 -1
- package/dist/cjs/{walletConnect-1514d700.cjs → walletConnect-4c7041f4.cjs} +1 -1
- package/dist/cjs/{walletLink-5879a68b.cjs → walletLink-f5eeb358.cjs} +1 -1
- package/dist/{draggabilly-f3461ab1.js → draggabilly-8a6d2c56.js} +1 -1
- package/dist/id-498aa201.js +1 -0
- package/dist/{index-b6f1e8cc.js → index-047258c9.js} +2 -2
- package/dist/{index-c8e0cbe6.js → index-2f6b2a4c.js} +1 -1
- package/dist/{index-31a37014.js → index-368ae3a5.js} +2 -2
- package/dist/{index-ad6d7603.js → index-48f958c3.js} +1 -1
- package/dist/{index-c836d1b2.js → index-53533375.js} +4 -4
- package/dist/{index-4b6c652e.js → index-62c0e8bd.js} +1 -1
- package/dist/{index-14f309d2.js → index-64fa3e39.js} +1 -1
- package/dist/{index-609bf40c.js → index-683e8af1.js} +1 -1
- package/dist/{index-e01611dd.js → index-71de575b.js} +1 -1
- package/dist/{index-fff9fb0c.js → index-e557fe13.js} +2 -2
- package/dist/{index-01b9db23.js → index-ee3324ae.js} +1 -1
- package/dist/{index.es-9ce4fdd7.js → index.es-3571323f.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{interface-226cc3e0.js → interface-5f71d096.js} +1 -1
- package/dist/{lib-typedarrays-c1439d8d.js → lib-typedarrays-31081346.js} +1 -1
- package/dist/{portis-9112d997.js → portis-9ae053cf.js} +1 -1
- package/dist/{provider-1e6242a3.js → provider-41be4533.js} +1 -1
- package/dist/{rainbow-280f7951.js → rainbow-f05183ef.js} +1 -1
- package/dist/{secp256k1-d403d4c1.js → secp256k1-0e241f29.js} +1 -1
- package/dist/{sha224-34dbb09c.js → sha224-d2d8ace8.js} +1 -1
- package/dist/{sha256-ecf76121.js → sha256-821377ec.js} +1 -1
- package/dist/{typed-data-cfc1152c.js → typed-data-2d531c9d.js} +1 -1
- package/dist/{uAuth-2883581a.js → uAuth-c8a84245.js} +1 -1
- package/dist/{walletConnect-6bf9ed97.js → walletConnect-054fd21b.js} +1 -1
- package/dist/{walletLink-0444bb94.js → walletLink-58d4bd66.js} +1 -1
- package/package.json +1 -1
- package/dist/cjs/id-030fb120.cjs +0 -1
- package/dist/id-155c1875.js +0 -1
|
@@ -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-53533375.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"@ethersproject/bytes";import"buffer";import"@ethersproject/abstract-provider";import"@ethersproject/contracts";import"events";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};
|