@dodoex/wallet-web3 0.0.38-0 → 0.0.38-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.
Files changed (103) hide show
  1. package/dist/DefaultJsonRpcProvider-023db5aa.js +1 -0
  2. package/dist/__node-resolve_empty-7c17bc23.js +1 -0
  3. package/dist/__tslib-84083895.js +1 -0
  4. package/dist/{blocto-a6cd807e.js → blocto-27f059d7.js} +1 -1
  5. package/dist/{bn-9584be28.js → bn-304e1d60.js} +1 -1
  6. package/dist/{browser-ponyfill-ceaf44e7.js → browser-ponyfill-9b4ef8a3.js} +1 -1
  7. package/dist/cjs/DefaultJsonRpcProvider-d29e7762.cjs +1 -0
  8. package/dist/cjs/{__node-resolve_empty-d0feef7d.cjs → __node-resolve_empty-0c1b6176.cjs} +1 -1
  9. package/dist/cjs/__tslib-09b93710.cjs +1 -0
  10. package/dist/cjs/{blocto-0b467bf1.cjs → blocto-e6a7fce9.cjs} +1 -1
  11. package/dist/cjs/{bn-e71fedb4.cjs → bn-c9a77de3.cjs} +1 -1
  12. package/dist/cjs/{browser-ponyfill-a1664394.cjs → browser-ponyfill-9467a437.cjs} +1 -1
  13. package/dist/cjs/{draggabilly-38f552fe.cjs → draggabilly-8693bda7.cjs} +1 -1
  14. package/dist/cjs/ethers-c5c25e89.cjs +1 -0
  15. package/dist/cjs/{id-27693a72.cjs → id-81c0e7d7.cjs} +1 -1
  16. package/dist/cjs/{index-fe5d6c82.cjs → index-39ba7b21.cjs} +2 -2
  17. package/dist/cjs/{index-3c316c68.cjs → index-402a5837.cjs} +1 -1
  18. package/dist/cjs/index-5584f8dd.cjs +1 -0
  19. package/dist/cjs/index-62e0f3ae.cjs +1 -0
  20. package/dist/cjs/index-6c6c6393.cjs +1 -0
  21. package/dist/cjs/index-6f4e58d7.cjs +1 -0
  22. package/dist/cjs/{index-6f572135.cjs → index-71fcb416.cjs} +1 -1
  23. package/dist/cjs/{index-d0b55caa.cjs → index-8ec0d3a5.cjs} +1 -1
  24. package/dist/cjs/{index-a75b8db4.cjs → index-b26f70bb.cjs} +1 -1
  25. package/dist/cjs/index-b7877bf5.cjs +15 -0
  26. package/dist/cjs/index-e102637e.cjs +1 -0
  27. package/dist/cjs/index.cjs +1 -1
  28. package/dist/cjs/{index.es-57126bda.cjs → index.es-f02d698e.cjs} +1 -1
  29. package/dist/cjs/{interface-efbed933.cjs → interface-76605ec5.cjs} +1 -1
  30. package/dist/cjs/{lib-typedarrays-bdd6ebce.cjs → lib-typedarrays-c4a4e3a1.cjs} +1 -1
  31. package/dist/cjs/{portis-b9a4f575.cjs → portis-fd11dffa.cjs} +1 -1
  32. package/dist/cjs/{provider-f35c74b4.cjs → provider-27422952.cjs} +1 -1
  33. package/dist/cjs/providers/baseProvider/DefaultJsonRpcProvider.d.ts +6 -0
  34. package/dist/cjs/providers/connector/cyber/provider.d.ts +1 -1
  35. package/dist/cjs/providers/connector/index.d.ts +2 -3
  36. package/dist/cjs/providers/connector/ledgerUSB/provider.d.ts +1 -1
  37. package/dist/cjs/providers/connector/types.d.ts +1 -0
  38. package/dist/cjs/providers/connector/uniPass/index.d.ts +2 -3
  39. package/dist/cjs/providers/connector/uniPass/provider.d.ts +4 -5
  40. package/dist/cjs/providers/wallets/index.d.ts +1 -0
  41. package/dist/cjs/{rainbow-26ed4a07.cjs → rainbow-bcf73bc1.cjs} +1 -1
  42. package/dist/cjs/{sha224-800bc9c6.cjs → sha224-22adba8e.cjs} +1 -1
  43. package/dist/cjs/{sha256-00851e3c.cjs → sha256-220413fb.cjs} +1 -1
  44. package/dist/cjs/{uAuth-0f14db24.cjs → uAuth-e3589bcb.cjs} +1 -1
  45. package/dist/cjs/{walletConnect-959dd939.cjs → walletConnect-c37e2492.cjs} +1 -1
  46. package/dist/cjs/walletLink-31031b72.cjs +3 -0
  47. package/dist/{draggabilly-b6db4be9.js → draggabilly-cff0507c.js} +1 -1
  48. package/dist/ethers-b4faabe7.js +1 -0
  49. package/dist/{id-12731258.js → id-7a72450a.js} +1 -1
  50. package/dist/{index-3ba69a09.js → index-2b4b285b.js} +2 -2
  51. package/dist/index-2fb9f03f.js +1 -0
  52. package/dist/{index-04e632fc.js → index-3064c150.js} +1 -1
  53. package/dist/index-3226a002.js +1 -0
  54. package/dist/{index-38a87c1d.js → index-3f80ded8.js} +1 -1
  55. package/dist/index-5126a09a.js +1 -0
  56. package/dist/{index-4a2b9fbb.js → index-718b7cea.js} +1 -1
  57. package/dist/index-7582b342.js +1 -0
  58. package/dist/index-85d303fd.js +1 -0
  59. package/dist/index-ae7d3074.js +15 -0
  60. package/dist/{index-fc4c5f68.js → index-cdb272cc.js} +1 -1
  61. package/dist/{index.es-1660ed9f.js → index.es-0a6a3401.js} +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/{interface-6fa31c33.js → interface-500e53e4.js} +1 -1
  64. package/dist/{lib-typedarrays-565397f3.js → lib-typedarrays-a390e948.js} +1 -1
  65. package/dist/{portis-2792bc32.js → portis-9d4b4870.js} +1 -1
  66. package/dist/{provider-e36ba00c.js → provider-ef233626.js} +1 -1
  67. package/dist/providers/baseProvider/DefaultJsonRpcProvider.d.ts +6 -0
  68. package/dist/providers/connector/cyber/provider.d.ts +1 -1
  69. package/dist/providers/connector/index.d.ts +2 -3
  70. package/dist/providers/connector/ledgerUSB/provider.d.ts +1 -1
  71. package/dist/providers/connector/types.d.ts +1 -0
  72. package/dist/providers/connector/uniPass/index.d.ts +2 -3
  73. package/dist/providers/connector/uniPass/provider.d.ts +4 -5
  74. package/dist/providers/wallets/index.d.ts +1 -0
  75. package/dist/{rainbow-3776a80e.js → rainbow-b52120c2.js} +1 -1
  76. package/dist/sha224-c1401791.js +1 -0
  77. package/dist/{sha256-7d953191.js → sha256-e8858cab.js} +1 -1
  78. package/dist/{uAuth-a10134f8.js → uAuth-69094892.js} +1 -1
  79. package/dist/{walletConnect-eb9d73e1.js → walletConnect-d37e0f11.js} +1 -1
  80. package/dist/walletLink-f5c11139.js +3 -0
  81. package/package.json +1 -1
  82. package/dist/__node-resolve_empty-243278fd.js +0 -1
  83. package/dist/__tslib-60be3963.js +0 -1
  84. package/dist/cjs/__tslib-2a3da337.cjs +0 -1
  85. package/dist/cjs/ethers-adc4197a.cjs +0 -1
  86. package/dist/cjs/index-0ad49e37.cjs +0 -1
  87. package/dist/cjs/index-0c56b744.cjs +0 -1
  88. package/dist/cjs/index-2f5278de.cjs +0 -1
  89. package/dist/cjs/index-899ad19f.cjs +0 -1
  90. package/dist/cjs/index-9b2ebee3.cjs +0 -15
  91. package/dist/cjs/index-d2607bc2.cjs +0 -1
  92. package/dist/cjs/typed-data-0687ecc0.cjs +0 -1
  93. package/dist/cjs/walletLink-1658878b.cjs +0 -3
  94. package/dist/ethers-9c12dcb6.js +0 -1
  95. package/dist/index-01560ab9.js +0 -1
  96. package/dist/index-41d286cf.js +0 -15
  97. package/dist/index-530cd3b1.js +0 -1
  98. package/dist/index-603004ab.js +0 -1
  99. package/dist/index-c8a4910b.js +0 -1
  100. package/dist/index-e2797e72.js +0 -1
  101. package/dist/sha224-83ad0b8d.js +0 -1
  102. package/dist/typed-data-947c7b13.js +0 -1
  103. package/dist/walletLink-005dd38f.js +0 -3
@@ -0,0 +1 @@
1
+ import{_ as e,l as r,m as t,n as o,E as n,o as s,p as i,u as d}from"./index-3f80ded8.js";export{q as getIsCyber}from"./index-3f80ded8.js";import{getAddress as a}from"@ethersproject/address";import"events";import{hexlify as c}from"@ethersproject/bytes";import{t as p}from"./id-7a72450a.js";import{T as h}from"./index-2fb9f03f.js";import{Signer as u}from"@ethersproject/abstract-signer";import{D as l}from"./DefaultJsonRpcProvider-023db5aa.js";import{defineReadOnly as m}from"@ethersproject/properties";import"@ethersproject/providers";import"zustand";import"@ethersproject/constants";import"@ethersproject/contracts";import"@ethersproject/transactions";import"./__node-resolve_empty-7c17bc23.js";class v extends u{constructor(e,r,t,o){super(),this._address=r,this._index=null!=t?t:0,this.provider=e,this.app=o}_legacySignMessage(e){throw new Error("Method not implemented.")}sendUncheckedTransaction(e){throw new Error("Method not implemented.")}unlock(e){throw new Error("Method not implemented.")}getAddress(){return e(this,void 0,void 0,(function*(){return Promise.resolve(a(this._address))}))}signMessage(t){return e(this,void 0,void 0,(function*(){const e=r(),o="string"==typeof t?p(t):t,n=yield this.getAddress();return yield e.send("personal_sign",[c(o),n.toLowerCase()])}))}_signTypedData(o,n,s){var i,d;return e(this,void 0,void 0,(function*(){const a=r(),c=yield h.resolveNames(o,n,s,(r=>e(this,void 0,void 0,(function*(){return yield a.resolveName(r)})))),p=null!==(d=null===(i=t())||void 0===i?void 0:i.ownerAddress)&&void 0!==d?d:"";return yield a.send("eth_signTypedData_v4",[p.toLowerCase(),JSON.stringify(h.getPayload(c.domain,n,c.value))])}))}signTransaction(r){return e(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}sendTransaction(r){return e(this,void 0,void 0,(function*(){const e=yield this.getChainId(),t=o(this.app,e);return{hash:yield t.sendTransaction({to:r.to,value:r.value,data:r.data}).catch((e=>{if(e.name===n.SendTransactionError&&(console.error(e.shortMessage),e.shortMessage))throw new Error(e.shortMessage);throw e}))}}))}connect(e){return new v(null!=e?e:this.provider,this._address,this._index,this.app)}connectUnchecked(){return new v(this.provider,this._address,this._index,this.app)}}function f(r,t){return e(this,void 0,void 0,(function*(){const o=yield function({appName:r,appLogoUrl:t,rpcUrl:o,rpc:n,chainId:d,cyberParams:c,JsonRpcProvider:p=l}){return e(this,void 0,void 0,(function*(){if(!r||!t)throw new Error("appName and appLogoUrl is required.");if(!(null==c?void 0:c.appId))throw new Error("cyberParams.appId and appLogoUrl is required.");const{app:h,cyberAccount:u}=yield s({appName:r,appLogoUrl:t,appId:null==c?void 0:c.appId});if(!u)throw new Error("cyberAccount is not valid.");const l=u.address,f=new class extends p{constructor(e,r){super(e,r),this.updateUpWalletConfig=e=>{const r=null==n?void 0:n[e];if(!i.includes(e))throw new Error(`chainId ${e} not supported`);if("object"==typeof this.network)this.network.chainId=e;else{const r={chainId:e,name:"unknown"};m(this,"_network",r),this.emit("network",r,null)}return this.rpcUrl=r,this.emit("chainChanged",`0x${e.toString(16)}`),{result:!0}}}getSigner(){return new v(f,l,0,h)}listAccounts(){return e(this,void 0,void 0,(function*(){return[l]}))}getAddress(){return Promise.resolve(a(l))}}(o,d);return f}))}(r);return o.on("connect",t.connect),o.on("disconnect",t.disconnect),o.on("accountsChanged",t.accountsChanged),o.on("chainChanged",t.chainChanged),o.on("message",t.message),o}))}function g(e){var r;const t=e.addChainParameters.chainId,o="string"==typeof t&&(null==t?void 0:t.startsWith("0x"))?parseInt(t,16):Number(t);if(!i.includes(o))throw new Error(`chainId ${o} not supported`);return null===(r=d.getState().provider)||void 0===r?void 0:r.updateUpWalletConfig(o)}export{f as default,g as switchChain};